Commit afcdb189c5ba9e91e584103ccd3e5cc8e6ca855f

Authored by liquanyu
1 parent 8d8dadbe00

儿童快速测量

Showing 13 changed files with 766 additions and 4 deletions

platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/BabyBookbuildingService.java View file @ afcdb18
... ... @@ -97,6 +97,15 @@
97 97 return babyBookBuildingDao.queryBabyWithQuery(query.addOrder(Sort.Direction.DESC, "created"));
98 98 }
99 99  
  100 + public BabyModel queryBabyBuildById(String id) {
  101 + BabyModelQuery babyQuery = new BabyModelQuery();
  102 + babyQuery.setId(id);
  103 + babyQuery.setYn(YnEnums.YES.getId());
  104 + MongoQuery query = babyQuery.convertToQuery();
  105 + List<BabyModel> list = babyBookBuildingDao.queryBabyWithQuery(query);
  106 + return CollectionUtils.isNotEmpty(list) ? list.get(0) : null;
  107 + }
  108 +
100 109 public List<BabyModel> queryBabyBuildByCond(BabyModelQuery babyQuery,String sortkey,Sort.Direction sort) {
101 110 MongoQuery query = babyQuery.convertToQuery();
102 111 if (StringUtils.isNotEmpty(babyQuery.getNeed())) {
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MeasureDataInfoMapper.java View file @ afcdb18
1 1 package com.lyms.platform.permission.dao.master;
2 2  
  3 +import com.lyms.platform.pojo.MeasureBabyInfoModel;
3 4 import com.lyms.platform.pojo.MeasureDataInfoModel;
4 5 import com.lyms.platform.pojo.MeasureInfoModel;
  6 +import com.lyms.platform.query.MeasureBabyDataInfoQuery;
5 7 import com.lyms.platform.query.MeasureDataInfoQuery;
6 8 import com.lyms.platform.query.MeasureInfoQuery;
7 9  
8 10 import java.util.List;
  11 +import java.util.Map;
9 12  
10 13 /**
11 14 * Created by Administrator on 2018-01-10.
... ... @@ -22,5 +25,11 @@
22 25 List<MeasureDataInfoModel> queryMeasureList(MeasureDataInfoQuery query);
23 26  
24 27 int queryMeasureListCount(MeasureDataInfoQuery query);
  28 +
  29 + void addMeasureBabyDataInfo(MeasureBabyInfoModel model);
  30 +
  31 + List<MeasureBabyInfoModel> queryMeasureBabyInfoList(MeasureBabyDataInfoQuery query);
  32 + int queryMeasureBabyInfoCount(MeasureBabyDataInfoQuery query);
  33 + int updateMeasureBabyDataInfo(MeasureBabyInfoModel model);
25 34 }
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MeasureUserInfoMapper.java View file @ afcdb18
1 1 package com.lyms.platform.permission.dao.master;
2 2  
  3 +import com.lyms.platform.pojo.MeasureBabyInfoModel;
3 4 import com.lyms.platform.pojo.MeasureUserInfoModel;
4 5 import com.lyms.platform.pojo.MeasureInfoModel;
5 6 import com.lyms.platform.pojo.MeasureUserInfoModel;
... ... @@ -18,5 +19,6 @@
18 19 int updateMeasureUserInfo(MeasureUserInfoModel model);
19 20  
20 21 int queryMeasureUserInfoListCount(MeasureUserInfoQuery query);
  22 +
21 23 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/MeasureDataInfoService.java View file @ afcdb18
1 1 package com.lyms.platform.permission.service;
2 2  
  3 +import com.lyms.platform.pojo.MeasureBabyInfoModel;
3 4 import com.lyms.platform.pojo.MeasureDataInfoModel;
4 5 import com.lyms.platform.pojo.MeasureInfoModel;
  6 +import com.lyms.platform.query.MeasureBabyDataInfoQuery;
5 7 import com.lyms.platform.query.MeasureDataInfoQuery;
6 8 import com.lyms.platform.query.MeasureInfoQuery;
7 9  
8 10 import java.util.List;
  11 +import java.util.Map;
9 12  
10 13 /**
11 14 * Created by Administrator on 2018-01-10.
... ... @@ -18,5 +21,10 @@
18 21 int updateMeasureDataInfo(MeasureDataInfoModel model);
19 22  
20 23 List<MeasureDataInfoModel> queryMeasureList(MeasureDataInfoQuery query);
  24 +
  25 + void addMeasureBabyInfo(MeasureBabyInfoModel model);
  26 +
  27 + List<MeasureBabyInfoModel> queryMeasureBabyInfoList(MeasureBabyDataInfoQuery query);
  28 + int updateMeasureBabyDataInfo(MeasureBabyInfoModel model);
21 29 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MeasureDataInfoServiceImpl.java View file @ afcdb18
... ... @@ -2,14 +2,17 @@
2 2  
3 3 import com.lyms.platform.permission.dao.master.MeasureDataInfoMapper;
4 4 import com.lyms.platform.permission.service.MeasureDataInfoService;
  5 +import com.lyms.platform.pojo.MeasureBabyInfoModel;
5 6 import com.lyms.platform.pojo.MeasureDataInfoModel;
6 7 import com.lyms.platform.pojo.MeasureInfoModel;
  8 +import com.lyms.platform.query.MeasureBabyDataInfoQuery;
7 9 import com.lyms.platform.query.MeasureDataInfoQuery;
8 10 import com.lyms.platform.query.MeasureInfoQuery;
9 11 import org.springframework.beans.factory.annotation.Autowired;
10 12 import org.springframework.stereotype.Service;
11 13  
12 14 import java.util.List;
  15 +import java.util.Map;
13 16  
14 17 /**
15 18 * Created by Administrator on 2018-01-10.
... ... @@ -45,6 +48,24 @@
45 48 query.mysqlBuild(measureDataInfoMapper.queryMeasureListCount(query));
46 49 }
47 50 return measureDataInfoMapper.queryMeasureList(query);
  51 + }
  52 +
  53 + @Override
  54 + public void addMeasureBabyInfo(MeasureBabyInfoModel model) {
  55 + measureDataInfoMapper.addMeasureBabyDataInfo(model);
  56 + }
  57 +
  58 + @Override
  59 + public List<MeasureBabyInfoModel> queryMeasureBabyInfoList(MeasureBabyDataInfoQuery query) {
  60 + if (query.getNeed() != null) {
  61 + query.mysqlBuild(measureDataInfoMapper.queryMeasureBabyInfoCount(query));
  62 + }
  63 + return measureDataInfoMapper.queryMeasureBabyInfoList(query);
  64 + }
  65 +
  66 + @Override
  67 + public int updateMeasureBabyDataInfo(MeasureBabyInfoModel model) {
  68 + return measureDataInfoMapper.updateMeasureBabyDataInfo(model);
48 69 }
49 70 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MeasureUserInfoServiceImpl.java View file @ afcdb18
... ... @@ -2,6 +2,7 @@
2 2  
3 3 import com.lyms.platform.permission.dao.master.MeasureUserInfoMapper;
4 4 import com.lyms.platform.permission.service.MeasureUserInfoService;
  5 +import com.lyms.platform.pojo.MeasureBabyInfoModel;
5 6 import com.lyms.platform.pojo.MeasureUserInfoModel;
6 7 import com.lyms.platform.query.MeasureUserInfoQuery;
7 8 import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -36,5 +37,6 @@
36 37 public int updateMeasureUserInfo(MeasureUserInfoModel model) {
37 38 return measureUserInfoMapper.updateMeasureUserInfo(model);
38 39 }
  40 +
39 41 }
platform-biz-service/src/main/resources/mainOrm/master/MeasureDataInfoMapper.xml View file @ afcdb18
... ... @@ -328,5 +328,146 @@
328 328 </if>
329 329 </where>
330 330 </sql>
  331 +
  332 + <insert id="addMeasureBabyDataInfo" parameterType="com.lyms.platform.pojo.MeasureBabyInfoModel">
  333 + INSERT INTO measure_baby_info(
  334 + value_one,value_two,value_three,value_type
  335 + ,record_count,created,modified,today_count,remark_value,hospital_id,baby_id)
  336 + VALUES (#{valueOne}
  337 + ,#{valueTwo},#{valueThree},#{valueType},#{recordCount},#{created},#{modified},#{todayCount},#{remarkValue},#{hospitalId},#{babyId})
  338 + </insert>
  339 +
  340 +
  341 + <resultMap type="com.lyms.platform.pojo.MeasureBabyInfoModel" id="measureBabyDataInfoMap">
  342 + <result column="id" property="id"/>
  343 + <result column="hospital_id" property="hospitalId"/>
  344 + <result column="baby_id" property="babyId"/>
  345 + <result column="value_one" property="valueOne"/>
  346 + <result column="value_two" property="valueTwo"/>
  347 + <result column="value_three" property="valueThree"/>
  348 + <result column="value_type" property="valueType"/>
  349 + <result column="record_count" property="recordCount"/>
  350 + <result column="created" property="created"/>
  351 + <result column="modified" property="modified"/>
  352 + <result column="today_count" property="todayCount"/>
  353 + <result column="remark_value" property="remarkValue"/>
  354 + </resultMap>
  355 +
  356 +
  357 + <sql id="queryMeasureBabyDataInfoCondition">
  358 + <where>
  359 + 1 = 1
  360 + <if test="id != null and id >= 0">
  361 + and id = #{id,jdbcType=INTEGER}
  362 + </if>
  363 + <if test="valueOne != null and valueOne != ''">
  364 + and value_one = #{valueOne,jdbcType=VARCHAR}
  365 + </if>
  366 + <if test="valueTwo != null and valueTwo != ''">
  367 + and value_two = #{valueTwo,jdbcType=VARCHAR}
  368 + </if>
  369 + <if test="valueThree != null and valueThree != ''">
  370 + and value_three = #{valueThree,jdbcType=VARCHAR}
  371 + </if>
  372 + <if test="valueType != null and valueType > 0">
  373 + and value_type = #{valueType,jdbcType=INTEGER}
  374 + </if>
  375 + <if test="created != null">
  376 + AND date_format(created,'%Y-%m-%d') = #{created}
  377 + </if>
  378 + <if test="recordCount != null and recordCount >= 0">
  379 + and record_count = #{recordCount,jdbcType=INTEGER}
  380 + </if>
  381 +
  382 + <if test="babyId != null and babyId != ''">
  383 + and baby_id = #{babyId,jdbcType=VARCHAR}
  384 + </if>
  385 +
  386 + <if test="createdTimeStart != null">
  387 + AND created >= date_format(#{createdTimeStart},'%Y-%m-%d')
  388 + </if>
  389 + <if test="createdTimeEnd != null">
  390 + AND <![CDATA[ created < date_format(#{createdTimeEnd},'%Y-%m-%d') ]]>
  391 + </if>
  392 +
  393 + <if test="modifiedTimeStart != null">
  394 + AND modified >= date_format(#{modifiedTimeStart},'%Y-%m-%d')
  395 + </if>
  396 + <if test="modifiedTimeEnd != null">
  397 + AND <![CDATA[ modified < date_format(#{modifiedTimeEnd},'%Y-%m-%d') ]]>
  398 + </if>
  399 +
  400 + <if test="todayCount != null and todayCount > 0">
  401 + AND today_count = #{todayCount,jdbcType=INTEGER}
  402 + </if>
  403 +
  404 + <if test="babyIds != null and babyIds.size > 0">
  405 + and baby_id in
  406 + <foreach collection="babyIds" open="(" close=")" separator="," item="bid">
  407 + #{bid}
  408 + </foreach>
  409 + </if>
  410 +
  411 + </where>
  412 + </sql>
  413 +
  414 +
  415 + <select id="queryMeasureBabyInfoList" resultMap="measureBabyDataInfoMap">
  416 + SELECT id,value_one,value_two,value_three,value_type
  417 + ,record_count,created,modified,today_count,remark_value,hospital_id,baby_id FROM measure_baby_info
  418 + <include refid="queryMeasureBabyDataInfoCondition"/>
  419 + <include refid="orderAndLimit"/>
  420 + </select>
  421 +
  422 + <select id="queryMeasureBabyInfoCount" resultType="int">
  423 + SELECT count(1) FROM measure_baby_info
  424 + <include refid="queryMeasureBabyDataInfoCondition"/>
  425 + <include refid="orderAndLimit"/>
  426 + </select>
  427 +
  428 +
  429 +
  430 + <update id="updateMeasureBabyDataInfo" parameterType="com.lyms.platform.pojo.MeasureBabyInfoModel" >
  431 + UPDATE
  432 + measure_baby_info
  433 + <set>
  434 + <if test="id != null and id >= 0">
  435 + id = #{id,jdbcType=INTEGER},
  436 + </if>
  437 + <if test="babyId != null">
  438 + baby_id = #{babyId},
  439 + </if>
  440 +
  441 + <if test="valueOne != null and valueOne != ''">
  442 + value_one = #{valueOne,jdbcType=VARCHAR},
  443 + </if>
  444 + <if test="valueTwo != null and valueTwo != ''">
  445 + value_two = #{valueTwo,jdbcType=VARCHAR},
  446 + </if>
  447 + <if test="valueThree != null and valueThree != ''">
  448 + value_three = #{valueThree,jdbcType=VARCHAR},
  449 + </if>
  450 + <if test="valueType != null and valueType > 0">
  451 + value_type = #{valueType,jdbcType=INTEGER},
  452 + </if>
  453 + <if test="recordCount != null and recordCount >= 0">
  454 + record_count = #{recordCount,jdbcType=INTEGER},
  455 + </if>
  456 +
  457 + <if test="created != null">
  458 + created = #{created},
  459 + </if>
  460 + <if test="modified != null">
  461 + modified = #{modified},
  462 + </if>
  463 + <if test="todayCount != null and todayCount > 0">
  464 + today_count = #{todayCount,jdbcType=INTEGER},
  465 + </if>
  466 + <if test="remarkValue != null and remarkValue != ''">
  467 + remark_value = #{remarkValue,jdbcType=VARCHAR},
  468 + </if>
  469 + </set>
  470 + where id = #{id,jdbcType=INTEGER}
  471 + </update>
331 472 </mapper>
platform-biz-service/src/main/resources/mainOrm/master/MeasureUserInfoMapper.xml View file @ afcdb18
... ... @@ -204,5 +204,6 @@
204 204 </if>
205 205 </where>
206 206 </sql>
  207 +
207 208 </mapper>
platform-dal/src/main/java/com/lyms/platform/pojo/MeasureBabyInfoModel.java View file @ afcdb18
  1 +package com.lyms.platform.pojo;
  2 +
  3 +
  4 +import java.util.Date;
  5 +
  6 +/**
  7 + * 儿童体重
  8 + */
  9 +public class MeasureBabyInfoModel {
  10 +
  11 + private Integer id;
  12 + //血压/体重/血糖
  13 + private String valueOne;
  14 + //脉搏/身高
  15 + private String valueTwo;
  16 + //体重测量存BMI值
  17 + private String valueThree;
  18 +
  19 + //值类型: 1 体重和身高 2 血压和脉搏 3、体温 4、血糖
  20 + private Integer valueType;
  21 +
  22 + //医院id
  23 + private String hospitalId;
  24 +
  25 + private String babyId;
  26 +
  27 + private Date created;
  28 + private Date modified;
  29 + private String remarkValue;
  30 + //记录总次数
  31 + private Integer recordCount;
  32 + //当天记录次数
  33 + private Integer todayCount;
  34 +
  35 + public String getRemarkValue() {
  36 + return remarkValue;
  37 + }
  38 +
  39 + public void setRemarkValue(String remarkValue) {
  40 + this.remarkValue = remarkValue;
  41 + }
  42 +
  43 + public Integer getRecordCount() {
  44 + return recordCount;
  45 + }
  46 +
  47 + public void setRecordCount(Integer recordCount) {
  48 + this.recordCount = recordCount;
  49 + }
  50 +
  51 + public Integer getTodayCount() {
  52 + return todayCount;
  53 + }
  54 +
  55 + public void setTodayCount(Integer todayCount) {
  56 + this.todayCount = todayCount;
  57 + }
  58 +
  59 + public Date getCreated() {
  60 + return created;
  61 + }
  62 +
  63 + public void setCreated(Date created) {
  64 + this.created = created;
  65 + }
  66 +
  67 + public Date getModified() {
  68 + return modified;
  69 + }
  70 +
  71 + public void setModified(Date modified) {
  72 + this.modified = modified;
  73 + }
  74 +
  75 + public Integer getId() {
  76 + return id;
  77 + }
  78 +
  79 + public void setId(Integer id) {
  80 + this.id = id;
  81 + }
  82 +
  83 + public String getValueOne() {
  84 + return valueOne;
  85 + }
  86 +
  87 + public void setValueOne(String valueOne) {
  88 + this.valueOne = valueOne;
  89 + }
  90 +
  91 + public String getValueTwo() {
  92 + return valueTwo;
  93 + }
  94 +
  95 + public void setValueTwo(String valueTwo) {
  96 + this.valueTwo = valueTwo;
  97 + }
  98 +
  99 + public String getValueThree() {
  100 + return valueThree;
  101 + }
  102 +
  103 + public void setValueThree(String valueThree) {
  104 + this.valueThree = valueThree;
  105 + }
  106 +
  107 + public Integer getValueType() {
  108 + return valueType;
  109 + }
  110 +
  111 + public void setValueType(Integer valueType) {
  112 + this.valueType = valueType;
  113 + }
  114 +
  115 + public String getHospitalId() {
  116 + return hospitalId;
  117 + }
  118 +
  119 + public void setHospitalId(String hospitalId) {
  120 + this.hospitalId = hospitalId;
  121 + }
  122 +
  123 + public String getBabyId() {
  124 + return babyId;
  125 + }
  126 +
  127 + public void setBabyId(String babyId) {
  128 + this.babyId = babyId;
  129 + }
  130 +}
platform-dal/src/main/java/com/lyms/platform/query/MeasureBabyDataInfoQuery.java View file @ afcdb18
  1 +package com.lyms.platform.query;
  2 +
  3 +
  4 +import com.lyms.platform.common.dao.BaseQuery;
  5 +
  6 +import java.util.Date;
  7 +import java.util.List;
  8 +
  9 +
  10 +/**
  11 + */
  12 +public class MeasureBabyDataInfoQuery extends BaseQuery {
  13 +
  14 + private String id;
  15 + //医院id
  16 + private String hospitalId;
  17 +
  18 + private String babyId;
  19 + private List<String> babyIds;
  20 +
  21 + //创建时间
  22 + private Date createdTimeStart;
  23 + private Date createdTimeEnd;
  24 +
  25 + private Date modifiedTimeStart;
  26 +
  27 + private Date modifiedTimeEnd;
  28 +
  29 +
  30 + //血压/体重/体温
  31 + private String valueOne;
  32 + //脉搏/身高
  33 + private String valueTwo;
  34 + //体重测量存BMI值
  35 + private String valueThree;
  36 +
  37 + //值类型: 1 体重和身高 2 血压和脉搏 3、体温
  38 + private Integer valueType;
  39 +
  40 + //记录总次数
  41 + private Integer recordCount;
  42 +
  43 + //创建时间
  44 + private String created;
  45 + //修改时间
  46 + private String modified;
  47 +
  48 + //当天记录次数
  49 + private Integer todayCount;
  50 +
  51 + //备注值
  52 + private String remarkValue;
  53 +
  54 + public List<String> getBabyIds() {
  55 + return babyIds;
  56 + }
  57 +
  58 + public void setBabyIds(List<String> babyIds) {
  59 + this.babyIds = babyIds;
  60 + }
  61 +
  62 + public String getId() {
  63 + return id;
  64 + }
  65 +
  66 + public void setId(String id) {
  67 + this.id = id;
  68 + }
  69 +
  70 + public String getHospitalId() {
  71 + return hospitalId;
  72 + }
  73 +
  74 + public void setHospitalId(String hospitalId) {
  75 + this.hospitalId = hospitalId;
  76 + }
  77 +
  78 + public String getBabyId() {
  79 + return babyId;
  80 + }
  81 +
  82 + public void setBabyId(String babyId) {
  83 + this.babyId = babyId;
  84 + }
  85 +
  86 + public Date getCreatedTimeStart() {
  87 + return createdTimeStart;
  88 + }
  89 +
  90 + public void setCreatedTimeStart(Date createdTimeStart) {
  91 + this.createdTimeStart = createdTimeStart;
  92 + }
  93 +
  94 + public Date getCreatedTimeEnd() {
  95 + return createdTimeEnd;
  96 + }
  97 +
  98 + public void setCreatedTimeEnd(Date createdTimeEnd) {
  99 + this.createdTimeEnd = createdTimeEnd;
  100 + }
  101 +
  102 + public Date getModifiedTimeStart() {
  103 + return modifiedTimeStart;
  104 + }
  105 +
  106 + public void setModifiedTimeStart(Date modifiedTimeStart) {
  107 + this.modifiedTimeStart = modifiedTimeStart;
  108 + }
  109 +
  110 + public Date getModifiedTimeEnd() {
  111 + return modifiedTimeEnd;
  112 + }
  113 +
  114 + public void setModifiedTimeEnd(Date modifiedTimeEnd) {
  115 + this.modifiedTimeEnd = modifiedTimeEnd;
  116 + }
  117 +
  118 + public String getValueOne() {
  119 + return valueOne;
  120 + }
  121 +
  122 + public void setValueOne(String valueOne) {
  123 + this.valueOne = valueOne;
  124 + }
  125 +
  126 + public String getValueTwo() {
  127 + return valueTwo;
  128 + }
  129 +
  130 + public void setValueTwo(String valueTwo) {
  131 + this.valueTwo = valueTwo;
  132 + }
  133 +
  134 + public String getValueThree() {
  135 + return valueThree;
  136 + }
  137 +
  138 + public void setValueThree(String valueThree) {
  139 + this.valueThree = valueThree;
  140 + }
  141 +
  142 + public Integer getValueType() {
  143 + return valueType;
  144 + }
  145 +
  146 + public void setValueType(Integer valueType) {
  147 + this.valueType = valueType;
  148 + }
  149 +
  150 + public Integer getRecordCount() {
  151 + return recordCount;
  152 + }
  153 +
  154 + public void setRecordCount(Integer recordCount) {
  155 + this.recordCount = recordCount;
  156 + }
  157 +
  158 + public String getCreated() {
  159 + return created;
  160 + }
  161 +
  162 + public void setCreated(String created) {
  163 + this.created = created;
  164 + }
  165 +
  166 + public String getModified() {
  167 + return modified;
  168 + }
  169 +
  170 + public void setModified(String modified) {
  171 + this.modified = modified;
  172 + }
  173 +
  174 + public Integer getTodayCount() {
  175 + return todayCount;
  176 + }
  177 +
  178 + public void setTodayCount(Integer todayCount) {
  179 + this.todayCount = todayCount;
  180 + }
  181 +
  182 + public String getRemarkValue() {
  183 + return remarkValue;
  184 + }
  185 +
  186 + public void setRemarkValue(String remarkValue) {
  187 + this.remarkValue = remarkValue;
  188 + }
  189 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java View file @ afcdb18
... ... @@ -343,5 +343,44 @@
343 343 return measureInfoFacade.getBabyMeasureInfo(certType, certNo, hospitalId);
344 344 }
345 345  
  346 +
  347 + /**
  348 + * 添加儿童体重测量
  349 + * @param measureBabyInfoRequest
  350 + * @param request
  351 + * @return
  352 + */
  353 + @RequestMapping(method = RequestMethod.POST, value = "/addMeasureBabyDataInfo")
  354 + @ResponseBody
  355 + public BaseResponse addMeasureDataInfo(@RequestBody MeasureBabyInfoRequest measureBabyInfoRequest, HttpServletRequest request) {
  356 + return measureInfoFacade.addMeasureBabyDataInfo(measureBabyInfoRequest);
  357 + }
  358 +
  359 +
  360 + /**
  361 + * 儿童体重
  362 + * @param queryNo
  363 + * @param page
  364 + * @param limit
  365 + * @param valueType
  366 + * @param vcCardNo
  367 + * @param recordTime
  368 + * @param request
  369 + * @return
  370 + */
  371 + @RequestMapping(method = RequestMethod.GET, value = "/queryMeasureBabyDataList")
  372 + @ResponseBody
  373 + @TokenRequired
  374 + public BaseResponse queryMeasureBabyDataList(@RequestParam(value = "queryNo", required = false) String queryNo,
  375 + @RequestParam("page") Integer page,
  376 + @RequestParam("limit") Integer limit,
  377 + @RequestParam("valueType") Integer valueType,
  378 + @RequestParam(value = "vcCardNo", required = false) String vcCardNo,
  379 + @RequestParam(value = "recordTime", required = false) String recordTime
  380 + , HttpServletRequest request) {
  381 + return measureInfoFacade.queryMeasureBabyDataList(queryNo,page,limit,valueType,vcCardNo,recordTime,getUserId(request));
  382 + }
  383 +
  384 +
346 385 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java View file @ afcdb18
... ... @@ -12,6 +12,7 @@
12 12 import com.lyms.platform.common.utils.DateUtil;
13 13 import com.lyms.platform.common.utils.ExceptionUtils;
14 14 import com.lyms.platform.operate.web.request.MeasureAllInfoRequest;
  15 +import com.lyms.platform.operate.web.request.MeasureBabyInfoRequest;
15 16 import com.lyms.platform.operate.web.request.MeasureInfoRequest;
16 17 import com.lyms.platform.operate.web.request.NutritionInfoRequest;
17 18 import com.lyms.platform.operate.web.result.MeasureBaseInfoResult;
... ... @@ -91,6 +92,8 @@
91 92  
92 93 @Autowired
93 94 private BasicConfigService basicConfigService;
  95 + @Autowired
  96 + private AutoMatchFacade autoMatchFacade;
94 97  
95 98 private static String[] blood_item = new String[]{"--","--","--","--","--","--","--","--","--"};
96 99  
... ... @@ -1525,10 +1528,6 @@
1525 1528 }
1526 1529  
1527 1530  
1528   -
1529   - @Autowired
1530   - private BabyBookbuildingService babyBookbuildingService;
1531   -
1532 1531 public BaseObjectResponse getBabyMeasureInfo(String certType, String certNo, String hospitalId) {
1533 1532 BaseObjectResponse br = new BaseObjectResponse();
1534 1533 BabyModelQuery query = new BabyModelQuery();
... ... @@ -1579,5 +1578,126 @@
1579 1578 }
1580 1579  
1581 1580  
  1581 + public BaseResponse addMeasureBabyDataInfo(MeasureBabyInfoRequest measureBabyInfoRequest) {
  1582 +
  1583 + MeasureBabyInfoModel measureBabyInfoModel = measureBabyInfoRequest.convertToDataModel();
  1584 + MeasureBabyDataInfoQuery query = new MeasureBabyDataInfoQuery();
  1585 + query.setBabyId(measureBabyInfoRequest.getBabyId());
  1586 + List<MeasureBabyInfoModel> models = mysqlMeasureDataInfoService.queryMeasureBabyInfoList(query);
  1587 +
  1588 + if (CollectionUtils.isNotEmpty(models))
  1589 + {
  1590 + int todayCount = 0;
  1591 + MeasureBabyInfoModel model = models.get(0);
  1592 + if (DateUtil.getyyyy_MM_dd(model.getModified()).equals(DateUtil.getyyyy_MM_dd(new Date()))) {
  1593 + todayCount = model.getTodayCount() + 1;
  1594 + }
  1595 + else
  1596 + {
  1597 + todayCount = 1;
  1598 + }
  1599 + model.setTodayCount(todayCount);
  1600 + model.setRecordCount(model.getRecordCount() + 1);
  1601 + model.setValueOne(measureBabyInfoRequest.getValueOne());
  1602 + model.setValueTwo(measureBabyInfoRequest.getValueTwo());
  1603 + model.setModified(new Date());
  1604 + mysqlMeasureDataInfoService.updateMeasureBabyDataInfo(model);
  1605 + }
  1606 + else
  1607 + {
  1608 + measureBabyInfoModel.setModified(new Date());
  1609 + measureBabyInfoModel.setTodayCount(1);
  1610 + measureBabyInfoModel.setRecordCount(1);
  1611 + mysqlMeasureDataInfoService.addMeasureBabyInfo(measureBabyInfoModel);
  1612 + }
  1613 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  1614 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  1615 + objectResponse.setErrormsg("成功");
  1616 + return objectResponse;
  1617 + }
  1618 +
  1619 + @Autowired
  1620 + private BabyBookbuildingService babyBookbuildingService;
  1621 +
  1622 + public BaseResponse queryMeasureBabyDataList(String queryNo, Integer page, Integer limit, Integer valueType, String vcCardNo, String recordTime, Integer userId) {
  1623 +
  1624 +
  1625 + List<String> babyIds = new ArrayList<>();
  1626 + if (StringUtils.isNotEmpty(vcCardNo) || StringUtils.isNotEmpty(queryNo) )
  1627 + {
  1628 + BabyModelQuery babyQuery = new BabyModelQuery();
  1629 + babyQuery.setVcCardNo(vcCardNo);
  1630 + babyQuery.setQueryNo(queryNo);
  1631 +
  1632 + List<BabyModel> babyModels = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
  1633 + if (CollectionUtils.isNotEmpty(babyModels))
  1634 + {
  1635 + for (BabyModel model : babyModels)
  1636 + {
  1637 + babyIds.add(model.getId());
  1638 + }
  1639 + }
  1640 + }
  1641 +
  1642 +
  1643 + MeasureBabyDataInfoQuery query = new MeasureBabyDataInfoQuery();
  1644 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  1645 + query.setBabyIds(babyIds);
  1646 + query.setHospitalId(hospitalId);
  1647 + query.setValueType(valueType);
  1648 + query.setLimit(limit);
  1649 + query.setPage(page);
  1650 + query.setNeed("true");
  1651 + if (StringUtils.isNotEmpty(recordTime)) {
  1652 + String[] dates = recordTime.split(" - ");
  1653 + query.setCreatedTimeStart(DateUtil.parseYMD(dates[0]));
  1654 + if (dates.length == 2) {
  1655 + query.setCreatedTimeEnd(DateUtil.addDay(DateUtil.parseYMD(dates[1]), 1));
  1656 + }
  1657 + }
  1658 +
  1659 + List<Map> list = new ArrayList<>();
  1660 +
  1661 + List<MeasureBabyInfoModel> models = mysqlMeasureDataInfoService.queryMeasureBabyInfoList(query);
  1662 + if (CollectionUtils.isNotEmpty(models))
  1663 + {
  1664 + for (MeasureBabyInfoModel model : models)
  1665 + {
  1666 + Map map = new HashMap();
  1667 +
  1668 + BabyModel babyModel = babyBookbuildingService.queryBabyBuildById(model.getBabyId());
  1669 + if (babyModel != null )
  1670 + {
  1671 + map.put("babyName",babyModel.getName());
  1672 + map.put("sex",SexEnum.getTextById(babyModel.getSex()));
  1673 + map.put("monthAge",DateUtil.getMonthDesc(babyModel.getBirth(), model.getModified()));
  1674 + map.put("motherName",babyModel.getMname());
  1675 + map.put("phone",babyModel.getMphone());
  1676 + map.put("vcCardNo",babyModel.getVcCardNo());
  1677 + map.put("weight",model.getValueOne());
  1678 + map.put("height",model.getValueTwo());
  1679 + map.put("recordTime",DateUtil.getyyyy_MM_dd(model.getModified()));
  1680 + map.put("recordCount",model.getRecordCount());
  1681 +
  1682 + String hospital = "";
  1683 + if (org.apache.commons.lang.StringUtils.isNotEmpty(model.getHospitalId())) {
  1684 + Organization organization = organizationService.getOrganization(Integer.parseInt(model.getHospitalId()));
  1685 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
  1686 + hospital = organization.getName();
  1687 + }
  1688 + }
  1689 + map.put("hospialName",hospital);
  1690 + list.add(map);
  1691 + }
  1692 + }
  1693 + }
  1694 +
  1695 + BaseListResponse objectResponse = new BaseListResponse();
  1696 + objectResponse.setPageInfo(query.getPageInfo());
  1697 + objectResponse.setData(list);
  1698 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  1699 + objectResponse.setErrormsg("成功");
  1700 + return objectResponse;
  1701 + }
1582 1702 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MeasureBabyInfoRequest.java View file @ afcdb18
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +
  4 +import com.lyms.platform.common.base.IBasicRequestConvert;
  5 +import com.lyms.platform.pojo.MeasureBabyInfoModel;
  6 +import com.lyms.platform.pojo.ModularFunctionConfigModel;
  7 +
  8 +import java.util.Date;
  9 +
  10 +/**
  11 + * Created by Administrator on 2018-01-10.
  12 + */
  13 +public class MeasureBabyInfoRequest implements IBasicRequestConvert<MeasureBabyInfoModel> {
  14 +
  15 +
  16 + //血压/体重/血糖
  17 + private String valueOne;
  18 + //脉搏/身高
  19 + private String valueTwo;
  20 + //体重测量存BMI值
  21 + private String valueThree;
  22 +
  23 + //值类型: 1 体重和身高 2 血压和脉搏 3、体温 4、血糖
  24 + private Integer valueType;
  25 +
  26 + //医院id
  27 + private String hospitalId;
  28 +
  29 + private String babyId;
  30 +
  31 + public String getBabyId() {
  32 + return babyId;
  33 + }
  34 +
  35 + public void setBabyId(String babyId) {
  36 + this.babyId = babyId;
  37 + }
  38 +
  39 + public String getValueOne() {
  40 + return valueOne;
  41 + }
  42 +
  43 + public void setValueOne(String valueOne) {
  44 + this.valueOne = valueOne;
  45 + }
  46 +
  47 + public String getValueTwo() {
  48 + return valueTwo;
  49 + }
  50 +
  51 + public void setValueTwo(String valueTwo) {
  52 + this.valueTwo = valueTwo;
  53 + }
  54 +
  55 + public String getValueThree() {
  56 + return valueThree;
  57 + }
  58 +
  59 + public void setValueThree(String valueThree) {
  60 + this.valueThree = valueThree;
  61 + }
  62 +
  63 + public Integer getValueType() {
  64 + return valueType;
  65 + }
  66 +
  67 + public void setValueType(Integer valueType) {
  68 + this.valueType = valueType;
  69 + }
  70 +
  71 + public String getHospitalId() {
  72 + return hospitalId;
  73 + }
  74 +
  75 + public void setHospitalId(String hospitalId) {
  76 + this.hospitalId = hospitalId;
  77 + }
  78 +
  79 + @Override
  80 + public MeasureBabyInfoModel convertToDataModel() {
  81 + MeasureBabyInfoModel model = new MeasureBabyInfoModel();
  82 + model.setHospitalId(hospitalId);
  83 + model.setValueOne(valueOne);
  84 + model.setValueTwo(valueTwo);
  85 + model.setValueThree(valueThree);
  86 + model.setCreated(new Date());
  87 + model.setBabyId(babyId);
  88 + model.setValueType(valueType);
  89 + return model;
  90 + }
  91 +}