Commit 9ad1def0a9c87cb147a88ce2be3564d91626b41f
1 parent
721c8619e5
Exists in
master
and in
6 other branches
服务
Showing 10 changed files with 482 additions and 7 deletions
- platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/SyncDataService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/TServiceTimeRecordMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/TServiceTimeRecordService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/TServiceTimeRecordServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/TServiceTimeRecord.xml
- platform-dal/src/main/java/com/lyms/platform/pojo/TServiceTimeRecord.java
- platform-dal/src/main/java/com/lyms/platform/query/TServiceTimeRecordQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceSysFacade.java
platform-biz-patient-service/src/main/java/com/lyms/platform/biz/service/SyncDataService.java
View file @
9ad1def
| ... | ... | @@ -4,10 +4,13 @@ |
| 4 | 4 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 5 | 5 | import com.lyms.platform.common.pojo.SyncDataModel; |
| 6 | 6 | import com.lyms.platform.common.pojo.SyncMysqlDataModel; |
| 7 | +import com.lyms.platform.common.result.BaseResponse; | |
| 7 | 8 | import com.lyms.platform.common.utils.ExceptionUtils; |
| 8 | 9 | import com.lyms.platform.common.utils.JsonUtil; |
| 9 | 10 | import com.lyms.platform.common.utils.SerializUtils; |
| 11 | +import com.lyms.platform.pojo.TServiceTimeRecord; | |
| 10 | 12 | import com.lyms.platform.query.SyncDataQuery; |
| 13 | +import net.sf.json.JSONObject; | |
| 11 | 14 | import org.apache.commons.codec.binary.Base64; |
| 12 | 15 | import org.apache.commons.lang.StringUtils; |
| 13 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -28,6 +31,7 @@ |
| 28 | 31 | @Autowired |
| 29 | 32 | private ISyncDataDao iSyncDataDao; |
| 30 | 33 | |
| 34 | + | |
| 31 | 35 | /** |
| 32 | 36 | * 对于不能访问外网的医院,先存到本地的库,由公网定时读并转发到短信中心 |
| 33 | 37 | */ |
| ... | ... | @@ -80,5 +84,6 @@ |
| 80 | 84 | } |
| 81 | 85 | return true; |
| 82 | 86 | } |
| 87 | + | |
| 83 | 88 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/TServiceTimeRecordMapper.java
View file @
9ad1def
| 1 | +package com.lyms.platform.permission.dao.master; | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | +import com.lyms.platform.pojo.TServiceTimeRecord; | |
| 6 | +import com.lyms.platform.query.TServiceTimeRecordQuery; | |
| 7 | + | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 10 | +public interface TServiceTimeRecordMapper { | |
| 11 | + | |
| 12 | + void addServiceTimeRecord(TServiceTimeRecord record); | |
| 13 | + List<TServiceTimeRecord> selectServiceTimeRecords(TServiceTimeRecordQuery query); | |
| 14 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/TServiceTimeRecordService.java
View file @
9ad1def
| 1 | +package com.lyms.platform.permission.service; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.lyms.platform.pojo.TServiceTimeRecord; | |
| 5 | +import com.lyms.platform.query.TServiceTimeRecordQuery; | |
| 6 | + | |
| 7 | +import java.util.List; | |
| 8 | + | |
| 9 | +public interface TServiceTimeRecordService { | |
| 10 | + void addServiceTimeRecord(TServiceTimeRecord record); | |
| 11 | + List<TServiceTimeRecord> selectServiceTimeRecords(TServiceTimeRecordQuery query); | |
| 12 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/TServiceTimeRecordServiceImpl.java
View file @
9ad1def
| 1 | +package com.lyms.platform.permission.service.impl; | |
| 2 | + | |
| 3 | + | |
| 4 | +import com.lyms.platform.permission.dao.master.TServiceTimeRecordMapper; | |
| 5 | +import com.lyms.platform.permission.service.TServiceTimeRecordService; | |
| 6 | +import com.lyms.platform.pojo.TServiceTimeRecord; | |
| 7 | +import com.lyms.platform.query.TServiceTimeRecordQuery; | |
| 8 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +@Service | |
| 14 | +public class TServiceTimeRecordServiceImpl implements TServiceTimeRecordService { | |
| 15 | + | |
| 16 | + @Autowired | |
| 17 | + private TServiceTimeRecordMapper tserviceTimeRecordMapper; | |
| 18 | + | |
| 19 | + | |
| 20 | + @Override | |
| 21 | + public void addServiceTimeRecord(TServiceTimeRecord record) { | |
| 22 | + tserviceTimeRecordMapper.addServiceTimeRecord(record); | |
| 23 | + } | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public List<TServiceTimeRecord> selectServiceTimeRecords(TServiceTimeRecordQuery query) { | |
| 27 | + return tserviceTimeRecordMapper.selectServiceTimeRecords(query); | |
| 28 | + } | |
| 29 | +} |
platform-biz-service/src/main/resources/mainOrm/master/TServiceTimeRecord.xml
View file @
9ad1def
| 1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
| 3 | +<mapper namespace="com.lyms.platform.permission.dao.master.TServiceTimeRecordMapper"> | |
| 4 | + | |
| 5 | + <insert id="addServiceTimeRecord" parameterType="com.lyms.platform.pojo.TServiceTimeRecord"> | |
| 6 | + insert into t_service_time_record | |
| 7 | + (serviceId,createTime,updateTime,startTime,endTime,type | |
| 8 | + ,weekStart,weekEnd,remark,patientId,memberId,foreignId) values | |
| 9 | + (#{serviceId},#{createTime},#{updateTime}, | |
| 10 | + #{startTime},#{endTime},#{type},#{weekStart},#{weekEnd},#{remark},#{patientId},#{memberId},#{foreignId}) | |
| 11 | + </insert> | |
| 12 | + | |
| 13 | + <select id="selectServiceTimeRecords" parameterType="com.lyms.platform.query.TServiceTimeRecordQuery" | |
| 14 | + resultType="com.lyms.platform.pojo.TServiceTimeRecord"> | |
| 15 | + SELECT id,serviceId,createTime,updateTime,startTime,endTime,type | |
| 16 | + ,weekStart,weekEnd,remark,patientId,memberId,foreignId from t_service_time_record | |
| 17 | + <include refid="TServiceTimeRecordCondition"/> | |
| 18 | + <include refid="orderAndLimit"/> | |
| 19 | + </select> | |
| 20 | + | |
| 21 | + | |
| 22 | + <sql id="TServiceTimeRecordCondition"> | |
| 23 | + <where> | |
| 24 | + 1 = 1 | |
| 25 | + <if test="id != null and id >= 0"> | |
| 26 | + and id = #{id,jdbcType=INTEGER} | |
| 27 | + </if> | |
| 28 | + <if test="serviceId != null"> | |
| 29 | + and serviceId = #{serviceId,jdbcType=INTEGER} | |
| 30 | + </if> | |
| 31 | + <if test="type != null and type >= 0"> | |
| 32 | + and type = #{type,jdbcType=INTEGER} | |
| 33 | + </if> | |
| 34 | + <if test="patientId != null and patientId >= 0"> | |
| 35 | + and patientId = #{patientId,jdbcType=INTEGER} | |
| 36 | + </if> | |
| 37 | + <if test="foreignId != null"> | |
| 38 | + and foreignId = #{foreignId} | |
| 39 | + </if> | |
| 40 | + <if test="memberId != null and memberId >= 0"> | |
| 41 | + and memberId = #{memberId,jdbcType=INTEGER} | |
| 42 | + </if> | |
| 43 | + <if test="weekStart != null and weekStart >= 0"> | |
| 44 | + <![CDATA[ and weekStart >= #{weekStart,jdbcType=INTEGER} ]]> | |
| 45 | + </if> | |
| 46 | + <if test="weekEnd != null and weekEnd >= 0"> | |
| 47 | + <![CDATA[ and weekEnd <= #{weekEnd,jdbcType=INTEGER} ]]> | |
| 48 | + </if> | |
| 49 | + <if test="startTime != null"> | |
| 50 | + <![CDATA[ and startTime >= #{startTime,jdbcType=TIMESTAMP} ]]> | |
| 51 | + </if> | |
| 52 | + <if test="endTime != null"> | |
| 53 | + <![CDATA[ and endTime <= #{endTime,jdbcType=TIMESTAMP} ]]> | |
| 54 | + </if> | |
| 55 | + | |
| 56 | + </where> | |
| 57 | + </sql> | |
| 58 | + | |
| 59 | + <sql id="orderAndLimit"> | |
| 60 | + <if test="sort != null and sort != '' "> | |
| 61 | + order by ${sort} | |
| 62 | + <if test="need != null"> | |
| 63 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
| 64 | + </if> | |
| 65 | + </if> | |
| 66 | + </sql> | |
| 67 | + | |
| 68 | +</mapper> |
platform-dal/src/main/java/com/lyms/platform/pojo/TServiceTimeRecord.java
View file @
9ad1def
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import java.util.Date; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 服务周期表 | |
| 7 | + */ | |
| 8 | +public class TServiceTimeRecord { | |
| 9 | + private Integer id; | |
| 10 | + private Integer serviceId;//t_patient_service_record表的主键', | |
| 11 | + private Date createTime;//创建时间', | |
| 12 | + private Date updateTime; | |
| 13 | + private Date startTime;//服务开始时间', | |
| 14 | + private Date endTime;//服务结束时间', | |
| 15 | + private Integer type;//'1单次服务 2一个月 3、一个季度 4 全孕周', | |
| 16 | + private Integer weekStart;//服务孕周', | |
| 17 | + private Integer weekEnd;//服务孕周', | |
| 18 | + private String remark;//备注', | |
| 19 | + private Integer patientId; | |
| 20 | + private Integer memberId; | |
| 21 | + private String foreignId; | |
| 22 | + | |
| 23 | + public Integer getId() { | |
| 24 | + return id; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public void setId(Integer id) { | |
| 28 | + this.id = id; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public Integer getServiceId() { | |
| 32 | + return serviceId; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void setServiceId(Integer serviceId) { | |
| 36 | + this.serviceId = serviceId; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public Date getCreateTime() { | |
| 40 | + return createTime; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public Date getUpdateTime() { | |
| 44 | + return updateTime; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setUpdateTime(Date updateTime) { | |
| 48 | + this.updateTime = updateTime; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public void setCreateTime(Date createTime) { | |
| 52 | + this.createTime = createTime; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public Date getStartTime() { | |
| 56 | + return startTime; | |
| 57 | + } | |
| 58 | + | |
| 59 | + public void setStartTime(Date startTime) { | |
| 60 | + this.startTime = startTime; | |
| 61 | + } | |
| 62 | + | |
| 63 | + public Date getEndTime() { | |
| 64 | + return endTime; | |
| 65 | + } | |
| 66 | + | |
| 67 | + public void setEndTime(Date endTime) { | |
| 68 | + this.endTime = endTime; | |
| 69 | + } | |
| 70 | + | |
| 71 | + public Integer getType() { | |
| 72 | + return type; | |
| 73 | + } | |
| 74 | + | |
| 75 | + public void setType(Integer type) { | |
| 76 | + this.type = type; | |
| 77 | + } | |
| 78 | + | |
| 79 | + public Integer getWeekStart() { | |
| 80 | + return weekStart; | |
| 81 | + } | |
| 82 | + | |
| 83 | + public void setWeekStart(Integer weekStart) { | |
| 84 | + this.weekStart = weekStart; | |
| 85 | + } | |
| 86 | + | |
| 87 | + public Integer getWeekEnd() { | |
| 88 | + return weekEnd; | |
| 89 | + } | |
| 90 | + | |
| 91 | + public void setWeekEnd(Integer weekEnd) { | |
| 92 | + this.weekEnd = weekEnd; | |
| 93 | + } | |
| 94 | + | |
| 95 | + public String getRemark() { | |
| 96 | + return remark; | |
| 97 | + } | |
| 98 | + | |
| 99 | + public void setRemark(String remark) { | |
| 100 | + this.remark = remark; | |
| 101 | + } | |
| 102 | + | |
| 103 | + public Integer getPatientId() { | |
| 104 | + return patientId; | |
| 105 | + } | |
| 106 | + | |
| 107 | + public void setPatientId(Integer patientId) { | |
| 108 | + this.patientId = patientId; | |
| 109 | + } | |
| 110 | + | |
| 111 | + public Integer getMemberId() { | |
| 112 | + return memberId; | |
| 113 | + } | |
| 114 | + | |
| 115 | + public void setMemberId(Integer memberId) { | |
| 116 | + this.memberId = memberId; | |
| 117 | + } | |
| 118 | + | |
| 119 | + public String getForeignId() { | |
| 120 | + return foreignId; | |
| 121 | + } | |
| 122 | + | |
| 123 | + public void setForeignId(String foreignId) { | |
| 124 | + this.foreignId = foreignId; | |
| 125 | + } | |
| 126 | + | |
| 127 | + @Override | |
| 128 | + public String toString() { | |
| 129 | + return "TServiceTimeRecord{" + | |
| 130 | + "id=" + id + | |
| 131 | + ", serviceId=" + serviceId + | |
| 132 | + ", createTime=" + createTime + | |
| 133 | + ", startTime=" + startTime + | |
| 134 | + ", endTime=" + endTime + | |
| 135 | + ", type=" + type + | |
| 136 | + ", weekStart=" + weekStart + | |
| 137 | + ", weekEnd=" + weekEnd + | |
| 138 | + ", remark='" + remark + '\'' + | |
| 139 | + ", patientId=" + patientId + | |
| 140 | + ", memberId=" + memberId + | |
| 141 | + ", foreignId='" + foreignId + '\'' + | |
| 142 | + '}'; | |
| 143 | + } | |
| 144 | +} |
platform-dal/src/main/java/com/lyms/platform/query/TServiceTimeRecordQuery.java
View file @
9ad1def
| 1 | +package com.lyms.platform.query; | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | +import com.lyms.platform.common.dao.BaseQuery; | |
| 6 | + | |
| 7 | +import java.util.Date; | |
| 8 | + | |
| 9 | + | |
| 10 | +public class TServiceTimeRecordQuery extends BaseQuery { | |
| 11 | + private Integer id; | |
| 12 | + private Integer serviceId;//t_patient_service_record表的主键', | |
| 13 | + private Date createTime;//创建时间', | |
| 14 | + private Date startTime;//服务开始时间', | |
| 15 | + private Date endTime;//服务结束时间', | |
| 16 | + private Date type;//'1单次服务 2一个月 3、一个季度 4 全孕周', | |
| 17 | + private Date weekStart;//服务孕周', | |
| 18 | + private Date weekEnd;//服务孕周', | |
| 19 | + private Date remark;//备注', | |
| 20 | + private Integer memberId; | |
| 21 | + private String foreignId;// | |
| 22 | + private String patientId; | |
| 23 | + | |
| 24 | + public Date getCreateTime() { | |
| 25 | + return createTime; | |
| 26 | + } | |
| 27 | + | |
| 28 | + public void setCreateTime(Date createTime) { | |
| 29 | + this.createTime = createTime; | |
| 30 | + } | |
| 31 | + | |
| 32 | + public Date getRemark() { | |
| 33 | + return remark; | |
| 34 | + } | |
| 35 | + | |
| 36 | + public void setRemark(Date remark) { | |
| 37 | + this.remark = remark; | |
| 38 | + } | |
| 39 | + | |
| 40 | + public String getPatientId() { | |
| 41 | + return patientId; | |
| 42 | + } | |
| 43 | + | |
| 44 | + public void setPatientId(String patientId) { | |
| 45 | + this.patientId = patientId; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public Integer getMemberId() { | |
| 49 | + return memberId; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public void setMemberId(Integer memberId) { | |
| 53 | + this.memberId = memberId; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public String getForeignId() { | |
| 57 | + return foreignId; | |
| 58 | + } | |
| 59 | + | |
| 60 | + public void setForeignId(String foreignId) { | |
| 61 | + this.foreignId = foreignId; | |
| 62 | + } | |
| 63 | + | |
| 64 | + public Integer getId() { | |
| 65 | + return id; | |
| 66 | + } | |
| 67 | + | |
| 68 | + public void setId(Integer id) { | |
| 69 | + this.id = id; | |
| 70 | + } | |
| 71 | + | |
| 72 | + public Integer getServiceId() { | |
| 73 | + return serviceId; | |
| 74 | + } | |
| 75 | + | |
| 76 | + public void setServiceId(Integer serviceId) { | |
| 77 | + this.serviceId = serviceId; | |
| 78 | + } | |
| 79 | + | |
| 80 | + public Date getEndTime() { | |
| 81 | + return endTime; | |
| 82 | + } | |
| 83 | + | |
| 84 | + public void setEndTime(Date endTime) { | |
| 85 | + this.endTime = endTime; | |
| 86 | + } | |
| 87 | + | |
| 88 | + public Date getStartTime() { | |
| 89 | + return startTime; | |
| 90 | + } | |
| 91 | + | |
| 92 | + public void setStartTime(Date startTime) { | |
| 93 | + this.startTime = startTime; | |
| 94 | + } | |
| 95 | + | |
| 96 | + public Date getType() { | |
| 97 | + return type; | |
| 98 | + } | |
| 99 | + | |
| 100 | + public void setType(Date type) { | |
| 101 | + this.type = type; | |
| 102 | + } | |
| 103 | + | |
| 104 | + public Date getWeekStart() { | |
| 105 | + return weekStart; | |
| 106 | + } | |
| 107 | + | |
| 108 | + public void setWeekStart(Date weekStart) { | |
| 109 | + this.weekStart = weekStart; | |
| 110 | + } | |
| 111 | + | |
| 112 | + public Date getWeekEnd() { | |
| 113 | + return weekEnd; | |
| 114 | + } | |
| 115 | + | |
| 116 | + public void setWeekEnd(Date weekEnd) { | |
| 117 | + this.weekEnd = weekEnd; | |
| 118 | + } | |
| 119 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SyncDataController.java
View file @
9ad1def
| ... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 | import com.lyms.platform.common.utils.ExceptionUtils; |
| 13 | 13 | import com.lyms.platform.common.utils.JsonUtil; |
| 14 | 14 | import com.lyms.platform.common.utils.LymsEncodeUtil; |
| 15 | +import com.lyms.platform.operate.web.facade.PatientServiceSysFacade; | |
| 15 | 16 | import com.lyms.platform.operate.web.facade.SysBaseFacade; |
| 16 | 17 | import com.lyms.platform.operate.web.request.SqlRequest; |
| 17 | 18 | import com.lyms.platform.permission.service.OrganizationService; |
| ... | ... | @@ -54,6 +55,9 @@ |
| 54 | 55 | @Autowired |
| 55 | 56 | private OrganizationService organizationService; |
| 56 | 57 | |
| 58 | + @Autowired | |
| 59 | + private PatientServiceSysFacade patientServiceSysFacade; | |
| 60 | + | |
| 57 | 61 | public static String mongo_crypto_key = Config.getItem("mongo_crypto_key", "0"); |
| 58 | 62 | |
| 59 | 63 | /** |
| ... | ... | @@ -84,6 +88,26 @@ |
| 84 | 88 | return baseResponse; |
| 85 | 89 | } |
| 86 | 90 | } |
| 91 | + | |
| 92 | + @ResponseBody | |
| 93 | + @RequestMapping(value = "/syncJzServiceData", method = RequestMethod.POST) | |
| 94 | + public BaseResponse syncJzServiceData( | |
| 95 | + @RequestParam(value = "action", required = true) String action, | |
| 96 | + @RequestParam(value = "synForm", required = true) String synForm | |
| 97 | + ) { | |
| 98 | + try { | |
| 99 | + System.out.println("syncJzServiceData:action:" + action + ",synForm:" + synForm); | |
| 100 | + return patientServiceSysFacade.syncJzServiceData(synForm); | |
| 101 | + } catch (Exception e) { | |
| 102 | + log.error("syncJzServiceData",e); | |
| 103 | + BaseResponse baseResponse = new BaseResponse(); | |
| 104 | + baseResponse.setObject(e.getMessage()); | |
| 105 | + baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
| 106 | + baseResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); | |
| 107 | + return baseResponse; | |
| 108 | + } | |
| 109 | + } | |
| 110 | + | |
| 87 | 111 | |
| 88 | 112 | /** |
| 89 | 113 | * 小程序同步数据接口 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceFacade.java
View file @
9ad1def
| ... | ... | @@ -16,12 +16,10 @@ |
| 16 | 16 | import com.lyms.platform.operate.web.result.PatientSerResult; |
| 17 | 17 | import com.lyms.platform.permission.model.*; |
| 18 | 18 | import com.lyms.platform.permission.service.*; |
| 19 | -import com.lyms.platform.pojo.AssistBuildUserModel; | |
| 20 | -import com.lyms.platform.pojo.BabyModel; | |
| 21 | -import com.lyms.platform.pojo.BasicConfig; | |
| 22 | -import com.lyms.platform.pojo.Patients; | |
| 19 | +import com.lyms.platform.pojo.*; | |
| 23 | 20 | import com.lyms.platform.query.BasicConfigQuery; |
| 24 | 21 | import com.lyms.platform.query.PatientsQuery; |
| 22 | +import com.lyms.platform.query.TServiceTimeRecordQuery; | |
| 25 | 23 | import net.sf.json.JSONObject; |
| 26 | 24 | import org.apache.commons.collections.CollectionUtils; |
| 27 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | ... | @@ -71,6 +69,9 @@ |
| 71 | 69 | private static List<BasicConfig> tiRuoBasicConfigList; |
| 72 | 70 | |
| 73 | 71 | @Autowired |
| 72 | + private TServiceTimeRecordService serviceTimeRecordService; | |
| 73 | + | |
| 74 | + @Autowired | |
| 74 | 75 | private AssistBuildService assistBuildService; |
| 75 | 76 | |
| 76 | 77 | public BaseResponse babyServiceInit(Integer userId) { |
| ... | ... | @@ -543,6 +544,12 @@ |
| 543 | 544 | result.setPid(ps.getPid()); |
| 544 | 545 | result.setSerType(ps.getSerType()); |
| 545 | 546 | String serType = PatientSerEnums.SerTypeEnums.getTitle(ps.getSerType()); |
| 547 | + | |
| 548 | + if (String.valueOf(PatientSerEnums.SerTypeEnums.yqjzzd.getId()).equals(serType)) | |
| 549 | + { | |
| 550 | + serType+=getServiceCricle(ps.getParentid()); | |
| 551 | + } | |
| 552 | + | |
| 546 | 553 | result.setSerTypeStr(serType); |
| 547 | 554 | result.setSerStatus(ps.getSerStatus()); |
| 548 | 555 | String serStatus = PatientSerEnums.SerStatusEnums.getTitle(ps.getSerStatus()); |
| ... | ... | @@ -580,6 +587,35 @@ |
| 580 | 587 | result.setBackUser(ps.getSerDoct()); |
| 581 | 588 | result.setSerDoct(ps.getSerDoct()); |
| 582 | 589 | return result; |
| 590 | + } | |
| 591 | + | |
| 592 | + public String getServiceCricle(String patientId) | |
| 593 | + { | |
| 594 | + TServiceTimeRecordQuery stquery = new TServiceTimeRecordQuery(); | |
| 595 | + stquery.setForeignId(patientId); | |
| 596 | + stquery.setSort(" createTime desc"); | |
| 597 | + String serType = ""; | |
| 598 | + List<TServiceTimeRecord> tsList = serviceTimeRecordService.selectServiceTimeRecords(stquery); | |
| 599 | + if (CollectionUtils.isNotEmpty(tsList)) | |
| 600 | + { | |
| 601 | + TServiceTimeRecord serviceTimeRecord = tsList.get(0); | |
| 602 | + if (serviceTimeRecord.getType() != null) | |
| 603 | + { | |
| 604 | + if (serviceTimeRecord.getType() == 1) | |
| 605 | + { | |
| 606 | + serType+="(单次)"; | |
| 607 | + } | |
| 608 | + else if (serviceTimeRecord.getType() == 2) | |
| 609 | + { | |
| 610 | + serType+="(一个月)"; | |
| 611 | + } | |
| 612 | + else if (serviceTimeRecord.getType() == 3) | |
| 613 | + { | |
| 614 | + serType+="(一个季度)"; | |
| 615 | + } | |
| 616 | + } | |
| 617 | + } | |
| 618 | + return serType; | |
| 583 | 619 | } |
| 584 | 620 | |
| 585 | 621 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientServiceSysFacade.java
View file @
9ad1def
| ... | ... | @@ -7,13 +7,16 @@ |
| 7 | 7 | import com.lyms.platform.common.enums.ServiceStatusEnums; |
| 8 | 8 | import com.lyms.platform.common.enums.ServiceTypeEnums; |
| 9 | 9 | import com.lyms.platform.common.result.BaseResponse; |
| 10 | +import com.lyms.platform.common.utils.JsonUtil; | |
| 10 | 11 | import com.lyms.platform.common.utils.StringUtils; |
| 11 | 12 | import com.lyms.platform.operate.web.request.BabyBookbuildingAddRequest; |
| 12 | 13 | import com.lyms.platform.permission.model.PatientService; |
| 13 | 14 | import com.lyms.platform.permission.model.PatientServiceQuery; |
| 14 | 15 | import com.lyms.platform.permission.service.PatientServiceService; |
| 16 | +import com.lyms.platform.permission.service.TServiceTimeRecordService; | |
| 15 | 17 | import com.lyms.platform.pojo.BabyModel; |
| 16 | 18 | import com.lyms.platform.pojo.Patients; |
| 19 | +import com.lyms.platform.pojo.TServiceTimeRecord; | |
| 17 | 20 | import net.sf.json.JSONArray; |
| 18 | 21 | import net.sf.json.JSONObject; |
| 19 | 22 | import org.apache.commons.collections.CollectionUtils; |
| ... | ... | @@ -43,6 +46,10 @@ |
| 43 | 46 | @Autowired |
| 44 | 47 | private BabyBookbuildingFacade babyBookbuildingFacade; |
| 45 | 48 | |
| 49 | + | |
| 50 | + @Autowired | |
| 51 | + private TServiceTimeRecordService serviceTimeRecordService; | |
| 52 | + | |
| 46 | 53 | @Override |
| 47 | 54 | public BaseResponse execute(String synForm) { |
| 48 | 55 | JSONArray jsonArray = JSONArray.fromObject(synForm); |
| 49 | 56 | |
| ... | ... | @@ -145,10 +152,7 @@ |
| 145 | 152 | } |
| 146 | 153 | } |
| 147 | 154 | } |
| 148 | - | |
| 149 | - System.out.println("同步数据方法结束"); | |
| 150 | 155 | baseResponse.setErrorcode(0); |
| 151 | - // baseResponse.setObject(synForm); | |
| 152 | 156 | baseResponse.setErrormsg("成功"); |
| 153 | 157 | return baseResponse; |
| 154 | 158 | } |
| ... | ... | @@ -209,6 +213,26 @@ |
| 209 | 213 | baseResponse.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); |
| 210 | 214 | return baseResponse; |
| 211 | 215 | } |
| 216 | + baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 217 | + return baseResponse; | |
| 218 | + } | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + public BaseResponse syncJzServiceData(String synForm) { | |
| 223 | + BaseResponse baseResponse = new BaseResponse(); | |
| 224 | + | |
| 225 | + try { | |
| 226 | + TServiceTimeRecord serviceTimeRecord = JsonUtil.str2Obj(synForm, TServiceTimeRecord.class); | |
| 227 | + serviceTimeRecordService.addServiceTimeRecord(serviceTimeRecord); | |
| 228 | + } | |
| 229 | + catch (Exception e) | |
| 230 | + { | |
| 231 | + baseResponse.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION); | |
| 232 | + baseResponse.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
| 233 | + return baseResponse; | |
| 234 | + } | |
| 235 | + baseResponse.setErrormsg(ErrorCodeConstants.SUCCESS_DESCRIPTION); | |
| 212 | 236 | baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 213 | 237 | return baseResponse; |
| 214 | 238 | } |