Administrator
2024-01-25 371591d64d37a57e2866e6f0729cf7054b8744ba
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/client/ClientCtrl.java
@@ -9,7 +9,6 @@
import com.dy.pipIrrGlobal.pojoSe.SeClient;
import com.dy.pipIrrGlobal.voSe.VoClient;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
@@ -67,32 +66,6 @@
    }
    /**
     * 获取交易记录
     * @param vo
     * @return
     */
    @Operation(summary = "获得一页交易记录", description = "返回一页交易记录")
    @ApiResponses(value = {
            @ApiResponse(
                    responseCode = ResultCodeMsg.RsCode.SUCCESS_CODE,
                    description = "返回一页农户数据(BaseResponse.content:QueryResultVo[{}])",
                    content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
                            schema = @Schema(implementation = BaClient.class))}
            )
    })
    @GetMapping(path = "getOperates")
    @SsoAop()
    public BaseResponse<Map> getOperates(QueryOperate vo){
        try {
           Map res = clientSv.getOperates(vo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("查询交易记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 根据主键获取一个农户对象
     * @param id
     * @return
@@ -137,13 +110,13 @@
    @PostMapping(path = "add", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> add(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoClient po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> add(@RequestBody @Valid DtoClient po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        Long villageId = po.getVillageId();
        /**
         * 获取5级行政区划信息
@@ -203,7 +176,7 @@
    }
    /**
     * 生成10为农户编号
     * 生成10位农户编号
     * 1. 到农户表中查询6位区划串开头的最大的农户编号
     * 2. 是否取到记录
     *      2.1 取到
@@ -247,13 +220,13 @@
    @PostMapping(path = "update", consumes = MediaType.APPLICATION_JSON_VALUE)
    @Transactional(rollbackFor = Exception.class)
    @SsoAop()
    public BaseResponse<Boolean> update(@RequestBody @Parameter(description = "form表单json数据", required = true) @Valid DtoClient po, @Parameter(hidden = true) BindingResult bindingResult){
    public BaseResponse<Boolean> update(@RequestBody @Valid DtoClient po, BindingResult bindingResult){
        if(bindingResult != null && bindingResult.hasErrors()){
            return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
        }
        // 接收村编号(主键)
        Long villageId = po.getVillageid();
        Long villageId = po.getVillageId();
        /**
         * 获取5级行政区划信息