|
@@ -22,13 +22,20 @@ import com.fjhx.form.service.cost.CostControlService;
|
|
|
import com.fjhx.wms.entity.stock.po.StockJournalDetails;
|
|
|
import com.fjhx.wms.service.stock.StockJournalDetailsService;
|
|
|
import com.ruoyi.common.core.domain.BasePo;
|
|
|
+import com.ruoyi.common.core.domain.entity.SysDept;
|
|
|
+import com.ruoyi.common.exception.ServiceException;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
+import com.ruoyi.system.service.ISysDeptService;
|
|
|
+import com.ruoyi.system.utils.UserUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* 费控流程
|
|
@@ -51,6 +58,8 @@ public class CostControlFlow extends FlowDelegate {
|
|
|
private AccountPaymentService accountPaymentService;
|
|
|
@Autowired
|
|
|
private AccountRunningWaterService accountRunningWaterService;
|
|
|
+ @Autowired
|
|
|
+ private ISysDeptService sysDeptService;
|
|
|
|
|
|
@Override
|
|
|
public String getFlowKey() {
|
|
@@ -188,4 +197,28 @@ public class CostControlFlow extends FlowDelegate {
|
|
|
//执行原本的方法
|
|
|
super.defaultMethod(flowId, businessId, handleNodeType, flowStatus, submitData);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Long> getHandlingUserList(Long flowId, JSONObject submitData) {
|
|
|
+ CostControlDto costControlDto = submitData.toJavaObject(CostControlDto.class);
|
|
|
+
|
|
|
+ List<SysDept> list = sysDeptService.list();
|
|
|
+ Map<Long, String> deptMap = list.stream().collect(Collectors.toMap(SysDept::getDeptId, SysDept::getDeptName));
|
|
|
+
|
|
|
+ List<Long> uidList = new ArrayList<>();
|
|
|
+
|
|
|
+
|
|
|
+ for (String companyIdStr : costControlDto.getCompanyId().split(",")) {
|
|
|
+ Long companyId = Long.valueOf(companyIdStr);
|
|
|
+ String companyName = deptMap.getOrDefault(companyId, companyIdStr);
|
|
|
+
|
|
|
+ List<Long> gmUserList = UserUtil.getUserIdsByRoleKey("GM", companyId);
|
|
|
+ if (ObjectUtil.isEmpty(gmUserList)) {
|
|
|
+ throw new ServiceException(companyName + ",不存在 总经理角色 用户!");
|
|
|
+ }
|
|
|
+ uidList.add(gmUserList.get(0));
|
|
|
+ }
|
|
|
+
|
|
|
+ return uidList;
|
|
|
+ }
|
|
|
}
|