Commit b5004ee8 authored by wangxl's avatar wangxl

1

parent e3b8a481
...@@ -686,6 +686,7 @@ public class CommonEnum { ...@@ -686,6 +686,7 @@ public class CommonEnum {
expertAdd("expertAdd", "添加专家"), expertAdd("expertAdd", "添加专家"),
expertStateUpdate("expertStateUpdate", "专家状态修改"), expertStateUpdate("expertStateUpdate", "专家状态修改"),
expertUpdate("expertUpdate", "专家修改"), expertUpdate("expertUpdate", "专家修改"),
expertReport("expertReport", "专家上报"),
expertDelete("expertDelete", "删除专家"), expertDelete("expertDelete", "删除专家"),
managerAdd("managerAdd", "添加管理员"), managerAdd("managerAdd", "添加管理员"),
......
...@@ -137,6 +137,14 @@ public class ComExpertController extends BaseController<ComExpertService, ComExp ...@@ -137,6 +137,14 @@ public class ComExpertController extends BaseController<ComExpertService, ComExp
return ResponseDataModel.ok(comExpertService.update(dto)); return ResponseDataModel.ok(comExpertService.update(dto));
} }
@ApiOperation(value = "更新专家", httpMethod = "POST", notes = "添加或更新专家")
@RequestMapping("/report")
@PutMapping
@Logs(value = CommonEnum.logType.expertReport)
public ResponseDataModel<String> report(@Validated @RequestBody ComExpertDTO dto) {
return ResponseDataModel.ok(comExpertService.report(dto));
}
private void checkRole(@RequestBody @Validated ComExpertDTO dto) { private void checkRole(@RequestBody @Validated ComExpertDTO dto) {
if (SecurityUserHolder.getRoles().contains(CommonEnum.systemRole.unit.getCode().toString())) { if (SecurityUserHolder.getRoles().contains(CommonEnum.systemRole.unit.getCode().toString())) {
dto.setUnitId(SecurityUserHolder.getUnitId()); dto.setUnitId(SecurityUserHolder.getUnitId());
......
...@@ -35,6 +35,14 @@ public interface ComExpertService extends BaseService<ComExpertQueryVO, ComExper ...@@ -35,6 +35,14 @@ public interface ComExpertService extends BaseService<ComExpertQueryVO, ComExper
*/ */
String update(ComExpertDTO dto); String update(ComExpertDTO dto);
/**
*
*
* @param dto
* @return
*/
String report(ComExpertDTO dto);
/** /**
* 移除单位管理员 * 移除单位管理员
*/ */
......
...@@ -168,6 +168,16 @@ public class ComExpertServiceImpl extends BaseServiceImpl<ComExpertDAO, ComExper ...@@ -168,6 +168,16 @@ public class ComExpertServiceImpl extends BaseServiceImpl<ComExpertDAO, ComExper
return dto.getId(); return dto.getId();
} }
@Transactional
public String report(ComExpertDTO dto) {
ComExpert comExpert = this.entityById(dto.getId());
if (null == comExpert)
throw new BusinessException("专家不存在或已删除!");
StringUtil.copyObj2Obj(dto, comExpert);
this.update(comExpert);
return dto.getId();
}
@Transactional @Transactional
public String deleteExpert(ComExpertDTO d) { public String deleteExpert(ComExpertDTO d) {
// this.deleteById(d.getId()); // this.deleteById(d.getId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment