Commit 4ef9bdcbd18228384ead4e22e94e02c9ee3af19b
1 parent
e20d7c640f
Exists in
master
and in
6 other branches
mysql数据同步
Showing 9 changed files with 454 additions and 75 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterLisMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/LisReportModel.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/LisReportQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/LisService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterLisMapper.java
View file @
4ef9bdc
| ... | ... | @@ -2,6 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.permission.model.LisReportItemModel; |
| 4 | 4 | import com.lyms.platform.permission.model.LisReportModel; |
| 5 | +import com.lyms.platform.permission.model.LisReportQuery; | |
| 5 | 6 | |
| 6 | 7 | import java.util.List; |
| 7 | 8 | |
| ... | ... | @@ -19,5 +20,11 @@ |
| 19 | 20 | List<LisReportItemModel> queryLisItemByModel(LisReportItemModel query); |
| 20 | 21 | |
| 21 | 22 | List<LisReportModel> queryListItems(LisReportModel query); |
| 23 | + | |
| 24 | + int queryLisCount(LisReportQuery query); | |
| 25 | + | |
| 26 | + List<LisReportModel> queryLisDataByQuery(LisReportQuery query); | |
| 27 | + | |
| 28 | + void updateAppLisStatus(List<String> list); | |
| 22 | 29 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/LisReportModel.java
View file @
4ef9bdc
| ... | ... | @@ -51,9 +51,19 @@ |
| 51 | 51 | //检验项集合 |
| 52 | 52 | private List<LisReportItemModel> items; |
| 53 | 53 | |
| 54 | + //数据状态是否被客户端查看过 0未查看 1查看 | |
| 55 | + private Integer status; | |
| 54 | 56 | |
| 55 | 57 | //检验明细json |
| 56 | 58 | private String itemJson; |
| 59 | + | |
| 60 | + public Integer getStatus() { | |
| 61 | + return status; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public void setStatus(Integer status) { | |
| 65 | + this.status = status; | |
| 66 | + } | |
| 57 | 67 | |
| 58 | 68 | public String getItemJson() { |
| 59 | 69 | return itemJson; |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/LisReportQuery.java
View file @
4ef9bdc
| 1 | +package com.lyms.platform.permission.model; | |
| 2 | + | |
| 3 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 4 | + | |
| 5 | +import java.util.Date; | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +/** | |
| 9 | + * @author lqy | |
| 10 | + * | |
| 11 | + */ | |
| 12 | +public class LisReportQuery extends BaseQuery { | |
| 13 | + | |
| 14 | + private Integer id; | |
| 15 | + // 检验报告ID | |
| 16 | + private String lisId; | |
| 17 | + // 检验报告名称 | |
| 18 | + private String title; | |
| 19 | + // 检验报告类型 | |
| 20 | + private String type; | |
| 21 | + // 就诊卡号 | |
| 22 | + private String vcCardNo; | |
| 23 | + // 患者姓名 | |
| 24 | + private String name; | |
| 25 | + // 住院号 | |
| 26 | + private String bhnum; | |
| 27 | + // 患者年龄 | |
| 28 | + private String age; | |
| 29 | + // 患者性别 | |
| 30 | + private String sex; | |
| 31 | + // 送检日期 | |
| 32 | + private Date applyTime; | |
| 33 | + // 检验时间 | |
| 34 | + private Date checkTime; | |
| 35 | + // 报告发布时间 | |
| 36 | + private Date publishTime; | |
| 37 | + // 送检医生 | |
| 38 | + private String applyDoctor; | |
| 39 | + // 送检科室 | |
| 40 | + private String applyDept; | |
| 41 | + // 检验员 | |
| 42 | + private String checker; | |
| 43 | + // 最后修改时间 | |
| 44 | + private Date modified; | |
| 45 | + // 创建时间 | |
| 46 | + private Date created; | |
| 47 | + // 医院id | |
| 48 | + private String hospitalId; | |
| 49 | + | |
| 50 | + //联系方式 | |
| 51 | + private String phone; | |
| 52 | + | |
| 53 | + //检验项集合 | |
| 54 | + private List<LisReportItemModel> items; | |
| 55 | + | |
| 56 | + //数据状态是否被客户端查看过 0未查看 1查看 | |
| 57 | + private Integer status; | |
| 58 | + | |
| 59 | + //检验明细json | |
| 60 | + private String itemJson; | |
| 61 | + | |
| 62 | + public Integer getStatus() { | |
| 63 | + return status; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public void setStatus(Integer status) { | |
| 67 | + this.status = status; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public String getItemJson() { | |
| 71 | + return itemJson; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setItemJson(String itemJson) { | |
| 75 | + this.itemJson = itemJson; | |
| 76 | + } | |
| 77 | + | |
| 78 | + public String getPhone() { | |
| 79 | + return phone; | |
| 80 | + } | |
| 81 | + | |
| 82 | + public void setPhone(String phone) { | |
| 83 | + this.phone = phone; | |
| 84 | + } | |
| 85 | + | |
| 86 | + public List<LisReportItemModel> getItems() { | |
| 87 | + return items; | |
| 88 | + } | |
| 89 | + | |
| 90 | + public void setItems(List<LisReportItemModel> items) { | |
| 91 | + this.items = items; | |
| 92 | + } | |
| 93 | + | |
| 94 | + public Integer getId() { | |
| 95 | + return id; | |
| 96 | + } | |
| 97 | + | |
| 98 | + public void setId(Integer id) { | |
| 99 | + this.id = id; | |
| 100 | + } | |
| 101 | + | |
| 102 | + public String getLisId() { | |
| 103 | + return lisId; | |
| 104 | + } | |
| 105 | + | |
| 106 | + public void setLisId(String lisId) { | |
| 107 | + this.lisId = lisId; | |
| 108 | + } | |
| 109 | + | |
| 110 | + public String getTitle() { | |
| 111 | + return title; | |
| 112 | + } | |
| 113 | + | |
| 114 | + public void setTitle(String title) { | |
| 115 | + this.title = title; | |
| 116 | + } | |
| 117 | + | |
| 118 | + public String getType() { | |
| 119 | + return type; | |
| 120 | + } | |
| 121 | + | |
| 122 | + public void setType(String type) { | |
| 123 | + this.type = type; | |
| 124 | + } | |
| 125 | + | |
| 126 | + public String getVcCardNo() { | |
| 127 | + return vcCardNo; | |
| 128 | + } | |
| 129 | + | |
| 130 | + public void setVcCardNo(String vcCardNo) { | |
| 131 | + this.vcCardNo = vcCardNo; | |
| 132 | + } | |
| 133 | + | |
| 134 | + public String getName() { | |
| 135 | + return name; | |
| 136 | + } | |
| 137 | + | |
| 138 | + public void setName(String name) { | |
| 139 | + this.name = name; | |
| 140 | + } | |
| 141 | + | |
| 142 | + public String getBhnum() { | |
| 143 | + return bhnum; | |
| 144 | + } | |
| 145 | + | |
| 146 | + public void setBhnum(String bhnum) { | |
| 147 | + this.bhnum = bhnum; | |
| 148 | + } | |
| 149 | + | |
| 150 | + public String getAge() { | |
| 151 | + return age; | |
| 152 | + } | |
| 153 | + | |
| 154 | + public void setAge(String age) { | |
| 155 | + this.age = age; | |
| 156 | + } | |
| 157 | + | |
| 158 | + public String getSex() { | |
| 159 | + return sex; | |
| 160 | + } | |
| 161 | + | |
| 162 | + public void setSex(String sex) { | |
| 163 | + this.sex = sex; | |
| 164 | + } | |
| 165 | + | |
| 166 | + public Date getApplyTime() { | |
| 167 | + return applyTime; | |
| 168 | + } | |
| 169 | + | |
| 170 | + public void setApplyTime(Date applyTime) { | |
| 171 | + this.applyTime = applyTime; | |
| 172 | + } | |
| 173 | + | |
| 174 | + public Date getCheckTime() { | |
| 175 | + return checkTime; | |
| 176 | + } | |
| 177 | + | |
| 178 | + public void setCheckTime(Date checkTime) { | |
| 179 | + this.checkTime = checkTime; | |
| 180 | + } | |
| 181 | + | |
| 182 | + public Date getPublishTime() { | |
| 183 | + return publishTime; | |
| 184 | + } | |
| 185 | + | |
| 186 | + public void setPublishTime(Date publishTime) { | |
| 187 | + this.publishTime = publishTime; | |
| 188 | + } | |
| 189 | + | |
| 190 | + public String getApplyDoctor() { | |
| 191 | + return applyDoctor; | |
| 192 | + } | |
| 193 | + | |
| 194 | + public void setApplyDoctor(String applyDoctor) { | |
| 195 | + this.applyDoctor = applyDoctor; | |
| 196 | + } | |
| 197 | + | |
| 198 | + public String getApplyDept() { | |
| 199 | + return applyDept; | |
| 200 | + } | |
| 201 | + | |
| 202 | + public void setApplyDept(String applyDept) { | |
| 203 | + this.applyDept = applyDept; | |
| 204 | + } | |
| 205 | + | |
| 206 | + public String getChecker() { | |
| 207 | + return checker; | |
| 208 | + } | |
| 209 | + | |
| 210 | + public void setChecker(String checker) { | |
| 211 | + this.checker = checker; | |
| 212 | + } | |
| 213 | + | |
| 214 | + public Date getModified() { | |
| 215 | + return modified; | |
| 216 | + } | |
| 217 | + | |
| 218 | + public void setModified(Date modified) { | |
| 219 | + this.modified = modified; | |
| 220 | + } | |
| 221 | + | |
| 222 | + public Date getCreated() { | |
| 223 | + return created; | |
| 224 | + } | |
| 225 | + | |
| 226 | + public void setCreated(Date created) { | |
| 227 | + this.created = created; | |
| 228 | + } | |
| 229 | + | |
| 230 | + public String getHospitalId() { | |
| 231 | + return hospitalId; | |
| 232 | + } | |
| 233 | + | |
| 234 | + public void setHospitalId(String hospitalId) { | |
| 235 | + this.hospitalId = hospitalId; | |
| 236 | + } | |
| 237 | + | |
| 238 | + @Override | |
| 239 | + public String toString() { | |
| 240 | + return "LisReportModel [id=" + id + ", lisId=" + lisId + ", title=" | |
| 241 | + + title + ", type=" + type + ", vcCardNo=" + vcCardNo | |
| 242 | + + ", name=" + name + ", bhnum=" + bhnum + ", age=" + age | |
| 243 | + + ", sex=" + sex + ", applyTime=" + applyTime + ", checkTime=" | |
| 244 | + + checkTime + ", publishTime=" + publishTime + ", applyDoctor=" | |
| 245 | + + applyDoctor + ", applyDept=" + applyDept + ", checker=" | |
| 246 | + + checker + ", modified=" + modified + ", created=" + created | |
| 247 | + + ", hospitalId=" + hospitalId + "]"; | |
| 248 | + } | |
| 249 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/LisService.java
View file @
4ef9bdc
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | import com.lyms.platform.common.result.BaseResponse; |
| 5 | 5 | import com.lyms.platform.permission.model.LisReportItemModel; |
| 6 | 6 | import com.lyms.platform.permission.model.LisReportModel; |
| 7 | +import com.lyms.platform.permission.model.LisReportQuery; | |
| 7 | 8 | |
| 8 | 9 | import java.util.List; |
| 9 | 10 | |
| ... | ... | @@ -16,5 +17,9 @@ |
| 16 | 17 | List<LisReportItemModel> queryLisItemByModel(LisReportItemModel query); |
| 17 | 18 | |
| 18 | 19 | List<LisReportModel> queryListItems(LisReportModel model); |
| 20 | + | |
| 21 | + List<LisReportModel> queryLisDataByQuery(LisReportQuery query); | |
| 22 | + | |
| 23 | + void updateAppLisStatus(List<String> list); | |
| 19 | 24 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java
View file @
4ef9bdc
| ... | ... | @@ -7,6 +7,7 @@ |
| 7 | 7 | import com.lyms.platform.permission.dao.master.MasterLisMapper; |
| 8 | 8 | import com.lyms.platform.permission.model.LisReportItemModel; |
| 9 | 9 | import com.lyms.platform.permission.model.LisReportModel; |
| 10 | +import com.lyms.platform.permission.model.LisReportQuery; | |
| 10 | 11 | import com.lyms.platform.permission.service.LisService; |
| 11 | 12 | import org.apache.commons.collections.CollectionUtils; |
| 12 | 13 | import org.codehaus.jackson.type.TypeReference; |
| 13 | 14 | |
| ... | ... | @@ -26,9 +27,7 @@ |
| 26 | 27 | public BaseResponse saveLisData(final List<LisReportModel> lisList) { |
| 27 | 28 | |
| 28 | 29 | try { |
| 29 | -// final List<LisReportModel> lisList =JsonUtil.jkstr2List(lisData, new TypeReference<List<LisReportModel>>() {}); | |
| 30 | 30 | System.out.println("saveLis data size = "+ lisList.size()); |
| 31 | - | |
| 32 | 31 | if (CollectionUtils.isNotEmpty(lisList)) |
| 33 | 32 | { |
| 34 | 33 | new Thread(new Runnable() { |
| ... | ... | @@ -40,11 +39,6 @@ |
| 40 | 39 | if (CollectionUtils.isEmpty(dbLis)) |
| 41 | 40 | { |
| 42 | 41 | masterLisMapper.saveLisData(model); |
| 43 | -// List<LisReportItemModel> items = model.getItems(); | |
| 44 | -// if (CollectionUtils.isNotEmpty(items)) | |
| 45 | -// { | |
| 46 | -// masterLisMapper.saveLisItemsData(items); | |
| 47 | -// } | |
| 48 | 42 | } |
| 49 | 43 | |
| 50 | 44 | } |
| ... | ... | @@ -75,6 +69,19 @@ |
| 75 | 69 | @Override |
| 76 | 70 | public List<LisReportModel> queryListItems(LisReportModel query) { |
| 77 | 71 | return masterLisMapper.queryListItems(query); |
| 72 | + } | |
| 73 | + | |
| 74 | + @Override | |
| 75 | + public List<LisReportModel> queryLisDataByQuery(LisReportQuery query) { | |
| 76 | + if (query.getNeed() != null) { | |
| 77 | + query.mysqlBuild( masterLisMapper.queryLisCount(query)); | |
| 78 | + } | |
| 79 | + return masterLisMapper.queryLisDataByQuery(query); | |
| 80 | + } | |
| 81 | + | |
| 82 | + @Override | |
| 83 | + public void updateAppLisStatus(List<String> list) { | |
| 84 | + masterLisMapper.updateAppLisStatus(list); | |
| 78 | 85 | } |
| 79 | 86 | } |
platform-biz-service/src/main/resources/mainOrm/master/MasterLis.xml
View file @
4ef9bdc
| ... | ... | @@ -184,7 +184,8 @@ |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | <resultMap id="queryListItemsMap" type="com.lyms.platform.permission.model.LisReportModel" > |
| 187 | - <id property="lisId" column="LIS_ID"/> | |
| 187 | + <id property="id" column="ID"/> | |
| 188 | + <result property="lisId" column="LIS_ID"/> | |
| 188 | 189 | <result property="title" column="TITLE"/> |
| 189 | 190 | <result property="type" column="TYPE"/> |
| 190 | 191 | <result property="vcCardNo" column="VCCARDNO"/> |
| 191 | 192 | |
| ... | ... | @@ -202,18 +203,79 @@ |
| 202 | 203 | <result property="created" column="CREATED"/> |
| 203 | 204 | <result property="hospitalId" column="HOSPITAL_ID"/> |
| 204 | 205 | <result property="phone" column="PHONE"/> |
| 205 | - <collection property="items" column="ITEM_LIS_ID" ofType="com.lyms.platform.permission.model.LisReportItemModel"> | |
| 206 | - <id property="lisId" column="ITEM_LIS_ID"/> | |
| 207 | - <result property="code" column="CODE"/> | |
| 208 | - <result property="name" column="ITEM_NAME"/> | |
| 209 | - <result property="result" column="RESULT"/> | |
| 210 | - <result property="resultFlag" column="RESULT_FLAG"/> | |
| 211 | - <result property="ref" column="REF"/> | |
| 212 | - <result property="resultType" column="RESULT_TYPE"/> | |
| 213 | - <result property="unit" column="UNIT"/> | |
| 214 | - <result property="printOrder" column="PRINT_ORDER"/> | |
| 215 | - <result property="hospitalId" column="HOSPITAL_ID"/> | |
| 216 | - </collection> | |
| 206 | + <result property="itemJson" column="ITEM_JSON"/> | |
| 207 | + <result property="status" column="STATUS"/> | |
| 217 | 208 | </resultMap> |
| 209 | + | |
| 210 | + | |
| 211 | + <sql id="orderAndLimit"> | |
| 212 | + <if test="sort != null and sort != '' "> | |
| 213 | + order by ${sort} | |
| 214 | + <if test="need != null"> | |
| 215 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
| 216 | + </if> | |
| 217 | + </if> | |
| 218 | + </sql> | |
| 219 | + | |
| 220 | + | |
| 221 | + <sql id="OrganizationCondition"> | |
| 222 | + <where> | |
| 223 | + 1 = 1 | |
| 224 | + <if test="vcCardNo != null or phone != null "> | |
| 225 | + AND (VCCARDNO=#{vcCardNo} OR PHONE = #{phone}) | |
| 226 | + </if> | |
| 227 | + | |
| 228 | + <if test="hospitalId != null"> | |
| 229 | + AND HOSPITAL_ID=#{hospitalId} | |
| 230 | + </if> | |
| 231 | + | |
| 232 | + <if test="status != null"> | |
| 233 | + AND STATUS=#{status} | |
| 234 | + </if> | |
| 235 | + </where> | |
| 236 | + </sql> | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + <select id="queryLisDataByQuery" parameterType="com.lyms.platform.permission.model.LisReportQuery" resultMap="queryListItemsMap"> | |
| 241 | + SELECT | |
| 242 | + ID, | |
| 243 | + LIS_ID, | |
| 244 | + TITLE, | |
| 245 | + TYPE, | |
| 246 | + VCCARDNO, | |
| 247 | + NAME, | |
| 248 | + BHNUM, | |
| 249 | + AGE, | |
| 250 | + SEX, | |
| 251 | + APPLY_TIME, | |
| 252 | + CHECK_TIME, | |
| 253 | + PUBLISH_TIME, | |
| 254 | + APPLY_DOCTOR, | |
| 255 | + APPLY_DEPT, | |
| 256 | + CHECKER, | |
| 257 | + MODIFIED, | |
| 258 | + CREATED, | |
| 259 | + HOSPITAL_ID, | |
| 260 | + PHONE, | |
| 261 | + ITEM_JSON | |
| 262 | + FROM LIS_REPORT_TBL | |
| 263 | + <include refid="LisCondition"/> | |
| 264 | + <include refid="orderAndLimit"/> | |
| 265 | + </select> | |
| 266 | + | |
| 267 | + <select id="queryLisCount" resultType="int" | |
| 268 | + parameterType="com.lyms.platform.permission.model.LisReportQuery"> | |
| 269 | + select count(1) from LIS_REPORT_TBL | |
| 270 | + <include refid="LisCondition"/> | |
| 271 | + </select> | |
| 272 | + | |
| 273 | + <update id="updateAppLisStatus" parameterType="java.util.List" > | |
| 274 | + UPDATE LIS_REPORT_TBL STATUS = 1 WHERE ID IN | |
| 275 | + <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> | |
| 276 | + #{item} | |
| 277 | + </foreach> | |
| 278 | + </update> | |
| 279 | + | |
| 218 | 280 | </mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/LisController.java
View file @
4ef9bdc
| ... | ... | @@ -3,8 +3,11 @@ |
| 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.base.LoginContext; |
| 6 | +import com.lyms.platform.common.constants.ErrorCodeConstants; | |
| 7 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
| 6 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 7 | 9 | import com.lyms.platform.common.utils.DateUtil; |
| 10 | +import com.lyms.platform.common.utils.ExceptionUtils; | |
| 8 | 11 | import com.lyms.platform.common.utils.JsonUtil; |
| 9 | 12 | import com.lyms.platform.operate.web.facade.LisFacade; |
| 10 | 13 | import com.lyms.platform.operate.web.request.LisReportModelRequest; |
| 11 | 14 | |
| 12 | 15 | |
| ... | ... | @@ -54,16 +57,10 @@ |
| 54 | 57 | List<LisReportItemModel> items = lisRequest.getItems(); |
| 55 | 58 | if (CollectionUtils.isNotEmpty(items)) |
| 56 | 59 | { |
| 57 | - System.out.println("====="+items.size()); | |
| 58 | - System.out.println("====="+JsonUtil.array2JsonString(items)); | |
| 59 | - | |
| 60 | 60 | model.setItemJson(JsonUtil.array2JsonString(items)); |
| 61 | - | |
| 62 | - | |
| 63 | - System.out.println(".................." + JsonUtil.array2JsonString(items)); | |
| 64 | - | |
| 65 | 61 | } |
| 66 | 62 | |
| 63 | + model.setStatus(0); | |
| 67 | 64 | model.setId(lisRequest.getId()); |
| 68 | 65 | model.setVcCardNo(lisRequest.getVcCardNo()); |
| 69 | 66 | model.setHospitalId(lisRequest.getHospitalId()); |
| ... | ... | @@ -88,41 +85,6 @@ |
| 88 | 85 | |
| 89 | 86 | } |
| 90 | 87 | } |
| 91 | - | |
| 92 | - | |
| 93 | - | |
| 94 | -// List<LisReportModel> list = new ArrayList<>(); | |
| 95 | -// if (models != null && models.size() > 0) | |
| 96 | -// { | |
| 97 | -// for(LisReportModelRequest lisRequest : models) | |
| 98 | -// { | |
| 99 | -// LisReportModel model = new LisReportModel(); | |
| 100 | -// model.setItems(lisRequest.getItems()); | |
| 101 | -// model.setId(lisRequest.getId()); | |
| 102 | -// model.setVcCardNo(lisRequest.getVcCardNo()); | |
| 103 | -// model.setHospitalId(lisRequest.getHospitalId()); | |
| 104 | -// model.setLisId(lisRequest.getLisId()); | |
| 105 | -// model.setAge(lisRequest.getAge()); | |
| 106 | -// model.setName(lisRequest.getName()); | |
| 107 | -// model.setBhnum(lisRequest.getBhnum()); | |
| 108 | -// model.setPhone(lisRequest.getPhone()); | |
| 109 | -// model.setSex(lisRequest.getSex()); | |
| 110 | -// model.setTitle(lisRequest.getTitle()); | |
| 111 | -// model.setType(lisRequest.getType()); | |
| 112 | -// model.setChecker(lisRequest.getChecker()); | |
| 113 | -// model.setApplyDept(lisRequest.getApplyDept()); | |
| 114 | -// model.setApplyDoctor(lisRequest.getApplyDoctor()); | |
| 115 | -// model.setApplyTime(DateUtil.parseYMDHMS(lisRequest.getApplyTime())); | |
| 116 | -// model.setPublishTime(DateUtil.parseYMDHMS(lisRequest.getPublishTime())); | |
| 117 | -// model.setModified(DateUtil.parseYMDHMS(lisRequest.getModified())); | |
| 118 | -// model.setCreated(DateUtil.parseYMDHMS(lisRequest.getCreated())); | |
| 119 | -// model.setCheckTime(DateUtil.parseYMDHMS(lisRequest.getCheckTime())); | |
| 120 | -// | |
| 121 | -// list.add(model); | |
| 122 | -// | |
| 123 | -// } | |
| 124 | -// } | |
| 125 | - | |
| 126 | 88 | return lisService.saveLisData(list); |
| 127 | 89 | } |
| 128 | 90 | |
| 129 | 91 | |
| 130 | 92 | |
| 131 | 93 | |
| ... | ... | @@ -141,21 +103,52 @@ |
| 141 | 103 | @RequestParam("sortType") Integer sortType, |
| 142 | 104 | HttpServletRequest request) { |
| 143 | 105 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 144 | - return lisFacade.getLisAndRisData(vcCardNo,sortType,loginState.getId()); | |
| 106 | + return lisFacade.getLisAndRisData(vcCardNo, sortType, loginState.getId()); | |
| 145 | 107 | } |
| 146 | 108 | |
| 147 | 109 | |
| 148 | 110 | /** |
| 149 | - * 返回小程序查询个人的lis报告 | |
| 111 | + * 返回小程序查询个人的lis报告 返回的是列表 | |
| 150 | 112 | * 该接口由app服务器端调用 |
| 151 | 113 | * @param patientId 院内系统的孕妇的建档id |
| 114 | + * @param status 0 未推送 1已推送 不传就查询所有 | |
| 152 | 115 | * @return |
| 153 | 116 | */ |
| 154 | 117 | @RequestMapping(method = RequestMethod.GET, value = "/getAppLis") |
| 155 | 118 | @ResponseBody |
| 156 | 119 | public BaseResponse getLisAndRisData(@RequestParam("patientId") String patientId, |
| 157 | - HttpServletRequest request) { | |
| 158 | - return lisFacade.getAppLis(patientId,request); | |
| 120 | + @RequestParam(required = false) Integer page, | |
| 121 | + @RequestParam(required = false) Integer limit, | |
| 122 | + @RequestParam(required = false) Integer status, | |
| 123 | + @RequestHeader("Authorization") String token) { | |
| 124 | + | |
| 125 | + if (!"3d19960bf3e81e7d816c4f26051c49ba".equals(token)) | |
| 126 | + { | |
| 127 | + ExceptionUtils.catchException("The request token is " + token); | |
| 128 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("Token is error"); | |
| 129 | + } | |
| 130 | + | |
| 131 | + return lisFacade.getAppLisList(patientId, status, page, limit); | |
| 132 | + } | |
| 133 | + | |
| 134 | + /** | |
| 135 | + * 更新lis为已经推送状态 | |
| 136 | + * @param ids | |
| 137 | + * @param token | |
| 138 | + * @return | |
| 139 | + */ | |
| 140 | + @RequestMapping(method = RequestMethod.PUT, value = "/updateAppLisStatus") | |
| 141 | + @ResponseBody | |
| 142 | + public BaseResponse updateAppLisStatus(@RequestParam("ids") String ids, | |
| 143 | + @RequestHeader("Authorization") String token) { | |
| 144 | + | |
| 145 | + if (!"3d19960bf3e81e7d816c4f26051c49ba".equals(token)) | |
| 146 | + { | |
| 147 | + ExceptionUtils.catchException("The request token is " + token); | |
| 148 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.TOKEN_EXPIRE).setErrormsg("Token is error"); | |
| 149 | + } | |
| 150 | + | |
| 151 | + return lisFacade.updateAppLisStatus(ids); | |
| 159 | 152 | } |
| 160 | 153 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java
View file @
4ef9bdc
| ... | ... | @@ -16,6 +16,7 @@ |
| 16 | 16 | import com.lyms.platform.operate.web.request.*; |
| 17 | 17 | import com.lyms.platform.operate.web.result.*; |
| 18 | 18 | import com.lyms.platform.permission.model.*; |
| 19 | +import com.lyms.platform.permission.model.LisReportQuery; | |
| 19 | 20 | import com.lyms.platform.permission.service.LisService; |
| 20 | 21 | import com.lyms.platform.permission.service.OrganizationService; |
| 21 | 22 | import com.lyms.platform.permission.service.UsersService; |
| 22 | 23 | |
| 23 | 24 | |
| 24 | 25 | |
| ... | ... | @@ -390,18 +391,58 @@ |
| 390 | 391 | /** |
| 391 | 392 | * 返回小程序查询个人的lis报告 |
| 392 | 393 | * 该接口由app服务器端调用 |
| 393 | - * @param patientId | |
| 394 | - * @param request | |
| 394 | + * @param patientId 院内系统孕妇建档id | |
| 395 | 395 | * @return |
| 396 | 396 | */ |
| 397 | - public BaseResponse getAppLis(String patientId, HttpServletRequest request) { | |
| 397 | + public BaseResponse getAppLisList(String patientId,Integer status,Integer page,Integer limit) { | |
| 398 | 398 | |
| 399 | - System.out.println(request.getRemoteAddr()); | |
| 400 | - System.out.println(request.getRemoteHost()); | |
| 401 | - System.out.println(request.getRemotePort()); | |
| 402 | - System.out.println(request.getRequestURI()); | |
| 403 | - System.out.println(request.getRequestURL()); | |
| 399 | + | |
| 400 | + PatientsQuery patientsQuery=new PatientsQuery(); | |
| 401 | + patientsQuery.setId(patientId); | |
| 402 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 403 | + List<Patients> list= patientsService.queryPatient(patientsQuery); | |
| 404 | + if (CollectionUtils.isNotEmpty(list)) | |
| 405 | + { | |
| 406 | + Patients patients = list.get(0); | |
| 407 | + | |
| 408 | + LisReportQuery query = new LisReportQuery(); | |
| 409 | + query.setPage(page); | |
| 410 | + query.setLimit(limit); | |
| 411 | + query.setNeed("true"); | |
| 412 | + query.setSort(" PUBLISH_TIME DESC "); | |
| 413 | + | |
| 414 | + query.setPhone(patients.getPhone()); | |
| 415 | + query.setVcCardNo(patients.getVcCardNo()); | |
| 416 | + query.setStatus(status); | |
| 417 | + query.setHospitalId(patients.getHospitalId()); | |
| 418 | + | |
| 419 | + List<LisReportModel> lises = lisService.queryLisDataByQuery(query); | |
| 420 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 421 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 422 | + objectResponse.setData(lises); | |
| 423 | + objectResponse.setErrormsg("成功"); | |
| 424 | + return objectResponse; | |
| 425 | + } | |
| 404 | 426 | return null; |
| 427 | + } | |
| 428 | + | |
| 429 | + /** | |
| 430 | + * 更新状态为已推送 | |
| 431 | + * @param ids | |
| 432 | + * @return | |
| 433 | + */ | |
| 434 | + public BaseResponse updateAppLisStatus(String ids) { | |
| 435 | + if (StringUtils.isNotEmpty(ids)) | |
| 436 | + { | |
| 437 | + String[] arrs = ids.split(","); | |
| 438 | + if (arrs != null && arrs.length > 0) | |
| 439 | + { | |
| 440 | + List<String> list = new ArrayList<>(); | |
| 441 | + CollectionUtils.addAll(list, arrs); | |
| 442 | + lisService.updateAppLisStatus(list); | |
| 443 | + } | |
| 444 | + } | |
| 445 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 405 | 446 | } |
| 406 | 447 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/MybatisSqlInterceptor.java
View file @
4ef9bdc
| ... | ... | @@ -41,12 +41,17 @@ |
| 41 | 41 | Configuration configuration = mappedStatement.getConfiguration(); |
| 42 | 42 | Object returnValue = invocation.proceed(); |
| 43 | 43 | String sql = getSql(configuration, boundSql, sqlId); |
| 44 | - System.out.println("mysql sql ======"+sql); | |
| 44 | + System.out.println("mysql sql ======" + sql); | |
| 45 | 45 | return returnValue; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public static String getSql(Configuration configuration, BoundSql boundSql, String sqlId) { |
| 49 | 49 | String sql = showSql(configuration, boundSql); |
| 50 | + //排除lis表 | |
| 51 | + if (sql.toUpperCase().contains("LIS_REPORT_TBL") || sql.toUpperCase().contains("RIS_REPORT_TBL")) | |
| 52 | + { | |
| 53 | + return sql; | |
| 54 | + } | |
| 50 | 55 | SendMysqlSyncDatUtil.sendSql(sql,sqlId); |
| 51 | 56 | return sql; |
| 52 | 57 | } |