Commit 5377e2bb by 邓实川

冲突解决

parents 3b3ec5de 5ad449c7
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
......@@ -29,6 +30,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.lang.Console;
import cn.hutool.core.util.ObjectUtil;
import cn.timer.api.aspect.lang.annotation.Log;
import cn.timer.api.aspect.lang.annotation.Role;
......@@ -46,6 +48,7 @@ import cn.timer.api.bean.jxgl.JxglBasicSetting;
import cn.timer.api.bean.jxgl.JxglPerformanceAppraisal;
import cn.timer.api.bean.jxgl.JxglPerformanceRating;
import cn.timer.api.bean.jxgl.JxglProcessNode;
import cn.timer.api.bean.qyzx.QyzxEmpEntAsso;
import cn.timer.api.bean.spmk.SpmkApproveSummary;
import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
......@@ -61,6 +64,7 @@ import cn.timer.api.config.enuminterface.JxglEnumInterface.IndicatorsType;
import cn.timer.api.config.enuminterface.JxglEnumInterface.PerformanceAppraisalSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ProcessNodeSts;
import cn.timer.api.config.enuminterface.JxglEnumInterface.ProcessType;
import cn.timer.api.config.enums.SysRoleType;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.config.validation.ValidList;
import cn.timer.api.controller.jxgl.service.JxglService;
......@@ -79,6 +83,7 @@ import cn.timer.api.dao.jxgl.JxglBasicSettingMapper;
import cn.timer.api.dao.jxgl.JxglPerformanceAppraisalMapper;
import cn.timer.api.dao.jxgl.JxglPerformanceRatingMapper;
import cn.timer.api.dao.jxgl.JxglProcessNodeMapper;
import cn.timer.api.dao.qyzx.QyzxEmpEntAssoMapper;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.jxgl.AppraisalAssessment;
......@@ -158,6 +163,9 @@ public class JxglController {
@Autowired
private JxglAppraisalItemMapper jxglAppraisalItemMapper;
@Autowired
private QyzxEmpEntAssoMapper qyzxEmpEntAssoMapper;
// TODO 基础设置
/**
* 新增或编辑-基础设置
......@@ -454,8 +462,26 @@ public class JxglController {
if (ExecuteType.BEING_APPRAISAL_PERSON.getType().equals(executeType)) {
processNode.setExecutorId(bAP);
} else if (ExecuteType.LEADER.getType().equals(executeType)) {
processNode.setExecutorId(
ygglService.selectLeaderEmpNumById(userBean.getOrgCode(), bAP, pN.getLeaderTier()));
Integer leaderId = ygglService.selectLeaderEmpNumById(userBean.getOrgCode(), bAP, pN.getLeaderTier());
Console.log("bAP:"+bAP);
Console.log("leaderTier:"+pN.getLeaderTier());
Console.log("leaderId:"+leaderId);
if (leaderId == null) {
QyzxEmpEntAsso eEA = qyzxEmpEntAssoMapper.selectOne(new QueryWrapper<QyzxEmpEntAsso>().lambda()
.select(QyzxEmpEntAsso::getEmpNum)
.eq(QyzxEmpEntAsso::getOrgCode, orgCode)
.eq(QyzxEmpEntAsso::getUserType, SysRoleType.U_TYPE_ADMIN.getType()));
leaderId = eEA != null ? eEA.getEmpNum() : null;
// 当 该企业无管理员时 报错
if (leaderId == null) {
throw new CustomException("该企业不存在管理员,请联系客服");
}
}
processNode.setExecutorId(leaderId);
} else if (ExecuteType.SPECIFIED_MEMBER.getType().equals(executeType)) {
processNode.setExecutorId(pN.getExecutorId());
}
......@@ -502,8 +528,10 @@ public class JxglController {
});
YgglMainEmp yME = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getName).eq(YgglMainEmp::getOrgCode, orgCode).eq(YgglMainEmp::getEmpNum, bAP));
// YgglMainEmp yME = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
// .select(YgglMainEmp::getName)
// .eq(YgglMainEmp::getOrgCode, orgCode)
// .eq(YgglMainEmp::getEmpNum, bAP));
appraisalLog.setAppraisalId(appraisal.getId());
appraisalLog.setExecutorId(bAP);
......@@ -1431,10 +1459,10 @@ public class JxglController {
}
/**
* 上级评价 -驳回目标
* 评价 -驳回目标
*/
@PostMapping(value = "/update_superior_score_reject")
@ApiOperation(value = "19.上级评价 -驳回目标", httpMethod = "POST", notes = "上级评价 -驳回目标")
@ApiOperation(value = "19.评价 -驳回目标", httpMethod = "POST", notes = "评价 -驳回目标")
@ApiOperationSupport(order = 19)
public Result<Object> updateSSR(@CurrentUser UserBean userBean, @RequestBody AppraisalReject appraisalReject) {
......@@ -1461,7 +1489,7 @@ public class JxglController {
return ResultUtil.error("流程不存在");
}
if (ProcessType.SUPERIOR_SCORE.getType() == processNode.getProcessType()) {
if (!userBean.getEmpNum().equals(processNode.getExecutorId())) {
return ResultUtil.error("无权限操作该流程");
......@@ -1471,7 +1499,10 @@ public class JxglController {
JxglProcessNode.builder().sts(ProcessNodeSts.NON_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
.eq(JxglProcessNode::getAppraisalId, appraisal.getId()).in(JxglProcessNode::getProcessType,
ProcessType.TARGET_CONFIRMED.getType(), ProcessType.SELF_ASSESSMENT.getType()));
ProcessType.TARGET_CONFIRMED.getType(),
ProcessType.SELF_ASSESSMENT.getType(),
ProcessType.SUPERIOR_SCORE.getType()
));
JxglProcessNode.builder().sts(ProcessNodeSts.IN_EXECUTION.getType()).build()
.update(new UpdateWrapper<JxglProcessNode>().lambda()
......@@ -1505,10 +1536,6 @@ public class JxglController {
appraisalLog.setType(AppraisalLogType.TARGET_DISMISS.getType());
appraisalLog.insert();
} else {
return ResultUtil.error("流程状态异常");
}
return ResultUtil.success();
}
......@@ -1603,6 +1630,7 @@ public class JxglController {
@PostMapping(value = "/save_score")
@ApiOperation(value = "22.评分提交", httpMethod = "POST", notes = "评分提交")
@ApiOperationSupport(order = 22)
@Log(title = "评分提交")
public Result<Object> saveScore(@CurrentUser UserBean userBean,
@Validated @RequestBody ValidList<AppraisalAssessment> appraisalAssessments) throws Exception{
......@@ -1646,9 +1674,7 @@ public class JxglController {
for (AppraisalAssessment a : appraisalAssessments) {
Integer type = ProcessType.SELF_ASSESSMENT.getType() == processNode.getProcessType()
? AssessmentType.SELF_ASSESSMENT.getType()
: AssessmentType.SUPERIOR_SCORE.getType();
Integer type = processNode.getProcessType();
if (Double.valueOf(a.getScore()) > maxScore) {
......@@ -1706,20 +1732,23 @@ public class JxglController {
}
// 算 总评分 ---- 自评权重*自评分 + 上级评分权重*上级评分 = 总评分
// 算 总评分 ---- 自评权重*自评综合分 + 上级评分权重*上级综合评分 = 总评分
List<JxglProcessNode> listProcessNode = jxglProcessNodeMapper.selectList(new QueryWrapper<JxglProcessNode>().lambda()
.select(JxglProcessNode::getWeight,JxglProcessNode::getProcessType)
.orderByAsc(JxglProcessNode::getProcessType)
.in(JxglProcessNode::getProcessType, ProcessType.SELF_ASSESSMENT.getType(),ProcessType.SUPERIOR_SCORE.getType()));
.eq(JxglProcessNode::getAppraisalId, appraisal.getId())
.in(JxglProcessNode::getProcessType,
ProcessType.SELF_ASSESSMENT.getType()
,ProcessType.SUPERIOR_SCORE.getType()));
List<JxglAppraisalAssessment> listAppraisalAssessment = jxglAppraisalAssessmentMapper.selectList(new QueryWrapper<JxglAppraisalAssessment>().lambda()
.select(JxglAppraisalAssessment::getType,JxglAppraisalAssessment::getComprehensiveScore)
.eq(JxglAppraisalAssessment::getAppraisalId, appraisal.getId())
.orderByAsc(JxglAppraisalAssessment::getType)
);
Double selfAssessment = 0D;
Double superiorAssessment = 0D;
Integer aWeights = 0;
Integer bWeights = 0;
Double total = 0D;
......@@ -1741,17 +1770,18 @@ public class JxglController {
Integer min = 0;
Integer max = 0;
// System.out.println(aWeights);
// System.out.println(selfAssessment);
// System.out.println(bWeights);
// System.out.println(superiorAssessment);
total = aWeights*0.01*selfAssessment + bWeights*0.01*superiorAssessment;
System.out.println(total);
System.out.println(aWeights);
System.out.println(selfAssessment);
System.out.println(bWeights);
System.out.println(superiorAssessment);
List<JxglPerformanceRating> listPR = bS.getPerformanceRatings();
for (JxglPerformanceRating pR : listPR) {
min = min > pR.getSectionMinScore() ? pR.getSectionMinScore() : min;
max = max < pR.getSectionMaxScore() ? pR.getSectionMaxScore() : max;
level = pR.getSectionMaxScore() <= total && pR.getSectionMinScore() < total ? pR.getName() : null;
min = min >= pR.getSectionMinScore() ? pR.getSectionMinScore() : min;
max = max <= pR.getSectionMaxScore() ? pR.getSectionMaxScore() : max;
level = pR.getSectionMaxScore() >= total && pR.getSectionMinScore() < total ? pR.getName() : null;
}
if (level == null) {
for (JxglPerformanceRating pR : listPR) {
......
......@@ -289,7 +289,7 @@ public class AttController {
* 查询列表-考勤组-分页【新】
*/
@PostMapping(value = "/attendance_group")
@ApiOperation(value = "34:查询列表-我审批的/抄送我的-分页", httpMethod = "POST", notes = "查询列表-我审批的-关键字、审批状态、发起时间-分页")
@ApiOperation(value = "34:查询列表-考勤组-分页-分页", httpMethod = "POST", notes = "查询列表-考勤组-分页-分页")
@ApiOperationSupport(order = 34)
public Result<Object> AttendanceGroup(@CurrentUser UserBean userBean, @Validated @RequestBody AttqueryCriteriaDto attquerycriteriadto){
IPage<KqglMainKqzDto> page = new Page<KqglMainKqzDto>(
......
......@@ -155,7 +155,7 @@ public class TimeCardController {
attquerycriteriadto.getTotalPage() == null ? 10 : attquerycriteriadto.getTotalPage());
attquerycriteriadto.setOrgCode(userBean.getOrgCode());
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
IPage<KqglAssoBcsz> pageAs = kqglassobcszmapper.selectPage(page, new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getQyid, userBean.getOrgCode()));
IPage<KqglAssoBcsz> pageAs = kqglassobcszmapper.selectPage(page, new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getQyid, userBean.getOrgCode()).orderByDesc(KqglAssoBcsz::getId));
List<KqglAssoBcsz> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
......@@ -731,7 +731,7 @@ public class TimeCardController {
attquerycriteriadto.setOrgCode(userBean.getOrgCode());
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
IPage<KqglAssoDkdz> pageAs = kqglassodkdzmapper.selectPage(page, new QueryWrapper<KqglAssoDkdz>().lambda().eq(KqglAssoDkdz::getQyid, userBean.getOrgCode()));
IPage<KqglAssoDkdz> pageAs = kqglassodkdzmapper.selectPage(page, new QueryWrapper<KqglAssoDkdz>().lambda().eq(KqglAssoDkdz::getQyid, userBean.getOrgCode()).orderByDesc(KqglAssoDkdz::getId));
List<KqglAssoDkdz> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
......@@ -789,7 +789,7 @@ public class TimeCardController {
attquerycriteriadto.setOrgCode(userBean.getOrgCode());
attquerycriteriadto.setEmpNum(userBean.getEmpNum());
IPage<KqglAssoDkwx> pageAs = kqglassodkwxmapper.selectPage(page, new QueryWrapper<KqglAssoDkwx>().lambda().eq(KqglAssoDkwx::getQyid, userBean.getOrgCode()));
IPage<KqglAssoDkwx> pageAs = kqglassodkwxmapper.selectPage(page, new QueryWrapper<KqglAssoDkwx>().lambda().eq(KqglAssoDkwx::getQyid, userBean.getOrgCode()).orderByDesc(KqglAssoDkwx::getId));
List<KqglAssoDkwx> listAs = pageAs.getRecords();
return ResultUtil.data(pageAs, listAs, "操作成功!");
}
......@@ -1007,7 +1007,7 @@ public class TimeCardController {
@ApiOperation(value = "38:获取员工数据-根据 组织机构代码", httpMethod = "GET", notes = "接口发布说明")
@ApiOperationSupport(order = 38)
public Result<Object> getEmployeeData(@CurrentUser UserBean userBean) {
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).eq(YgglMainEmp::getJobStatus, "1"));
List<YgglMainEmp> yggl = YgglMainEmp.builder().build().selectList(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getOrgCode, userBean.getOrgCode()).ne(YgglMainEmp::getJobStatus, "3"));
return ResultUtil.data(yggl);
}
......
......@@ -442,7 +442,7 @@ public class AttendanceTaskTiming{
//排查请假是否在最后一次打卡范围内 查询当月的请假所有日期
List<KqglAssoRelationSummary> leainv = kqglassorelationsummarymapper.LeaveInvestigation(user.getEmpnum(), 2, ttstr);
KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
// KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
String beginTime = sdf1.format(new Date());
// List<String> rowData = new ArrayList<String>();
//遍历目前为止所有日期 结合该用户发起的审批进行结合
......@@ -543,6 +543,8 @@ public class AttendanceTaskTiming{
}
}
KqglAssoBcsz shif = KqglAssoBcsz.builder().build();
if(attgro.getPbfs() == 1){
int several = Integer.valueOf(ClockInTool.dateToWeek(num));//
KqglAssoTeshu tesu = KqglAssoTeshu.builder().build().selectOne(new QueryWrapper<KqglAssoTeshu>().lambda().eq(KqglAssoTeshu::getKqzid, attgro.getId()).eq(KqglAssoTeshu::getTsrq, num));
......@@ -563,6 +565,7 @@ public class AttendanceTaskTiming{
KqglAssoZhoupaiban gudingpb = KqglAssoZhoupaiban.builder().build().selectOne(new QueryWrapper<KqglAssoZhoupaiban>().lambda().eq(KqglAssoZhoupaiban::getKqzid, attgro.getId())
.eq(KqglAssoZhoupaiban::getType, several));
if(gudingpb != null) {
shif = KqglAssoBcsz.builder().build();
shif = shif.selectOne(new QueryWrapper<KqglAssoBcsz>().lambda().eq(KqglAssoBcsz::getId, gudingpb.getBcid()));
}
}else if(attgro.getPbfs() == 2){
......
......@@ -36,7 +36,7 @@ public class KqglServiceImpl implements KqglService {
public boolean attleaveapproval(AttLeaveApprovalDto leaveappr) {
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(leaveappr.getStarttime());
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(leaveappr.getEndtime());
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(";");
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
for(String num : days) {
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(leaveappr.getUserid()).appTime(num).approvalId(leaveappr.getLeaveid()).approvalType(2).duration(leaveappr.getDuration())
......@@ -46,7 +46,7 @@ public class KqglServiceImpl implements KqglService {
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, leaveappr.getUserid()));
int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, leaveappr.getUserid())
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, leaveappr.getUserid()).eq(KqglAssoLeaveBalance::getOrgCode, leaveappr.getOrgcode())
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
if(balan != null) {
modifynumber = balan.getModifyNumber()+1;
......@@ -63,7 +63,7 @@ public class KqglServiceImpl implements KqglService {
public boolean attovertimeapproval(AttOvertimeApprovalDto overappr) {
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(overappr.getStarttime());
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(overappr.getEndtime());
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(";");
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
for(String num : days) {
//记入打卡月汇总关联表
......@@ -72,7 +72,7 @@ public class KqglServiceImpl implements KqglService {
.endTime(new SimpleDateFormat("yyyy-MM-dd' 'HH:mm:ss").format(overappr.getEndtime())).build().insert();
}
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, overappr.getUserid()));
YgglMainEmp emp = YgglMainEmp.builder().build().selectOne(new QueryWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, overappr.getUserid()).eq(YgglMainEmp::getOrgCode, overappr.getOrgcode()));
//查询当前公司调休的id
KqglAssoLeaveRules learul = KqglAssoLeaveRules.builder().build().selectOne(new QueryWrapper<KqglAssoLeaveRules>().lambda().eq(KqglAssoLeaveRules::getOrgCode, emp.getOrgCode()).eq(KqglAssoLeaveRules::getRulesType, 2));
......@@ -80,7 +80,7 @@ public class KqglServiceImpl implements KqglService {
if(overappr.getCompensate() == 1) {
int modifynumber = 1;
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, overappr.getUserid())
KqglAssoLeaveBalance balan = kqglassoleavebalancemapper.selectOne(new QueryWrapper<KqglAssoLeaveBalance>().lambda().eq(KqglAssoLeaveBalance::getUserid, overappr.getUserid()).eq(KqglAssoLeaveBalance::getOrgCode, overappr.getOrgcode())
.orderByDesc(KqglAssoLeaveBalance :: getModifyNumber).last("LIMIT 1"));
if(balan != null) {
modifynumber = balan.getModifyNumber()+1;
......@@ -101,7 +101,7 @@ public class KqglServiceImpl implements KqglService {
if(evecappr.getEvectiontype() == 1) { //出差
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getStarttime());
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getEndtime());
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(";");
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
for(String num : days) {
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(3)
......@@ -110,7 +110,7 @@ public class KqglServiceImpl implements KqglService {
}else { //外出
String startdate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getStarttime());
String enddate = new SimpleDateFormat("yyyy-MM-dd").format(evecappr.getEndtime());
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(";");
String[] days=ClockInTool.listToString(ClockInTool.getDays(startdate,enddate)).split(",");
for(String num : days) {
//记入打卡月汇总关联表
KqglAssoRelationSummary.builder().userId(evecappr.getUserid()).appTime(num).approvalId(evecappr.getEvectionid()).approvalType(4)
......
......@@ -596,6 +596,9 @@ public class SpmkController {
return ResultUtil.data(adD);
}
@Autowired
private SpmkAssoBusinessFactory spmkAssoBusinessFactory;
//TODO 审批人审批
/**
* 审批人审批
......@@ -668,11 +671,17 @@ public class SpmkController {
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.set("approveId", FromData.builder().value(String.valueOf(asId)));
jSONObject.set("approveId", FromData.builder().value(String.valueOf(asId)).build());
jSONObject.set("orgCode", userBean.getOrgCode());
System.out.println("0----------"+ FromData.builder().value(String.valueOf(asId)));
System.out.println("1----------"+ aSummary.getAssoType());
System.out.println("2----------"+ ApproveEnum.getEnums(aSummary.getAssoType()));
//审批完成后 业务
SpmkAssoBusiness sab = SpmkAssoBusinessFactory.getFactory().createSpmkAssoType(ApproveEnum.getEnums(aSummary.getAssoType()));
SpmkAssoBusiness sab = spmkAssoBusinessFactory.createSpmkService(ApproveEnum.getEnums(aSummary.getAssoType()));
if (sab != null)
System.out.println("3----------"+ sab);
System.out.println("4----------"+ jSONObject);
sab.handleApprove(jSONObject);
}
}
......
......@@ -454,7 +454,12 @@ public class YgglController {
break;
case 1:
String[] strs = IdcardUtil.isValidCard10(zjNum);
isvalid = "澳门/香港".contains(strs[0]) && "true".equals(strs[2]);
if (strs == null) {
isvalid = false;
break;
}
String str2 = strs != null && strs.length > 2 ? strs[2] : "false";
isvalid = "澳门/香港".contains(strs[0]) && "true".equals(str2);
break;
case 2:
isvalid = IdcardUtil.isValidTWCard(zjNum);
......
......@@ -13,4 +13,6 @@ public interface YgglService {
* 根据 员工ID 和 主管层级 查询 主管
*/
Integer selectLeaderEmpNumById(Integer orgCode, Integer id, Integer leave);
}
......@@ -16,10 +16,12 @@ import cn.timer.api.bean.yggl.YgglMainEmp;
import cn.timer.api.bean.yggl.YgglMainLzb;
import cn.timer.api.bean.zzgl.ZzglBmgwM;
import cn.timer.api.config.enuminterface.YgEnumInterface;
import cn.timer.api.config.enuminterface.YgEnumInterface.jobStatus;
import cn.timer.api.dao.yggl.YgglMainEmpMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.yggl.LzygQueryDto;
import cn.timer.api.dto.yggl.YgzzDto;
import cn.timer.api.utils.ResultUtil;
@Service
public class YgglServiceImpl implements YgglService {
......@@ -33,34 +35,50 @@ public class YgglServiceImpl implements YgglService {
@Override
public void applicationResignation(LzygQueryDto lzygQueryDto) {
// TODO Auto-generated method stub
Integer empNum = lzygQueryDto.getEmpNum();
Integer orgCode = lzygQueryDto.getOrgCode();
YgglMainEmp ygglMainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, orgCode));
// if (ygglMainEmp.getJobStatus() == jobStatus.LIZHIZHONG.getType()) {
// return ResultUtil.success("你已在离职中");
// }
QueryWrapper<YgglMainEmp> queryWrapper = new QueryWrapper<YgglMainEmp>();
queryWrapper.eq("emp_num", empNum).eq("org_code", lzygQueryDto.getOrgCode());
YgglMainEmp ygglMainEmp = YgglMainEmp.builder().build().selectOne(queryWrapper);
YgglMainLzb ygglMainLzb = YgglMainLzb.builder().empNum(lzygQueryDto.getEmpNum()).build();
// 移动员工表数据到离职表
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb);
BeanUtil.copyProperties(ygglMainEmp, ygglMainLzb, "before_leaving_sts");
ygglMainLzb.insert();
UpdateWrapper<YgglMainEmp> updateWrapper = new UpdateWrapper<YgglMainEmp>();
updateWrapper.eq("emp_num", empNum);
UpdateWrapper<YgglMainLzb> updateWrapper1 = new UpdateWrapper<YgglMainLzb>();
updateWrapper1.eq("emp_num", empNum);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(YgEnumInterface.jobStatus.YILIZHI.getType()).build().update(updateWrapper);
YgglMainLzb.builder().jobStatus(YgEnumInterface.jobStatus.LIZHIZHONG.getType()).lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build().update(updateWrapper1);
YgglMainEmp.builder().empNum(lzygQueryDto.getEmpNum()).jobStatus(jobStatus.LIZHIZHONG.getType())
.beforeLeavingSts(ygglMainEmp.getJobStatus()).build()
.update(new UpdateWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, empNum)
.eq(YgglMainEmp::getOrgCode, orgCode));
YgglMainLzb.builder()
.jobStatus(jobStatus.LIZHIZHONG.getType())
.lzTime(lzygQueryDto.getLzTime())
.lzyy(lzygQueryDto.getLzyy()).lzbz(lzygQueryDto.getLzbz()).build()
.update(new UpdateWrapper<YgglMainLzb>().lambda()
.eq(YgglMainLzb::getEmpNum, empNum)
.eq(YgglMainLzb::getOrgCode, orgCode));
}
@Override
public void applicationRegularization(YgzzDto ygzzDto) {
// TODO Auto-generated method stub
YgglMainEmp.builder()
.jobStatus(2)
.jobStatus(1)
.zzTime(ygzzDto.getZzTime())
.sjzzTime(new Date())
.zzRemark(ygzzDto.getZzRemark())
.build().update(new UpdateWrapper<YgglMainEmp>().lambda().eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum()));
.build().update(new UpdateWrapper<YgglMainEmp>().lambda()
.eq(YgglMainEmp::getEmpNum, ygzzDto.getEmpNum())
.eq(YgglMainEmp::getOrgCode, ygzzDto.getOrgCode())
);
}
@Override
......@@ -68,7 +86,8 @@ public class YgglServiceImpl implements YgglService {
// TODO Auto-generated method stub
YgglMainEmp mainEmp = ygglMainEmpMapper.selectOne(new QueryWrapper<YgglMainEmp>().lambda()
.select(YgglMainEmp::getBmgwId)
.eq(YgglMainEmp::getEmpNum, id));
.eq(YgglMainEmp::getEmpNum, id)
.eq(YgglMainEmp::getOrgCode, orgCode));
Integer gWId = mainEmp != null ? mainEmp.getBmgwId() : null;
// 企业所有部门岗位
......@@ -85,13 +104,13 @@ public class YgglServiceImpl implements YgglService {
// List<ZzglBmgwM> listbM = ListUtil.toList();
// 指定 主管id
Integer leaderId = null;
for (int i = 0,n = leave; i < n; i++) {
Integer bmgwLeaderId;
for (int i = 0,n = leave + 1; i < n; i++) {
ZzglBmgwM bmgwM = getLeaderEmp(listBM, baseBmgwId);
baseBmgwId = bmgwM != null ? bmgwM.getId() : null;
bmgwLeaderId = bmgwM != null ? bmgwM.getLeader() : null;
if (i == n-1) {
// listbM.add(bmgwM);
leaderId = baseBmgwId;
leaderId = bmgwLeaderId;
}
}
......
......@@ -21,6 +21,9 @@ public class AttEvectionApprovalDto {
@ApiModelProperty(value = "用户id", example = "")
private int userid;
@ApiModelProperty(value = "公司id", example = "")
private int orgcode;
@ApiModelProperty(value = "开始时间", example = "时间戳")
private long starttime;
......
......@@ -21,6 +21,9 @@ public class AttLeaveApprovalDto {
@ApiModelProperty(value = "用户id", example = "")
private int userid;
@ApiModelProperty(value = "公司id", example = "")
private int orgcode;
@ApiModelProperty(value = "请假类型", example = "具体传ID")
private int leavetype;
......
......@@ -21,6 +21,9 @@ public class AttOvertimeApprovalDto {
@ApiModelProperty(value = "用户id", example = "")
private int userid;
@ApiModelProperty(value = "公司id", example = "")
private int orgcode;
@ApiModelProperty(value = "加班类型", example = "具体传ID")
private int overtimetype;
......
......@@ -21,6 +21,9 @@ public class AttRepairApprovalDto {
@ApiModelProperty(value = "用户id", example = "")
private int userid;
@ApiModelProperty(value = "公司id", example = "")
private int orgcode;
@ApiModelProperty(value = "补卡时间", example = "时间戳")
private long cardrepltime;
......
......@@ -20,6 +20,9 @@ public class YgzzDto implements Serializable{
@ApiModelProperty(value="工号",example="9527")
private Integer empNum;
@ApiModelProperty(value="企业id",example="12")
private Integer orgCode;
@ApiModelProperty(value="应转正时间",example="1999-12-03")
private Date zzTime;
......
......@@ -109,7 +109,7 @@ public class DateFormatUtils {
public static Date getDateByString(String date) throws ParseException {
if (date == null) {
if (date == null || "".equals(date)) {
return null;
}
......
......@@ -31,9 +31,9 @@ public class EvectionBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......@@ -52,6 +52,8 @@ public class EvectionBusiness extends SpmkAssoBusiness {
System.out.println(approveId);
AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.evectionid(Convert.toInt(approveId))
.evectiontype(1)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
......@@ -59,6 +61,8 @@ public class EvectionBusiness extends SpmkAssoBusiness {
.duration(Convert.toDouble(longTime))
.build();
System.out.println("出差:" + eaD);
// 调 考勤管理 业务-出差
kqglService.attevectionapproval(eaD);
}
......
......@@ -27,9 +27,9 @@ public class GoOutBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) throws Exception {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = jsonObj.get("orgCode",FromData.class).getValue();
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = jsonObj.get("initiator",FromData.class).getValue();
......@@ -48,6 +48,8 @@ public class GoOutBusiness extends SpmkAssoBusiness {
AttEvectionApprovalDto eaD = AttEvectionApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.evectionid(Convert.toInt(approveId))
.evectiontype(2)
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
......@@ -55,6 +57,7 @@ public class GoOutBusiness extends SpmkAssoBusiness {
.duration(Convert.toDouble(longTime))
.build();
System.out.println("外出:" + eaD);
// 调 考勤管理 业务-外出
kqglService.attevectionapproval(eaD);
}
......
......@@ -31,16 +31,16 @@ public class LeaveBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
// 审批汇总id
String approveId = ObjectUtil.isNull(jsonObj.get("approveId",FromData.class)) ? null : jsonObj.get("approveId",FromData.class).getValue();
// 请假类型
// 请假类型 - 前端传中文
String LeaveType = ObjectUtil.isNull(jsonObj.get("__LeaveType",FromData.class)) ? null : jsonObj.get("__LeaveType",FromData.class).getValue();
// 开始时间
String startTime = ObjectUtil.isNull(jsonObj.get("__startTime",FromData.class)) ? null : jsonObj.get("__startTime",FromData.class).getValue();
......@@ -55,13 +55,16 @@ public class LeaveBusiness extends SpmkAssoBusiness {
AttLeaveApprovalDto laD = AttLeaveApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.leaveid(Convert.toInt(approveId))
.leavetype(Convert.toInt(LeaveType))
.leavetype(Convert.toInt(1))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.duration(Convert.toDouble(longTime))
.build();
System.out.println("请假:" + laD);
// 调 考勤管理 业务-请假
kqglService.attleaveapproval(laD);
}
......
......@@ -2,6 +2,7 @@ package cn.timer.api.utils.router.business;
import org.springframework.stereotype.Service;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.dto.spmk.FromData;
......@@ -20,9 +21,9 @@ public class RecruitBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......
......@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.bean.yggl.YgglMainEmp;
......@@ -49,6 +50,8 @@ public class RegularizationBusiness extends SpmkAssoBusiness {
// 发起人id
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 计划转正时间
String confirmationTime = ObjectUtil.isNull(jsonObj.get("confirmationTime",FromData.class)) ? null : jsonObj.get("confirmationTime",FromData.class).getValue();
// 实际转正时间
......@@ -58,11 +61,12 @@ public class RegularizationBusiness extends SpmkAssoBusiness {
YgzzDto ygzzDto = YgzzDto.builder()
.empNum(id)
.orgCode(orgCode)
.zzTime(DateFormatUtils.getDateByString(confirmationTime))
.sjzzTime(DateFormatUtils.getDateByString(newConfirmationTime))
.zzRemark(Remarks)
.build();
System.out.println("转正:"+ygzzDto);
// 调 员工管理 业务
// YgglMainEmp.builder()
// .jobStatus(2)
......
......@@ -29,9 +29,9 @@ public class ReissueACardBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......@@ -50,11 +50,14 @@ public class ReissueACardBusiness extends SpmkAssoBusiness {
AttRepairApprovalDto raD = AttRepairApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.repairid(Convert.toInt(approveId))
.cardrepltime(DateUtil.getStringTime(PatchCardTime, "yyyy-MM-dd HH:mm:ss"))
.cardreplperiod(Convert.toInt(cardreplperiod))
.build();
System.out.println("补卡:"+raD);
// 调 考勤管理 业务-补卡
kqglService.attrepairapproval(raD);
}
......
......@@ -5,6 +5,7 @@ import java.text.ParseException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
......@@ -29,9 +30,9 @@ public class ResignationBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) throws Exception {
// TODO Auto-generated method stub
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : Integer.parseInt(jsonObj.get("orgCode",FromData.class).getValue());
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("",FromData.class).getValue());
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......@@ -44,15 +45,16 @@ public class ResignationBusiness extends SpmkAssoBusiness {
// 备注
String Remarks = ObjectUtil.isNull(jsonObj.get("Remarks",FromData.class)) ? null : jsonObj.get("Remarks",FromData.class).getValue();
LzygQueryDto dto = LzygQueryDto.builder()
LzygQueryDto dtO = LzygQueryDto.builder()
.orgCode(orgCode)
.empNum(id)
.lzTime(DateFormatUtils.getDateByString(terminationDate))
.lzyy(ReasonForResignation)
.lzbz(Remarks)
.build();
System.out.println("离职:"+dtO);
// 调 员工管理 业务
ygglService.applicationResignation(dto);
ygglService.applicationResignation(dtO);
}
......
package cn.timer.api.utils.router.business;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import cn.timer.api.utils.router.enums.ApproveEnum;
/**
* 审批关联业务工厂类
*
* @author Tang
*
*/
public class SpmkAssoBusinessFactory {
@Autowired
private RegularizationBusiness regularizationBusiness;
@Autowired
private TransferPositionBusiness transferPositionBusiness;
@Autowired
private ResignationBusiness resignationBusiness;
@Autowired
private RecruitBusiness recruitBusiness;
@Autowired
private WorkOvertimeBusiness workOvertimeBusiness;
@Autowired
private LeaveBusiness leaveBusiness;
@Autowired
private EvectionBusiness evectionBusiness;
@Autowired
private GoOutBusiness goOutBusiness;
@Autowired
private ReissueACardBusiness reissueACardBusiness;
static SpmkAssoBusinessFactory factory;
public static SpmkAssoBusinessFactory getFactory() {
return factory == null ? new SpmkAssoBusinessFactory() : factory;
}
/*
* Map中的Value是 ServiceBean
*/
private Map<String, SpmkAssoBusiness> serviceMap;
public SpmkAssoBusiness createSpmkAssoType(ApproveEnum assotype) {
SpmkAssoBusiness sat = null;
public SpmkAssoBusiness createSpmkService(ApproveEnum assotype) {
switch (assotype) {
case DEFAULT:
break;
case REGULARIZATION:
sat = regularizationBusiness;
break;
return serviceMap.get("regularizationBusiness");
case RESIGNATION:
sat = resignationBusiness;
break;
return serviceMap.get("resignationBusiness");
case TRANSFER_POSITION:
sat = transferPositionBusiness;
break;
return serviceMap.get("transferPositionBusiness");
case RECRUIT:
sat = recruitBusiness;
break;
return serviceMap.get("recruitBusiness");
case WORK_OVERTIME:
sat = workOvertimeBusiness;
break;
return serviceMap.get("workOvertimeBusiness");
case LEAVE:
sat = leaveBusiness;
break;
return serviceMap.get("leaveBusiness");
case EVECTION:
sat = evectionBusiness;
break;
return serviceMap.get("evectionBusiness");
case GO_OUT:
sat = goOutBusiness;
break;
return serviceMap.get("goOutBusiness");
case REISSUE_A_CARD:
sat = reissueACardBusiness;
break;
return serviceMap.get("reissueACardBusiness");
default:
break;
}
return sat;
return serviceMap.get("regularizationBusiness");
}
public void setServiceMap(Map<String, SpmkAssoBusiness> serviceMap) {
this.serviceMap = serviceMap;
}
}
package cn.timer.api.utils.router.business;
import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SpmkConfig {
@Autowired
private RegularizationBusiness regularizationBusiness;
@Autowired
private TransferPositionBusiness transferPositionBusiness;
@Autowired
private ResignationBusiness resignationBusiness;
@Autowired
private RecruitBusiness recruitBusiness;
@Autowired
private WorkOvertimeBusiness workOvertimeBusiness;
@Autowired
private LeaveBusiness leaveBusiness;
@Autowired
private EvectionBusiness evectionBusiness;
@Autowired
private GoOutBusiness goOutBusiness;
@Autowired
private ReissueACardBusiness reissueACardBusiness;
@Bean
public SpmkAssoBusinessFactory createFactory () {
SpmkAssoBusinessFactory factory = new SpmkAssoBusinessFactory();
Map<String, SpmkAssoBusiness> serviceMap = new HashMap<>();
serviceMap.put("regularizationBusiness",regularizationBusiness);
serviceMap.put("transferPositionBusiness",transferPositionBusiness);
serviceMap.put("resignationBusiness",resignationBusiness);
serviceMap.put("recruitBusiness",recruitBusiness);
serviceMap.put("workOvertimeBusiness",workOvertimeBusiness);
serviceMap.put("leaveBusiness",leaveBusiness);
serviceMap.put("evectionBusiness",evectionBusiness);
serviceMap.put("goOutBusiness",goOutBusiness);
serviceMap.put("reissueACardBusiness",reissueACardBusiness);
factory.setServiceMap(serviceMap);
return factory;
}
}
......@@ -3,8 +3,10 @@ package cn.timer.api.utils.router.business;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONObject;
import cn.timer.api.config.exception.CustomException;
import cn.timer.api.controller.zzgl.service.ZzglBmgwMService;
import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.dto.zzgl.UpEmpDeptDto;
......@@ -26,7 +28,7 @@ public class TransferPositionBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) {
// TODO Auto-generated method stub
// 发起人企业id
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : Integer.parseInt(jsonObj.get("orgCode",FromData.class).getValue());
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
......@@ -37,9 +39,12 @@ public class TransferPositionBusiness extends SpmkAssoBusiness {
// 申请原因
String ReasonForApplication = ObjectUtil.isNull(jsonObj.get("__ReasonForApplication",FromData.class)) ? null : jsonObj.get("__ReasonForApplication",FromData.class).getValue();
// 调入部门
Integer TransferInDepartment = ObjectUtil.isNull(jsonObj.get("__TransferInDepartment",FromData.class)) ? null : Integer.parseInt(jsonObj.get("__TransferInDepartment",FromData.class).getValue());
Integer TransferInDepartment = ObjectUtil.isNull(jsonObj.get("__TransferInDepartment",FromData.class)) ? null : Convert.toInt(jsonObj.get("__TransferInDepartment",FromData.class).getValue());
// 调入岗位
String TransferInPosition = ObjectUtil.isNull(jsonObj.get("__TransferInPosition",FromData.class)) ? null : jsonObj.get("__TransferInPosition",FromData.class).getValue();
Integer TransferInPosition = ObjectUtil.isNull(jsonObj.get("__TransferInPosition",FromData.class)) ? null : Integer.parseInt(jsonObj.get("__TransferInPosition",FromData.class).getValue());
if (TransferInDepartment == null || TransferInPosition == null) {
throw new CustomException("部门或岗位 未填写,审批失败");
}
// 生效日期
String effectiveDate = ObjectUtil.isNull(jsonObj.get("__effectiveDate",FromData.class)) ? null : jsonObj.get("__effectiveDate",FromData.class).getValue();
// 备注
......@@ -52,6 +57,7 @@ public class TransferPositionBusiness extends SpmkAssoBusiness {
.isdg(1)
.build();
System.out.println("调岗:"+upEmpDeptDto);
// 调 员工管理 业务
zzglBmgwMService.applicationTransferPosition(id, orgCode, upEmpDeptDto);
}
......
......@@ -12,7 +12,6 @@ import cn.timer.api.controller.kqgl.service.KqglService;
import cn.timer.api.dto.kqmk.AttOvertimeApprovalDto;
import cn.timer.api.dto.spmk.FromData;
import cn.timer.api.utils.DateUtil;
import lombok.Builder;
/**
* 加班-业务
......@@ -29,9 +28,9 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
public void handleApprove(JSONObject jsonObj) throws ParseException {
// TODO Auto-generated method stub
// 发起人企业id
String orgCode = ObjectUtil.isNull(jsonObj.get("orgCode",FromData.class)) ? null : jsonObj.get("orgCode",FromData.class).getValue();
Integer orgCode = ObjectUtil.isNull(jsonObj.get("orgCode")) ? null : Convert.toInt(jsonObj.get("orgCode"));
// 发起人id
String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : jsonObj.get("id",FromData.class).getValue();
Integer id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : Integer.parseInt(jsonObj.get("id",FromData.class).getValue());
// 发起人名称
String initiator = ObjectUtil.isNull(jsonObj.get("initiator",FromData.class)) ? null : jsonObj.get("initiator",FromData.class).getValue();
......@@ -44,25 +43,28 @@ public class WorkOvertimeBusiness extends SpmkAssoBusiness {
String endTime = ObjectUtil.isNull(jsonObj.get("__endTime",FromData.class)) ? null : jsonObj.get("__endTime",FromData.class).getValue();
// 时长
String timeLong = ObjectUtil.isNull(jsonObj.get("__timeLong",FromData.class)) ? null : jsonObj.get("__timeLong",FromData.class).getValue();
// 加班补偿方式
// 加班补偿方式 -前端传中文
String compensate = ObjectUtil.isNull(jsonObj.get("__compensate",FromData.class)) ? null : jsonObj.get("__compensate",FromData.class).getValue();
// 加班原因
String OvertimeReason = ObjectUtil.isNull(jsonObj.get("__OvertimeReason",FromData.class)) ? null : jsonObj.get("__OvertimeReason",FromData.class).getValue();
// 加班类型-前端未给
String overtimetype = ObjectUtil.isNull(jsonObj.get("__overtimetype",FromData.class)) ? null : jsonObj.get("__overtimetype",FromData.class).getValue();
String workOvertimeType = ObjectUtil.isNull(jsonObj.get("__workOvertimeType",FromData.class)) ? null : jsonObj.get("__workOvertimeType",FromData.class).getValue();
// 上传文件
String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue();
AttOvertimeApprovalDto oaD = AttOvertimeApprovalDto
.builder()
.userid(id)
.orgcode(orgCode)
.overtimeid(Convert.toInt(approveId))
.overtimetype(Convert.toInt(overtimetype))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm:ss"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm:ss"))
.overtimetype(Convert.toInt(1))
.starttime(DateUtil.getStringTime(startTime, "yyyy-MM-dd HH:mm"))
.endtime(DateUtil.getStringTime(endTime, "yyyy-MM-dd HH:mm"))
.duration(Convert.toDouble(timeLong))
.compensate(Convert.toInt(compensate))
.compensate(Convert.toInt(1))
.build();
System.out.println("加班:"+oaD);
// 调 考勤管理 业务-加班
kqglService.attovertimeapproval(oaD);
......
......@@ -237,7 +237,7 @@
(SELECT name FROM yggl_main_emp WHERE emp_num = c.executor_id AND org_code = #{param.orgCode}) as executor_name
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 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.process_type = a.sts
WHERE a.performance_appraisal_id = #{param.id}
<if test="param.empNums != null and param.empNums.size() > 0">
......
......@@ -166,6 +166,7 @@
<if test="param.query != null and param.query != ''">
and kqz.`name` like CONCAT('%',#{param.query},'%')
</if>
ORDER BY kqz.id DESC;
</select>
<!--
......
......@@ -211,7 +211,7 @@
FROM yggl_main_emp a
<where>
AND a.org_code = #{param.orgCode}
AND a.job_status != 3
AND a.job_status IN (0,1,2)
<if test="param.jobType != null">
AND a.job_type = #{param.jobType}
</if>
......
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