Commit 4b78523e22e2f62c604f30612ce740d57531e761
1 parent
5491b1d996
Exists in
master
and in
6 other branches
微量元素
Showing 4 changed files with 126 additions and 0 deletions
- platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
- platform-dal/src/main/java/com/lyms/platform/pojo/ServiceConfig.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/facade/BasicConfigFacade.java
platform-dal/src/main/java/com/lyms/platform/beans/SerialIdEnum.java
View file @
4b78523
| ... | ... | @@ -28,6 +28,7 @@ |
| 28 | 28 | CheckItemActual("CheckItemActual", 97521500100L), |
| 29 | 29 | CheckItemConfig("CheckItemConfig", 97531320100L), |
| 30 | 30 | TrackDayConfig("TrackDayConfig", 97531320170L), |
| 31 | + ServiceConfig("ServiceConfig", 97531334170L), | |
| 31 | 32 | BCInventoryModel("BCInventoryModel", 97531000110L), |
| 32 | 33 | TrackCountRecord("TrackCountRecord", 92231000110L), |
| 33 | 34 | AutoRiskRecord("AutoRiskRecord", 97231000110L), |
platform-dal/src/main/java/com/lyms/platform/pojo/ServiceConfig.java
View file @
4b78523
| 1 | +package com.lyms.platform.pojo; | |
| 2 | + | |
| 3 | +import com.lyms.platform.beans.SerialIdEnum; | |
| 4 | +import com.lyms.platform.common.result.BaseModel; | |
| 5 | +import org.springframework.data.mongodb.core.mapping.Document; | |
| 6 | + | |
| 7 | +import java.util.Date; | |
| 8 | +import java.util.List; | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 试用服务配置 | |
| 14 | + */ | |
| 15 | +@Document(collection="lyms_service_config") | |
| 16 | +public class ServiceConfig extends BaseModel { | |
| 17 | + | |
| 18 | + private static final long serialVersionUID = SerialIdEnum.ServiceConfig.getCid(); | |
| 19 | + | |
| 20 | + private String id; | |
| 21 | + private String hospitalId; | |
| 22 | + | |
| 23 | + // 0 关闭 1 开启 | |
| 24 | + private Integer status; | |
| 25 | + | |
| 26 | + private Map<String,String> confis; | |
| 27 | + private Date created; | |
| 28 | + private Date modified; | |
| 29 | + | |
| 30 | + public Integer getStatus() { | |
| 31 | + return status; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public void setStatus(Integer status) { | |
| 35 | + this.status = status; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public String getId() { | |
| 39 | + return id; | |
| 40 | + } | |
| 41 | + | |
| 42 | + public void setId(String id) { | |
| 43 | + this.id = id; | |
| 44 | + } | |
| 45 | + | |
| 46 | + public String getHospitalId() { | |
| 47 | + return hospitalId; | |
| 48 | + } | |
| 49 | + | |
| 50 | + public void setHospitalId(String hospitalId) { | |
| 51 | + this.hospitalId = hospitalId; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public Map<String, String> getConfis() { | |
| 55 | + return confis; | |
| 56 | + } | |
| 57 | + | |
| 58 | + public void setConfis(Map<String, String> confis) { | |
| 59 | + this.confis = confis; | |
| 60 | + } | |
| 61 | + | |
| 62 | + public Date getCreated() { | |
| 63 | + return created; | |
| 64 | + } | |
| 65 | + | |
| 66 | + public void setCreated(Date created) { | |
| 67 | + this.created = created; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public Date getModified() { | |
| 71 | + return modified; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setModified(Date modified) { | |
| 75 | + this.modified = modified; | |
| 76 | + } | |
| 77 | +} |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BasicConfigController.java
View file @
4b78523
| ... | ... | @@ -12,6 +12,7 @@ |
| 12 | 12 | import com.lyms.platform.operate.web.request.BasicConfigUpdateRequest; |
| 13 | 13 | import com.lyms.platform.operate.web.result.FrontEndResult; |
| 14 | 14 | import com.lyms.platform.pojo.CheckItemConfig; |
| 15 | +import com.lyms.platform.pojo.ServiceConfig; | |
| 15 | 16 | import com.lyms.platform.pojo.TrackDayConfig; |
| 16 | 17 | import org.springframework.beans.factory.annotation.Autowired; |
| 17 | 18 | import org.springframework.http.MediaType; |
| ... | ... | @@ -268,5 +269,32 @@ |
| 268 | 269 | public BaseResponse deleteTrackDayConfig(@PathVariable String id,HttpServletRequest request) { |
| 269 | 270 | return basicConfigFacade.deleteTrackDayConfig(id); |
| 270 | 271 | } |
| 272 | + | |
| 273 | + /** | |
| 274 | + * 添加或者修改服务试用配置 | |
| 275 | + * @param serviceConfig | |
| 276 | + * @param request | |
| 277 | + * @return | |
| 278 | + */ | |
| 279 | + @RequestMapping(method = RequestMethod.POST, value = "/addOrUpServiceConfig", consumes = {MediaType.APPLICATION_JSON_VALUE}) | |
| 280 | + @ResponseBody | |
| 281 | + @TokenRequired | |
| 282 | + public BaseResponse addOrUpServiceConfig(@RequestBody ServiceConfig serviceConfig, HttpServletRequest request) { | |
| 283 | + return basicConfigFacade.addOrUpServiceConfig(serviceConfig, getUserId(request)); | |
| 284 | + } | |
| 285 | + | |
| 286 | + /** | |
| 287 | + * 查询服务试用配置 | |
| 288 | + * @param request | |
| 289 | + * @return | |
| 290 | + */ | |
| 291 | + @RequestMapping(method = RequestMethod.GET, value = "/queryServiceConfig/{hospitalId}") | |
| 292 | + @ResponseBody | |
| 293 | + @TokenRequired | |
| 294 | + public BaseResponse queryServiceConfig(@PathVariable String hospitalId, HttpServletRequest request) { | |
| 295 | + return basicConfigFacade.queryServiceConfig(hospitalId); | |
| 296 | + } | |
| 297 | + | |
| 298 | + | |
| 271 | 299 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BasicConfigFacade.java
View file @
4b78523
| ... | ... | @@ -627,5 +627,25 @@ |
| 627 | 627 | mongoTemplate.remove(Query.query(Criteria.where("_id").is(id)), TrackDayConfig.class); |
| 628 | 628 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 629 | 629 | } |
| 630 | + | |
| 631 | + public BaseResponse addOrUpServiceConfig(ServiceConfig serviceConfig, Integer userId) { | |
| 632 | + serviceConfig.setModified(new Date()); | |
| 633 | + if (StringUtils.isNotEmpty(serviceConfig.getId())) | |
| 634 | + { | |
| 635 | + Query query = Query.query(Criteria.where("_id").is(serviceConfig.getId())); | |
| 636 | + Update update = MongoConvertHelper | |
| 637 | + .convertToNativeUpdate(ReflectionUtils.getUpdateField(serviceConfig)); | |
| 638 | + mongoTemplate.updateFirst(query, update, ServiceConfig.class); | |
| 639 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 640 | + } | |
| 641 | + serviceConfig.setCreated(new Date()); | |
| 642 | + mongoTemplate.save(serviceConfig); | |
| 643 | + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 644 | + } | |
| 645 | + | |
| 646 | + public BaseResponse queryServiceConfig(String hospitalId) { | |
| 647 | + ServiceConfig serviceConfig = mongoTemplate.findOne(Query.query(Criteria.where("hospitalId").is(hospitalId)), ServiceConfig.class); | |
| 648 | + return new BaseObjectResponse().setData(serviceConfig).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); | |
| 649 | + } | |
| 630 | 650 | } |