Commit 9bb74348 authored by 廖旭伟's avatar 廖旭伟

添加绩效异常信息表

parent 4f7225d0
package com.mortals.xhx.module.perform.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import java.util.List;
/**
* 绩效异常信息Dao
* 绩效异常信息 DAO接口
*
* @author zxfei
* @date 2024-04-28
*/
public interface PerformErrorMessageDao extends ICRUDDao<PerformErrorMessageEntity,Long>{
}
package com.mortals.xhx.module.perform.dao.ibatis;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import com.mortals.xhx.module.perform.dao.PerformErrorMessageDao;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import org.springframework.stereotype.Repository;
/**
* 绩效异常信息DaoImpl DAO接口
*
* @author zxfei
* @date 2024-04-28
*/
@Repository("performErrorMessageDao")
public class PerformErrorMessageDaoImpl extends BaseCRUDDaoMybatis<PerformErrorMessageEntity,Long> implements PerformErrorMessageDao {
}
package com.mortals.xhx.module.perform.model;
import com.mortals.xhx.module.perform.model.vo.PerformErrorMessageVo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 绩效异常信息实体对象
*
* @author zxfei
* @date 2024-04-28
*/
@Data
public class PerformErrorMessageEntity extends PerformErrorMessageVo {
private static final long serialVersionUID = 1L;
/**
* 核查记录Id
*/
private Long checkRecordId;
/**
* 部门id号
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 所属大厅
*/
private Long salaId;
/**
* 所属大厅名称
*/
private String salaName;
/**
* 绩效责任人id
*/
private Long staffId;
/**
* 绩效负责人名称
*/
private String staffName;
/**
* 工号
*/
private String workNum;
/**
* 异常时间
*/
private Date errorTime;
/**
* 绩效规则id
*/
private Long ruleId;
/**
* 规则名称
*/
private String ruleName;
/**
* 增减类型(1.增加,2.扣除)
*/
private Integer subAddType;
/**
* 扣分或增加分值
*/
private BigDecimal score;
/**
* 阅读状态0未读1已读
*/
private Integer readStatus;
/**
* 核查处理状态1.未处理,2.已处理
*/
private Integer checkStatus;
/**
* 申述状态(-1未申诉,0,申述中1.通过,2.不通过)
*/
private Integer appealStatus;
/**
* 备注
*/
private String remark;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof PerformErrorMessageEntity) {
PerformErrorMessageEntity tmp = (PerformErrorMessageEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.checkRecordId = null;
this.deptId = null;
this.deptName = "";
this.salaId = null;
this.salaName = "";
this.staffId = null;
this.staffName = "";
this.workNum = "";
this.errorTime = new Date();
this.ruleId = null;
this.ruleName = "";
this.subAddType = 1;
this.score = BigDecimal.ZERO;
this.readStatus = 0;
this.checkStatus = 0;
this.appealStatus = -1;
this.remark = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 绩效异常信息视图对象
*
* @author zxfei
* @date 2024-04-28
*/
@Data
public class PerformErrorMessageVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.perform.model.vo;
import lombok.Data;
@Data
public class StaffErrorMessageVo {
/**
* 部门id号
*/
private Long deptId;
/**
* 部门名称
*/
private String deptName;
/**
* 所属大厅
*/
private Long salaId;
/**
* 所属大厅名称
*/
private String salaName;
/**
* 绩效责任人id
*/
private Long staffId;
/**
* 绩效负责人名称
*/
private String staffName;
/**
* 工号
*/
private String workNum;
/**
* 未读消息数量
*/
private Integer messageCount;
}
package com.mortals.xhx.module.perform.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import com.mortals.xhx.module.perform.dao.PerformErrorMessageDao;
/**
* PerformErrorMessageService
*
* 绩效异常信息 service接口
*
* @author zxfei
* @date 2024-04-28
*/
public interface PerformErrorMessageService extends ICRUDService<PerformErrorMessageEntity,Long>{
PerformErrorMessageDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.perform.service.impl;
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;
/**
* PerformErrorMessageService
* 绩效异常信息 service实现
*
* @author zxfei
* @date 2024-04-28
*/
@Service("performErrorMessageService")
@Slf4j
public class PerformErrorMessageServiceImpl extends AbstractCRUDServiceImpl<PerformErrorMessageDao, PerformErrorMessageEntity, Long> implements PerformErrorMessageService {
}
\ No newline at end of file
package com.mortals.xhx.module.perform.web;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.AppealStatusEnum;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.SubAddTypeEnum;
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.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
*
* 绩效异常信息
*
* @author zxfei
* @date 2024-04-28
*/
@RestController
@RequestMapping("perform/error/message")
public class PerformErrorMessageController extends BaseCRUDJsonBodyMappingController<PerformErrorMessageService,PerformErrorMessageEntity,Long> {
@Autowired
private ParamService paramService;
public PerformErrorMessageController(){
super.setModuleDesc( "绩效异常信息");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "subAddType", SubAddTypeEnum.getEnumMap());
this.addDict(model, "checkStatus", CheckStatusEnum.getEnumMap());
this.addDict(model, "appealStatus", AppealStatusEnum.getEnumMap());
super.init(model, context);
}
}
\ No newline at end of file
...@@ -4,13 +4,13 @@ import com.mortals.framework.common.Rest; ...@@ -4,13 +4,13 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.common.pdu.window.WindowPdu; import com.mortals.xhx.common.pdu.window.WindowPdu;
import com.mortals.xhx.module.perform.model.vo.StaffErrorMessageVo;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.window.dao.WindowOwnerDao;
import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity; import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity;
import com.mortals.xhx.module.window.model.WindowOwnerEntity; import com.mortals.xhx.module.window.model.WindowOwnerEntity;
import com.mortals.xhx.module.window.dao.WindowOwnerDao;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* WindowOwnerService * WindowOwnerService
...@@ -52,5 +52,5 @@ public interface WindowOwnerService extends ICRUDService<WindowOwnerEntity, Long ...@@ -52,5 +52,5 @@ public interface WindowOwnerService extends ICRUDService<WindowOwnerEntity, Long
* @param id * @param id
* @return * @return
*/ */
List<StaffEntity> getStaffList(Long id); List<StaffErrorMessageVo> getStaffList(Long id);
} }
\ No newline at end of file
...@@ -3,40 +3,43 @@ package com.mortals.xhx.module.window.service.impl; ...@@ -3,40 +3,43 @@ package com.mortals.xhx.module.window.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.window.WindowPdu; import com.mortals.xhx.common.pdu.window.WindowPdu;
import com.mortals.xhx.common.pdu.workman.WorkmanPdu; import com.mortals.xhx.common.pdu.workman.WorkmanPdu;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.feign.window.IWindowFeign; import com.mortals.xhx.feign.window.IWindowFeign;
import com.mortals.xhx.feign.workman.IWorkmanFeign; import com.mortals.xhx.feign.workman.IWorkmanFeign;
import com.mortals.xhx.module.perform.model.PerformErrorMessageEntity;
import com.mortals.xhx.module.perform.model.PerformErrorMessageQuery;
import com.mortals.xhx.module.perform.model.vo.StaffErrorMessageVo;
import com.mortals.xhx.module.perform.service.PerformErrorMessageService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.model.StaffQuery; import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.dao.WindowOwnerDao;
import com.mortals.xhx.module.window.model.*; import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import com.mortals.xhx.module.window.service.WindowOwnerService;
import com.mortals.xhx.module.window.service.WindowPerformService; import com.mortals.xhx.module.window.service.WindowPerformService;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformService; import com.mortals.xhx.module.window.service.WindowWorkmanPerformService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.beans.BeanUtils;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.window.dao.WindowOwnerDao;
import com.mortals.xhx.module.window.service.WindowOwnerService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
/** /**
* WindowOwnerService * WindowOwnerService
* 窗口负责人 service实现 * 窗口负责人 service实现
...@@ -63,6 +66,8 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -63,6 +66,8 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
private UserService userService; private UserService userService;
@Autowired @Autowired
private IWorkmanFeign workmanFeign; private IWorkmanFeign workmanFeign;
@Autowired
private PerformErrorMessageService performErrorMessageService;
@Override @Override
...@@ -319,18 +324,29 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -319,18 +324,29 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
} }
@Override @Override
public List<StaffEntity> getStaffList(Long key) { public List<StaffErrorMessageVo> getStaffList(Long key) {
WindowOwnerEntity entity = this.dao.get(key); WindowOwnerEntity entity = this.dao.get(key);
List<StaffErrorMessageVo> result = new ArrayList<>();
if(entity!=null){ if(entity!=null){
if(StringUtils.isNotEmpty(entity.getStaffIds())){ if(StringUtils.isNotEmpty(entity.getStaffIds())){
List<Long> staffIdList = Arrays.asList(entity.getStaffIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList()); List<Long> staffIdList = Arrays.asList(entity.getStaffIds().split(",")).stream().map(s -> Long.parseLong(s.trim())).collect(Collectors.toList());
List<PerformErrorMessageEntity> errorMessageList = performErrorMessageService.find(new PerformErrorMessageQuery().staffIdList(staffIdList));
Map<Long,List<PerformErrorMessageEntity>> msgMap = errorMessageList.stream().collect(Collectors.groupingBy(PerformErrorMessageEntity::getStaffId));
List<StaffEntity> staffEntityList = staffService.find(new StaffQuery().idList(staffIdList)); List<StaffEntity> staffEntityList = staffService.find(new StaffQuery().idList(staffIdList));
return staffEntityList; for(StaffEntity staffEntity:staffEntityList){
}else { StaffErrorMessageVo vo = new StaffErrorMessageVo();
return Collections.emptyList(); BeanUtils.copyProperties(staffEntity, vo, BeanUtil.getNullPropertyNames(staffEntity));
vo.setStaffId(staffEntity.getId());
vo.setStaffName(staffEntity.getName());
if(msgMap.containsKey(staffEntity.getId())){
vo.setMessageCount(msgMap.get(staffEntity.getId()).size());
}else {
vo.setMessageCount(0);
}
result.add(vo);
}
} }
}else {
return Collections.emptyList();
} }
return result;
} }
} }
\ No newline at end of file
...@@ -20,6 +20,7 @@ import com.mortals.xhx.feign.site.ISiteHallFeign; ...@@ -20,6 +20,7 @@ import com.mortals.xhx.feign.site.ISiteHallFeign;
import com.mortals.xhx.feign.window.IWindowFeign; import com.mortals.xhx.feign.window.IWindowFeign;
import com.mortals.xhx.module.dept.model.DeptQuery; import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.perform.model.vo.StaffErrorMessageVo;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity; import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -207,14 +208,14 @@ public class WindowOwnerController extends BaseCRUDJsonBodyMappingController<Win ...@@ -207,14 +208,14 @@ public class WindowOwnerController extends BaseCRUDJsonBodyMappingController<Win
*/ */
@PostMapping(value = "staffList") @PostMapping(value = "staffList")
@UnAuth @UnAuth
public Rest<List<StaffEntity>> staffList(@RequestBody WindowOwnerEntity query){ public Rest<List<StaffErrorMessageVo>> staffList(@RequestBody WindowOwnerEntity query){
Rest<List<StaffEntity>> ret = new Rest(); Rest<List<StaffErrorMessageVo>> ret = new Rest();
String busiDesc = "查询当前负责人负责的人员列表" + this.getModuleDesc(); String busiDesc = "查询当前负责人负责的人员列表" + this.getModuleDesc();
Context context = this.getContext(); Context context = this.getContext();
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
int code = 1; int code = 1;
try { try {
List<StaffEntity> result = this.getService().getStaffList(query.getId()); List<StaffErrorMessageVo> result = this.getService().getStaffList(query.getId());
ret.setData(result); ret.setData(result);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】"); this.recordSysLog(this.request, busiDesc + " 【成功】");
......
...@@ -1284,4 +1284,36 @@ PRIMARY KEY (`id`) ...@@ -1284,4 +1284,36 @@ PRIMARY KEY (`id`)
-- ---------------------------- -- ----------------------------
ALTER TABLE `mortals_xhx_window_owner` ADD COLUMN `roleType` tinyint(2) COMMENT '角色类型(首席代表,运维,审核,其他)' AFTER `remark`, ALTER TABLE `mortals_xhx_window_owner` ADD COLUMN `roleType` tinyint(2) COMMENT '角色类型(首席代表,运维,审核,其他)' AFTER `remark`,
ADD COLUMN `inspect` tinyint(2) DEFAULT '0' COMMENT '是否允许巡检' AFTER `roleType`, ADD COLUMN `inspect` tinyint(2) DEFAULT '0' COMMENT '是否允许巡检' AFTER `roleType`,
ADD COLUMN `staffIds` varchar(255) COMMENT '管辖人员' AFTER `inspect`; ADD COLUMN `staffIds` varchar(255) COMMENT '管辖人员' AFTER `inspect`;
\ No newline at end of file -- ----------------------------
2024-04-28
-- ----------------------------
-- ----------------------------
-- 绩效异常信息表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_perform_error_message`;
CREATE TABLE mortals_xhx_perform_error_message(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`checkRecordId` bigint(20) COMMENT '核查记录Id',
`deptId` bigint(20) DEFAULT '0' COMMENT '部门id号',
`deptName` varchar(64) COMMENT '部门名称',
`salaId` bigint(20) COMMENT '所属大厅',
`salaName` varchar(128) COMMENT '所属大厅名称',
`staffId` bigint(20) COMMENT '绩效责任人id',
`staffName` varchar(64) COMMENT '绩效负责人名称',
`workNum` varchar(64) COMMENT '工号',
`errorTime` datetime COMMENT '异常时间',
`ruleId` bigint(20) COMMENT '绩效规则id',
`ruleName` varchar(128) COMMENT '规则名称',
`subAddType` tinyint(1) DEFAULT '1' COMMENT '增减类型(1.增加,2.扣除)',
`score` decimal(10,2) DEFAULT '0.00' COMMENT '扣分或增加分值',
`readStatus` tinyint(1) DEFAULT '0' COMMENT '阅读状态0未读1已读',
`checkStatus` tinyint(1) DEFAULT '0' COMMENT '核查处理状态1.未处理,2.已处理',
`appealStatus` tinyint(1) DEFAULT '0' COMMENT '申诉状态(0.未申诉,1.申诉中,2.申诉拒绝,3.申诉通过)',
`remark` varchar(255) COMMENT '备注',
`createTime` datetime COMMENT '创建时间',
`createUserId` bigint(20) COMMENT '创建用户',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '修改时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='绩效异常信息';
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