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;
@@ -40,6 +39,11 @@
public class ClientCtrl {
    private final ClientSv clientSv;
    /**
     * 获取农户列表
     * @param vo
     * @return
     */
    @Operation(summary = "获得一页农户", description = "返回一页农户数据")
    @ApiResponses(value = {
            @ApiResponse(
@@ -61,6 +65,11 @@
        }
    }
    /**
     * 根据主键获取一个农户对象
     * @param id
     * @return
     */
    @Operation(summary = "获得一个农户", description = "返回一个农户数据")
    @ApiResponses(value = {
            @ApiResponse(
@@ -83,6 +92,12 @@
    }
    /**
     * 添加一个农户对象
     * @param po
     * @param bindingResult
     * @return
     */
    @Operation(summary = "添加农户记录", description = "添加农户记录")
    @ApiResponses(value = {
            @ApiResponse(
@@ -95,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级行政区划信息
@@ -161,7 +176,7 @@
    }
    /**
     * 生成10为农户编号
     * 生成10位农户编号
     * 1. 到农户表中查询6位区划串开头的最大的农户编号
     * 2. 是否取到记录
     *      2.1 取到
@@ -188,7 +203,7 @@
    }
    /**
     * 修改农户对象 虚拟卡号、禁止标志、逻辑删除标识不参与修改
     * 修改农户对象(虚拟卡号、禁止标志、逻辑删除标识不参与修改)
     * @param po 农户对象
     * @param bindingResult
     * @return
@@ -205,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级行政区划信息