Commit e2cb75e8 by lal

Merge branch 'develop' of develop-gitlab.youlingrc.com:8timerv2/8timerapiv200 into lal

parents a947a4b1 3ebd53d0
...@@ -74,6 +74,10 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> { ...@@ -74,6 +74,10 @@ public class QyzxEmpLogin extends Model<QyzxEmpLogin> {
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value="验证码 ",example="666666") @ApiModelProperty(value="验证码 ",example="666666")
private Integer code; private Integer code;
@TableField(exist = false)
@ApiModelProperty(value="是否主管",example="0 是 1 否")
private Integer isLeader;
@ApiModelProperty(value="权限 ",example="0,1,2") @ApiModelProperty(value="权限 ",example="0,1,2")
@TableField(exist = false) @TableField(exist = false)
......
...@@ -166,6 +166,9 @@ public class YgglMainEmp extends Model<YgglMainEmp> { ...@@ -166,6 +166,9 @@ public class YgglMainEmp extends Model<YgglMainEmp> {
@ApiModelProperty(value="部门岗位id 部门岗位id",example="101") @ApiModelProperty(value="部门岗位id 部门岗位id",example="101")
private Integer bmgwId; private Integer bmgwId;
@ApiModelProperty(value="部门名称",example="")
private String bmgwName;
@ApiModelProperty(value="修改时间",example="修改时间") @ApiModelProperty(value="修改时间",example="修改时间")
private Date updateTime; private Date updateTime;
......
...@@ -588,6 +588,11 @@ public class LoginController { ...@@ -588,6 +588,11 @@ public class LoginController {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
Integer isLeader = zzglBmgwMMapper.selectCount(new QueryWrapper<ZzglBmgwM>().lambda()
.eq(ZzglBmgwM::getLeader, qyzxEmpLogin1.getId())
.eq(ZzglBmgwM::getOrgCode, qyzxEmpLogin1.getOrgId())) > 0 ? 0 : 1;
qyzxEmpLogin1.setIsLeader(isLeader);
List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId()); List<QysDto> qys = qyzxEmpLoginMapper.getQys(qyzxEmpLogin1.getId());
if (qys.size() == 0) if (qys.size() == 0)
......
...@@ -355,6 +355,8 @@ public class DzhtController { ...@@ -355,6 +355,8 @@ public class DzhtController {
} else { } else {
DzhtController2 d = new DzhtController2(); DzhtController2 d = new DzhtController2();
accountId = d.grzc(userBean, empNum); accountId = d.grzc(userBean, empNum);
if (accountId.equals("IDCARD-ERROR"))
return ResultUtil.error("请先完善身份证信息!");
} }
grrz.setAccountId(accountId); grrz.setAccountId(accountId);
...@@ -623,7 +625,7 @@ public class DzhtController { ...@@ -623,7 +625,7 @@ public class DzhtController {
code = a.getBody().get("code").toString(); code = a.getBody().get("code").toString();
returnList.add(a.getBody()); returnList.add(a.getBody());
} }
if (code.equals("0")) { if (code != null && code.equals("0")) {
return ResultUtil.data(returnList); return ResultUtil.data(returnList);
} else { } else {
return ResultUtil.data(returnList, "查询失败"); return ResultUtil.data(returnList, "查询失败");
......
...@@ -112,6 +112,8 @@ public class DzhtController2 { ...@@ -112,6 +112,8 @@ public class DzhtController2 {
String name = yg.getName(); String name = yg.getName();
Integer type = yg.getZjType(); Integer type = yg.getZjType();
String idType = null; String idType = null;
if (type == null)
return "IDCARD-ERROR";
if (type == 0) { if (type == 0) {
idType = "CRED_PSN_CH_IDCARD";// 大陆身份证 idType = "CRED_PSN_CH_IDCARD";// 大陆身份证
} else if (type == 1) { } else if (type == 1) {
......
...@@ -470,7 +470,7 @@ public class JxglController { ...@@ -470,7 +470,7 @@ public class JxglController {
.ne(aT.getIsUseNotFixd() == 1, JxglAppraisalIndicatorsT::getType, .ne(aT.getIsUseNotFixd() == 1, JxglAppraisalIndicatorsT::getType,
IndicatorsType.NOT_FIXATION.getType())); IndicatorsType.NOT_FIXATION.getType()));
if (listAIT == null || listAIT.size() <= 0) { if (CollectionUtil.isEmpty(listAIT)) {
throw new CustomException("考核指标不存在"); throw new CustomException("考核指标不存在");
} }
...@@ -504,7 +504,7 @@ public class JxglController { ...@@ -504,7 +504,7 @@ public class JxglController {
appraisalLog.setAppraisalId(appraisal.getId()); appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(bAP); appraisalLog.setExecutorId(bAP);
appraisalLog.setExecutorName(yME.getName()); appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.START.getType()); appraisalLog.setType(AppraisalLogType.START.getType());
appraisalLog.insert(); appraisalLog.insert();
} }
...@@ -541,7 +541,7 @@ public class JxglController { ...@@ -541,7 +541,7 @@ public class JxglController {
// 删除 绩效考核 // 删除 绩效考核
jxglPerformanceAppraisalMapper.deleteById(id); jxglPerformanceAppraisalMapper.deleteById(id);
if (aIds.size() > 0) { if (CollectionUtil.isNotEmpty(aIds)) {
// 批量删除 考核 // 批量删除 考核
jxglAppraisalMapper.deleteBatchIds(aIds); jxglAppraisalMapper.deleteBatchIds(aIds);
...@@ -745,10 +745,31 @@ public class JxglController { ...@@ -745,10 +745,31 @@ public class JxglController {
// 修改 考核状态 // 修改 考核状态
jxglAppraisalMapper.update( jxglAppraisalMapper.update(
JxglAppraisal.builder().performanceAppraisalId(id).sts(PerformanceAppraisalSts.TERMINATION_ASSESSMENT.getType()).build(), JxglAppraisal.builder().performanceAppraisalId(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build(),
new UpdateWrapper<JxglAppraisal>().lambda() new UpdateWrapper<JxglAppraisal>().lambda()
.eq(JxglAppraisal::getPerformanceAppraisalId, id) .eq(JxglAppraisal::getPerformanceAppraisalId, id)
); );
List<JxglAppraisal> listAppraisal = jxglAppraisalMapper.selectList(new QueryWrapper<JxglAppraisal>().lambda()
.select(JxglAppraisal::getId)
.eq(JxglAppraisal::getPerformanceAppraisalId, performanceAppraisal.getId()));
if (CollectionUtil.isNotEmpty(listAppraisal)) {
List<Integer> aIds = listAppraisal.stream().map(JxglAppraisal::getId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(aIds)) {
aIds.forEach(aId -> {
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(aId);
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TERMINATION_ASSESSMENT.getType());
appraisalLog.insert();
});
}
}
return ResultUtil.success(); return ResultUtil.success();
} }
...@@ -826,6 +847,23 @@ public class JxglController { ...@@ -826,6 +847,23 @@ public class JxglController {
IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(), query.getTotalPage()); IPage<JxglAppraisal> page = new Page<JxglAppraisal>(query.getCurrentPage(), query.getTotalPage());
query.setOrgCode(userBean.getOrgCode()); query.setOrgCode(userBean.getOrgCode());
List<Integer> empNums = CollUtil.toList();
if (query.getBmId() != null) {
List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), query.getBmId());
if (usersQuery != null) {
empNums = usersQuery.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
}else {
return ResultUtil.data(null);
}
if (empNums == null || empNums.size() == 0) {
return ResultUtil.data(null);
}
}
query.setEmpNums(empNums);
IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListByQuery(page, query); IPage<JxglAppraisal> pageA = jxglAppraisalMapper.selectListByQuery(page, query);
...@@ -925,6 +963,13 @@ public class JxglController { ...@@ -925,6 +963,13 @@ public class JxglController {
return ResultUtil.error("考核不存在"); return ResultUtil.error("考核不存在");
} else if (appraisal.getSts() <= AppraisalSts.RESULT_VERIFICATION.getType()) { } else if (appraisal.getSts() <= AppraisalSts.RESULT_VERIFICATION.getType()) {
JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById(); JxglAppraisal.builder().id(id).sts(AppraisalSts.TERMINATION_ASSESSMENT.getType()).build().updateById();
JxglAppraisalLog appraisalLog = JxglAppraisalLog.builder().build();
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(userBean.getEmpNum());
appraisalLog.setExecutorName(userBean.getUserInfo().getName());
appraisalLog.setType(AppraisalLogType.TERMINATION_ASSESSMENT.getType());
appraisalLog.insert();
} else if (appraisal.getSts() == AppraisalSts.ASSESSMENT_COMPLETE.getType()) { } else if (appraisal.getSts() == AppraisalSts.ASSESSMENT_COMPLETE.getType()) {
return ResultUtil.error("考核已完成,无法终止"); return ResultUtil.error("考核已完成,无法终止");
} else if (appraisal.getSts() == AppraisalSts.TERMINATION_ASSESSMENT.getType()) { } else if (appraisal.getSts() == AppraisalSts.TERMINATION_ASSESSMENT.getType()) {
...@@ -951,13 +996,13 @@ public class JxglController { ...@@ -951,13 +996,13 @@ public class JxglController {
if (query.getBmId() != null) { if (query.getBmId() != null) {
List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), query.getBmId()); List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), query.getBmId());
if (usersQuery != null) { if (CollectionUtil.isNotEmpty(usersQuery)) {
empNums = usersQuery.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList()); empNums = usersQuery.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
}else { }else {
return ResultUtil.data(null); return ResultUtil.data(null);
} }
if (empNums == null || empNums.size() == 0) { if (CollectionUtil.isEmpty(empNums)) {
return ResultUtil.data(null); return ResultUtil.data(null);
} }
} }
......
...@@ -25,6 +25,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; ...@@ -25,6 +25,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Console; import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
...@@ -361,7 +362,7 @@ public class SpmkController { ...@@ -361,7 +362,7 @@ public class SpmkController {
.eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())) > 0) { .eq(SpmkCustomApproval::getOrgCode, userBean.getOrgCode())) > 0) {
return ResultUtil.error("自定义审批名重复!"); return ResultUtil.error("自定义审批名重复!");
} }
ca.setOrgCode(userBean.getOrgCode());
ca.setFroms(ObjectUtil.serialize(spmkCustomApprovalDto.getFroms())); ca.setFroms(ObjectUtil.serialize(spmkCustomApprovalDto.getFroms()));
ca.setRouter(ObjectUtil.serialize(spmkCustomApprovalDto.getRouter())); ca.setRouter(ObjectUtil.serialize(spmkCustomApprovalDto.getRouter()));
...@@ -468,7 +469,9 @@ public class SpmkController { ...@@ -468,7 +469,9 @@ public class SpmkController {
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>() YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>()
.lambda() .lambda()
.select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName) .select(YgglMainEmp::getHeadUrl,YgglMainEmp::getName)
.eq(YgglMainEmp::getEmpNum, userBean.getEmpNum())); .eq(YgglMainEmp::getEmpNum, userBean.getEmpNum())
.eq(YgglMainEmp::getOrgCode, userBean.getOrgCode())
);
if (ygglMainEmp == null) if (ygglMainEmp == null)
return ResultUtil.error("发起人不存在!"); return ResultUtil.error("发起人不存在!");
...@@ -477,13 +480,13 @@ public class SpmkController { ...@@ -477,13 +480,13 @@ public class SpmkController {
Router router = spmkApproveSummaryDto.getRouter(); Router router = spmkApproveSummaryDto.getRouter();
List<Router> routers = router.getChildren(); List<Router> routers = router.getChildren();
if (routers != null && routers.size() > 0) { if (CollectionUtil.isNotEmpty(routers)) {
List<Relation> relations = routers.get(0).getRelation(); List<Relation> relations = routers.get(0).getRelation();
if (relations == null || relations.size() < 1) { if (relations == null || relations.size() < 1) {
return ResultUtil.error("无法发起,请完善审批流程"); return ResultUtil.error("无法发起,请完善审批流程");
} }
List<User> users = relations.get(0).getUsers(); List<User> users = relations.get(0).getUsers();
if (users == null || users.size() < 1) { if (CollectionUtil.isEmpty(users)) {
return ResultUtil.error("无法发起,请完善审批流程"); return ResultUtil.error("无法发起,请完善审批流程");
} }
...@@ -537,7 +540,6 @@ public class SpmkController { ...@@ -537,7 +540,6 @@ public class SpmkController {
throw new CustomException("审批详情-新增异常"); throw new CustomException("审批详情-新增异常");
return ResultUtil.success(); return ResultUtil.success();
} }
//TODO 审批汇总 //TODO 审批汇总
...@@ -606,17 +608,18 @@ public class SpmkController { ...@@ -606,17 +608,18 @@ public class SpmkController {
// @BindingResultCtrol(title = "审批人审批") // @BindingResultCtrol(title = "审批人审批")
public Result<Object> approving(@CurrentUser UserBean userBean,@Validated @RequestBody ApprovingDto approvingDto) throws Exception { public Result<Object> approving(@CurrentUser UserBean userBean,@Validated @RequestBody ApprovingDto approvingDto) throws Exception {
Integer asId = approvingDto.getAsId();
SpmkApproveDetail ad = SpmkApproveDetail.builder().build().selectOne(new QueryWrapper<SpmkApproveDetail>() SpmkApproveDetail ad = SpmkApproveDetail.builder().build().selectOne(new QueryWrapper<SpmkApproveDetail>()
.lambda() .lambda()
.select(SpmkApproveDetail::getId, .select(SpmkApproveDetail::getId,
SpmkApproveDetail::getRequestData, SpmkApproveDetail::getRequestData,
SpmkApproveDetail::getFlowChildren) SpmkApproveDetail::getFlowChildren)
.eq(SpmkApproveDetail::getApproveSummaryId, approvingDto.getAsId())); .eq(SpmkApproveDetail::getApproveSummaryId, asId));
// 查询 SpmkApproveSummary 状态 // 查询 SpmkApproveSummary 状态
SpmkApproveSummary aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda() SpmkApproveSummary aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts) .select(SpmkApproveSummary::getSts)
.eq(SpmkApproveSummary::getId, approvingDto.getAsId())); .eq(SpmkApproveSummary::getId, asId));
if (aSummary.getSts() > SpmkEnumInterface.ApproveSummarySts.IN.ordinal()) { if (aSummary.getSts() > SpmkEnumInterface.ApproveSummarySts.IN.ordinal()) {
return ResultUtil.error("该审批已结束!"); return ResultUtil.error("该审批已结束!");
...@@ -643,7 +646,7 @@ public class SpmkController { ...@@ -643,7 +646,7 @@ public class SpmkController {
// 审批逻辑 // 审批逻辑
RouterUtils.approving( RouterUtils.approving(
listFlowChildren, listFlowChildren,
approvingDto.getAsId(), asId,
approvingDto.getExecuteRecordId(), approvingDto.getExecuteRecordId(),
approvingDto.getExecutorId(), approvingDto.getExecutorId(),
approvingDto.getOpinion(), approvingDto.getOpinion(),
...@@ -659,13 +662,14 @@ public class SpmkController { ...@@ -659,13 +662,14 @@ public class SpmkController {
// 查询 SpmkApproveSummary 状态 // 查询 SpmkApproveSummary 状态
aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda() aSummary = spmkApproveSummaryMapper.selectOne(new QueryWrapper<SpmkApproveSummary>().lambda()
.select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType) .select(SpmkApproveSummary::getSts,SpmkApproveSummary::getAssoType)
.eq(SpmkApproveSummary::getId, approvingDto.getAsId())); .eq(SpmkApproveSummary::getId, asId));
if (aSummary.getSts() != SpmkEnumInterface.ApproveSummarySts.REFUSE.ordinal()) { if (aSummary.getSts() != SpmkEnumInterface.ApproveSummarySts.REFUSE.ordinal()) {
SpmkApproveSummary.builder().id(approvingDto.getAsId()).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById(); SpmkApproveSummary.builder().id(asId).currentApprover(CommonEnum.NULL_STR.getDesc()).endTime(new Date()).sts(ApproveSummarySts.FINISH.ordinal()).build().updateById();
JSONObject jSONObject = ObjectUtil.deserialize(ad.getRequestData()); JSONObject jSONObject = ObjectUtil.deserialize(ad.getRequestData());
jSONObject.set("approveId", approvingDto.getAsId()); jSONObject.set("approveId", FromData.builder().value(String.valueOf(asId)));
//审批完成后 业务 //审批完成后 业务
SpmkAssoBusiness sab = SpmkAssoBusinessFactory.createSpmkAssoType(ApproveEnum.getEnums(aSummary.getAssoType())); SpmkAssoBusiness sab = SpmkAssoBusinessFactory.createSpmkAssoType(ApproveEnum.getEnums(aSummary.getAssoType()));
if (sab != null) if (sab != null)
......
...@@ -42,6 +42,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; ...@@ -42,6 +42,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.BetweenFormater.Level; import cn.hutool.core.date.BetweenFormater.Level;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.IoUtil; import cn.hutool.core.io.IoUtil;
...@@ -83,6 +84,7 @@ import cn.timer.api.config.enums.CommonEnum; ...@@ -83,6 +84,7 @@ import cn.timer.api.config.enums.CommonEnum;
import cn.timer.api.config.enums.SysRoleType; import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.config.exception.Regular; import cn.timer.api.config.exception.Regular;
import cn.timer.api.config.validation.ValidList; import cn.timer.api.config.validation.ValidList;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dao.clazz.CommonAreaMapper; import cn.timer.api.dao.clazz.CommonAreaMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper; import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper; import cn.timer.api.dao.qyzx.QyzxEmpLoginMapper;
...@@ -91,6 +93,7 @@ import cn.timer.api.dao.yggl.YgglMainEmpMapper; ...@@ -91,6 +93,7 @@ import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.yggl.YgglMainLzbMapper; import cn.timer.api.dao.yggl.YgglMainLzbMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper; import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.AddygdaDto; import cn.timer.api.dto.yggl.AddygdaDto;
import cn.timer.api.dto.yggl.EmpQuery;
import cn.timer.api.dto.yggl.ImportEmpDto; import cn.timer.api.dto.yggl.ImportEmpDto;
import cn.timer.api.dto.yggl.LoginInfoDto; import cn.timer.api.dto.yggl.LoginInfoDto;
import cn.timer.api.dto.yggl.LoginerChargeDto; import cn.timer.api.dto.yggl.LoginerChargeDto;
...@@ -338,9 +341,7 @@ public class YgglController { ...@@ -338,9 +341,7 @@ public class YgglController {
Integer j = ygQueryDto.getJobStatus(); Integer j = ygQueryDto.getJobStatus();
Integer t = ygQueryDto.getJobType(); Integer t = ygQueryDto.getJobType();
String q = ygQueryDto.getQuery(); String q = ygQueryDto.getQuery();
Page<YgglMainEmp> page = new Page<YgglMainEmp>( Page<YgglMainEmp> page = new Page<YgglMainEmp>(ygQueryDto.getCurrentPage(), ygQueryDto.getTotalPage());
ygQueryDto.getCurrentPage() == null ? 1 : ygQueryDto.getCurrentPage(),
ygQueryDto.getTotalPage() == null ? 10 : ygQueryDto.getTotalPage());
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>(); QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda() queryWrapper.lambda()
.select(YgglMainEmp::getName, YgglMainEmp::getEmpNum, YgglMainEmp::getBmgwId, YgglMainEmp::getRzTime, .select(YgglMainEmp::getName, YgglMainEmp::getEmpNum, YgglMainEmp::getBmgwId, YgglMainEmp::getRzTime,
...@@ -355,6 +356,45 @@ public class YgglController { ...@@ -355,6 +356,45 @@ public class YgglController {
return ResultUtil.data(ygglMainEmpPage); return ResultUtil.data(ygglMainEmpPage);
} }
@Autowired
private ZzglBmgwMService zzglBmgwMService;
/**
* 员工列表-分页
*
* @param
* @return
*/
@PostMapping(value = "/selects_emp")
@ApiOperation(value = "6.员工列表-分页", httpMethod = "POST", notes = "员工列表-分页")
@ApiOperationSupport(order = 6)
public Result<Object> selectsEmp(@CurrentUser UserBean userBean, @RequestBody EmpQuery empQuery) {
Integer orgCode = userBean.getOrgCode();
Integer bmgwId = empQuery.getBmgwid();
Page<YgglMainEmp> page = new Page<YgglMainEmp>(empQuery.getCurrentPage(), empQuery.getTotalPage());
List<Integer> empNums = CollUtil.toList();
if (bmgwId != null) {
List<YgglMainEmp> usersQuery = zzglBmgwMService.selectOtherlistent(userBean.getOrgCode(), bmgwId);
if (CollectionUtil.isNotEmpty(usersQuery)) {
empNums = usersQuery.stream().map(YgglMainEmp::getEmpNum).collect(Collectors.toList());
}else {
return ResultUtil.data(null);
}
if (CollectionUtil.isEmpty(empNums)) {
return ResultUtil.data(null);
}
}
empQuery.setOrgCode(orgCode);
empQuery.setEmpNums(empNums);
IPage<YgglMainEmp> ygglMainEmpPage = ygglMainEmpMapper.selectME(page, empQuery);
List<YgglMainEmp> ygglMainEmps = ygglMainEmpPage.getRecords();
return ResultUtil.data(page, ygglMainEmps);
}
/** /**
* 导入员工档案 * 导入员工档案
...@@ -1511,8 +1551,8 @@ public class YgglController { ...@@ -1511,8 +1551,8 @@ public class YgglController {
@GetMapping(value = "/ygsbgjj") @GetMapping(value = "/ygsbgjj")
@ApiOperation(value = "65.获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "65.获取员工社保公积金", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 65) @ApiOperationSupport(order = 65)
public Result<List<YgglAttaSbgjj>> selectygsbgjj(@CurrentUser UserBean userBean) { public Result<YgglAttaSbgjj> selectygsbgjj(@CurrentUser UserBean userBean) {
List<YgglAttaSbgjj> ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectList( YgglAttaSbgjj ygglAttaSbgjj = YgglAttaSbgjj.builder().build().selectOne(
new QueryWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getOrgCode, userBean.getOrgCode()) new QueryWrapper<YgglAttaSbgjj>().lambda().eq(YgglAttaSbgjj::getOrgCode, userBean.getOrgCode())
.eq(YgglAttaSbgjj::getEmpNum, userBean.getEmpNum())); .eq(YgglAttaSbgjj::getEmpNum, userBean.getEmpNum()));
return ResultUtil.data(ygglAttaSbgjj); return ResultUtil.data(ygglAttaSbgjj);
......
...@@ -7,9 +7,12 @@ import org.springframework.stereotype.Repository; ...@@ -7,9 +7,12 @@ import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.timer.api.bean.yggl.YgglMainEmp; import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dto.yggl.EmpQuery;
import cn.timer.api.dto.yggl.YgCartogramDto; import cn.timer.api.dto.yggl.YgCartogramDto;
import cn.timer.api.dto.yggl.YgQueryDto; import cn.timer.api.dto.yggl.YgQueryDto;
import cn.timer.api.dto.yggl.YgbintuDto; import cn.timer.api.dto.yggl.YgbintuDto;
...@@ -119,4 +122,12 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> { ...@@ -119,4 +122,12 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @return * @return
*/ */
List<YgglCartogramDto> queryWorkingAge(UserBean userBean); List<YgglCartogramDto> queryWorkingAge(UserBean userBean);
/**
* 员工列表
* @param page
* @param empQuery
* @return
*/
IPage<YgglMainEmp> selectME(Page<YgglMainEmp> page,@Param("param") EmpQuery empQuery);
} }
package cn.timer.api.dto.jxgl; package cn.timer.api.dto.jxgl;
import java.util.List;
import javax.validation.constraints.Max; import javax.validation.constraints.Max;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
...@@ -36,4 +38,7 @@ public class AppraisalQuery extends Page{ ...@@ -36,4 +38,7 @@ public class AppraisalQuery extends Page{
@ApiModelProperty(value = "部门id", example = "") @ApiModelProperty(value = "部门id", example = "")
private Integer bmId; private Integer bmId;
@ApiModelProperty(value = "员工id列表", example = "")
private List<Integer> empNums;
} }
package cn.timer.api.dto.yggl;
import java.io.Serializable;
import java.util.List;
import cn.timer.api.utils.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class EmpQuery extends Page implements Serializable{
private static final long serialVersionUID = -1230023773946170942L;
@ApiModelProperty(value="工作性质0全职、1实习生、2兼职、3劳务派遣、4劳务、5派遣、6外包、7退休返聘",example="0")
private Integer jobType;
@ApiModelProperty(value="部门id",example="10")
private Integer bmgwid;
@ApiModelProperty(value="员工状态0试用、1正式、2离职中、3已离职",example="0")
private Integer jobStatus;
@ApiModelProperty(value="手机号、姓名",example="1388888888 or 张三")
private String query;
@ApiModelProperty(value="企业id",example="0")
private Integer orgCode;
@ApiModelProperty(value = "员工id列表", example = "")
private List<Integer> empNums;
}
...@@ -78,7 +78,7 @@ public class RouterUtils { ...@@ -78,7 +78,7 @@ public class RouterUtils {
public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse, boolean isAuditNext) throws NumberFormatException, ConvertException, Exception { public static List<Router> NextNode(List<Router> listRouter,JSONObject obj, boolean isFirse, boolean isAuditNext) throws NumberFormatException, ConvertException, Exception {
Router router; Router router;
if (listRouter != null && listRouter.size() != 0) { if (CollectionUtil.isNotEmpty(listRouter)) {
// 非条件节点 // 非条件节点
if (listRouter.size() == 1) { if (listRouter.size() == 1) {
router = listRouter.get(0); router = listRouter.get(0);
...@@ -291,7 +291,7 @@ public class RouterUtils { ...@@ -291,7 +291,7 @@ public class RouterUtils {
getIsFlowChildren(router.getChildren(), listFlowChildren); getIsFlowChildren(router.getChildren(), listFlowChildren);
} }
}else if (listRouter.size() > 1) { }else if (listRouter != null && listRouter.size() > 1) {
for (Router router2 : listRouter) { for (Router router2 : listRouter) {
if (router2.getFlow()) { if (router2.getFlow()) {
getIsFlowChildren(router2.getChildren(), listFlowChildren); getIsFlowChildren(router2.getChildren(), listFlowChildren);
......
...@@ -238,16 +238,31 @@ ...@@ -238,16 +238,31 @@
FROM jxgl_appraisal a FROM jxgl_appraisal a
LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode} LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode}
LEFT JOIN jxgl_process_node c ON a.id = c.appraisal_id AND c.sts = 1 LEFT JOIN jxgl_process_node c ON a.id = c.appraisal_id AND c.sts = 1
<!-- 缺部门 搜索 -->
WHERE a.performance_appraisal_id = #{param.id} WHERE a.performance_appraisal_id = #{param.id}
<if test="param.empNums != null and param.empNums.size() > 0">
<choose>
<when test="param.empNums.size() > 1">
AND b.emp_num IN
(
<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
#{it}
</foreach>
)
</when>
<otherwise>
AND b.emp_num = #{param.empNums[0]}
</otherwise>
</choose>
</if>
<if test="param.query != null and param.query != ''"> <if test="param.query != null and param.query != ''">
and ( AND (
b.name like CONCAT('%',#{param.query},'%') or b.name like CONCAT('%',#{param.query},'%') or
b.phone like CONCAT('%',#{param.query},'%') b.phone like CONCAT('%',#{param.query},'%')
) )
</if> </if>
<if test="param.sts != null"> <if test="param.sts != null">
and a.sts = #{param.sts} AND a.sts = #{param.sts}
</if> </if>
ORDER BY a.id DESC ORDER BY a.id DESC
...@@ -260,10 +275,11 @@ ...@@ -260,10 +275,11 @@
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id limit 1) limit 1) as bm_name, (SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = b.bmgw_id limit 1) limit 1) as bm_name,
(SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name (SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name
FROM jxgl_appraisal a FROM jxgl_appraisal a
LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num AND b.org_code = #{param.orgCode} LEFT JOIN yggl_main_emp b ON a.emp_num = b.emp_num
LEFT JOIN jxgl_process_node c ON a.id = c.appraisal_id AND c.sts = 1 LEFT JOIN jxgl_process_node c ON a.id = c.appraisal_id AND c.sts = 1
<where> <where>
AND b.org_code = #{param.orgCode}
<if test="param.empNums != null and param.empNums.size() > 0"> <if test="param.empNums != null and param.empNums.size() > 0">
<choose> <choose>
<when test="param.empNums.size() > 1"> <when test="param.empNums.size() > 1">
...@@ -275,7 +291,7 @@ ...@@ -275,7 +291,7 @@
) )
</when> </when>
<otherwise> <otherwise>
AND asso_id = #{param.empNums[0]} AND b.emp_num = #{param.empNums[0]}
</otherwise> </otherwise>
</choose> </choose>
</if> </if>
......
...@@ -137,6 +137,7 @@ ...@@ -137,6 +137,7 @@
SUM((CASE WHEN b.sts in (0,1) THEN 1 ELSE 0 END)) AS target_seting, SUM((CASE WHEN b.sts in (0,1) THEN 1 ELSE 0 END)) AS target_seting,
SUM((CASE WHEN b.sts in (2,3) THEN 1 ELSE 0 END)) AS performance_score, SUM((CASE WHEN b.sts in (2,3) THEN 1 ELSE 0 END)) AS performance_score,
SUM((CASE WHEN b.sts in (4,5) THEN 1 ELSE 0 END)) AS result_verification, SUM((CASE WHEN b.sts in (4,5) THEN 1 ELSE 0 END)) AS result_verification,
SUM((CASE WHEN b.sts = 6 THEN 1 ELSE 0 END)) AS termination_assessment,
SUM((CASE WHEN b.sts = 7 THEN 1 ELSE 0 END)) AS performance_archive SUM((CASE WHEN b.sts = 7 THEN 1 ELSE 0 END)) AS performance_archive
FROM jxgl_performance_appraisal a FROM jxgl_performance_appraisal a
LEFT JOIN jxgl_appraisal b ON a.id = b.performance_appraisal_id LEFT JOIN jxgl_appraisal b ON a.id = b.performance_appraisal_id
......
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
<result column="work_email" property="workEmail" /> <result column="work_email" property="workEmail" />
<result column="zpqd" property="zpqd" /> <result column="zpqd" property="zpqd" />
<result column="bmgw_id" property="bmgwId" /> <result column="bmgw_id" property="bmgwId" />
<result column="bmgw_name" property="bmgwName" />
<result column="org_code" property="orgCode" /> <result column="org_code" property="orgCode" />
<result column="unionid" property="unionid" /> <result column="unionid" property="unionid" />
<result column="openid" property="openid" /> <result column="openid" property="openid" />
...@@ -117,6 +119,23 @@ ...@@ -117,6 +119,23 @@
appopenid appopenid
</sql> </sql>
<sql id="Base_Column_List_a">
a.id,
a.emp_num,
a.phone,
a.head_url,
a.name,
a.english_name,
a.sex,
a.birthday,
a.jg,
a.job_type,
a.job_status,
a.rz_time,
a.bmgw_id,
a.org_code
</sql>
<sql id="Base_Column_List_Alias"> <sql id="Base_Column_List_Alias">
id YgglMainEmp_id, id YgglMainEmp_id,
emp_num YgglMainEmp_emp_num, emp_num YgglMainEmp_emp_num,
...@@ -180,6 +199,44 @@ ...@@ -180,6 +199,44 @@
WHERE e.org_code = #{orgCode} WHERE e.org_code = #{orgCode}
</select> </select>
<select id="selectME" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List_a" />,
(SELECT name FROM zzgl_bmgw_m WHERE id = (SELECT up_id FROM zzgl_bmgw_m WHERE id = a.bmgw_id limit 1) limit 1) as bmgw_name
FROM yggl_main_emp a
<where>
AND a.org_code = #{param.orgCode}
<if test="param.jobType != null">
AND a.job_type = #{param.jobType}
</if>
<if test="param.jobStatus != null">
AND a.job_status = #{param.jobStatus}
</if>
<if test="param.query != null and param.query != ''">
AND (
a.name like CONCAT('%',#{param.query},'%') or
a.phone like CONCAT('%',#{param.query},'%')
)
</if>
<if test="param.empNums != null and param.empNums.size() > 0">
<choose>
<when test="param.empNums.size() > 1">
AND a.emp_num IN
(
<foreach item="it" index="index" collection="param.empNums" separator="," close="" >
#{it}
</foreach>
)
</when>
<otherwise>
AND a.emp_num = #{param.empNums[0]}
</otherwise>
</choose>
</if>
</where>
</select>
<!-- benyueLz本月离职人数 --> <!-- benyueLz本月离职人数 -->
<select id="benyueLz" resultType="Integer"> <select id="benyueLz" resultType="Integer">
SELECT COUNT(datediff(CURDATE(),l.sjlz_time)) FROM yggl_main_lzb l WHERE datediff(CURDATE(),l.sjlz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode}; SELECT COUNT(datediff(CURDATE(),l.sjlz_time)) FROM yggl_main_lzb l WHERE datediff(CURDATE(),l.sjlz_time) <![CDATA[ <= ]]> 30 AND org_code = #{orgCode};
......
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