|
|
@ -158,12 +158,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
|
QueryWrapper<FinBillApplication> qw = new QueryWrapper<>(); |
|
|
|
String isArrears = query.getIsArrears(); |
|
|
|
if ("是".equals(isArrears)){ |
|
|
|
qw.eq("fba.billStateKey","003"); |
|
|
|
}else { |
|
|
|
qw.ne("fba.billStateKey","003"); |
|
|
|
} |
|
|
|
qw.ne("fba.billStateKey", "003"); |
|
|
|
qw.eq("fba.useOrgSid", query.getUseOrgSid()); |
|
|
|
qw.eq("fba.createBySid", query.getCreateBySid()); |
|
|
|
if (StringUtils.isNotBlank(query.getSaleTypeKey())) { |
|
|
@ -217,6 +212,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
List<FinBillFileDto> khkpsqsApplicationAppendxs = dto.getKhkpsqsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> kpxxqrsApplicationAppendxs = dto.getKpxxqrsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> cldjhtApplicationAppendxs = dto.getCldjhtApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> zjApplicationAppendxs = dto.getZjApplicationAppendxs(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) {//新增
|
|
|
|
FinBillApplication finBillApplication = new FinBillApplication(); |
|
|
|
BeanUtil.copyProperties(dto, finBillApplication, "sid"); |
|
|
@ -269,6 +265,16 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.CLDJHT.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
for (FinBillFileDto finBillFileDto : zjApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.ZJ.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
return rb.success().setMsg("保存成功").setData(finBillApplication.getSid()); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(dtoSid); |
|
|
@ -279,7 +285,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
updateByDto(dto); |
|
|
|
finBillFileService.deleteByFinAppSid(dtoSid); |
|
|
|
//附件信息
|
|
|
|
if (khkpsqsApplicationAppendxs != null){ |
|
|
|
if (khkpsqsApplicationAppendxs != null) { |
|
|
|
for (FinBillFileDto finBillFileDto : khkpsqsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -291,7 +297,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (kpxxqrsApplicationAppendxs != null){ |
|
|
|
if (kpxxqrsApplicationAppendxs != null) { |
|
|
|
for (FinBillFileDto finBillFileDto : kpxxqrsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -303,7 +309,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (cldjhtApplicationAppendxs != null){ |
|
|
|
if (cldjhtApplicationAppendxs != null) { |
|
|
|
for (FinBillFileDto finBillFileDto : cldjhtApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -315,6 +321,18 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (zjApplicationAppendxs != null) { |
|
|
|
for (FinBillFileDto finBillFileDto : zjApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.ZJ.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
finBillVehicleService.delByBillAppSid(dtoSid); |
|
|
|
for (FinBillVehicleDto finBillVehicleDto : finBillVehicles) { |
|
|
|
FinBillVehicle finBillVehicle = new FinBillVehicle(); |
|
|
@ -352,31 +370,18 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
FinBillApplication entity = fetchBySid(sid); |
|
|
|
String contractNo = entity.getContractNo(); |
|
|
|
List<FinBillApplicationDetailsVo> finBillApplicationVos = baseMapper.selectByContractNo(contractNo); |
|
|
|
if (finBillApplicationVos != null && finBillApplicationVos.size() > 0){ |
|
|
|
if (finBillApplicationVos != null && finBillApplicationVos.size() > 0) { |
|
|
|
FinBillApplicationDetailsVo finBillApplicationVo = finBillApplicationVos.get(0); |
|
|
|
entity.setOneBillMoney(new BigDecimal(finBillApplicationVo.getOneBillMoney())); |
|
|
|
} |
|
|
|
FinBillApplicationDetailsVo vo = new FinBillApplicationDetailsVo(); |
|
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
|
String sid1 = entity.getContractSid(); |
|
|
|
ResultBean<CommonContractVo> commonContractVoResultBean = commonContractFeign.fetchBySid(sid1); |
|
|
|
CommonContractVo data = commonContractVoResultBean.getData(); |
|
|
|
String busSid = data.getBusSid(); |
|
|
|
ResultBean<BusSalesOrderDetailsVo> busSalesOrderDetailsVoResultBean = busSalesOrderFeign.fetchDetailsBySid(busSid); |
|
|
|
BusSalesOrderDetailsVo data1 = busSalesOrderDetailsVoResultBean.getData(); |
|
|
|
String oneBillMoney = data1.getOneBillMoney(); |
|
|
|
if (StringUtils.isBlank(oneBillMoney)) { |
|
|
|
vo.setOneBillState("0"); |
|
|
|
} else { |
|
|
|
vo.setOneBillMoney(oneBillMoney); |
|
|
|
vo.setOneBillState("1"); |
|
|
|
} |
|
|
|
List<FinBillVehicleVo> finBillVehicleVos = finBillVehicleService.fetchVehBySid(sid); |
|
|
|
vo.setFinBillVehicles(finBillVehicleVos); |
|
|
|
List<FinBillTrailerVo> finBillTrailerVos = finBillTrailerService.fetchByMainSid(sid); |
|
|
|
if (finBillTrailerVos.size() > 0){ |
|
|
|
if (finBillTrailerVos.size() > 0) { |
|
|
|
vo.setFinBillTrailers(finBillTrailerVos); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
for (FinBillVehicleVo finBillVehicleVo : finBillVehicleVos) { |
|
|
|
BaseVehicle baseVehicle = baseVehicleFeign.selectByVinNoAndOrgSid(finBillVehicleVo.getVinNo(), entity.getUseOrgSid()).getData(); |
|
|
|
List<TrailerVo> trailerVos = baseTrailerFeign.trailerList(baseVehicle.getSid()).getData(); |
|
|
@ -421,24 +426,20 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
public void delAllBySids(String[] sids) { |
|
|
|
public ResultBean delAllBySids(String[] sids) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//查询该sid中是否有流程不是待提交的
|
|
|
|
int count = baseMapper.selectBySid(StringUtils.join(sids, ",")); |
|
|
|
if (count > 0) { |
|
|
|
return rb.setMsg("删除的数据中包含已提交或已办结审批的数据,删除失败"); |
|
|
|
} |
|
|
|
delBySids(sids); |
|
|
|
for (String sid : sids) { |
|
|
|
FinBillApplication finBillApplication = fetchBySid(sid); |
|
|
|
String billAppPublicSid = finBillApplication.getBillAppPublicSid(); |
|
|
|
finBillApplicationPublicService.deleteBySid(billAppPublicSid); |
|
|
|
deleteBySid(sid); |
|
|
|
ResultBean<List<CommonAppendixVo>> listResultBean = commonAppendixFeign.selByLinkSid(sid); |
|
|
|
List<CommonAppendixVo> data = listResultBean.getData(); |
|
|
|
String path = ""; |
|
|
|
for (CommonAppendixVo datum : data) { |
|
|
|
String filePath = datum.getFilePath(); |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
path = urlPrefix + filePath; |
|
|
|
commonAppendixFeign.deleteFilesOss(path); |
|
|
|
} |
|
|
|
commonAppendixFeign.deleteFiles(sid); |
|
|
|
finBillVehicleService.delByBillAppSid(sid); |
|
|
|
finBillTrailerService.delByBillAppSid(sid); |
|
|
|
finBillFileService.deleteByFinAppSid(sid); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/*public ResultBean submitFinBillApplication(SubmitFinBillApplicationDto dto) { |
|
|
@ -710,7 +711,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finVehicleInvoiceDto.setUseOrgSid(finBillApplication.getUseOrgSid()); |
|
|
|
finVehicleInvoiceService.mySave(finVehicleInvoiceDto); |
|
|
|
} |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
@ -742,9 +743,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//查询业务信息
|
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
if ("003".equals(finBillApplication.getBillStateKey())){ |
|
|
|
if ("003".equals(finBillApplication.getBillStateKey())) { |
|
|
|
bv.setModelId(ProcDefEnum.QKFINBILLAPPLICATION.getProDefId()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
bv.setModelId(ProcDefEnum.FINBILLAPPLICATION.getProDefId()); |
|
|
|
} |
|
|
|
//判断是否是高低开,若是,则isTrue网关参数为true=============添加
|
|
|
@ -768,9 +769,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//查询业务信息
|
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
if ("003".equals(finBillApplication.getBillStateKey())){ |
|
|
|
if ("003".equals(finBillApplication.getBillStateKey())) { |
|
|
|
bv.setModelId(ProcDefEnum.QKFINBILLAPPLICATION.getProDefId()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
bv.setModelId(ProcDefEnum.FINBILLAPPLICATION.getProDefId()); |
|
|
|
} |
|
|
|
//判断是否是高低开,若是,则isTrue网关参数为true=============添加
|
|
|
@ -811,7 +812,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
String contractNo = finBillApplication.getContractNo(); |
|
|
|
BusSalesOrderPrice data = busSalesOrderFeign.selectByContractNo(contractNo).getData(); |
|
|
|
if (data != null) { |
|
|
|
variables.put("isTrue", data.getSingleFinalPrice().equals(finBillApplication.getOneBillMoney())); |
|
|
|
variables.put("isAdj", !data.getSingleFinalPrice().equals(finBillApplication.getOneBillMoney())); |
|
|
|
} |
|
|
|
flowTaskVo.setValues(variables); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|
|
@ -905,9 +906,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = ""; |
|
|
|
if(StringUtils.isNotBlank(dto.getOrgSidPath())){ |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgSidPath())) { |
|
|
|
orgSidPath = dto.getOrgSidPath(); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getCreateBySid()); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
@ -951,9 +952,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//流程定义id
|
|
|
|
String billStateKey = dto.getBillStateKey(); |
|
|
|
if ("003".equals(billStateKey)){ |
|
|
|
if ("003".equals(billStateKey)) { |
|
|
|
bv.setModelId(ProcDefEnum.QKFINBILLAPPLICATION.getProDefId()); |
|
|
|
}else { |
|
|
|
} else { |
|
|
|
bv.setModelId(ProcDefEnum.FINBILLAPPLICATION.getProDefId()); |
|
|
|
} |
|
|
|
if (r == 1) { |
|
|
@ -1041,10 +1042,10 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
if (StringUtils.isNotBlank(useOrgSid)) { |
|
|
|
qw.eq("fba.useOrgSid", useOrgSid); |
|
|
|
} |
|
|
|
if ("是".equals(pagerQuery.getParams().getIsArrears())){ |
|
|
|
qw.eq("fba.billStateKey","003"); |
|
|
|
}else { |
|
|
|
qw.ne("fba.billStateKey","003"); |
|
|
|
if ("是".equals(pagerQuery.getParams().getIsArrears())) { |
|
|
|
qw.eq("fba.billStateKey", "003"); |
|
|
|
} else { |
|
|
|
qw.ne("fba.billStateKey", "003"); |
|
|
|
} |
|
|
|
String name = pagerQuery.getParams().getName(); |
|
|
|
IPage<AppBillApplicationPageVo> iPage = baseMapper.getInvoicedApplyList(page, qw, name); |
|
|
@ -1248,9 +1249,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = ""; |
|
|
|
if(StringUtils.isNotBlank(dto.getOrgSidPath())){ |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgSidPath())) { |
|
|
|
orgSidPath = dto.getOrgSidPath(); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getUserSid()); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
@ -1335,51 +1336,507 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* public ResultBean submitFinBillApplicationPageList(SubmitFinBillApplicationPageListDto dto) { |
|
|
|
/* public ResultBean submitFinBillApplicationPageList(SubmitFinBillApplicationPageListDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinBillApplicationDetailsVo finBillApplicationDetailsVo = fetchDetailsVoBySid(dto.getSid()); |
|
|
|
String oneBillMoney = finBillApplicationDetailsVo.getOneBillMoney(); |
|
|
|
if (StringUtils.isBlank(oneBillMoney)) { |
|
|
|
rb.setMsg("该申请单信息不完善,请补充完整后提交"); |
|
|
|
} |
|
|
|
List<FinBillVehicleVo> finBillVehicles = finBillApplicationDetailsVo.getFinBillVehicles(); |
|
|
|
for (FinBillVehicleVo finBillVehicle : finBillVehicles) { |
|
|
|
String billTypeValue = finBillVehicle.getBillTypeValue(); |
|
|
|
String billName = finBillVehicle.getBillName(); |
|
|
|
if (StringUtils.isBlank(billTypeValue) || StringUtils.isBlank(billName)) { |
|
|
|
rb.setMsg("该申请单信息不完善,请补充完整后提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
String orgSid = checkUserOrg(dto.getStaffSid()); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("businessSid", dto.getSid()); |
|
|
|
variables.put("orgSid", orgSid); //部门sid
|
|
|
|
if (StringUtils.isBlank(dto.getTaskId())) { // 新提交
|
|
|
|
String proDefId = ProcDefEnum.SEALAPPLY.getProDefId(); |
|
|
|
ResultBean resultBean1 = null; |
|
|
|
return resultBean1; |
|
|
|
} else { // 驳回到发起人后再次提交
|
|
|
|
variables.put("comment", StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
variables.put("instanceId", dto.getInstanceId()); |
|
|
|
variables.put("taskId", dto.getTaskId()); |
|
|
|
variables.put("userSid", dto.getUserSid()); |
|
|
|
return complete(variables); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
public String getApplyCode(String useOrgSid) { |
|
|
|
ResultBean<SysOrganizationVo> resultBean1 = sysOrganizationFeign.fetchBySid(useOrgSid); |
|
|
|
String orgCode = resultBean1.getData().getOrgCode(); |
|
|
|
BillNo b = new BillNo(); |
|
|
|
b.setOrgCode(orgCode); |
|
|
|
b.setBillType(BillTypeEnum.KPSQ.getBillType()); |
|
|
|
String bill = Rule.getBill(b); |
|
|
|
String i = baseMapper.selectNum(bill); |
|
|
|
String billNo = ""; |
|
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
|
billNo = Rule.getBillNo(bill, Integer.valueOf(i).intValue()); |
|
|
|
} else { |
|
|
|
billNo = Rule.getBillNo(bill, 0); |
|
|
|
} |
|
|
|
return billNo; |
|
|
|
} |
|
|
|
|
|
|
|
public String getApplyCodeQK(String useOrgSid) { |
|
|
|
ResultBean<SysOrganizationVo> resultBean1 = sysOrganizationFeign.fetchBySid(useOrgSid); |
|
|
|
String orgCode = resultBean1.getData().getOrgCode(); |
|
|
|
BillNo b = new BillNo(); |
|
|
|
b.setOrgCode(orgCode); |
|
|
|
b.setBillType(BillTypeEnum.QKKP.getBillType()); |
|
|
|
String bill = Rule.getBill(b); |
|
|
|
String i = baseMapper.selectNum(bill); |
|
|
|
String billNo = ""; |
|
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
|
billNo = Rule.getBillNo(bill, Integer.valueOf(i).intValue()); |
|
|
|
} else { |
|
|
|
billNo = Rule.getBillNo(bill, 0); |
|
|
|
} |
|
|
|
return billNo; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean saveOrUpdateDtoQK(FinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinBillApplicationDetailsVo finBillApplicationDetailsVo = fetchDetailsVoBySid(dto.getSid()); |
|
|
|
String oneBillMoney = finBillApplicationDetailsVo.getOneBillMoney(); |
|
|
|
if (StringUtils.isBlank(oneBillMoney)) { |
|
|
|
rb.setMsg("该申请单信息不完善,请补充完整后提交"); |
|
|
|
} |
|
|
|
List<FinBillVehicleVo> finBillVehicles = finBillApplicationDetailsVo.getFinBillVehicles(); |
|
|
|
for (FinBillVehicleVo finBillVehicle : finBillVehicles) { |
|
|
|
String billTypeValue = finBillVehicle.getBillTypeValue(); |
|
|
|
String billName = finBillVehicle.getBillName(); |
|
|
|
if (StringUtils.isBlank(billTypeValue) || StringUtils.isBlank(billName)) { |
|
|
|
rb.setMsg("该申请单信息不完善,请补充完整后提交"); |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
List<FinBillTrailerDto> finBillTrailers = dto.getFinBillTrailers(); |
|
|
|
List<FinBillVehicleDto> finBillVehicles = dto.getFinBillVehicles(); |
|
|
|
List<FinBillFileDto> khkpsqsApplicationAppendxs = dto.getKhkpsqsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> kpxxqrsApplicationAppendxs = dto.getKpxxqrsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> cldjhtApplicationAppendxs = dto.getCldjhtApplicationAppendxs(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) {//新增
|
|
|
|
FinBillApplication finBillApplication = new FinBillApplication(); |
|
|
|
BeanUtil.copyProperties(dto, finBillApplication, "sid"); |
|
|
|
finBillApplication.setNodeState("待提交"); |
|
|
|
String billNo = getApplyCodeQK(dto.getUseOrgSid()); |
|
|
|
finBillApplication.setBillNo(billNo); |
|
|
|
finBillApplication.setBillStateKey("003"); |
|
|
|
finBillApplication.setBillStateValue("欠款开票"); |
|
|
|
finBillApplication.setNum(finBillVehicles.size()); |
|
|
|
save(finBillApplication); |
|
|
|
//主车开票信息
|
|
|
|
for (FinBillVehicleDto finBillVehicleDto : finBillVehicles) { |
|
|
|
FinBillVehicle finBillVehicle = new FinBillVehicle(); |
|
|
|
BeanUtil.copyProperties(finBillVehicleDto, finBillVehicle, "sid"); |
|
|
|
finBillVehicle.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillVehicleService.save(finBillVehicle); |
|
|
|
} |
|
|
|
//挂车开票信息
|
|
|
|
for (FinBillTrailerDto finBillTrailerDto : finBillTrailers) { |
|
|
|
FinBillTrailer finBillTrailer = new FinBillTrailer(); |
|
|
|
BeanUtil.copyProperties(finBillTrailerDto, finBillTrailer, "sid"); |
|
|
|
finBillTrailer.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillTrailerService.save(finBillTrailer); |
|
|
|
} |
|
|
|
//附件信息
|
|
|
|
for (FinBillFileDto finBillFileDto : khkpsqsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KHKPSQS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
for (FinBillFileDto finBillFileDto : kpxxqrsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KPXXQRS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
for (FinBillFileDto finBillFileDto : cldjhtApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.CLDJHT.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
return rb.success().setMsg("保存成功").setData(finBillApplication.getSid()); |
|
|
|
} |
|
|
|
String orgSid = checkUserOrg(dto.getStaffSid()); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(dtoSid); |
|
|
|
if (finBillApplication == null) { |
|
|
|
rb.setMsg("该数据不存在"); |
|
|
|
} |
|
|
|
dto.setArrearsMoney("0"); |
|
|
|
updateByDto(dto); |
|
|
|
finBillFileService.deleteByFinAppSid(dtoSid); |
|
|
|
//附件信息
|
|
|
|
if (khkpsqsApplicationAppendxs != null) { |
|
|
|
for (FinBillFileDto finBillFileDto : khkpsqsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KHKPSQS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (kpxxqrsApplicationAppendxs != null) { |
|
|
|
for (FinBillFileDto finBillFileDto : kpxxqrsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KPXXQRS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (cldjhtApplicationAppendxs != null) { |
|
|
|
for (FinBillFileDto finBillFileDto : cldjhtApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.CLDJHT.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
finBillVehicleService.delByBillAppSid(dtoSid); |
|
|
|
for (FinBillVehicleDto finBillVehicleDto : finBillVehicles) { |
|
|
|
FinBillVehicle finBillVehicle = new FinBillVehicle(); |
|
|
|
BeanUtil.copyProperties(finBillVehicleDto, finBillVehicle, "sid"); |
|
|
|
finBillVehicle.setBillAppSid(dtoSid); |
|
|
|
finBillVehicleService.save(finBillVehicle); |
|
|
|
} |
|
|
|
finBillTrailerService.delByBillAppSid(dtoSid); |
|
|
|
for (FinBillTrailerDto finBillTrailerDto : finBillTrailers) { |
|
|
|
FinBillTrailer finBillTrailer = new FinBillTrailer(); |
|
|
|
BeanUtil.copyProperties(finBillTrailerDto, finBillTrailer, "sid"); |
|
|
|
finBillTrailer.setBillAppSid(dtoSid); |
|
|
|
finBillTrailerService.save(finBillTrailer); |
|
|
|
} |
|
|
|
return rb.success().setMsg("修改成功").setData(dtoSid); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean submitFinBillApplicationQK(SubmitFinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgSidPath())) { |
|
|
|
orgSidPath = dto.getOrgSidPath(); |
|
|
|
} else { |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getCreateBySid()); |
|
|
|
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()); |
|
|
|
} |
|
|
|
orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
|
|
|
} |
|
|
|
dto.setOrgSidPath(orgSidPath); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(dto.getSid()); |
|
|
|
int r = submitBusinessDataPc(dto, finBillApplication); |
|
|
|
if (r == 3) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = saveOrUpdateDto(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
String businessSid = resultBean.getData(); |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("businessSid", dto.getSid()); |
|
|
|
variables.put("orgSid", orgSid); //部门sid
|
|
|
|
if (StringUtils.isBlank(dto.getTaskId())) { // 新提交
|
|
|
|
String proDefId = ProcDefEnum.SEALAPPLY.getProDefId(); |
|
|
|
ResultBean resultBean1 = null; |
|
|
|
return resultBean1; |
|
|
|
} else { // 驳回到发起人后再次提交
|
|
|
|
variables.put("comment", StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
variables.put("instanceId", dto.getInstanceId()); |
|
|
|
variables.put("taskId", dto.getTaskId()); |
|
|
|
variables.put("userSid", dto.getUserSid()); |
|
|
|
return complete(variables); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("businessSid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
//用户sid
|
|
|
|
bv.setUserSid(dto.getCreateBySid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.QKFINBILLAPPLICATION.getProDefId()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|
|
|
if (!voResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(voResultBean.getMsg()); |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("欠款开票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
public String getApplyCode(String useOrgSid) { |
|
|
|
ResultBean<SysOrganizationVo> resultBean1 = sysOrganizationFeign.fetchBySid(useOrgSid); |
|
|
|
String orgCode = resultBean1.getData().getOrgCode(); |
|
|
|
BillNo b = new BillNo(); |
|
|
|
b.setOrgCode(orgCode); |
|
|
|
b.setBillType(BillTypeEnum.KPSQ.getBillType()); |
|
|
|
String bill = Rule.getBill(b); |
|
|
|
String i = baseMapper.selectNum(bill); |
|
|
|
String billNo = ""; |
|
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
|
billNo = Rule.getBillNo(bill, Integer.valueOf(i).intValue()); |
|
|
|
} else { |
|
|
|
billNo = Rule.getBillNo(bill, 0); |
|
|
|
} |
|
|
|
return billNo; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
|
if (StringUtils.isBlank(dto.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
bv.setTaskId(finBillApplication.getTaskId()); |
|
|
|
bv.setTaskDefKey(finBillApplication.getNodeSid()); |
|
|
|
bv.setComment("重新提交"); |
|
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
|
return complete(bv); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean completeQK(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String businessSid = bv.getBusinessSid(); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(businessSid); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
bv.setOrgSidPath(finBillApplication.getOrgSidPath()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
if (bv.getTaskId().equals(finBillApplication.getTaskId())) { |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
ufVo.setProcDefId(finBillApplication.getProcDefId()); |
|
|
|
ufVo.setProcInsId(finBillApplication.getProcInstSid()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("欠款开票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<FinBillNodeVo>> getPreviousNodesForRejectQK(FinBillNodeQuery query) { |
|
|
|
ResultBean<List<FinBillNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//查询业务信息
|
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
bv.setModelId(ProcDefEnum.QKFINBILLAPPLICATION.getProDefId()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<FinBillNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinBillNodeVo.class)).collect(Collectors.toList()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<FinBillNodeVo>> getNextNodesForSubmitQK(FinBillNodeQuery query) { |
|
|
|
ResultBean<List<FinBillNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//查询业务信息
|
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
bv.setModelId(ProcDefEnum.QKFINBILLAPPLICATION.getProDefId()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<FinBillNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinBillNodeVo.class)).collect(Collectors.toList()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean rejectQK(FinBillTaskQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String businessSid = query.getBusinessSid(); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(businessSid); |
|
|
|
if (finBillApplication == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
String businessTaskId = finBillApplication.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
if (StringUtils.isBlank(query.getComment())) { |
|
|
|
return rb.setMsg("请填写意见"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
flowTaskVo.setValues(variables); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(ufVo); |
|
|
|
//更新业务中的流程相关的参数
|
|
|
|
updateFlowFiled(map); |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
String procId = finBillApplication.getProcInstSid(); |
|
|
|
ufVo.setProcInsId(procId); |
|
|
|
ufVo.setProcDefId(finBillApplication.getProcDefId()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("欠款开票"); |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(procId); |
|
|
|
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); |
|
|
|
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); |
|
|
|
if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(finBillApplication.getCreateBySid())) { |
|
|
|
messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); |
|
|
|
} else { |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
} |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean revokeProcessQK(FinBillTaskQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = finBillApplication.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.revokeProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败,提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean breakProcessQK(FinBillTaskQuery query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getComment())) { |
|
|
|
return rb.setMsg("请填写意见"); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = finBillApplication.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<FinBillApplicationVo> listPageQK(PagerQuery<FinBillApplicationQuery> pq) { |
|
|
|
FinBillApplicationQuery query = pq.getParams(); |
|
|
|
QueryWrapper<FinBillApplication> qw = new QueryWrapper<>(); |
|
|
|
qw.eq("fba.billStateKey", "003"); |
|
|
|
qw.eq("fba.useOrgSid", query.getUseOrgSid()); |
|
|
|
qw.eq("fba.createBySid", query.getCreateBySid()); |
|
|
|
if (StringUtils.isNotBlank(query.getSaleTypeKey())) { |
|
|
|
qw.eq("fba.saleTypeKey", query.getSaleTypeKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getContractNo())) { |
|
|
|
qw.like("fba.contractNo", query.getContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getOpenTickUnitName())) { |
|
|
|
qw.like("fba.openTickUnitName", query.getOpenTickUnitName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
|
|
|
qw.like("fba.customerName", query.getCustomerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getModelName())) { |
|
|
|
qw.like("fba.modelName", query.getModelName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBillStateKey())) { |
|
|
|
qw.eq("fba.billStateKey", query.getBillStateKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
|
|
qw.eq("fba.createByName", query.getCreateByName()); |
|
|
|
} |
|
|
|
String returnedMoneyStartDate = query.getReturnedMoneyStartDate(); |
|
|
|
String returnedMoneyEndDate = query.getReturnedMoneyEndDate(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(returnedMoneyStartDate), "date_format (fba.returnedMoneyDate,'%Y-%m-%d') >= date_format('" + returnedMoneyStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(returnedMoneyEndDate), "date_format (fba.returnedMoneyDate,'%Y-%m-%d') <= date_format('" + returnedMoneyEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
IPage<FinBillApplication> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<FinBillApplicationVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<FinBillApplicationVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
} |