|
@@ -10,6 +10,7 @@ import com.management.platform.entity.vo.ContractPageVO;
|
|
|
import com.management.platform.entity.vo.SysRichFunction;
|
|
|
import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.ContractDocumentService;
|
|
|
+import com.management.platform.service.ContractPayCustomizedService;
|
|
|
import com.management.platform.service.ContractService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.management.platform.service.ExcelExportService;
|
|
@@ -56,6 +57,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
@Resource
|
|
|
private ContractCustomMapper contractCustomMapper;
|
|
|
@Resource
|
|
|
+ private ContractPayCustomizedMapper payCustomizedMapper;
|
|
|
+ @Resource
|
|
|
private ContractMapper contractMapper;
|
|
|
@Resource
|
|
|
private ContractPaymentMapper contractPaymentMapper;
|
|
@@ -364,17 +367,32 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(paymentListStr)){
|
|
|
- List<ContractPayment> contractPaymentList = JSON.parseArray(paymentListStr, ContractPayment.class);
|
|
|
- BigDecimal bg = new BigDecimal("0");
|
|
|
- for (ContractPayment contractPayment:contractPaymentList) {
|
|
|
- contractPayment.setContractId(contract.getId());
|
|
|
- contractPaymentMapper.insert(contractPayment);
|
|
|
- if (contractPayment.getIsPayed()) {
|
|
|
- bg = bg.add(contractPayment.getAmount());
|
|
|
+ if (user.getCompanyId()==4215){
|
|
|
+ List<ContractPayCustomized> payCustomizedList = JSON.parseArray(paymentListStr, ContractPayCustomized.class);
|
|
|
+ BigDecimal bg = new BigDecimal("0");
|
|
|
+ for (ContractPayCustomized payCustomized:payCustomizedList) {
|
|
|
+ payCustomized.setContractId(contract.getId());
|
|
|
+ payCustomizedMapper.insert(payCustomized);
|
|
|
+ if (payCustomized.getIsPayed()) {
|
|
|
+ bg = bg.add(payCustomized.getPayedAmount());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ contract.setPayment(bg);
|
|
|
+ contractMapper.updateById(contract);
|
|
|
+ }else {
|
|
|
+ List<ContractPayment> contractPaymentList = JSON.parseArray(paymentListStr, ContractPayment.class);
|
|
|
+ BigDecimal bg = new BigDecimal("0");
|
|
|
+ for (ContractPayment contractPayment:contractPaymentList) {
|
|
|
+ contractPayment.setContractId(contract.getId());
|
|
|
+ contractPaymentMapper.insert(contractPayment);
|
|
|
+ if (contractPayment.getIsPayed()) {
|
|
|
+ bg = bg.add(contractPayment.getAmount());
|
|
|
+ }
|
|
|
}
|
|
|
+ contract.setPayment(bg);
|
|
|
+ contractMapper.updateById(contract);
|
|
|
}
|
|
|
- contract.setPayment(bg);
|
|
|
- contractMapper.updateById(contract);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
ContractLog contractLog = new ContractLog();
|
|
@@ -437,17 +455,31 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
contract.setIndate(null);
|
|
|
//更新回款计划
|
|
|
if (StringUtils.isNotBlank(paymentListStr)){
|
|
|
- List<ContractPayment> contractPaymentList = JSON.parseArray(paymentListStr, ContractPayment.class);
|
|
|
- contractPaymentMapper.delete(new QueryWrapper<ContractPayment>().eq("contract_id",contract.getId()));
|
|
|
- BigDecimal bg = new BigDecimal("0");
|
|
|
- for (ContractPayment contractPayment:contractPaymentList) {
|
|
|
- contractPaymentMapper.insert(contractPayment);
|
|
|
- if (contractPayment.getIsPayed()) {
|
|
|
- bg = bg.add(contractPayment.getAmount());
|
|
|
+ if (user.getCompanyId()==4215){
|
|
|
+ List<ContractPayCustomized> payCustomizedList = JSON.parseArray(paymentListStr, ContractPayCustomized.class);
|
|
|
+ payCustomizedMapper.delete(new QueryWrapper<ContractPayCustomized>().eq("contract_id",contract.getId()));
|
|
|
+ BigDecimal bg = new BigDecimal("0");
|
|
|
+ for (ContractPayCustomized payCustomized:payCustomizedList) {
|
|
|
+ payCustomized.setContractId(contract.getId());
|
|
|
+ payCustomizedMapper.insert(payCustomized);
|
|
|
+ if (payCustomized.getIsPayed()) {
|
|
|
+ bg = bg.add(payCustomized.getPayedAmount());
|
|
|
+ }
|
|
|
}
|
|
|
+ contract.setPayment(bg);
|
|
|
+ }else {
|
|
|
+ List<ContractPayment> contractPaymentList = JSON.parseArray(paymentListStr, ContractPayment.class);
|
|
|
+ contractPaymentMapper.delete(new QueryWrapper<ContractPayment>().eq("contract_id",contract.getId()));
|
|
|
+ BigDecimal bg = new BigDecimal("0");
|
|
|
+ for (ContractPayment contractPayment:contractPaymentList) {
|
|
|
+ contractPaymentMapper.insert(contractPayment);
|
|
|
+ if (contractPayment.getIsPayed()) {
|
|
|
+ bg = bg.add(contractPayment.getAmount());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ System.out.println("回款金额: " + bg);
|
|
|
+ contract.setPayment(bg);
|
|
|
}
|
|
|
- System.out.println("回款金额: " + bg);
|
|
|
- contract.setPayment(bg);
|
|
|
}
|
|
|
contractMapper.updateById(contract);
|
|
|
boolean flag = false;
|
|
@@ -834,7 +866,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
if (StringUtils.isNotBlank(s4)){
|
|
|
customItem.setPendingAmounts(new BigDecimal(s4));
|
|
|
}*/
|
|
|
- String status = row.getCell(27)==null?null:row.getCell(27).getStringCellValue();
|
|
|
+ String status = row.getCell(20)==null?null:row.getCell(20).getStringCellValue();
|
|
|
if (StringUtils.isNotBlank(status)){
|
|
|
if ("履约中".equals(status)) {
|
|
|
customItem.setFinishStatus(1);
|
|
@@ -842,8 +874,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
customItem.setFinishStatus(2);
|
|
|
}
|
|
|
}
|
|
|
- String remarks = row.getCell(28)==null?null:row.getCell(28).getStringCellValue();
|
|
|
- customItem.setStampDutyItems(row.getCell(29)==null?null:row.getCell(29).getStringCellValue());
|
|
|
+ String remarks = row.getCell(21)==null?null:row.getCell(21).getStringCellValue();
|
|
|
+ customItem.setStampDutyItems(row.getCell(22)==null?null:row.getCell(22).getStringCellValue());
|
|
|
Contract item = new Contract();
|
|
|
//检查合同编号是否存在
|
|
|
if (StringUtils.isNotBlank(No)){
|