Commit b5f747fb authored by ww-xxy's avatar ww-xxy
parents 0e4e46b7 c6e202a8
......@@ -182,7 +182,6 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
model.put(PAGEINFO_KEY, pageInfo);
}
public static void main(String[] args) {
}
......
......@@ -11,7 +11,8 @@ import java.util.Map;
public enum SubMethodEnum {
系统自动(1, "系统自动"),
人工添加(2, "人工添加"),
大厅巡查(3, "大厅巡查");
大厅巡查(3, "大厅巡查"),
申诉冲销(4, "申诉冲销");
private Integer value;
private String desc;
......
......@@ -110,7 +110,7 @@ public class CheckAttendRecordEntity extends CheckAttendRecordVo {
*/
private Integer checkStatus;
/**
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查,4.申诉冲销)
*/
private Integer subMethod;
/**
......
package com.mortals.xhx.module.perform.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.dao.PerformAttendAppealDao;
/**
* PerformAttendAppealService
*
* 绩效记录申诉信息 service接口
*
* @author zxfei
* @date 2023-07-12
*/
public interface PerformAttendAppealService extends ICRUDService<PerformAttendAppealEntity,Long>{
* PerformAttendAppealService
* <p>
* 绩效记录申诉信息 service接口
*
* @author zxfei
* @date 2023-07-12
*/
public interface PerformAttendAppealService extends ICRUDService<PerformAttendAppealEntity, Long> {
PerformAttendAppealDao getDao();
Rest<Void> audit(PerformAttendAppealEntity appeal, Context context);
}
\ No newline at end of file
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
......@@ -11,27 +18,140 @@ import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesQuery;
import com.mortals.xhx.module.perform.service.PerformAttendAppealFilesService;
import org.springframework.util.ObjectUtils;
import java.util.Date;
import java.util.Arrays;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
/**
* PerformAttendAppealService
* 绩效记录申诉信息 service实现
*
* @author zxfei
* @date 2023-07-12
*/
* PerformAttendAppealService
* 绩效记录申诉信息 service实现
*
* @author zxfei
* @date 2023-07-12
*/
@Service("performAttendAppealService")
@Slf4j
public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<PerformAttendAppealDao, PerformAttendAppealEntity, Long> implements PerformAttendAppealService {
@Autowired
private CheckAttendRecordService checkAttendRecordService;
@Autowired
private CheckReviewRecordService checkReviewRecordService;
@Autowired
private CheckComplainRecordService checkComplainRecordService;
@Autowired
private CheckEffectRecordService checkEffectRecordService;
@Autowired
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
@Autowired
private PerformAttendAppealFilesService performAttendAppealFilesService;
@Override
public Rest<Void> audit(PerformAttendAppealEntity appeal, Context context) {
PerformAttendAppealEntity appealEntity = this.get(appeal.getId(), context);
if (appealEntity.getProcessStatus() == ProcessStatusEnum.已处理.getValue()) {
throw new AppException("当前申诉已审核!");
}
appealEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
appealEntity.setAppealDesc(appeal.getAppealDesc());
appealEntity.setAppealResult(appeal.getAppealResult());
appealEntity.setAppealTime(new Date());
appealEntity.setUpdateUserId(context.getUser().getId());
appealEntity.setUpdateTime(new Date());
this.getDao().update(appealEntity);
String appealMsg = "申诉成功,返回所扣分数,申诉ID:" + appeal.getId().toString();
if (appeal.getAppealResult() == AppealResultEnum.通过.getValue()) {
if (appeal.getSubAddType() == SubAddTypeEnum.扣除.getValue()) {
//需增一条记录后 冲销相关核查的记录
if (PerformTypeEnum.考勤绩效.getValue().equals(appeal.getPerformType())) {
CheckAttendRecordEntity checkEntity = checkAttendRecordService.get(appeal.getId(), context);
CheckAttendRecordEntity checkAttendRecordEntity = new CheckAttendRecordEntity();
checkAttendRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkAttendRecordEntity, new String[]{"id", "recordId"});
checkAttendRecordEntity.setSubAddType(SubAddTypeEnum.增加.getValue());
checkAttendRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue());
checkAttendRecordEntity.setRemark(appealMsg);
checkAttendRecordService.save(checkAttendRecordEntity, context);
} else if (PerformTypeEnum.评价差评绩效.getValue().equals(appeal.getPerformType())) {
CheckReviewRecordEntity checkEntity = checkReviewRecordService.get(appeal.getId(), context);
CheckReviewRecordEntity checkRecordEntity = new CheckReviewRecordEntity();
checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
checkRecordEntity.setSubAddType(SubAddTypeEnum.增加.getValue());
checkRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue());
checkRecordEntity.setRemark(appealMsg);
checkRecordEntity.setCreateTime(new Date());
checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkReviewRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.评价投诉绩效.getValue().equals(appeal.getPerformType())) {
CheckComplainRecordEntity checkEntity = checkComplainRecordService.get(appeal.getId(), context);
CheckComplainRecordEntity checkRecordEntity = new CheckComplainRecordEntity();
checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
checkRecordEntity.setSubAddType(SubAddTypeEnum.增加.getValue());
checkRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue());
checkRecordEntity.setRemark(appealMsg);
checkRecordEntity.setCreateTime(new Date());
checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkComplainRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.办件绩效.getValue().equals(appeal.getPerformType())) {
CheckGoworkRecordEntity checkEntity = checkGoworkRecordService.get(appeal.getId(), context);
CheckGoworkRecordEntity checkRecordEntity = new CheckGoworkRecordEntity();
checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
checkRecordEntity.setSubAddType(SubAddTypeEnum.增加.getValue());
checkRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue());
checkRecordEntity.setRemark(appealMsg);
checkRecordEntity.setCreateTime(new Date());
checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkGoworkRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.效能绩效.getValue().equals(appeal.getPerformType())) {
CheckEffectRecordEntity checkEntity = checkEffectRecordService.get(appeal.getId(), context);
CheckEffectRecordEntity checkRecordEntity = new CheckEffectRecordEntity();
checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
checkRecordEntity.setSubAddType(SubAddTypeEnum.增加.getValue());
checkRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue());
checkRecordEntity.setRemark(appealMsg);
checkRecordEntity.setCreateTime(new Date());
checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkEffectRecordService.save(checkRecordEntity, context);
} else if (PerformTypeEnum.其它绩效.getValue().equals(appeal.getPerformType())) {
CheckOtherRecordEntity checkEntity = checkOtherRecordService.get(appeal.getId(), context);
CheckOtherRecordEntity checkRecordEntity = new CheckOtherRecordEntity();
checkRecordEntity.initAttrValue();
BeanUtils.copyProperties(checkEntity, checkRecordEntity, new String[]{"id", "recordId"});
checkRecordEntity.setSubAddType(SubAddTypeEnum.增加.getValue());
checkRecordEntity.setSubMethod(SubMethodEnum.申诉冲销.getValue());
checkRecordEntity.setRemark(appealMsg);
checkRecordEntity.setCreateTime(new Date());
checkRecordEntity.setCreateUserId(this.getContextUserId(context));
checkOtherRecordService.save(checkRecordEntity, context);
}
}
}
return Rest.ok();
}
@Override
protected void saveAfter(PerformAttendAppealEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getPerformAttendAppealFilesList())){
entity.getPerformAttendAppealFilesList().stream().peek(item->{
if (!ObjectUtils.isEmpty(entity.getPerformAttendAppealFilesList())) {
entity.getPerformAttendAppealFilesList().stream().peek(item -> {
item.setAppealId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
......@@ -43,10 +163,10 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
@Override
protected void updateAfter(PerformAttendAppealEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getPerformAttendAppealFilesList())){
if (!ObjectUtils.isEmpty(entity.getPerformAttendAppealFilesList())) {
Long[] performAttendAppealFilesIds = performAttendAppealFilesService.find(new PerformAttendAppealFilesQuery().appealId(entity.getId())).stream().map(PerformAttendAppealFilesEntity::getId).toArray(Long[]::new);
performAttendAppealFilesService.remove(performAttendAppealFilesIds,context);
entity.getPerformAttendAppealFilesList().stream().peek(item ->{
performAttendAppealFilesService.remove(performAttendAppealFilesIds, context);
entity.getPerformAttendAppealFilesList().stream().peek(item -> {
item.setAppealId(entity.getId());
item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date());
......@@ -61,7 +181,8 @@ public class PerformAttendAppealServiceImpl extends AbstractCRUDServiceImpl<Perf
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<PerformAttendAppealFilesEntity> performAttendAppealFileslist = performAttendAppealFilesService.find(new PerformAttendAppealFilesQuery().appealIdList(Arrays.asList(ids)));
performAttendAppealFilesService.removeList(performAttendAppealFileslist,context);
performAttendAppealFilesService.removeList(performAttendAppealFileslist, context);
super.removeAfter(ids, context, result);
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.web;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
import com.mortals.xhx.module.perform.service.PerformAttendAppealService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 绩效记录申诉信息
*
* @author zxfei
* @date 2023-07-12
*/
* 绩效记录申诉信息
*
* @author zxfei
* @date 2023-07-12
*/
@RestController
@RequestMapping("perform/attend/appeal")
public class PerformAttendAppealController extends BaseCRUDJsonBodyMappingController<PerformAttendAppealService,PerformAttendAppealEntity,Long> {
public class PerformAttendAppealController extends BaseCRUDJsonBodyMappingController<PerformAttendAppealService, PerformAttendAppealEntity, Long> {
@Autowired
private ParamService paramService;
public PerformAttendAppealController(){
super.setModuleDesc( "绩效记录申诉信息");
public PerformAttendAppealController() {
super.setModuleDesc("绩效记录申诉信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "subMethod", paramService.getParamBySecondOrganize("PerformAttendAppeal","subMethod"));
this.addDict(model, "subAddType", paramService.getParamBySecondOrganize("PerformAttendAppeal","subAddType"));
this.addDict(model, "processStatus", paramService.getParamBySecondOrganize("PerformAttendAppeal","processStatus"));
this.addDict(model, "appealResult", paramService.getParamBySecondOrganize("PerformAttendAppeal","appealResult"));
this.addDict(model, "reviewResult", paramService.getParamBySecondOrganize("PerformAttendAppeal","reviewResult"));
this.addDict(model, "reviewSource", paramService.getParamBySecondOrganize("PerformAttendAppeal","reviewSource"));
this.addDict(model, "irregularType", paramService.getParamBySecondOrganize("PerformAttendAppeal","irregularType"));
this.addDict(model, "irregularOtherType", paramService.getParamBySecondOrganize("PerformAttendAppeal","irregularOtherType"));
this.addDict(model, "subMethod", paramService.getParamBySecondOrganize("PerformAttendAppeal", "subMethod"));
this.addDict(model, "subAddType", paramService.getParamBySecondOrganize("PerformAttendAppeal", "subAddType"));
this.addDict(model, "processStatus", paramService.getParamBySecondOrganize("PerformAttendAppeal", "processStatus"));
this.addDict(model, "appealResult", paramService.getParamBySecondOrganize("PerformAttendAppeal", "appealResult"));
this.addDict(model, "reviewResult", paramService.getParamBySecondOrganize("PerformAttendAppeal", "reviewResult"));
this.addDict(model, "reviewSource", paramService.getParamBySecondOrganize("PerformAttendAppeal", "reviewSource"));
this.addDict(model, "irregularType", paramService.getParamBySecondOrganize("PerformAttendAppeal", "irregularType"));
this.addDict(model, "irregularOtherType", paramService.getParamBySecondOrganize("PerformAttendAppeal", "irregularOtherType"));
super.init(model, context);
}
/**
* 申诉审核
*/
@PostMapping(value = "audit")
public String appealAudit(@RequestBody PerformAttendAppealEntity appeal) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = this.getModuleDesc() + "审核";
try {
Rest<Void> audit = this.service.audit(appeal, getContext());
if (audit.getCode() == YesNoEnum.NO.getValue()) {
throw new AppException("申诉审核异常!");
}
recordSysLog(request, busiDesc + " 【成功】");
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} catch (Exception e) {
log.error("申诉审核", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
}
\ No newline at end of file
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