|
@@ -1,15 +1,16 @@
|
|
|
package com.steerinfo.ems.emsgmpcjh.controller;
|
|
|
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.steerinfo.auth.utils.JwtUtil;
|
|
|
import com.steerinfo.ems.Utils.DateUtils;
|
|
|
import com.steerinfo.ems.Utils.ExcelToolUtils;
|
|
|
-import com.steerinfo.ems.websocket.controller.WebSocket;
|
|
|
import com.steerinfo.ems.emsgmpcjh.mapper.EmsGmPcJhMapper;
|
|
|
import com.steerinfo.ems.emsgmpcjh.model.EmsGmPcJh;
|
|
|
import com.steerinfo.ems.emsgmpcjh.service.IEmsGmPcJhService;
|
|
|
import com.steerinfo.ems.emsprodplanweightadjustment.mapper.EmsProdplanWeightAdjustmentMapper;
|
|
|
import com.steerinfo.ems.emsprodplanweightadjustment.model.EmsProdplanWeightAdjustment;
|
|
|
+import com.steerinfo.ems.emswebsocketlog.model.EmsWebsocketLog;
|
|
|
+import com.steerinfo.ems.emswebsocketlog.service.IEmsWebsocketLogService;
|
|
|
+import com.steerinfo.ems.websocket.controller.WebSocket;
|
|
|
import com.steerinfo.framework.controller.BaseRESTfulController;
|
|
|
import com.steerinfo.framework.controller.RESTfulResult;
|
|
|
import com.steerinfo.framework.service.pagehelper.PageList;
|
|
@@ -22,11 +23,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.text.ParseException;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* EmsGmPcJh RESTful接口:
|
|
@@ -56,6 +53,8 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
|
private WebSocket webSocket;
|
|
|
@Autowired
|
|
|
EmsProdplanWeightAdjustmentMapper emsProdplanWeightAdjustmentMapper;
|
|
|
+ @Autowired
|
|
|
+ IEmsWebsocketLogService emsWebsocketLogService;
|
|
|
|
|
|
@ApiOperation(value="获取列表", notes="分页查询")
|
|
|
@ApiImplicitParams({
|
|
@@ -249,15 +248,25 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
|
emsGmPcJhService.updateState(model);
|
|
|
}
|
|
|
if(result){
|
|
|
- soketMessage += "已下发,请注意接收";
|
|
|
- String[] roles = {"生产部-生产处"};
|
|
|
- Map <String, Object> map = new HashMap<String,Object>();
|
|
|
- map.put("role",roles);
|
|
|
- map.put("title","国贸订单下发");
|
|
|
- map.put("message",soketMessage);
|
|
|
- map.put("tips","您好,有新的国贸计划已下发,请注意接收。");
|
|
|
- soketMessage= JSON.toJSONString(map);
|
|
|
- webSocket.sendAllMessage(soketMessage);
|
|
|
+ soketMessage += "已下发,请注意接收";
|
|
|
+ List<EmsWebsocketLog> websocketLogs = new ArrayList<>();
|
|
|
+ EmsWebsocketLog websocketLog = new EmsWebsocketLog();
|
|
|
+ websocketLog.setMessage(soketMessage);
|
|
|
+ websocketLog.setTitle("生产部-生产处");
|
|
|
+ websocketLog.setState("0");
|
|
|
+ websocketLog.setTips("国贸订单下发");
|
|
|
+ websocketLog.setRole("您好,有新的国贸计划已下发,请注意接收。");
|
|
|
+ websocketLogs.add(websocketLog);
|
|
|
+ emsWebsocketLogService.pushMessageByDataException(websocketLogs);
|
|
|
+ //soketMessage += "已下发,请注意接收";
|
|
|
+ //String[] roles = {"生产部-生产处"};
|
|
|
+ //Map <String, Object> map = new HashMap<String,Object>();
|
|
|
+ //map.put("role",roles);
|
|
|
+ //map.put("title","国贸订单下发");
|
|
|
+ //map.put("message",soketMessage);
|
|
|
+ //map.put("tips","您好,有新的国贸计划已下发,请注意接收。");
|
|
|
+ //soketMessage= JSON.toJSONString(map);
|
|
|
+ // webSocket.sendAllMessage(soketMessage);
|
|
|
}
|
|
|
return success();
|
|
|
}
|
|
@@ -302,14 +311,24 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
|
}
|
|
|
if(result){
|
|
|
soketMessage += "已提交审核,请注意接收";
|
|
|
- String[] roles = {"国贸-部门领导"};
|
|
|
- Map <String, Object> map = new HashMap<String,Object>();
|
|
|
- map.put("role",roles);
|
|
|
- map.put("title","国贸订单审核");
|
|
|
- map.put("message",soketMessage);
|
|
|
- map.put("tips","您好,有新的国贸计划已提交审核,请注意接收。");
|
|
|
- soketMessage= JSON.toJSONString(map);
|
|
|
- webSocket.sendAllMessage(soketMessage);
|
|
|
+ List<EmsWebsocketLog> websocketLogs = new ArrayList<>();
|
|
|
+ EmsWebsocketLog websocketLog = new EmsWebsocketLog();
|
|
|
+ websocketLog.setMessage(soketMessage);
|
|
|
+ websocketLog.setTitle("国贸-部门领导");
|
|
|
+ websocketLog.setState("0");
|
|
|
+ websocketLog.setTips("国贸订单审核");
|
|
|
+ websocketLog.setRole("您好,有新的国贸计划已提交审核,请注意接收。");
|
|
|
+ websocketLogs.add(websocketLog);
|
|
|
+ emsWebsocketLogService.pushMessageByDataException(websocketLogs);
|
|
|
+ //soketMessage += "已提交审核,请注意接收";
|
|
|
+ //String[] roles = {"国贸-部门领导"};
|
|
|
+ //Map <String, Object> map = new HashMap<String,Object>();
|
|
|
+ //map.put("role",roles);
|
|
|
+ //map.put("title","国贸订单审核");
|
|
|
+ //map.put("message",soketMessage);
|
|
|
+ //map.put("tips","您好,有新的国贸计划已提交审核,请注意接收。");
|
|
|
+ //soketMessage= JSON.toJSONString(map);
|
|
|
+ //webSocket.sendAllMessage(soketMessage);
|
|
|
}
|
|
|
return success();
|
|
|
}
|
|
@@ -334,14 +353,24 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
|
soketMessage+=emsGmPcJh.getId()+",";
|
|
|
if(result){
|
|
|
soketMessage += "下发,请注意接收";
|
|
|
- String[] roles = {"生产部-生产处"};
|
|
|
- Map <String, Object> map = new HashMap<String,Object>();
|
|
|
- map.put("role",roles);
|
|
|
- map.put("title","国贸订单下发");
|
|
|
- map.put("message",soketMessage);
|
|
|
- map.put("tips","您好,有新的国贸计划已经下发,请注意接收。");
|
|
|
- soketMessage= JSON.toJSONString(map);
|
|
|
- webSocket.sendAllMessage(soketMessage);
|
|
|
+ List<EmsWebsocketLog> websocketLogs = new ArrayList<>();
|
|
|
+ EmsWebsocketLog websocketLog = new EmsWebsocketLog();
|
|
|
+ websocketLog.setMessage(soketMessage);
|
|
|
+ websocketLog.setTitle("生产处");
|
|
|
+ websocketLog.setState("0");
|
|
|
+ websocketLog.setTips("国贸订单下发");
|
|
|
+ websocketLog.setRole("您好,有新的国贸计划已经下发,请注意接收。");
|
|
|
+ websocketLogs.add(websocketLog);
|
|
|
+ emsWebsocketLogService.pushMessageByDataException(websocketLogs);
|
|
|
+ //soketMessage += "下发,请注意接收";
|
|
|
+ //String[] roles = {"生产部-生产处"};
|
|
|
+ //Map <String, Object> map = new HashMap<String,Object>();
|
|
|
+ //map.put("role",roles);
|
|
|
+ //map.put("title","国贸订单下发");
|
|
|
+ //map.put("message",soketMessage);
|
|
|
+ //map.put("tips","您好,有新的国贸计划已经下发,请注意接收。");
|
|
|
+ //soketMessage= JSON.toJSONString(map);
|
|
|
+ //webSocket.sendAllMessage(soketMessage);
|
|
|
}
|
|
|
}
|
|
|
return success();
|
|
@@ -365,14 +394,24 @@ public class EmsGmPcJhController extends BaseRESTfulController {
|
|
|
soketMessage+=emsGmPcJh.getId()+",";
|
|
|
if(result){
|
|
|
soketMessage += "已被撤回,请注意查看";
|
|
|
- String[] roles = {"国贸-业务人员"};
|
|
|
- Map <String, Object> map = new HashMap<String,Object>();
|
|
|
- map.put("role",roles);
|
|
|
- map.put("title","国贸订单审核");
|
|
|
- map.put("message",soketMessage);
|
|
|
- map.put("tips","您好,您提交的订单已被撤回,请注意查看。");
|
|
|
- soketMessage= JSON.toJSONString(map);
|
|
|
- webSocket.sendAllMessage(soketMessage);
|
|
|
+ List<EmsWebsocketLog> websocketLogs = new ArrayList<>();
|
|
|
+ EmsWebsocketLog websocketLog = new EmsWebsocketLog();
|
|
|
+ websocketLog.setMessage(soketMessage);
|
|
|
+ websocketLog.setTitle("国贸-业务人员");
|
|
|
+ websocketLog.setState("0");
|
|
|
+ websocketLog.setTips("国贸订单审核");
|
|
|
+ websocketLog.setRole("您好,您提交的订单已被撤回,请注意查看。");
|
|
|
+ websocketLogs.add(websocketLog);
|
|
|
+ emsWebsocketLogService.pushMessageByDataException(websocketLogs);
|
|
|
+ //soketMessage += "已被撤回,请注意查看";
|
|
|
+ //String[] roles = {"国贸-业务人员"};
|
|
|
+ //Map <String, Object> map = new HashMap<String,Object>();
|
|
|
+ //map.put("role",roles);
|
|
|
+ //map.put("title","国贸订单审核");
|
|
|
+ //map.put("message",soketMessage);
|
|
|
+ //map.put("tips","您好,您提交的订单已被撤回,请注意查看。");
|
|
|
+ //soketMessage= JSON.toJSONString(map);
|
|
|
+ //webSocket.sendAllMessage(soketMessage);
|
|
|
}
|
|
|
}
|
|
|
return success();
|