package cn.timer.api.utils.router.business; import java.text.ParseException; import org.springframework.beans.factory.annotation.Autowired; import cn.hutool.core.convert.Convert; import cn.hutool.core.util.ObjectUtil; import cn.hutool.json.JSONObject; import cn.timer.api.controller.kqgl.service.KqglService; import cn.timer.api.dto.kqmk.AttRepairApprovalDto; import cn.timer.api.dto.spmk.FromData; import cn.timer.api.utils.DateUtil; import lombok.Builder; /** * 补卡-业务 * @author Tang * */ @Builder public class ReissueACardBusiness extends SpmkAssoBusiness { @Autowired private KqglService kqglService; @Override 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(); // 发起人id String id = ObjectUtil.isNull(jsonObj.get("id",FromData.class)) ? null : 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 PatchCardTime = ObjectUtil.isNull(jsonObj.get("__PatchCardTime",FromData.class)) ? null : jsonObj.get("__PatchCardTime",FromData.class).getValue(); // 缺卡原因 String cardShortage = ObjectUtil.isNull(jsonObj.get("cardShortage",FromData.class)) ? null : jsonObj.get("cardShortage",FromData.class).getValue(); // 缺卡时段-上班、下班-前端未改 String cardreplperiod = ObjectUtil.isNull(jsonObj.get("cardreplperiod",FromData.class)) ? null : jsonObj.get("cardreplperiod",FromData.class).getValue(); // 上传文件 String UploadAttachment = ObjectUtil.isNull(jsonObj.get("UploadAttachment",FromData.class)) ? null : jsonObj.get("UploadAttachment",FromData.class).getValue(); AttRepairApprovalDto raD = AttRepairApprovalDto .builder() .repairid(Convert.toInt(approveId)) .cardrepltime(DateUtil.getStringTime(PatchCardTime, "yyyy-MM-dd HH:mm:ss")) .cardreplperiod(Convert.toInt(cardreplperiod)) .build(); // 调 考勤管理 业务-补卡 kqglService.attrepairapproval(raD); } }