Commit dc87eafc2d1eb9c0d2b310dc50901338aa930c9a
1 parent
632fdeb562
Exists in
master
and in
6 other branches
update code
Showing 13 changed files with 761 additions and 22 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IMeasureInfoDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/MeasureInfoDao.java
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MeasureInfoService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MeasureInfoMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/MeasureInfoService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MeasureInfoServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/MeasureInfoMapper.xml
- platform-dal/src/main/java/com/lyms/platform/pojo/MeasureInfoModel.java
- platform-dal/src/main/java/com/lyms/platform/query/MeasureInfoQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MeasureInfoRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MeasureInfoResult.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/IMeasureInfoDao.java
View file @
dc87eaf
| ... | ... | @@ -12,5 +12,9 @@ |
| 12 | 12 | List<MeasureInfoModel> queryMeasureInfoList(MongoQuery query); |
| 13 | 13 | |
| 14 | 14 | int queryMeasureInfoListCount(MongoQuery mongoQuery); |
| 15 | + | |
| 16 | + void addMeasureInfo(MeasureInfoModel model); | |
| 17 | + | |
| 18 | + void updateMeasureInfo(MongoQuery mongoQuery,MeasureInfoModel model); | |
| 15 | 19 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/dal/impl/MeasureInfoDao.java
View file @
dc87eaf
| ... | ... | @@ -22,5 +22,15 @@ |
| 22 | 22 | public int queryMeasureInfoListCount(MongoQuery mongoQuery) { |
| 23 | 23 | return (int)count(mongoQuery.convertToMongoQuery()); |
| 24 | 24 | } |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public void addMeasureInfo(MeasureInfoModel model) { | |
| 28 | + save(model); | |
| 29 | + } | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public void updateMeasureInfo(MongoQuery mongoQuery,MeasureInfoModel model) { | |
| 33 | + update(mongoQuery.convertToMongoQuery(),model); | |
| 34 | + } | |
| 25 | 35 | } |
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/MeasureInfoService.java
View file @
dc87eaf
| 1 | 1 | package com.lyms.platform.biz.service; |
| 2 | 2 | |
| 3 | -import com.lyms.platform.biz.dal.IMatDeliverDao; | |
| 4 | 3 | import com.lyms.platform.biz.dal.IMeasureInfoDao; |
| 4 | +import com.lyms.platform.common.dao.operator.MongoCondition; | |
| 5 | +import com.lyms.platform.common.dao.operator.MongoOper; | |
| 5 | 6 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 6 | 7 | import com.lyms.platform.pojo.MeasureInfoModel; |
| 7 | 8 | import com.lyms.platform.query.MeasureInfoQuery; |
| ... | ... | @@ -29,6 +30,14 @@ |
| 29 | 30 | query.start(measureInfoQuery.getOffset()).end(measureInfoQuery.getLimit()); |
| 30 | 31 | } |
| 31 | 32 | return measureInfoDao.queryMeasureInfoList(query.addOrder(Sort.Direction.DESC, "created")); |
| 33 | + } | |
| 34 | + | |
| 35 | + public void addMeasureInfo(MeasureInfoModel model) { | |
| 36 | + measureInfoDao.addMeasureInfo(model); | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void updateMeasureInfo(MeasureInfoModel model) { | |
| 40 | + measureInfoDao.updateMeasureInfo(new MongoQuery(new MongoCondition("id", model.getId(), MongoOper.IS)), model); | |
| 32 | 41 | } |
| 33 | 42 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MeasureInfoMapper.java
View file @
dc87eaf
| 1 | +package com.lyms.platform.permission.dao.master; | |
| 2 | + | |
| 3 | +import com.lyms.platform.pojo.MeasureInfoModel; | |
| 4 | +import com.lyms.platform.query.MeasureInfoQuery; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by Administrator on 2018-01-10. | |
| 10 | + */ | |
| 11 | +public interface MeasureInfoMapper { | |
| 12 | + public void addMeasureInfo(MeasureInfoModel model); | |
| 13 | + | |
| 14 | + List<MeasureInfoModel> queryMeasureInfoList(MeasureInfoQuery query); | |
| 15 | + | |
| 16 | + int updateMeasureInfo(MeasureInfoModel model); | |
| 17 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/MeasureInfoService.java
View file @
dc87eaf
| 1 | +package com.lyms.platform.permission.service; | |
| 2 | + | |
| 3 | +import com.lyms.platform.pojo.MeasureInfoModel; | |
| 4 | +import com.lyms.platform.query.MeasureInfoQuery; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * Created by Administrator on 2018-01-10. | |
| 10 | + */ | |
| 11 | +public interface MeasureInfoService { | |
| 12 | + void addMeasureInfo(MeasureInfoModel model); | |
| 13 | + | |
| 14 | + List<MeasureInfoModel> queryMeasureInfoList(MeasureInfoQuery query); | |
| 15 | + | |
| 16 | + int updateMeasureInfo(MeasureInfoModel model); | |
| 17 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/MeasureInfoServiceImpl.java
View file @
dc87eaf
| 1 | +package com.lyms.platform.permission.service.impl; | |
| 2 | + | |
| 3 | +import com.lyms.platform.permission.dao.master.MeasureInfoMapper; | |
| 4 | +import com.lyms.platform.permission.service.MeasureInfoService; | |
| 5 | +import com.lyms.platform.pojo.MeasureInfoModel; | |
| 6 | +import com.lyms.platform.query.MeasureInfoQuery; | |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | + | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * Created by Administrator on 2018-01-10. | |
| 14 | + */ | |
| 15 | +@Service("mysqlMeasureInfoService") | |
| 16 | +public class MeasureInfoServiceImpl implements MeasureInfoService { | |
| 17 | + | |
| 18 | + @Autowired | |
| 19 | + private MeasureInfoMapper measureInfoMapper; | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public void addMeasureInfo(MeasureInfoModel model) { | |
| 23 | + measureInfoMapper.addMeasureInfo(model); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public List<MeasureInfoModel> queryMeasureInfoList(MeasureInfoQuery query) { | |
| 28 | + return measureInfoMapper.queryMeasureInfoList(query); | |
| 29 | + } | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public int updateMeasureInfo(MeasureInfoModel model) { | |
| 33 | + return measureInfoMapper.updateMeasureInfo(model); | |
| 34 | + } | |
| 35 | +} |
platform-biz-service/src/main/resources/mainOrm/master/MeasureInfoMapper.xml
View file @
dc87eaf
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper | |
| 3 | + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |
| 4 | + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 5 | +<mapper namespace="com.lyms.platform.permission.dao.master.MeasureInfoMapper"> | |
| 6 | + | |
| 7 | + <resultMap type="com.lyms.platform.pojo.MeasureInfoModel" id="measureInfoModelMap"> | |
| 8 | + <result column="id" property="id"/> | |
| 9 | + <result column="user_name" property="userName"/> | |
| 10 | + <result column="cert_type" property="certType"/> | |
| 11 | + <result column="cert_no" property="certNo"/> | |
| 12 | + <result column="age" property="age"/> | |
| 13 | + <result column="phone" property="phone"/> | |
| 14 | + <result column="sex" property="sex"/> | |
| 15 | + <result column="vc_card_no" property="vcCardNo"/> | |
| 16 | + <result column="value_one" property="valueOne"/> | |
| 17 | + <result column="value_two" property="valueTwo"/> | |
| 18 | + <result column="value_type" property="valueType"/> | |
| 19 | + <result column="record_time" property="recordTime"/> | |
| 20 | + <result column="wx_code" property="wxCode"/> | |
| 21 | + <result column="record_count" property="recordCount"/> | |
| 22 | + <result column="open_id" property="openId"/> | |
| 23 | + <result column="hospital_id" property="hospitalId"/> | |
| 24 | + <result column="created" property="created"/> | |
| 25 | + <result column="modified" property="modified"/> | |
| 26 | + </resultMap> | |
| 27 | + | |
| 28 | + <insert id="addMeasureInfo" parameterType="com.lyms.platform.pojo.MeasureInfoModel" > | |
| 29 | + INSERT INTO measure_info(user_name,cert_type, | |
| 30 | + cert_no,age,phone,sex,vc_card_no, | |
| 31 | + value_one,value_two,value_type,record_time,wx_code | |
| 32 | + ,record_count,open_id,created,modified) | |
| 33 | + VALUES (#{userName},#{certType}, | |
| 34 | + #{certNo},#{age},#{phone},#{sex} | |
| 35 | + ,#{vcCardNo},#{valueOne} | |
| 36 | + ,#{valueTwo},#{valueType},#{recordTime}, | |
| 37 | + #{wxCode},#{recordCount},#{openId},#{created},#{modified}) | |
| 38 | + </insert> | |
| 39 | + | |
| 40 | + <select id="queryMeasureInfoList" parameterType="com.lyms.platform.query.MeasureInfoQuery" resultMap="measureInfoModelMap"> | |
| 41 | + SELECT id,user_name,cert_type, | |
| 42 | + cert_no,age,phone,sex,vc_card_no, | |
| 43 | + value_one,value_two,value_type,record_time,wx_code | |
| 44 | + ,record_count,open_id,created,modified | |
| 45 | + FROM measure_info | |
| 46 | + | |
| 47 | + <include refid="queryMeasureInfoCondition"/> | |
| 48 | + <include refid="orderAndLimit"/> | |
| 49 | + </select> | |
| 50 | + | |
| 51 | + <update id="updateMeasureInfo" parameterType="com.lyms.platform.pojo.MeasureInfoModel" > | |
| 52 | + UPDATE | |
| 53 | + measure_info | |
| 54 | + <set> | |
| 55 | + <if test="id != null and id >= 0"> | |
| 56 | + id = #{id,jdbcType=INTEGER}, | |
| 57 | + </if> | |
| 58 | + <if test="userName != null"> | |
| 59 | + user_name = #{userName,jdbcType=VARCHAR}, | |
| 60 | + </if> | |
| 61 | + <if test="certType != null and certType != ''"> | |
| 62 | + cert_type = #{certType,jdbcType=VARCHAR}, | |
| 63 | + </if> | |
| 64 | + <if test="certNo != null and certNo != ''"> | |
| 65 | + cert_no = #{certNo,jdbcType=VARCHAR}, | |
| 66 | + </if> | |
| 67 | + <if test="age != null and age >= 0"> | |
| 68 | + age = #{age,jdbcType=INTEGER}, | |
| 69 | + </if> | |
| 70 | + <if test="phone != null and phone != ''"> | |
| 71 | + phone = #{phone,jdbcType=VARCHAR}, | |
| 72 | + </if> | |
| 73 | + <if test="sex != null"> | |
| 74 | + sex = #{sex,jdbcType=INTEGER}, | |
| 75 | + </if> | |
| 76 | + <if test="vcCardNo != null and vcCardNo != ''"> | |
| 77 | + vc_card_no = #{vcCardNo,jdbcType=VARCHAR}, | |
| 78 | + </if> | |
| 79 | + <if test="valueOne != null and valueOne != ''"> | |
| 80 | + value_one = #{valueOne,jdbcType=VARCHAR}, | |
| 81 | + </if> | |
| 82 | + <if test="valueTwo != null and valueTwo != ''"> | |
| 83 | + value_two = #{valueTwo,jdbcType=VARCHAR}, | |
| 84 | + </if> | |
| 85 | + <if test="valueType != null and valueType > 0"> | |
| 86 | + value_type = #{valueType,jdbcType=INTEGER}, | |
| 87 | + </if> | |
| 88 | + <if test="recordTime != null"> | |
| 89 | + record_time = #{recordTime}, | |
| 90 | + </if> | |
| 91 | + <if test="wxCode != null and wxCode != ''"> | |
| 92 | + wx_code = #{wxCode,jdbcType=VARCHAR}, | |
| 93 | + </if> | |
| 94 | + <if test="recordCount != null and recordCount >= 0"> | |
| 95 | + record_count = #{recordCount,jdbcType=INTEGER}, | |
| 96 | + </if> | |
| 97 | + <if test="openId != null and openId != ''"> | |
| 98 | + open_id = #{openId,jdbcType=VARCHAR}, | |
| 99 | + </if> | |
| 100 | + <if test="created != null"> | |
| 101 | + created = #{created}, | |
| 102 | + </if> | |
| 103 | + <if test="modified != null"> | |
| 104 | + modified = #{modified}, | |
| 105 | + </if> | |
| 106 | + </set> | |
| 107 | + where id = #{id,jdbcType=INTEGER} | |
| 108 | + </update> | |
| 109 | + | |
| 110 | + | |
| 111 | + <sql id="orderAndLimit"> | |
| 112 | + <if test="sort != null and sort != '' "> | |
| 113 | + order by ${sort} | |
| 114 | + <if test="need != null"> | |
| 115 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
| 116 | + </if> | |
| 117 | + </if> | |
| 118 | + </sql> | |
| 119 | + | |
| 120 | + | |
| 121 | + <sql id="queryMeasureInfoCondition"> | |
| 122 | + <where> | |
| 123 | + 1 = 1 | |
| 124 | + <if test="id != null and id >= 0"> | |
| 125 | + and id = #{id,jdbcType=INTEGER} | |
| 126 | + </if> | |
| 127 | + <if test="userName != null"> | |
| 128 | + and user_name = #{userName,jdbcType=VARCHAR} | |
| 129 | + </if> | |
| 130 | + <if test="certType != null and certType != ''"> | |
| 131 | + and cert_type = #{certType,jdbcType=VARCHAR} | |
| 132 | + </if> | |
| 133 | + <if test="certNo != null and certNo != ''"> | |
| 134 | + and cert_no = #{certNo,jdbcType=VARCHAR} | |
| 135 | + </if> | |
| 136 | + <if test="age != null and age >= 0"> | |
| 137 | + and age = #{age,jdbcType=INTEGER} | |
| 138 | + </if> | |
| 139 | + <if test="phone != null and phone != ''"> | |
| 140 | + and phone = #{phone,jdbcType=VARCHAR} | |
| 141 | + </if> | |
| 142 | + <if test="sex != null"> | |
| 143 | + and sex = #{sex,jdbcType=INTEGER} | |
| 144 | + </if> | |
| 145 | + <if test="vcCardNo != null and vcCardNo != ''"> | |
| 146 | + and vc_card_no = #{vcCardNo,jdbcType=VARCHAR} | |
| 147 | + </if> | |
| 148 | + <if test="valueOne != null and valueOne != ''"> | |
| 149 | + and value_one = #{valueOne,jdbcType=VARCHAR} | |
| 150 | + </if> | |
| 151 | + <if test="valueTwo != null and valueTwo != ''"> | |
| 152 | + and value_two = #{valueTwo,jdbcType=VARCHAR} | |
| 153 | + </if> | |
| 154 | + <if test="valueType != null and valueType > 0"> | |
| 155 | + and value_type = #{valueType,jdbcType=INTEGER} | |
| 156 | + </if> | |
| 157 | + <if test="recordTime != null"> | |
| 158 | + AND date_format(record_time,'%Y-%m-%d') = #{recordTime} | |
| 159 | + </if> | |
| 160 | + <if test="wxCode != null and wxCode != ''"> | |
| 161 | + and wx_code = #{wxCode,jdbcType=VARCHAR} | |
| 162 | + </if> | |
| 163 | + <if test="recordCount != null and recordCount >= 0"> | |
| 164 | + and record_count = #{recordCount,jdbcType=INTEGER} | |
| 165 | + </if> | |
| 166 | + <if test="openId != null and openId != ''"> | |
| 167 | + and open_id = #{openId,jdbcType=VARCHAR} | |
| 168 | + </if> | |
| 169 | + | |
| 170 | + <if test="recordTimeStart != null"> | |
| 171 | + AND record_time >= date_format(#{recordTimeStart},'%Y-%m-%d') | |
| 172 | + </if> | |
| 173 | + <if test="recordTimeEnd != null"> | |
| 174 | + AND <![CDATA[ record_time <= date_format(#{recordTimeEnd},'%Y-%m-%d') ]]> | |
| 175 | + </if> | |
| 176 | + | |
| 177 | + </where> | |
| 178 | + </sql> | |
| 179 | +</mapper> |
platform-dal/src/main/java/com/lyms/platform/pojo/MeasureInfoModel.java
View file @
dc87eaf
| 1 | 1 | package com.lyms.platform.pojo; |
| 2 | 2 | |
| 3 | -import org.springframework.data.mongodb.core.mapping.Document; | |
| 4 | 3 | |
| 5 | 4 | import java.util.Date; |
| 6 | 5 | |
| ... | ... | @@ -8,7 +7,7 @@ |
| 8 | 7 | * Created by Administrator on 2018-01-09. |
| 9 | 8 | * ๆต้่ก็ณๅ่ๆใ่บซ้ซๅไฝ้็ๅผ |
| 10 | 9 | */ |
| 11 | -@Document(collection = "lyms_measureInfo") | |
| 10 | +//@Document(collection = "lyms_measureInfo") | |
| 12 | 11 | public class MeasureInfoModel { |
| 13 | 12 | |
| 14 | 13 | private Integer id; |
| ... | ... | @@ -31,7 +30,7 @@ |
| 31 | 30 | //่ฎฐๅฝๆถ้ด |
| 32 | 31 | private Date recordTime; |
| 33 | 32 | //ๅพฎไฟกๅท |
| 34 | - private String wxXode; | |
| 33 | + private String wxCode; | |
| 35 | 34 | //่ฎฐๅฝๆปๆฌกๆฐ |
| 36 | 35 | private Integer recordCount; |
| 37 | 36 | //openId |
| ... | ... | @@ -44,6 +43,27 @@ |
| 44 | 43 | //ๅป้ขid |
| 45 | 44 | private String hospitalId; |
| 46 | 45 | |
| 46 | + //ๆๆบๅท็ | |
| 47 | + private String phone; | |
| 48 | + | |
| 49 | + private Integer age; | |
| 50 | + | |
| 51 | + public String getPhone() { | |
| 52 | + return phone; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setPhone(String phone) { | |
| 56 | + this.phone = phone; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public Integer getAge() { | |
| 60 | + return age; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public void setAge(Integer age) { | |
| 64 | + this.age = age; | |
| 65 | + } | |
| 66 | + | |
| 47 | 67 | public String getHospitalId() { |
| 48 | 68 | return hospitalId; |
| 49 | 69 | } |
| 50 | 70 | |
| ... | ... | @@ -132,12 +152,12 @@ |
| 132 | 152 | this.recordTime = recordTime; |
| 133 | 153 | } |
| 134 | 154 | |
| 135 | - public String getWxXode() { | |
| 136 | - return wxXode; | |
| 155 | + public String getWxCode() { | |
| 156 | + return wxCode; | |
| 137 | 157 | } |
| 138 | 158 | |
| 139 | - public void setWxXode(String wxXode) { | |
| 140 | - this.wxXode = wxXode; | |
| 159 | + public void setWxCode(String wxCode) { | |
| 160 | + this.wxCode = wxCode; | |
| 141 | 161 | } |
| 142 | 162 | |
| 143 | 163 | public Integer getRecordCount() { |
platform-dal/src/main/java/com/lyms/platform/query/MeasureInfoQuery.java
View file @
dc87eaf
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | */ |
| 17 | 17 | public class MeasureInfoQuery extends BaseQuery implements IConvertToNativeQuery { |
| 18 | 18 | |
| 19 | - private Integer id; | |
| 19 | + private String id; | |
| 20 | 20 | //็จๆทๅงๅ |
| 21 | 21 | private String userName; |
| 22 | 22 | //่ฏไปถ็ฑปๅ |
| ... | ... | @@ -57,6 +57,10 @@ |
| 57 | 57 | private String queryNo; |
| 58 | 58 | private String hospitalId; |
| 59 | 59 | |
| 60 | + private Date recordTime; | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 60 | 64 | @Override |
| 61 | 65 | public MongoQuery convertToQuery() { |
| 62 | 66 | MongoCondition condition = MongoCondition.newInstance(); |
| ... | ... | @@ -139,6 +143,15 @@ |
| 139 | 143 | return condition.toMongoQuery(); |
| 140 | 144 | } |
| 141 | 145 | |
| 146 | + | |
| 147 | + public Date getRecordTime() { | |
| 148 | + return recordTime; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public void setRecordTime(Date recordTime) { | |
| 152 | + this.recordTime = recordTime; | |
| 153 | + } | |
| 154 | + | |
| 142 | 155 | public String getHospitalId() { |
| 143 | 156 | return hospitalId; |
| 144 | 157 | } |
| 145 | 158 | |
| ... | ... | @@ -291,11 +304,11 @@ |
| 291 | 304 | this.queryNo = queryNo; |
| 292 | 305 | } |
| 293 | 306 | |
| 294 | - public Integer getId() { | |
| 307 | + public String getId() { | |
| 295 | 308 | return id; |
| 296 | 309 | } |
| 297 | 310 | |
| 298 | - public void setId(Integer id) { | |
| 311 | + public void setId(String id) { | |
| 299 | 312 | this.id = id; |
| 300 | 313 | } |
| 301 | 314 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/MeasureInfoController.java
View file @
dc87eaf
| ... | ... | @@ -3,15 +3,16 @@ |
| 3 | 3 | import com.lyms.platform.common.annotation.TokenRequired; |
| 4 | 4 | import com.lyms.platform.common.base.BaseController; |
| 5 | 5 | import com.lyms.platform.common.result.BaseListResponse; |
| 6 | +import com.lyms.platform.common.result.BaseResponse; | |
| 6 | 7 | import com.lyms.platform.operate.web.facade.MeasureInfoFacade; |
| 8 | +import com.lyms.platform.operate.web.request.MeasureInfoRequest; | |
| 7 | 9 | import com.lyms.platform.operate.web.request.SmsTemplateRequest; |
| 8 | 10 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 11 | import org.springframework.stereotype.Controller; |
| 10 | -import org.springframework.web.bind.annotation.RequestMapping; | |
| 11 | -import org.springframework.web.bind.annotation.RequestMethod; | |
| 12 | -import org.springframework.web.bind.annotation.RequestParam; | |
| 13 | -import org.springframework.web.bind.annotation.ResponseBody; | |
| 12 | +import org.springframework.web.bind.annotation.*; | |
| 14 | 13 | |
| 14 | +import javax.servlet.http.HttpServletRequest; | |
| 15 | + | |
| 15 | 16 | /** |
| 16 | 17 | * ๆต้่ก็ณๅ่ๆใ่บซ้ซๅไฝ้็ๅผ |
| 17 | 18 | * |
| ... | ... | @@ -29,8 +30,8 @@ |
| 29 | 30 | */ |
| 30 | 31 | @RequestMapping(method = RequestMethod.GET, value = "/queryMeasureInfoList") |
| 31 | 32 | @ResponseBody |
| 32 | - @TokenRequired | |
| 33 | - public BaseListResponse querySmsTemps(@RequestParam(value = "queryNo", required = false) String queryNo, | |
| 33 | +// @TokenRequired | |
| 34 | + public BaseListResponse queryMeasureInfoList(@RequestParam(value = "queryNo", required = false) String queryNo, | |
| 34 | 35 | @RequestParam("page") Integer page, |
| 35 | 36 | @RequestParam("limit") Integer limit, |
| 36 | 37 | @RequestParam("valueType") Integer valueType, |
| ... | ... | @@ -41,5 +42,30 @@ |
| 41 | 42 | return measureInfoFacade.queryMeasureInfoList(queryNo,valueType,certNo,recordTime,age,page,limit); |
| 42 | 43 | } |
| 43 | 44 | |
| 45 | + | |
| 46 | + /** | |
| 47 | + * ๆทปๅ ่ก็ณๅ่ๆ ่บซ้ซๅไฝ้็ๅผๅ่กจ | |
| 48 | + * @param measureInfoRequest | |
| 49 | + * @param request | |
| 50 | + * @return | |
| 51 | + */ | |
| 52 | + @RequestMapping(method = RequestMethod.POST, value = "/addMeasureInfo") | |
| 53 | + @ResponseBody | |
| 54 | + public BaseResponse addMeasureInfo(@RequestBody MeasureInfoRequest measureInfoRequest, HttpServletRequest request) { | |
| 55 | + return measureInfoFacade.addMeasureInfo(measureInfoRequest); | |
| 56 | + } | |
| 57 | + | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * ๆดๆฐๆฐๆฎ | |
| 61 | + * @param measureInfoRequest | |
| 62 | + * @param request | |
| 63 | + * @return | |
| 64 | + */ | |
| 65 | + @RequestMapping(method = RequestMethod.POST, value = "/updateMeasureInfo") | |
| 66 | + @ResponseBody | |
| 67 | + public BaseResponse updateMeasureInfo(@RequestBody MeasureInfoRequest measureInfoRequest, HttpServletRequest request) { | |
| 68 | + return measureInfoFacade.updateMeasureInfo(measureInfoRequest); | |
| 69 | + } | |
| 44 | 70 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MeasureInfoFacade.java
View file @
dc87eaf
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | -import com.lyms.platform.biz.service.MatDeliverService; | |
| 4 | -import com.lyms.platform.biz.service.MeasureInfoService; | |
| 5 | 3 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 4 | +import com.lyms.platform.common.enums.SexEnum; | |
| 6 | 5 | import com.lyms.platform.common.result.BaseListResponse; |
| 6 | +import com.lyms.platform.common.result.BaseResponse; | |
| 7 | 7 | import com.lyms.platform.common.utils.DateUtil; |
| 8 | +import com.lyms.platform.operate.web.request.MeasureInfoRequest; | |
| 9 | +import com.lyms.platform.operate.web.result.MeasureInfoResult; | |
| 8 | 10 | import com.lyms.platform.pojo.MeasureInfoModel; |
| 9 | 11 | import com.lyms.platform.query.MeasureInfoQuery; |
| 12 | +import org.apache.commons.collections.CollectionUtils; | |
| 10 | 13 | import org.apache.commons.lang.StringUtils; |
| 11 | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 15 | import org.springframework.stereotype.Component; |
| 13 | 16 | |
| 17 | +import java.util.ArrayList; | |
| 18 | +import java.util.Date; | |
| 14 | 19 | import java.util.List; |
| 15 | 20 | |
| 16 | 21 | /** |
| ... | ... | @@ -19,7 +24,7 @@ |
| 19 | 24 | @Component |
| 20 | 25 | public class MeasureInfoFacade { |
| 21 | 26 | @Autowired |
| 22 | - private MeasureInfoService measureInfoService; | |
| 27 | + private com.lyms.platform.permission.service.MeasureInfoService mysqlMeasureInfoService; | |
| 23 | 28 | |
| 24 | 29 | |
| 25 | 30 | public BaseListResponse queryMeasureInfoList(String queryNo, |
| 26 | 31 | |
| 27 | 32 | |
| ... | ... | @@ -41,13 +46,98 @@ |
| 41 | 46 | query.setRecordTimeEnd(DateUtil.parseYMDHMS(dates[1] + " 23:59:59")); |
| 42 | 47 | } |
| 43 | 48 | } |
| 44 | - List<MeasureInfoModel> list = measureInfoService.queryMeasureInfoList(query); | |
| 49 | + List<MeasureInfoModel> list = mysqlMeasureInfoService.queryMeasureInfoList(query); | |
| 50 | + | |
| 51 | + List<MeasureInfoResult> results = new ArrayList<>(); | |
| 52 | + if (CollectionUtils.isNotEmpty(list)) | |
| 53 | + { | |
| 54 | + for (MeasureInfoModel model : list) | |
| 55 | + { | |
| 56 | + MeasureInfoResult result = new MeasureInfoResult(); | |
| 57 | + result.setId(model.getId()); | |
| 58 | + result.setUserName(model.getUserName()); | |
| 59 | + result.setCertType(model.getCertType()); | |
| 60 | + result.setCertNo(model.getCertNo()); | |
| 61 | + result.setHospitalId(model.getHospitalId()); | |
| 62 | + result.setOpenId(model.getOpenId()); | |
| 63 | + result.setRecordCount(model.getRecordCount()); | |
| 64 | + result.setRecordTime(DateUtil.getyyyy_MM_dd(model.getRecordTime())); | |
| 65 | + result.setSex(SexEnum.getTextById(model.getSex())); | |
| 66 | + result.setAge(model.getAge()); | |
| 67 | + result.setValueOne(model.getValueOne()); | |
| 68 | + result.setValueTwo(model.getValueTwo()); | |
| 69 | + result.setVcCardNo(model.getVcCardNo()); | |
| 70 | + result.setWxXode(model.getWxCode()); | |
| 71 | + result.setPhone(model.getPhone()); | |
| 72 | + results.add(result); | |
| 73 | + } | |
| 74 | + } | |
| 75 | + | |
| 45 | 76 | BaseListResponse objectResponse = new BaseListResponse(); |
| 46 | - objectResponse.setData(list); | |
| 77 | + objectResponse.setData(results); | |
| 47 | 78 | objectResponse.setPageInfo(query.getPageInfo()); |
| 48 | 79 | objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 49 | 80 | objectResponse.setErrormsg("ๆๅ"); |
| 50 | 81 | return objectResponse; |
| 82 | + } | |
| 83 | + | |
| 84 | + public BaseResponse addMeasureInfo(MeasureInfoRequest measureInfoRequest) { | |
| 85 | + | |
| 86 | + MeasureInfoModel model = getModel(measureInfoRequest); | |
| 87 | + model.setCreated(new Date()); | |
| 88 | + model.setModified(new Date()); | |
| 89 | + | |
| 90 | + mysqlMeasureInfoService.addMeasureInfo(model); | |
| 91 | + BaseResponse objectResponse = new BaseResponse(); | |
| 92 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 93 | + objectResponse.setErrormsg("ๆๅ"); | |
| 94 | + return objectResponse; | |
| 95 | + } | |
| 96 | + | |
| 97 | + public BaseResponse updateMeasureInfo(MeasureInfoRequest measureInfoRequest) { | |
| 98 | + MeasureInfoModel model = getModel(measureInfoRequest); | |
| 99 | + MeasureInfoQuery query = new MeasureInfoQuery(); | |
| 100 | + query.setCertNo(measureInfoRequest.getCertNo()); | |
| 101 | + query.setCertType(measureInfoRequest.getCertType()); | |
| 102 | + List<MeasureInfoModel> list = mysqlMeasureInfoService.queryMeasureInfoList(query); | |
| 103 | + if (CollectionUtils.isNotEmpty(list)) | |
| 104 | + { | |
| 105 | + model.setModified(new Date()); | |
| 106 | + model.setId(list.get(0).getId()); | |
| 107 | + mysqlMeasureInfoService.updateMeasureInfo(model); | |
| 108 | + } | |
| 109 | + else | |
| 110 | + { | |
| 111 | + model.setCreated(new Date()); | |
| 112 | + model.setModified(new Date()); | |
| 113 | + mysqlMeasureInfoService.addMeasureInfo(model); | |
| 114 | + } | |
| 115 | + | |
| 116 | + BaseResponse objectResponse = new BaseResponse(); | |
| 117 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 118 | + objectResponse.setErrormsg("ๆๅ"); | |
| 119 | + return objectResponse; | |
| 120 | + } | |
| 121 | + | |
| 122 | + private MeasureInfoModel getModel(MeasureInfoRequest measureInfoRequest) | |
| 123 | + { | |
| 124 | + MeasureInfoModel model = new MeasureInfoModel(); | |
| 125 | + model.setUserName(measureInfoRequest.getUserName()); | |
| 126 | + model.setCertType(measureInfoRequest.getCertType()); | |
| 127 | + model.setCertNo(measureInfoRequest.getCertNo()); | |
| 128 | + model.setHospitalId(measureInfoRequest.getHospitalId()); | |
| 129 | + model.setOpenId(measureInfoRequest.getOpenId()); | |
| 130 | + model.setRecordCount(measureInfoRequest.getRecordCount()); | |
| 131 | + model.setRecordTime(DateUtil.parseYMDHMS(measureInfoRequest.getRecordTime())); | |
| 132 | + model.setSex(measureInfoRequest.getSex()); | |
| 133 | + model.setAge(measureInfoRequest.getAge()); | |
| 134 | + model.setValueOne(measureInfoRequest.getValueOne()); | |
| 135 | + model.setValueTwo(measureInfoRequest.getValueTwo()); | |
| 136 | + model.setValueType(measureInfoRequest.getValueType()); | |
| 137 | + model.setVcCardNo(measureInfoRequest.getVcCardNo()); | |
| 138 | + model.setWxCode(measureInfoRequest.getWxXode()); | |
| 139 | + model.setPhone(measureInfoRequest.getPhone()); | |
| 140 | + return model; | |
| 51 | 141 | } |
| 52 | 142 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/MeasureInfoRequest.java
View file @
dc87eaf
| 1 | +package com.lyms.platform.operate.web.request; | |
| 2 | + | |
| 3 | + | |
| 4 | +/** | |
| 5 | + * Created by Administrator on 2018-01-10. | |
| 6 | + */ | |
| 7 | +public class MeasureInfoRequest { | |
| 8 | + //็จๆทๅงๅ | |
| 9 | + private String userName; | |
| 10 | + //่ฏไปถ็ฑปๅ | |
| 11 | + private String certType; | |
| 12 | + //่ฏไปถๅท | |
| 13 | + private String certNo; | |
| 14 | + //ๆงๅซ | |
| 15 | + private Integer sex; | |
| 16 | + //ๅฐฑ่ฏๅกๅท | |
| 17 | + private String vcCardNo; | |
| 18 | + //่กๅ/ไฝ้ | |
| 19 | + private String valueOne; | |
| 20 | + //่ๆ/่บซ้ซ | |
| 21 | + private String valueTwo; | |
| 22 | + //ๅผ็ฑปๅ๏ผ 1 ่บซ้ซใไฝ้ 2 ่กๅๅ่ๆ | |
| 23 | + private Integer valueType; | |
| 24 | + //่ฎฐๅฝๆถ้ด | |
| 25 | + private String recordTime; | |
| 26 | + //ๅพฎไฟกๅท | |
| 27 | + private String wxXode; | |
| 28 | + //่ฎฐๅฝๆปๆฌกๆฐ | |
| 29 | + private Integer recordCount; | |
| 30 | + //openId | |
| 31 | + private String openId; | |
| 32 | + | |
| 33 | + //ๅป้ขid | |
| 34 | + private String hospitalId; | |
| 35 | + | |
| 36 | + //ๅนด้พ | |
| 37 | + private Integer age; | |
| 38 | + | |
| 39 | + //ๆๆบๅท็ | |
| 40 | + private String phone; | |
| 41 | + | |
| 42 | + public String getPhone() { | |
| 43 | + return phone; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public void setPhone(String phone) { | |
| 47 | + this.phone = phone; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public Integer getAge() { | |
| 51 | + return age; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setAge(Integer age) { | |
| 55 | + this.age = age; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public String getUserName() { | |
| 59 | + return userName; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public void setUserName(String userName) { | |
| 63 | + this.userName = userName; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public String getCertType() { | |
| 67 | + return certType; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setCertType(String certType) { | |
| 71 | + this.certType = certType; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public String getCertNo() { | |
| 75 | + return certNo; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public void setCertNo(String certNo) { | |
| 79 | + this.certNo = certNo; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public Integer getSex() { | |
| 83 | + return sex; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public void setSex(Integer sex) { | |
| 87 | + this.sex = sex; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public String getVcCardNo() { | |
| 91 | + return vcCardNo; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public void setVcCardNo(String vcCardNo) { | |
| 95 | + this.vcCardNo = vcCardNo; | |
| 96 | + } | |
| 97 | + | |
| 98 | + public String getValueOne() { | |
| 99 | + return valueOne; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public void setValueOne(String valueOne) { | |
| 103 | + this.valueOne = valueOne; | |
| 104 | + } | |
| 105 | + | |
| 106 | + public String getValueTwo() { | |
| 107 | + return valueTwo; | |
| 108 | + } | |
| 109 | + | |
| 110 | + public void setValueTwo(String valueTwo) { | |
| 111 | + this.valueTwo = valueTwo; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public Integer getValueType() { | |
| 115 | + return valueType; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public void setValueType(Integer valueType) { | |
| 119 | + this.valueType = valueType; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public String getRecordTime() { | |
| 123 | + return recordTime; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public void setRecordTime(String recordTime) { | |
| 127 | + this.recordTime = recordTime; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public String getWxXode() { | |
| 131 | + return wxXode; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public void setWxXode(String wxXode) { | |
| 135 | + this.wxXode = wxXode; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public Integer getRecordCount() { | |
| 139 | + return recordCount; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public void setRecordCount(Integer recordCount) { | |
| 143 | + this.recordCount = recordCount; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public String getOpenId() { | |
| 147 | + return openId; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public void setOpenId(String openId) { | |
| 151 | + this.openId = openId; | |
| 152 | + } | |
| 153 | + | |
| 154 | + public String getHospitalId() { | |
| 155 | + return hospitalId; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public void setHospitalId(String hospitalId) { | |
| 159 | + this.hospitalId = hospitalId; | |
| 160 | + } | |
| 161 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MeasureInfoResult.java
View file @
dc87eaf
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +/** | |
| 4 | + * Created by Administrator on 2018-01-10. | |
| 5 | + */ | |
| 6 | +public class MeasureInfoResult { | |
| 7 | + private Integer id; | |
| 8 | + //็จๆทๅงๅ | |
| 9 | + private String userName; | |
| 10 | + //่ฏไปถ็ฑปๅ | |
| 11 | + private String certType; | |
| 12 | + //่ฏไปถๅท | |
| 13 | + private String certNo; | |
| 14 | + //ๆงๅซ | |
| 15 | + private String sex; | |
| 16 | + //ๅนด้พ | |
| 17 | + private Integer age; | |
| 18 | + //ๅฐฑ่ฏๅกๅท | |
| 19 | + private String vcCardNo; | |
| 20 | + //่กๅ/ไฝ้ | |
| 21 | + private String valueOne; | |
| 22 | + //่ๆ/่บซ้ซ | |
| 23 | + private String valueTwo; | |
| 24 | + //่ฎฐๅฝๆถ้ด | |
| 25 | + private String recordTime; | |
| 26 | + //ๅพฎไฟกๅท | |
| 27 | + private String wxXode; | |
| 28 | + //่ฎฐๅฝๆปๆฌกๆฐ | |
| 29 | + private Integer recordCount; | |
| 30 | + //openId | |
| 31 | + private String openId; | |
| 32 | + | |
| 33 | + //ๅป้ขid | |
| 34 | + private String hospitalId; | |
| 35 | + | |
| 36 | + //ๆๆบๅท็ | |
| 37 | + private String phone; | |
| 38 | + | |
| 39 | + public String getPhone() { | |
| 40 | + return phone; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public void setPhone(String phone) { | |
| 44 | + this.phone = phone; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public Integer getId() { | |
| 48 | + return id; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setId(Integer id) { | |
| 52 | + this.id = id; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public String getUserName() { | |
| 56 | + return userName; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setUserName(String userName) { | |
| 60 | + this.userName = userName; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public String getCertType() { | |
| 64 | + return certType; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setCertType(String certType) { | |
| 68 | + this.certType = certType; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public String getCertNo() { | |
| 72 | + return certNo; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setCertNo(String certNo) { | |
| 76 | + this.certNo = certNo; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public String getSex() { | |
| 80 | + return sex; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setSex(String sex) { | |
| 84 | + this.sex = sex; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public String getVcCardNo() { | |
| 88 | + return vcCardNo; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setVcCardNo(String vcCardNo) { | |
| 92 | + this.vcCardNo = vcCardNo; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public String getValueOne() { | |
| 96 | + return valueOne; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setValueOne(String valueOne) { | |
| 100 | + this.valueOne = valueOne; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public String getValueTwo() { | |
| 104 | + return valueTwo; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setValueTwo(String valueTwo) { | |
| 108 | + this.valueTwo = valueTwo; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public String getRecordTime() { | |
| 112 | + return recordTime; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setRecordTime(String recordTime) { | |
| 116 | + this.recordTime = recordTime; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public String getWxXode() { | |
| 120 | + return wxXode; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setWxXode(String wxXode) { | |
| 124 | + this.wxXode = wxXode; | |
| 125 | + } | |
| 126 | + | |
| 127 | + public Integer getRecordCount() { | |
| 128 | + return recordCount; | |
| 129 | + } | |
| 130 | + | |
| 131 | + public void setRecordCount(Integer recordCount) { | |
| 132 | + this.recordCount = recordCount; | |
| 133 | + } | |
| 134 | + | |
| 135 | + public String getOpenId() { | |
| 136 | + return openId; | |
| 137 | + } | |
| 138 | + | |
| 139 | + public void setOpenId(String openId) { | |
| 140 | + this.openId = openId; | |
| 141 | + } | |
| 142 | + | |
| 143 | + public String getHospitalId() { | |
| 144 | + return hospitalId; | |
| 145 | + } | |
| 146 | + | |
| 147 | + public void setHospitalId(String hospitalId) { | |
| 148 | + this.hospitalId = hospitalId; | |
| 149 | + } | |
| 150 | + | |
| 151 | + public Integer getAge() { | |
| 152 | + return age; | |
| 153 | + } | |
| 154 | + | |
| 155 | + public void setAge(Integer age) { | |
| 156 | + this.age = age; | |
| 157 | + } | |
| 158 | +} |