renyu %!s(int64=2) %!d(string=hai) anos
pai
achega
8091bcd608

+ 4 - 1
src/main/java/com/chinaitop/depot/fumigation/controller/FumigationAlterController.java

@@ -15,6 +15,7 @@ import io.swagger.annotations.ApiImplicitParams;
15 15
 import io.swagger.annotations.ApiOperation;
16 16
 import org.springframework.beans.factory.annotation.Value;
17 17
 import org.springframework.http.MediaType;
18
+import org.springframework.util.CollectionUtils;
18 19
 import org.springframework.web.bind.annotation.RequestMapping;
19 20
 import org.springframework.web.bind.annotation.RequestMethod;
20 21
 import org.springframework.web.bind.annotation.RestController;
@@ -194,7 +195,9 @@ public class FumigationAlterController {
194 195
             criteria.andRecordIdEqualTo(tFumigationAfter.getRecordId());
195 196
             criteria.andDeleteStateEqualTo("1");
196 197
             List<TFumigationProcess> tFumigationProcess = fumigationProcessService.getDataByFumId(example);
197
-            modelMap.put("processEdit",tFumigationProcess.get(0));//熏蒸作业过程数据
198
+            if(!CollectionUtils.isEmpty(tFumigationProcess)){
199
+                modelMap.put("processEdit",tFumigationProcess.get(0));//熏蒸作业过程数据
200
+            }
198 201
 
199 202
             TFumigationForrecord fumigationForrecord = fumigationForRecordService.getById(tFumigationAfter.getRecordId());
200 203
             /* TFumigationPlan tFumigationPlan = fumigationPlanService.findById(tFumigationProcess.getFumigationId());*/

+ 18 - 0
src/main/java/com/chinaitop/depot/fumigation/controller/FumigationForRecordController.java

@@ -576,16 +576,34 @@ public class FumigationForRecordController {
576 576
             BigDecimal zyyl = new BigDecimal(ObjectUtils.toString(detail.get("totalDosage")));
577 577
             String hcjcdh = (String)detail.get("pestNo");
578 578
             List<Map<String,Object>> pest =  (List<Map<String,Object>>)detail.get("pestVOS");
579
+
579 580
             if(!CollectionUtils.isEmpty(pest)){
580 581
                 String zyhc = "";
581 582
                 String ckmd = "";
582 583
                 for (Map<String, Object> stringObjectMap : pest) {
584
+                    TFumigationPesticide pesticide = new TFumigationPesticide();
585
+                    pesticide.setRecordId(uuid);
583 586
                     if(stringObjectMap.get("pestType") !=null){
584 587
                         zyhc +=(String)stringObjectMap.get("pestType")+"#";
588
+                        pesticide.setMajorInsectPests(Integer.valueOf((String)stringObjectMap.get("pestType")));
585 589
                     }
586 590
                     if(stringObjectMap.get("density") !=null){
587 591
                         ckmd += (String)stringObjectMap.get("density") + "|";
592
+                        pesticide.setInsectDensity((String)stringObjectMap.get("density"));
593
+                    }
594
+                    if(yjmc!=null){
595
+                        pesticide.setDrugName(Integer.valueOf(yjmc));
596
+                    }
597
+                    if(stringObjectMap.get("discoveryTime")!=null){
598
+                        pesticide.setInsectProductTime(format.parse((String)stringObjectMap.get("discoveryTime")));
599
+                    }
600
+                    if(stringObjectMap.get("happenPosition")!=null){
601
+                        pesticide.setOccurrencePlace((String)stringObjectMap.get("happenPosition"));
602
+                    }
603
+                    if(stringObjectMap.get("pestResistance")!=null){
604
+                        pesticide.setDrugResistance((String)stringObjectMap.get("pestResistance"));
588 605
                     }
606
+                    pesticidePlanService.add(pesticide);
589 607
                 }
590 608
                 zyhc = zyhc.substring(0,zyhc.lastIndexOf("#"));
591 609
                 ckmd = ckmd.substring(0,ckmd.lastIndexOf("|"));

+ 2 - 1
src/main/java/com/chinaitop/depot/fumigation/controller/FumigationProcessController.java

@@ -103,12 +103,13 @@ public class FumigationProcessController {
103 103
     @RequestMapping(value="/saveFumigationProcessDate", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.POST)
104 104
     @ApiOperation(value="保存熏蒸作业信息", notes = "保存熏蒸作业信息")
105 105
     @ApiImplicitParams({
106
-            @ApiImplicitParam(name = "fumigation", value = "熏蒸作业数据", paramType = "form")
106
+            @ApiImplicitParam(name = "fumigationProcess", value = "熏蒸作业数据", paramType = "form")
107 107
     })
108 108
     public Map<String, Object> saveFumigationProcessDate(String fumigationProcess) throws Exception {
109 109
         Map<String, Object> modelMap = new HashMap<String, Object>();
110 110
         // JSON字符串转对象
111 111
         ObjectMapper mapper = new ObjectMapper();
112
+        //TFumigationProcess tFumigationProcess = mapper.readValue(fumigationProcess,TFumigationProcess.class);
112 113
         TFumigationProcess tFumigationProcess = (TFumigationProcess) JsonToObjectUtils.jsonToObject(fumigationProcess,"com.chinaitop.depot.fumigation.model.TFumigationProcess");
113 114
         tFumigationProcess.setDeleteState("1");//默认设置删除标志
114 115
         if (tFumigationProcess.getId() == null) {

+ 20 - 0
src/main/java/com/chinaitop/depot/fumigation/controller/PesticidePlanController.java

@@ -226,6 +226,26 @@ public class PesticidePlanController {
226 226
     }
227 227
 
228 228
     /**
229
+     * 根据熏蒸id查询施药数据
230
+     * @param id 主键id
231
+     * @return
232
+     */
233
+    @RequestMapping(value="/getByRecordId", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
234
+    @ApiOperation(value="根据熏蒸备案id查询施药数据", notes = "根据熏蒸备案id查询施药数据")
235
+    @ApiImplicitParams({
236
+            @ApiImplicitParam(name = "recordId", value = "熏蒸备案id", paramType = "query")
237
+    })
238
+    public List<TFumigationPesticide> getByRecordId(String recordId) {
239
+        TFumigationPesticideExample example = new TFumigationPesticideExample();
240
+        TFumigationPesticideExample.Criteria criteria = example.createCriteria();
241
+        criteria.andRecordIdEqualTo(recordId);
242
+
243
+        List<TFumigationPesticide> tFumigationPesticides = pesticidePlanService.getFumigationPesticideList(example);
244
+
245
+        return tFumigationPesticides;
246
+    }
247
+
248
+    /**
229 249
      * 施药方案状态提交
230 250
      *
231 251
      * @param id 数据ID

+ 4 - 3
src/main/java/com/chinaitop/depot/fumigation/mapper/TFumigationPesticideMapper.xml

@@ -44,6 +44,7 @@
44 44
     <result column="kjdwyyl" property="kjdwyyl" jdbcType="DECIMAL" />
45 45
     <result column="syff" property="syff" jdbcType="VARCHAR" />
46 46
     <result column="fzsycs" property="fzsycs" jdbcType="VARCHAR" />
47
+    <result column="record_id" property="recordId" jdbcType="VARCHAR" />
47 48
   </resultMap>
48 49
   <sql id="Example_Where_Clause" >
49 50
     <where >
@@ -110,7 +111,7 @@
110 111
     seal_type, setting_concentration, concentration_check_type, bulk_gas_type, drug_user_number, 
111 112
     pesticide_operator, creater, create_time, update_time, state, approve_people, approve_department, 
112 113
     approve_note, approve_time, org_id, delete_state, updatetime, syryzzqk, syzzsh, jx, 
113
-    lddwyyl, kjdwyyl, syff, fzsycs
114
+    lddwyyl, kjdwyyl, syff, fzsycs,record_id
114 115
   </sql>
115 116
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.fumigation.model.TFumigationPesticideExample" >
116 117
     select
@@ -157,7 +158,7 @@
157 158
       org_id, delete_state, updatetime, 
158 159
       syryzzqk, syzzsh, jx, 
159 160
       lddwyyl, kjdwyyl, syff, 
160
-      fzsycs)
161
+      fzsycs,record_id)
161 162
     values (#{id,jdbcType=VARCHAR}, #{fumigationId,jdbcType=VARCHAR}, #{majorInsectPests,jdbcType=INTEGER}, 
162 163
       #{insectDensity,jdbcType=VARCHAR}, #{occurrencePlace,jdbcType=VARCHAR}, #{insectProductTime,jdbcType=TIMESTAMP}, 
163 164
       #{drugResistance,jdbcType=VARCHAR}, #{drugName,jdbcType=INTEGER}, #{reagentType,jdbcType=VARCHAR}, 
@@ -172,7 +173,7 @@
172 173
       #{orgId,jdbcType=VARCHAR}, #{deleteState,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, 
173 174
       #{syryzzqk,jdbcType=VARCHAR}, #{syzzsh,jdbcType=VARCHAR}, #{jx,jdbcType=VARCHAR}, 
174 175
       #{lddwyyl,jdbcType=DECIMAL}, #{kjdwyyl,jdbcType=DECIMAL}, #{syff,jdbcType=VARCHAR}, 
175
-      #{fzsycs,jdbcType=VARCHAR})
176
+      #{fzsycs,jdbcType=VARCHAR},#{recordId,jdbcType=VARCHAR})
176 177
   </insert>
177 178
   <insert id="insertSelective" parameterType="com.chinaitop.depot.fumigation.model.TFumigationPesticide" >
178 179
     insert into t_fumigation_pesticide

+ 19 - 1
src/main/java/com/chinaitop/depot/fumigation/model/TFumigationForrecord.java

@@ -1,5 +1,6 @@
1 1
 package com.chinaitop.depot.fumigation.model;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
3 4
 import org.springframework.format.annotation.DateTimeFormat;
4 5
 
5 6
 import java.math.BigDecimal;
@@ -15,9 +16,12 @@ public class TFumigationForrecord {
15 16
 
16 17
     private String contactPhone;
17 18
 
18
-    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
19
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
20
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
19 21
     private Date fumigationStart;
20 22
 
23
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
24
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
21 25
     private Date fumigationEnd;
22 26
 
23 27
     private String east;
@@ -36,16 +40,22 @@ public class TFumigationForrecord {
36 40
 
37 41
     private Integer creater;
38 42
 
43
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
44
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
39 45
     private Date createTime;
40 46
 
41 47
     private String outPerson;
42 48
 
49
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
50
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
43 51
     private Date outForrecordTime;
44 52
 
45 53
     private Integer orgId;
46 54
 
47 55
     private String deleteState;
48 56
 
57
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
58
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
49 59
     private Date updatetime;
50 60
 
51 61
     private List<TFumigationPersonnel> fumigationPersonnelList;
@@ -205,6 +215,8 @@ public class TFumigationForrecord {
205 215
     /**
206 216
      *药剂有效期
207 217
      */
218
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
219
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
208 220
     private Date yjyxq;
209 221
 
210 222
     /**
@@ -225,6 +237,8 @@ public class TFumigationForrecord {
225 237
     /**
226 238
      * 领取时间
227 239
      */
240
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
241
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
228 242
     private Date lqsj;
229 243
 
230 244
     /**
@@ -235,6 +249,8 @@ public class TFumigationForrecord {
235 249
     /**
236 250
      * 审批时间
237 251
      */
252
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
253
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
238 254
     private Date spsj;
239 255
 
240 256
     /**
@@ -280,6 +296,8 @@ public class TFumigationForrecord {
280 296
     /**
281 297
      * 申请日期
282 298
      */
299
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
300
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
283 301
     private Date sqrq;
284 302
 
285 303
     /**

+ 32 - 0
src/main/java/com/chinaitop/depot/fumigation/model/TFumigationPesticide.java

@@ -1,5 +1,8 @@
1 1
 package com.chinaitop.depot.fumigation.model;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import org.springframework.format.annotation.DateTimeFormat;
5
+
3 6
 import java.math.BigDecimal;
4 7
 import java.util.Date;
5 8
 
@@ -14,6 +17,8 @@ public class TFumigationPesticide {
14 17
 
15 18
     private String occurrencePlace;
16 19
 
20
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
21
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
17 22
     private Date insectProductTime;
18 23
 
19 24
     private String drugResistance;
@@ -28,14 +33,20 @@ public class TFumigationPesticide {
28 33
 
29 34
     private String getPerson;
30 35
 
36
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
37
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
31 38
     private Date getTime;
32 39
 
33 40
     private String drugPurity;
34 41
 
35 42
     private String useDrugType;
36 43
 
44
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
45
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
37 46
     private Date plannDrugStartTime;
38 47
 
48
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
49
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
39 50
     private Date plannDrugUseUpTime;
40 51
 
41 52
     private String plannDrugCount;
@@ -54,8 +65,12 @@ public class TFumigationPesticide {
54 65
 
55 66
     private Integer creater;
56 67
 
68
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
69
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
57 70
     private Date createTime;
58 71
 
72
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
73
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
59 74
     private Date updateTime;
60 75
 
61 76
     private Integer state;
@@ -66,12 +81,16 @@ public class TFumigationPesticide {
66 81
 
67 82
     private String approveNote;
68 83
 
84
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
85
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
69 86
     private Date approveTime;
70 87
 
71 88
     private String orgId;
72 89
 
73 90
     private String deleteState;
74 91
 
92
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
93
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
75 94
     private Date updatetime;
76 95
 
77 96
     private String syryzzqk;
@@ -89,6 +108,11 @@ public class TFumigationPesticide {
89 108
     private String fzsycs;
90 109
 
91 110
     /**
111
+     * 备案id
112
+     */
113
+    private String recordId;
114
+
115
+    /**
92 116
      * 施药任务表
93 117
      * @return id 施药任务表
94 118
      */
@@ -759,4 +783,12 @@ public class TFumigationPesticide {
759 783
     public void setFzsycs(String fzsycs) {
760 784
         this.fzsycs = fzsycs == null ? null : fzsycs.trim();
761 785
     }
786
+
787
+    public String getRecordId() {
788
+        return recordId;
789
+    }
790
+
791
+    public void setRecordId(String recordId) {
792
+        this.recordId = recordId;
793
+    }
762 794
 }

+ 5 - 0
src/main/java/com/chinaitop/depot/fumigation/model/TFumigationPesticideExample.java

@@ -2907,6 +2907,11 @@ public class TFumigationPesticideExample {
2907 2907
             addCriterion("fzsycs not between", value1, value2, "fzsycs");
2908 2908
             return (Criteria) this;
2909 2909
         }
2910
+
2911
+        public Criteria andRecordIdEqualTo(String value) {
2912
+            addCriterion("record_id =", value, "recordId");
2913
+            return (Criteria) this;
2914
+        }
2910 2915
     }
2911 2916
 
2912 2917
     /**

+ 23 - 0
src/main/java/com/chinaitop/depot/fumigation/model/TFumigationProcess.java

@@ -1,5 +1,8 @@
1 1
 package com.chinaitop.depot.fumigation.model;
2 2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+import org.springframework.format.annotation.DateTimeFormat;
5
+
3 6
 import java.math.BigDecimal;
4 7
 import java.util.Date;
5 8
 
@@ -32,6 +35,8 @@ public class TFumigationProcess {
32 35
 
33 36
     private String oxygenAlarmDevice;
34 37
 
38
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
39
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
35 40
     private Date firstUseDrugTime;
36 41
 
37 42
     private String firstUseDrugUnit;
@@ -40,10 +45,14 @@ public class TFumigationProcess {
40 45
 
41 46
     private String circulationUseTime;
42 47
 
48
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
49
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
43 50
     private Date firstSupplementDrugTime;
44 51
 
45 52
     private String firstSupplementDrugCount;
46 53
 
54
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
55
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
47 56
     private Date lastSupplementDrugTime;
48 57
 
49 58
     private String lastSupplementDrugCount;
@@ -100,10 +109,16 @@ public class TFumigationProcess {
100 109
 
101 110
     private Integer isHaveFirstAidKit;
102 111
 
112
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
113
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
103 114
     private Date bulkStartTime;
104 115
 
116
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
117
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
105 118
     private Date bulkEndTime;
106 119
 
120
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
121
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
107 122
     private Date perforatedDate;
108 123
 
109 124
     private String perforatedDays;
@@ -126,12 +141,18 @@ public class TFumigationProcess {
126 141
 
127 142
     private Integer taskState;
128 143
 
144
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
145
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
129 146
     private Date taskEndTime;
130 147
 
131 148
     private Integer creater;
132 149
 
150
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
151
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
133 152
     private Date createTime;
134 153
 
154
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
155
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
135 156
     private Date updateTime;
136 157
 
137 158
     private Integer orgId;
@@ -140,6 +161,8 @@ public class TFumigationProcess {
140 161
 
141 162
     private String dataSource;
142 163
 
164
+    @DateTimeFormat(pattern="yyyy-MM-dd  HH:mm:ss")
165
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
143 166
     private Date updatetime;
144 167
 
145 168
     private String yqbjyaqjc;