|
@@ -730,4 +730,161 @@ public class SampleXxlJob {
|
|
|
map.put("recordType", recordType);
|
|
|
return map;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 会计-超期收款发票通知
|
|
|
+ */
|
|
|
+ @XxlJob("exceedCwFinance")
|
|
|
+ public void exceedCwFinance(){
|
|
|
+ String exceedCwFinance = SpringUtil.getBean(FinanceFeignApi.class).getExceedCwFinance();
|
|
|
+ List<CwFinanceInvoiceList> invoiceList = JSON.parseObject(exceedCwFinance, new TypeReference<List<CwFinanceInvoiceList>>() {});
|
|
|
+ for (CwFinanceInvoiceList invoice : invoiceList) {
|
|
|
+ //对数据进行发送通知
|
|
|
+ String taskName = null;
|
|
|
+ String titleStr = null;
|
|
|
+
|
|
|
+ int interval = Integer.parseInt(this.getInterval(invoice.getBillingDate(), new Date()));
|
|
|
+
|
|
|
+ taskName = "超期收款发票";
|
|
|
+ titleStr = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],已超期"+interval+"天,请尽快收款";
|
|
|
+
|
|
|
+ Set<String> noticeUserSet = new HashSet<String>();
|
|
|
+
|
|
|
+ //获取人员信息
|
|
|
+ String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(invoice.getCreateBy().getId());
|
|
|
+ UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
|
|
|
+
|
|
|
+ if(null != createUser && StringUtils.isNotBlank(createUser.getId())){
|
|
|
+ noticeUserSet.add(createUser.getId());
|
|
|
+ }
|
|
|
+ List<String> noticeUserList = new ArrayList<String>(noticeUserSet);
|
|
|
+ if(noticeUserList.size()>0){
|
|
|
+ MyNoticeList myNotice = new MyNoticeList();
|
|
|
+ myNotice.setCreateById("1");
|
|
|
+ myNotice.setCreateTime(new Date());
|
|
|
+ myNotice.setUpdateById("1");
|
|
|
+ myNotice.setUpdateTime(new Date());
|
|
|
+ myNotice.setDelFlag(0);
|
|
|
+ //根据procInsId获取taskId
|
|
|
+// String currentTask = SpringUtil.getBean(IFlowableApi.class).getTaskIdByprocInstId(info.getProcInsId());
|
|
|
+ myNotice.setTaskId("");
|
|
|
+ myNotice.setDefId(invoice.getId());
|
|
|
+ myNotice.setTitle(titleStr);
|
|
|
+ myNotice.setTaskName(taskName);
|
|
|
+ myNotice.setLink("结束");
|
|
|
+ myNotice.setType("0");
|
|
|
+ myNotice.setCreateUser("管理员");
|
|
|
+ myNotice.setCreateTime(new Date());
|
|
|
+
|
|
|
+ for (String noticeUserId : noticeUserList) {
|
|
|
+ myNotice.setNoticeId(noticeUserId);
|
|
|
+ myNotice.setNoticeName(createUser.getName());
|
|
|
+ //根据taskName和通知人 查询重复数量
|
|
|
+ String myNoticeInfo = JSON.toJSONString(myNotice);
|
|
|
+ Map<String,String> map = new HashMap();
|
|
|
+ map.put("myNoticeInfo", myNoticeInfo);
|
|
|
+ String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
|
|
|
+ MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {});
|
|
|
+
|
|
|
+ if(null == repetitionCountBymyNotice){
|
|
|
+ // 生成id
|
|
|
+ String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ myNotice.setId(id);
|
|
|
+ myNotice.setRepetitionCount(0);
|
|
|
+
|
|
|
+ myNoticeInfo = JSON.toJSONString(myNotice);
|
|
|
+ map.put("myNoticeInfo", myNoticeInfo);
|
|
|
+ SpringUtil.getBean ( IFlowableApi.class ).insertMyNotice(map);
|
|
|
+ }else{
|
|
|
+ myNotice.setId(repetitionCountBymyNotice.getId());
|
|
|
+ myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
|
|
|
+
|
|
|
+ myNoticeInfo = JSON.toJSONString(myNotice);
|
|
|
+ map.put("myNoticeInfo", myNoticeInfo);
|
|
|
+ SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 评估-超期收款发票通知
|
|
|
+ */
|
|
|
+ @XxlJob("exceedFinance")
|
|
|
+ public void exceedFinance(){
|
|
|
+ String exceedFinance = SpringUtil.getBean(AssessFeignApi.class).getExceedFinance();
|
|
|
+ List<FinanceInvoiceList> invoiceList = JSON.parseObject(exceedFinance, new TypeReference<List<FinanceInvoiceList>>() {});
|
|
|
+ for (FinanceInvoiceList invoice : invoiceList) {
|
|
|
+ //对数据进行发送通知
|
|
|
+ String taskName = null;
|
|
|
+ String titleStr = null;
|
|
|
+
|
|
|
+ int interval = Integer.parseInt(this.getInterval(invoice.getBillingDate(), new Date()));
|
|
|
+
|
|
|
+ taskName = "评估发票超期收款";
|
|
|
+ titleStr = "发票编号为"+ invoice.getNo()+"的项目["+invoice.getProgramName()+"],已超期"+interval+"天,请尽快收款";
|
|
|
+
|
|
|
+ Set<String> noticeUserSet = new HashSet<String>();
|
|
|
+
|
|
|
+ //获取人员信息
|
|
|
+ String byIdForXXL = SpringUtil.getBean(IUserApi.class).getByIdForXXL(invoice.getCreateBy().getId());
|
|
|
+ UserDTO createUser = JSON.parseObject(byIdForXXL, new TypeReference<UserDTO>() {});
|
|
|
+
|
|
|
+ if(null != createUser && StringUtils.isNotBlank(createUser.getId())){
|
|
|
+ noticeUserSet.add(createUser.getId());
|
|
|
+ }
|
|
|
+ List<String> noticeUserList = new ArrayList<String>(noticeUserSet);
|
|
|
+ if(noticeUserList.size()>0){
|
|
|
+ MyNoticeList myNotice = new MyNoticeList();
|
|
|
+ myNotice.setCreateById("1");
|
|
|
+ myNotice.setCreateTime(new Date());
|
|
|
+ myNotice.setUpdateById("1");
|
|
|
+ myNotice.setUpdateTime(new Date());
|
|
|
+ myNotice.setDelFlag(0);
|
|
|
+ //根据procInsId获取taskId
|
|
|
+// String currentTask = SpringUtil.getBean(IFlowableApi.class).getTaskIdByprocInstId(info.getProcInsId());
|
|
|
+ myNotice.setTaskId("");
|
|
|
+ myNotice.setDefId(invoice.getId());
|
|
|
+ myNotice.setTitle(titleStr);
|
|
|
+ myNotice.setTaskName(taskName);
|
|
|
+ myNotice.setLink("结束");
|
|
|
+ myNotice.setType("0");
|
|
|
+ myNotice.setCreateUser("管理员");
|
|
|
+ myNotice.setCreateTime(new Date());
|
|
|
+
|
|
|
+ for (String noticeUserId : noticeUserList) {
|
|
|
+ myNotice.setNoticeId(noticeUserId);
|
|
|
+ myNotice.setNoticeName(createUser.getName());
|
|
|
+ //根据taskName和通知人 查询重复数量
|
|
|
+ String myNoticeInfo = JSON.toJSONString(myNotice);
|
|
|
+ Map<String,String> map = new HashMap();
|
|
|
+ map.put("myNoticeInfo", myNoticeInfo);
|
|
|
+ String jsonInfo = SpringUtil.getBean(IFlowableApi.class).getRepetitionCountBymyNoticeTitle(map);
|
|
|
+ MyNoticeList repetitionCountBymyNotice = JSON.parseObject(jsonInfo, new TypeReference<MyNoticeList>() {});
|
|
|
+
|
|
|
+ if(null == repetitionCountBymyNotice){
|
|
|
+ // 生成id
|
|
|
+ String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
+ myNotice.setId(id);
|
|
|
+ myNotice.setRepetitionCount(0);
|
|
|
+
|
|
|
+ myNoticeInfo = JSON.toJSONString(myNotice);
|
|
|
+ map.put("myNoticeInfo", myNoticeInfo);
|
|
|
+ SpringUtil.getBean ( IFlowableApi.class ).insertMyNotice(map);
|
|
|
+ }else{
|
|
|
+ myNotice.setId(repetitionCountBymyNotice.getId());
|
|
|
+ myNotice.setRepetitionCount(repetitionCountBymyNotice.getRepetitionCount()+1);
|
|
|
+
|
|
|
+ myNoticeInfo = JSON.toJSONString(myNotice);
|
|
|
+ map.put("myNoticeInfo", myNoticeInfo);
|
|
|
+ SpringUtil.getBean ( IFlowableApi.class ).updateMyNotice(map);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|