Commit 1ede5b38dc27dbbc65e432f5b66a2300b74076f9

Authored by wangbo
1 parent 51ea3514e5

孕妇建档年龄搜索添加

Showing 7 changed files with 351 additions and 28 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/BasicConfigServiceTest.java View file @ 1ede5b3
... ... @@ -4172,6 +4172,141 @@
4172 4172  
4173 4173 }
4174 4174  
  4175 + /**
  4176 + * 秦皇岛儿童膳食报告
  4177 + */
  4178 + public static void babyReport(String fileName) {
  4179 + ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath:/spring/applicationContext_biz_patient1.xml");
  4180 + MongoTemplate mongoTemplate
  4181 + = (MongoTemplate) applicationContext.getBean("mongoTemplate");
  4182 + mongoTemplate.getDb().authenticate("platform", "platform123".toCharArray());
  4183 + File file = new File(fileName);
  4184 + Workbook wb = null;
  4185 + try {
  4186 + wb = Workbook.getWorkbook(file);
  4187 +
  4188 + Sheet s = wb.getSheet(0);
  4189 + System.out.println(s.getName() + " : ");
  4190 + int rows = s.getRows();
  4191 + if (rows > 0) {
  4192 + //遍历每行
  4193 + for (int i = 1; i < rows; i++) {
  4194 + System.out.println("rows=" + i);
  4195 + BabyDietReportModel babyDiet = new BabyDietReportModel();
  4196 + //6-11月膳食结构正常消瘦超重类型 0 正常 1超重消瘦
  4197 + babyDiet.setWeightType(0);
  4198 + Cell[] cells = s.getRow(i);
  4199 + if (cells.length > 0) {
  4200 + //遍历每行中的每列
  4201 + for (int j = 0; j < cells.length; j++) {
  4202 + String str = cells[j].getContents().trim();
  4203 + switch (j) {
  4204 + case 0:
  4205 + babyDiet.setMonthAge(Integer.parseInt(str));
  4206 + continue;
  4207 + case 1:
  4208 + List<String> list1 = Arrays.asList(str.split("\n"));
  4209 + babyDiet.setDietStructure(list1);
  4210 + continue;
  4211 + case 2:
  4212 + List<String> list2 = Arrays.asList(str.split("\n"));
  4213 + babyDiet.setWeeklyRecipes(list2);
  4214 + continue;
  4215 + case 3:
  4216 + List<String> list3 = Arrays.asList(str.split("\n"));
  4217 + babyDiet.setRecommendRecipes(list3);
  4218 + continue;
  4219 + }
  4220 + }
  4221 + }
  4222 + mongoTemplate.save(babyDiet);
  4223 + }
  4224 +
  4225 + }
  4226 +
  4227 + Sheet s1 = wb.getSheet(1);
  4228 + System.out.println(s.getName() + " : ");
  4229 + int rows1 = s1.getRows();
  4230 + if (rows1 > 0) {
  4231 + for (int i = 1; i < rows1; i++) {
  4232 + System.out.println("rows=" + i);
  4233 + BabyDietReportModel babyDiet = new BabyDietReportModel();
  4234 + //6-11月膳食结构正常消瘦超重类型 0 正常 1超重消瘦
  4235 + babyDiet.setWeightType(1);
  4236 + Cell[] cells = s1.getRow(i);
  4237 + if (cells.length > 0) {
  4238 + //遍历每行中的每列
  4239 + for (int j = 0; j < cells.length; j++) {
  4240 + String str = cells[j].getContents().trim();
  4241 + switch (j) {
  4242 + case 0:
  4243 + babyDiet.setMonthAge(Integer.parseInt(str));
  4244 + continue;
  4245 + case 1:
  4246 + babyDiet.setKcal(str);
  4247 + continue;
  4248 + case 2:
  4249 + List<String> list1 = Arrays.asList(str.split("\n"));
  4250 + babyDiet.setDietStructure(list1);
  4251 + continue;
  4252 + case 3:
  4253 + List<String> list2 = Arrays.asList(str.split("\n"));
  4254 + babyDiet.setOneDayRecipes(list2);
  4255 + continue;
  4256 + case 4:
  4257 + List<String> list3 = Arrays.asList(str.split("\n"));
  4258 + babyDiet.setRecommendRecipes(list3);
  4259 + continue;
  4260 + }
  4261 + }
  4262 +
  4263 + }
  4264 + mongoTemplate.save(babyDiet);
  4265 + }
  4266 + }
  4267 +
  4268 + Sheet s2 = wb.getSheet(2);
  4269 + System.out.println(s2.getName() + " : ");
  4270 + int rows2 = s2.getRows();
  4271 + if (rows2 > 0) {
  4272 + //遍历每行
  4273 + for (int i = 1; i < rows2; i++) {
  4274 + System.out.println("rows=" + i);
  4275 + BabyDietReportModel babyDiet = new BabyDietReportModel();
  4276 + Cell[] cells = s2.getRow(i);
  4277 + if (cells.length > 0) {
  4278 + //遍历每行中的每列
  4279 + for (int j = 0; j < cells.length; j++) {
  4280 + String str = cells[j].getContents().trim();
  4281 + switch (j) {
  4282 + case 0:
  4283 + babyDiet.setMonthAge(Integer.parseInt(str));
  4284 + continue;
  4285 + case 1:
  4286 + babyDiet.setFeedingPattern(Integer.parseInt(str));
  4287 + continue;
  4288 + case 2:
  4289 + babyDiet.setShape(Integer.parseInt(str));
  4290 + continue;
  4291 + case 3:
  4292 + List<String> list2 = Arrays.asList(str.split("\n"));
  4293 + babyDiet.setFeedingGuide(list2);
  4294 + continue;
  4295 + }
  4296 + }
  4297 +
  4298 + }
  4299 + mongoTemplate.save(babyDiet);
  4300 + }
  4301 + }
  4302 + } catch (IOException e) {
  4303 + e.printStackTrace();
  4304 + } catch (BiffException e) {
  4305 + e.printStackTrace();
  4306 + }
  4307 +
  4308 + }
  4309 +
4175 4310 public static void main(String[] args) {
4176 4311 // weightWeek("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
4177 4312 // weightMange("F:\\体重与营养管理\\体重与营养管理第三版(北方)改标红“、冰淇淋”-晓萌.xls");
4178 4313  
4179 4314  
... ... @@ -4186,16 +4321,17 @@
4186 4321 // babyConfig("F:\\儿童营养报告\\儿童营养报告模板.xls");
4187 4322  
4188 4323  
4189   -// babyNutritionConfig("F:\儿童营养报告\婴幼儿体重与营养管理报告内容及规则\儿童膳食报告文章2.xls");
  4324 + //babyNutritionConfig("F:\儿童营养报告\婴幼儿体重与营养管理报告内容及规则\儿童膳食报告文章2.xls");
4190 4325 //xyPresentation("E:\\血压报告.xls");
4191 4326 //weightReport("E:\\体重营养报告10.xls");
4192 4327 //renGaoZhen("G:\\妊高症风险.xls");
4193   - Test("G:\text.xls");
  4328 + //Test("G:\text.xls");
4194 4329 // weightReport("E:\\体重营养报告10.xls");
4195 4330 // saveCdgwOrg("F:\\承德工位\\cdorg.xls");
4196 4331 // saveCdgwOrgJwhRe("F:\\承德工位\\承德卫生机构与居委会对应关系表.xls");
4197 4332  
4198   - saveCdgwOrg("F:\\承德工位\\qhdorg.xls");
  4333 + //saveCdgwOrg("F:\\承德工位\\qhdorg.xls");
  4334 + babyReport("G:\\儿童膳食报告.xls");
4199 4335 }
4200 4336  
4201 4337 }
platform-dal/src/main/java/com/lyms/platform/pojo/BabyDietReportModel.java View file @ 1ede5b3
  1 +package com.lyms.platform.pojo;
  2 +
  3 +import com.lyms.platform.common.result.BaseModel;
  4 +import org.springframework.data.mongodb.core.mapping.Document;
  5 +
  6 +import java.util.List;
  7 +
  8 +@Document(collection = "lyms_baby_diet_report")
  9 +public class BabyDietReportModel extends BaseModel {
  10 + private String id;
  11 + //月龄
  12 + private Integer monthAge;
  13 +
  14 + //热量值
  15 + private String kcal;
  16 +
  17 + //膳食结构
  18 + private List<String> dietStructure;
  19 +
  20 + //一周参考食谱
  21 + private List<String> weeklyRecipes;
  22 +
  23 + //推荐食谱
  24 + private List<String> recommendRecipes;
  25 + //超重消瘦一日喂养指南
  26 + private List<String> oneDayRecipes;
  27 +
  28 + //6-11月膳食结构正常消瘦超重类型 0 正常 1超重消瘦
  29 + private Integer weightType;
  30 +
  31 + //喂养方式 0 母乳喂养 1.混合喂养 2 人工喂养
  32 + private Integer feedingPattern;
  33 + //体型 0 消瘦 1.正常 2.超重
  34 + private Integer shape;
  35 + //喂养方式
  36 + private List<String> feedingGuide;
  37 +
  38 + public String getId() {
  39 + return id;
  40 + }
  41 +
  42 + public void setId(String id) {
  43 + this.id = id;
  44 + }
  45 +
  46 + public Integer getMonthAge() {
  47 + return monthAge;
  48 + }
  49 +
  50 + public void setMonthAge(Integer monthAge) {
  51 + this.monthAge = monthAge;
  52 + }
  53 +
  54 + public List<String> getRecommendRecipes() {
  55 + return recommendRecipes;
  56 + }
  57 +
  58 + public void setRecommendRecipes(List<String> recommendRecipes) {
  59 + this.recommendRecipes = recommendRecipes;
  60 + }
  61 +
  62 + public String getKcal() {
  63 + return kcal;
  64 + }
  65 +
  66 + public void setKcal(String kcal) {
  67 + this.kcal = kcal;
  68 + }
  69 +
  70 + public List<String> getDietStructure() {
  71 + return dietStructure;
  72 + }
  73 +
  74 + public void setDietStructure(List<String> dietStructure) {
  75 + this.dietStructure = dietStructure;
  76 + }
  77 +
  78 + public List<String> getWeeklyRecipes() {
  79 + return weeklyRecipes;
  80 + }
  81 +
  82 + public void setWeeklyRecipes(List<String> weeklyRecipes) {
  83 + this.weeklyRecipes = weeklyRecipes;
  84 + }
  85 +
  86 +
  87 + public List<String> getOneDayRecipes() {
  88 + return oneDayRecipes;
  89 + }
  90 +
  91 + public void setOneDayRecipes(List<String> oneDayRecipes) {
  92 + this.oneDayRecipes = oneDayRecipes;
  93 + }
  94 +
  95 + public Integer getWeightType() {
  96 + return weightType;
  97 + }
  98 +
  99 + public void setWeightType(Integer weightType) {
  100 + this.weightType = weightType;
  101 + }
  102 +
  103 + public Integer getFeedingPattern() {
  104 + return feedingPattern;
  105 + }
  106 +
  107 + public void setFeedingPattern(Integer feedingPattern) {
  108 + this.feedingPattern = feedingPattern;
  109 + }
  110 +
  111 + public Integer getShape() {
  112 + return shape;
  113 + }
  114 +
  115 + public void setShape(Integer shape) {
  116 + this.shape = shape;
  117 + }
  118 +
  119 + public List<String> getFeedingGuide() {
  120 + return feedingGuide;
  121 + }
  122 +
  123 + public void setFeedingGuide(List<String> feedingGuide) {
  124 + this.feedingGuide = feedingGuide;
  125 + }
  126 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyNutritionController.java View file @ 1ede5b3
... ... @@ -16,18 +16,19 @@
16 16  
17 17  
18 18 /**
19   - *儿童营养报告
  19 + * 儿童营养报告
20 20 */
21 21 @Controller
22   -public class BabyNutritionController extends BaseController{
  22 +public class BabyNutritionController extends BaseController {
23 23  
24   -
  24 +
25 25 @Autowired
26 26 private BabyNutritionFacade babyNutritionFacade;
27 27  
28 28  
29 29 /**
30   - * 添加儿童营养
  30 + * 添加儿童营养
  31 + *
31 32 * @param request
32 33 * @return
33 34 */
34 35  
... ... @@ -37,12 +38,13 @@
37 38 public BaseResponse addOrUpBabyNutrition(@Valid @RequestBody BabyNutritionRequest request,
38 39 HttpServletRequest httpServletRequest) {
39 40  
40   - return babyNutritionFacade.addOrUpBabyNutrition(request,getUserId(httpServletRequest));
  41 + return babyNutritionFacade.addOrUpBabyNutrition(request, getUserId(httpServletRequest));
41 42 }
42 43  
43 44  
44 45 /**
45 46 * 膳食列表
  47 + *
46 48 * @param page
47 49 * @param limit
48 50 * @param queryNo
49 51  
50 52  
51 53  
52 54  
53 55  
54 56  
55 57  
56 58  
57 59  
58 60  
... ... @@ -54,65 +56,76 @@
54 56 @RequestMapping(value = "/queryBabyNutritionList", method = RequestMethod.GET)
55 57 @ResponseBody
56 58 @TokenRequired
57   - public BaseResponse queryBabyNutritionList( @RequestParam("page") Integer page,
58   - @RequestParam("limit") Integer limit,
59   - @RequestParam(required = false)String queryNo,
60   - @RequestParam(required = false)String vcCardNo,
61   - @RequestParam(required = false)String babyName,
62   - @RequestParam(required = false)String recordTime,
63   - HttpServletRequest request){
64   - return babyNutritionFacade.queryBabyNutritionList(page, limit, queryNo, vcCardNo, babyName, getUserId(request), recordTime);
  59 + public BaseResponse queryBabyNutritionList(@RequestParam("page") Integer page,
  60 + @RequestParam("limit") Integer limit,
  61 + @RequestParam(required = false) String queryNo,
  62 + @RequestParam(required = false) String vcCardNo,
  63 + @RequestParam(required = false) String babyName,
  64 + @RequestParam(required = false) String recordTime,
  65 + HttpServletRequest request) {
  66 + return babyNutritionFacade.queryBabyNutritionList(page, limit, queryNo, vcCardNo, babyName, getUserId(request), recordTime);
65 67 }
66 68  
67 69  
68 70 /**
69 71 * 查询营养记录
  72 + *
70 73 * @param babyId
71 74 * @return
72 75 */
73 76 @RequestMapping(value = "/queryBabyNutritionRecord/{babyId}", method = RequestMethod.GET)
74 77 @ResponseBody
75 78 @TokenRequired
76   - public BaseObjectResponse queryBabyNutritionRecord(@PathVariable("babyId")String babyId){
77   - return babyNutritionFacade.queryBabyNutritionRecord(babyId);
  79 + public BaseObjectResponse queryBabyNutritionRecord(@PathVariable("babyId") String babyId) {
  80 + return babyNutritionFacade.queryBabyNutritionRecord(babyId);
78 81 }
79 82  
80 83 /**
81 84 * 查询单条记录
  85 + *
82 86 * @param id
83 87 * @return
84 88 */
85 89 @RequestMapping(value = "/queryBabyNutritionById/{id}", method = RequestMethod.GET)
86 90 @ResponseBody
87 91 @TokenRequired
88   - public BaseObjectResponse queryBabyNutritionById(@PathVariable("id")String id){
89   - return babyNutritionFacade.queryBabyNutritionById(id);
  92 + public BaseObjectResponse queryBabyNutritionById(@PathVariable("id") String id) {
  93 + return babyNutritionFacade.queryBabyNutritionById(id);
90 94 }
91 95  
92 96  
93 97 /**
94 98 * 从ams获取儿童营养食谱
  99 + *
95 100 * @return
96 101 */
97   - @RequestMapping(value = "/queryBabyNutritionFood", method = RequestMethod.GET,produces = "application/json; charset=utf-8")
  102 + @RequestMapping(value = "/queryBabyNutritionFood", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
98 103 @ResponseBody
99   - public BaseObjectResponse queryBabyNutritionFood(){
  104 + public BaseObjectResponse queryBabyNutritionFood() {
100 105 return babyNutritionFacade.queryBabyNutritionFood();
101 106 }
102 107  
103 108  
104 109 /**
105 110 * 儿童营养报告
  111 + *
106 112 * @param id
107 113 * @return
108 114 */
109 115 @RequestMapping(value = "/queryBabyNutritionReport/{id}", method = RequestMethod.GET)
110 116 @ResponseBody
111 117 @TokenRequired
112   - public BaseObjectResponse queryBabyNutritionReport(@PathVariable("id")String id,HttpServletRequest request){
113   - return babyNutritionFacade.queryBabyNutritionReport(id,getUserId(request));
  118 + public BaseObjectResponse queryBabyNutritionReport(@PathVariable("id") String id, HttpServletRequest request) {
  119 + return babyNutritionFacade.queryBabyNutritionReport(id, getUserId(request));
114 120 }
115 121  
  122 + /**
  123 + * 秦皇岛儿童膳食报告模板
  124 + */
  125 + @RequestMapping(value = "/queryBabyDietReport/{id}", method = RequestMethod.GET)
  126 + public BaseObjectResponse queryBabyDietReport(@PathVariable("id") String id, HttpServletRequest request) {
  127 + return null;
  128 + }
116 129  
117 130 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyNutritionFacade.java View file @ 1ede5b3
... ... @@ -940,5 +940,7 @@
940 940 }
941 941 return kaupEvaluate;
942 942 }
  943 +
  944 +
943 945 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanChanResult.java View file @ 1ede5b3
... ... @@ -457,7 +457,22 @@
457 457 setName(destModel.getUsername());
458 458 setRealPhone(destModel.getPhone());
459 459 setPhone(StringUtils.encryPhone(destModel.getPhone()));
460   - setCreatedWeek(DateUtil.getWeek(destModel.getLastMenses(), destModel.getCreated()) + "周");
  460 + String dueWeek = "";
  461 + try {
  462 + // 徐倩说改的
  463 + int days = DateUtil.daysBetween(destModel.getLastMenses(), destModel.getBookbuildingDate());
  464 + if (days > 7 * 42 - 1) {
  465 + dueWeek = "已分娩";
  466 + } else {
  467 + String week = (days / 7) + "";
  468 + int day = (days % 7);
  469 + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");
  470 + }
  471 +
  472 + } catch (Exception e) {
  473 + // 什么都不干
  474 + }
  475 + setCreatedWeek(dueWeek);
461 476  
462 477 setFileCode(destModel.getFileCode());
463 478 if (null != destModel.getFmDate()) {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/QuanPatientsResult.java View file @ 1ede5b3
... ... @@ -43,7 +43,7 @@
43 43  
44 44 //联系方式
45 45 private String phone;
46   -// @JsonIgnore
  46 + // @JsonIgnore
47 47 private String realPhone;
48 48 //预约产检时间
49 49 private String cTime;
... ... @@ -381,7 +381,22 @@
381 381 setId(destModel.getId());
382 382 setName(destModel.getUsername());
383 383 setAge(destModel.getAge());
384   - setCreatedWeek(DateUtil.getWeek(destModel.getLastMenses(), destModel.getCreated()) + "周");
  384 + String dueWeek = "";
  385 + try {
  386 + // 徐倩说改的
  387 + int days = DateUtil.daysBetween(destModel.getLastMenses(), destModel.getBookbuildingDate());
  388 + if (days > 7 * 42 - 1) {
  389 + dueWeek = "已分娩";
  390 + } else {
  391 + String week = (days / 7) + "";
  392 + int day = (days % 7);
  393 + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");
  394 + }
  395 +
  396 + } catch (Exception e) {
  397 + // 什么都不干
  398 + }
  399 + setCreatedWeek(dueWeek);
385 400 if (null != destModel.getLastMenses()) {
386 401 int days = DateUtil.daysBetween(destModel.getLastMenses(), new Date());
387 402 this.dueWeek = StringUtils.dueWeek(days);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/RiskPatientsResult.java View file @ 1ede5b3
... ... @@ -356,7 +356,23 @@
356 356 setcTime(DateUtil.getyyyy_MM_dd(destModel.getNextCheckTime()));
357 357 setDueDate(DateUtil.getyyyy_MM_dd(destModel.getDueDate()));
358 358 setPhone(StringUtils.encryPhone(destModel.getPhone()));
359   - setCreatedWeek(DateUtil.getWeek(destModel.getLastMenses(), destModel.getCreated()) + "周");
  359 + String dueWeek = "";
  360 + try {
  361 + // 徐倩说改的
  362 + int days = DateUtil.daysBetween(destModel.getLastMenses(), destModel.getBookbuildingDate());
  363 + if (days > 7 * 42 - 1) {
  364 + dueWeek = "已分娩";
  365 + } else {
  366 + String week = (days / 7) + "";
  367 + int day = (days % 7);
  368 + dueWeek = "孕" + week + "周" + (day > 0 ? "+" + day + "天" : "");
  369 + }
  370 +
  371 + } catch (Exception e) {
  372 + // 什么都不干
  373 + }
  374 + setCreatedWeek(dueWeek);
  375 +
360 376 if (null != destModel.getDueStatus() && 1 == destModel.getDueStatus()) {
361 377 this.dueWeek = "终止妊娠";
362 378 } else if (3 == destModel.getType()) {