From 4edca70f3d2f43cc3f6c43eceab9d2fd5c0ae90c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E7=8E=89=E7=90=A6?= <7507756+jiang_yuqi@user.noreply.gitee.com> Date: Sun, 21 Apr 2024 16:16:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/LabourApiController.java | 52 +++++++++++++++++-- .../src/main/resources/application.yml | 4 +- .../views/wxsetting/labourComplaint/index.vue | 37 ++++++++----- .../src/main/resources/application.yml | 4 +- .../impl/FlowLabourInfoServiceImpl.java | 26 ++++++---- .../domain/SurProjectAttendanceData.java | 11 ++++ .../jh/project/domain/vo/LabourDataVo.java | 12 +++-- .../jh/project/domain/vo/LabourDataVoPM.java | 24 +++++++++ .../mapper/flow/FlowLabourInfoMapper.xml | 8 +-- 9 files changed, 141 insertions(+), 37 deletions(-) create mode 100644 yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVoPM.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java b/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java index da6780a9..4f70730a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/api/labour/controller/LabourApiController.java @@ -38,6 +38,7 @@ import com.yanzhu.jh.project.domain.SurProjectAttendanceData; import com.yanzhu.jh.project.domain.SurProjectAttendanceGroup; import com.yanzhu.jh.project.domain.SurProjectAttendanceUser; import com.yanzhu.jh.project.domain.vo.LabourDataVo; +import com.yanzhu.jh.project.domain.vo.LabourDataVoPM; import com.yanzhu.jh.project.domain.vo.LabourGroupVO; import com.yanzhu.jh.project.domain.vo.LabourUserVO; import com.yanzhu.jh.project.service.ISurProjectAttendanceDataService; @@ -505,9 +506,26 @@ public class LabourApiController extends BaseController { SurProjectAttendanceData data = surProjectAttendanceDataService.findCurrentAttendanceData(findData); if(data!=null){ //这里不能修改出勤时间 - data.setAttendanceOutTime(labourDataVo.getAttendanceTime()); + if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){ + data.setAttendanceOutTime(labourDataVo.getAttendanceTime()); + } data.setUpdateBy(sysApplyConfig.getAppId()+"Api推送离场打卡"); - data.setUpdateTime(new Date()); + try { + List result; + if(data.getRemark()!=null){ + result = JSON.parseArray(data.getRemark(), LabourDataVoPM.class); + }else{ + result = new ArrayList<>(); + } + LabourDataVoPM labourDataVoPM = new LabourDataVoPM(); + labourDataVoPM.setAttendanceType(surProjectAttendanceData.getAttendanceType()); + labourDataVoPM.setAttendanceTime(surProjectAttendanceData.getAttendanceTime()); + labourDataVoPM.setScanPhoto(surProjectAttendanceData.getScanPhoto()); + result.add(labourDataVoPM); + data.setRemark(JSONObject.toJSONString(result)); + }catch (Exception e){ + log.error("保存考勤PM信息出错...{}",e.getMessage()); + } surProjectAttendanceDataService.updateSurProjectAttendanceData(data); }else{ /** @@ -523,6 +541,11 @@ public class LabourApiController extends BaseController { if(StringUtils.isNull(surProjectAttendanceUser.getCompanyTypeId())){ throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode()); } + //进出门逻辑判断 + if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){ + surProjectAttendanceData.setAttendanceOutTime(labourDataVo.getAttendanceTime()); + surProjectAttendanceData.setAttendanceTime(null); + } surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId()); surProjectAttendanceData.setAppId(sysApplyConfig.getAppId()); surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId()); @@ -634,8 +657,26 @@ public class LabourApiController extends BaseController { SurProjectAttendanceData data = surProjectAttendanceDataService.findCurrentAttendanceData(findData); if(data!=null){ //这里不能修改出勤时间 - data.setAttendanceOutTime(surProjectAttendanceData.getAttendanceTime()); + if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){ + data.setAttendanceOutTime(surProjectAttendanceData.getAttendanceTime()); + } data.setUpdateBy(sysApplyConfig.getAppId()+"Api推送离场打卡"); + try { + List result; + if(data.getRemark()!=null){ + result = JSON.parseArray(data.getRemark(), LabourDataVoPM.class); + }else{ + result = new ArrayList<>(); + } + LabourDataVoPM labourDataVoPM = new LabourDataVoPM(); + labourDataVoPM.setAttendanceType(surProjectAttendanceData.getAttendanceType()); + labourDataVoPM.setAttendanceTime(surProjectAttendanceData.getAttendanceTime()); + labourDataVoPM.setScanPhoto(surProjectAttendanceData.getScanPhoto()); + result.add(labourDataVoPM); + data.setRemark(JSONObject.toJSONString(result)); + }catch (Exception e){ + log.error("保存考勤PM信息出错...{}",e.getMessage()); + } surProjectAttendanceDataService.updateSurProjectAttendanceData(data); }else{ /** @@ -651,6 +692,11 @@ public class LabourApiController extends BaseController { if(StringUtils.isNull(surProjectAttendanceUser.getCompanyTypeId())){ throw new ServiceException("人员部门类型信息不完整",HttpStatusEnum.DARA_EXCEPTION.getCode()); } + //进出门逻辑判断 + if(Objects.equals("L",surProjectAttendanceData.getAttendanceType())){ + surProjectAttendanceData.setAttendanceOutTime(surProjectAttendanceData.getAttendanceTime()); + surProjectAttendanceData.setAttendanceTime(null); + } surProjectAttendanceData.setCfgid(sysApplyConfig.getCfgId()); surProjectAttendanceData.setAppId(sysApplyConfig.getAppId()); surProjectAttendanceData.setProjectId(sysApplyConfig.getProjectId()); diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index cd55cebe..73a50cfe 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -74,9 +74,9 @@ xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) - excludes: /system/notice + excludes: /system/notice,/common/* # 匹配链接 - urlPatterns: /system/*,/monitor/*,/tool/* + urlPatterns: /system/*,/monitor/*,/tool/*,/api/*,/flow/* # flowable相关表 flowable: diff --git a/ruoyi-ui/src/views/wxsetting/labourComplaint/index.vue b/ruoyi-ui/src/views/wxsetting/labourComplaint/index.vue index df56abcd..588c00e4 100644 --- a/ruoyi-ui/src/views/wxsetting/labourComplaint/index.vue +++ b/ruoyi-ui/src/views/wxsetting/labourComplaint/index.vue @@ -109,7 +109,7 @@ v-model="form.laborReason" type="textarea" rows="3" - placeholder="请输入拖欠原因说明" + placeholder="请输入拖欠原因说明(最多600字)" /> @@ -238,13 +238,7 @@ -
+
@@ -362,10 +356,14 @@ export default { subDeptOptions: [], flowLabours: [], flowLabourNodes: [], + flowId: null, nav: null, // 表单校验 rules: { - laborName: [{ required: true, message: "请输入投诉人名称", trigger: "blur" }], + laborName: [ + { required: true, message: "请输入投诉人名称", trigger: "blur" }, + { max: 10, message: "最多输入10字符", trigger: "blur" }, + ], laborPhone: [ { required: true, message: "请输入投诉人手机号码", trigger: "blur" }, { @@ -407,11 +405,11 @@ export default { ], laborReason: [ { required: true, message: "请输入拖欠原因说明", trigger: "blur" }, - { max: 200, message: "最多输入600字符", trigger: "blur" }, + { max: 600, message: "最多输入600字符", trigger: "blur" }, ], }, timer: null, // 定时器 - count: 60, // 初始倒计时时间(单位:s) + count: 30, // 初始倒计时时间(单位:s) buttonText: "查 询 投 诉 进 度", // 按钮显示文本 disabled: false, // 按钮是否可点击 }; @@ -462,7 +460,7 @@ export default { // 表单重置 reset() { this.form = { - projectId: null + projectId: null, }; this.resetForm("form"); }, @@ -497,6 +495,12 @@ export default { this.loading = false; this.flowLabours = response.data || []; this.showInspect = true; + if (this.flowId != null) { + //默认刷新展开的记录信息 + let nav = this.nav; + this.nav = null; + this.showDetail(this.flowId, nav); + } this.startCountdown(); }); }, @@ -508,13 +512,19 @@ export default { this.loading = false; this.flowLabours = response.data || []; this.showInspect = true; + if (this.flowId != null) { + //默认刷新展开的记录信息 + let nav = this.nav; + this.nav = null; + this.showDetail(this.flowId, nav); + } this.startCountdown(); }); } }); }, resetCountdown() { - this.count = 60; + this.count = 30; this.buttonText = "查 询 投 诉 进 度"; this.disabled = false; // 恢复按钮可点击 }, @@ -531,6 +541,7 @@ export default { }, 1000); }, showDetail(detailId, nv) { + this.flowId = detailId; if (this.nav == nv) { this.nav = null; return false; diff --git a/ruoyi-wechat/src/main/resources/application.yml b/ruoyi-wechat/src/main/resources/application.yml index 13af2178..13ee415f 100644 --- a/ruoyi-wechat/src/main/resources/application.yml +++ b/ruoyi-wechat/src/main/resources/application.yml @@ -70,9 +70,9 @@ xss: # 过滤开关 enabled: true # 排除链接(多个用逗号分隔) - excludes: /system/notice + excludes: /system/notice,/wechat/common/* # 匹配链接 - urlPatterns: /system/*,/monitor/*,/tool/* + urlPatterns: /system/*,/monitor/*,/tool/*,/wechat/* # flowable相关表 flowable: diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/flow/service/impl/FlowLabourInfoServiceImpl.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/flow/service/impl/FlowLabourInfoServiceImpl.java index e0004a5f..38ed25f3 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/flow/service/impl/FlowLabourInfoServiceImpl.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/flow/service/impl/FlowLabourInfoServiceImpl.java @@ -145,16 +145,22 @@ public class FlowLabourInfoServiceImpl implements IFlowLabourInfoService flowLabourInfo.setId(0L); return AjaxResult.success(flowLabourInfo); }else{ - flowLabourInfo.setCreateTime(DateUtils.getNowDate()); - flowLabourInfoMapper.insertFlowLabourInfo(flowLabourInfo); - //保存流程节点信息 - FlowLabourAuditNode flowLabourAuditNode = new FlowLabourAuditNode(); - flowLabourAuditNode.setFlowId(flowLabourInfo.getId()); - flowLabourAuditNode.setFlowNode("0"); - flowLabourAuditNode.setCreateBy(flowLabourInfo.getLaborName()); - flowLabourAuditNode.setCreateTime(new Date()); - flowLabourAuditNodeMapper.insertFlowLabourAuditNode(flowLabourAuditNode); - return AjaxResult.success(flowLabourInfo); + try { + flowLabourInfo.setApproveStatus("10"); + flowLabourInfo.setCreateBy(flowLabourInfo.getLaborName()); + flowLabourInfo.setCreateTime(DateUtils.getNowDate()); + flowLabourInfoMapper.insertFlowLabourInfo(flowLabourInfo); + //保存流程节点信息 + FlowLabourAuditNode flowLabourAuditNode = new FlowLabourAuditNode(); + flowLabourAuditNode.setFlowId(flowLabourInfo.getId()); + flowLabourAuditNode.setFlowNode("0"); + flowLabourAuditNode.setCreateBy(flowLabourInfo.getLaborName()); + flowLabourAuditNode.setCreateTime(new Date()); + flowLabourAuditNodeMapper.insertFlowLabourAuditNode(flowLabourAuditNode); + return AjaxResult.success(flowLabourInfo); + }catch (Exception e){ + throw new RuntimeException("输入字符中包含系统未识别的乱码!"); + } } } diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java index 70c80190..59d98734 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/SurProjectAttendanceData.java @@ -243,6 +243,9 @@ public class SurProjectAttendanceData extends BaseEntity /** 重要::yanzhu接口接收base64图片 */ private String scanPhotoBase64; + /** 重要::yanzhu出门进门逻辑判断 */ + private String attendanceType; + public String getScanPhotoBase64() { return scanPhotoBase64; } @@ -251,6 +254,14 @@ public class SurProjectAttendanceData extends BaseEntity this.scanPhotoBase64 = scanPhotoBase64; } + public String getAttendanceType() { + return attendanceType; + } + + public void setAttendanceType(String attendanceType) { + this.attendanceType = attendanceType; + } + public static SurProjectAttendanceData createFromHuazhu(JSONObject j) { SurProjectAttendanceData d=new SurProjectAttendanceData(); d.vendorsCode="huazhu"; diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVo.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVo.java index 8d6971e7..6ff29125 100644 --- a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVo.java +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVo.java @@ -29,11 +29,9 @@ public class LabourDataVo extends BaseEntity private String companyId; /** 进门还是出门E进,L出 */ - /** - * 新接口改造&暂不需要传入参数 @NotBlank(message = "进出门不能为空") @Pattern(regexp = "E|L", message = "进出门类型格式异常,E进|L出") - private String attendanceType;*/ + private String attendanceType; /** 考勤时间yyyy-MM-dd HH:mm:ss */ @NotBlank(message = "考勤时间不能为空") @@ -97,4 +95,12 @@ public class LabourDataVo extends BaseEntity public void setIsDel(Long isDel) { this.isDel = isDel; } + + public String getAttendanceType() { + return attendanceType; + } + + public void setAttendanceType(String attendanceType) { + this.attendanceType = attendanceType; + } } diff --git a/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVoPM.java b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVoPM.java new file mode 100644 index 00000000..31977371 --- /dev/null +++ b/yanzhu-jh/src/main/java/com/yanzhu/jh/project/domain/vo/LabourDataVoPM.java @@ -0,0 +1,24 @@ +package com.yanzhu.jh.project.domain.vo; + +import lombok.Data; + +/** + * 劳务实名制管理对象 + * + * @author JiangYuQi + * @date 2024-01-22 + */ +@Data +public class LabourDataVoPM +{ + private static final long serialVersionUID = 1L; + + /** 进门还是出门E进,L出 */ + private String attendanceType; + + /** 考勤时间yyyy-MM-dd HH:mm:ss */ + private String attendanceTime; + + /** 打卡照片 */ + private String scanPhoto; +} diff --git a/yanzhu-jh/src/main/resources/mapper/flow/FlowLabourInfoMapper.xml b/yanzhu-jh/src/main/resources/mapper/flow/FlowLabourInfoMapper.xml index 42811402..736bcaa3 100644 --- a/yanzhu-jh/src/main/resources/mapper/flow/FlowLabourInfoMapper.xml +++ b/yanzhu-jh/src/main/resources/mapper/flow/FlowLabourInfoMapper.xml @@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sp.id in (select spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept} and spui.job_type='24' and spui.del_flag=0 ) - and fl.approve_status in ('10','21','30','31','100') and sp.id in (select spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='24' and spui.del_flag=0 ) + and fl.approve_status in ('10','21','30','31','100') and sp.id in (select spui.project_id from sur_project_userinfo spui where spui.dept_id = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='24' and spui.is_del=0) and fl.approve_status in ('20','31') @@ -96,7 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and fl.approve_status in ('20','31','30','100') and sp.deptId = #{nowDept} and fl.approve_status in ('10','21','30','31','100') and sp.id in (select spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept} and spui.job_type='24' and spui.del_flag=0 ) - and fl.approve_status in ('10','21','30','31','100') and sp.id in (select spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='24' and spui.del_flag=0 ) + and fl.approve_status in ('10','21','30','31','100') and sp.id in (select spui.project_id from sur_project_userinfo spui where spui.dept_id = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='24' and spui.is_del=0) group by fl.approve_status @@ -120,10 +120,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sp.deptId = #{projectDeptId} and fl.approve_status in ('30') - and sp.id in (select spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='21' and spui.del_flag=0 ) + and sp.id in (select spui.project_id from sur_project_userinfo spui where spui.dept_id = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='21' and spui.is_del=0 ) and sp.id in (select spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept} and spui.job_type='24' and spui.del_flag=0 ) - and fl.approve_status in ('10','21','30','31','100') and sp.id in (select spui.projectId from sur_project_unit_info spui where spui.unitId = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='24' and spui.del_flag=0 ) + and fl.approve_status in ('10','21','30','31','100') and sp.id in (select spui.project_id from sur_project_userinfo spui where spui.dept_id = #{nowDept} and spui.user_id=#{nowUser} and spui.job_type='24' and spui.is_del=0 ) and fl.approve_status in ('20','31')