|
|
@ -34,7 +34,6 @@ import com.yxt.anrui.base.api.basevehmodelconfig.BaseVehmodelConfigFeign; |
|
|
|
import com.yxt.anrui.base.api.basevehmodelconfig.BaseVehmodelVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeposit.AppBusDepositBusDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeposit.BusDeposit; |
|
|
|
import com.yxt.anrui.buscenter.api.busdeposit.SubmitVirtualOrderDepositDto; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositcustomer.AppBusDepositCustomerListDto; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositcustomer.BusDepositCustomer; |
|
|
|
import com.yxt.anrui.buscenter.api.busdepositcustomer.BusDepositCustomerVo; |
|
|
@ -710,6 +709,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busMainDeposit.setStaffSid(data.getStaffSid()); |
|
|
|
busMainDeposit.setStaffName(data.getStaffName()); |
|
|
|
busMainDeposit.setOrgSid(data.getOrgSid()); |
|
|
|
busMainDeposit.setCreateBySid(dto.getUserSid()); |
|
|
|
busMainDeposit.setOrgName(sysOrganizationVo.getName() + "-" + data.getOrgName()); |
|
|
|
busMainDeposit.setDepositBillType("订金收取"); |
|
|
|
busMainDeposit.setDepositBillTypeKey("01"); |
|
|
@ -743,7 +743,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busDepositService.updateById(busDeposit); |
|
|
|
busDepositCustomerService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return new ResultBean().success().setMsg("修改成功"); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("修改成功"); |
|
|
|
} else if (nodeState.equals("待提交") && nodeState.equals("已驳回")) { |
|
|
|
BusDeposit busDeposit = busDepositService.selectByBillSid(dto.getVirtualOrderSid()); |
|
|
|
//付款凭证
|
|
|
@ -754,7 +754,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busDepositService.updateById(busDeposit); |
|
|
|
busDepositCustomerService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
appSetBusDepositCustomer(dto, busDeposit.getBillSid()); |
|
|
|
return new ResultBean().success().setMsg("修改成功"); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("修改成功"); |
|
|
|
} |
|
|
|
return new ResultBean().fail().setMsg("已提交办理审批中不可修改!"); |
|
|
|
} |
|
|
@ -1131,6 +1131,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busMainDeposit.setSid(UUID.randomUUID().toString()); |
|
|
|
Map<String, String> map = generateBillNo(dto.getUserSid()); |
|
|
|
busMainDeposit.setBillNo(map.get("billNo_Num")); |
|
|
|
busMainDeposit.setCreateBySid(dto.getUserSid()); |
|
|
|
busMainDeposit.setStaffSid(appUserOrgInfoVo.getStaffSid()); |
|
|
|
busMainDeposit.setStaffName(appUserOrgInfoVo.getStaffName()); |
|
|
|
busMainDeposit.setOrgSid(appUserOrgInfoVo.getOrgSid()); |
|
|
@ -1159,7 +1160,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
baseMapper.updateById(busMainDeposit); |
|
|
|
busDepositVehicleService.delByBillSid(dto.getVirtualOrderSid()); |
|
|
|
appSetBusDepositVehicle(dto, busMainDeposit); |
|
|
|
return new ResultBean().success().setMsg("修改成功"); |
|
|
|
return new ResultBean().success().setData(busMainDeposit.getSid()).setMsg("修改成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -1181,6 +1182,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
busDepositVehicle.setModelConfigSid(carListDto.getConfigSid()); |
|
|
|
busDepositVehicle.setModelSid(carListDto.getModelSid()); |
|
|
|
busDepositVehicle.setVehicleSid(carListDto.getCarSid()); |
|
|
|
busDepositVehicle.setCreateBySid(dto.getUserSid()); |
|
|
|
busDepositVehicleService.insert(busDepositVehicle); |
|
|
|
} |
|
|
|
} |
|
|
@ -1670,12 +1672,12 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 提交接口 |
|
|
|
* 订金提交接口 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submitVirtualOrder(SubmitVirtualOrderDto dto) { |
|
|
|
public ResultBean submitVirtualDepositOrder(SubmitVirtualOrderDepositDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
|
|
@ -1689,99 +1691,156 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
} |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
|
|
|
BusMainDeposit busMainDeposit = fetchBySid(dto.getSid()); |
|
|
|
int r = submitBusinessData(dto, busMainDeposit); |
|
|
|
BusMainDeposit busMainDeposit = fetchBySid(dto.getVirtualOrderSid()); |
|
|
|
int r = submitBusinessDepositData(dto, busMainDeposit); |
|
|
|
if (r == 3) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
String businessSid = ""; |
|
|
|
if ("1".equals(dto.getType())) {//订金
|
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = saveDepositInfo(dto.getAppBusDepositBuscenterDto()); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
businessSid = resultBean.getData(); |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
//用户sid
|
|
|
|
bv.setUserSid(dto.getUserSid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//若app移动端有此功能,则传递appMap参数
|
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
//需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。
|
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
return voResultBean; |
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = saveDepositInfo(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
String businessSid = resultBean.getData(); |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
//用户sid
|
|
|
|
bv.setUserSid(dto.getUserSid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//若app移动端有此功能,则传递appMap参数
|
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
//需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。
|
|
|
|
appMap.put("virtualOrderSid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.ORDERDEPOSITAPPROVE.getProDefId()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
|
// ToDo:驳回到发起人后再次提交
|
|
|
|
if (com.yxt.common.base.utils.StringUtils.isBlank(dto.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
|
// ToDo:驳回到发起人后再次提交
|
|
|
|
if (com.yxt.common.base.utils.StringUtils.isBlank(dto.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
bv.setTaskId(busMainDeposit.getTaskId()); |
|
|
|
bv.setTaskDefKey(busMainDeposit.getTaskDefKey()); |
|
|
|
bv.setComment(com.yxt.common.base.utils.StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
|
return complete(bv); |
|
|
|
} |
|
|
|
return rb; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 判断提交的流程是否被允许 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private synchronized int submitBusinessDepositData(SubmitVirtualOrderDepositDto dto, BusMainDeposit busMainDeposit) { |
|
|
|
int r = 0; |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isBlank(dto.getSid())) { |
|
|
|
r = 1; |
|
|
|
} else { |
|
|
|
if (busMainDeposit != null) { |
|
|
|
String businessTaskId = busMainDeposit.getTaskId(); |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isBlank(businessTaskId) && com.yxt.common.base.utils.StringUtils.isBlank(dto.getTaskId())) { |
|
|
|
//新提交
|
|
|
|
r = 1; |
|
|
|
} else if (com.yxt.common.base.utils.StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { |
|
|
|
//二次提交//只有数据一致的时候才能进行下一步
|
|
|
|
r = 2; |
|
|
|
} |
|
|
|
bv.setTaskId(busMainDeposit.getTaskId()); |
|
|
|
bv.setTaskDefKey(busMainDeposit.getNodeId()); |
|
|
|
bv.setComment(com.yxt.common.base.utils.StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
|
return complete(bv); |
|
|
|
} |
|
|
|
} else if (dto.getType().equals("2")) {//订车
|
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = reserveCarInfo(dto.getAppBusDepositVehicleDto()); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
businessSid = resultBean.getData(); |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
//用户sid
|
|
|
|
bv.setUserSid(dto.getUserSid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//若app移动端有此功能,则传递appMap参数
|
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
//需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。
|
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.ORDERDEPOSITVEHICLEAPPROVE.getProDefId()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
return voResultBean; |
|
|
|
} else { |
|
|
|
r = 3; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
|
// ToDo:驳回到发起人后再次提交
|
|
|
|
if (com.yxt.common.base.utils.StringUtils.isBlank(dto.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
bv.setTaskId(busMainDeposit.getTaskId()); |
|
|
|
bv.setTaskDefKey(busMainDeposit.getNodeId()); |
|
|
|
bv.setComment(com.yxt.common.base.utils.StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
|
return complete(bv); |
|
|
|
|
|
|
|
} |
|
|
|
return r; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 订车提交接口 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submitVirtualVehicleOrder(SubmitVirtualOrderVehicleDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(userVoResultBean.getMsg()); |
|
|
|
} |
|
|
|
//根据staffSid获取用户的组织全路径
|
|
|
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
|
|
|
if (!staffOrgResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
|
|
|
} |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
|
|
|
BusMainDeposit busMainDeposit = fetchBySid(dto.getVirtualOrderSid()); |
|
|
|
int r = submitBusinessVehicleData(dto, busMainDeposit); |
|
|
|
if (r == 3) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = reserveCarInfo(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
String businessSid = resultBean.getData(); |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
//用户sid
|
|
|
|
bv.setUserSid(dto.getUserSid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//若app移动端有此功能,则传递appMap参数
|
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
//需和移动端沟通业务sid保存的属性具体值:appMap中sid不是固定的。移动端提供具体字段。
|
|
|
|
appMap.put("virtualOrderSid", businessSid); |
|
|
|
appMap.put("customerSid", dto.getCustomerSid()); |
|
|
|
variables.put("app", appMap); |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.ORDERDEPOSITVEHICLEAPPROVE.getProDefId()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
|
// ToDo:驳回到发起人后再次提交
|
|
|
|
if (StringUtils.isBlank(dto.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
bv.setTaskId(busMainDeposit.getTaskId()); |
|
|
|
bv.setTaskDefKey(busMainDeposit.getTaskDefKey()); |
|
|
|
bv.setComment(com.yxt.common.base.utils.StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
|
return complete(bv); |
|
|
|
} |
|
|
|
return rb; |
|
|
|
} |
|
|
@ -1789,6 +1848,9 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
public ResultBean complete(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
BusMainDeposit busMainDeposit = fetchBySid(bv.getBusinessSid()); |
|
|
|
String userSid = bv.getUserSid(); |
|
|
|
SysOrganizationVo data = sysOrganizationFeign.getUseOrgByUserSid(userSid).getData(); |
|
|
|
bv.setOrgSidPath(data.getOrgSidPath()); |
|
|
|
if (bv.getTaskId().equals(busMainDeposit.getTaskId())) { |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
@ -1807,17 +1869,17 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private synchronized int submitBusinessData(SubmitVirtualOrderDto dto, BusMainDeposit busMainDeposit) { |
|
|
|
private synchronized int submitBusinessVehicleData(SubmitVirtualOrderVehicleDto dto, BusMainDeposit busMainDeposit) { |
|
|
|
int r = 0; |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isBlank(dto.getSid())) { |
|
|
|
if (StringUtils.isBlank(dto.getVirtualOrderSid())) { |
|
|
|
r = 1; |
|
|
|
} else { |
|
|
|
if (busMainDeposit != null) { |
|
|
|
String businessTaskId = busMainDeposit.getTaskId(); |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isBlank(businessTaskId) && com.yxt.common.base.utils.StringUtils.isBlank(dto.getTaskId())) { |
|
|
|
if (StringUtils.isBlank(businessTaskId) && StringUtils.isBlank(dto.getTaskId())) { |
|
|
|
//新提交
|
|
|
|
r = 1; |
|
|
|
} else if (com.yxt.common.base.utils.StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { |
|
|
|
} else if (StringUtils.isNotBlank(businessTaskId) && businessTaskId.equals(dto.getTaskId())) { |
|
|
|
//二次提交//只有数据一致的时候才能进行下一步
|
|
|
|
r = 2; |
|
|
|
} |
|
|
@ -1829,6 +1891,7 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
return r; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean<List<AppGetNodeVo>> getPreviousNodesForReject(AppGetNodeQuery query) { |
|
|
|
ResultBean<List<AppGetNodeVo>> rb = new ResultBean<>(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
@ -1891,7 +1954,6 @@ public class BusMainDepositService extends MybatisBaseService<BusMainDepositMapp |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
//根据业务sid查询移库申请
|
|
|
|
BusMainDeposit busMainDeposit = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = busMainDeposit.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|