|
|
@ -55,6 +55,7 @@ import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
import com.yxt.messagecenter.api.message.AppMessageDto; |
|
|
|
import com.yxt.messagecenter.api.message.AppScmMessageFlowableQuery; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
|
import com.yxt.messagecenter.api.message.MsgTargetUriEnum; |
|
|
|
import com.yxt.messagecenter.api.messagelist.MessageListDto; |
|
|
@ -324,19 +325,28 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S |
|
|
|
List<String> receiveIdList = new ArrayList<>(); |
|
|
|
List<AppLiableListDto> liableList = new ArrayList<>(); |
|
|
|
AppLiableListDto appLiableListDto = new AppLiableListDto(); |
|
|
|
List<String> recipientSidList = new ArrayList<>(); |
|
|
|
appLiableListDto.setLiableName(dto.getLiableName()); |
|
|
|
appLiableListDto.setLiableSid(dto.getLiableSid()); |
|
|
|
liableList.add(appLiableListDto); |
|
|
|
recipientSidList.add(appLiableListDto.getLiableSid()); |
|
|
|
SysUserVo sysUserVos = sysUserFeign.fetchBySid(dto.getLiableSid()).getData(); |
|
|
|
Integer id = sysUserVos.getId(); |
|
|
|
receiveIdList.add(String.valueOf(id)); |
|
|
|
AppPatrolinspectionDto appPatrolinspectionDto = new AppPatrolinspectionDto(); |
|
|
|
appPatrolinspectionDto.setMsgContent(sysUserVo.getName()); |
|
|
|
appPatrolinspectionDto.setList(liableList); |
|
|
|
appPatrolinspectionDto.setMainSid(dto.getMainSid()); |
|
|
|
appPatrolinspectionDto.setReceiveIdList(receiveIdList); |
|
|
|
// 消息推送
|
|
|
|
sendMessage(appPatrolinspectionDto); |
|
|
|
AppScmMessageFlowableQuery query = new AppScmMessageFlowableQuery(); |
|
|
|
query.setMainSid(dto.getMainSid()); |
|
|
|
query.setList(recipientSidList); |
|
|
|
query.setReceiveIdList(receiveIdList); |
|
|
|
query.setMsgTitle("月度巡检问题"); |
|
|
|
query.setMsgContent(sysUserVo.getName() + "提交的月度巡检问题,请查阅"); |
|
|
|
query.setMsgSource("供应链"); |
|
|
|
query.setMsgTargetUri(MsgTargetUriEnum.GYLPKBG.getUri()); |
|
|
|
query.setApp_type("2"); |
|
|
|
query.setModuleSid("98ff0724-5df4-4fc7-ab6d-3996e7706acd"); |
|
|
|
query.setName("供应链"); |
|
|
|
// 消息推送
|
|
|
|
messageFeign.sendMessage(query); |
|
|
|
return rb.success().setMsg("添加成功"); |
|
|
|
} |
|
|
|
BeanUtil.copyProperties(dto, scmVehiclePatrolinspectionsheet, "sid"); |
|
|
@ -361,20 +371,29 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S |
|
|
|
scmVehiclePatrolinspectionService.updateByMainSid(oneKey, oneValue, newDate, sysUserVo.getName(), dto.getMainSid()); |
|
|
|
List<String> receiveIdList = new ArrayList<>(); |
|
|
|
List<AppLiableListDto> liableList = new ArrayList<>(); |
|
|
|
List<String> recipientSidList = new ArrayList<>(); |
|
|
|
AppLiableListDto appLiableListDto = new AppLiableListDto(); |
|
|
|
appLiableListDto.setLiableName(dto.getLiableName()); |
|
|
|
appLiableListDto.setLiableSid(dto.getLiableSid()); |
|
|
|
liableList.add(appLiableListDto); |
|
|
|
recipientSidList.add(dto.getLiableSid()); |
|
|
|
SysUserVo sysUserVos = sysUserFeign.fetchBySid(dto.getLiableSid()).getData(); |
|
|
|
Integer id = sysUserVos.getId(); |
|
|
|
receiveIdList.add(String.valueOf(id)); |
|
|
|
AppPatrolinspectionDto appPatrolinspectionDto = new AppPatrolinspectionDto(); |
|
|
|
appPatrolinspectionDto.setMsgContent(sysUserVo.getName()); |
|
|
|
appPatrolinspectionDto.setList(liableList); |
|
|
|
appPatrolinspectionDto.setMainSid(dto.getMainSid()); |
|
|
|
appPatrolinspectionDto.setReceiveIdList(receiveIdList); |
|
|
|
// 消息推送
|
|
|
|
sendMessage(appPatrolinspectionDto); |
|
|
|
AppScmMessageFlowableQuery query = new AppScmMessageFlowableQuery(); |
|
|
|
query.setMainSid(dto.getMainSid()); |
|
|
|
query.setList(recipientSidList); |
|
|
|
query.setReceiveIdList(receiveIdList); |
|
|
|
query.setMsgTitle("月度巡检问题"); |
|
|
|
query.setMsgContent(sysUserVo.getName() + "提交的月度巡检问题,请查阅"); |
|
|
|
query.setMsgSource("供应链"); |
|
|
|
query.setMsgTargetUri(MsgTargetUriEnum.GYLPKBG.getUri()); |
|
|
|
query.setApp_type("2"); |
|
|
|
query.setModuleSid("98ff0724-5df4-4fc7-ab6d-3996e7706acd"); |
|
|
|
query.setName("供应链"); |
|
|
|
// 消息推送
|
|
|
|
messageFeign.sendMessage(query); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
@ -489,86 +508,95 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S |
|
|
|
receiveIdList.add(String.valueOf(id)); |
|
|
|
List<AppLiableListDto> liableList = new ArrayList<>(); |
|
|
|
AppLiableListDto appLiableListDto = new AppLiableListDto(); |
|
|
|
List<String> recipientSidList = new ArrayList<>(); |
|
|
|
appLiableListDto.setLiableName(scmWarehouse.getLibTubeName()); |
|
|
|
appLiableListDto.setLiableSid(scmWarehouse.getLibTubeSid()); |
|
|
|
recipientSidList.add(dto.getLiableSid()); |
|
|
|
liableList.add(appLiableListDto); |
|
|
|
AppPatrolinspectionDto appPatrolinspectionDto = new AppPatrolinspectionDto(); |
|
|
|
appPatrolinspectionDto.setMsgContent(sysUserVo.getName()); |
|
|
|
appPatrolinspectionDto.setList(liableList); |
|
|
|
appPatrolinspectionDto.setMainSid(dto.getMainSid()); |
|
|
|
appPatrolinspectionDto.setReceiveIdList(receiveIdList); |
|
|
|
// 消息推送
|
|
|
|
sendMessage(appPatrolinspectionDto); |
|
|
|
AppScmMessageFlowableQuery query = new AppScmMessageFlowableQuery(); |
|
|
|
query.setMainSid(dto.getMainSid()); |
|
|
|
query.setList(recipientSidList); |
|
|
|
query.setReceiveIdList(receiveIdList); |
|
|
|
query.setMsgTitle("月度巡检问题"); |
|
|
|
query.setMsgContent(sysUserVo.getName() + "提交的月度巡检问题,请查阅"); |
|
|
|
query.setMsgSource("供应链"); |
|
|
|
query.setMsgTargetUri(MsgTargetUriEnum.GYLPKBG.getUri()); |
|
|
|
query.setApp_type("2"); |
|
|
|
query.setModuleSid("98ff0724-5df4-4fc7-ab6d-3996e7706acd"); |
|
|
|
query.setName("供应链"); |
|
|
|
// 消息推送
|
|
|
|
messageFeign.sendMessage(query); |
|
|
|
return rb.success().setMsg("添加成功"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 保存消息、发出推送 |
|
|
|
* |
|
|
|
* @throws InterruptedException |
|
|
|
*/ |
|
|
|
public void sendMessage(AppPatrolinspectionDto appPatrolinspectionDto) { |
|
|
|
// 1、保存消息体
|
|
|
|
AppMessageDto messageDto = new AppMessageDto(); |
|
|
|
ResultBean<List<MessageTypeVo>> messageBean = messageTypeFeign.selectAppMsgTypeList(IDENTIFIER); |
|
|
|
if (messageBean.getSuccess() && messageBean.getData() != null) { |
|
|
|
List<MessageTypeVo> typeVoList = messageBean.getData(); |
|
|
|
for (MessageTypeVo message : typeVoList) { |
|
|
|
if (message.getMsgType().equals("供应链")) { |
|
|
|
messageDto.setMsgTypeSid(message.getMsgTypeSid()); |
|
|
|
messageDto.setMsgType(message.getMsgType()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
messageDto.setMsgTitle("月度巡检问题"); |
|
|
|
messageDto.setMsgContent(appPatrolinspectionDto.getMsgContent() + "提交的月度巡检问题,请查阅"); |
|
|
|
messageDto.setMsgSource("供应链"); |
|
|
|
messageDto.setMsgTargetUri(MsgTargetUriEnum.GYLXJWT.getUri()); |
|
|
|
messageDto.setApp_type("2"); |
|
|
|
messageDto.setModuleSid("98ff0724-5df4-4fc7-ab6d-3996e7706acd"); |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("sid", appPatrolinspectionDto.getMainSid()); |
|
|
|
messageDto.setArgs_json(json.toJSONString()); |
|
|
|
String msgSid = (String) messageFeign.saveOrUpdateAppMessage(messageDto).getData(); |
|
|
|
String msgTypeSid = messageDto.getMsgTypeSid(); |
|
|
|
// 2、保存至消息列表
|
|
|
|
List<AppLiableListDto> list = appPatrolinspectionDto.getList(); |
|
|
|
// 使用多线程保存
|
|
|
|
List<Future<?>> futures = new ArrayList<Future<?>>(); |
|
|
|
ExecutorService executor = Executors.newFixedThreadPool(4); |
|
|
|
for (AppLiableListDto appLiableListDto : list) { |
|
|
|
Future<?> f = executor.submit(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
try { |
|
|
|
System.out.println("run start-----------------" + System.currentTimeMillis() + ":" + Thread.currentThread().getName()); |
|
|
|
MessageListDto messageList = new MessageListDto(); |
|
|
|
messageList.setMsgSid(msgSid); |
|
|
|
messageList.setRDelStatus(0); |
|
|
|
messageList.setSDelStatus(0); |
|
|
|
messageList.setReceiverSid(appLiableListDto.getLiableSid()); |
|
|
|
messageListFeign.save(messageList); |
|
|
|
// Thread.sleep(5 * 1000);
|
|
|
|
System.out.println("run end-----------------" + System.currentTimeMillis() + ":" + Thread.currentThread().getName()); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
futures.add(f); |
|
|
|
} |
|
|
|
executor.shutdown(); |
|
|
|
for (int i = 0; i < appPatrolinspectionDto.getReceiveIdList().size(); i++) { |
|
|
|
/** |
|
|
|
* msgTitle:排产申请 |
|
|
|
* content:xxx的排产申请 |
|
|
|
*/ |
|
|
|
JPushServer.sendPushAlias(messageDto.getMsgTitle(), messageDto.getMsgContent(), msgTypeSid, "供应链", appPatrolinspectionDto.getReceiveIdList().get(i)); |
|
|
|
} // 3、推送
|
|
|
|
// JPushServer.sendPushAll(messageDto.getMsgTitle(), messageDto.getMsgContent(), msgTypeSid, messageDto.getMsgType());
|
|
|
|
// JPushServer.sendPushAlias(messageDto.getMsgTitle(), messageDto.getMsgContent(), msgSid, messageDto.getMsgType(), "23","26","66"); // 别名
|
|
|
|
System.out.println("process end"); |
|
|
|
} |
|
|
|
// /**
|
|
|
|
// * 保存消息、发出推送
|
|
|
|
// *
|
|
|
|
// * @throws InterruptedException
|
|
|
|
// */
|
|
|
|
// public void sendMessage(AppPatrolinspectionDto appPatrolinspectionDto) {
|
|
|
|
// // 1、保存消息体
|
|
|
|
// AppMessageDto messageDto = new AppMessageDto();
|
|
|
|
// ResultBean<List<MessageTypeVo>> messageBean = messageTypeFeign.selectAppMsgTypeList(IDENTIFIER);
|
|
|
|
// if (messageBean.getSuccess() && messageBean.getData() != null) {
|
|
|
|
// List<MessageTypeVo> typeVoList = messageBean.getData();
|
|
|
|
// for (MessageTypeVo message : typeVoList) {
|
|
|
|
// if (message.getMsgType().equals("供应链")) {
|
|
|
|
// messageDto.setMsgTypeSid(message.getMsgTypeSid());
|
|
|
|
// messageDto.setMsgType(message.getMsgType());
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// messageDto.setMsgTitle("月度巡检问题");
|
|
|
|
// messageDto.setMsgContent(appPatrolinspectionDto.getMsgContent() + "提交的月度巡检问题,请查阅");
|
|
|
|
// messageDto.setMsgSource("供应链");
|
|
|
|
// messageDto.setMsgTargetUri(MsgTargetUriEnum.GYLXJWT.getUri());
|
|
|
|
// messageDto.setApp_type("2");
|
|
|
|
// messageDto.setModuleSid("98ff0724-5df4-4fc7-ab6d-3996e7706acd");
|
|
|
|
// JSONObject json = new JSONObject();
|
|
|
|
// json.put("sid", appPatrolinspectionDto.getMainSid());
|
|
|
|
// messageDto.setArgs_json(json.toJSONString());
|
|
|
|
// String msgSid = (String) messageFeign.saveOrUpdateAppMessage(messageDto).getData();
|
|
|
|
// String msgTypeSid = messageDto.getMsgTypeSid();
|
|
|
|
// // 2、保存至消息列表
|
|
|
|
// List<AppLiableListDto> list = appPatrolinspectionDto.getList();
|
|
|
|
// // 使用多线程保存
|
|
|
|
// List<Future<?>> futures = new ArrayList<Future<?>>();
|
|
|
|
// ExecutorService executor = Executors.newFixedThreadPool(4);
|
|
|
|
// for (AppLiableListDto appLiableListDto : list) {
|
|
|
|
// Future<?> f = executor.submit(new Runnable() {
|
|
|
|
// @Override
|
|
|
|
// public void run() {
|
|
|
|
// try {
|
|
|
|
// System.out.println("run start-----------------" + System.currentTimeMillis() + ":" + Thread.currentThread().getName());
|
|
|
|
// MessageListDto messageList = new MessageListDto();
|
|
|
|
// messageList.setMsgSid(msgSid);
|
|
|
|
// messageList.setRDelStatus(0);
|
|
|
|
// messageList.setSDelStatus(0);
|
|
|
|
// messageList.setReceiverSid(appLiableListDto.getLiableSid());
|
|
|
|
// messageListFeign.save(messageList);
|
|
|
|
//// Thread.sleep(5 * 1000);
|
|
|
|
// System.out.println("run end-----------------" + System.currentTimeMillis() + ":" + Thread.currentThread().getName());
|
|
|
|
// } catch (Exception e) {
|
|
|
|
// e.printStackTrace();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// futures.add(f);
|
|
|
|
// }
|
|
|
|
// executor.shutdown();
|
|
|
|
// for (int i = 0; i < appPatrolinspectionDto.getReceiveIdList().size(); i++) {
|
|
|
|
// /**
|
|
|
|
// * msgTitle:排产申请
|
|
|
|
// * content:xxx的排产申请
|
|
|
|
// */
|
|
|
|
// JPushServer.sendPushAlias(messageDto.getMsgTitle(), messageDto.getMsgContent(), msgTypeSid, "供应链", appPatrolinspectionDto.getReceiveIdList().get(i));
|
|
|
|
// } // 3、推送
|
|
|
|
//// JPushServer.sendPushAll(messageDto.getMsgTitle(), messageDto.getMsgContent(), msgTypeSid, messageDto.getMsgType());
|
|
|
|
//// JPushServer.sendPushAlias(messageDto.getMsgTitle(), messageDto.getMsgContent(), msgSid, messageDto.getMsgType(), "23","26","66"); // 别名
|
|
|
|
// System.out.println("process end");
|
|
|
|
// }
|
|
|
|
|
|
|
|
/** |
|
|
|
* 手机端-通过巡检操作 |
|
|
|