Commit bffd0739 authored by 廖旭伟's avatar 廖旭伟

绩效异常信息已读处理

parent 9097aefb
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.perform.dao.PerformErrorMessageDao;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import com.mortals.xhx.module.perform.service.PerformErrorMessageService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* PerformErrorMessageService
* 绩效异常信息 service实现
......@@ -16,5 +21,19 @@ import org.springframework.stereotype.Service;
@Service("performErrorMessageService")
@Slf4j
public class PerformErrorMessageServiceImpl extends AbstractCRUDServiceImpl<PerformErrorMessageDao, PerformErrorMessageEntity, Long> implements PerformErrorMessageService {
public PerformErrorMessageEntity get(Long key, Context context) throws AppException {
PerformErrorMessageEntity entity = this.dao.get(key);
if(context!=null && entity!=null){
Long staffId = context.getUser().getCustomerId();
if(staffId!=null && staffId==entity.getStaffId()){
PerformErrorMessageEntity update = new PerformErrorMessageEntity();
update.setId(entity.getId());
update.setUpdateTime(new Date());
update.setReadStatus(1);
this.dao.update(update);
}
}
return entity;
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
......@@ -7,10 +9,14 @@ import com.mortals.xhx.common.code.AppealStatusEnum;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.PerformTypeEnum;
import com.mortals.xhx.common.code.SubAddTypeEnum;
import com.mortals.xhx.module.check.model.*;
import com.mortals.xhx.module.check.service.*;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import com.mortals.xhx.module.perform.service.PerformErrorMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
......@@ -28,6 +34,18 @@ public class PerformErrorMessageController extends BaseCRUDJsonBodyMappingContro
@Autowired
private ParamService paramService;
@Autowired
private CheckAttendRecordService checkAttendRecordService;
@Autowired
private CheckEffectRecordService checkEffectRecordService;
@Autowired
private CheckGoworkRecordService checkGoworkRecordService;
@Autowired
private CheckReviewRecordService checkReviewRecordService;
@Autowired
private CheckComplainRecordService checkComplainRecordService;
@Autowired
private CheckOtherRecordService checkOtherRecordService;
public PerformErrorMessageController(){
super.setModuleDesc( "绩效异常信息");
......@@ -39,8 +57,71 @@ public class PerformErrorMessageController extends BaseCRUDJsonBodyMappingContro
this.addDict(model, "checkStatus", CheckStatusEnum.getEnumMap());
this.addDict(model, "appealStatus", AppealStatusEnum.getEnumMap());
this.addDict(model, "performType", PerformTypeEnum.getEnumMap(PerformTypeEnum.全部.getValue()));
Map<String, String> data = new HashMap<>();
data.put("0","未读");
data.put("1","已读");
this.addDict(model, "readStatus", data);
super.init(model, context);
}
@RequestMapping(value = {"info"},method = {RequestMethod.POST, RequestMethod.GET})
@UnAuth
@Override
public String info(Long id) {
Map<String, Object> model = new HashMap();
if (id == null) {
return this.createFailJsonResp("请选择待查看" + this.getModuleDesc() + "信息");
} else {
JSONObject ret = new JSONObject();
String busiDesc = "查看" + this.getModuleDesc();
Context context = this.getContext();
try {
this.infoBefore(id, model, context);
PerformErrorMessageEntity entity = this.service.get(id, context);
this.infoAfter(id, model, entity, context);
if (entity == null) {
throw new Exception(busiDesc + ",不存在或已被删除");
}
ret.put("data", entity);
if(entity.getPerformType().equals(PerformTypeEnum.考勤绩效.getValue())){
CheckAttendRecordEntity checkAttendRecordEntity = checkAttendRecordService.get(entity.getCheckRecordId());
ret.put("checkRecordData", checkAttendRecordEntity);
}
if(entity.getPerformType().equals(PerformTypeEnum.效能绩效.getValue())){
CheckEffectRecordEntity checkEffectRecordEntity = checkEffectRecordService.get(entity.getCheckRecordId());
ret.put("checkRecordData", checkEffectRecordEntity);
}
if(entity.getPerformType().equals(PerformTypeEnum.办件绩效.getValue())){
CheckGoworkRecordEntity checkGoworkRecordEntity = checkGoworkRecordService.get(entity.getCheckRecordId());
ret.put("checkRecordData", checkGoworkRecordEntity);
}
if(entity.getPerformType().equals(PerformTypeEnum.评价差评绩效.getValue())){
CheckReviewRecordEntity checkReviewRecordEntity = checkReviewRecordService.get(entity.getCheckRecordId());
ret.put("checkRecordData", checkReviewRecordEntity);
}
if(entity.getPerformType().equals(PerformTypeEnum.评价投诉绩效.getValue())){
CheckComplainRecordEntity checkComplainRecordEntity = checkComplainRecordService.get(entity.getCheckRecordId());
ret.put("checkRecordData", checkComplainRecordEntity);
}
if(entity.getPerformType().equals(PerformTypeEnum.其它绩效.getValue())){
CheckOtherRecordEntity checkOtherRecordEntity = checkOtherRecordService.get(entity.getCheckRecordId());
ret.put("checkRecordData", checkOtherRecordEntity);
}
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var8) {
this.doException(this.request, busiDesc, model, var8);
Object msg = model.get("message_info");
return this.createFailJsonResp(msg == null ? "系统异常" : msg.toString());
}
this.init(model, context);
ret.put("code", 1);
ret.put("msg", model.remove("message_info"));
ret.put("dict", model.remove("dict"));
return ret.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