Commit af0d3bd1 by kangxiaoshan

验收金额

parent 0201c49f
...@@ -111,6 +111,7 @@ public class Contract { ...@@ -111,6 +111,7 @@ public class Contract {
private String agreementTypeName; //协议类型 1 普通协议 2 框架协议 private String agreementTypeName; //协议类型 1 普通协议 2 框架协议
private String productType; //产品类型 private String productType; //产品类型
private String acceptanceAmount;//验收金额
@Id @Id
...@@ -822,4 +823,13 @@ public class Contract { ...@@ -822,4 +823,13 @@ public class Contract {
public void setProductType(String productType) { public void setProductType(String productType) {
this.productType = productType; this.productType = productType;
} }
@Transient
public String getAcceptanceAmount() {
return acceptanceAmount;
}
public void setAcceptanceAmount(String acceptanceAmount) {
this.acceptanceAmount = acceptanceAmount;
}
} }
...@@ -16,4 +16,6 @@ public interface DmpIncomeRepository extends JpaRepository<DmpIncome, Long> { ...@@ -16,4 +16,6 @@ public interface DmpIncomeRepository extends JpaRepository<DmpIncome, Long> {
@Query(value = "select * from dmp_income where contract_code = ?1 and income_month =?2 limit 1 ", nativeQuery = true) @Query(value = "select * from dmp_income where contract_code = ?1 and income_month =?2 limit 1 ", nativeQuery = true)
DmpIncome findByCodeMonth(String contractCode, String incomeMonth); DmpIncome findByCodeMonth(String contractCode, String incomeMonth);
} }
...@@ -14,4 +14,7 @@ public interface PdIncomeRepository extends JpaRepository<PdIncome, Long> { ...@@ -14,4 +14,7 @@ public interface PdIncomeRepository extends JpaRepository<PdIncome, Long> {
@Query(value = "select * from pd_income where settlement_date > ?1 and settlement_date < ?2", nativeQuery = true) @Query(value = "select * from pd_income where settlement_date > ?1 and settlement_date < ?2", nativeQuery = true)
List<PdIncome> findByDs(String startDate, String endDate); List<PdIncome> findByDs(String startDate, String endDate);
@Query(value = "select contract_code, sum(acceptance_amount) from pd_income where contract_code in ?1 group by contract_code", nativeQuery = true)
List<Object[]> findGroupWithCode(List codes);
} }
...@@ -235,6 +235,9 @@ public class ContractServiceImpl implements ContractService { ...@@ -235,6 +235,9 @@ public class ContractServiceImpl implements ContractService {
@Autowired @Autowired
private DmpIncomeService dmpIncomeService; private DmpIncomeService dmpIncomeService;
@Autowired
private PdIncomeRepository pdIncomeRepository;
@Override @Override
public Map<String, Object> checkAccount(String email, String platfrom) { public Map<String, Object> checkAccount(String email, String platfrom) {
...@@ -1585,7 +1588,16 @@ public class ContractServiceImpl implements ContractService { ...@@ -1585,7 +1588,16 @@ public class ContractServiceImpl implements ContractService {
Map<String, String> tradeTypeMap = tradeTypeRepsitory.findAll().stream().collect(Collectors.toMap(v -> v.getId().toString(), v -> v.getName())); Map<String, String> tradeTypeMap = tradeTypeRepsitory.findAll().stream().collect(Collectors.toMap(v -> v.getId().toString(), v -> v.getName()));
if (ValidateUtil.isValid(contractList)) { if (ValidateUtil.isValid(contractList)) {
Map<String, String> acceptanceAmountMap = new HashMap<>();
if ("pd".equals(platform)) {
//私有化合同关联 验收收入
List<Object[]> objects = pdIncomeRepository.findGroupWithCode(contractList.stream().map(v -> v.getContractCode()).collect(Collectors.toList()));
acceptanceAmountMap = objects.stream().collect(Collectors.toMap(v -> v[0] + "", v -> v[1] + "", (v1, v2) -> v1));
}
List<BarrioCity> barrioCities = barrioCityRepository.findAll(); List<BarrioCity> barrioCities = barrioCityRepository.findAll();
Map<Long, BarrioCity> barrioCitiesNameMap = barrioCities.stream().collect(Collectors.toMap(BarrioCity::getId, Function.identity(), (v1, v2) -> v1)); Map<Long, BarrioCity> barrioCitiesNameMap = barrioCities.stream().collect(Collectors.toMap(BarrioCity::getId, Function.identity(), (v1, v2) -> v1));
for (Contract c : contractList) { for (Contract c : contractList) {
...@@ -1607,6 +1619,9 @@ public class ContractServiceImpl implements ContractService { ...@@ -1607,6 +1619,9 @@ public class ContractServiceImpl implements ContractService {
c.setRelationContract(-1L); c.setRelationContract(-1L);
} }
c.setAcceptanceAmount(acceptanceAmountMap.containsKey(c.getContractCode())
? acceptanceAmountMap.get(c.getContractCode()) : "0");
/* if (ContractStatusEnum.MONEY_BACK_FIRST.getKey().equals(c.getStatus())) { /* if (ContractStatusEnum.MONEY_BACK_FIRST.getKey().equals(c.getStatus())) {
c.setStartDate(null); c.setStartDate(null);
}*/ }*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment