Ver código fonte

日常检查-02

hanqingsong 1 ano atrás
pai
commit
2e13c0b39f

+ 1 - 1
src/main/java/com/chinaitop/depot/storage/controller/StorageDailyController.java

@@ -106,7 +106,7 @@ public class StorageDailyController {
106
         // JSON字符串转对象
106
         // JSON字符串转对象
107
         ObjectMapper mapper = new ObjectMapper();
107
         ObjectMapper mapper = new ObjectMapper();
108
         try {
108
         try {
109
-            StorageDailycheck dailycheck = (StorageDailycheck)mapper.readValue(dailycheckJson, StorageDailycheck.class);
109
+            StorageDailycheck dailycheck = mapper.readValue(dailycheckJson, StorageDailycheck.class);
110
             storageDailyService.save(dailycheck);
110
             storageDailyService.save(dailycheck);
111
             modelMap.put("status", "success");
111
             modelMap.put("status", "success");
112
         } catch (IOException e) {
112
         } catch (IOException e) {

+ 4 - 1
src/main/java/com/chinaitop/depot/storage/mapper/StorageDailycheckMapper.xml

@@ -153,8 +153,11 @@
153
   </insert>
153
   </insert>
154
   <insert id="insertSelective" parameterType="com.chinaitop.depot.storage.model.StorageDailycheck" >
154
   <insert id="insertSelective" parameterType="com.chinaitop.depot.storage.model.StorageDailycheck" >
155
     insert into storage_dailycheck
155
     insert into storage_dailycheck
156
+    <selectKey keyProperty="id" resultType="java.lang.Integer" order="BEFORE">
157
+      select seq_storage_dailycheck.nextVal from dual
158
+    </selectKey>
156
     <trim prefix="(" suffix=")" suffixOverrides="," >
159
     <trim prefix="(" suffix=")" suffixOverrides="," >
157
-      id,
160
+        id,
158
       <if test="houseId != null" >
161
       <if test="houseId != null" >
159
         house_id,
162
         house_id,
160
       </if>
163
       </if>

+ 4 - 0
src/main/java/com/chinaitop/depot/storage/model/StorageDailycheck.java

@@ -1,5 +1,7 @@
1
 package com.chinaitop.depot.storage.model;
1
 package com.chinaitop.depot.storage.model;
2
 
2
 
3
+import com.fasterxml.jackson.annotation.JsonFormat;
4
+
3
 import java.math.BigDecimal;
5
 import java.math.BigDecimal;
4
 import java.util.Date;
6
 import java.util.Date;
5
 
7
 
@@ -20,6 +22,7 @@ public class StorageDailycheck {
20
 
22
 
21
     private String cyry; // 参与人员(提交人)
23
     private String cyry; // 参与人员(提交人)
22
 
24
 
25
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
23
     private Date commitTime; // 参与人员(提交人)
26
     private Date commitTime; // 参与人员(提交人)
24
 
27
 
25
     private String tqqk;
28
     private String tqqk;
@@ -92,6 +95,7 @@ public class StorageDailycheck {
92
 
95
 
93
     private Integer subType;
96
     private Integer subType;
94
 
97
 
98
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8")
95
     private Date checkTime;
99
     private Date checkTime;
96
 
100
 
97
     private String checker;
101
     private String checker;