Commit a93341f427f831323649f80f2fd986b6f44d5570
1 parent
1f320cd8ac
Exists in
master
and in
6 other branches
智能建档
Showing 12 changed files with 334 additions and 23 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IYunBookBuildingDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/YunBookbuildingDaoImpl.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
- platform-common/src/main/java/com/lyms/platform/common/utils/FileUtil.java
- platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
- platform-dal/src/main/java/com/lyms/platform/pojo/FilePathModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java
- platform-operate-api/src/main/resources/config.properties
- platform-operate-api/src/main/resources/spring/applicationContext-mvc.xml
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IYunBookBuildingDao.java
View file @
a93341f
| 1 | 1 | package com.lyms.platform.biz.dal; |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 4 | +import com.lyms.platform.pojo.FilePathModel; | |
| 4 | 5 | import com.lyms.platform.pojo.Patients; |
| 5 | 6 | |
| 6 | 7 | import java.util.List; |
| ... | ... | @@ -19,5 +20,10 @@ |
| 19 | 20 | public Patients findOneById(String id); |
| 20 | 21 | |
| 21 | 22 | int queryPatientCount(MongoQuery query); |
| 23 | + | |
| 24 | + void addFilePath(FilePathModel filePath); | |
| 25 | + void updateFilePath(FilePathModel obj); | |
| 26 | + | |
| 27 | + FilePathModel findFilePath(String patientId); | |
| 22 | 28 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/YunBookbuildingDaoImpl.java
View file @
a93341f
| ... | ... | @@ -4,7 +4,11 @@ |
| 4 | 4 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 5 | 5 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 6 | 6 | import com.lyms.platform.common.utils.DateUtil; |
| 7 | +import com.lyms.platform.common.utils.MongoConvertHelper; | |
| 8 | +import com.lyms.platform.common.utils.ReflectionUtils; | |
| 7 | 9 | import com.lyms.platform.common.utils.StringUtils; |
| 10 | +import com.lyms.platform.pojo.FilePathModel; | |
| 11 | +import com.lyms.platform.pojo.PatientWeight; | |
| 8 | 12 | import com.mongodb.DBCollection; |
| 9 | 13 | import com.mongodb.DBObject; |
| 10 | 14 | import com.mongodb.MapReduceCommand; |
| ... | ... | @@ -13,6 +17,8 @@ |
| 13 | 17 | import org.springframework.data.mongodb.core.aggregation.AggregationOperation; |
| 14 | 18 | import org.springframework.data.mongodb.core.aggregation.AggregationResults; |
| 15 | 19 | import org.springframework.data.mongodb.core.query.Criteria; |
| 20 | +import org.springframework.data.mongodb.core.query.Query; | |
| 21 | +import org.springframework.data.mongodb.core.query.Update; | |
| 16 | 22 | import org.springframework.stereotype.Repository; |
| 17 | 23 | |
| 18 | 24 | import com.lyms.platform.biz.dal.IYunBookBuildingDao; |
| ... | ... | @@ -39,6 +45,23 @@ |
| 39 | 45 | @Override |
| 40 | 46 | public int queryPatientCount(MongoQuery query) { |
| 41 | 47 | return (int) count(query.convertToMongoQuery()); |
| 48 | + } | |
| 49 | + | |
| 50 | + @Override | |
| 51 | + public void addFilePath(FilePathModel filePath) { | |
| 52 | + mongoTemplate.insert(filePath); | |
| 53 | + } | |
| 54 | + | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + public void updateFilePath(FilePathModel obj) { | |
| 58 | + Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(obj)); | |
| 59 | + mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(obj.getId())), update, FilePathModel.class); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public FilePathModel findFilePath(String patientId) { | |
| 64 | + return mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientId)),FilePathModel.class); | |
| 42 | 65 | } |
| 43 | 66 | |
| 44 | 67 | @Override |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/YunBookbuildingService.java
View file @
a93341f
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 5 | 5 | import com.lyms.platform.common.enums.YnEnums; |
| 6 | 6 | import com.lyms.platform.pojo.AntExChuModel; |
| 7 | +import com.lyms.platform.pojo.FilePathModel; | |
| 7 | 8 | import com.lyms.platform.query.AntExChuQuery; |
| 8 | 9 | import com.lyms.platform.query.PatientsQuery; |
| 9 | 10 | import org.apache.commons.lang.StringUtils; |
| ... | ... | @@ -78,6 +79,19 @@ |
| 78 | 79 | |
| 79 | 80 | public List<String> getBirthHusbands(String dateStr) { |
| 80 | 81 | return yunBookBuildingDao.getBirthHusbands(dateStr); |
| 82 | + } | |
| 83 | + | |
| 84 | + public void addFilePath(FilePathModel filePath) { | |
| 85 | + yunBookBuildingDao.addFilePath(filePath); | |
| 86 | + } | |
| 87 | + | |
| 88 | + public void updateFilePath(FilePathModel filePath) { | |
| 89 | + yunBookBuildingDao.updateFilePath(filePath); | |
| 90 | + } | |
| 91 | + | |
| 92 | + public FilePathModel findFilePath(String patientId) { | |
| 93 | + | |
| 94 | + return yunBookBuildingDao.findFilePath(patientId); | |
| 81 | 95 | } |
| 82 | 96 | } |
platform-common/src/main/java/com/lyms/platform/common/utils/FileUtil.java
View file @
a93341f
| ... | ... | @@ -30,6 +30,27 @@ |
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | + /** | |
| 34 | + * 判断是否为允许的上传文件类型,true表示允许 | |
| 35 | + */ | |
| 36 | + public static boolean checkFile(String fileName) { | |
| 37 | + //设置允许上传文件类型 | |
| 38 | + String suffixList = "jpg,gif,png,ico,bmp,jpeg"; | |
| 39 | + // 获取文件后缀 | |
| 40 | + String suffix = getFileSuffix(fileName); | |
| 41 | + if (suffixList.contains(suffix.trim().toLowerCase())) { | |
| 42 | + return true; | |
| 43 | + } | |
| 44 | + return false; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public static String getFileSuffix(String fileName) | |
| 48 | + { | |
| 49 | + // 获取文件后缀 | |
| 50 | + return fileName.substring(fileName.lastIndexOf(".") | |
| 51 | + + 1, fileName.length()); | |
| 52 | + } | |
| 53 | + | |
| 33 | 54 | public static void main(String[] args) throws IOException { |
| 34 | 55 | getFileItem(); |
| 35 | 56 | } |
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
View file @
a93341f
| ... | ... | @@ -11,6 +11,7 @@ |
| 11 | 11 | AntExRecordModel("AntExRecordModel", 97531000030L), |
| 12 | 12 | ArchiveData("ArchiveData", 97531000040L), |
| 13 | 13 | AssayConfig("AssayConfig", 97531000050L), |
| 14 | + FilePathModel("FilePathModel", 97233000050L), | |
| 14 | 15 | AwModel("AwModel", 97531000060L), |
| 15 | 16 | BabyCheckModel("BabyCheckModel", 97531000070L), |
| 16 | 17 | BabyModel("BabyModel", 97531000080L), |
platform-dal/src/main/java/com/lyms/platform/pojo/FilePathModel.java
View file @
a93341f
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import com.lyms.platform.beans.SerialIdEnum; | |
| 4 | +import com.lyms.platform.common.enums.TrackDownDateEnums; | |
| 5 | +import com.lyms.platform.common.result.BaseModel; | |
| 6 | +import com.lyms.platform.common.utils.DateUtil; | |
| 7 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 8 | +import org.springframework.data.mongodb.core.mapping.Field; | |
| 9 | + | |
| 10 | +import java.util.Date; | |
| 11 | +import java.util.List; | |
| 12 | +import java.util.Objects; | |
| 13 | + | |
| 14 | + | |
| 15 | +@Document(collection="lyms_file_path") | |
| 16 | +public class FilePathModel extends BaseModel { | |
| 17 | + | |
| 18 | + private static final long serialVersionUID = SerialIdEnum.FilePathModel.getCid(); | |
| 19 | + | |
| 20 | + | |
| 21 | + private String id; | |
| 22 | + | |
| 23 | + //孕妇建档id | |
| 24 | + private String patientId; | |
| 25 | + | |
| 26 | + //身份证正面 | |
| 27 | + private String cardNoz; | |
| 28 | + //身份证反面 | |
| 29 | + private String cardNof; | |
| 30 | + | |
| 31 | + //户主信息 | |
| 32 | + private String registerHouse; | |
| 33 | + | |
| 34 | + //孕妇信息 | |
| 35 | + private String registerPatient; | |
| 36 | + | |
| 37 | + //面部信息 | |
| 38 | + private String facePatient; | |
| 39 | + | |
| 40 | + public String getId() { | |
| 41 | + return id; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public void setId(String id) { | |
| 45 | + this.id = id; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public String getPatientId() { | |
| 49 | + return patientId; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public void setPatientId(String patientId) { | |
| 53 | + this.patientId = patientId; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public String getCardNoz() { | |
| 57 | + return cardNoz; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setCardNoz(String cardNoz) { | |
| 61 | + this.cardNoz = cardNoz; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public String getCardNof() { | |
| 65 | + return cardNof; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setCardNof(String cardNof) { | |
| 69 | + this.cardNof = cardNof; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public String getRegisterHouse() { | |
| 73 | + return registerHouse; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setRegisterHouse(String registerHouse) { | |
| 77 | + this.registerHouse = registerHouse; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public String getRegisterPatient() { | |
| 81 | + return registerPatient; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setRegisterPatient(String registerPatient) { | |
| 85 | + this.registerPatient = registerPatient; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public String getFacePatient() { | |
| 89 | + return facePatient; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setFacePatient(String facePatient) { | |
| 93 | + this.facePatient = facePatient; | |
| 94 | + } | |
| 95 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java
View file @
a93341f
| ... | ... | @@ -23,9 +23,11 @@ |
| 23 | 23 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 24 | 24 | import org.springframework.stereotype.Controller; |
| 25 | 25 | import org.springframework.web.bind.annotation.*; |
| 26 | +import org.springframework.web.multipart.MultipartFile; | |
| 26 | 27 | |
| 27 | 28 | import javax.servlet.http.HttpServletRequest; |
| 28 | 29 | import javax.servlet.http.HttpServletResponse; |
| 30 | +import java.io.File; | |
| 29 | 31 | import java.io.IOException; |
| 30 | 32 | import java.io.UnsupportedEncodingException; |
| 31 | 33 | import java.net.URLEncoder; |
| ... | ... | @@ -58,7 +60,7 @@ |
| 58 | 60 | @RequestParam(required = true) String certNo, |
| 59 | 61 | @RequestParam(required = true) String hospitalId, |
| 60 | 62 | @RequestParam(required = true) Integer valueType) { |
| 61 | - return bookbuildingFacade.getPatientBuildId(certType,certNo,hospitalId,valueType); | |
| 63 | + return bookbuildingFacade.getPatientBuildId(certType, certNo, hospitalId, valueType); | |
| 62 | 64 | } |
| 63 | 65 | |
| 64 | 66 | /** |
| ... | ... | @@ -95,7 +97,7 @@ |
| 95 | 97 | return bookbuildingFacade.updatePregnantById(yunBookbuildingAddRequest.getId(), yunBookbuildingAddRequest,loginState.getId()); |
| 96 | 98 | |
| 97 | 99 | } |
| 98 | - BaseObjectResponse p = bookbuildingFacade.addPregnantBookbuilding(yunBookbuildingAddRequest,loginState.getId()); | |
| 100 | + BaseObjectResponse p = bookbuildingFacade.addPregnantBookbuilding(yunBookbuildingAddRequest, loginState.getId()); | |
| 99 | 101 | return p; |
| 100 | 102 | } |
| 101 | 103 | |
| ... | ... | @@ -185,7 +187,7 @@ |
| 185 | 187 | AntenatalExaminationQueryRequest antenatalExaminationQueryRequest = new AntenatalExaminationQueryRequest(); |
| 186 | 188 | antenatalExaminationQueryRequest.setPatientId(id); |
| 187 | 189 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 188 | - return antenatalExaminationFacade.queryAntenatalExamination(antenatalExaminationQueryRequest,loginState.getId()); | |
| 190 | + return antenatalExaminationFacade.queryAntenatalExamination(antenatalExaminationQueryRequest, loginState.getId()); | |
| 189 | 191 | } |
| 190 | 192 | |
| 191 | 193 | /** |
| ... | ... | @@ -197,7 +199,7 @@ |
| 197 | 199 | @TokenRequired |
| 198 | 200 | public BaseResponse queryLatePregnant(HttpServletRequest request,@RequestParam("parentId")String parentId){ |
| 199 | 201 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 200 | - return bookbuildingFacade.findPatientById(parentId,loginState.getId()); | |
| 202 | + return bookbuildingFacade.findPatientById(parentId, loginState.getId()); | |
| 201 | 203 | } |
| 202 | 204 | |
| 203 | 205 | |
| ... | ... | @@ -221,7 +223,7 @@ |
| 221 | 223 | @TokenRequired |
| 222 | 224 | public BaseObjectResponse queryYunBuildInfo(HttpServletRequest request,@RequestParam(required = false) String cardNo,@RequestParam(required = false) String vcCardNo){ |
| 223 | 225 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 224 | - BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,vcCardNo,loginState.getId()); | |
| 226 | + BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo, vcCardNo, loginState.getId()); | |
| 225 | 227 | return objectResponse; |
| 226 | 228 | } |
| 227 | 229 | |
| ... | ... | @@ -532,6 +534,32 @@ |
| 532 | 534 | } |
| 533 | 535 | |
| 534 | 536 | |
| 537 | + /** | |
| 538 | + * 图片上次 | |
| 539 | + * @param request | |
| 540 | + * @param file | |
| 541 | + * @return | |
| 542 | + * @throws Exception | |
| 543 | + */ | |
| 544 | + @RequestMapping(value="/uploadImg",method=RequestMethod.POST) | |
| 545 | + @ResponseBody | |
| 546 | +// @TokenRequired | |
| 547 | + public BaseResponse upload(HttpServletRequest request, | |
| 548 | + @RequestParam("file") MultipartFile file) throws Exception { | |
| 549 | + | |
| 550 | + return bookbuildingFacade.uploadImg(file); | |
| 551 | + | |
| 552 | + } | |
| 553 | + | |
| 554 | +// @RequestMapping(value="/deleteImg",method=RequestMethod.GET) | |
| 555 | +// @ResponseBody | |
| 556 | +//// @TokenRequired | |
| 557 | +// public BaseResponse deleteImg(HttpServletRequest request, | |
| 558 | +// @RequestParam("filePath") String filePath) throws Exception { | |
| 559 | +// | |
| 560 | +// return bookbuildingFacade.deleteImg(filePath); | |
| 561 | +// | |
| 562 | +// } | |
| 535 | 563 | |
| 536 | 564 | |
| 537 | 565 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
a93341f
| ... | ... | @@ -43,8 +43,11 @@ |
| 43 | 43 | import org.springframework.data.mongodb.core.query.Query; |
| 44 | 44 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| 45 | 45 | import org.springframework.stereotype.Component; |
| 46 | +import org.springframework.web.multipart.MultipartFile; | |
| 46 | 47 | |
| 47 | 48 | import javax.servlet.http.HttpServletResponse; |
| 49 | +import java.io.File; | |
| 50 | +import java.io.IOException; | |
| 48 | 51 | import java.io.OutputStream; |
| 49 | 52 | import java.util.*; |
| 50 | 53 | |
| ... | ... | @@ -57,6 +60,7 @@ |
| 57 | 60 | private Logger logger = LoggerFactory.getLogger(BookbuildingFacade.class); |
| 58 | 61 | |
| 59 | 62 | public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version"); |
| 63 | + public static final String BASE_IMG_PATH = PropertiesUtils.getPropertyValue("img_path"); | |
| 60 | 64 | |
| 61 | 65 | @Autowired |
| 62 | 66 | private YunBookbuildingService yunBookbuildingService; |
| ... | ... | @@ -390,6 +394,7 @@ |
| 390 | 394 | |
| 391 | 395 | |
| 392 | 396 | final Patients tempP = p; |
| 397 | + final FilePathModel filePath = yunRequest.getFilePath(); | |
| 393 | 398 | commonThreadPool.execute(new Runnable() { |
| 394 | 399 | @Override |
| 395 | 400 | public void run() { |
| ... | ... | @@ -403,6 +408,12 @@ |
| 403 | 408 | Date endDate = DateUtil.addDay(new Date(), 1); |
| 404 | 409 | qhdfyFmService.syncByCardNo(DateUtil.getyyyy_MM_dd(startDate),DateUtil.getyyyy_MM_dd(endDate),tempP.getCardNo()); |
| 405 | 410 | } |
| 411 | + if (filePath != null && filePath.getId() == null) | |
| 412 | + { | |
| 413 | + filePath.setPatientId(tempP.getId()); | |
| 414 | + yunBookbuildingService.addFilePath(filePath); | |
| 415 | + } | |
| 416 | + | |
| 406 | 417 | } |
| 407 | 418 | }); |
| 408 | 419 | |
| ... | ... | @@ -876,6 +887,19 @@ |
| 876 | 887 | } |
| 877 | 888 | Patients patients = patientsService.findOnePatientById(id); |
| 878 | 889 | updateAntExLastMenses(patients.getLastMenses(), patients.getPid(), patients.getBookbuildingDate()); |
| 890 | + | |
| 891 | + FilePathModel filePath = yunRequest.getFilePath(); | |
| 892 | + if (filePath != null && filePath.getId() != null) | |
| 893 | + { | |
| 894 | + yunBookbuildingService.updateFilePath(filePath); | |
| 895 | + } | |
| 896 | + | |
| 897 | + List<String> delFiles = yunRequest.getDelFiles(); | |
| 898 | + if (CollectionUtils.isNotEmpty(delFiles)) | |
| 899 | + { | |
| 900 | + deleteImg(delFiles); | |
| 901 | + } | |
| 902 | + | |
| 879 | 903 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 880 | 904 | } |
| 881 | 905 | |
| ... | ... | @@ -2027,6 +2051,50 @@ |
| 2027 | 2051 | } |
| 2028 | 2052 | } |
| 2029 | 2053 | return patientId; |
| 2054 | + } | |
| 2055 | + | |
| 2056 | + public BaseResponse uploadImg(MultipartFile file) { | |
| 2057 | + //如果文件不为空,写入上传路径 | |
| 2058 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 2059 | + if(file.isEmpty()) { | |
| 2060 | + objectResponse.setErrorcode(ErrorCodeConstants.NO_DATA); | |
| 2061 | + objectResponse.setErrormsg("没有上传数据"); | |
| 2062 | + return objectResponse; | |
| 2063 | + } | |
| 2064 | + try { | |
| 2065 | + | |
| 2066 | + String imgPath = DateUtil.getYmd(new Date()); | |
| 2067 | + String filename = StringUtils.uuid()+"."+FileUtil.getFileSuffix(file.getOriginalFilename()); | |
| 2068 | + | |
| 2069 | + File filepath = new File(BASE_IMG_PATH+File.separator+imgPath,filename); | |
| 2070 | + //判断路径是否存在,如果不存在就创建一个 | |
| 2071 | + if (!filepath.getParentFile().exists()) { | |
| 2072 | + filepath.getParentFile().mkdirs(); | |
| 2073 | + } | |
| 2074 | + file.transferTo(filepath); | |
| 2075 | + objectResponse.setData(imgPath + "/" + filename); | |
| 2076 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 2077 | + objectResponse.setErrormsg("成功"); | |
| 2078 | + return objectResponse; | |
| 2079 | + } catch (IOException e) { | |
| 2080 | + ExceptionUtils.catchException(e,"上传文件发生异常"); | |
| 2081 | + objectResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
| 2082 | + objectResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); | |
| 2083 | + return objectResponse; | |
| 2084 | + } | |
| 2085 | + | |
| 2086 | + } | |
| 2087 | + | |
| 2088 | + public void deleteImg(List<String> delFiles) { | |
| 2089 | + | |
| 2090 | + for (String filePath : delFiles) | |
| 2091 | + { | |
| 2092 | + File filepath = new File(BASE_IMG_PATH+File.separator+filePath); | |
| 2093 | + if (filepath.exists()) | |
| 2094 | + { | |
| 2095 | + filepath.delete(); | |
| 2096 | + } | |
| 2097 | + } | |
| 2030 | 2098 | } |
| 2031 | 2099 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
a93341f
| ... | ... | @@ -256,6 +256,10 @@ |
| 256 | 256 | /** 优惠券编号 */ |
| 257 | 257 | map.put("couponCode", couponService.findByUsedId(id)); |
| 258 | 258 | |
| 259 | + FilePathModel filePath = yunBookbuildingService.findFilePath(id); | |
| 260 | + | |
| 261 | + map.put("filePath", filePath); | |
| 262 | + | |
| 259 | 263 | return map; |
| 260 | 264 | } |
| 261 | 265 | |
| 262 | 266 | |
| 263 | 267 | |
| 264 | 268 | |
| 265 | 269 | |
| 266 | 270 | |
| 267 | 271 | |
| ... | ... | @@ -4362,29 +4366,43 @@ |
| 4362 | 4366 | patientMap.put("maddress",CommonsHelper.getResidence(pat.getProvinceId(), pat.getCityId(), |
| 4363 | 4367 | pat.getAreaId(), pat.getStreetId(), pat.getAddress(), basicConfigService));//母亲户籍地址 |
| 4364 | 4368 | |
| 4369 | + if (StringUtils.isNotEmpty(pat.getHusbandName())) | |
| 4370 | + { | |
| 4371 | + patientMap.put("fname",StringUtils.isNotEmpty(pat.getHusbandName()) ? pat.getHusbandName() : "");//父亲姓名 | |
| 4365 | 4372 | |
| 4366 | - patientMap.put("fname",StringUtils.isNotEmpty(pat.getHusbandName()) ? pat.getHusbandName() : "");//父亲姓名 | |
| 4373 | + patientMap.put("fcountry",getBasicConfig(pat.getHcountryId()));//父亲国籍 | |
| 4374 | + patientMap.put("fnation",getBasicConfig(pat.getHnationId()));//父亲民族 | |
| 4375 | + String fbirthday = ""; | |
| 4376 | + if (StringUtils.isNotEmpty(pat.getHcertificateTypeId()) && StringUtils.isNotEmpty(pat.getHcertificateNum()) && | |
| 4377 | + pat.getHcertificateNum().length() == 18 && | |
| 4378 | + "70ae1d93-2964-46bc-83fa-bec9ff605b1c".equals(pat.getHcertificateTypeId())) { | |
| 4379 | + String cardNo = pat.getHcertificateNum().substring(6, 14); | |
| 4380 | + Date date = DateUtil.parseYYYYMMDD(cardNo); | |
| 4381 | + fbirthday = DateUtil.getyyyy_MM_dd(date); | |
| 4382 | + } | |
| 4367 | 4383 | |
| 4368 | - patientMap.put("fcountry",getBasicConfig(pat.getHcountryId()));//父亲国籍 | |
| 4369 | - patientMap.put("fnation",getBasicConfig(pat.getHnationId()));//父亲民族 | |
| 4370 | - String fbirthday = ""; | |
| 4371 | - if (StringUtils.isNotEmpty(pat.getHcertificateTypeId()) && StringUtils.isNotEmpty(pat.getHcertificateNum()) && | |
| 4372 | - pat.getHcertificateNum().length() == 18 && | |
| 4373 | - "70ae1d93-2964-46bc-83fa-bec9ff605b1c".equals(pat.getHcertificateTypeId())) { | |
| 4374 | - String cardNo = pat.getHcertificateNum().substring(6, 14); | |
| 4375 | - Date date = DateUtil.parseYYYYMMDD(cardNo); | |
| 4376 | - fbirthday = DateUtil.getyyyy_MM_dd(date); | |
| 4377 | - } | |
| 4384 | + patientMap.put("fbirthday",fbirthday);//父亲出生日期 | |
| 4385 | + patientMap.put("fcardtype",getBasicConfig(pat.getHcertificateTypeId()));//父亲证件类型 | |
| 4378 | 4386 | |
| 4379 | - patientMap.put("fbirthday",fbirthday);//父亲出生日期 | |
| 4380 | - patientMap.put("fcardtype",getBasicConfig(pat.getHcertificateTypeId()));//父亲证件类型 | |
| 4381 | 4387 | |
| 4388 | + patientMap.put("fcardnum",StringUtils.isNotEmpty(pat.getHcertificateNum()) ? pat.getHcertificateNum() : "");//父亲证件号码 | |
| 4389 | + patientMap.put("faddress",CommonsHelper.getResidence(pat.getHprovinceRegisterId(), pat.getHcityRegisterId(), | |
| 4390 | + pat.getHareaRegisterId(), pat.getHstreetRegisterId(), pat.getHaddressRegister(), | |
| 4391 | + basicConfigService));//父亲户籍地址 | |
| 4392 | + } | |
| 4393 | + else | |
| 4394 | + { | |
| 4395 | + patientMap.put("fname","");//父亲姓名 | |
| 4396 | + patientMap.put("fcountry","");//父亲国籍 | |
| 4397 | + patientMap.put("fnation","");//父亲民族 | |
| 4398 | + patientMap.put("fbirthday","");//父亲出生日期 | |
| 4399 | + patientMap.put("fcardtype","");//父亲证件类型 | |
| 4400 | + patientMap.put("fcardnum","");//父亲证件号码 | |
| 4401 | + patientMap.put("faddress","");//父亲户籍地址 | |
| 4402 | + } | |
| 4382 | 4403 | |
| 4383 | - patientMap.put("fcardnum",StringUtils.isNotEmpty(pat.getHcertificateNum()) ? pat.getHcertificateNum() : "");//父亲证件号码 | |
| 4384 | - patientMap.put("faddress",CommonsHelper.getResidence(pat.getHprovinceRegisterId(), pat.getHcityRegisterId(), | |
| 4385 | - pat.getHareaRegisterId(), pat.getHstreetRegisterId(), pat.getHaddressRegister(), | |
| 4386 | - basicConfigService));//父亲户籍地址 | |
| 4387 | 4404 | |
| 4405 | + | |
| 4388 | 4406 | Organization organization = null; |
| 4389 | 4407 | String fmHospital = ""; |
| 4390 | 4408 | if (StringUtils.isNotEmpty(datas.get(0).getFmHospital())) { |
| ... | ... | @@ -4487,7 +4505,7 @@ |
| 4487 | 4505 | |
| 4488 | 4506 | |
| 4489 | 4507 | if (StringUtils.isNotEmpty(data.getFmHospital()) && com.lyms.platform.common.utils.StringUtils.isNum(data.getFmHospital())) { |
| 4490 | - organization = organizationService.getOrganization(Integer.parseInt(pat.getFmHospital())); | |
| 4508 | + organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital())); | |
| 4491 | 4509 | } |
| 4492 | 4510 | |
| 4493 | 4511 | String babyprovince = ""; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java
View file @
a93341f
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.core.annotation.form.Form; |
| 4 | 4 | import com.lyms.platform.common.core.annotation.form.FormParam; |
| 5 | +import com.lyms.platform.pojo.FilePathModel; | |
| 5 | 6 | import org.hibernate.validator.constraints.NotEmpty; |
| 6 | 7 | |
| 7 | 8 | import java.util.List; |
| ... | ... | @@ -32,6 +33,26 @@ |
| 32 | 33 | private Boolean reqHusband; |
| 33 | 34 | //是否发放母子保健手册 |
| 34 | 35 | private String sendCareMan; |
| 36 | + | |
| 37 | + private FilePathModel filePath; | |
| 38 | + //删除文件路径 | |
| 39 | + private List<String> delFiles; | |
| 40 | + | |
| 41 | + public List<String> getDelFiles() { | |
| 42 | + return delFiles; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setDelFiles(List<String> delFiles) { | |
| 46 | + this.delFiles = delFiles; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public FilePathModel getFilePath() { | |
| 50 | + return filePath; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setFilePath(FilePathModel filePath) { | |
| 54 | + this.filePath = filePath; | |
| 55 | + } | |
| 35 | 56 | |
| 36 | 57 | public String getSendCareMan() { |
| 37 | 58 | return sendCareMan; |
platform-operate-api/src/main/resources/config.properties
View file @
a93341f
platform-operate-api/src/main/resources/spring/applicationContext-mvc.xml
View file @
a93341f
| ... | ... | @@ -41,5 +41,17 @@ |
| 41 | 41 | <bean class="com.lymsh.mommybaby.operateapi.inteceptor.PermissionValidateInteceptor"/>--> |
| 42 | 42 | </mvc:interceptors> |
| 43 | 43 | |
| 44 | + | |
| 45 | + <bean id="multipartResolver" | |
| 46 | + class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> | |
| 47 | + <!-- 上传文件大小上限,单位为字节(10MB) --> | |
| 48 | + <property name="maxUploadSize"> | |
| 49 | + <value>10485760</value> | |
| 50 | + </property> | |
| 51 | + <property name="defaultEncoding"> | |
| 52 | + <value>UTF-8</value> | |
| 53 | + </property> | |
| 54 | + </bean> | |
| 55 | + | |
| 44 | 56 | </beans> |