|
@@ -0,0 +1,87 @@
|
|
|
|
+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.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.WarehousingOrder;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.IGeneralAuditInfoService;
|
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.service.IWarehousingOrderService;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
+
|
|
|
|
+import java.text.MessageFormat;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+@Component("warehousingOrderApprove")
|
|
|
|
+public class WarehousingOrderProvider implements BeanWorkFlowProvider {
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ICommonStaffService staffService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private IWarehousingOrderService warehousingOrderService;
|
|
|
|
+ // 工作通知信息
|
|
|
|
+ static final String MESSAGE_CONTENT = "{0}发起的入库单请款等待您的审核,{1}{2}入库单请款,重量{3}吨,金额{4}元";
|
|
|
|
+ public static final String RETURN_MESSAGE = "您发起的【{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) {
|
|
|
|
+ List<WarehousingOrder> list = warehousingOrderService.selectList(new EntityWrapper<WarehousingOrder>().eq("batch_id",businessId));
|
|
|
|
+ Double requestFunds = 0d;
|
|
|
|
+ Double inWarehouseWeight = 0d;
|
|
|
|
+ for(int i=0;i<list.size();i++){
|
|
|
|
+ requestFunds =requestFunds + list.get(i).getRequestFunds();
|
|
|
|
+ inWarehouseWeight =inWarehouseWeight + list.get(i).getInWarehouseWeight();
|
|
|
|
+ }
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
|
|
|
|
+ String staffName = "XXX";
|
|
|
|
+ CommonStaff commitUserInfo = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
|
|
|
|
+ if (commitUserInfo != null) {
|
|
|
|
+ staffName = commitUserInfo.getMajorRole() != null
|
|
|
|
+ ? commitUserInfo.getMajorRole().getRoleName() + " " + commitUserInfo.getStaffName()
|
|
|
|
+ : commitUserInfo.getStaffName();
|
|
|
|
+ }
|
|
|
|
+ return MessageFormat.format(MESSAGE_CONTENT, commitUserInfo.getStaffName(), list.get(0).getWarehouseName(),sdf.format(list.get(0).getIssuingTime()),inWarehouseWeight,requestFunds);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取文案(退回)
|
|
|
|
+ */
|
|
|
|
+// @Override
|
|
|
|
+// public String getNotificeReturn(String businessId) {
|
|
|
|
+// GeneralAuditInfo info = generalAuditInfoService.selectById(businessId);
|
|
|
|
+// String staffName = "XXX";
|
|
|
|
+// CommonStaff staff = staffService.getInfo(AuthSecurityUtils.getCurrentUserId());
|
|
|
|
+// if (staff != null) {
|
|
|
|
+// staffName = staff.getMajorRole() != null
|
|
|
|
+// ? staff.getMajorRole().getRoleName() + " " + staff.getStaffName()
|
|
|
|
+// : staff.getStaffName();
|
|
|
|
+// }
|
|
|
|
+// return MessageFormat.format(RETURN_MESSAGE, info.getBusinessType(), staffName);
|
|
|
|
+// }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+}
|