Browse Source

修改

zhanglei
ligaode 2 weeks ago
parent
commit
a8bfb4998e
  1. 68
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryallocatebill/WmsInventoryAllocateBillService.java

68
yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryallocatebill/WmsInventoryAllocateBillService.java

@ -1140,6 +1140,27 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
}
}
variables.put("iscc", f0);
UserRoleQuery userRoleQuery = new UserRoleQuery();
userRoleQuery.setRoleSid("bdacdca7-7a62-49b1-84c6-e32a4ffab777");
if (list.contains("bdacdca7-7a62-49b1-84c6-e32a4ffab777")) {
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
} else {
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getOutPlatSid());
}
List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData();
StringBuilder nextNodeUserSids = new StringBuilder();
if (sysUserVos.size() > 0) {
for (SysUserVo sysUserVo : sysUserVos) {
String sid = sysUserVo.getSid();
nextNodeUserSids.append(sid).append(",");
}
}
if (StringUtils.isBlank(nextNodeUserSids)) {
return rb.setMsg("下一环节暂无审批人员,请联系管理员");
} else {
String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(","));
bv.setNextNodeUserSids(substring);
}
//用户的部门全路径sid
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getDeptSid()).getData();
if (sysOrganization != null) {
@ -1208,10 +1229,13 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
String createBySid = wmsInventoryAllocateBill.getCreateBySid();
List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData();
variables.put("iszg", list.contains("bdacdca7-7a62-49b1-84c6-e32a4ffab777"));
variables.put("ishz", true);
//是否合作二级站
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getInPlatSid()).getData();
Boolean f1 = "合作二级服务站".equals(sysOrganizationVo.getOrgAttributeValue());
variables.put("ishz", f1);
//超出二级配件库存累计金额
SysFlowNodeQuery flowNodeQuery = new SysFlowNodeQuery();
flowNodeQuery.setType(0);
flowNodeQuery.setType(1);
flowNodeQuery.setFlowName("调拨申请(自有、合作二级站间调拨)");
flowNodeQuery.setCreateOrgName(wmsInventoryAllocateBill.getCreateOrgName());
flowNodeQuery.setProcDefId("process_hw0a2ybh");
@ -1227,6 +1251,46 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
}
}
variables.put("iscc", f0);
//特殊处理
//获取调出方组织信息
SysOrganizationVo dcOrg = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getOutPlatSid()).getData();
//获取调入方组织信息
SysOrganizationVo drOrg = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getInPlatSid()).getData();
//流程预演
ResultBean<List<Map<String, Object>>> resultBean1 = flowTaskFeign.getNextNodesForSubmit(bv);
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
List<GetNodeVo> voList = Optional.ofNullable(resultBean1.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList());
//获取下一环节审批角色
List<String> candidateGroups = voList.get(0).getCandidateGroups();
UserRoleQuery userRoleQuery = new UserRoleQuery();
if (candidateGroups != null && candidateGroups.size() > 0) {
userRoleQuery.setRoleSid(candidateGroups.get(0));
if (bv.getTaskDefKey().equals("Activity_0isr3wq")) {//一级配件主管审批
if (f1){
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
bv.setOrgSidPath(drOrg.getOrgSidPath());
}
}else if (bv.getTaskDefKey().equals("Activity_1557g51")){//合作二级站站长审批
if (f0){
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
bv.setOrgSidPath(drOrg.getOrgSidPath());
}
}
List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData();
StringBuilder nextNodeUserSids = new StringBuilder();
if (sysUserVos.size() > 0) {
for (SysUserVo sysUserVo : sysUserVos) {
String sid = sysUserVo.getSid();
nextNodeUserSids.append(sid).append(",");
}
}
if (StringUtils.isBlank(nextNodeUserSids)) {
return rb.setMsg("下一环节暂无审批人员,请联系管理员");
} else {
String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(","));
bv.setNextNodeUserSids(substring);
}
}
Map<String, Object> appMap = new HashMap<>();
appMap.put("sid", businessSid);
appMap.put("type", "3");

Loading…
Cancel
Save