Pārlūkot izejas kodu

日常检查-02

hanqingsong 1 gadu atpakaļ
vecāks
revīzija
2e13c0b39f

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

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

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

@@ -153,8 +153,11 @@
153 153
   </insert>
154 154
   <insert id="insertSelective" parameterType="com.chinaitop.depot.storage.model.StorageDailycheck" >
155 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 159
     <trim prefix="(" suffix=")" suffixOverrides="," >
157
-      id,
160
+        id,
158 161
       <if test="houseId != null" >
159 162
         house_id,
160 163
       </if>

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

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