diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/LabourApiController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/LabourApiController.java index 4118e829..7c4c714d 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/LabourApiController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/LabourApiController.java @@ -210,7 +210,6 @@ public class LabourApiController extends BaseController { if (CollectionUtils.isNotEmpty(list)) { SurProjectAttendanceUser surProjectAttendanceUser = list.get(0); surProjectAttendanceUser.setName(req.getName()); - surProjectAttendanceUser.setVendorsCode(VendorsCodeEnum.YANZHU.getCode()); surProjectAttendanceUser.setEthnic(req.getEthnic()); surProjectAttendanceUser.setNativePlace(req.getNativePlace()); surProjectAttendanceUser.setGender(req.getGender()); @@ -230,6 +229,7 @@ public class LabourApiController extends BaseController { surProjectAttendanceUser.setEnterDate(req.getEnterDate()); surProjectAttendanceUser.setCompanyId(req.getCompanyId()); surProjectAttendanceUser.setCompanyName(req.getCompanyName()); + surProjectAttendanceUser.setLeader(req.getGroupLeader()); surProjectAttendanceUser.setIsDel(req.getIsDel()); surProjectAttendanceUser.setUpdateBy(sysApplyConfig.getAppId()); surProjectAttendanceUser.setUpdateTime(new Date()); @@ -238,7 +238,9 @@ public class LabourApiController extends BaseController { SurProjectAttendanceUser surProjectAttendanceUser = new SurProjectAttendanceUser(); surProjectAttendanceUser.setAppId(sysApplyConfig.getAppId()); surProjectAttendanceUser.setCfgid(sysApplyConfig.getCfgId()); + surProjectAttendanceUser.setWorkerId(req.getWorkerId()); surProjectAttendanceUser.setName(req.getName()); + surProjectAttendanceUser.setVendorsCode(VendorsCodeEnum.YANZHU.getCode()); surProjectAttendanceUser.setEthnic(req.getEthnic()); surProjectAttendanceUser.setNativePlace(req.getNativePlace()); surProjectAttendanceUser.setGender(req.getGender()); @@ -251,6 +253,8 @@ public class LabourApiController extends BaseController { surProjectAttendanceUser.setEnterDate(req.getEnterDate()); surProjectAttendanceUser.setCompanyId(req.getCompanyId()); surProjectAttendanceUser.setCompanyName(req.getCompanyName()); + surProjectAttendanceUser.setLeader(req.getGroupLeader()); + surProjectAttendanceUser.setVendorId(0L); surProjectAttendanceUser.setIsDel(req.getIsDel()); surProjectAttendanceUser.setCreateBy(sysApplyConfig.getAppId()); surProjectAttendanceUser.setCreateTime(new Date()); diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/vo/LabourSignetVo.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/vo/LabourSignetVo.java deleted file mode 100644 index cf1f29af..00000000 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/vo/LabourSignetVo.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.yanzhu.manage.api.vo; - -import com.ruoyi.common.utils.AuthRsaUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.sign.Md5Utils; -import lombok.Data; -import lombok.extern.slf4j.Slf4j; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; - -/** - * 劳务人员签名推送信息 请求参数 - * - * @author: JiangYuQi - * @date: 2024/01/13 12:21 - */ -@Data -@Slf4j -public class LabourSignetVo { - - /** - * 签名 - * RSA(dataMd5 + 时间戳)加密 - */ - @NotBlank(message = "签名不能为空") - private String sign; - - /** - * 推送数据 明文参数 - */ - @NotBlank(message = "推送数据不能为空") - private String data; - - /** - * 时间戳 - */ - @NotNull(message = "时间戳不能为空") - private Long timestamp; - - /** - * 获取数据签名 - * - * @author: JiangYuQi - * @date: 2024/01/13 10:17 - */ - public Boolean getDataSign(String privateKey) { - boolean signFlag = false; - try { - String decryptByPrivateKey = AuthRsaUtils.decryptByPrivateKey(privateKey,sign); - String privateDataStr = Md5Utils.hash(data) + timestamp; - log.info("签名值...{}",privateDataStr); - log.info("解密值...{}",decryptByPrivateKey); - if (StringUtils.equals(privateDataStr, decryptByPrivateKey)) { - signFlag = true; - } - } catch (Exception e) { - log.error(e.getMessage()); - } - return signFlag; - } - - /** - * 效验时间签名[30分钟有效期] - */ - public Boolean checkTimestamp() { - boolean timestampFlag = true; - /**long timePoor = Math.abs(timestamp - System.currentTimeMillis()); - if (timePoor < 1000 * 60 * 30) { - timestampFlag = true; - }*/ - return timestampFlag; - } -} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/vo/LabourUserReqVo.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/vo/LabourUserReqVo.java index cdf6df2e..b69ffb80 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/vo/LabourUserReqVo.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/api/vo/LabourUserReqVo.java @@ -1,5 +1,7 @@ package com.yanzhu.manage.api.vo; +import com.yanzhu.common.core.annotation.Excel; + import javax.validation.constraints.Max; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @@ -80,6 +82,10 @@ public class LabourUserReqVo { @Size(max = 64, message = "分包商名称最大64位") private String companyName; + /** 是否班组长 */ + @NotNull(message = "是否班组长") + private Integer groupLeader; + /** 数据是否有效 */ @NotNull(message = "数据是否有效不能为空") @Max(value = 1, message = "数据是否有效格式异常,0有效|1无效") @@ -205,6 +211,14 @@ public class LabourUserReqVo { this.companyName = companyName; } + public Integer getGroupLeader() { + return groupLeader; + } + + public void setGroupLeader(Integer groupLeader) { + this.groupLeader = groupLeader; + } + public Long getIsDel() { return isDel; } @@ -212,4 +226,5 @@ public class LabourUserReqVo { public void setIsDel(Long isDel) { this.isDel = isDel; } + } diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SysApplyConfigController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SysApplyConfigController.java index 600778c5..026b90f0 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SysApplyConfigController.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/SysApplyConfigController.java @@ -1,5 +1,6 @@ package com.yanzhu.manage.controller; +import com.yanzhu.common.core.constant.CacheConstants; import com.yanzhu.common.core.enums.ApplyCfgTypeEnum; import com.yanzhu.common.core.enums.ShiFouEnum; import com.yanzhu.common.core.enums.VendorsCodeEnum; @@ -10,8 +11,10 @@ import com.yanzhu.common.core.web.domain.AjaxResult; import com.yanzhu.common.core.web.page.TableDataInfo; import com.yanzhu.common.log.annotation.Log; import com.yanzhu.common.log.enums.BusinessType; +import com.yanzhu.common.redis.service.RedisService; import com.yanzhu.common.security.annotation.RequiresPermissions; import com.yanzhu.manage.domain.AttendanceCfg; +import com.yanzhu.manage.domain.ProProjectInfo; import com.yanzhu.manage.domain.SysApplyConfig; import com.yanzhu.manage.service.IAttendanceCfgService; import com.yanzhu.manage.service.ISysApplyConfigService; @@ -33,6 +36,9 @@ import java.util.List; @RequestMapping("/applyConfig") public class SysApplyConfigController extends BaseController { + @Autowired + private RedisService redisService; + @Autowired private ISysApplyConfigService sysApplyConfigService; @@ -82,6 +88,9 @@ public class SysApplyConfigController extends BaseController @PostMapping public AjaxResult add(@RequestBody SysApplyConfig sysApplyConfig) { + ProProjectInfo proProjectInfo = redisService.getCacheObject(CacheConstants.PRO_PROJECT+sysApplyConfig.getProjectId()); + sysApplyConfig.setDeptId(proProjectInfo.getComId()); + sysApplyConfig.setIsDel(ShiFouEnum.FOU.getCode()); if(ApplyCfgTypeEnum.LABOUR.getCode().equals(sysApplyConfig.getCfgType())){ AttendanceCfg attendanceCfg = new AttendanceCfg(); attendanceCfg.setProjectId(sysApplyConfig.getProjectId()); diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceCfgServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceCfgServiceImpl.java index 27deda5c..3c2765f2 100644 --- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceCfgServiceImpl.java +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceCfgServiceImpl.java @@ -3,6 +3,7 @@ package com.yanzhu.manage.service.impl; import java.util.List; import com.yanzhu.common.core.context.SecurityContextHolder; +import com.yanzhu.common.core.exception.ServiceException; import com.yanzhu.common.core.utils.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -55,6 +56,12 @@ public class AttendanceCfgServiceImpl implements IAttendanceCfgService @Override public int insertAttendanceCfg(AttendanceCfg attendanceCfg) { + AttendanceCfg query = new AttendanceCfg(); + query.setProjectId(attendanceCfg.getProjectId()); + List cfgs = attendanceCfgMapper.selectAttendanceCfgList(query); + if(cfgs.size()>0){ + throw new ServiceException("当前项目已配置考勤信息..."); + } attendanceCfg.setCreateBy(SecurityContextHolder.getUserName()); attendanceCfg.setCreateTime(DateUtils.getNowDate()); return attendanceCfgMapper.insertAttendanceCfg(attendanceCfg); diff --git a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java index 4f18dffd..2c71e4fa 100644 --- a/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java +++ b/yanzhu-modules/yanzhu-system/src/main/java/com/yanzhu/system/controller/SysUserController.java @@ -129,9 +129,9 @@ public class SysUserController extends BaseController { if (StringUtils.isNull(sysUser)) { throw new ServiceException("用户名或密码错误"); } - if (StringUtils.isEmpty(sysUser.getRoles())) { + /**if (StringUtils.isEmpty(sysUser.getRoles())) { throw new ServiceException("用户未查询到分配角色,请联系管理员!!!"); - } + }*/ // 重写登录方法 if (!sysUser.isAdmin() && sysUser.getRoles().size() > 1) { List gsAdmins = sysUser.getRoles().stream().filter(role -> role.getRoleId() == 2L).collect(Collectors.toList()); diff --git a/yanzhu-ui-vue3/src/api/manage/applyConfig.js b/yanzhu-ui-vue3/src/api/manage/applyConfig.js index 0db434cd..be1ff3a6 100644 --- a/yanzhu-ui-vue3/src/api/manage/applyConfig.js +++ b/yanzhu-ui-vue3/src/api/manage/applyConfig.js @@ -42,3 +42,11 @@ export function delApplyConfig(id) { method: 'delete' }) } + +// 生成AppId +export function createAppId() { + return request({ + url: '/manage/applyConfig/createAppId', + method: 'post' + }) +} diff --git a/yanzhu-ui-vue3/src/views/manage/applyConfig/index.vue b/yanzhu-ui-vue3/src/views/manage/applyConfig/index.vue index 1e0ec1b8..1f2cea55 100644 --- a/yanzhu-ui-vue3/src/views/manage/applyConfig/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/applyConfig/index.vue @@ -1,6 +1,6 @@ - - - - - - - - - + + + + + + + + + @@ -109,10 +111,15 @@ /> - - + + + + + + + - + - - + + - - - - - - - - - - - - - - - - - - - - + +