Commit a27e21d782117836e77fb79bd2093638f2bd5cb6

Authored by cfl
1 parent 6d649c0a4b
Exists in master and in 2 other branches dev, luanping

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

Showing 3 changed files with 51 additions and 40 deletions

platform-biz-service/src/main/resources/mainOrm/master/MasterCheckItemNoticeManage.xml View file @ a27e21d
... ... @@ -29,7 +29,7 @@
29 29 <if test="startNum !=null">
30 30 and startweek >= #{startNum,jdbcType=INTEGER}
31 31 and endweek &lt;= #{startNum,jdbcType=INTEGER}
32   - </if>a
  32 + </if>
33 33 <if test="type !=null">
34 34 and type=#{type,jdbcType=INTEGER}
35 35 </if>
... ... @@ -51,7 +51,7 @@
51 51 <if test="endWeek!=null and endWeek>=0">
52 52 endweek=#{endWeek,jdbcType=INTEGER},
53 53 </if>
54   - <if test="noticeinfo!=null and noticeinfo!=''">
  54 + <if test="noticeInfo!=null and noticeInfo!=''">
55 55 noticeinfo=#{noticeInfo},
56 56 </if>
57 57 <if test="affiliateId!=null and affiliateId!=''">
platform-common/src/main/java/com/lyms/platform/common/dao/BaseQuery.java View file @ a27e21d
... ... @@ -33,7 +33,7 @@
33 33  
34 34 private List<Integer> pageNums = new ArrayList<Integer>();
35 35  
36   - private int startNum;
  36 + private Integer startNum;
37 37 private int endNum;
38 38 /*
39 39 private Date startTimeStart;
40 40  
... ... @@ -195,11 +195,11 @@
195 195 return this.page + 1;
196 196 }
197 197  
198   - public int getStartNum() {
  198 + public Integer getStartNum() {
199 199 return startNum;
200 200 }
201 201  
202   - public void setStartNum(int startNum) {
  202 + public void setStartNum(Integer startNum) {
203 203 this.startNum = startNum;
204 204 }
205 205  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CheckItemNoticeManageController.java View file @ a27e21d
... ... @@ -90,29 +90,21 @@
90 90 ResultUtils.buildParameterErrorResultAndWrite(response, "起始周不能大于结束周!");
91 91 return;
92 92 }
93   - boolean start = true;
94   - boolean end = true;
  93 + boolean repeat = true;
95 94 CheckItemManageQuery checkItemManageQuery = new CheckItemManageQuery();
96 95 checkItemManageQuery.setAffiliateId(checkItemNoticeManage.getAffiliateId());
97 96 checkItemManageQuery.setType(checkItemNoticeManage.getType());
98 97 List<CheckItemNoticeManage> list = checkItemNoticeManageService.getCheckItemNoticeManage(checkItemManageQuery);
99 98 if (CollectionUtils.isNotEmpty(list)) {
100 99 for (CheckItemNoticeManage checkItemManage : list) {
101   - if (checkItemManage.getStartWeek() <= checkItemNoticeManage.getStartWeek()
102   - && checkItemManage.getEndWeek() >= checkItemNoticeManage.getStartWeek()) {
103   - start = false;
104   - break;
  100 + if(!(checkItemNoticeManage.getStartWeek() > checkItemManage.getEndWeek()
  101 + || checkItemNoticeManage.getEndWeek() < checkItemManage.getStartWeek())){
  102 + repeat = false;
105 103 }
106 104 }
107   - for (CheckItemNoticeManage checkItemManage : list) {
108   - if (checkItemManage.getStartWeek() <= checkItemNoticeManage.getEndWeek()
109   - && checkItemManage.getEndWeek() >= checkItemNoticeManage.getEndWeek()) {
110   - end = false;
111   - break;
112   - }
113   - }
  105 +
114 106 }
115   - if (end && start) {
  107 + if (repeat) {
116 108 checkItemNoticeManage.setEnable(1);
117 109 checkItemNoticeManage.setCreated(new Date());
118 110 checkItemNoticeManage.setModified(new Date());
119 111  
120 112  
121 113  
122 114  
... ... @@ -128,37 +120,56 @@
128 120 /**
129 121 * 修改展示项
130 122 */
131   - @RequestMapping(value = "/update", method = RequestMethod.PUT)
  123 + @RequestMapping(value = "/update", method = RequestMethod.POST)
132 124 @TokenRequired
133   - public void updateCheckItem(HttpServletResponse response,
134   - @RequestParam(value = "id") Integer id,
135   - @RequestParam(value = "startweek") Integer startweek,
136   - @RequestParam(value = "endweek") Integer endweek,
137   - @RequestParam(value = "noticeInfo") String noticeInfo,
138   - @RequestParam(value = "affiliateId") String affiliateId) {
139   - if (null == id) {
  125 + public void updateCheckItem(HttpServletResponse response,@RequestBody CheckItemNoticeManage param) {
  126 + if (null == param.getId()) {
140 127 ResultUtils.buildParameterErrorResultAndWrite(response, "请选择要修改的数据");
141 128 return;
142 129 }
143   - CheckItemNoticeManage checkItemNoticeManage = new CheckItemNoticeManage();
144   - checkItemNoticeManage.setId(id);
145   - checkItemNoticeManage.setStartWeek(startweek);
146   - checkItemNoticeManage.setEndWeek(endweek);
147   - checkItemNoticeManage.setNoticeInfo(noticeInfo);
148   - checkItemNoticeManage.setAffiliateId(affiliateId);
149   - checkItemNoticeManage.setModified(new Date());
150   - Integer count = checkItemNoticeManageService.updateCheckItemNoticeManage(checkItemNoticeManage);
151   - if (count > 0) {
152   - ResultUtils.buildResultAndWrite(response, 0, "修改成功");
153   - } else {
154   - ResultUtils.buildParameterErrorResultAndWrite(response, "修改失败");
  130 + if (param.getStartWeek() > param.getEndWeek()) {
  131 + ResultUtils.buildParameterErrorResultAndWrite(response, "起始周不能大于结束周!");
  132 + return;
155 133 }
  134 +
  135 + boolean repeat = true;
  136 + CheckItemManageQuery checkItemManageQuery = new CheckItemManageQuery();
  137 + checkItemManageQuery.setAffiliateId(param.getAffiliateId());
  138 + checkItemManageQuery.setType(param.getType());
  139 + List<CheckItemNoticeManage> list = checkItemNoticeManageService.getCheckItemNoticeManage(checkItemManageQuery);
  140 + if (CollectionUtils.isNotEmpty(list)) {
  141 + for (CheckItemNoticeManage checkItemManage : list) {
  142 + if(checkItemManage.getId() != param.getId() && !(param.getStartWeek() > checkItemManage.getEndWeek()
  143 + || param.getEndWeek() < checkItemManage.getStartWeek())){
  144 + repeat = false;
  145 + }
  146 + }
  147 +
  148 + }
  149 + if(repeat){
  150 + CheckItemNoticeManage checkItemNoticeManage = new CheckItemNoticeManage();
  151 + checkItemNoticeManage.setId(param.getId());
  152 + checkItemNoticeManage.setNoticeInfo(param.getNoticeInfo());
  153 + checkItemNoticeManage.setStartWeek(param.getStartWeek());
  154 + checkItemNoticeManage.setEndWeek(param.getEndWeek());
  155 + checkItemNoticeManage.setType(param.getType());
  156 + checkItemNoticeManage.setModified(new Date());
  157 + Integer count = checkItemNoticeManageService.updateCheckItemNoticeManage(checkItemNoticeManage);
  158 + if (count > 0) {
  159 + ResultUtils.buildResultAndWrite(response, 0, "修改成功");
  160 + } else {
  161 + ResultUtils.buildParameterErrorResultAndWrite(response, "修改失败");
  162 + }
  163 + }else{
  164 + ResultUtils.buildParameterErrorResultAndWrite(response, "此范围孕周已已有数据有重合,请确认!");
  165 + }
  166 +
156 167 }
157 168  
158 169 /**
159 170 * 删除展示项
160 171 */
161   - @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
  172 + @RequestMapping(value = "/delete", method = RequestMethod.POST)
162 173 @TokenRequired
163 174 public void deleteCheckItem(HttpServletResponse response, @RequestParam("id") Integer id) {
164 175 if (null == id) {