mitao
2025-01-15 da8bd34ef4e721b9d6255f983c68ef3975d0962d
land-admin/src/main/java/com/zzg/web/controller/state/StateAssetController.java
@@ -14,9 +14,12 @@
import com.zzg.system.service.state.StateAssetService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.List;
import java.util.Objects;
@@ -26,12 +29,12 @@
public class StateAssetController {
    private final StateAssetService assetService;
    // 新增和修改 项目资金
    @PostMapping(UrlConstants.STATE_PROJECT_ASSET_SAVE)
    public AjaxResult<Boolean> saveAsset(@RequestBody StateAssetBO asset) {
        return AjaxResult.success(assetService.saveAsset(asset));
    }
    // 项目删除
    @GetMapping(UrlConstants.STATE_PROJECT_ASSET_DEL)
    public AjaxResult<Boolean> delAsset(@RequestParam String assetId) {
        StateAsset asset = assetService.getById(assetId);
@@ -43,11 +46,13 @@
        updateWrapper.set(StateAsset::getDelFlag, DeleteFlagEnum.DELETED.getKey());
        return AjaxResult.success(assetService.update(updateWrapper));
    }
    // 项目资金展示
    @GetMapping(UrlConstants.STATE_PROJECT_ASSET_LIST)
    public AjaxResult<List<StateAsset>> listAsset(@RequestParam String projectId,
                                                  @RequestParam String street,
                                                  @RequestParam(required = false) String assetId) {
    public AjaxResult<List<StateAsset>> listAsset(
            @RequestParam String projectId,
            @RequestParam String street,
            @RequestParam(required = false) String assetId
    ) {
        LambdaQueryWrapper<StateAsset> stateAssetQueryWrapper = new LambdaQueryWrapper<>();
        stateAssetQueryWrapper.eq(StateAsset::getStateProjectId, projectId);
        stateAssetQueryWrapper.eq(StateAsset::getStreet, street);
@@ -60,12 +65,12 @@
                .setScale(4, RoundingMode.HALF_UP)));
        return AjaxResult.success(list);
    }
    // 项目资金 上方统计数据
    @GetMapping(UrlConstants.STATE_PROJECT_ASSET_SUM)
    public AjaxResult<JSONObject> sumAsset(@RequestParam String projectId) {
        return AjaxResult.success(assetService.sumAsset(projectId));
    }
    // 项目资金点击上方符号查询
    @PostMapping(UrlConstants.STATE_PROJECT_ASSET_DETAIL)
    public AjaxResult<PageInfo<StateAssetDetailVO>> listAssetDetail(@RequestBody AssetDetailBO detailBO) {
        return AjaxResult.success(assetService.listAssetDetail(detailBO));