Commit 0cac0506 authored by 赵啸非's avatar 赵啸非

添加钉钉接口相关

parent 99cc36d4
...@@ -9,18 +9,11 @@ public class RedisKey { ...@@ -9,18 +9,11 @@ public class RedisKey {
* 登录 key * 登录 key
*/ */
public static final String KEY_MENU_CACHE = "iot:base:MenuCacheKey:"; public static final String KEY_MENU_CACHE = "iot:base:MenuCacheKey:";
/**
* 设备心跳上报
*/
public static final String KEY_DEVICE_ONLINE_CACHE = "device:online:";
public static final String KEY_SITE_CACHE = "siteDict";
public static final String KEY_PLATFORM_CACHE = "platformDict"; /**
* 钉钉 访问token
public static final String KEY_PRODUCT_CACHE = "productDict"; */
public static final String KEY_DINGTALK_ACCESSTOKEN_CACHE = "dingtalk:token:";
public static final String KEY_TOKEN_API_CACHE = "token:api:";
} }
...@@ -83,9 +83,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR ...@@ -83,9 +83,9 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
msg.setMsgtype("link"); msg.setMsgtype("link");
Link link = new Link(); Link link = new Link();
link.setPicUrl("测试图片链接"); link.setPicUrl("测试图片链接");
link.setMessageUrl("测试消息链接"); link.setMessageUrl("http://www.baidu.com");
link.setText("测试文本"); link.setText("你有一条绩效考核核查通知,请及时查看!");
link.setTitle("测试标题"); link.setTitle("绩效考核核查通知");
msg.setLink(link); msg.setLink(link);
workMsgReq.setUseridList(personRest.getMsg()); workMsgReq.setUseridList(personRest.getMsg());
......
...@@ -7,9 +7,12 @@ import com.dingtalk.api.response.OapiGettokenResponse; ...@@ -7,9 +7,12 @@ import com.dingtalk.api.response.OapiGettokenResponse;
import com.hikvision.artemis.sdk.config.ArtemisConfig; import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.ICacheService;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.ApiRespPdu; import com.mortals.xhx.common.pdu.ApiRespPdu;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService; import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -32,7 +35,7 @@ public abstract class AbstractDingTalkService implements IDingPersonService { ...@@ -32,7 +35,7 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
protected Long agentId; protected Long agentId;
/** /**
* AgentId * domain
*/ */
@Value("${dingtalk.domain:https://oapi.dingtalk.com}") @Value("${dingtalk.domain:https://oapi.dingtalk.com}")
protected String domain; protected String domain;
...@@ -49,43 +52,38 @@ public abstract class AbstractDingTalkService implements IDingPersonService { ...@@ -49,43 +52,38 @@ public abstract class AbstractDingTalkService implements IDingPersonService {
@Value("${dingtalk.AppSecret:''}") @Value("${dingtalk.AppSecret:''}")
protected String appSecret; protected String appSecret;
/** @Autowired
* getToken private ICacheService cacheService;
*/
@Value("${dingtalk.gettoken:https://oapi.dingtalk.com/gettoken}")
protected String getTokneUrl;
protected String dingToken;
protected DingTalkClient getDingTalkClient(String path) { protected DingTalkClient getDingTalkClient(String path) {
DingTalkClient client = new DefaultDingTalkClient(domain + path); DingTalkClient client = new DefaultDingTalkClient(domain + path);
return client; return client;
} }
protected void checkToken() {
if (ObjectUtils.isEmpty(dingToken)) {
dingToken = getToken().getData();
}
}
@Override @Override
public Rest<String> getToken() { public String getToken() {
try { try {
String dingToken = cacheService.get(RedisKey.KEY_DINGTALK_ACCESSTOKEN_CACHE);
if (ObjectUtils.isEmpty(dingToken)) {
DingTalkClient client = getDingTalkClient("/gettoken"); DingTalkClient client = getDingTalkClient("/gettoken");
OapiGettokenRequest req = new OapiGettokenRequest(); OapiGettokenRequest req = new OapiGettokenRequest();
req.setAppkey(appKey); req.setAppkey(appKey);
req.setAppsecret(appSecret); req.setAppsecret(appSecret);
OapiGettokenResponse rsp = client.execute(req); OapiGettokenResponse rsp = client.execute(req);
log.info("OapiGettokenResponse:{}",rsp.getBody()); log.info("OapiGettokenResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) { if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getAccessToken()); cacheService.setex(RedisKey.KEY_DINGTALK_ACCESSTOKEN_CACHE, rsp.getAccessToken(), 4800);
return rsp.getAccessToken();
} else { } else {
throw new AppException(rsp.getMessage()); throw new AppException(String.format("code:{},errorMsg:{}", rsp.getErrcode(), rsp.getErrmsg()));
}
} else {
return dingToken;
} }
} catch (Exception e) { } catch (Exception e) {
log.error("获取TOKEN异常", e); log.error("获取TOKEN异常", e);
return Rest.fail(e.getMessage()); throw new AppException(e.getMessage());
} }
} }
......
...@@ -3,5 +3,5 @@ package com.mortals.xhx.module.dingding; ...@@ -3,5 +3,5 @@ package com.mortals.xhx.module.dingding;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
public interface IDingTalkService { public interface IDingTalkService {
Rest<String> getToken(); String getToken();
} }
...@@ -24,11 +24,10 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -24,11 +24,10 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
public Rest<String> getPersonByMobile(String mobile) { public Rest<String> getPersonByMobile(String mobile) {
try { try {
DingTalkClient client = getDingTalkClient("/topapi/v2/user/getbymobile"); DingTalkClient client = getDingTalkClient("/topapi/v2/user/getbymobile");
checkToken();
OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest(); OapiV2UserGetbymobileRequest req = new OapiV2UserGetbymobileRequest();
req.setMobile(mobile); req.setMobile(mobile);
log.info("getPersonByMobile:{}",mobile); log.info("getPersonByMobile:{}",mobile);
OapiV2UserGetbymobileResponse rsp = client.execute(req, dingToken); OapiV2UserGetbymobileResponse rsp = client.execute(req, getToken());
log.info("OapiV2UserGetbymobileResponse:{}",rsp.getBody()); log.info("OapiV2UserGetbymobileResponse:{}",rsp.getBody());
if (rsp.getErrcode() == 0) { if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getResult().getUserid()); return Rest.ok(rsp.getResult().getUserid());
...@@ -45,13 +44,13 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -45,13 +44,13 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
public Rest<String> sendWorkMsg(WorkMsgReq workMsgReq) { public Rest<String> sendWorkMsg(WorkMsgReq workMsgReq) {
try { try {
DingTalkClient client = getDingTalkClient("/topapi/message/corpconversation/asyncsend_v2"); DingTalkClient client = getDingTalkClient("/topapi/message/corpconversation/asyncsend_v2");
checkToken();
OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request(); OapiMessageCorpconversationAsyncsendV2Request req = new OapiMessageCorpconversationAsyncsendV2Request();
req.setAgentId(agentId); req.setAgentId(agentId);
req.setUseridList(workMsgReq.getUseridList()); req.setUseridList(workMsgReq.getUseridList());
req.setMsg(JSON.toJSONString(workMsgReq.getMsg())); req.setMsg(JSON.toJSONString(workMsgReq.getMsg()));
log.info("sendWorkMsg:{}", JSON.toJSONString(workMsgReq)); log.info("sendWorkMsg:{}", JSON.toJSONString(workMsgReq));
OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, dingToken); OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(req, getToken());
log.info("OapiMessageResponse:{}",rsp.getBody()); log.info("OapiMessageResponse:{}",rsp.getBody());
if (rsp.getErrcode() == 0) { if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getMsg(), rsp.getRequestId()); return Rest.ok(rsp.getMsg(), rsp.getRequestId());
......
...@@ -11,11 +11,11 @@ import com.mortals.xhx.module.perform.model.vo.PerformAttendAppealVo; ...@@ -11,11 +11,11 @@ import com.mortals.xhx.module.perform.model.vo.PerformAttendAppealVo;
import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealFilesEntity;
import lombok.Data; import lombok.Data;
/** /**
* 绩效记录申诉信息实体对象 * 绩效记录申诉信息实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-07-12 * @date 2023-07-15
*/ */
@Data @Data
public class PerformAttendAppealEntity extends PerformAttendAppealVo { public class PerformAttendAppealEntity extends PerformAttendAppealVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -235,6 +235,15 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo { ...@@ -235,6 +235,15 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo {
* 绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】 * 绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】
*/ */
private String performType; private String performType;
/**
* 扣分人员
*/
@Excel(name = "扣分人员")
private String deductPerson;
/**
* 扣分时间
*/
private Date deductTime;
/** /**
* 绩效记录申诉附件信息信息 * 绩效记录申诉附件信息信息
*/ */
...@@ -363,5 +372,9 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo { ...@@ -363,5 +372,9 @@ public class PerformAttendAppealEntity extends PerformAttendAppealVo {
this.irregularOtherType = -1; this.irregularOtherType = -1;
this.performType = ""; this.performType = "";
this.deductPerson = "";
this.deductTime = null;
} }
} }
\ No newline at end of file
...@@ -6,11 +6,11 @@ import java.util.Date; ...@@ -6,11 +6,11 @@ import java.util.Date;
import java.util.List; import java.util.List;
import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity; import com.mortals.xhx.module.perform.model.PerformAttendAppealEntity;
/** /**
* 绩效记录申诉信息查询对象 * 绩效记录申诉信息查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-07-12 * @date 2023-07-15
*/ */
public class PerformAttendAppealQuery extends PerformAttendAppealEntity { public class PerformAttendAppealQuery extends PerformAttendAppealEntity {
/** 开始 序号,主键,自增长 */ /** 开始 序号,主键,自增长 */
private Long idStart; private Long idStart;
...@@ -469,6 +469,17 @@ public class PerformAttendAppealQuery extends PerformAttendAppealEntity { ...@@ -469,6 +469,17 @@ public class PerformAttendAppealQuery extends PerformAttendAppealEntity {
/** 绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】排除列表 */ /** 绩效类型【attend:考勤绩效,review:评价差评绩效,complain:评价投诉绩效,gowork:办件绩效,effect:效能绩效,other:其它绩效】排除列表 */
private List <String> performTypeNotList; private List <String> performTypeNotList;
/** 扣分人员 */
private List<String> deductPersonList;
/** 扣分人员排除列表 */
private List <String> deductPersonNotList;
/** 开始 扣分时间 */
private String deductTimeStart;
/** 结束 扣分时间 */
private String deductTimeEnd;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<PerformAttendAppealQuery> orConditionList; private List<PerformAttendAppealQuery> orConditionList;
...@@ -3070,6 +3081,70 @@ public class PerformAttendAppealQuery extends PerformAttendAppealEntity { ...@@ -3070,6 +3081,70 @@ public class PerformAttendAppealQuery extends PerformAttendAppealEntity {
this.performTypeNotList = performTypeNotList; this.performTypeNotList = performTypeNotList;
} }
/**
* 获取 扣分人员
* @return deductPersonList
*/
public List<String> getDeductPersonList(){
return this.deductPersonList;
}
/**
* 设置 扣分人员
* @param deductPersonList
*/
public void setDeductPersonList(List<String> deductPersonList){
this.deductPersonList = deductPersonList;
}
/**
* 获取 扣分人员
* @return deductPersonNotList
*/
public List<String> getDeductPersonNotList(){
return this.deductPersonNotList;
}
/**
* 设置 扣分人员
* @param deductPersonNotList
*/
public void setDeductPersonNotList(List<String> deductPersonNotList){
this.deductPersonNotList = deductPersonNotList;
}
/**
* 获取 开始 扣分时间
* @return deductTimeStart
*/
public String getDeductTimeStart(){
return this.deductTimeStart;
}
/**
* 设置 开始 扣分时间
* @param deductTimeStart
*/
public void setDeductTimeStart(String deductTimeStart){
this.deductTimeStart = deductTimeStart;
}
/**
* 获取 结束 扣分时间
* @return deductTimeEnd
*/
public String getDeductTimeEnd(){
return this.deductTimeEnd;
}
/**
* 设置 结束 扣分时间
* @param deductTimeEnd
*/
public void setDeductTimeEnd(String deductTimeEnd){
this.deductTimeEnd = deductTimeEnd;
}
/** /**
* 设置 序号,主键,自增长 * 设置 序号,主键,自增长
* @param id * @param id
...@@ -4494,6 +4569,26 @@ public class PerformAttendAppealQuery extends PerformAttendAppealEntity { ...@@ -4494,6 +4569,26 @@ public class PerformAttendAppealQuery extends PerformAttendAppealEntity {
return this; return this;
} }
/**
* 设置 扣分人员
* @param deductPerson
*/
public PerformAttendAppealQuery deductPerson(String deductPerson){
setDeductPerson(deductPerson);
return this;
}
/**
* 设置 扣分人员
* @param deductPersonList
*/
public PerformAttendAppealQuery deductPersonList(List<String> deductPersonList){
this.deductPersonList = deductPersonList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"mybatis-3-mapper.dtd"> "mybatis-3-mapper.dtd">
<mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformAttendAppealDaoImpl"> <mapper namespace="com.mortals.xhx.module.perform.dao.ibatis.PerformAttendAppealDaoImpl">
<!-- 字段和属性映射 --> <!-- 字段和属性映射 -->
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
<result property="snapPath" column="snapPath" /> <result property="snapPath" column="snapPath" />
<result property="irregularOtherType" column="irregularOtherType" /> <result property="irregularOtherType" column="irregularOtherType" />
<result property="performType" column="performType" /> <result property="performType" column="performType" />
<result property="deductPerson" column="deductPerson" />
<result property="deductTime" column="deductTime" />
<collection property="performAttendAppealFilesList" column="id" ofType="PerformAttendAppealFilesEntity" javaType="ArrayList" select="getPerformAttendAppealFilesByAppealId"></collection> <collection property="performAttendAppealFilesList" column="id" ofType="PerformAttendAppealFilesEntity" javaType="ArrayList" select="getPerformAttendAppealFilesByAppealId"></collection>
</resultMap> </resultMap>
<resultMap type="PerformAttendAppealFilesEntity" id="PerformAttendAppealFilesEntity-Map"> <resultMap type="PerformAttendAppealFilesEntity" id="PerformAttendAppealFilesEntity-Map">
...@@ -242,6 +244,12 @@ ...@@ -242,6 +244,12 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('performType') or colPickMode == 1 and data.containsKey('performType')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('performType') or colPickMode == 1 and data.containsKey('performType')))">
a.performType, a.performType,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deductPerson') or colPickMode == 1 and data.containsKey('deductPerson')))">
a.deductPerson,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deductTime') or colPickMode == 1 and data.containsKey('deductTime')))">
a.deductTime,
</if>
</trim> </trim>
</sql> </sql>
<!-- 子表所有列 --> <!-- 子表所有列 -->
...@@ -253,18 +261,18 @@ ...@@ -253,18 +261,18 @@
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="PerformAttendAppealEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="PerformAttendAppealEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_perform_attend_appeal insert into mortals_xhx_perform_attend_appeal
(checkRecordId,staffId,staffName,workNum,deptId,deptName,attendanceGroupId,attendanceGroupName,attendanceDate,ruleId,ruleName,subMethod,subAddType,score,goOffTimeStr,errorTime,actualAttendTime,errorResult,checkPerson,checkTime,checkDesc,checkResult,processStatus,appealDesc,appealTime,appealResult,remark,createUserId,createTime,updateUserId,updateTime,violationType,reviewResult,reviewTime,reviewSource,reviewDevice,complainTitle,complainContent,complainRealName,contact,complainTime,complainSource,complainDevice,goworkCode,goworkDepts,matterlName,goworkTime,irregularType,happenTime,duration,alarmTime,snapPath,irregularOtherType,performType) (checkRecordId,staffId,staffName,workNum,deptId,deptName,attendanceGroupId,attendanceGroupName,attendanceDate,ruleId,ruleName,subMethod,subAddType,score,goOffTimeStr,errorTime,actualAttendTime,errorResult,checkPerson,checkTime,checkDesc,checkResult,processStatus,appealDesc,appealTime,appealResult,remark,createUserId,createTime,updateUserId,updateTime,violationType,reviewResult,reviewTime,reviewSource,reviewDevice,complainTitle,complainContent,complainRealName,contact,complainTime,complainSource,complainDevice,goworkCode,goworkDepts,matterlName,goworkTime,irregularType,happenTime,duration,alarmTime,snapPath,irregularOtherType,performType,deductPerson,deductTime)
VALUES VALUES
(#{checkRecordId},#{staffId},#{staffName},#{workNum},#{deptId},#{deptName},#{attendanceGroupId},#{attendanceGroupName},#{attendanceDate},#{ruleId},#{ruleName},#{subMethod},#{subAddType},#{score},#{goOffTimeStr},#{errorTime},#{actualAttendTime},#{errorResult},#{checkPerson},#{checkTime},#{checkDesc},#{checkResult},#{processStatus},#{appealDesc},#{appealTime},#{appealResult},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{violationType},#{reviewResult},#{reviewTime},#{reviewSource},#{reviewDevice},#{complainTitle},#{complainContent},#{complainRealName},#{contact},#{complainTime},#{complainSource},#{complainDevice},#{goworkCode},#{goworkDepts},#{matterlName},#{goworkTime},#{irregularType},#{happenTime},#{duration},#{alarmTime},#{snapPath},#{irregularOtherType},#{performType}) (#{checkRecordId},#{staffId},#{staffName},#{workNum},#{deptId},#{deptName},#{attendanceGroupId},#{attendanceGroupName},#{attendanceDate},#{ruleId},#{ruleName},#{subMethod},#{subAddType},#{score},#{goOffTimeStr},#{errorTime},#{actualAttendTime},#{errorResult},#{checkPerson},#{checkTime},#{checkDesc},#{checkResult},#{processStatus},#{appealDesc},#{appealTime},#{appealResult},#{remark},#{createUserId},#{createTime},#{updateUserId},#{updateTime},#{violationType},#{reviewResult},#{reviewTime},#{reviewSource},#{reviewDevice},#{complainTitle},#{complainContent},#{complainRealName},#{contact},#{complainTime},#{complainSource},#{complainDevice},#{goworkCode},#{goworkDepts},#{matterlName},#{goworkTime},#{irregularType},#{happenTime},#{duration},#{alarmTime},#{snapPath},#{irregularOtherType},#{performType},#{deductPerson},#{deductTime})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_perform_attend_appeal insert into mortals_xhx_perform_attend_appeal
(checkRecordId,staffId,staffName,workNum,deptId,deptName,attendanceGroupId,attendanceGroupName,attendanceDate,ruleId,ruleName,subMethod,subAddType,score,goOffTimeStr,errorTime,actualAttendTime,errorResult,checkPerson,checkTime,checkDesc,checkResult,processStatus,appealDesc,appealTime,appealResult,remark,createUserId,createTime,updateUserId,updateTime,violationType,reviewResult,reviewTime,reviewSource,reviewDevice,complainTitle,complainContent,complainRealName,contact,complainTime,complainSource,complainDevice,goworkCode,goworkDepts,matterlName,goworkTime,irregularType,happenTime,duration,alarmTime,snapPath,irregularOtherType,performType) (checkRecordId,staffId,staffName,workNum,deptId,deptName,attendanceGroupId,attendanceGroupName,attendanceDate,ruleId,ruleName,subMethod,subAddType,score,goOffTimeStr,errorTime,actualAttendTime,errorResult,checkPerson,checkTime,checkDesc,checkResult,processStatus,appealDesc,appealTime,appealResult,remark,createUserId,createTime,updateUserId,updateTime,violationType,reviewResult,reviewTime,reviewSource,reviewDevice,complainTitle,complainContent,complainRealName,contact,complainTime,complainSource,complainDevice,goworkCode,goworkDepts,matterlName,goworkTime,irregularType,happenTime,duration,alarmTime,snapPath,irregularOtherType,performType,deductPerson,deductTime)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.checkRecordId},#{item.staffId},#{item.staffName},#{item.workNum},#{item.deptId},#{item.deptName},#{item.attendanceGroupId},#{item.attendanceGroupName},#{item.attendanceDate},#{item.ruleId},#{item.ruleName},#{item.subMethod},#{item.subAddType},#{item.score},#{item.goOffTimeStr},#{item.errorTime},#{item.actualAttendTime},#{item.errorResult},#{item.checkPerson},#{item.checkTime},#{item.checkDesc},#{item.checkResult},#{item.processStatus},#{item.appealDesc},#{item.appealTime},#{item.appealResult},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.violationType},#{item.reviewResult},#{item.reviewTime},#{item.reviewSource},#{item.reviewDevice},#{item.complainTitle},#{item.complainContent},#{item.complainRealName},#{item.contact},#{item.complainTime},#{item.complainSource},#{item.complainDevice},#{item.goworkCode},#{item.goworkDepts},#{item.matterlName},#{item.goworkTime},#{item.irregularType},#{item.happenTime},#{item.duration},#{item.alarmTime},#{item.snapPath},#{item.irregularOtherType},#{item.performType}) (#{item.checkRecordId},#{item.staffId},#{item.staffName},#{item.workNum},#{item.deptId},#{item.deptName},#{item.attendanceGroupId},#{item.attendanceGroupName},#{item.attendanceDate},#{item.ruleId},#{item.ruleName},#{item.subMethod},#{item.subAddType},#{item.score},#{item.goOffTimeStr},#{item.errorTime},#{item.actualAttendTime},#{item.errorResult},#{item.checkPerson},#{item.checkTime},#{item.checkDesc},#{item.checkResult},#{item.processStatus},#{item.appealDesc},#{item.appealTime},#{item.appealResult},#{item.remark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.violationType},#{item.reviewResult},#{item.reviewTime},#{item.reviewSource},#{item.reviewDevice},#{item.complainTitle},#{item.complainContent},#{item.complainRealName},#{item.contact},#{item.complainTime},#{item.complainSource},#{item.complainDevice},#{item.goworkCode},#{item.goworkDepts},#{item.matterlName},#{item.goworkTime},#{item.irregularType},#{item.happenTime},#{item.duration},#{item.alarmTime},#{item.snapPath},#{item.irregularOtherType},#{item.performType},#{item.deductPerson},#{item.deductTime})
</foreach> </foreach>
</insert> </insert>
...@@ -484,6 +492,12 @@ ...@@ -484,6 +492,12 @@
<if test="(colPickMode==0 and data.containsKey('performType')) or (colPickMode==1 and !data.containsKey('performType'))"> <if test="(colPickMode==0 and data.containsKey('performType')) or (colPickMode==1 and !data.containsKey('performType'))">
a.performType=#{data.performType}, a.performType=#{data.performType},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('deductPerson')) or (colPickMode==1 and !data.containsKey('deductPerson'))">
a.deductPerson=#{data.deductPerson},
</if>
<if test="(colPickMode==0 and data.containsKey('deductTime')) or (colPickMode==1 and !data.containsKey('deductTime'))">
a.deductTime=#{data.deductTime},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -954,6 +968,20 @@ ...@@ -954,6 +968,20 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="deductPerson=(case" suffix="ELSE deductPerson end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deductPerson')) or (colPickMode==1 and !item.containsKey('deductPerson'))">
when a.id=#{item.id} then #{item.deductPerson}
</if>
</foreach>
</trim>
<trim prefix="deductTime=(case" suffix="ELSE deductTime end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deductTime')) or (colPickMode==1 and !item.containsKey('deductTime'))">
when a.id=#{item.id} then #{item.deductTime}
</if>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -2263,6 +2291,42 @@ ...@@ -2263,6 +2291,42 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('deductPerson')">
<if test="conditionParamRef.deductPerson != null and conditionParamRef.deductPerson != ''">
${_conditionType_} a.deductPerson like #{${_conditionParam_}.deductPerson}
</if>
<if test="conditionParamRef.deductPerson == null">
${_conditionType_} a.deductPerson is null
</if>
</if>
<if test="conditionParamRef.containsKey('deductPersonList') and conditionParamRef.deductPersonList.size() > 0">
${_conditionType_} a.deductPerson in
<foreach collection="conditionParamRef.deductPersonList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deductPersonNotList') and conditionParamRef.deductPersonNotList.size() > 0">
${_conditionType_} a.deductPerson not in
<foreach collection="conditionParamRef.deductPersonNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deductTime')">
<if test="conditionParamRef.deductTime != null ">
${_conditionType_} a.deductTime = #{${_conditionParam_}.deductTime}
</if>
<if test="conditionParamRef.deductTime == null">
${_conditionType_} a.deductTime is null
</if>
</if>
<if test="conditionParamRef.containsKey('deductTimeStart') and conditionParamRef.deductTimeStart != null and conditionParamRef.deductTimeStart!=''">
${_conditionType_} a.deductTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.deductTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s')
</if>
<if test="conditionParamRef.containsKey('deductTimeEnd') and conditionParamRef.deductTimeEnd != null and conditionParamRef.deductTimeEnd!=''">
${_conditionType_} a.deductTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{${_conditionParam_}.deductTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s')
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -2551,6 +2615,16 @@ ...@@ -2551,6 +2615,16 @@
<if test='orderCol.performType != null and "DESC".equalsIgnoreCase(orderCol.performType)'>DESC</if> <if test='orderCol.performType != null and "DESC".equalsIgnoreCase(orderCol.performType)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('deductPerson')">
a.deductPerson
<if test='orderCol.deductPerson != null and "DESC".equalsIgnoreCase(orderCol.deductPerson)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deductTime')">
a.deductTime
<if test='orderCol.deductTime != null and "DESC".equalsIgnoreCase(orderCol.deductTime)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
...@@ -641,3 +641,12 @@ CREATE TABLE mortals_xhx_staff_perform_summary( ...@@ -641,3 +641,12 @@ CREATE TABLE mortals_xhx_staff_perform_summary(
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='员工绩效统计'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='员工绩效统计';
-- ----------------------------
2023-7-15
-- ----------------------------
ALTER TABLE mortals_xhx_perform_attend_appeal ADD COLUMN `deductPerson` varchar(128) COMMENT '扣分人员' AFTER subMethod;
ALTER TABLE mortals_xhx_perform_attend_appeal ADD COLUMN `deductTime` datetime COMMENT '扣分时间' AFTER deductPerson;
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