diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/mapper/ContractMobileMapper.java b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/mapper/ContractMobileMapper.java index f7c729e5..d223d3db 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/mapper/ContractMobileMapper.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/mapper/ContractMobileMapper.java @@ -35,4 +35,6 @@ public interface ContractMobileMapper extends BaseMapper { //进行中的合同 IPage getContractlist(Page page, ContractMobilePagination contractMobilePagination, QueryWrapper contractMobileQueryWrapper); + + List getPurchaseData(@Param("id") String id); } diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java index f44cb474..00e4ae3b 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java @@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.lang.reflect.Field; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -252,6 +253,16 @@ public class ContractMobileServiceImpl extends ServiceImpl page = new Page<>(1, 99); page.setOptimizeCountSql(false); IPage userIPage = contractMobileMapper.getMobileDate(page, contractMobileQueryWrapper); + List list = userIPage.getRecords(); + BigDecimal purNum = new BigDecimal("0"); + for (ContractMobileVO contractMobileVO: list) { + List purchaseList = contractMobileMapper.getPurchaseData(contractMobileVO.getId()); + for (PurchaseContractMobileVO purchaseContractMobileVO: purchaseList) { + purNum = purNum.add(purchaseContractMobileVO.getNum()); + } + contractMobileVO.setUndistributedNum(contractMobileVO.getNum().subtract(purNum)); + contractMobileVO.setPurchaseList(purchaseList); + } // IPage userIPage = this.page(page, contractMobileQueryWrapper); return userIPage.getRecords(); } diff --git a/SC-boot/linkage-scm/src/main/resources/mapper/contractMobile/ContractMobileMapper.xml b/SC-boot/linkage-scm/src/main/resources/mapper/contractMobile/ContractMobileMapper.xml index 6d3f88cf..3e2e2e5c 100644 --- a/SC-boot/linkage-scm/src/main/resources/mapper/contractMobile/ContractMobileMapper.xml +++ b/SC-boot/linkage-scm/src/main/resources/mapper/contractMobile/ContractMobileMapper.xml @@ -106,43 +106,7 @@ @@ -939,6 +623,14 @@ ) aaa + +