|
|
@ -1,14 +1,19 @@ |
|
|
|
package com.kms.build.service; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.jianwei.common.core.domain.SearchParam; |
|
|
|
import com.jianwei.common.core.domain.entity.SysUser; |
|
|
|
import com.jianwei.common.core.service.BaseService; |
|
|
|
import com.jianwei.common.mybaitsplus.BeanToWrapper; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiContInfo; |
|
|
|
import com.kms.build.domain.BsSgcjsjdBuiProInfo; |
|
|
|
import com.kms.build.mapper.BsSgcjsjdBuiProInfoMapper; |
|
|
|
import com.kms.common.utils.UserUtils; |
|
|
|
import com.kms.earlyStage.domain.SpecialProjectInfo; |
|
|
|
import com.kms.system.service.SysXzqhService; |
|
|
|
import org.apache.ibatis.reflection.wrapper.BaseWrapper; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -34,6 +39,9 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM |
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiContInfoService bsSgcJsjdBuiContInfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysXzqhService sysXzqhService; |
|
|
|
|
|
|
|
|
|
|
|
public IPage selectPage(SearchParam<BsSgcjsjdBuiProInfo> sp, String adcd) { |
|
|
|
|
|
|
@ -74,4 +82,53 @@ public class BsSgcjsjdBuiProInfoService extends BaseService<BsSgcjsjdBuiProInfoM |
|
|
|
return page; |
|
|
|
} |
|
|
|
|
|
|
|
public IPage<BsSgcjsjdBuiProInfo> selectPage1(SearchParam<BsSgcjsjdBuiProInfo> sp) { |
|
|
|
SysUser sysUser = UserUtils.getUser(); |
|
|
|
|
|
|
|
BsSgcjsjdBuiProInfo data = sp.getData(); |
|
|
|
|
|
|
|
Map<String, Object> params = sp.getParams(); |
|
|
|
|
|
|
|
assert sysUser != null; |
|
|
|
List<BsSgcjsjdBuiProInfo> list = null; |
|
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNull(params)) { |
|
|
|
list = bsSgcjsjdBuiProInfoMapper.getByUserPro(sysUser.getId(),sysUser.getUserType(),data.getId(),data.getProjectName(), |
|
|
|
sysXzqhService.getSubString(sp.getData().getAdcd()), |
|
|
|
"create_time",sp.getPageNum(),sp.getPageSize()); |
|
|
|
}else { |
|
|
|
list = bsSgcjsjdBuiProInfoMapper.getByUserPro(sysUser.getId(),sysUser.getUserType(),data.getId(), |
|
|
|
data.getProjectName(), sysXzqhService.getSubString(sp.getData().getAdcd()), (String) params.get("orderBy"), sp.getPageNum(), sp.getPageSize()); |
|
|
|
} |
|
|
|
|
|
|
|
Page<BsSgcjsjdBuiProInfo> page = new Page<>(); |
|
|
|
page.setRecords(list); |
|
|
|
page.setTotal(list.size()); |
|
|
|
List<BsSgcjsjdBuiProInfo> records = page.getRecords(); |
|
|
|
|
|
|
|
for (BsSgcjsjdBuiProInfo record : records) { |
|
|
|
String proNo = record.getProNo(); |
|
|
|
String proCode = record.getProCode(); |
|
|
|
QueryWrapper<BsSgcJsjdBuiContInfo> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("pro_no", proNo); |
|
|
|
queryWrapper.eq("pro_code", proCode); |
|
|
|
List<BsSgcJsjdBuiContInfo> bsSgcJsjdBuiContInfos = |
|
|
|
bsSgcJsjdBuiContInfoService.list(queryWrapper); |
|
|
|
BigDecimal contractPayment = BigDecimal.ZERO; |
|
|
|
for (BsSgcJsjdBuiContInfo bsSgcJsjdBuiContInfo : bsSgcJsjdBuiContInfos) { |
|
|
|
BigDecimal actualPayment = bsSgcJsjdBuiContInfo.getActualPayment(); |
|
|
|
if (actualPayment == null) { |
|
|
|
actualPayment = BigDecimal.ZERO; |
|
|
|
} |
|
|
|
contractPayment = contractPayment.add(actualPayment); |
|
|
|
} |
|
|
|
record.setContractPayment(contractPayment); |
|
|
|
|
|
|
|
} |
|
|
|
page.setRecords(records); |
|
|
|
|
|
|
|
return page; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|