Commit 34d0dab6 authored by 姬鋆屾's avatar 姬鋆屾
parents f917cb3d 3dd6e2e1
...@@ -91,7 +91,18 @@ public class UserEntity extends UserVo implements IUser { ...@@ -91,7 +91,18 @@ public class UserEntity extends UserVo implements IUser {
*/ */
private Long customerId; private Long customerId;
/**
* 钉钉userId
*/
private String dingUserId;
public String getDingUserId() {
return dingUserId;
}
public void setDingUserId(String dingUserId) {
this.dingUserId = dingUserId;
}
public UserEntity(){} public UserEntity(){}
/** /**
......
...@@ -162,6 +162,14 @@ public class UserQuery extends UserEntity { ...@@ -162,6 +162,14 @@ public class UserQuery extends UserEntity {
/** 最后一次登录地址排除列表 */ /** 最后一次登录地址排除列表 */
private List <String> lastLoginAddressNotList; private List <String> lastLoginAddressNotList;
/** 钉钉userId */
private List<String> dingUserIdList;
/** 钉钉userId排除列表 */
private List <String> dingUserIdNotList;
/** 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<UserQuery> orConditionList; private List<UserQuery> orConditionList;
...@@ -1606,4 +1614,23 @@ public class UserQuery extends UserEntity { ...@@ -1606,4 +1614,23 @@ public class UserQuery extends UserEntity {
this.andConditionList = andConditionList; this.andConditionList = andConditionList;
} }
/**
* 设置 钉钉userId
* @param dingUserId
*/
public UserQuery dingUserId(String dingUserId){
setDingUserId(dingUserId);
return this;
}
/**
* 设置 钉钉userId
* @param dingUserIdList
*/
public UserQuery dingUserIdList(List<String> dingUserIdList){
this.dingUserIdList = dingUserIdList;
return this;
}
} }
\ No newline at end of file
package com.mortals.xhx.busiz.h5.req;
import com.mortals.xhx.busiz.BaseReq;
import lombok.Data;
@Data
public class DingTalkReq extends BaseReq {
/**
* 授权码
*/
private String code;
}
package com.mortals.xhx.busiz.h5.web;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.CookieService;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.AESUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.util.HttpUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.login.web.LoginForm;
import com.mortals.xhx.base.system.menu.model.MenuEntity;
import com.mortals.xhx.base.system.menu.service.MenuService;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.base.system.valid.service.ValidCodeService;
import com.mortals.xhx.busiz.h5.req.DingTalkReq;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.RedisKey;
import com.mortals.xhx.common.pdu.HomeStatInfo;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.dingding.IDingTalkService;
import com.mortals.xhx.module.dingding.personal.service.IDingPersonService;
import com.mortals.xhx.module.staff.model.StaffQuery;
import com.mortals.xhx.module.staff.service.StaffService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.Set;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED;
import static com.mortals.xhx.common.key.ErrorCode.ERROR_TOKEN_EXPIRED_CONTENT;
/**
* 钉钉授权登录
*
* @author:
* @date: 2023/7/15 10:26
*/
@RestController
@Slf4j
@RequestMapping("dingtalk")
public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<UserService, UserEntity, Long> {
@Autowired
private UserService userService;
@Autowired
private ValidCodeService validCodeService;
@Autowired
private ResourceService resourceService;
@Autowired
private MenuService menuService;
@Autowired
private ICacheService cacheService;
@Autowired
private IAuthTokenService authTokenService;
@Autowired
private StaffService staffService;
@Autowired
private DeptService deptService;
@Autowired
private IDingPersonService dingPersonService;
@RequestMapping("authlogin")
public String login(@RequestBody DingTalkReq req) throws Exception {
JSONObject ret = new JSONObject();
UserEntity userEntity = null;
try {
if (ObjectUtils.isEmpty(req.getCode())) {
throw new AppException("钉钉 code 不能为空!");
}
//根据code 查询钉钉用户id
Rest<String> personRest = dingPersonService.getPersonByCode(req.getCode());
if (personRest.getCode() == YesNoEnum.NO.getValue()) {
throw new AppException(String.format("获取钉钉用户异常,{}", personRest.getMsg()));
}
//根据钉钉的用户查询系统绑定的用户
recordSysLog(request, userEntity, "用户登录系统成功!");
// 返回拥有的菜单数据
Set<String> urls = resourceService.findUrlSetByUserId(userEntity.getId());
List<MenuEntity> outlookBarList = menuService.findTreeMenu(userEntity, urls);
String currUserName = userEntity.getRealName();
if (currUserName == null || currUserName.trim().length() == 0) {
currUserName = "管理员";
}
JSONObject data = new JSONObject();
data.put("currUserName", currUserName);
data.put("barList", outlookBarList);
data.put("id", userEntity.getId());
data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
// userEntity.setMenuUrl(generateMenuUrlCode(urls));
String token = authTokenService.createToken(userEntity);
data.put("token", token);
//设置token 和过期时间
//data.put("expiresTime", DateUtils.addCurrDate(7).getTime());
//this.generateBlackCookie(request, response, loginName, urls);
ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
ret.put("resources", urls);
return ret.toJSONString();
} catch (Exception e) {
log.error("dinding login error ", e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
@RequestMapping("logout")
public void logout(HttpServletRequest request, HttpServletResponse response) throws Exception {
recordSysLog(request, "退出登录");
super.removeCurrUser(request);
this.deleteBlackCookie(request, response);
}
protected void deleteBlackCookie(HttpServletRequest request, HttpServletResponse response) {
try {
CookieService.deleteCookieForAuth(request, response);
} catch (Throwable e) {
}
}
@RequestMapping("parseToken")
public IUser parseToken() throws Exception {
IUser userEntity = authTokenService.getLoginUser(request);
if (!ObjectUtils.isEmpty(userEntity)) {
authTokenService.verifyToken(userEntity);
return userEntity;
}
return null;
}
}
...@@ -7,6 +7,7 @@ import com.mortals.framework.common.Rest; ...@@ -7,6 +7,7 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.busiz.h5.req.FeedbackReq; import com.mortals.xhx.busiz.h5.req.FeedbackReq;
import com.mortals.xhx.busiz.h5.req.FeedbackSaveReq; import com.mortals.xhx.busiz.h5.req.FeedbackSaveReq;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
...@@ -75,17 +76,20 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> { ...@@ -75,17 +76,20 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
feedbackReq.setFeedBackEndDate(DateUtil.endOfMonth(DateUtil.parse(feedbackReq.getFeedBackStartDate()).toJdkDate()).toDateStr()); feedbackReq.setFeedBackEndDate(DateUtil.endOfMonth(DateUtil.parse(feedbackReq.getFeedBackStartDate()).toJdkDate()).toDateStr());
} }
//PageInfo pageInfo = buildPageInfo(feedbackReq); //PageInfo pageInfo = buildPageInfo(feedbackReq);
//todo PageInfo pageAllInfo = buildPageInfo(feedbackReq);
PageInfo pageAllInfo = new PageInfo();
if (YesNoEnum.YES.getValue() == feedbackReq.getFeedbackStatus()) { if (YesNoEnum.YES.getValue() == feedbackReq.getFeedbackStatus()) {
//已反馈 //已反馈
//查询我已经回答过的 //查询我已经回答过的
List<Long> feedbackIdList = answerService.find(new FeedbackAnswerQuery().staffId(context.getUser().getCustomerId())).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList()); List<Long> feedbackIdList = answerService.find(new FeedbackAnswerQuery().staffId(context.getUser().getCustomerId())).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList());
FeedbackQuery feedbackQuery = new FeedbackQuery(); FeedbackQuery feedbackQuery = new FeedbackQuery();
feedbackQuery.setIdList(feedbackIdList); feedbackQuery.setIdList(feedbackIdList);
List<FeedbackEntity> feedbackEntities = feedbackService.find(feedbackQuery);
model.put(KEY_RESULT_DATA, feedbackEntities); Result<FeedbackEntity> result = feedbackService.find(feedbackQuery, pageAllInfo, null);
pageAllInfo.setTotalResult(feedbackEntities.size());
model.put(PAGEINFO_KEY, result.getPageInfo());
model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo());
} else { } else {
//未反馈 //未反馈
//查询我的反馈 但是还未回答的 //查询我的反馈 但是还未回答的
...@@ -96,17 +100,16 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> { ...@@ -96,17 +100,16 @@ public class FeedbackApiController extends AbstractBaseController<FeedbackReq> {
feedbackStaffQuery.setStaffId(context.getUser().getCustomerId()); feedbackStaffQuery.setStaffId(context.getUser().getCustomerId());
List<Long> unfinFeedbackList = feedbackStaffService.find(feedbackStaffQuery).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList()); List<Long> unfinFeedbackList = feedbackStaffService.find(feedbackStaffQuery).stream().map(i -> i.getFeedbackId()).distinct().collect(Collectors.toList());
model.put(KEY_RESULT_DATA, unfinFeedbackList); FeedbackQuery feedbackQuery = new FeedbackQuery();
pageAllInfo.setTotalResult(unfinFeedbackList.size()); feedbackQuery.setIdList(unfinFeedbackList);
} Result<FeedbackEntity> result = feedbackService.find(feedbackQuery, pageAllInfo, null);
pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1);
model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo);
model.put(PAGEINFO_KEY, result.getPageInfo());
model.put(KEY_RESULT_DATA, result.getList());
parsePageInfo(model, result.getPageInfo());
}
rest.setData(model); rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
log.error(busiDesc, e); log.error(busiDesc, e);
......
...@@ -186,16 +186,13 @@ public class InspectApiController extends AbstractBaseController<PerformReq> { ...@@ -186,16 +186,13 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
PageInfo pageAllInfo = new PageInfo(); PageInfo pageAllInfo = new PageInfo();
pageAllInfo.setTotalResult(collect.size()); pageAllInfo.setTotalResult(collect.size());
pageAllInfo.setCurrPage(1); pageAllInfo.setCurrPage(1);
pageAllInfo.setPrePageResult(-1); pageAllInfo.setPrePageResult(10);
model.put(PAGEINFO_KEY, pageAllInfo); model.put(PAGEINFO_KEY, pageAllInfo);
parsePageInfo(model, pageAllInfo); parsePageInfo(model, pageAllInfo);
} }
// model.put(KEY_RESULT_DATA, result.getList()); // model.put(KEY_RESULT_DATA, result.getList());
// model.put(PAGEINFO_KEY, result.getPageInfo()); // model.put(PAGEINFO_KEY, result.getPageInfo());
// parsePageInfo(model, result.getPageInfo()); // parsePageInfo(model, result.getPageInfo());
rest.setData(model); rest.setData(model);
recordSysLog(request, busiDesc + " 【成功】"); recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) { } catch (Exception e) {
......
...@@ -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:";
} }
package com.mortals.xhx.module.check.dao; package com.mortals.xhx.module.check.dao;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
...@@ -10,5 +12,5 @@ import java.util.List; ...@@ -10,5 +12,5 @@ import java.util.List;
*/ */
public interface CheckAllRecordDao { public interface CheckAllRecordDao {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query); Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query, PageInfo pageInfo);
} }
package com.mortals.xhx.module.check.dao.ibatis; package com.mortals.xhx.module.check.dao.ibatis;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.ParamDto;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao; import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport; import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -30,8 +35,39 @@ public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements Check ...@@ -30,8 +35,39 @@ public class CheckAllRecordDaoImpl extends SqlSessionDaoSupport implements Check
} }
@Override @Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery checkAllRecordQuery) { public Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery checkAllRecordQuery, PageInfo pageInfo) {
Result result = new Result();
List list = null;
if (pageInfo.isCountPage()) {
int count = this.getCount(checkAllRecordQuery);
if (count == 0) {
list = new ArrayList();
} else if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery, rowBounds);
}
pageInfo.setTotalResult(count);
result.setPageInfo(pageInfo);
result.setList((List)list);
} else {
if (pageInfo.getPrePageResult() == -1) {
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery);
} else {
RowBounds rowBounds = new RowBounds(pageInfo.getBeginIndex(), pageInfo.getPrePageResult());
list = this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery, rowBounds);
}
pageInfo.setTotalResult(-1);
result.setPageInfo(pageInfo);
result.setList(list);
}
return result;
}
return this.getSqlSession().selectList(this.getSqlId("getList"), checkAllRecordQuery); public int getCount(CheckAllRecordQuery checkAllRecordQuery) {
return (Integer)this.getSqlSession().selectOne(this.getSqlId("getListCount"), checkAllRecordQuery);
} }
} }
package com.mortals.xhx.module.check.service; package com.mortals.xhx.module.check.service;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo; import com.mortals.xhx.module.check.model.vo.CheckAllRecordVo;
...@@ -10,5 +12,5 @@ import java.util.List; ...@@ -10,5 +12,5 @@ import java.util.List;
*/ */
public interface CheckAllRecordService { public interface CheckAllRecordService {
List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query); Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query, PageInfo pageInfo);
} }
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.module.check.dao.CheckAllRecordDao; import com.mortals.xhx.module.check.dao.CheckAllRecordDao;
import com.mortals.xhx.module.check.model.CheckAllRecordQuery; import com.mortals.xhx.module.check.model.CheckAllRecordQuery;
...@@ -21,7 +23,7 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService { ...@@ -21,7 +23,7 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService {
private CheckAllRecordDao checkAllRecordDao; private CheckAllRecordDao checkAllRecordDao;
@Override @Override
public List<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query) { public Result<CheckAllRecordVo> getAllCheckRecord(CheckAllRecordQuery query,PageInfo pageInfo) {
if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){ if(StringUtils.isEmpty(query.getCheckTimeStart())||StringUtils.isEmpty(query.getCheckTimeStart())){
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Calendar calendar=Calendar.getInstance(); Calendar calendar=Calendar.getInstance();
...@@ -32,6 +34,6 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService { ...@@ -32,6 +34,6 @@ public class CheckAllRecordServiceImpl implements CheckAllRecordService {
query.setCheckTimeStart(startTime); query.setCheckTimeStart(startTime);
query.setCheckTimeEnd(endTime); query.setCheckTimeEnd(endTime);
} }
return checkAllRecordDao.getAllCheckRecord(query); return checkAllRecordDao.getAllCheckRecord(query,pageInfo);
} }
} }
...@@ -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());
......
...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.web; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.module.check.web;
import com.mortals.framework.annotation.UnAuth; import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.web.BaseJsonBodyController; import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.common.code.CheckStatusEnum; import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.CheckTypeEnum; import com.mortals.xhx.common.code.CheckTypeEnum;
...@@ -45,14 +47,14 @@ public class CheckAllRecordController extends BaseJsonBodyController { ...@@ -45,14 +47,14 @@ public class CheckAllRecordController extends BaseJsonBodyController {
Rest<Object> ret = new Rest(); Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
Context context = this.getContext(); Context context = this.getContext();
String busiDesc = "查询所类型绩效核查信息"; String busiDesc = "查询所类型绩效核查信息";
int code=1; int code=1;
try { try {
PageInfo pageInfo = new PageInfo(-1);
Result<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query,pageInfo);
List<CheckAllRecordVo> result = checkAllRecordService.getAllCheckRecord(query); model.put("data", result.getList());
model.put("data", result);
model.put("message_info", busiDesc + "成功"); model.put("message_info", busiDesc + "成功");
if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) { if (!ObjectUtils.isEmpty(context) && !ObjectUtils.isEmpty(context.getUser())) {
......
...@@ -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();
} }
...@@ -25,6 +25,14 @@ public interface IDingPersonService extends IDingTalkService { ...@@ -25,6 +25,14 @@ public interface IDingPersonService extends IDingTalkService {
*/ */
Rest<String> getPersonByMobile(String mobile); Rest<String> getPersonByMobile(String mobile);
/**
* 根据code获取钉钉用户id
*
* @param code
* @return
*/
Rest<String> getPersonByCode(String code);
/** /**
* 发送工作消息 * 发送工作消息
......
...@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON; ...@@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON;
import com.dingtalk.api.DingTalkClient; import com.dingtalk.api.DingTalkClient;
import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request; import com.dingtalk.api.request.OapiMessageCorpconversationAsyncsendV2Request;
import com.dingtalk.api.request.OapiV2UserGetbymobileRequest; import com.dingtalk.api.request.OapiV2UserGetbymobileRequest;
import com.dingtalk.api.request.OapiV2UserGetuserinfoRequest;
import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response; import com.dingtalk.api.response.OapiMessageCorpconversationAsyncsendV2Response;
import com.dingtalk.api.response.OapiV2UserGetbymobileResponse; import com.dingtalk.api.response.OapiV2UserGetbymobileResponse;
import com.dingtalk.api.response.OapiV2UserGetuserinfoResponse;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.module.dingding.AbstractDingTalkService; import com.mortals.xhx.module.dingding.AbstractDingTalkService;
import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq; import com.mortals.xhx.module.dingding.personal.model.req.workmsg.WorkMsgReq;
...@@ -24,12 +26,11 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -24,12 +26,11 @@ 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());
} else { } else {
...@@ -41,18 +42,38 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID ...@@ -41,18 +42,38 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
} }
} }
@Override
public Rest<String> getPersonByCode(String code) {
try {
DingTalkClient client = getDingTalkClient("/topapi/v2/user/getuserinfo");
OapiV2UserGetuserinfoRequest req = new OapiV2UserGetuserinfoRequest();
req.setCode(code);
log.info("getPersonByCode:{}", code);
OapiV2UserGetuserinfoResponse rsp = client.execute(req, getToken());
log.info("OapiV2UserGetuserinfoResponse:{}", rsp.getBody());
if (rsp.getErrcode() == 0) {
return Rest.ok(rsp.getResult().getUserid());
} else {
return Rest.fail(String.format("code:%s,msg:%s", rsp.getErrcode(), rsp.getErrmsg()));
}
} catch (ApiException e) {
log.info("根据code查询人员异常", e);
return Rest.fail(e.getMessage());
}
}
@Override @Override
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());
} else { } else {
......
...@@ -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
......
package com.mortals.xhx.module.window.service.impl; package com.mortals.xhx.module.window.service.impl;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -13,17 +14,20 @@ import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity; ...@@ -13,17 +14,20 @@ import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity;
import com.mortals.xhx.module.window.model.WindowOwnerDetailQuery; import com.mortals.xhx.module.window.model.WindowOwnerDetailQuery;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService; import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.Date; import java.util.Date;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
* WindowOwnerService * WindowOwnerService
* 窗口负责人 service实现 * 窗口负责人 service实现
* *
* @author zxfei * @author zxfei
* @date 2023-07-12 * @date 2023-07-12
*/ */
@Service("windowOwnerService") @Service("windowOwnerService")
@Slf4j @Slf4j
public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerDao, WindowOwnerEntity, Long> implements WindowOwnerService { public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerDao, WindowOwnerEntity, Long> implements WindowOwnerService {
...@@ -32,36 +36,53 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -32,36 +36,53 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
@Autowired @Autowired
private DeptService deptService; private DeptService deptService;
@Override
protected void saveBefore(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.setWindowCount(entity.getWindowOwnerDetailList().size());
}
}
@Override
protected void updateBefore(WindowOwnerEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.setWindowCount(entity.getWindowOwnerDetailList().size());
}
}
@Override @Override
protected void saveAfter(WindowOwnerEntity entity, Context context) throws AppException { protected void saveAfter(WindowOwnerEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())){ if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.getWindowOwnerDetailList().stream().peek(item->{ entity.getWindowOwnerDetailList().stream().peek(item -> {
item.setOwnerId(entity.getId()); item.setOwnerId(entity.getId());
item.setCreateUserId(this.getContextUserId(context)); item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date()); item.setCreateTime(new Date());
}).count(); }).count();
DeptEntity deptEntity = deptService.get(entity.getId()); DeptEntity deptEntity = deptService.get(entity.getId());
entity.setDeptName(deptEntity==null?"":deptEntity.getDeptName()); entity.setDeptName(deptEntity == null ? "" : deptEntity.getDeptName());
entity.setNumber(entity.getWindowOwnerDetailList().size()+""); entity.setNumber(entity.getWindowOwnerDetailList().size() + "");
windowOwnerDetailService.save(entity.getWindowOwnerDetailList()); windowOwnerDetailService.save(entity.getWindowOwnerDetailList());
} }
super.saveAfter(entity, context); super.saveAfter(entity, context);
} }
@Override @Override
protected void updateAfter(WindowOwnerEntity entity, Context context) throws AppException { protected void updateAfter(WindowOwnerEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())){ if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
Long[] windowOwnerDetailIds = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerId(entity.getId())).stream().map(WindowOwnerDetailEntity::getId).toArray(Long[]::new); Long[] windowOwnerDetailIds = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerId(entity.getId())).stream().map(WindowOwnerDetailEntity::getId).toArray(Long[]::new);
windowOwnerDetailService.remove(windowOwnerDetailIds,context); windowOwnerDetailService.remove(windowOwnerDetailIds, context);
entity.getWindowOwnerDetailList().stream().peek(item ->{ entity.getWindowOwnerDetailList().stream().peek(item -> {
item.setOwnerId(entity.getId()); item.setOwnerId(entity.getId());
item.setCreateUserId(this.getContextUserId(context)); item.setCreateUserId(this.getContextUserId(context));
item.setCreateTime(new Date()); item.setCreateTime(new Date());
item.setUpdateUserId(this.getContextUserId(context)); item.setUpdateUserId(this.getContextUserId(context));
item.setUpdateTime(new Date()); item.setUpdateTime(new Date());
}).count(); }).count();
entity.setNumber(entity.getWindowOwnerDetailList().size()+""); entity.setNumber(entity.getWindowOwnerDetailList().size() + "");
windowOwnerDetailService.save(entity.getWindowOwnerDetailList()); windowOwnerDetailService.save(entity.getWindowOwnerDetailList());
} }
super.updateAfter(entity, context); super.updateAfter(entity, context);
...@@ -70,7 +91,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -70,7 +91,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
@Override @Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException { protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<WindowOwnerDetailEntity> windowOwnerDetaillist = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerIdList(Arrays.asList(ids))); List<WindowOwnerDetailEntity> windowOwnerDetaillist = windowOwnerDetailService.find(new WindowOwnerDetailQuery().ownerIdList(Arrays.asList(ids)));
windowOwnerDetailService.removeList(windowOwnerDetaillist,context); windowOwnerDetailService.removeList(windowOwnerDetaillist, context);
super.removeAfter(ids, context, result); super.removeAfter(ids, context, result);
} }
} }
\ No newline at end of file
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
<result property="email" column="email" /> <result property="email" column="email" />
<result property="qq" column="qq" /> <result property="qq" column="qq" />
<result property="userType" column="userType" /> <result property="userType" column="userType" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
<result property="siteIds" column="siteIds" />
<result property="areaCodes" column="areaCodes" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="customerId" column="customerId" /> <result property="customerId" column="customerId" />
<result property="createTime" column="createTime" /> <result property="createTime" column="createTime" />
...@@ -26,6 +22,11 @@ ...@@ -26,6 +22,11 @@
<result property="createUserName" column="createUserName" /> <result property="createUserName" column="createUserName" />
<result property="lastLoginTime" column="lastLoginTime" /> <result property="lastLoginTime" column="lastLoginTime" />
<result property="lastLoginAddress" column="lastLoginAddress" /> <result property="lastLoginAddress" column="lastLoginAddress" />
<result property="deptId" column="deptId" />
<result property="deptName" column="deptName" />
<result property="siteIds" column="siteIds" />
<result property="areaCodes" column="areaCodes" />
<result property="dingUserId" column="dingUserId" />
</resultMap> </resultMap>
...@@ -63,18 +64,6 @@ ...@@ -63,18 +64,6 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('userType') or colPickMode == 1 and data.containsKey('userType')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('userType') or colPickMode == 1 and data.containsKey('userType')))">
a.userType, a.userType,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteIds') or colPickMode == 1 and data.containsKey('siteIds')))">
a.siteIds,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaCodes') or colPickMode == 1 and data.containsKey('areaCodes')))">
a.areaCodes,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('status') or colPickMode == 1 and data.containsKey('status')))">
a.status, a.status,
</if> </if>
...@@ -96,23 +85,38 @@ ...@@ -96,23 +85,38 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('lastLoginAddress') or colPickMode == 1 and data.containsKey('lastLoginAddress')))">
a.lastLoginAddress, a.lastLoginAddress,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptId') or colPickMode == 1 and data.containsKey('deptId')))">
a.deptId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deptName') or colPickMode == 1 and data.containsKey('deptName')))">
a.deptName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteIds') or colPickMode == 1 and data.containsKey('siteIds')))">
a.siteIds,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('areaCodes') or colPickMode == 1 and data.containsKey('areaCodes')))">
a.areaCodes,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('dingUserId') or colPickMode == 1 and data.containsKey('dingUserId')))">
a.dingUserId,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="UserEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_user insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,deptId,deptName,siteIds,areaCodes,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress) (loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,dingUserId)
VALUES VALUES
(#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress}) (#{loginName},#{loginPwd},#{loginLimitAddress},#{realName},#{mobile},#{phone},#{email},#{qq},#{userType},#{status},#{customerId},#{createTime},#{createUserId},#{createUserName},#{lastLoginTime},#{lastLoginAddress},#{deptId},#{deptName},#{siteIds},#{areaCodes},#{dingUserId})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_user insert into mortals_xhx_user
(loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,deptId,deptName,siteIds,areaCodes,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress) (loginName,loginPwd,loginLimitAddress,realName,mobile,phone,email,qq,userType,status,customerId,createTime,createUserId,createUserName,lastLoginTime,lastLoginAddress,deptId,deptName,siteIds,areaCodes,dingUserId)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress}) (#{item.loginName},#{item.loginPwd},#{item.loginLimitAddress},#{item.realName},#{item.mobile},#{item.phone},#{item.email},#{item.qq},#{item.userType},#{item.status},#{item.customerId},#{item.createTime},#{item.createUserId},#{item.createUserName},#{item.lastLoginTime},#{item.lastLoginAddress},#{item.deptId},#{item.deptName},#{item.siteIds},#{item.areaCodes},#{item.dingUserId})
</foreach> </foreach>
</insert> </insert>
...@@ -152,21 +156,6 @@ ...@@ -152,21 +156,6 @@
<if test="(colPickMode==0 and data.containsKey('userTypeIncrement')) or (colPickMode==1 and !data.containsKey('userTypeIncrement'))"> <if test="(colPickMode==0 and data.containsKey('userTypeIncrement')) or (colPickMode==1 and !data.containsKey('userTypeIncrement'))">
a.userType=ifnull(a.userType,0) + #{data.userTypeIncrement}, a.userType=ifnull(a.userType,0) + #{data.userTypeIncrement},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIds')) or (colPickMode==1 and !data.containsKey('siteIds'))">
a.siteIds=#{data.siteIds},
</if>
<if test="(colPickMode==0 and data.containsKey('areaCodes')) or (colPickMode==1 and !data.containsKey('areaCodes'))">
a.areaCodes=#{data.areaCodes},
</if>
<if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))"> <if test="(colPickMode==0 and data.containsKey('status')) or (colPickMode==1 and !data.containsKey('status'))">
a.status=#{data.status}, a.status=#{data.status},
</if> </if>
...@@ -197,6 +186,24 @@ ...@@ -197,6 +186,24 @@
<if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))"> <if test="(colPickMode==0 and data.containsKey('lastLoginAddress')) or (colPickMode==1 and !data.containsKey('lastLoginAddress'))">
a.lastLoginAddress=#{data.lastLoginAddress}, a.lastLoginAddress=#{data.lastLoginAddress},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('deptId')) or (colPickMode==1 and !data.containsKey('deptId'))">
a.deptId=#{data.deptId},
</if>
<if test="(colPickMode==0 and data.containsKey('deptIdIncrement')) or (colPickMode==1 and !data.containsKey('deptIdIncrement'))">
a.deptId=ifnull(a.deptId,0) + #{data.deptIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('deptName')) or (colPickMode==1 and !data.containsKey('deptName'))">
a.deptName=#{data.deptName},
</if>
<if test="(colPickMode==0 and data.containsKey('siteIds')) or (colPickMode==1 and !data.containsKey('siteIds'))">
a.siteIds=#{data.siteIds},
</if>
<if test="(colPickMode==0 and data.containsKey('areaCodes')) or (colPickMode==1 and !data.containsKey('areaCodes'))">
a.areaCodes=#{data.areaCodes},
</if>
<if test="(colPickMode==0 and data.containsKey('dingUserId')) or (colPickMode==1 and !data.containsKey('dingUserId'))">
a.dingUserId=#{data.dingUserId},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -277,39 +284,6 @@ ...@@ -277,39 +284,6 @@
</choose> </choose>
</foreach> </foreach>
</trim> </trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
<trim prefix="siteIds=(case" suffix="ELSE siteIds end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('siteIds')) or (colPickMode==1 and !item.containsKey('siteIds'))">
when a.id=#{item.id} then #{item.siteIds}
</if>
</foreach>
</trim>
<trim prefix="areaCodes=(case" suffix="ELSE areaCodes end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('areaCodes')) or (colPickMode==1 and !item.containsKey('areaCodes'))">
when a.id=#{item.id} then #{item.areaCodes}
</if>
</foreach>
</trim>
<trim prefix="status=(case" suffix="ELSE status end),"> <trim prefix="status=(case" suffix="ELSE status end),">
<foreach collection="data.dataList" item="item" index="index" separator="" > <foreach collection="data.dataList" item="item" index="index" separator="" >
<choose> <choose>
...@@ -374,6 +348,46 @@ ...@@ -374,6 +348,46 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="deptId=(case" suffix="ELSE deptId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('deptId')) or (colPickMode==1 and !item.containsKey('deptId'))">
when a.id=#{item.id} then #{item.deptId}
</when>
<when test="(colPickMode==0 and item.containsKey('deptIdIncrement')) or (colPickMode==1 and !item.containsKey('deptIdIncrement'))">
when a.id=#{item.id} then ifnull(a.deptId,0) + #{item.deptIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="deptName=(case" suffix="ELSE deptName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('deptName')) or (colPickMode==1 and !item.containsKey('deptName'))">
when a.id=#{item.id} then #{item.deptName}
</if>
</foreach>
</trim>
<trim prefix="siteIds=(case" suffix="ELSE siteIds end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('siteIds')) or (colPickMode==1 and !item.containsKey('siteIds'))">
when a.id=#{item.id} then #{item.siteIds}
</if>
</foreach>
</trim>
<trim prefix="areaCodes=(case" suffix="ELSE areaCodes end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('areaCodes')) or (colPickMode==1 and !item.containsKey('areaCodes'))">
when a.id=#{item.id} then #{item.areaCodes}
</if>
</foreach>
</trim>
<trim prefix="dingUserId=(case" suffix="ELSE dingUserId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('dingUserId')) or (colPickMode==1 and !item.containsKey('dingUserId'))">
when a.id=#{item.id} then #{item.dingUserId}
</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=")">
...@@ -712,96 +726,6 @@ ...@@ -712,96 +726,6 @@
${_conditionType_} a.userType <![CDATA[ <= ]]> #{${_conditionParam_}.userTypeEnd} ${_conditionType_} a.userType <![CDATA[ <= ]]> #{${_conditionParam_}.userTypeEnd}
</if> </if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIds')">
<if test="conditionParamRef.siteIds != null and conditionParamRef.siteIds != ''">
${_conditionType_} a.siteIds like #{${_conditionParam_}.siteIds}
</if>
<if test="conditionParamRef.siteIds == null">
${_conditionType_} a.siteIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdsList') and conditionParamRef.siteIdsList.size() > 0">
${_conditionType_} a.siteIds in
<foreach collection="conditionParamRef.siteIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdsNotList') and conditionParamRef.siteIdsNotList.size() > 0">
${_conditionType_} a.siteIds not in
<foreach collection="conditionParamRef.siteIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodes')">
<if test="conditionParamRef.areaCodes != null and conditionParamRef.areaCodes != ''">
${_conditionType_} a.areaCodes like #{${_conditionParam_}.areaCodes}
</if>
<if test="conditionParamRef.areaCodes == null">
${_conditionType_} a.areaCodes is null
</if>
</if>
<if test="conditionParamRef.containsKey('areaCodesList') and conditionParamRef.areaCodesList.size() > 0">
${_conditionType_} a.areaCodes in
<foreach collection="conditionParamRef.areaCodesList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodesNotList') and conditionParamRef.areaCodesNotList.size() > 0">
${_conditionType_} a.areaCodes not in
<foreach collection="conditionParamRef.areaCodesNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('status')"> <if test="conditionParamRef.containsKey('status')">
<if test="conditionParamRef.status != null "> <if test="conditionParamRef.status != null ">
${_conditionType_} a.status = #{${_conditionParam_}.status} ${_conditionType_} a.status = #{${_conditionParam_}.status}
...@@ -955,6 +879,117 @@ ...@@ -955,6 +879,117 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('deptId')">
<if test="conditionParamRef.deptId != null ">
${_conditionType_} a.deptId = #{${_conditionParam_}.deptId}
</if>
<if test="conditionParamRef.deptId == null">
${_conditionType_} a.deptId is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptIdList') and conditionParamRef.deptIdList.size() > 0">
${_conditionType_} a.deptId in
<foreach collection="conditionParamRef.deptIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdNotList') and conditionParamRef.deptIdNotList.size() > 0">
${_conditionType_} a.deptId not in
<foreach collection="conditionParamRef.deptIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptIdStart') and conditionParamRef.deptIdStart != null">
${_conditionType_} a.deptId <![CDATA[ >= ]]> #{${_conditionParam_}.deptIdStart}
</if>
<if test="conditionParamRef.containsKey('deptIdEnd') and conditionParamRef.deptIdEnd != null">
${_conditionType_} a.deptId <![CDATA[ <= ]]> #{${_conditionParam_}.deptIdEnd}
</if>
<if test="conditionParamRef.containsKey('deptName')">
<if test="conditionParamRef.deptName != null and conditionParamRef.deptName != ''">
${_conditionType_} a.deptName like #{${_conditionParam_}.deptName}
</if>
<if test="conditionParamRef.deptName == null">
${_conditionType_} a.deptName is null
</if>
</if>
<if test="conditionParamRef.containsKey('deptNameList') and conditionParamRef.deptNameList.size() > 0">
${_conditionType_} a.deptName in
<foreach collection="conditionParamRef.deptNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deptNameNotList') and conditionParamRef.deptNameNotList.size() > 0">
${_conditionType_} a.deptName not in
<foreach collection="conditionParamRef.deptNameNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIds')">
<if test="conditionParamRef.siteIds != null and conditionParamRef.siteIds != ''">
${_conditionType_} a.siteIds like #{${_conditionParam_}.siteIds}
</if>
<if test="conditionParamRef.siteIds == null">
${_conditionType_} a.siteIds is null
</if>
</if>
<if test="conditionParamRef.containsKey('siteIdsList') and conditionParamRef.siteIdsList.size() > 0">
${_conditionType_} a.siteIds in
<foreach collection="conditionParamRef.siteIdsList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('siteIdsNotList') and conditionParamRef.siteIdsNotList.size() > 0">
${_conditionType_} a.siteIds not in
<foreach collection="conditionParamRef.siteIdsNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodes')">
<if test="conditionParamRef.areaCodes != null and conditionParamRef.areaCodes != ''">
${_conditionType_} a.areaCodes like #{${_conditionParam_}.areaCodes}
</if>
<if test="conditionParamRef.areaCodes == null">
${_conditionType_} a.areaCodes is null
</if>
</if>
<if test="conditionParamRef.containsKey('areaCodesList') and conditionParamRef.areaCodesList.size() > 0">
${_conditionType_} a.areaCodes in
<foreach collection="conditionParamRef.areaCodesList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('areaCodesNotList') and conditionParamRef.areaCodesNotList.size() > 0">
${_conditionType_} a.areaCodes not in
<foreach collection="conditionParamRef.areaCodesNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dingUserId')">
<if test="conditionParamRef.dingUserId != null and conditionParamRef.dingUserId != ''">
${_conditionType_} a.dingUserId like #{${_conditionParam_}.dingUserId}
</if>
<if test="conditionParamRef.dingUserId == null">
${_conditionType_} a.dingUserId is null
</if>
</if>
<if test="conditionParamRef.containsKey('dingUserIdList') and conditionParamRef.dingUserIdList.size() > 0">
${_conditionType_} a.dingUserId in
<foreach collection="conditionParamRef.dingUserIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('dingUserIdNotList') and conditionParamRef.dingUserIdNotList.size() > 0">
${_conditionType_} a.dingUserId not in
<foreach collection="conditionParamRef.dingUserIdNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -1018,26 +1053,6 @@ ...@@ -1018,26 +1053,6 @@
<if test='orderCol.userType != null and "DESC".equalsIgnoreCase(orderCol.userType)'>DESC</if> <if test='orderCol.userType != null and "DESC".equalsIgnoreCase(orderCol.userType)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('siteIds')">
a.siteIds
<if test='orderCol.siteIds != null and "DESC".equalsIgnoreCase(orderCol.siteIds)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('areaCodes')">
a.areaCodes
<if test='orderCol.areaCodes != null and "DESC".equalsIgnoreCase(orderCol.areaCodes)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('status')"> <if test="orderCol.containsKey('status')">
a.status a.status
<if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if> <if test='orderCol.status != null and "DESC".equalsIgnoreCase(orderCol.status)'>DESC</if>
...@@ -1073,6 +1088,31 @@ ...@@ -1073,6 +1088,31 @@
<if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if> <if test='orderCol.lastLoginAddress != null and "DESC".equalsIgnoreCase(orderCol.lastLoginAddress)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('deptId')">
a.deptId
<if test='orderCol.deptId != null and "DESC".equalsIgnoreCase(orderCol.deptId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deptName')">
a.deptName
<if test='orderCol.deptName != null and "DESC".equalsIgnoreCase(orderCol.deptName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('siteIds')">
a.siteIds
<if test='orderCol.siteIds != null and "DESC".equalsIgnoreCase(orderCol.siteIds)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('areaCodes')">
a.areaCodes
<if test='orderCol.areaCodes != null and "DESC".equalsIgnoreCase(orderCol.areaCodes)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('dingUserId')">
a.dingUserId
<if test='orderCol.dingUserId != null and "DESC".equalsIgnoreCase(orderCol.dingUserId)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<mapper namespace="com.mortals.xhx.module.check.dao.ibatis.CheckAllRecordDaoImpl"> <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="getList" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="com.mortals.xhx.module.check.model.vo.CheckAllRecordVo">
SELECT * FROM (
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1 SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if> <if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if> <if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
...@@ -57,5 +58,64 @@ ...@@ -57,5 +58,64 @@
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if> <if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if> <if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
) AS a
</select>
<select id="getListCount" parameterType="com.mortals.xhx.module.check.model.CheckAllRecordQuery" resultType="int">
SELECT count(1) FROM (
SELECT id,recordId,staffId,staffName,workNum,deptId,deptName,ruleId,ruleName,subAddType,score,subMethod,checkTime,createTime AS deductTime,1 AS checkType ,'attend' AS performType FROM mortals_xhx_check_attend_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 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 ,'effect' AS performType FROM mortals_xhx_check_effect_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 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 ,'complain' AS performType FROM mortals_xhx_check_complain_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 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 ,'gowork' AS performType FROM mortals_xhx_check_gowork_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 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 ,'review' AS performType FROM mortals_xhx_check_review_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 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 ,'other' AS performType FROM mortals_xhx_check_other_record WHERE 1=1
<if test="checkStatus != null and checkStatus!=''"> AND checkStatus = #{checkStatus} </if>
<if test="subMethod != null and subMethod!=''"> AND subMethod = #{subMethod} </if>
<if test="subAddType != null and subAddType!=''"> AND subAddType = #{subAddType} </if>
<if test="staffId != null and staffId!=''"> AND staffId = #{staffId} </if>
<if test="checkTimeStart != null and checkTimeStart!=''"> AND checkTime <![CDATA[ >= ]]> STR_TO_DATE(left(concat(#{checkTimeStart},' 00:00:00'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="checkTimeEnd != null and checkTimeEnd!=''"> AND checkTime <![CDATA[ <= ]]> STR_TO_DATE(left(concat(#{checkTimeEnd},' 23:59:59'),19),'%Y-%m-%d %k:%i:%s') </if>
<if test="createUserId != null and createUserId!=''"> AND createUserId = #{createUserId} </if>
) AS a
</select> </select>
</mapper> </mapper>
\ No newline at end of file
<?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,13 @@ CREATE TABLE mortals_xhx_staff_perform_summary( ...@@ -641,3 +641,13 @@ 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) DEFAULT '' COMMENT '扣分人员' AFTER subMethod;
ALTER TABLE mortals_xhx_perform_attend_appeal ADD COLUMN `deductTime` datetime COMMENT '扣分时间' AFTER deductPerson;
ALTER TABLE mortals_xhx_user ADD COLUMN `dingUserId` varchar(64) DEFAULT '' COMMENT '钉钉userId' AFTER customerId;
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