Commit d2571c83b7143a90b6c9099bb85144a2e575e90a
Exists in
master
and in
8 other branches
Merge remote-tracking branch 'origin/master'
Showing 23 changed files
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Roles.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/OrganizationService.java
- platform-biz-service/src/main/resources/mainOrm/Organization.xml
- platform-common/src/main/java/com/lyms/platform/common/base/ExceptionHandlerController.java
- platform-common/src/main/java/com/lyms/platform/common/enums/PatientsTypeEnum.java
- platform-common/src/main/java/com/lyms/platform/common/enums/SampleTypeEnum.java
- platform-dal/src/main/java/com/lyms/platform/pojo/ReferValue.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AssayConfigController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyManageController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BasicConfigController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DepartmentsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PermissionsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReferConfigController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RegionController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RolesController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/VisitController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/TokenValidateInteceptor.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Organization.java
View file @
d2571c8
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | private String provinceId; |
18 | 18 | private String cityId; |
19 | 19 | private String areaId; |
20 | + private String streetId; | |
20 | 21 | private String address; |
21 | 22 | private String description; |
22 | 23 | private Integer publishId; |
... | ... | @@ -35,6 +36,14 @@ |
35 | 36 | |
36 | 37 | Map<String, Departments> departmentsMap = new HashMap<>(); |
37 | 38 | |
39 | + public String getStreetId() { | |
40 | + return streetId; | |
41 | + } | |
42 | + | |
43 | + public void setStreetId(String streetId) { | |
44 | + this.streetId = streetId; | |
45 | + } | |
46 | + | |
38 | 47 | public Map<String, Departments> getDepartmentsMap() { |
39 | 48 | return departmentsMap; |
40 | 49 | } |
41 | 50 | |
... | ... | @@ -252,14 +261,6 @@ |
252 | 261 | |
253 | 262 | } |
254 | 263 | |
255 | - public String getShortcode() { | |
256 | - return shortCode; | |
257 | - } | |
258 | 264 | |
259 | - | |
260 | - public void setShortcode(String shortCode) { | |
261 | - this.shortCode = shortCode; | |
262 | - | |
263 | - } | |
264 | 265 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
View file @
d2571c8
... | ... | @@ -15,6 +15,7 @@ |
15 | 15 | private String provinceId; |
16 | 16 | private String cityId; |
17 | 17 | private String areaId; |
18 | + private String streetId; | |
18 | 19 | private String address; |
19 | 20 | private String description; |
20 | 21 | private Integer publishId; |
... | ... | @@ -25,6 +26,15 @@ |
25 | 26 | private String shortCode; |
26 | 27 | private String keyword; |
27 | 28 | private String foreignId; |
29 | + | |
30 | + | |
31 | + public String getStreetId() { | |
32 | + return streetId; | |
33 | + } | |
34 | + | |
35 | + public void setStreetId(String streetId) { | |
36 | + this.streetId = streetId; | |
37 | + } | |
28 | 38 | |
29 | 39 | public String getForeignId() { |
30 | 40 | return foreignId; |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Roles.java
View file @
d2571c8
platform-biz-service/src/main/java/com/lyms/platform/permission/service/OrganizationService.java
View file @
d2571c8
... | ... | @@ -5,7 +5,18 @@ |
5 | 5 | |
6 | 6 | import java.util.List; |
7 | 7 | |
8 | -public interface OrganizationService {public void addOrganization(Organization obj);public void updateOrganization(Organization obj);public void deleteOrganization(Integer id);public Organization getOrganization(Integer id);public int queryOrganizationCount(OrganizationQuery query);public List<Organization> queryOrganization(OrganizationQuery query); | |
8 | +public interface OrganizationService { | |
9 | + public void addOrganization(Organization obj); | |
10 | + | |
11 | + public void updateOrganization(Organization obj); | |
12 | + | |
13 | + public void deleteOrganization(Integer id); | |
14 | + | |
15 | + public Organization getOrganization(Integer id); | |
16 | + | |
17 | + public int queryOrganizationCount(OrganizationQuery query); | |
18 | + | |
19 | + public List<Organization> queryOrganization(OrganizationQuery query); | |
9 | 20 | |
10 | 21 | } |
platform-biz-service/src/main/resources/mainOrm/Organization.xml
View file @
d2571c8
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | <result column="area_manage" property="areaManage" jdbcType="INTEGER"/> |
11 | 11 | <result column="province_id" property="provinceId" jdbcType="VARCHAR"/> |
12 | 12 | <result column="city_id" property="cityId" jdbcType="VARCHAR"/> |
13 | + <result column="street_id" property="streetId" jdbcType="VARCHAR"/> | |
13 | 14 | <result column="area_id" property="areaId" jdbcType="VARCHAR"/> |
14 | 15 | <result column="address" property="address" jdbcType="VARCHAR"/> |
15 | 16 | <result column="description" property="description" jdbcType="VARCHAR"/> |
... | ... | @@ -25,8 +26,8 @@ |
25 | 26 | |
26 | 27 | <insert id="addOrganization" parameterType="com.lyms.platform.permission.model.Organization"> |
27 | 28 | <selectKey order="AFTER" keyProperty="id" resultType="java.lang.Integer"> SELECT LAST_INSERT_ID() </selectKey> |
28 | -insert into organization (foreign_id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode) | |
29 | -values (#{foreignId},#{name},#{type},#{level},#{areaManage},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode}) | |
29 | +insert into organization (foreign_id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,street_id) | |
30 | +values (#{foreignId},#{name},#{type},#{level},#{areaManage},#{provinceId},#{cityId},#{areaId},#{address},#{description},#{publishId},#{publishName},#{yn},#{modified},#{created},#{shortCode},#{streetId}) | |
30 | 31 | </insert> |
31 | 32 | |
32 | 33 | |
... | ... | @@ -57,6 +58,9 @@ |
57 | 58 | <if test="areaId != null"> |
58 | 59 | area_id = #{areaId,jdbcType=INTEGER}, |
59 | 60 | </if> |
61 | + <if test="streetId != null"> | |
62 | + street_id = #{streetId,jdbcType=INTEGER}, | |
63 | + </if> | |
60 | 64 | <if test="address != null and address != ''"> |
61 | 65 | address = #{address,jdbcType=VARCHAR}, |
62 | 66 | </if> |
... | ... | @@ -92,7 +96,7 @@ |
92 | 96 | |
93 | 97 | |
94 | 98 | <select id="getOrganization" resultMap="OrganizationResultMap" parameterType="java.lang.Integer"> |
95 | -select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id | |
99 | +select id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id | |
96 | 100 | from organization where id = #{id,jdbcType=INTEGER} |
97 | 101 | </select> |
98 | 102 | |
... | ... | @@ -137,6 +141,9 @@ |
137 | 141 | <if test="areaId != null"> |
138 | 142 | and area_id = #{areaId,jdbcType=INTEGER} |
139 | 143 | </if> |
144 | + <if test="streetId != null"> | |
145 | + and street_id = #{streetId,jdbcType=INTEGER} | |
146 | + </if> | |
140 | 147 | <if test="address != null and address != ''"> |
141 | 148 | and address = #{address,jdbcType=VARCHAR} |
142 | 149 | </if> |
... | ... | @@ -171,7 +178,7 @@ |
171 | 178 | <select id="queryOrganization" resultMap="OrganizationResultMap" |
172 | 179 | parameterType="com.lyms.platform.permission.model.OrganizationQuery"> |
173 | 180 | select |
174 | - id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id | |
181 | + id,name,type,level,area_manage,province_id,city_id,area_id,address,description,publish_id,publish_name,yn,modified,created,shortCode,foreign_id,street_id | |
175 | 182 | from organization |
176 | 183 | <include refid="OrganizationCondition"/> |
177 | 184 | <include refid="orderAndLimit"/> |
platform-common/src/main/java/com/lyms/platform/common/base/ExceptionHandlerController.java
View file @
d2571c8
... | ... | @@ -7,12 +7,20 @@ |
7 | 7 | import javax.servlet.http.HttpServletRequest; |
8 | 8 | import javax.servlet.http.HttpServletResponse; |
9 | 9 | |
10 | +import com.lyms.platform.common.core.resolve.MessageResolver; | |
11 | +import com.lyms.platform.common.result.BaseResponse; | |
12 | +import org.apache.commons.collections.CollectionUtils; | |
13 | +import org.springframework.aop.AopInvocationException; | |
14 | +import org.springframework.beans.factory.annotation.Autowired; | |
15 | +import org.springframework.dao.DataAccessResourceFailureException; | |
10 | 16 | import org.springframework.http.HttpStatus; |
17 | +import org.springframework.http.converter.HttpMessageNotReadableException; | |
11 | 18 | import org.springframework.validation.BindException; |
12 | 19 | import org.springframework.validation.BindingResult; |
13 | 20 | import org.springframework.web.bind.MethodArgumentNotValidException; |
14 | 21 | import org.springframework.web.bind.MissingServletRequestParameterException; |
15 | 22 | import org.springframework.web.bind.annotation.ExceptionHandler; |
23 | +import org.springframework.web.bind.annotation.ResponseBody; | |
16 | 24 | import org.springframework.web.bind.annotation.ResponseStatus; |
17 | 25 | |
18 | 26 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
... | ... | @@ -27,6 +35,42 @@ |
27 | 35 | */ |
28 | 36 | public class ExceptionHandlerController { |
29 | 37 | |
38 | + @Autowired | |
39 | + private MessageResolver messageResolver; | |
40 | + | |
41 | + @ExceptionHandler(HttpMessageNotReadableException.class) | |
42 | + @ResponseBody | |
43 | + @ResponseStatus(HttpStatus.BAD_REQUEST) | |
44 | + public BaseResponse handException(HttpMessageNotReadableException e) { | |
45 | + ExceptionUtils.catchException(e, e.getMessage()); | |
46 | + BaseResponse error = new BaseResponse(); | |
47 | + error.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR); | |
48 | + error.setErrormsg("参数错误"); | |
49 | + return error; | |
50 | + } | |
51 | + | |
52 | + @ExceptionHandler(org.springframework.dao.DataAccessResourceFailureException.class) | |
53 | + @ResponseBody | |
54 | + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) | |
55 | + public BaseResponse handException(DataAccessResourceFailureException e) { | |
56 | + ExceptionUtils.catchException(e, e.getMessage()); | |
57 | + BaseResponse error = new BaseResponse(); | |
58 | + error.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
59 | + error.setErrormsg("错误"); | |
60 | + return error; | |
61 | + } | |
62 | + @ExceptionHandler(org.springframework.aop.AopInvocationException.class) | |
63 | + @ResponseBody | |
64 | + @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) | |
65 | + public BaseResponse handException(AopInvocationException e) { | |
66 | + ExceptionUtils.catchException(e, e.getMessage()); | |
67 | + BaseResponse error = new BaseResponse(); | |
68 | + error.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR); | |
69 | + error.setErrormsg("错误"); | |
70 | + return error; | |
71 | + } | |
72 | + | |
73 | + | |
30 | 74 | @ExceptionHandler(MethodArgumentNotValidException.class) |
31 | 75 | @ResponseStatus(HttpStatus.OK) |
32 | 76 | public void validationError(MethodArgumentNotValidException e, HttpServletResponse httpServletResponse) { |
... | ... | @@ -132,7 +176,8 @@ |
132 | 176 | List<org.springframework.validation.FieldError> fieldErrors = bindingResult.getFieldErrors(); |
133 | 177 | for (org.springframework.validation.FieldError fieldError : fieldErrors) { |
134 | 178 | map.put("errorcode", ErrorCodeConstants.PARAMETER_ERROR); |
135 | - map.put("errormsg",fieldError.getDefaultMessage()); | |
179 | + map.put("errormsg",messageResolver.getErrorMessage(fieldError | |
180 | + .getDefaultMessage())); | |
136 | 181 | break; |
137 | 182 | } |
138 | 183 | return map; |
platform-common/src/main/java/com/lyms/platform/common/enums/PatientsTypeEnum.java
View file @
d2571c8
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.result.IdTextModel; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 病人类型 |
5 | 7 | * Created by Zhang.Rui on 2016/4/7. |
... | ... | @@ -32,6 +34,20 @@ |
32 | 34 | |
33 | 35 | public void setText(String text) { |
34 | 36 | this.text = text; |
37 | + } | |
38 | + | |
39 | + public static IdTextModel getById(String id) { | |
40 | + IdTextModel idTextModel = new IdTextModel(); | |
41 | + if(null == id) return idTextModel; | |
42 | + | |
43 | + for(PatientsTypeEnum s : PatientsTypeEnum.values()) { | |
44 | + if(id.equals(s.getId().toString())) { | |
45 | + idTextModel.setText(s.getText()); | |
46 | + idTextModel.setId(String.valueOf(s.getId())); | |
47 | + return idTextModel; | |
48 | + } | |
49 | + } | |
50 | + return idTextModel; | |
35 | 51 | } |
36 | 52 | } |
platform-common/src/main/java/com/lyms/platform/common/enums/SampleTypeEnum.java
View file @
d2571c8
1 | 1 | package com.lyms.platform.common.enums; |
2 | 2 | |
3 | +import com.lyms.platform.common.result.IdTextModel; | |
4 | + | |
3 | 5 | /** |
4 | 6 | * 样本类型 |
5 | 7 | * Created by Zhang.Rui on 2016/4/7. |
... | ... | @@ -37,5 +39,18 @@ |
37 | 39 | this.text = text; |
38 | 40 | } |
39 | 41 | |
42 | + public static IdTextModel getById(String id) { | |
43 | + IdTextModel idTextModel = new IdTextModel(); | |
44 | + if(null == id) return idTextModel; | |
45 | + | |
46 | + for(SampleTypeEnum s : SampleTypeEnum.values()) { | |
47 | + if(id.equals(s.getId().toString())) { | |
48 | + idTextModel.setText(s.getText()); | |
49 | + idTextModel.setId(String.valueOf(s.getId())); | |
50 | + return idTextModel; | |
51 | + } | |
52 | + } | |
53 | + return idTextModel; | |
54 | + } | |
40 | 55 | } |
platform-dal/src/main/java/com/lyms/platform/pojo/ReferValue.java
View file @
d2571c8
... | ... | @@ -58,6 +58,24 @@ |
58 | 58 | |
59 | 59 | private Integer yn; |
60 | 60 | |
61 | + private String sampleVal; | |
62 | + private String featureVal; | |
63 | + | |
64 | + public String getSampleVal() { | |
65 | + return sampleVal; | |
66 | + } | |
67 | + | |
68 | + public void setSampleVal(String sampleVal) { | |
69 | + this.sampleVal = sampleVal; | |
70 | + } | |
71 | + | |
72 | + public String getFeatureVal() { | |
73 | + return featureVal; | |
74 | + } | |
75 | + | |
76 | + public void setFeatureVal(String featureVal) { | |
77 | + this.featureVal = featureVal; | |
78 | + } | |
61 | 79 | |
62 | 80 | public String getSex() { |
63 | 81 | return sex; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AssayConfigController.java
View file @
d2571c8
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyManageController.java
View file @
d2571c8
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BasicConfigController.java
View file @
d2571c8
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CommunityConfigController.java
View file @
d2571c8
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | * Created by Zhang.Rui on 2016/3/18. |
43 | 43 | */ |
44 | 44 | @Controller |
45 | -public class CommunityConfigController extends RestController { | |
45 | +public class CommunityConfigController extends BaseController { | |
46 | 46 | @Autowired |
47 | 47 | private CommunityConfigService communityConfigService; |
48 | 48 | @Autowired |
... | ... | @@ -103,7 +103,7 @@ |
103 | 103 | public FrontEndResult queryCommunity(CommunityQuery communityQuery) { |
104 | 104 | BasicConfig config = basicConfigService.getOneBasicConfigById(communityQuery.getId()); |
105 | 105 | if(null != communityQuery.getId() && null == config) { |
106 | - return FrontEndResult.ini(ErrorCodeConstants.PARAMETER_ERROR, "address ID error"); | |
106 | + communityQuery.setId(null); | |
107 | 107 | } |
108 | 108 | List<CommunityConfig> communityConfigList = communityConfigService.queryCommunity(communityQuery); |
109 | 109 | if(null != communityConfigList) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DepartmentsController.java
View file @
d2571c8
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | * Created by zhang.rui on 2015/9/28 0028. |
24 | 24 | */ |
25 | 25 | @Controller |
26 | -public class DepartmentsController extends RestController { | |
26 | +public class DepartmentsController extends BaseController { | |
27 | 27 | @Autowired |
28 | 28 | private DepartmentsService departmentsService; |
29 | 29 | @Autowired |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
d2571c8
... | ... | @@ -100,6 +100,7 @@ |
100 | 100 | @RequestParam(value = "provinceId", required = false) String provinceId, |
101 | 101 | @RequestParam(value = "cityId", required = false) String cityId, |
102 | 102 | @RequestParam(value = "areaId", required = false) String areaId, |
103 | + @RequestParam(value = "streetId", required = false) String streetId, | |
103 | 104 | @RequestParam(value = "address", required = false) String address, |
104 | 105 | @RequestParam(value = "description", required = false) String description, |
105 | 106 | @RequestParam(value = "shortCode", required = false) String shortCode) { |
106 | 107 | |
107 | 108 | |
... | ... | @@ -124,10 +125,11 @@ |
124 | 125 | organization.setProvinceId(provinceId); |
125 | 126 | organization.setCityId(cityId); |
126 | 127 | organization.setAreaId(areaId); |
128 | + organization.setStreetId(streetId); | |
127 | 129 | organization.setAddress(address); |
128 | 130 | organization.setDescription(description); |
129 | - organization.setShortcode(shortCode); | |
130 | 131 | organization.setModified(new Date()); |
132 | + organization.setShortCode(shortCode); | |
131 | 133 | organizationService.updateOrganization(organization); |
132 | 134 | |
133 | 135 | ResultUtils.buildSuccessResultAndWrite(response); |
... | ... | @@ -149,6 +151,7 @@ |
149 | 151 | @RequestParam(value = "provinceId") String provinceId, |
150 | 152 | @RequestParam(value = "cityId") String cityId, |
151 | 153 | @RequestParam(value = "areaId") String areaId, |
154 | + @RequestParam(value = "streetId") String streetId, | |
152 | 155 | @RequestParam(value = "address") String address, |
153 | 156 | @RequestParam(value = "description", required = false) String description, |
154 | 157 | @RequestParam(value = "shortCode", required = false) String shortCode) { |
155 | 158 | |
... | ... | @@ -178,9 +181,10 @@ |
178 | 181 | organization.setProvinceId(provinceId); |
179 | 182 | organization.setCityId(cityId); |
180 | 183 | organization.setAreaId(areaId); |
184 | + organization.setStreetId(streetId); | |
181 | 185 | organization.setAddress(address); |
182 | 186 | organization.setDescription(description); |
183 | - organization.setShortcode(shortCode); | |
187 | + organization.setShortCode(shortCode); | |
184 | 188 | organization.setYn(YnEnums.YES.getId()); |
185 | 189 | organization.setCreated(new Date()); |
186 | 190 | organization.setModified(new Date()); |
... | ... | @@ -217,7 +221,7 @@ |
217 | 221 | OrganizationQuery organizationQuery = new OrganizationQuery(); |
218 | 222 | organizationQuery.setId(id); |
219 | 223 | organizationQuery.setNeed("true"); |
220 | - organizationQuery.setSort("id desc"); | |
224 | + organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); | |
221 | 225 | organizationQuery.setYn(YnEnums.YES.getId()); |
222 | 226 | organizationQuery.setPage(page); |
223 | 227 | organizationQuery.setLimit(limit); |
... | ... | @@ -238,6 +242,11 @@ |
238 | 242 | BasicConfig p2 = basicConfigService.getOneBasicConfigById(p1.getParentId()); |
239 | 243 | if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p2.getParentId())) { |
240 | 244 | organizationQuery.setAreaId(areaId); |
245 | + } else { | |
246 | +// BasicConfig p3 = basicConfigService.getOneBasicConfigById(p1.getParentId()); | |
247 | +// if (p2 != null && SystemConfig.CHINA_BASIC_ID.equals(p3.getParentId())) { | |
248 | + organizationQuery.setStreetId(areaId); | |
249 | +// } | |
241 | 250 | } |
242 | 251 | } |
243 | 252 | } |
... | ... | @@ -283,6 +292,10 @@ |
283 | 292 | map.put("province",organization.getProvince()); |
284 | 293 | map.put("provinceId",organization.getProvinceId()); |
285 | 294 | return map; |
295 | + } | |
296 | + @RequestMapping("/") | |
297 | + public void build(){ | |
298 | + | |
286 | 299 | } |
287 | 300 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PermissionsController.java
View file @
d2571c8
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | * Created by Administrator on 2015/9/28 0028. |
33 | 33 | */ |
34 | 34 | @Controller |
35 | -public class PermissionsController extends RestController { | |
35 | +public class PermissionsController extends BaseController { | |
36 | 36 | |
37 | 37 | @Autowired |
38 | 38 | private PermissionsService permissionsService; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PuerperaManageController.java
View file @
d2571c8
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReferConfigController.java
View file @
d2571c8
... | ... | @@ -6,6 +6,7 @@ |
6 | 6 | |
7 | 7 | import com.lyms.platform.biz.param.ReferConfigQuery; |
8 | 8 | import com.lyms.platform.common.annotation.TokenRequired; |
9 | +import com.lyms.platform.common.base.BaseController; | |
9 | 10 | import com.lyms.platform.common.enums.YnEnums; |
10 | 11 | import com.lyms.platform.operate.web.result.FrontEndResult; |
11 | 12 | import org.apache.commons.lang.StringUtils; |
... | ... | @@ -29,7 +30,7 @@ |
29 | 30 | * 参考值配置 |
30 | 31 | */ |
31 | 32 | @Controller |
32 | -public class ReferConfigController extends RestController{ | |
33 | +public class ReferConfigController extends BaseController { | |
33 | 34 | @Autowired |
34 | 35 | ReferConfigService referConfigService; |
35 | 36 | @Autowired |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RegionController.java
View file @
d2571c8
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RolesController.java
View file @
d2571c8
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/VisitController.java
View file @
d2571c8
... | ... | @@ -3,6 +3,7 @@ |
3 | 3 | import javax.validation.Valid; |
4 | 4 | |
5 | 5 | import com.lyms.platform.common.annotation.TokenRequired; |
6 | +import com.lyms.platform.common.base.BaseController; | |
6 | 7 | import org.apache.commons.lang.StringUtils; |
7 | 8 | import org.springframework.beans.factory.annotation.Autowired; |
8 | 9 | import org.springframework.http.MediaType; |
... | ... | @@ -23,7 +24,7 @@ |
23 | 24 | * @author Administrator |
24 | 25 | */ |
25 | 26 | @Controller |
26 | -public class VisitController extends RestController { | |
27 | +public class VisitController extends BaseController { | |
27 | 28 | |
28 | 29 | @Autowired |
29 | 30 | private VisitFacade visitFacade; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/VisitFacade.java
View file @
d2571c8
... | ... | @@ -5,16 +5,19 @@ |
5 | 5 | import com.lyms.platform.common.enums.YnEnums; |
6 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
7 | 7 | import com.lyms.platform.common.result.BaseResponse; |
8 | +import com.lyms.platform.common.utils.DateUtil; | |
8 | 9 | import com.lyms.platform.operate.web.request.BabyVisitAddRequest; |
9 | 10 | import com.lyms.platform.operate.web.request.VisitAddRequest; |
10 | 11 | import com.lyms.platform.operate.web.request.VisitAddRequest.SimpleVisitPuerpera; |
11 | -import com.lyms.platform.operate.web.result.AddressInner; | |
12 | 12 | import com.lyms.platform.operate.web.result.BabyVisitResult; |
13 | 13 | import com.lyms.platform.operate.web.result.BabyVisitResult.BabyVisit; |
14 | 14 | import com.lyms.platform.operate.web.result.SimpleVisit; |
15 | 15 | import com.lyms.platform.operate.web.result.VisitResult; |
16 | 16 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
17 | -import com.lyms.platform.pojo.*; | |
17 | +import com.lyms.platform.pojo.BabyModel; | |
18 | +import com.lyms.platform.pojo.BabyVisitModel; | |
19 | +import com.lyms.platform.pojo.Patients; | |
20 | +import com.lyms.platform.pojo.VisitModel; | |
18 | 21 | import com.lyms.platform.query.BabyModelQuery; |
19 | 22 | import com.lyms.platform.query.PatientsQuery; |
20 | 23 | import com.lyms.platform.query.VisitQuery; |
... | ... | @@ -24,6 +27,7 @@ |
24 | 27 | import org.springframework.stereotype.Component; |
25 | 28 | |
26 | 29 | import java.util.ArrayList; |
30 | +import java.util.Date; | |
27 | 31 | import java.util.List; |
28 | 32 | |
29 | 33 | /** |
... | ... | @@ -80,7 +84,7 @@ |
80 | 84 | private BaseObjectResponse doBiz(Patients puerperaModel) { |
81 | 85 | VisitResult data = new VisitResult(); |
82 | 86 | if (null != puerperaModel) { |
83 | - data.convertToResult1(puerperaModel, CommonsHelper.fullAddress(puerperaModel,basicConfigService)); | |
87 | + data.convertToResult1(puerperaModel, CommonsHelper.fullAddress(puerperaModel, basicConfigService)); | |
84 | 88 | VisitQuery visitQuery = new VisitQuery(); |
85 | 89 | visitQuery.setParentId(puerperaModel.getId()); |
86 | 90 | List<VisitModel> visits = visitService.queryVisit(visitQuery); |
... | ... | @@ -114,6 +118,7 @@ |
114 | 118 | return patientsService.findOnePatientByCardNo(query); |
115 | 119 | } |
116 | 120 | |
121 | + | |
117 | 122 | /** |
118 | 123 | * 增加产妇访视记录 |
119 | 124 | * |
... | ... | @@ -123,6 +128,14 @@ |
123 | 128 | public BaseResponse addOneVisit(VisitAddRequest visitRequest) { |
124 | 129 | // 获取患者id |
125 | 130 | String parentId = visitRequest.getParentId(); |
131 | + String checkTime = visitRequest.getCheckTime(); | |
132 | + if (StringUtils.isNotEmpty(checkTime)&&null!=visitRequest.getPatients().getDueDate()) { | |
133 | + boolean f = DateUtil.parseYMD(checkTime).before(visitRequest.getPatients().getDueDate()); | |
134 | + if (f) { | |
135 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("检查时间必须大于分娩时间"); | |
136 | + } | |
137 | + } | |
138 | + | |
126 | 139 | if (StringUtils.isNotBlank(parentId)) { |
127 | 140 | Patients model; |
128 | 141 | PatientsQuery patientsQuery = new PatientsQuery(); |
... | ... | @@ -134,7 +147,10 @@ |
134 | 147 | SimpleVisitPuerpera srcModel = visitRequest.new SimpleVisitPuerpera(model); |
135 | 148 | // 和数据库里面的对象比较如果不等就表示有修改需存入到数据库中 |
136 | 149 | if (!destModel.equals(srcModel)) { |
137 | - patientsService.updatePatient(visitRequest.getPatients()/*.build()*/); | |
150 | + Patients patients = visitRequest.getPatients(); | |
151 | + patients.setCreated(new Date()); | |
152 | + patients.setModified(new Date()); | |
153 | + patientsService.updatePatient(patients/*.build()*/); | |
138 | 154 | } |
139 | 155 | } else { |
140 | 156 | return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg("产妇信息不存在"); |
... | ... | @@ -146,6 +162,8 @@ |
146 | 162 | patients.setType(3); |
147 | 163 | patients.setYn(YnEnums.YES.getId()); |
148 | 164 | patients.setId(null); |
165 | + patients.setCreated(new Date()); | |
166 | + patients.setModified(new Date()); | |
149 | 167 | parentId = patientsService.addPatient(patients).getId(); |
150 | 168 | } |
151 | 169 | |
152 | 170 | |
153 | 171 | |
... | ... | @@ -155,13 +173,18 @@ |
155 | 173 | if (StringUtils.isNotBlank(parentId)) { |
156 | 174 | visitModel.setParentId(parentId); |
157 | 175 | } |
176 | + visitModel.setCreated(new Date()); | |
177 | + visitModel.setModified(new Date()); | |
158 | 178 | visitService.addVisit(visitModel); |
159 | 179 | } else { |
160 | - visitService.updateVisit(visitRequest.getRequestVisit()); | |
180 | + VisitModel visitModel = visitRequest.getRequestVisit(); | |
181 | + visitModel.setModified(new Date()); | |
182 | + visitService.updateVisit(visitModel); | |
161 | 183 | } |
162 | 184 | Patients patients = new Patients(); |
163 | 185 | patients.setId(parentId); |
164 | 186 | patients.setIsVisit(1); |
187 | + patients.setModified(new Date()); | |
165 | 188 | patientsService.updatePatient(patients); |
166 | 189 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
167 | 190 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/inteceptor/TokenValidateInteceptor.java
View file @
d2571c8
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | public boolean validateToken(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { |
66 | 66 | String token = httpServletRequest.getHeader("Authorization"); |
67 | 67 | if (StringUtils.isEmpty(token)) { |
68 | - throw new ParameterException(); | |
68 | + throw new TokenException(); | |
69 | 69 | } |
70 | 70 | LoginContext loginContext = LoginUtil.checkLoginState(token); |
71 | 71 | if(!loginContext.isLogin()) { |