|
@@ -1,6 +1,14 @@
|
|
|
package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
+import com.google.common.collect.Lists;
|
|
|
+import com.winsea.svc.base.base.entity.CommonStaff;
|
|
|
+import com.winsea.svc.base.base.service.ICommonStaffService;
|
|
|
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
+import com.winsea.svc.notice.entity.NoticeTaskInfo;
|
|
|
+import com.winsea.svc.notice.entity.base.BaseNotice;
|
|
|
+import com.winsea.svc.notice.service.INoticeService;
|
|
|
+import com.winsea.svc.notice.service.INoticeTaskService;
|
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
|
import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
|
|
@@ -46,7 +54,12 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
|
|
|
private ISalesDeliveryReportService salesDeliveryReportService;
|
|
|
@Autowired
|
|
|
private GeTuiUtils geTuiUtils;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private INoticeService noticeService;
|
|
|
+ @Autowired
|
|
|
+ private INoticeTaskService noticeTaskService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonStaffService staffService;
|
|
|
/**
|
|
|
* 添加发车信息
|
|
|
*
|
|
@@ -96,6 +109,7 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
|
|
|
List<CommonUser> tmp = commonUserService.selectList(new EntityWrapper<CommonUser>().eq("phone", warehouseBaseInfo.getPersonPhone()));
|
|
|
if (tmp.size() > 0) {
|
|
|
geTuiUtils.pushByCid("入库任务", "您有新的入库任务待完成,车牌号:" + warehouseInOutInfo.getCarNo(), tmp.get(0).getId());
|
|
|
+ tesk(warehouseInOutInfo, "2");
|
|
|
}
|
|
|
}
|
|
|
boolean two = warehouseInOutInfoService.insert(warehouseInOutInfo);
|
|
@@ -188,4 +202,42 @@ public class TranCarInfoServiceImpl extends ServiceImpl<TranCarInfoMapper, TranC
|
|
|
this.deleteById(tranCarInfo.getId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 任务
|
|
|
+ *
|
|
|
+ * @param warehouseInOutInfo
|
|
|
+ */
|
|
|
+ private void tesk(WarehouseInOutInfo warehouseInOutInfo, String flag) {
|
|
|
+ // 先删除任务
|
|
|
+ noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "INOUTTASK-TASK-APPROVE",
|
|
|
+ warehouseInOutInfo.getId(), null);
|
|
|
+ String staffName = "XXX";
|
|
|
+ CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
|
|
|
+ if (commitUserInfo != null) {
|
|
|
+ staffName = commitUserInfo.getMajorRole() != null
|
|
|
+ ? commitUserInfo.getMajorRole().getRoleName() + " " + commitUserInfo.getStaffName()
|
|
|
+ : commitUserInfo.getStaffName();
|
|
|
+ }
|
|
|
+ String taskContent = "";
|
|
|
+ // 向下一步操作人发送任务通知
|
|
|
+ if ("1".equals(flag)) {
|
|
|
+ taskContent = "您的合同(" + warehouseInOutInfo.getContractNo() + ")车辆:" + warehouseInOutInfo.getCarNo() + "已发出";
|
|
|
+ } else {
|
|
|
+ taskContent = "您的合同(" + warehouseInOutInfo.getContractNo() + ")车辆:" + warehouseInOutInfo.getCarNo() + "申请卸货,请及时确认";
|
|
|
+
|
|
|
+ }
|
|
|
+ NoticeTaskInfo taskInfo = new NoticeTaskInfo();
|
|
|
+ taskInfo.setCompId(commitUserInfo.getCompId());
|
|
|
+ taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
|
|
|
+ taskInfo.setBusinessId(warehouseInOutInfo.getId());
|
|
|
+ taskInfo.setBusinessType("WAREHOUSE");
|
|
|
+ taskInfo.setMessageContent(taskContent);
|
|
|
+ taskInfo.setBusinessCode("INOUTTASK-TASK-APPROVE");
|
|
|
+// taskInfo.setNoticeTaskStatus(NoticeTaskInfo.NoticeTaskStatus.RETURN);
|
|
|
+ noticeTaskService.createNoticeTask(Lists.newArrayList(warehouseInOutInfo.getCommonId()),
|
|
|
+ null, taskInfo);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|