培训返回值

This commit is contained in:
bianyadong
2024-05-09 16:16:45 +08:00
parent 31fca6ad8c
commit d80d1e4b3c
7 changed files with 58 additions and 8 deletions

View File

@@ -4,13 +4,11 @@ import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*;
import com.cool.store.dto.StaffExamInfoDTO;
import com.cool.store.dto.decoration.ConstructionScheduleDTO;
import com.cool.store.dto.openPreparation.OpenPlanShopInfoDTO;
import com.cool.store.dto.xfsgFirstOderDTO;
import com.cool.store.entity.AcceptanceInfoDO;
import com.cool.store.entity.LeaseBaseInfoDO;
import com.cool.store.entity.LineInterviewDO;
import com.cool.store.entity.ShopStageInfoDO;
import com.cool.store.entity.*;
import com.cool.store.enums.*;
import com.cool.store.enums.point.ShopSubStageEnum;
import com.cool.store.enums.point.ShopSubStageStatusEnum;
@@ -23,6 +21,7 @@ import com.cool.store.response.xfsgFirstOderListResponse;
import com.cool.store.service.CoolStoreStartFlowService;
import com.cool.store.service.DecorationService;
import com.cool.store.service.PreparationService;
import com.cool.store.service.XfsgEhrService;
import com.cool.store.service.impl.CommonService;
import com.cool.store.utils.poi.DateUtils;
import com.cool.store.utils.poi.StringUtils;
@@ -76,6 +75,14 @@ public class XxlJobHandler {
private DecorationService decorationService;
@Resource
private CommonService commonService;
@Resource
private EmployeeTrainingDAO employeeTrainingDAO;
@Resource
private XfsgEhrService xfsgEhrService;
@Resource
private TempUserDetailDAO tempUserDetailDAO;
@Resource
private EnterpriseUserDAO enterpriseUserDAO;
/**
* 每天都将待体验门店信息变更到体验中
@@ -266,4 +273,30 @@ public class XxlJobHandler {
XxlJobHelper.handleSuccess();
}
@XxlJob("theoreticalExam")
public void theoreticalExam() {
log.info("------理论考试更新------");
List<EmployeeTrainingDO> theoreticalList = employeeTrainingDAO.theoreticalList();
if (CollectionUtils.isEmpty(theoreticalList)) {
log.info("------今日没有待更新数据------");
return;
}
for (EmployeeTrainingDO employeeTrainingDO : theoreticalList) {
TempUserDetailDO tempUserDetailDO = tempUserDetailDAO.selectById(employeeTrainingDO.getXfsgUserDetailId());
EnterpriseUserDO enterpriseUserDO = enterpriseUserDAO.getUserInfoByThirdOaUniqueFlag(tempUserDetailDO.getIdCard());
//查询理论分支并更新
StaffExamInfoDTO staffExamInfoDTO = xfsgEhrService.getUserExamInfo(enterpriseUserDO.getJobnumber());
if (staffExamInfoDTO != null && StringUtils.isNotBlank(staffExamInfoDTO.getExamResult())
&& StringUtils.isNotBlank(staffExamInfoDTO.getExamScore())) {
employeeTrainingDO.setTheoreticalExamScore(StringUtils.isNotBlank(staffExamInfoDTO.getExamScore()) ? Integer.valueOf(staffExamInfoDTO.getExamScore()) : null);
employeeTrainingDO.setTheoreticalExamStatus(ExamStatusEnum.matchCodeByDesc(staffExamInfoDTO.getExamResult()));
employeeTrainingDAO.updateByPrimaryKeySelective(employeeTrainingDO);
}
}
XxlJobHelper.handleSuccess();
}
}