|
@@ -0,0 +1,83 @@
|
|
|
|
+package com.yh.saas.plugin.yiliangyiyun.workflow;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
+import com.winsea.svc.base.base.entity.CommonStaff;
|
|
|
|
+import com.winsea.svc.base.base.service.ICommonStaffService;
|
|
|
|
+import com.winsea.svc.base.base.util.provider.BeanWorkFlowProvider;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.TranPriceApprove;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.TranProcessInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.ITranPriceApproveService;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.ITranProcessInfoService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+import java.text.MessageFormat;
|
|
|
|
+
|
|
|
|
+@Component("yunjiaTranApprove")
|
|
|
|
+public class TranProessProvider implements BeanWorkFlowProvider {
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICommonStaffService staffService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ITranProcessInfoService tranProcessInfoService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ITranPriceApproveService tranPriceApproveService;
|
|
|
|
+
|
|
|
|
+ // 工作通知信息
|
|
|
|
+ static final String MESSAGE_CAR_CONTENT = "{0}发起的汽运单价等待您的审核,单价金额{1}元/车。";
|
|
|
|
+ static final String MESSAGE_KG_CONTENT = "{0}发起的汽运单价等待您的审核,单价金额{1}元/吨。";
|
|
|
|
+ static final String MESSAGE_SHIP_CONTENT = "{0}发起的船运总价等待您的审核,总价金额{1}元。";
|
|
|
|
+ static final String MESSAGE_FIRE_CONTENT = "{0}发起的船运总价等待您的审核,总价金额{1}元。";
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String getDeptId(String businessId) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String getNoticeCopywriting() {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public String getVesselId(String businessId) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取文案(审核中)
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public String getNotificeTask(String businessId) {
|
|
|
|
+ TranProcessInfo info = tranProcessInfoService.selectById(businessId);
|
|
|
|
+ if (info == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ String staffName = "XXX";
|
|
|
|
+ CommonStaff commitUserInfo = staffService.getInfo(info.getUpdateUserId());
|
|
|
|
+ if (commitUserInfo != null) {
|
|
|
|
+ staffName = commitUserInfo.getMajorRole() != null
|
|
|
|
+ ? commitUserInfo.getMajorRole().getRoleName() + " " + commitUserInfo.getStaffName()
|
|
|
|
+ : commitUserInfo.getStaffName();
|
|
|
|
+ }
|
|
|
|
+ //汽运
|
|
|
|
+ if("1".equals(info.getTranTypeKey())){
|
|
|
|
+ //按吨
|
|
|
|
+ if("1".equals(info.getBillingMethod())){
|
|
|
|
+ return MessageFormat.format(MESSAGE_KG_CONTENT, commitUserInfo.getStaffName(),info.getTranPriceIng());
|
|
|
|
+ }
|
|
|
|
+ //按车
|
|
|
|
+ else {
|
|
|
|
+ return MessageFormat.format(MESSAGE_CAR_CONTENT, commitUserInfo.getStaffName(),info.getTranPriceIngCar());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //火运
|
|
|
|
+ else if("2".equals(info.getTranTypeKey())){
|
|
|
|
+ return MessageFormat.format(MESSAGE_FIRE_CONTENT, commitUserInfo.getStaffName(),info.getTranPriceIng());
|
|
|
|
+ }
|
|
|
|
+ //船运
|
|
|
|
+ else{
|
|
|
|
+ return MessageFormat.format(MESSAGE_SHIP_CONTENT, commitUserInfo.getStaffName(),info.getTranPriceIng());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|