Browse Source

Merge remote-tracking branch 'origin/master'

zhanglei
dimengzhe 3 weeks ago
parent
commit
f29c6951dc
  1. 15
      anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyRest.java
  2. 4
      yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryAllocatebillRest.java
  3. 181
      yxt-wms-biz/src/main/java/com/yxt/wms/biz/inventory/wmsinventoryallocatebill/WmsInventoryAllocateBillService.java

15
anrui-riskcenter/anrui-riskcenter-biz/src/main/java/com/yxt/anrui/riskcenter/biz/loancaseexecuteapply/LoanCaseExecuteApplyRest.java

@ -46,21 +46,8 @@ import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApplyDet
import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApplyDto; import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApplyDto;
import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApplyFeign; import com.yxt.anrui.riskcenter.api.loancaseexecuteapply.LoanCaseExecuteApplyFeign;
/**
* Project: anrui-riskcenter(案件执行立案申请) <br/>
* File: LoanCaseExecuteApplyFeignFallback.java <br/>
* Class: com.yxt.anrui.riskcenter.biz.loancaseexecuteapply.LoanCaseExecuteApplyRest <br/>
* Description: 案件执行立案申请. <br/>
* Copyright: Copyright (c) 2011 <br/>
* Company: https://gitee.com/liuzp315 <br/>
* Makedate: 2024-02-07 10:00:57 <br/>
*
* @author liupopo
* @version 1.0
* @since 1.0
*/
@Api(tags = "案件执行立案申请") @Api(tags = "案件执行立案申请")
@RestController("com.yxt.anrui.riskcenter.biz.loancaseexecuteapply.LoanCaseExecuteApplyRest") @RestController
@RequestMapping("v1/loancaseexecuteapply") @RequestMapping("v1/loancaseexecuteapply")
public class LoanCaseExecuteApplyRest implements LoanCaseExecuteApplyFeign { public class LoanCaseExecuteApplyRest implements LoanCaseExecuteApplyFeign {

4
yxt-wms-biz/src/main/java/com/yxt/wms/apiadmin/inventroy/WmsInventoryAllocatebillRest.java

@ -60,9 +60,7 @@ public class WmsInventoryAllocatebillRest {
@ApiOperation("新增或修改") @ApiOperation("新增或修改")
@PostMapping("/save") @PostMapping("/save")
public ResultBean save(@RequestBody WmsInventoryAllocateBillDtoNew dto) { public ResultBean save(@RequestBody WmsInventoryAllocateBillDtoNew dto) {
ResultBean rb = ResultBean.fireFail(); return wmsInventoryAllocateBillService.saveOrUpdateDto(dto);
wmsInventoryAllocateBillService.saveOrUpdateDto(dto);
return rb.success();
} }
@ApiOperation("根据sid批量删除") @ApiOperation("根据sid批量删除")

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

@ -41,6 +41,8 @@ import org.apache.tomcat.util.threads.ThreadPoolExecutor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -171,7 +173,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
} }
public String saveOrUpdateDto(WmsInventoryAllocateBillDtoNew dto) { public ResultBean<String> saveOrUpdateDto(WmsInventoryAllocateBillDtoNew dto) {
ResultBean rb = ResultBean.fireFail();
String dtoSid = dto.getSid(); String dtoSid = dto.getSid();
List<WmsInventoryAllocateBillDetailDtoNew> wmsInventoryAllocateBillDetailNewList = dto.getWmsInventoryAllocateBillDetailNewList(); List<WmsInventoryAllocateBillDetailDtoNew> wmsInventoryAllocateBillDetailNewList = dto.getWmsInventoryAllocateBillDetailNewList();
if (StringUtils.isBlank(dtoSid)) { if (StringUtils.isBlank(dtoSid)) {
@ -190,10 +193,19 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
dto.setCreateOrgName(sysOrganizationVo.getName()); dto.setCreateOrgName(sysOrganizationVo.getName());
String sid = this.insertByDto(dto); String sid = this.insertByDto(dto);
for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) { for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) {
if (wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().compareTo(new BigDecimal(BigInteger.ZERO)) == 0) {
deleteBySid(sid);
return rb.setMsg("所选商品成本价不能为0");
}
wmsInventoryAllocateBillDetailDtoNew.setBillSid(sid); wmsInventoryAllocateBillDetailDtoNew.setBillSid(sid);
wmsInventoryAllocateBillDetailService.insertByDto(wmsInventoryAllocateBillDetailDtoNew); wmsInventoryAllocateBillDetailService.insertByDto(wmsInventoryAllocateBillDetailDtoNew);
} }
return sid; return rb.success().setData(sid);
}
for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) {
if (wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().compareTo(new BigDecimal(BigInteger.ZERO)) == 0) {
return rb.setMsg("所选商品成本价不能为0");
}
} }
this.updateByDto(dto); this.updateByDto(dto);
wmsInventoryAllocateBillDetailService.delByMainSid(dtoSid); wmsInventoryAllocateBillDetailService.delByMainSid(dtoSid);
@ -201,7 +213,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
wmsInventoryAllocateBillDetailDtoNew.setBillSid(dtoSid); wmsInventoryAllocateBillDetailDtoNew.setBillSid(dtoSid);
wmsInventoryAllocateBillDetailService.insertByDto(wmsInventoryAllocateBillDetailDtoNew); wmsInventoryAllocateBillDetailService.insertByDto(wmsInventoryAllocateBillDetailDtoNew);
} }
return dtoSid; return rb.success().setData(dtoSid);
} }
public String insertByDto(WmsInventoryAllocateBillDtoNew dto) { public String insertByDto(WmsInventoryAllocateBillDtoNew dto) {
@ -231,7 +243,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
if (r == 0) { if (r == 0) {
return rb.setMsg("操作失败!提交的数据不一致"); return rb.setMsg("操作失败!提交的数据不一致");
} }
String businessSid = saveOrUpdateDto(dto); String businessSid = saveOrUpdateDto(dto).getData();
wmsInventoryAllocateBill = fetchBySid(businessSid); wmsInventoryAllocateBill = fetchBySid(businessSid);
//创建BusinessVariables实体对象 //创建BusinessVariables实体对象
BusinessVariables bv = new BusinessVariables(); BusinessVariables bv = new BusinessVariables();
@ -378,7 +390,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
//获取下一环节审批角色 //获取下一环节审批角色
List<String> candidateGroups = voList.get(0).getCandidateGroups(); List<String> candidateGroups = voList.get(0).getCandidateGroups();
UserRoleQuery userRoleQuery = new UserRoleQuery(); UserRoleQuery userRoleQuery = new UserRoleQuery();
if (candidateGroups != null && candidateGroups.size() > 0){ if (candidateGroups != null && candidateGroups.size() > 0) {
userRoleQuery.setRoleSid(candidateGroups.get(0)); userRoleQuery.setRoleSid(candidateGroups.get(0));
if (bv.getTaskDefKey().equals("Activity_0eb1lqn")) {//调出方配件主管审批 if (bv.getTaskDefKey().equals("Activity_0eb1lqn")) {//调出方配件主管审批
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid()); userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
@ -633,7 +645,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
if (r == 0) { if (r == 0) {
return rb.setMsg("操作失败!提交的数据不一致"); return rb.setMsg("操作失败!提交的数据不一致");
} }
String businessSid = saveOrUpdateDto(dto); String businessSid = saveOrUpdateDto(dto).getData();
wmsInventoryAllocateBill = fetchBySid(businessSid); wmsInventoryAllocateBill = fetchBySid(businessSid);
//创建BusinessVariables实体对象 //创建BusinessVariables实体对象
BusinessVariables bv = new BusinessVariables(); BusinessVariables bv = new BusinessVariables();
@ -659,7 +671,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
List<WmsInventoryAllocateBillDetailDtoNew> wmsInventoryAllocateBillDetailNewList = dto.getWmsInventoryAllocateBillDetailNewList(); List<WmsInventoryAllocateBillDetailDtoNew> wmsInventoryAllocateBillDetailNewList = dto.getWmsInventoryAllocateBillDetailNewList();
for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) { for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) {
flowNodeQuery.setNodeNames("调出方站长审批"); flowNodeQuery.setNodeNames("调出方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f0) { if (f0) {
break; break;
@ -667,7 +680,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) { for (WmsInventoryAllocateBillDetailDtoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocateBillDetailNewList) {
flowNodeQuery.setNodeNames("调入方站长审批"); flowNodeQuery.setNodeNames("调入方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f1) { if (f1) {
break; break;
@ -676,15 +690,10 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
variables.put("iscdy", f0); variables.put("iscdy", f0);
variables.put("isrdy", f1); variables.put("isrdy", f1);
UserRoleQuery userRoleQuery = new UserRoleQuery(); UserRoleQuery userRoleQuery = new UserRoleQuery();
userRoleQuery.setRoleSid("bdacdca7-7a62-49b1-84c6-e32a4ffab777");
if (list.contains("bdacdca7-7a62-49b1-84c6-e32a4ffab777")) { if (list.contains("bdacdca7-7a62-49b1-84c6-e32a4ffab777")) {
ResultBean<List<Map<String, Object>>> resultBean1 = flowTaskFeign.getNextNodesForSubmit(bv); userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将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.setRoleSid(candidateGroups.get(0));
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getOutPlatSid());
} else { } else {
userRoleQuery.setRoleSid("bdacdca7-7a62-49b1-84c6-e32a4ffab777");
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getOutPlatSid()); userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getOutPlatSid());
} }
List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData(); List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData();
@ -696,7 +705,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
} }
if (StringUtils.isBlank(nextNodeUserSids)) { if (StringUtils.isBlank(nextNodeUserSids)) {
bv.setNextNodeUserSids(""); return rb.setMsg("下一环节暂无审批人员,请联系管理员");
} else { } else {
String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(",")); String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(","));
bv.setNextNodeUserSids(substring); bv.setNextNodeUserSids(substring);
@ -781,7 +790,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(businessSid); List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(businessSid);
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调出方站长审批"); flowNodeQuery.setNodeNames("调出方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f0) { if (f0) {
break; break;
@ -789,7 +799,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调入方站长审批"); flowNodeQuery.setNodeNames("调入方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f1) { if (f1) {
break; break;
@ -807,14 +818,44 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
bv.setOrgSidPath(sysOrganization.getOrgSidPath()); bv.setOrgSidPath(sysOrganization.getOrgSidPath());
} }
bv.setModelId(wmsInventoryAllocateBill.getProcDefId()); bv.setModelId(wmsInventoryAllocateBill.getProcDefId());
if (bv.getTaskDefKey().equals("Activity_1jchfap")) {//调出方站长审批 //特殊处理
ResultBean<List<Map<String, Object>>> resultBean1 = flowTaskFeign.getNextNodesForSubmit(bv); //获取调出方组织信息
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo SysOrganizationVo dcOrg = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getOutPlatSid()).getData();
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(); SysOrganizationVo drOrg = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getInPlatSid()).getData();
UserRoleQuery userRoleQuery = new UserRoleQuery(); //流程预演
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)); userRoleQuery.setRoleSid(candidateGroups.get(0));
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getOutPlatSid()); if (bv.getTaskDefKey().equals("Activity_1kuhabd") || bv.getTaskDefKey().equals("Activity_0nhcymu")) {//调出方站长审批
if (!f0) {
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
bv.setOrgSidPath(drOrg.getOrgSidPath());
} else {
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getOutPlatSid());
bv.setOrgSidPath(dcOrg.getOrgSidPath());
}
} else if (bv.getTaskDefKey().equals("Activity_0ax87n7")) {//调出方分公司总(副总)经理审批
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getOutPlatSid());
bv.setOrgSidPath(dcOrg.getOrgSidPath());
} else if (bv.getTaskDefKey().equals("Activity_1ri7ft5")) {//调出方省(分)公司总经理审批
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
bv.setOrgSidPath(drOrg.getOrgSidPath());
} else if (bv.getTaskDefKey().equals("Activity_0p4jq17")) {//调入方配件主管审批
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
bv.setOrgSidPath(drOrg.getOrgSidPath());
} else if (bv.getTaskDefKey().equals("Activity_0cuo7gz")) {//调入方站长审批
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
bv.setOrgSidPath(drOrg.getOrgSidPath());
} else if (bv.getTaskDefKey().equals("Activity_0x5oo96")) {//调入方分公司总(副总)经理审批
userRoleQuery.setOrgSid(wmsInventoryAllocateBill.getInPlatSid());
bv.setOrgSidPath(drOrg.getOrgSidPath());
}
List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData(); List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData();
StringBuilder nextNodeUserSids = new StringBuilder(); StringBuilder nextNodeUserSids = new StringBuilder();
if (sysUserVos.size() > 0) { if (sysUserVos.size() > 0) {
@ -824,7 +865,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
} }
if (StringUtils.isBlank(nextNodeUserSids)) { if (StringUtils.isBlank(nextNodeUserSids)) {
bv.setNextNodeUserSids(""); return rb.setMsg("下一环节暂无审批人员,请联系管理员");
} else { } else {
String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(",")); String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(","));
bv.setNextNodeUserSids(substring); bv.setNextNodeUserSids(substring);
@ -885,7 +926,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(query.getBusinessSid()); List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(query.getBusinessSid());
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调出方站长审批"); flowNodeQuery.setNodeNames("调出方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f0) { if (f0) {
break; break;
@ -893,7 +935,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调入方站长审批"); flowNodeQuery.setNodeNames("调入方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f1) { if (f1) {
break; break;
@ -932,7 +975,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(query.getBusinessSid()); List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(query.getBusinessSid());
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调出方站长审批"); flowNodeQuery.setNodeNames("调出方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f0) { if (f0) {
break; break;
@ -940,7 +984,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调入方站长审批"); flowNodeQuery.setNodeNames("调入方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f1) { if (f1) {
break; break;
@ -994,7 +1039,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(query.getBusinessSid()); List<WmsInventoryAllocatebillDetailDetailsVoNew> wmsInventoryAllocatebillDetailDetailsVoNews = wmsInventoryAllocateBillDetailService.selByMainSid(query.getBusinessSid());
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调出方站长审批"); flowNodeQuery.setNodeNames("调出方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f0 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f0) { if (f0) {
break; break;
@ -1002,7 +1048,8 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) { for (WmsInventoryAllocatebillDetailDetailsVoNew wmsInventoryAllocateBillDetailDtoNew : wmsInventoryAllocatebillDetailDetailsVoNews) {
flowNodeQuery.setNodeNames("调入方站长审批"); flowNodeQuery.setNodeNames("调入方站长审批");
flowNodeQuery.setValue(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice().toString()); BigDecimal zk = wmsInventoryAllocateBillDetailDtoNew.getRequAmount().divide(wmsInventoryAllocateBillDetailDtoNew.getTaxPrice()).multiply(new BigDecimal("10"));
flowNodeQuery.setValue(zk.toString());
f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery); f1 = sysFlowPowerFeign.flowPermissions(flowNodeQuery);
if (f1) { if (f1) {
break; break;
@ -1060,7 +1107,7 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
if (r == 0) { if (r == 0) {
return rb.setMsg("操作失败!提交的数据不一致"); return rb.setMsg("操作失败!提交的数据不一致");
} }
String businessSid = saveOrUpdateDto(dto); String businessSid = saveOrUpdateDto(dto).getData();
wmsInventoryAllocateBill = fetchBySid(businessSid); wmsInventoryAllocateBill = fetchBySid(businessSid);
//创建BusinessVariables实体对象 //创建BusinessVariables实体对象
BusinessVariables bv = new BusinessVariables(); BusinessVariables bv = new BusinessVariables();
@ -1093,6 +1140,27 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
} }
variables.put("iscc", f0); 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 //用户的部门全路径sid
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getDeptSid()).getData(); SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(wmsInventoryAllocateBill.getDeptSid()).getData();
if (sysOrganization != null) { if (sysOrganization != null) {
@ -1161,10 +1229,13 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
String createBySid = wmsInventoryAllocateBill.getCreateBySid(); String createBySid = wmsInventoryAllocateBill.getCreateBySid();
List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData(); List<String> list = sysUserRoleFeign.getUserRoleSidByUserSid(createBySid).getData();
variables.put("iszg", list.contains("bdacdca7-7a62-49b1-84c6-e32a4ffab777")); 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(); SysFlowNodeQuery flowNodeQuery = new SysFlowNodeQuery();
flowNodeQuery.setType(0); flowNodeQuery.setType(1);
flowNodeQuery.setFlowName("调拨申请(自有、合作二级站间调拨)"); flowNodeQuery.setFlowName("调拨申请(自有、合作二级站间调拨)");
flowNodeQuery.setCreateOrgName(wmsInventoryAllocateBill.getCreateOrgName()); flowNodeQuery.setCreateOrgName(wmsInventoryAllocateBill.getCreateOrgName());
flowNodeQuery.setProcDefId("process_hw0a2ybh"); flowNodeQuery.setProcDefId("process_hw0a2ybh");
@ -1180,6 +1251,46 @@ public class WmsInventoryAllocateBillService extends MybatisBaseService<WmsInven
} }
} }
variables.put("iscc", f0); 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<>(); Map<String, Object> appMap = new HashMap<>();
appMap.put("sid", businessSid); appMap.put("sid", businessSid);
appMap.put("type", "3"); appMap.put("type", "3");

Loading…
Cancel
Save