优化代码
This commit is contained in:
parent
25d828a319
commit
1143ea4c18
|
@ -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")
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()));
|
||||
});
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue