|
|
@ -1,8 +1,11 @@ |
|
|
|
package com.kms.build.controller; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.jianwei.common.core.controller.BaseController; |
|
|
|
import com.jianwei.common.core.domain.SearchParam; |
|
|
|
import com.jianwei.common.utils.poi.ExcelUtil; |
|
|
@ -11,6 +14,8 @@ import com.kms.build.service.BsSgcjsjdBuiProInfoService; |
|
|
|
import com.kms.common.utils.BaseEntityUtils; |
|
|
|
|
|
|
|
|
|
|
|
import com.kms.earlyStage.domain.SpecialProjectProposal; |
|
|
|
import com.kms.earlyStage.service.SpecialProjectProposalService; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@ -45,6 +50,19 @@ public class BsSgcjsjdBuiProInfoController extends BaseController |
|
|
|
@Autowired |
|
|
|
private BsSgcjsjdBuiProInfoService bsSgcjsjdBuiProInfoService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SpecialProjectProposalService specialProjectProposalService; |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getProposal") |
|
|
|
public AjaxResult getSpecialProjectProposal() { |
|
|
|
QueryWrapper<SpecialProjectProposal> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("is_construction", "0"); |
|
|
|
List<SpecialProjectProposal> proposalList = specialProjectProposalService.list(queryWrapper); |
|
|
|
return AjaxResult.success(proposalList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询项目基本信息管理列表 |
|
|
|
*/ |
|
|
@ -87,6 +105,37 @@ public class BsSgcjsjdBuiProInfoController extends BaseController |
|
|
|
public AjaxResult add(@RequestBody BsSgcjsjdBuiProInfo bsSgcjsjdBuiProInfo) |
|
|
|
{ |
|
|
|
BaseEntityUtils.preInsert(bsSgcjsjdBuiProInfo); |
|
|
|
|
|
|
|
UpdateWrapper<SpecialProjectProposal> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.set("is_construction", "1"); |
|
|
|
updateWrapper.eq("project_code", bsSgcjsjdBuiProInfo.getProCode()); |
|
|
|
updateWrapper.eq("pro_no", bsSgcjsjdBuiProInfo.getProNo()); |
|
|
|
specialProjectProposalService.update(updateWrapper); |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal centralArrangedFunds = bsSgcjsjdBuiProInfo.getCentralArrangedFunds(); |
|
|
|
BigDecimal cityLevelFunds = bsSgcjsjdBuiProInfo.getCityLevelFunds(); |
|
|
|
BigDecimal provincialFunding = bsSgcjsjdBuiProInfo.getProvincialFunding(); |
|
|
|
BigDecimal countyLevelFunds = bsSgcjsjdBuiProInfo.getCountyLevelFunds(); |
|
|
|
BigDecimal townshipInvestments = bsSgcjsjdBuiProInfo.getTownshipInvestments(); |
|
|
|
if (centralArrangedFunds==null){ |
|
|
|
centralArrangedFunds = BigDecimal.valueOf(BigDecimal.ROUND_UP); |
|
|
|
} |
|
|
|
if (cityLevelFunds==null){ |
|
|
|
cityLevelFunds = BigDecimal.valueOf(BigDecimal.ROUND_UP); |
|
|
|
} |
|
|
|
if (provincialFunding==null){ |
|
|
|
provincialFunding = BigDecimal.valueOf(BigDecimal.ROUND_UP); |
|
|
|
} |
|
|
|
if (countyLevelFunds==null){ |
|
|
|
countyLevelFunds = BigDecimal.valueOf(BigDecimal.ROUND_UP); |
|
|
|
} |
|
|
|
if (townshipInvestments==null){ |
|
|
|
townshipInvestments = BigDecimal.valueOf(BigDecimal.ROUND_UP); |
|
|
|
} |
|
|
|
BigDecimal total = centralArrangedFunds.add(cityLevelFunds).add(provincialFunding). |
|
|
|
add(countyLevelFunds).add(townshipInvestments); |
|
|
|
bsSgcjsjdBuiProInfo.setTotal(total); |
|
|
|
return toAjax(bsSgcjsjdBuiProInfoService.save(bsSgcjsjdBuiProInfo)); |
|
|
|
} |
|
|
|
|
|
|
|