| | |
| | | @Value("${dept.smjzt}") |
| | | private String smjzt; |
| | | |
| | | @Value("${dept.smjhw}") |
| | | private String smjhw; |
| | | |
| | | @Value("${dept.sgb}") |
| | | private String sgb; |
| | | |
| | |
| | | addDTO.getSubjectMatterList().stream().forEach(outSubjectMatterAddDTO -> { |
| | | OutBound outBound = BeanUtil.copyProperties(outSubjectMatterAddDTO, OutBound.class); |
| | | if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { |
| | | outBound.setBatchNumber(generateSMJContractCKNo()); |
| | | } |
| | | if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { |
| | |
| | | return r; |
| | | } |
| | | Contract contract = r.getData(); |
| | | String batchNumber = genBatchNumber(); |
| | | //出库 |
| | | handleOutBound(contract, addDTO); |
| | | handleOutBound(batchNumber,contract, addDTO); |
| | | |
| | | //保存资金明细 |
| | | BigDecimal outBoundAmount = savePaymentConfirm(contract, addDTO); |
| | |
| | | contract.setOutBoundAmout(outBoundAmount); |
| | | updateContractSchedule(contract); |
| | | |
| | | return R.ok(); |
| | | return R.ok(batchNumber); |
| | | } |
| | | |
| | | private void updateContractSchedule(Contract contract) { |
| | |
| | | return outAmount; |
| | | } |
| | | |
| | | private void handleOutBound(Contract contract, OutBoundAddDTO addDTO) { |
| | | private void handleOutBound(String batchNumber,Contract contract, OutBoundAddDTO addDTO) { |
| | | addDTO.getSubjectMatterList().stream().forEach(outSubjectMatterAddDTO -> { |
| | | ContractSubjectMatter subjectMatter = contractSubjectMatterMapper.selectOne(Wrappers.<ContractSubjectMatter>lambdaQuery() |
| | | .eq(ContractSubjectMatter::getContractId, contract.getId()) |
| | |
| | | subjectMatter.setActualDeliveryDate(addDTO.getOutBoundTime()); |
| | | contractSubjectMatterMapper.updateById(subjectMatter); |
| | | //保存erp出库 |
| | | String batchNumber = genBatchNumber(); |
| | | Long outBoundId = saveErpOutBound(contract, addDTO, outSubjectMatterAddDTO, batchNumber); |
| | | //保存合同出库记录 |
| | | saveContractOutBound(contract, addDTO, subjectMatter, outBoundId); |
| | |
| | | |
| | | private String genBatchNumber() { |
| | | if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smj) || StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjsc) || |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)) { |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjzt)|| |
| | | StrUtil.equals(SecurityUtils.getUser().getCompId() + "", smjhw)) { |
| | | return generateSMJContractCKNo(); |
| | | } |
| | | if (StrUtil.equals(SecurityUtils.getUser().getCompId() + "", sgb)) { |