Commit 6d649c0a4b948ba4f0aa972a765f03af27c46186

Authored by cfl
1 parent 9527d454aa
Exists in master and in 2 other branches dev, luanping

大同需求,增加产检通知重点文字维护的增删改查

Showing 2 changed files with 17 additions and 24 deletions

platform-biz-service/src/main/resources/mainOrm/master/MasterCheckItemNoticeManage.xml View file @ 6d649c0
... ... @@ -22,7 +22,7 @@
22 22 </insert>
23 23  
24 24  
25   - <select id="getCheckItemNoticeManage" resultMap="CheckItemManageMap" parameterType="com.lyms.platform.permission.model.CheckItemManageQuery">
  25 + <select id="getCheckItemNoticeManage" resultMap="CheckItemNoticeManageMap" parameterType="com.lyms.platform.permission.model.CheckItemManageQuery">
26 26 SELECT id,startweek,endweek,noticeinfo,affiliate,type from lyms_checkitem_notice
27 27 where affiliate=#{affiliateId}
28 28 and enable = 1
29 29  
... ... @@ -77,9 +77,9 @@
77 77 </sql>
78 78  
79 79  
80   - <select id="queryCheckItemNoticeManage" resultMap="CheckItemManageMap"
  80 + <select id="queryCheckItemNoticeManage" resultMap="CheckItemNoticeManageMap"
81 81 parameterType="com.lyms.platform.permission.model.CheckItemManageQuery">
82   - SELECT id,startweek,endweek,checkItemInfoId,affiliate,type from lyms_checkitem_notice
  82 + SELECT id,startweek,endweek,noticeinfo,affiliate,type from lyms_checkitem_notice
83 83 where enable = 1
84 84 <if test="affiliateId!=null and affiliateId!=''">
85 85 and affiliate=#{affiliateId,jdbcType=VARCHAR}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CheckItemNoticeManageController.java View file @ 6d649c0
... ... @@ -7,6 +7,7 @@
7 7 import com.lyms.platform.common.utils.StringUtils;
8 8 import com.lyms.platform.operate.web.result.FrontEndResult;
9 9 import com.lyms.platform.operate.web.utils.CollectionUtils;
  10 +import com.lyms.platform.permission.model.CheckItem;
10 11 import com.lyms.platform.permission.model.CheckItemManage;
11 12 import com.lyms.platform.permission.model.CheckItemManageQuery;
12 13 import com.lyms.platform.permission.model.CheckItemNoticeManage;
13 14  
... ... @@ -51,9 +52,9 @@
51 52 @RequestParam(value = "limit", required = false) Integer limit) {
52 53 FrontEndResult frontEndResult = new FrontEndResult();
53 54 frontEndResult.setErrorcode(ErrorCodeConstants.SUCCESS);
54   - if(StringUtils.isEmpty(affiliateId) || type != 1 || type !=2){
  55 + if(StringUtils.isEmpty(affiliateId)){
55 56 frontEndResult.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
56   - frontEndResult.setErrormsg("参数错误");
  57 + frontEndResult.setErrormsg("机构信息必须填写");
57 58 return frontEndResult;
58 59 }
59 60 CheckItemManageQuery checkItemManageQuery = new CheckItemManageQuery();
60 61  
61 62  
62 63  
63 64  
64 65  
65 66  
... ... @@ -77,49 +78,41 @@
77 78 @RequestMapping(value = "/add", method = RequestMethod.POST)
78 79 @TokenRequired
79 80 public void addCheckItemNoticeManage(HttpServletResponse response,
80   - @RequestParam(value = "startweek") Integer startweek,
81   - @RequestParam(value = "endweek") Integer endweek,
82   - @RequestParam(value = "noticeInfo") String noticeInfo,
83   - @RequestParam(value = "type") Integer type,
84   - @RequestParam(value = "affiliateId") String affiliateId) {
  81 + @RequestBody CheckItemNoticeManage checkItemNoticeManage) {
85 82  
86   - if (null == startweek || null == endweek
87   - || StringUtils.isEmpty(noticeInfo)
88   - || StringUtils.isEmpty(affiliateId)) {
  83 + if (null == checkItemNoticeManage.getStartWeek() || null == checkItemNoticeManage.getEndWeek()
  84 + || StringUtils.isEmpty(checkItemNoticeManage.getNoticeInfo())
  85 + || StringUtils.isEmpty(checkItemNoticeManage.getAffiliateId())) {
89 86 ResultUtils.buildParameterErrorResultAndWrite(response, "请填写必须项!");
90 87 return;
91 88 } else {
92   - if (startweek > endweek) {
  89 + if (checkItemNoticeManage.getStartWeek() > checkItemNoticeManage.getEndWeek()) {
93 90 ResultUtils.buildParameterErrorResultAndWrite(response, "起始周不能大于结束周!");
94 91 return;
95 92 }
96 93 boolean start = true;
97 94 boolean end = true;
98 95 CheckItemManageQuery checkItemManageQuery = new CheckItemManageQuery();
99   - checkItemManageQuery.setAffiliateId(affiliateId);
100   - checkItemManageQuery.setType(type);
  96 + checkItemManageQuery.setAffiliateId(checkItemNoticeManage.getAffiliateId());
  97 + checkItemManageQuery.setType(checkItemNoticeManage.getType());
101 98 List<CheckItemNoticeManage> list = checkItemNoticeManageService.getCheckItemNoticeManage(checkItemManageQuery);
102 99 if (CollectionUtils.isNotEmpty(list)) {
103 100 for (CheckItemNoticeManage checkItemManage : list) {
104   - if (checkItemManage.getStartWeek() <= startweek && checkItemManage.getEndWeek() >= startweek) {
  101 + if (checkItemManage.getStartWeek() <= checkItemNoticeManage.getStartWeek()
  102 + && checkItemManage.getEndWeek() >= checkItemNoticeManage.getStartWeek()) {
105 103 start = false;
106 104 break;
107 105 }
108 106 }
109 107 for (CheckItemNoticeManage checkItemManage : list) {
110   - if (checkItemManage.getStartWeek() <= endweek && checkItemManage.getEndWeek() >= endweek) {
  108 + if (checkItemManage.getStartWeek() <= checkItemNoticeManage.getEndWeek()
  109 + && checkItemManage.getEndWeek() >= checkItemNoticeManage.getEndWeek()) {
111 110 end = false;
112 111 break;
113 112 }
114 113 }
115 114 }
116 115 if (end && start) {
117   - CheckItemNoticeManage checkItemNoticeManage = new CheckItemNoticeManage();
118   - checkItemNoticeManage.setType(type);
119   - checkItemNoticeManage.setStartWeek(startweek);
120   - checkItemNoticeManage.setEndWeek(endweek);
121   - checkItemNoticeManage.setNoticeInfo(noticeInfo);
122   - checkItemNoticeManage.setAffiliateId(affiliateId);
123 116 checkItemNoticeManage.setEnable(1);
124 117 checkItemNoticeManage.setCreated(new Date());
125 118 checkItemNoticeManage.setModified(new Date());