|
@@ -3,15 +3,19 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
|
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.yiliangyiyun.constant.StatusEnum;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.CollectionManagementMapper;
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.service.ICollectionManagementService;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.service.ISalePlanInfoService;
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.service.ISalesDeliveryReportService;
|
|
|
-import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -37,6 +41,12 @@ public class CollectionManagementServiceImpl extends ServiceImpl<CollectionManag
|
|
|
private ISalePlanInfoService salePlanInfoService;
|
|
|
@Autowired
|
|
|
private ISalesDeliveryReportService salesDeliveryReportService;
|
|
|
+ @Autowired
|
|
|
+ private INoticeService noticeService;
|
|
|
+ @Autowired
|
|
|
+ private INoticeTaskService noticeTaskService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonStaffService staffService;
|
|
|
/**
|
|
|
* 收款列表查询
|
|
|
* @param collectionManagement
|
|
@@ -110,6 +120,8 @@ public class CollectionManagementServiceImpl extends ServiceImpl<CollectionManag
|
|
|
warehouseInOutInfo.setContractNo(collectionManagement.getContractNo());
|
|
|
warehouseInOutInfo.setGoodsName(collectionManagement.getGoodsName());
|
|
|
warehouseInOutInfoService.insert(warehouseInOutInfo);
|
|
|
+
|
|
|
+ tesk(warehouseInOutInfo,"1");
|
|
|
return "ok";
|
|
|
}
|
|
|
|
|
@@ -157,4 +169,43 @@ public class CollectionManagementServiceImpl extends ServiceImpl<CollectionManag
|
|
|
CollectionManagement collectionManagement = this.selectById(id);
|
|
|
return collectionManagement;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 任务
|
|
|
+ *
|
|
|
+ * @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(AuthSecurityUtils.getCurrentUserId()),
|
|
|
+ null, taskInfo);
|
|
|
+
|
|
|
+ }
|
|
|
}
|