|
@@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
|
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.entity.CommonStaffRole;
|
|
|
import com.winsea.svc.base.base.service.ICommonRoleResourceService;
|
|
|
+import com.winsea.svc.base.base.service.ICommonStaffRoleService;
|
|
|
import com.winsea.svc.base.base.service.ICommonStaffService;
|
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
import com.winsea.svc.base.workflow.entity.Workflow;
|
|
@@ -31,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -70,6 +73,8 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
private IStockSaleReceiptReportService stockSaleReceiptReportService;
|
|
|
@Autowired
|
|
|
private IContractManagementInfoService contractManagementInfoService;
|
|
|
+ @Autowired
|
|
|
+ private ICommonStaffRoleService commonStaffRoleService;
|
|
|
/**
|
|
|
* 汽运调度分页列表查询
|
|
|
*
|
|
@@ -198,6 +203,7 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String insertTranCar(TranProcessInfo tranProcessInfo) {
|
|
|
+ this.updateById(tranProcessInfo);
|
|
|
List<TranCarInfo> tranCarInfoList = tranProcessInfo.getTranCarInfoList();
|
|
|
if (!CollectionUtils.isEmpty(tranCarInfoList)) {
|
|
|
for (TranCarInfo tranCarInfo : tranCarInfoList) {
|
|
@@ -812,6 +818,54 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
return "ok";
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String setUpTranPriceCar(TranProcessInfo tranProcessInfo) {
|
|
|
+ //物流部提交
|
|
|
+ if ("1".equals(tranProcessInfo.getFlag())) {
|
|
|
+ tranProcessInfo.setPriceStatusCar("审核中");
|
|
|
+ List<String> roleIdList = Lists.newArrayList();
|
|
|
+ if("1".equals(tranProcessInfo.getTranTypeKey())){
|
|
|
+ roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
+ Lists.newArrayList("transportationInfo-Execar"));
|
|
|
+ teskCar(tranProcessInfo,roleIdList);
|
|
|
+ }
|
|
|
+ else if("2".equals(tranProcessInfo.getTranTypeKey())){
|
|
|
+ roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
+ Lists.newArrayList("transportationInfo-Triancar"));
|
|
|
+ teskCar(tranProcessInfo,roleIdList);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ roleIdList = roleResourceService.getBindRoleIdsByResourceIds(AuthSecurityUtils.getCurrentUserInfo().getCompId(),
|
|
|
+ Lists.newArrayList("transportationInfo-Shipcar"));
|
|
|
+ teskCar(tranProcessInfo,roleIdList);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //决策人审核
|
|
|
+ else if ("2".equals(tranProcessInfo.getFlag())) {
|
|
|
+ tranProcessInfo.setTranPriceCar(tranProcessInfo.getTranPriceIngCar());
|
|
|
+ tranProcessInfo.setTranPriceIngCar(0.0f);
|
|
|
+ tranProcessInfo.setPriceStatusCar("已通过");
|
|
|
+ //汽运生成审核记录
|
|
|
+ if(tranProcessInfo.getTranTypeKey()!=null&&"1".equals(tranProcessInfo.getTranTypeKey())) {
|
|
|
+ //生成审核记录
|
|
|
+ TranPriceApprove tranPriceApprove = new TranPriceApprove();
|
|
|
+ tranPriceApprove.setProcessId(tranProcessInfo.getId());
|
|
|
+ tranPriceApprove.setId(IdGenerator.generateUUID());
|
|
|
+ tranPriceApprove.setReviewer(tranProcessInfo.getReviewer());
|
|
|
+ tranPriceApprove.setResult("通过");
|
|
|
+ tranPriceApprove.setRecordType("1");
|
|
|
+ tranPriceApprove.setTranPrice(tranProcessInfo.getTranPriceCar());
|
|
|
+ tranPriceApproveService.insert(tranPriceApprove);
|
|
|
+ }
|
|
|
+ // 先删除任务
|
|
|
+ noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "TRAN-TEAM-APPROVE",
|
|
|
+ tranProcessInfo.getId(), null);
|
|
|
+ }
|
|
|
+ this.updateById(tranProcessInfo);
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 任务
|
|
@@ -845,6 +899,35 @@ public class TranProcessInfoServiceImpl extends ServiceImpl<TranProcessInfoMappe
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private void teskCar(TranProcessInfo tranProcessInfo, List<String> roleIdList) {
|
|
|
+ // 先删除任务
|
|
|
+ noticeService.removeNotice(BaseNotice.NoticeStatus.TASK, "TRAN-TEAM-APPROVE",
|
|
|
+ tranProcessInfo.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();
|
|
|
+ }
|
|
|
+ List<CommonStaffRole> commonStaffRoles = commonStaffRoleService.findStaff(roleIdList);
|
|
|
+ List<String> staffIds = commonStaffRoles.stream().map(CommonStaffRole::getStaffId).collect(Collectors.toList());
|
|
|
+ String taskContent = "";
|
|
|
+ // 向下一步操作人发送任务通知
|
|
|
+ taskContent = staffName + "提交的运输单价等待审核";
|
|
|
+ NoticeTaskInfo taskInfo = new NoticeTaskInfo();
|
|
|
+ taskInfo.setCompId(commitUserInfo.getCompId());
|
|
|
+ taskInfo.setAcceptType(BaseNotice.AcceptStatus.STAFF);
|
|
|
+ taskInfo.setBusinessId(tranProcessInfo.getId());
|
|
|
+ taskInfo.setBusinessType("Tran");
|
|
|
+ taskInfo.setMessageContent(taskContent);
|
|
|
+ taskInfo.setBusinessCode("TRAN-TEAM-APPROVE");
|
|
|
+// taskInfo.setNoticeTaskStatus(NoticeTaskInfo.NoticeTaskStatus.RETURN);
|
|
|
+ noticeTaskService.createNoticeTask(staffIds,
|
|
|
+ null, taskInfo);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 他运反馈
|
|
|
* @param tranProcessInfo
|