| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取交易记录 |
| | | * @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 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 = "getStatistics") |
| | | @SsoAop() |
| | | public BaseResponse<Map> getStatistics(QueryStatistic vo){ |
| | | try { |
| | | Map res = clientSv.getStatistics(vo); |
| | | return BaseResponseUtils.buildSuccess(res); |
| | | } catch (Exception e) { |
| | | log.error("查询交易汇总记录异常", e); |
| | | return BaseResponseUtils.buildException(e.getMessage()) ; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据主键获取一个农户对象 |
| | | * @param id |
| | | * @return |
| | |
| | | @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级行政区划信息 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 生成10为农户编号 |
| | | * 生成10位农户编号 |
| | | * 1. 到农户表中查询6位区划串开头的最大的农户编号 |
| | | * 2. 是否取到记录 |
| | | * 2.1 取到 |
| | |
| | | @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级行政区划信息 |