Commit e79fb360 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 883f241a 7b729d39
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
/***
* 核查类型枚举(1.考勤绩效,2.效能绩效,3.评价绩效,4.办件绩效,5.评价差评绩效,6.其它绩效)
*/
public enum CheckTypeEnum {
考勤绩效(1, "考勤绩效"),
效能绩效(2, "效能绩效"),
评价绩效(3, "评价绩效"),
办件绩效(4, "办件绩效"),
差评绩效(5, "差评绩效"),
其它绩效(6, "其它绩效"),
;
private Integer value;
private String desc;
CheckTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static CheckTypeEnum getByValue(Integer value) {
for (CheckTypeEnum checkTypeEnum : CheckTypeEnum.values()) {
if (checkTypeEnum.getValue() == value) {
return checkTypeEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (CheckTypeEnum item : CheckTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
package com.mortals.xhx.module.check.dao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import java.util.List;
/**
* 全部类型核查信息Dao
*/
public interface CheckAllRecordDao {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query);
}
package com.mortals.xhx.module.check.dao.ibatis;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* 全部类型核查信息Dao
*/
@Repository("checkAllRecordDao")
public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements CheckAllRecordDao {
protected String namespace = this.getClass().getName();
@Autowired
public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
super.setSqlSessionFactory(sqlSessionFactory);
}
protected String getSqlId(String id) {
return this.namespace + "." + id;
}
@Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) {
return this.getSqlSession().selectList(this.getSqlId("getList"), query);
}
}
package com.mortals.xhx.module.check.model;
import lombok.Data;
@Data
public class CheckAllRecordQuery {
/**
* 员工ID
*/
private Long staffId;
/**
* 处理状态(1.未处理,2.已处理)
*/
private Integer checkStatus;
private String createTimeStart;
private String createTimeEnd;
private Long createUserId;
}
package com.mortals.xhx.module.check.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 全部类型核查信息视图对象
*/
@Data
public class CheckAllRecordVo extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 记录ID
*/
private Long recordId;
/**
* 员工ID
*/
private Long staffId;
/**
* 员工姓名
*/
private String staffName;
/**
* 工号
*/
private String workNum;
/**
* 所属部门
*/
private Long deptId;
/**
* 所属部门名称
*/
private String deptName;
/**
* 绩效规则id
*/
private Long ruleId;
/**
* 规则名称
*/
private String ruleName;
/**
* 增减类型(1.增加,2.扣除)
*/
private Integer subAddType;
/**
* 扣分或增加分值
*/
private BigDecimal score;
/**
* 核查时间
*/
private Date checkTime;
/**
* 扣分方式(1.系统自动,2.人工添加,3.大厅巡查)
*/
private Integer subMethod;
/**
* 扣分时间
*/
private Date deductTime;
/**
* 核查类型(1.考勤绩效,2.效能绩效,3.评价绩效,4.办件绩效,5.评价差评绩效,6.其它绩效)
*/
private Integer checkType;
}
package com.mortals.xhx.module.check.service;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import java.util.List;
/**
* 全部类型核查信息Dao
*/
public interface CheckAllRecordService {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query);
}
package com.mortals.xhx.module.check.service.impl;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.service.CheckAllRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("checkAllRecordService")
@Slf4j
public class CheckAllRecordServiceImpl implements CheckAllRecordService {
@Autowired
private CheckAllRecordDao checkAllRecordDao;
@Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) {
return checkAllRecordDao.getAllCheckRecord(query);
}
}
package com.mortals.xhx.module.check.web;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.CheckTypeEnum;
import com.mortals.xhx.common.code.SubAddTypeEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import com.mortals.xhx.module.check.service.CheckAllRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 全部类型核查信息Dao
*/
@RestController
@RequestMapping("check/all/record")
public class CheckAllRecordController extends BaseJsonBodyController {
@Autowired
private CheckAllRecordService checkAllRecordService;
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "checkStatus", CheckStatusEnum.getEnumMap());
this.addDict(model, "subMethod", SubMethodEnum.getEnumMap());
this.addDict(model, "subAddType", SubAddTypeEnum.getEnumMap());
this.addDict(model, "checkType", CheckTypeEnum.getEnumMap());
}
@PostMapping({"list"})
@UnAuth
public Rest<Object> list(@RequestBody CheckAllRecordQuery query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "查询所以类型绩效核查信息";
int code=1;
try {
List<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query);
model.put("data", result);
model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
this.recordSysLog(this.request, busiDesc + " 【成功】");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
this.init(model, context);
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.check.dao.ibatis.CheckAllRecordDaoImpl">
<select id="getList" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="com.mortals.xhx.module.check.model.vo.CheckAllRecordVo">
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,2 AS checkType FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,3 AS checkType FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,4 AS checkType FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,5 AS checkType FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if>
UNION
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,2 AS subAddType,score,subMethod,checkTime,createTime AS deductTime,6 AS checkType FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkStatus != null and !checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="staffId != null and !staffId!=''"> AND staffId = #{staffId} </if>
<if test="createTimeStart != null and !createTimeStart!=''"> AND createTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{createTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createTimeEnd != null and !createTimeEnd!=''"> AND createTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{createTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and !createUserId!=''"> AND createUserId = #{createUserId} </if>
</select>
</mapper>
\ 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