fanxw 2 роки тому
батько
коміт
2d85052fa9

+ 2 - 3
src/main/java/com/chinaitop/depot/business/controller/BusinessDeliveryStorageNoticeController.java

@@ -40,14 +40,13 @@ import java.util.Map;
40 40
 @RestController
41 41
 @RequestMapping(value="/depot/business/deliveryStorageNotice")
42 42
 @Api(value= "BusinessDeliveryStorageNoticeController", description = "出入库通知单管理")
43
-
44 43
 public class BusinessDeliveryStorageNoticeController {
45
-    
44
+
46 45
     @Resource
47 46
     private BusinessDeliveryStorageNoticeService deliveryStorageNoticeService;
48 47
     @Resource
49 48
     private BusinessStoreWareDetailService businessStoreWareDetailService;
50
-    
49
+
51 50
     /**
52 51
      * 申请列表.
53 52
      * @param pageNum 页码

+ 3 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessNoticeReceive.java

@@ -2,6 +2,8 @@ package com.chinaitop.depot.business.model;
2 2
 
3 3
 import java.util.Date;
4 4
 
5
+import com.fasterxml.jackson.annotation.JsonFormat;
6
+
5 7
 public class BusinessNoticeReceive {
6 8
 	
7 9
 	    //业务字段
@@ -68,6 +70,7 @@ public class BusinessNoticeReceive {
68 70
 		private Integer grainAnnual;//收获年度
69 71
 		private Integer productiveYear;//生产年份
70 72
 		private Integer grainProducingArea;//粮油产地
73
+		@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
71 74
 		private Date inputTime;//入库时间
72 75
 		
73 76
 		

+ 3 - 0
src/main/java/com/chinaitop/depot/business/model/BusinessStoreWareDetail.java

@@ -2,6 +2,8 @@ package com.chinaitop.depot.business.model;
2 2
 
3 3
 import java.util.Date;
4 4
 
5
+import com.fasterxml.jackson.annotation.JsonFormat;
6
+
5 7
 public class BusinessStoreWareDetail {
6 8
     private Integer id;
7 9
 
@@ -39,6 +41,7 @@ public class BusinessStoreWareDetail {
39 41
 
40 42
     private String inDetailTotalPrice;
41 43
 
44
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
42 45
     private Date inputTime;
43 46
 
44 47
     private Integer state;

+ 2 - 14
src/main/java/com/chinaitop/depot/business/service/impl/ReceiveNoticeServiceImpl.java

@@ -1,6 +1,5 @@
1 1
 package com.chinaitop.depot.business.service.impl;
2 2
 
3
-import java.text.SimpleDateFormat;
4 3
 import java.util.Date;
5 4
 import java.util.HashMap;
6 5
 import java.util.List;
@@ -21,6 +20,7 @@ import com.chinaitop.depot.business.model.BusinessNoticeReceiveExample.Criteria;
21 20
 import com.chinaitop.depot.business.service.FeignAgileService;
22 21
 import com.chinaitop.depot.business.service.FeignBasicService;
23 22
 import com.chinaitop.depot.business.service.ReceiveNoticeService;
23
+import com.chinaitop.depot.utils.ParameterUtil;
24 24
 import com.github.pagehelper.PageHelper;
25 25
 
26 26
 @Service
@@ -194,19 +194,7 @@ public class ReceiveNoticeServiceImpl implements ReceiveNoticeService {
194 194
                             Integer scnf = Integer.parseInt(map.get("scnf")+"");
195 195
                             Date date = null;
196 196
                             if(inputTime!=null){
197
-                                //String year=String.format("%tY", inputTime);
198
-
199
-                                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
200
-                                date = sdf.parse(inputTime);
201
-                                // 获取String字符串中的年
202
-                                //SimpleDateFormat y = new SimpleDateFormat("yyyy");
203
-                                //System.out.println(y.format(date));
204
-                                //String enumName = y.format(date);
205
-
206
-                                //Integer parentId = 1004;
207
-                                //Map<String, Object> basicMap = feignBasicService.getIdByNameAndParentId(parentId, enumName, null);//1004是生产年份的父ID
208
-                                //Integer productiveYear = (Integer) basicMap.get("enumId");
209
-
197
+                                date = ParameterUtil.string2datetime(inputTime);
210 198
                                 businessNoticeReceive.setInputTime(date);//入库时间
211 199
                             }
212 200
                             businessNoticeReceive.setProductiveYear(scnf);//生产年份