评分标准新增或者修改

This commit is contained in:
mythxb 2024-04-01 17:38:41 +08:00
parent d03013db06
commit d32b94d618
4 changed files with 130 additions and 49 deletions

View File

@ -14,6 +14,9 @@ import javax.validation.constraints.NotNull;
@ApiModel("加分项考核指标新增")
public class ItemAddBonusDto {
@ApiModelProperty(value = "评分标准id 传修改 不传新增",required = true)
private String standardId;
@NotNull(message = "考核不能为空")
@ApiModelProperty(value = "考核id",required = true)
private String examineId;
@ -30,6 +33,14 @@ public class ItemAddBonusDto {
@ApiModelProperty(value = "党政同责考核类型 1、直属部门 2、监管部门 3、市县",required = true)
private Integer examineState;
public String getStandardId() {
return standardId;
}
public void setStandardId(String standardId) {
this.standardId = standardId;
}
public String getExamineId() {
return examineId;
}

View File

@ -14,6 +14,9 @@ import javax.validation.constraints.NotNull;
@ApiModel("普通考核指标添加")
public class ItemAddDto {
@ApiModelProperty(value = "评分标准id 传修改 不传新增",required = true)
private String standardId;
@NotNull(message = "考核不能为空")
@ApiModelProperty(value = "考核id",required = true)
private String examineId;
@ -52,6 +55,14 @@ public class ItemAddDto {
@ApiModelProperty(value = "党政同责考核类型 1、直属部门 2、监管部门 3、市县",required = true)
private Integer examineState;
public String getStandardId() {
return standardId;
}
public void setStandardId(String standardId) {
this.standardId = standardId;
}
public String getExamineId() {
return examineId;
}

View File

@ -15,6 +15,9 @@ import javax.validation.constraints.NotNull;
public class ItemAddSpecificDto {
@ApiModelProperty(value = "评分标准id 传修改 不传新增",required = true)
private String standardId;
@NotNull(message = "考核不能为空")
@ApiModelProperty(value = "考核id",required = true)
private String examineId;
@ -39,6 +42,14 @@ public class ItemAddSpecificDto {
@ApiModelProperty(value = "部门id",required = true)
private String listperformid;
public String getStandardId() {
return standardId;
}
public void setStandardId(String standardId) {
this.standardId = standardId;
}
public String getExamineId() {
return examineId;
}

View File

@ -98,13 +98,13 @@ public class ExamineController extends BaseController{
}
/**
* 普通考核项新增
* 普通考核项新增修改
* @version v1.0
* @author dong
* @date 2024/4/1 13:43
*/
@LoginAuth
@ApiOperation(value = "普通考核项新增", notes = "普通考核项新增")
@ApiOperation(value = "普通考核项新增修改", notes = "普通考核项新增修改")
@PostMapping(value = "itemAdd")
public SingleResult<String> itemAdd(@Valid @RequestBody ItemAddDto itemAddDto)throws Exception{
SingleResult<String> result = new SingleResult<>();
@ -131,23 +131,42 @@ public class ExamineController extends BaseController{
//考核内容信息
ExExamineItem examineItem = exExamineItemMapper.selectById(contentId);
String userId = getUserId();
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(RandomNumber.getUUid());
exStandard.setExamineId(itemAddDto.getExamineId());
exStandard.setTitle(itemAddDto.getTitle());
exStandard.setScore(itemAddDto.getScore());
exStandard.setSortId(itemAddDto.getSortId());
exStandard.setExamineState(itemAddDto.getExamineState());
exStandard.setItemType(ExItemType.ORDINARY.getType());
exStandard.setItemId(examineItem.getItemId());
exStandard.setItemPath(examineItem.getParentPath());
exStandard.setDelState(DelState.NOT_DEL.getState());
exStandard.setCreateTime(new Date());
exStandard.setModifyTime(new Date());
exStandard.setCreateBy(userId);
exStandard.setModifyBy(userId);
exStandardMapper.insert(exStandard);
if(StringUtils.isNotBlank(itemAddDto.getStandardId())){
String userId = getUserId();
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(itemAddDto.getStandardId());
exStandard.setExamineId(itemAddDto.getExamineId());
exStandard.setTitle(itemAddDto.getTitle());
exStandard.setScore(itemAddDto.getScore());
exStandard.setSortId(itemAddDto.getSortId());
exStandard.setExamineState(itemAddDto.getExamineState());
exStandard.setItemId(examineItem.getItemId());
exStandard.setItemPath(examineItem.getParentPath());
exStandard.setItemType(ExItemType.ORDINARY.getType());
exStandard.setModifyTime(new Date());
exStandard.setModifyBy(userId);
exStandardMapper.updateById(exStandard);
}else{
String userId = getUserId();
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(RandomNumber.getUUid());
exStandard.setExamineId(itemAddDto.getExamineId());
exStandard.setTitle(itemAddDto.getTitle());
exStandard.setScore(itemAddDto.getScore());
exStandard.setSortId(itemAddDto.getSortId());
exStandard.setExamineState(itemAddDto.getExamineState());
exStandard.setItemType(ExItemType.ORDINARY.getType());
exStandard.setItemId(examineItem.getItemId());
exStandard.setItemPath(examineItem.getParentPath());
exStandard.setDelState(DelState.NOT_DEL.getState());
exStandard.setCreateTime(new Date());
exStandard.setModifyTime(new Date());
exStandard.setCreateBy(userId);
exStandard.setModifyBy(userId);
exStandardMapper.insert(exStandard);
}
return result;
}
@ -191,31 +210,45 @@ public class ExamineController extends BaseController{
}
/**
* 加分考核项新增
* 加分考核项新增修改
* @version v1.0
* @author dong
* @date 2024/4/1 13:43
*/
@LoginAuth
@ApiOperation(value = "加分考核项新增", notes = "加分考核项新增")
@ApiOperation(value = "加分考核项新增修改", notes = "加分考核项新增修改")
@PostMapping(value = "itemAddBonus")
public SingleResult<String> itemAddBonus(@Valid @RequestBody ItemAddBonusDto itemAddBonusDto)throws Exception{
SingleResult<String> result = new SingleResult<>();
String userId = getUserId();
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(RandomNumber.getUUid());
exStandard.setExamineId(itemAddBonusDto.getExamineId());
exStandard.setTitle(itemAddBonusDto.getTitle());
exStandard.setSortId(itemAddBonusDto.getSortId());
exStandard.setExamineState(itemAddBonusDto.getExamineState());
exStandard.setItemType(ExItemType.BONUS_POINT.getType());
exStandard.setDelState(DelState.NOT_DEL.getState());
exStandard.setCreateTime(new Date());
exStandard.setModifyTime(new Date());
exStandard.setCreateBy(userId);
exStandard.setModifyBy(userId);
exStandardMapper.insert(exStandard);
if(StringUtils.isNotBlank(itemAddBonusDto.getStandardId())){
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(itemAddBonusDto.getStandardId());
exStandard.setExamineId(itemAddBonusDto.getExamineId());
exStandard.setTitle(itemAddBonusDto.getTitle());
exStandard.setSortId(itemAddBonusDto.getSortId());
exStandard.setExamineState(itemAddBonusDto.getExamineState());
exStandard.setItemType(ExItemType.BONUS_POINT.getType());
exStandard.setModifyTime(new Date());
exStandard.setModifyBy(userId);
exStandardMapper.updateById(exStandard);
}else{
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(RandomNumber.getUUid());
exStandard.setExamineId(itemAddBonusDto.getExamineId());
exStandard.setTitle(itemAddBonusDto.getTitle());
exStandard.setSortId(itemAddBonusDto.getSortId());
exStandard.setExamineState(itemAddBonusDto.getExamineState());
exStandard.setItemType(ExItemType.BONUS_POINT.getType());
exStandard.setDelState(DelState.NOT_DEL.getState());
exStandard.setCreateTime(new Date());
exStandard.setModifyTime(new Date());
exStandard.setCreateBy(userId);
exStandard.setModifyBy(userId);
exStandardMapper.insert(exStandard);
}
return result;
}
@ -232,21 +265,36 @@ public class ExamineController extends BaseController{
SingleResult<String> result = new SingleResult<>();
String userId = getUserId();
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(RandomNumber.getUUid());
exStandard.setExamineId(itemAddSpecificDto.getExamineId());
exStandard.setTitle(itemAddSpecificDto.getTitle());
exStandard.setSortId(itemAddSpecificDto.getSortId());
exStandard.setExamineState(itemAddSpecificDto.getExamineState());
exStandard.setScore(itemAddSpecificDto.getScore());
exStandard.setPerformId(itemAddSpecificDto.getListperformid());
exStandard.setItemType(ExItemType.PERSONALITY.getType());
exStandard.setDelState(DelState.NOT_DEL.getState());
exStandard.setCreateTime(new Date());
exStandard.setModifyTime(new Date());
exStandard.setCreateBy(userId);
exStandard.setModifyBy(userId);
exStandardMapper.insert(exStandard);
if(StringUtils.isNotBlank(itemAddSpecificDto.getStandardId())){
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(itemAddSpecificDto.getStandardId());
exStandard.setExamineId(itemAddSpecificDto.getExamineId());
exStandard.setTitle(itemAddSpecificDto.getTitle());
exStandard.setSortId(itemAddSpecificDto.getSortId());
exStandard.setExamineState(itemAddSpecificDto.getExamineState());
exStandard.setScore(itemAddSpecificDto.getScore());
exStandard.setPerformId(itemAddSpecificDto.getListperformid());
exStandard.setItemType(ExItemType.PERSONALITY.getType());
exStandard.setModifyTime(new Date());
exStandard.setModifyBy(userId);
exStandardMapper.updateById(exStandard);
}else{
ExStandard exStandard = new ExStandard();
exStandard.setStandardId(RandomNumber.getUUid());
exStandard.setExamineId(itemAddSpecificDto.getExamineId());
exStandard.setTitle(itemAddSpecificDto.getTitle());
exStandard.setSortId(itemAddSpecificDto.getSortId());
exStandard.setExamineState(itemAddSpecificDto.getExamineState());
exStandard.setScore(itemAddSpecificDto.getScore());
exStandard.setPerformId(itemAddSpecificDto.getListperformid());
exStandard.setItemType(ExItemType.PERSONALITY.getType());
exStandard.setDelState(DelState.NOT_DEL.getState());
exStandard.setCreateTime(new Date());
exStandard.setModifyTime(new Date());
exStandard.setCreateBy(userId);
exStandard.setModifyBy(userId);
exStandardMapper.insert(exStandard);
}
return result;
}