优化代码

This commit is contained in:
gaoxiong 2025-07-10 00:29:32 +08:00
parent 25d828a319
commit 1143ea4c18
5 changed files with 22 additions and 16 deletions

View File

@ -43,9 +43,9 @@ public class CheckSchemeEntity extends AuditableEntity implements Serializable {
@TableField("construction_scheme")
private String constructionScheme;
@ApiModelProperty("检查方式枚举CheckTypeEnum")
@TableField("check_type")
private String checkType;
@ApiModelProperty("检查方式枚举CheckMethodEnum")
@TableField("check_method")
private String checkMethod;
@ApiModelProperty("备注")
@TableField("remark")

View File

@ -13,8 +13,8 @@ import java.util.List;
* @Description:
*/
public interface CheckSchemeService extends IService<CheckSchemeEntity> {
List<CheckSchemeResp> page(String checkType);
List<CheckSchemeResp> list(String checkType);
List<CheckSchemeResp> page(String checkMethod);
List<CheckSchemeResp> list(String checkMethod);
CheckSchemeResp detail(String checkSchemeId);
void save(CheckSchemeReq req);
void update(String checkSchemeId, CheckSchemeReq req);

View File

@ -28,14 +28,14 @@ import java.util.List;
public class CheckSchemeServiceImpl extends ServiceImpl<CheckSchemeMapper, CheckSchemeEntity> implements CheckSchemeService {
@Override
public List<CheckSchemeResp> page(String checkType) {
public List<CheckSchemeResp> page(String checkMethod) {
PageUtil.startPage();
return this.list(checkType);
return this.list(checkMethod);
}
@Override
public List<CheckSchemeResp> list(String checkType) {
List<CheckSchemeResp> result = Converts.INSTANCE.toCheckSchemeResp(this.list(Wrappers.lambdaQuery(CheckSchemeEntity.class).eq(StrUtil.isNotBlank(checkType), CheckSchemeEntity::getCheckType, checkType)));
public List<CheckSchemeResp> list(String checkMethod) {
List<CheckSchemeResp> result = Converts.INSTANCE.toCheckSchemeResp(this.list(Wrappers.lambdaQuery(CheckSchemeEntity.class).eq(StrUtil.isNotBlank(checkMethod), CheckSchemeEntity::getCheckMethod, checkMethod)));
result.forEach(resp -> {
resp.setCheckMethodLabel(CheckMethodEnum.getDescByCode(resp.getCheckMethod()));
});

View File

@ -27,14 +27,14 @@ public class CheckSchemeController {
@ApiOperation(value = "分页查询检查方案信息", httpMethod = "GET")
@GetMapping("/page")
public PageResult<CheckSchemeResp> page(@RequestParam(required = false) String checkType){
return PageResult.ok(checkSchemeService.page(checkType));
public PageResult<CheckSchemeResp> page(@RequestParam(required = false) String checkMethod){
return PageResult.ok(checkSchemeService.page(checkMethod));
}
@ApiOperation(value = "查询检查方案信息列表", httpMethod = "GET")
@GetMapping("/list")
public Result<List<CheckSchemeResp>> list(@RequestParam(required = false) String checkType){
return Result.ok(checkSchemeService.list(checkType));
public Result<List<CheckSchemeResp>> list(@RequestParam(required = false) String checkMethod){
return Result.ok(checkSchemeService.list(checkMethod));
}
@ApiOperation(value = "查询检查方案详情", httpMethod = "GET")

View File

@ -134,7 +134,7 @@ public class CommonController {
}
@ApiOperation(value = "查询在职状态", httpMethod = "GET")
@GetMapping("/list/user_status")
@GetMapping("/list/user-status")
public Result<?> listUserStatus(){
return Result.ok(UserStatusEnum.listAll());
}
@ -146,16 +146,22 @@ public class CommonController {
}
@ApiOperation(value = "查询保险状态", httpMethod = "GET")
@GetMapping("/list/insurance_status")
@GetMapping("/list/insurance-status")
public Result<?> listInsuranceStatus(){
return Result.ok(InsuranceStatusEnum.listAll());
}
@ApiOperation(value = "查询附件业务类型", httpMethod = "GET")
@GetMapping("/list/attach_business_type")
@GetMapping("/list/attach-business_type")
public Result<?> listAttachBusinessType(){
return Result.ok(AttachBusinessTypeEnum.listAll());
}
@ApiOperation(value = "查询检查方式", httpMethod = "GET")
@GetMapping("/list/check-method")
public Result<?> listCheckMethod(){
return Result.ok(CheckMethodEnum.listAll());
}
}