|
|
@ -180,7 +180,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
BaseOutsourcingApplication entity = new BaseOutsourcingApplication(); |
|
|
|
List<BaseOutsourcingApplicationVehicleDto> baseOutsourcingApplicationVehicleDtos = dto.getBaseOutsourcingApplicationVehicleDtos(); |
|
|
|
CommonAppendix contract = dto.getContract(); |
|
|
|
CommonAppendix contract = dto.getContract(); |
|
|
|
String sid1 = entity.getSid(); |
|
|
|
String sid = dto.getSid(); |
|
|
|
if (StringUtils.isBlank(sid)) {//新增
|
|
|
@ -220,10 +220,10 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
baseOutsourcingApplicationVehicle.setOutAppSid(sid1); |
|
|
|
baseOutsourcingApplicationVehicleService.save(baseOutsourcingApplicationVehicle); |
|
|
|
} |
|
|
|
if(contract!=null&& com.yxt.common.base.utils.StringUtils.isNotBlank(contract.getFilePath())){ |
|
|
|
if (contract != null && com.yxt.common.base.utils.StringUtils.isNotBlank(contract.getFilePath())) { |
|
|
|
contract.setLinkSid(entity.getSid()); |
|
|
|
contract.setFileType( contract.getFileName().substring( |
|
|
|
contract.getFileName().lastIndexOf("."),contract.getFileName().length())); |
|
|
|
contract.setFileType(contract.getFileName().substring( |
|
|
|
contract.getFileName().lastIndexOf("."), contract.getFileName().length())); |
|
|
|
contract.setName(dto.getCreateByName()); |
|
|
|
contract.setAttachType(CommonAttachTypeEnum.OUTSOURCINGAPPLY.getAttachType()); |
|
|
|
commonAppendixService.save(contract); |
|
|
@ -238,6 +238,15 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
baseOutsourcingApplicationVehicle.setOutAppSid(sid); |
|
|
|
baseOutsourcingApplicationVehicleService.save(baseOutsourcingApplicationVehicle); |
|
|
|
} |
|
|
|
commonAppendixService.deleteFiles(sid); |
|
|
|
if (contract != null && com.yxt.common.base.utils.StringUtils.isNotBlank(contract.getFilePath())) { |
|
|
|
contract.setLinkSid(sid); |
|
|
|
contract.setFileType(contract.getFileName().substring( |
|
|
|
contract.getFileName().lastIndexOf("."), contract.getFileName().length())); |
|
|
|
contract.setName(dto.getCreateByName()); |
|
|
|
contract.setAttachType(CommonAttachTypeEnum.OUTSOURCINGAPPLY.getAttachType()); |
|
|
|
commonAppendixService.save(contract); |
|
|
|
} |
|
|
|
return rb.success().setMsg("修改成功").setData(sid); |
|
|
|
} |
|
|
|
|
|
|
@ -258,8 +267,8 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
List<BaseOutsourcingApplicationVehicleVo> baseOutsourcingApplicationVehicleVos = baseOutsourcingApplicationVehicleService.fetchByOutAppSid(sid); |
|
|
|
baseOutsourcingApplicationDetailsVo.setBaseOutsourcingApplicationVehicleVos(baseOutsourcingApplicationVehicleVos); |
|
|
|
|
|
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixService.selByLinkSid( sid); |
|
|
|
if(commonAppendixVos!=null&&commonAppendixVos.size()>0){ |
|
|
|
List<CommonAppendixVo> commonAppendixVos = commonAppendixService.selByLinkSid(sid); |
|
|
|
if (commonAppendixVos != null && commonAppendixVos.size() > 0) { |
|
|
|
baseOutsourcingApplicationDetailsVo.setContract(commonAppendixVos.get(0)); |
|
|
|
} |
|
|
|
|
|
|
@ -355,7 +364,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
bv.setUserSid(dto.getUserSid()); |
|
|
|
// variables.put("businessSid", businessSid);
|
|
|
|
// variables.put("businessSid", businessSid);
|
|
|
|
bv.setFormVariables(variables); |
|
|
|
bv.setModelId(ProcDefEnum.BASEOUTSOURCINGAPPLICATION.getProDefId()); |
|
|
|
//如果taskid从业务的数据库中查询出来,那这个taskid 和当前的关系是什么 如果数据库中查询出来的taskid是第四个环节的id,但是目前是做的第一次的提交操作。
|
|
|
@ -367,12 +376,12 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(uff)); |
|
|
|
return resultBean1; |
|
|
|
} |
|
|
|
ResultBean rb = submitBusinessData(dto, busSid,orgSidPath); |
|
|
|
ResultBean rb = submitBusinessData(dto, busSid, orgSidPath); |
|
|
|
return rb; |
|
|
|
} |
|
|
|
|
|
|
|
private synchronized ResultBean submitBusinessData(SubmitBaseOutSourcingApplicationDto dto, |
|
|
|
String businessSid,String orgSidPath) { |
|
|
|
String businessSid, String orgSidPath) { |
|
|
|
Map<String, Object> variables = BeanUtil.beanToMap(dto); |
|
|
|
BaseOutsourcingApplicationDto booad = baseMapper.getBySid(businessSid); |
|
|
|
String businessTaskid = booad.getTaskId(); |
|
|
@ -381,12 +390,12 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
bv.setUserSid(dto.getUserSid()); |
|
|
|
// variables.put("businessSid", businessSid);
|
|
|
|
// variables.put("businessSid", businessSid);
|
|
|
|
bv.setFormVariables(variables); |
|
|
|
bv.setModelId(ProcDefEnum.BASEOUTSOURCINGAPPLICATION.getProDefId()); |
|
|
|
if (StringUtils.isBlank(businessTaskid) && StringUtils.isBlank(dto.getTaskId())) { |
|
|
|
// 新提交 taskid都是空的
|
|
|
|
saveOrUpdateDto(dto);//update
|
|
|
|
saveOrUpdateDto(dto);//update
|
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean1 = flowableFeign.startProcess(bv); |
|
|
|
UpdateFlowFieldVo uff = resultBean1.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(uff)); |
|
|
@ -399,10 +408,11 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(rb.getData()); |
|
|
|
updateFlowFiled(stringObjectMap); |
|
|
|
return rb; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return ResultBean.fireFail().setMsg("操作失败,提交的数据不一致!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 检查用户是否设置部门 |
|
|
|
* |
|
|
@ -434,13 +444,13 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
updateFlowFiled(stringObjectMap); |
|
|
|
if ("Event_end".equals(taskDefKey)) { |
|
|
|
BigDecimal deposit = booad.getDeposit(); |
|
|
|
if(deposit!=null){ |
|
|
|
if(deposit.doubleValue()>0){ |
|
|
|
if (deposit != null) { |
|
|
|
if (deposit.doubleValue() > 0) { |
|
|
|
// 推送 传达款的数据
|
|
|
|
sendFinPaymentrecord(bv, booad); |
|
|
|
} |
|
|
|
} |
|
|
|
for (int i=0;i<booad.getNum();i++) { |
|
|
|
for (int i = 0; i < booad.getNum(); i++) { |
|
|
|
//验车业务模块的数据推送
|
|
|
|
ResultBean<String> resultBean1 = sendScmVehicleExamine(booad); |
|
|
|
if (!resultBean1.getSuccess()) { |
|
|
@ -461,6 +471,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
|
|
|
|
/** |
|
|
|
* 验车单业务模块的数据推送 |
|
|
|
* |
|
|
|
* @param resultBean1 |
|
|
|
* @return |
|
|
|
*/ |
|
|
@ -473,6 +484,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
|
|
|
|
/** |
|
|
|
* 验车业务模块的数据推送 |
|
|
|
* |
|
|
|
* @param booad |
|
|
|
* @return |
|
|
|
*/ |
|
|
@ -497,6 +509,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
|
|
|
|
/** |
|
|
|
* 推送 传达款的数据 |
|
|
|
* |
|
|
|
* @param bv |
|
|
|
* @param booad |
|
|
|
*/ |
|
|
@ -509,10 +522,10 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
finPaymentrecordDto.setPayType(1); |
|
|
|
finPaymentrecordDto.setCreateOrgSid(booad.getUseOrgSid()); |
|
|
|
finPaymentrecordDto.setUseOrgSid(booad.getUseOrgSid()); |
|
|
|
//款项名称,数据字典 车款
|
|
|
|
finPaymentrecordDto.setCostTitleKey("1"); |
|
|
|
//款项名称,数据字典
|
|
|
|
finPaymentrecordDto.setCostTitleValue("车款"); |
|
|
|
finPaymentrecordDto.setCostTitleKey("2"); |
|
|
|
//款项名称,数据字典
|
|
|
|
finPaymentrecordDto.setCostTitleValue("订金"); |
|
|
|
//款项类别 外采
|
|
|
|
finPaymentrecordDto.setCostTypeValue(ManPurOrderType.ManOrderType.WC_ORDER.getRemarks()); |
|
|
|
//款项类别
|
|
|
@ -521,8 +534,8 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
finPaymentrecordDto.setReceiveCompany(booad.getPurchasingUnitName()); |
|
|
|
//收款银行账号
|
|
|
|
finPaymentrecordDto.setReceiveBankAccount(booad.getBankAccount()); |
|
|
|
|
|
|
|
finPaymentrecordDto.setCost(booad.getTotalExpenseAmount().intValue()); |
|
|
|
//金额
|
|
|
|
finPaymentrecordDto.setCost(booad.getDeposit().intValue()); |
|
|
|
//业务编号
|
|
|
|
finPaymentrecordDto.setBusSid(""); |
|
|
|
finPaymentrecordFeign.save(finPaymentrecordDto); |
|
|
@ -544,7 +557,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
* @param flowTaskVo |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean revokeProcess( FlowTaskVo flowTaskVo) { |
|
|
|
public ResultBean revokeProcess(FlowTaskVo flowTaskVo) { |
|
|
|
BaseOutsourcingApplicationDto booad = baseMapper.getBySid(flowTaskVo.getBusinessSid()); |
|
|
|
String businessTaskid = booad.getTaskId(); |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
@ -553,13 +566,13 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
fl.setBusinessSid(flowTaskVo.getBusinessSid()); |
|
|
|
fl.setUserSid(flowTaskVo.getUserSid()); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.revokeProcess(fl); |
|
|
|
if(!resultBean.getSuccess()){ |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return ResultBean.fireFail().setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(stringObjectMap); |
|
|
|
return resultBean; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return ResultBean.fireFail().setMsg("操作失败,提交的数据不一致!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -586,7 +599,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
stringObjectMap.put("nodeState", data.getNodeState()); |
|
|
|
updateFlowFiled(stringObjectMap); |
|
|
|
return resultBean; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return ResultBean.fireFail().setMsg("操作失败,提交的数据不一致!"); |
|
|
|
} |
|
|
|
} |
|
|
@ -597,7 +610,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
* @param flowTaskVo |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean breakProcess( FlowTaskVo flowTaskVo) { |
|
|
|
public ResultBean breakProcess(FlowTaskVo flowTaskVo) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
BaseOutsourcingApplicationDto booad = baseMapper.getBySid(flowTaskVo.getBusinessSid()); |
|
|
|
String businessTaskid = booad.getTaskId(); |
|
|
@ -607,7 +620,7 @@ public class BaseOutsourcingApplicationService extends MybatisBaseService<BaseOu |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(fl); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
return resultBean; |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
return ResultBean.fireFail().setMsg("操作失败,提交的数据不一致!"); |
|
|
|
} |
|
|
|
} |
|
|
|