Browse Source

出库通知单提示

fanxw 3 months ago
parent
commit
ae12d7d813

+ 38 - 14
src/main/java/com/chinaitop/depot/business/controller/GrainNoticeController.java

@@ -1,6 +1,23 @@
1
 package com.chinaitop.depot.business.controller;
1
 package com.chinaitop.depot.business.controller;
2
 
2
 
3
 
3
 
4
+import java.io.IOException;
5
+import java.util.ArrayList;
6
+import java.util.HashMap;
7
+import java.util.List;
8
+import java.util.Map;
9
+
10
+import javax.annotation.Resource;
11
+import javax.servlet.http.HttpServletRequest;
12
+
13
+import org.apache.commons.lang3.StringUtils;
14
+import org.slf4j.Logger;
15
+import org.slf4j.LoggerFactory;
16
+import org.springframework.http.MediaType;
17
+import org.springframework.web.bind.annotation.RequestMapping;
18
+import org.springframework.web.bind.annotation.RequestMethod;
19
+import org.springframework.web.bind.annotation.RestController;
20
+
4
 import com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice;
21
 import com.chinaitop.depot.business.model.BusinessDeliveryStorageNotice;
5
 import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
22
 import com.chinaitop.depot.business.model.BusinessStoreWareDetail;
6
 import com.chinaitop.depot.business.model.enums.AuditType;
23
 import com.chinaitop.depot.business.model.enums.AuditType;
@@ -8,28 +25,17 @@ import com.chinaitop.depot.business.model.enums.StoreWareType;
8
 import com.chinaitop.depot.business.model.vo.BusinessDeliveryStorageNoticeAuditVO;
25
 import com.chinaitop.depot.business.model.vo.BusinessDeliveryStorageNoticeAuditVO;
9
 import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
26
 import com.chinaitop.depot.business.service.BusinessStoreWareDetailService;
10
 import com.chinaitop.depot.business.service.GrainNoticeService;
27
 import com.chinaitop.depot.business.service.GrainNoticeService;
28
+import com.chinaitop.depot.business.service.SystemOutsideDataService;
11
 import com.fasterxml.jackson.core.JsonParseException;
29
 import com.fasterxml.jackson.core.JsonParseException;
12
 import com.fasterxml.jackson.core.type.TypeReference;
30
 import com.fasterxml.jackson.core.type.TypeReference;
13
 import com.fasterxml.jackson.databind.JsonMappingException;
31
 import com.fasterxml.jackson.databind.JsonMappingException;
14
 import com.fasterxml.jackson.databind.ObjectMapper;
32
 import com.fasterxml.jackson.databind.ObjectMapper;
15
 import com.github.pagehelper.PageInfo;
33
 import com.github.pagehelper.PageInfo;
34
+
16
 import io.swagger.annotations.Api;
35
 import io.swagger.annotations.Api;
17
 import io.swagger.annotations.ApiImplicitParam;
36
 import io.swagger.annotations.ApiImplicitParam;
18
 import io.swagger.annotations.ApiImplicitParams;
37
 import io.swagger.annotations.ApiImplicitParams;
19
 import io.swagger.annotations.ApiOperation;
38
 import io.swagger.annotations.ApiOperation;
20
-import org.apache.commons.lang3.StringUtils;
21
-import org.springframework.http.MediaType;
22
-import org.springframework.web.bind.annotation.RequestMapping;
23
-import org.springframework.web.bind.annotation.RequestMethod;
24
-import org.springframework.web.bind.annotation.RestController;
25
-
26
-import javax.annotation.Resource;
27
-import javax.servlet.http.HttpServletRequest;
28
-import java.io.IOException;
29
-import java.util.ArrayList;
30
-import java.util.HashMap;
31
-import java.util.List;
32
-import java.util.Map;
33
 
39
 
34
 /**
40
 /**
35
  * 储备粮管理-通知单
41
  * 储备粮管理-通知单
@@ -41,11 +47,13 @@ import java.util.Map;
41
 @Api(value= "GrainNoticeController", description = "储备粮管理-出入库通知单管理")
47
 @Api(value= "GrainNoticeController", description = "储备粮管理-出入库通知单管理")
42
 
48
 
43
 public class GrainNoticeController {
49
 public class GrainNoticeController {
44
-    
50
+	public static final Logger logger = LoggerFactory.getLogger(GrainNoticeController.class);
45
     @Resource
51
     @Resource
46
     private GrainNoticeService deliveryStorageNoticeService;
52
     private GrainNoticeService deliveryStorageNoticeService;
47
     @Resource
53
     @Resource
48
     private BusinessStoreWareDetailService businessStoreWareDetailService;
54
     private BusinessStoreWareDetailService businessStoreWareDetailService;
55
+    @Resource
56
+	private SystemOutsideDataService systemOutsideDataService;
49
     
57
     
50
     /**
58
     /**
51
      * 申请列表.
59
      * 申请列表.
@@ -617,4 +625,20 @@ public class GrainNoticeController {
617
         }
625
         }
618
         return modelMap;
626
         return modelMap;
619
     }
627
     }
628
+    
629
+    @RequestMapping(value="/pushCktzdts",produces = MediaType.APPLICATION_JSON_VALUE,  method=RequestMethod.GET)
630
+   	@ApiOperation(value="给市平台推送出库通知单提示消息", notes = "")
631
+   	@ApiImplicitParams({
632
+   		@ApiImplicitParam(name = "fsr", value = "发送人", paramType = "query"),
633
+   		@ApiImplicitParam(name = "fsdw", value = "发送单位", paramType = "query")
634
+   	})
635
+    public void pushCktzdts(String fsr, String fsdw) {
636
+    	try {
637
+			String resultStr = deliveryStorageNoticeService.pushCktzdts(fsr, fsdw);
638
+			systemOutsideDataService.addlogger("cktzdts", fsr+"_"+fsdw, resultStr);
639
+		} catch (Exception e) {
640
+			logger.error(e.getMessage(), e);
641
+			systemOutsideDataService.addlogger("cktzdts", fsr+"_"+fsdw, e.getMessage());
642
+		}
643
+    }
620
 }
644
 }

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

@@ -216,8 +216,8 @@ public class ReceiveNoticeController {
216
 			BusinessNoticeReceive receiveNotice = (BusinessNoticeReceive)mapper.readValue(datas, BusinessNoticeReceive.class);
216
 			BusinessNoticeReceive receiveNotice = (BusinessNoticeReceive)mapper.readValue(datas, BusinessNoticeReceive.class);
217
 			receiveNoticeService.retSptMeagess(receiveNotice);
217
 			receiveNoticeService.retSptMeagess(receiveNotice);
218
 		} catch (Exception e) {
218
 		} catch (Exception e) {
219
-			logger.error("性质转变单生成异常");
220
-			logger.error(e.getMessage());
219
+			logger.error("推送性质转变单库级审批结束信息给市平台时代码异常");
220
+			logger.error(e.getMessage(), e);
221
 			map.put("status", "error");
221
 			map.put("status", "error");
222
 			map.put("msg", "接口异常,请联系管理员!");
222
 			map.put("msg", "接口异常,请联系管理员!");
223
 		}
223
 		}

+ 9 - 1
src/main/java/com/chinaitop/depot/business/service/GrainNoticeService.java

@@ -115,6 +115,14 @@ public interface GrainNoticeService {
115
 
115
 
116
 	List<BusinessDeliveryStorageNotice> getAuditPassList(Integer pageNum, Integer pageSize,
116
 	List<BusinessDeliveryStorageNotice> getAuditPassList(Integer pageNum, Integer pageSize,
117
 			BusinessDeliveryStorageNotice notice);
117
 			BusinessDeliveryStorageNotice notice);
118
-			
118
+
119
+	/**
120
+	 * 给市平台推送出库通知单提示消息
121
+	 * @param fsr
122
+	 * @param fsdw
123
+	 * @return
124
+	 * @throws Exception
125
+	 */
126
+	String pushCktzdts(String fsr, String fsdw) throws Exception;
119
 
127
 
120
 }
128
 }

+ 33 - 1
src/main/java/com/chinaitop/depot/business/service/impl/GrainNoticeServiceImpl.java

@@ -11,12 +11,15 @@ import java.util.Map;
11
 import javax.annotation.Resource;
11
 import javax.annotation.Resource;
12
 
12
 
13
 import org.apache.commons.lang.StringUtils;
13
 import org.apache.commons.lang.StringUtils;
14
+import org.slf4j.Logger;
15
+import org.slf4j.LoggerFactory;
14
 import org.springframework.stereotype.Service;
16
 import org.springframework.stereotype.Service;
15
 import org.springframework.transaction.annotation.Transactional;
17
 import org.springframework.transaction.annotation.Transactional;
16
 
18
 
17
 import com.alibaba.fastjson.JSONObject;
19
 import com.alibaba.fastjson.JSONObject;
18
 import com.chinaitop.depot.act.service.ActTaskService;
20
 import com.chinaitop.depot.act.service.ActTaskService;
19
 import com.chinaitop.depot.agile.model.BusinessScedule;
21
 import com.chinaitop.depot.agile.model.BusinessScedule;
22
+import com.chinaitop.depot.business.controller.GrainNoticeController;
20
 import com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper;
23
 import com.chinaitop.depot.business.mapper.BusinessDeliveryStorageNoticeMapper;
21
 import com.chinaitop.depot.business.model.BusinessApproval;
24
 import com.chinaitop.depot.business.model.BusinessApproval;
22
 import com.chinaitop.depot.business.model.BusinessContract;
25
 import com.chinaitop.depot.business.model.BusinessContract;
@@ -41,6 +44,8 @@ import com.chinaitop.depot.business.service.FeignAgileService;
41
 import com.chinaitop.depot.business.service.GrainContractService;
44
 import com.chinaitop.depot.business.service.GrainContractService;
42
 import com.chinaitop.depot.business.service.GrainNoticeService;
45
 import com.chinaitop.depot.business.service.GrainNoticeService;
43
 import com.chinaitop.depot.business.service.UserInfoService;
46
 import com.chinaitop.depot.business.service.UserInfoService;
47
+import com.chinaitop.depot.system.service.SysCodeService;
48
+import com.chinaitop.depot.utils.HTTPUtils;
44
 import com.github.pagehelper.PageHelper;
49
 import com.github.pagehelper.PageHelper;
45
 import com.github.pagehelper.PageInfo;
50
 import com.github.pagehelper.PageInfo;
46
 import com.google.common.collect.Maps;
51
 import com.google.common.collect.Maps;
@@ -48,7 +53,8 @@ import com.google.common.collect.Maps;
48
 
53
 
49
 @Service
54
 @Service
50
 public class GrainNoticeServiceImpl implements GrainNoticeService {
55
 public class GrainNoticeServiceImpl implements GrainNoticeService {
51
-    @Resource
56
+	public static final Logger logger = LoggerFactory.getLogger(GrainNoticeServiceImpl.class);
57
+	@Resource
52
     private BusinessDeliveryStorageNoticeMapper businessDeliveryStorageNoticeMapper;
58
     private BusinessDeliveryStorageNoticeMapper businessDeliveryStorageNoticeMapper;
53
     @Resource
59
     @Resource
54
     private BusinessStoreWareDetailService businessStoreWareDetailService;
60
     private BusinessStoreWareDetailService businessStoreWareDetailService;
@@ -67,6 +73,8 @@ public class GrainNoticeServiceImpl implements GrainNoticeService {
67
     private UserInfoService userInfoService;
73
     private UserInfoService userInfoService;
68
     @Resource
74
     @Resource
69
 	private FeignAgileService feignAgileService;
75
 	private FeignAgileService feignAgileService;
76
+    @Resource
77
+	private SysCodeService sysCodeService;
70
     
78
     
71
     // 入库通知单枚举id,出入库系统使用.
79
     // 入库通知单枚举id,出入库系统使用.
72
     private static Integer STORAGENOTICEENUMID = 2816;
80
     private static Integer STORAGENOTICEENUMID = 2816;
@@ -1233,5 +1241,29 @@ public class GrainNoticeServiceImpl implements GrainNoticeService {
1233
             List<BusinessDeliveryStorageNotice> list = businessDeliveryStorageNoticeMapper.selectByExample(example);
1241
             List<BusinessDeliveryStorageNotice> list = businessDeliveryStorageNoticeMapper.selectByExample(example);
1234
             return list;
1242
             return list;
1235
 		}
1243
 		}
1244
+
1245
+
1246
+		@Override
1247
+		public String pushCktzdts(String fsr, String fsdw) throws Exception {
1248
+			String path = sysCodeService.getSVal(10, "cktzdts");
1249
+			logger.info("查到的配置接口数据是:"+path);
1250
+			String result = null;
1251
+			if (StringUtils.isNotBlank(path)) {
1252
+				//组装请求参数
1253
+				Map<String, String> params = new HashMap<>();
1254
+				params.put("fsr", fsr);
1255
+				params.put("fsdw", fsdw);
1256
+
1257
+				logger.info("给给市平台发送出库通知单提示信息参数是:"+params.toString());
1258
+				logger.info("给给市平台发送出库通知单提示信息地址是:"+path);
1259
+
1260
+				//给市平台发送请求
1261
+				result = HTTPUtils.doPost(path, params);
1262
+
1263
+				//保存推送合同引用状态的消息和返回结果
1264
+				//systemOutsideDataService.addlogger("cktzdts", params.toString(), result);
1265
+			}
1266
+			return result;
1267
+		}
1236
     
1268
     
1237
 }
1269
 }