Commit c1402bbe5410beaee86fe18a6d097bb75e7b5d0f
1 parent
ee9579b411
Exists in
master
and in
6 other branches
出生证明儿童建档
Showing 7 changed files with 209 additions and 8 deletions
- platform-msg-generate/src/main/java/com/lyms/platform/msg/utils/DateUtils.java
- platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/BabyDiseaseMsgGenerateWorker.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/CertBabyResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/ICommonServer.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CommonServerImpl.java
- platform-operate-api/src/main/resources/config.properties
platform-msg-generate/src/main/java/com/lyms/platform/msg/utils/DateUtils.java
View file @
c1402bb
| 1 | 1 | package com.lyms.platform.msg.utils; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.common.utils.DateUtil; | |
| 3 | 4 | import org.slf4j.Logger; |
| 4 | 5 | import org.slf4j.LoggerFactory; |
| 5 | 6 | |
| ... | ... | @@ -231,7 +232,8 @@ |
| 231 | 232 | return Math.abs(result); |
| 232 | 233 | } |
| 233 | 234 | public static void main(String[] args) { |
| 234 | - System.out.println( getWeekOfDate(new Date())); | |
| 235 | + System.out.println(DateUtil.getyyyy_MM_dd(DateUtil.addDay(new Date(),33))); | |
| 236 | + System.out.println(DateUtil.daysBetween(DateUtil.addDay(DateUtil.addDay(new Date(),33),-33),new Date())); | |
| 235 | 237 | } |
| 236 | 238 | } |
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/BabyDiseaseMsgGenerateWorker.java
View file @
c1402bb
| ... | ... | @@ -136,10 +136,10 @@ |
| 136 | 136 | { |
| 137 | 137 | for (MessageContent message : amsSmses) |
| 138 | 138 | { |
| 139 | -// boolean isExist = SaveMessageService.isExistMsg(baby.getId(), message.getId()); | |
| 140 | -// if (isExist) { | |
| 141 | -// continue; | |
| 142 | -// } | |
| 139 | + boolean isExist = SaveMessageService.isExistMsg(baby.getId(), message.getId()); | |
| 140 | + if (isExist) { | |
| 141 | + continue; | |
| 142 | + } | |
| 143 | 143 | //开通一个月 按照ams短信配置的天数来发送 |
| 144 | 144 | if ("1".equals(baby.getOpenDiseaseType())) |
| 145 | 145 | { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
c1402bb
| ... | ... | @@ -21,6 +21,7 @@ |
| 21 | 21 | import com.lyms.platform.operate.web.request.*; |
| 22 | 22 | import com.lyms.platform.operate.web.result.*; |
| 23 | 23 | import com.lyms.platform.operate.web.service.BabyAfterVisitService; |
| 24 | +import com.lyms.platform.operate.web.service.ICommonServer; | |
| 24 | 25 | import com.lyms.platform.operate.web.service.ITrackDownService; |
| 25 | 26 | import com.lyms.platform.operate.web.utils.*; |
| 26 | 27 | import com.lyms.platform.permission.model.*; |
| 27 | 28 | |
| ... | ... | @@ -105,7 +106,11 @@ |
| 105 | 106 | @Autowired |
| 106 | 107 | private PatientsService patientsService; |
| 107 | 108 | |
| 109 | + | |
| 108 | 110 | @Autowired |
| 111 | + private ICommonServer commonServer; | |
| 112 | + | |
| 113 | + @Autowired | |
| 109 | 114 | private MatDeliverService matDeliverService; |
| 110 | 115 | |
| 111 | 116 | @Autowired |
| 112 | 117 | |
| ... | ... | @@ -2051,7 +2056,15 @@ |
| 2051 | 2056 | results.add(result); |
| 2052 | 2057 | } |
| 2053 | 2058 | } |
| 2059 | + else | |
| 2060 | + { | |
| 2061 | + if ("2100001377".equals(param.getHospitalId())) | |
| 2062 | + { | |
| 2063 | + //查询出生证明的儿童信息用于建档, | |
| 2064 | + map.put("certBabyInfo", getCertBabyInfo(param.getCardNo())); | |
| 2065 | + } | |
| 2054 | 2066 | |
| 2067 | + } | |
| 2055 | 2068 | puerperaQuery.setPhoneOrCert(param.getCardNo()); |
| 2056 | 2069 | } else if ((param.getHospitalId() != null & !StringUtils.isEmpty(param.getVcCardNo())) |
| 2057 | 2070 | || StringUtils.isNotEmpty(param.getEncoded()) //编码 |
| ... | ... | @@ -2258,6 +2271,19 @@ |
| 2258 | 2271 | objectResponse.setErrormsg("成功"); |
| 2259 | 2272 | return objectResponse; |
| 2260 | 2273 | } |
| 2274 | + | |
| 2275 | + | |
| 2276 | + /** | |
| 2277 | + * 获取出生证明儿童信息用于建档 | |
| 2278 | + * @param cardNo | |
| 2279 | + * @return | |
| 2280 | + */ | |
| 2281 | + private List<CertBabyResult> getCertBabyInfo(String cardNo) | |
| 2282 | + { | |
| 2283 | + List<CertBabyResult> list = commonServer.getBabyInfoByCardNo(cardNo); | |
| 2284 | + return list; | |
| 2285 | + } | |
| 2286 | + | |
| 2261 | 2287 | |
| 2262 | 2288 | /** |
| 2263 | 2289 | * 秦皇岛儿童建档要求使用编码可以查询到档案信息,保存那会只给lyms_baby加编码了所以这里先查 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/CertBabyResult.java
View file @
c1402bb
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Created by Administrator on 2020-11-17. | |
| 5 | + */ | |
| 6 | +public class CertBabyResult { | |
| 7 | + | |
| 8 | + private String babyName;//儿童姓名 | |
| 9 | + private String babySex;//儿童性别 | |
| 10 | + private String babyBirth;//儿童生日 | |
| 11 | + private String cardNo;//母亲身份证 | |
| 12 | + private String mname;//母亲姓名 | |
| 13 | + private String mphone;//母亲手机号码 | |
| 14 | + private String fname;//父亲姓名 | |
| 15 | + private String fcardNo;//父亲身份证号码 | |
| 16 | + //private String mfolk;//母亲名族 | |
| 17 | + private String pregweek;//分娩孕周 | |
| 18 | + private String pregday;//分娩天数 | |
| 19 | + private String weight;//体重 | |
| 20 | + private String height;//身高 | |
| 21 | + private String birthDept;//分娩医院 | |
| 22 | + | |
| 23 | + public String getBabyName() { | |
| 24 | + return babyName; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public void setBabyName(String babyName) { | |
| 28 | + this.babyName = babyName; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public String getBabySex() { | |
| 32 | + return babySex; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void setBabySex(String babySex) { | |
| 36 | + this.babySex = babySex; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public String getBabyBirth() { | |
| 40 | + return babyBirth; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setBabyBirth(String babyBirth) { | |
| 44 | + this.babyBirth = babyBirth; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public String getCardNo() { | |
| 48 | + return cardNo; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setCardNo(String cardNo) { | |
| 52 | + this.cardNo = cardNo; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public String getMname() { | |
| 56 | + return mname; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setMname(String mname) { | |
| 60 | + this.mname = mname; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public String getMphone() { | |
| 64 | + return mphone; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setMphone(String mphone) { | |
| 68 | + this.mphone = mphone; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getFname() { | |
| 72 | + return fname; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setFname(String fname) { | |
| 76 | + this.fname = fname; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getFcardNo() { | |
| 80 | + return fcardNo; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setFcardNo(String fcardNo) { | |
| 84 | + this.fcardNo = fcardNo; | |
| 85 | + } | |
| 86 | +// | |
| 87 | +// public String getMfolk() { | |
| 88 | +// return mfolk; | |
| 89 | +// } | |
| 90 | +// | |
| 91 | +// public void setMfolk(String mfolk) { | |
| 92 | +// this.mfolk = mfolk; | |
| 93 | +// } | |
| 94 | + | |
| 95 | + public String getPregweek() { | |
| 96 | + return pregweek; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setPregweek(String pregweek) { | |
| 100 | + this.pregweek = pregweek; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public String getPregday() { | |
| 104 | + return pregday; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setPregday(String pregday) { | |
| 108 | + this.pregday = pregday; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public String getWeight() { | |
| 112 | + return weight; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setWeight(String weight) { | |
| 116 | + this.weight = weight; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public String getHeight() { | |
| 120 | + return height; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setHeight(String height) { | |
| 124 | + this.height = height; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public String getBirthDept() { | |
| 128 | + return birthDept; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void setBirthDept(String birthDept) { | |
| 132 | + this.birthDept = birthDept; | |
| 133 | + } | |
| 134 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/ICommonServer.java
View file @
c1402bb
| ... | ... | @@ -2,7 +2,10 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.common.result.BaseResponse; |
| 4 | 4 | import com.lyms.platform.operate.web.request.CommonRequest; |
| 5 | +import com.lyms.platform.operate.web.result.CertBabyResult; | |
| 5 | 6 | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 6 | 9 | public interface ICommonServer { |
| 7 | 10 | |
| 8 | 11 | |
| ... | ... | @@ -37,5 +40,11 @@ |
| 37 | 40 | BaseResponse queryKidsInfo(String cardNo); |
| 38 | 41 | |
| 39 | 42 | |
| 43 | + /** | |
| 44 | + * 从出生证明获取儿童档案信息 | |
| 45 | + * @param cardNo | |
| 46 | + * @return | |
| 47 | + */ | |
| 48 | + List<CertBabyResult> getBabyInfoByCardNo(String cardNo); | |
| 40 | 49 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CommonServerImpl.java
View file @
c1402bb
| ... | ... | @@ -5,7 +5,10 @@ |
| 5 | 5 | import com.lyms.platform.common.enums.SexEnum; |
| 6 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 7 | 7 | import com.lyms.platform.common.result.ResponseCode; |
| 8 | +import com.lyms.platform.common.utils.*; | |
| 9 | +import com.lyms.platform.operate.web.result.CertBabyResult; | |
| 8 | 10 | import com.lyms.platform.pojo.*; |
| 11 | +import net.sf.json.JSONObject; | |
| 9 | 12 | import org.slf4j.Logger; |
| 10 | 13 | import org.slf4j.LoggerFactory; |
| 11 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -18,8 +21,6 @@ |
| 18 | 21 | import com.lyms.platform.biz.service.BasicConfigService; |
| 19 | 22 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 20 | 23 | import com.lyms.platform.common.result.BaseResponse; |
| 21 | -import com.lyms.platform.common.utils.DateUtil; | |
| 22 | -import com.lyms.platform.common.utils.StringUtils; | |
| 23 | 24 | import com.lyms.platform.operate.web.request.CommonRequest; |
| 24 | 25 | import com.lyms.platform.operate.web.request.PatientBaseInfoRequest; |
| 25 | 26 | import com.lyms.platform.operate.web.service.ICommonServer; |
| ... | ... | @@ -36,6 +37,8 @@ |
| 36 | 37 | @Service |
| 37 | 38 | public class CommonServerImpl implements ICommonServer { |
| 38 | 39 | |
| 40 | + String CERT_URL = PropertiesUtils.getPropertyValue("cert_url"); | |
| 41 | + | |
| 39 | 42 | @Autowired |
| 40 | 43 | private MongoTemplate mongoTemplate; |
| 41 | 44 | |
| ... | ... | @@ -322,6 +325,31 @@ |
| 322 | 325 | baseResponse.setErrorcode(ResponseCode.SUCCESS.getCode()); |
| 323 | 326 | baseResponse.setErrormsg(ResponseCode.SUCCESS.getMsg()); |
| 324 | 327 | return baseResponse; |
| 328 | + } | |
| 329 | + | |
| 330 | + @Override | |
| 331 | + public List<CertBabyResult> getBabyInfoByCardNo(String cardNo) { | |
| 332 | + if (StringUtils.isNotEmpty(CERT_URL)) | |
| 333 | + { | |
| 334 | + Map<String,String> param = new HashMap<>(1); | |
| 335 | + param.put("cardNo", cardNo); | |
| 336 | + String url = CERT_URL+"/cp/openApi/babyInfo/getBabyInfoByCardNo"; | |
| 337 | + String json = HttpClientUtil.doGet(url, param, "utf-8", ""); | |
| 338 | + if (StringUtils.isNotEmpty(json)) | |
| 339 | + { | |
| 340 | + JSONObject jsonObject = JsonUtil.getObj(json); | |
| 341 | + if (jsonObject.get("errorcode") != null && Integer.valueOf(String.valueOf(jsonObject.get("errorcode"))) == 0) | |
| 342 | + { | |
| 343 | + String dataJson = jsonObject.getJSONArray("data").toString(); | |
| 344 | + if (StringUtils.isNotEmpty(dataJson) && !"[]".equals(dataJson)) | |
| 345 | + { | |
| 346 | + List<CertBabyResult> results = JsonUtil.toList(dataJson,CertBabyResult.class); | |
| 347 | + return results; | |
| 348 | + } | |
| 349 | + } | |
| 350 | + } | |
| 351 | + } | |
| 352 | + return null; | |
| 325 | 353 | } |
| 326 | 354 | } |