From 903192ce68d601c90cd235e245482b02749f2d0d Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 14:25:32 +0800 Subject: [PATCH 01/27] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=91=98=E7=94=A8=E6=88=B7=E6=98=A0=E5=B0=84SQL?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=B8=AD=E7=9A=84=E6=A0=BC=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E3=80=82=E6=AD=A4=E6=AC=A1=E8=B0=83=E6=95=B4=E5=8C=85?= =?UTF-8?q?=E6=8B=AC=E5=AF=B9`createTime`=E5=AD=97=E6=AE=B5=E7=9A=84?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=BF=9B=E8=A1=8C=E8=A7=84=E8=8C=83=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96=EF=BC=8C=E4=BB=A5=E4=BF=9D=E6=8C=81=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=9A=84=E5=8F=AF=E8=AF=BB=E6=80=A7=E5=92=8C=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E6=80=A7=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/system/dal/mysql/user/AdminUserMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index 1ab40c3d..1df19a5d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -136,7 +136,7 @@ public interface AdminUserMapper extends BaseMapperX { " contract_duration AS contractDuration,\n" + " probation_period_time AS probationPeriodTime,\n" + " status,\n" + - " create_time AS createTime,\n" + + " create_time AS createTime\n" + " FROM\n" + " system_labor_contract lc\n" + " INNER JOIN (SELECT\n" + From b5a3bcac50f9c0dda9a1c3acf9c6189822e7746a Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 14:26:27 +0800 Subject: [PATCH 02/27] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7=E5=85=A5?= =?UTF-8?q?=E8=81=8C=E5=92=8C=E8=BD=AC=E6=AD=A3=E6=97=B6=E9=97=B4=E7=9A=84?= =?UTF-8?q?API=E5=92=8C=E7=9B=B8=E5=85=B3=E6=9C=8D=E5=8A=A1=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LaborContractController.java | 21 +++++++++++++++++++ .../laborcontract/vo/SigningDateRespVO.java | 20 ++++++++++++++++++ .../admin/laborcontract/vo/UploadFile.java | 5 ++++- .../laborcontract/LaborContractService.java | 8 ++++++- .../LaborContractServiceImpl.java | 13 ++++++++++++ 5 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/SigningDateRespVO.java diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java index f84a4899..b228fe48 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO; +import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.SigningDateRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; @@ -21,9 +22,12 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.List; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; @Tag(name = "管理后台 - 劳动合同管理") @RestController @@ -101,4 +105,21 @@ public class LaborContractController { return success(laborContractService.getLaborContractPage(pageReqVO)); } + + @GetMapping("/getSigningDate") + @Operation(summary = "获得当前登录用户的入职时间和转正时间") + @PreAuthorize("@ss.hasPermission('system:labor-contract:query')") + public CommonResult getSigningDate() { + + LaborContractDO contractDO = laborContractService.getSigningDate(getLoginUserId()); + if (contractDO == null) { + return success(new SigningDateRespVO()); + } + + SigningDateRespVO respVO = BeanUtils.toBean(contractDO, SigningDateRespVO.class); + // 设置转正日期 + LocalDate regularDate = contractDO.getSigningDate().plusMonths(contractDO.getProbationPeriodTime()); + respVO.setRegularDate(regularDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))); + return success(respVO); + } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/SigningDateRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/SigningDateRespVO.java new file mode 100644 index 00000000..31650d41 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/SigningDateRespVO.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; + +@Schema(description = "管理后台 - 劳动合同管理 Response VO") +@Data +public class SigningDateRespVO { + + @Schema(description = "签约日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private String signingDate; + + @Schema(description = "转正日期") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private String regularDate; +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/UploadFile.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/UploadFile.java index 723b9c14..5ce0d6c5 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/UploadFile.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/UploadFile.java @@ -9,9 +9,12 @@ import lombok.Data; @Data public class UploadFile { - @Schema(description = "文件管理 fileId", requiredMode = Schema.RequiredMode.REQUIRED, example = "123.jpg") + @Schema(description = "文件管理 fileId", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") private String fileId; + @Schema(description = "文件名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "123.jpg") + private String fileName; + @Schema(description = "文件URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://xxx.xxx/xx/xx/123.jpgss") private String url; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java index f8853c3b..4a821ee4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java @@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO; +import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.SigningDateRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO; import javax.validation.Valid; @@ -83,5 +84,10 @@ public interface LaborContractService { */ List getListByEndTime(LocalDate now); - + /** + * 获得当前登录用户的入职时间和转正时间 + * @param userId 用户编号 + * @return 日期 + */ + LaborContractDO getSigningDate(Long userId); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java index ba0a7396..5aa03550 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java @@ -1,11 +1,13 @@ package cn.iocoder.yudao.module.system.service.laborcontract; +import cn.hutool.core.collection.CollectionUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO; +import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.SigningDateRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO; import cn.iocoder.yudao.module.system.dal.mysql.laborcontract.LaborContractMapper; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; @@ -118,4 +120,15 @@ public class LaborContractServiceImpl implements LaborContractService { .lt(LaborContractDO::getExpirationDate, now) .eq(LaborContractDO::getStatus, 3)); } + + @Override + public LaborContractDO getSigningDate(Long userId) { + + List list = laborContractMapper.selectList(new LambdaQueryWrapperX() + .eq(LaborContractDO::getUserId, userId) + .isNotNull(LaborContractDO::getProbationPeriodTime) + .orderByDesc(LaborContractDO::getCreateTime)); + + return CollectionUtil.isEmpty(list) ? null : list.get(0); + } } \ No newline at end of file From d55524789a815fc48a74c36ebb2cfcfcf2b21804 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 14:26:42 +0800 Subject: [PATCH 03/27] =?UTF-8?q?=E5=87=BA=E5=B7=AE=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=9A=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=9A=E9=9A=8F=E8=A1=8C=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 重构出差申请模块,支持指定多个随行人。修改了BpmOAEvectionCreateReqVO和BpmOAEvectionDO中的字段,将单个随行人用户ID调整为用户ID集合。更新了BpmOAEvectionController中的逻辑,以处理多随行人的情况,包括从集合中转换和合并用户名称。 --- .../admin/oa/BpmOAEvectionController.java | 17 +++++++++++------ .../vo/evection/BpmOAEvectionCreateReqVO.java | 3 ++- .../oa/vo/evection/BpmOAEvectionRespVO.java | 3 ++- .../bpm/dal/dataobject/oa/BpmOAEvectionDO.java | 7 +++++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java index 87032694..a5d23909 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.bpm.controller.admin.oa; +import cn.hutool.core.collection.CollectionUtil; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionCreateReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionRespVO; @@ -17,7 +18,11 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; +import java.util.List; +import java.util.stream.Collectors; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; /** @@ -54,9 +59,9 @@ public class BpmOAEvectionController { BpmOAEvectionRespVO respVO = BpmOAEvectionConvert.INSTANCE.convert(evection); - if (evection.getTogetherUserId() != null) { - AdminUserRespDTO userRespDTO = userApi.getUser(evection.getTogetherUserId()).getCheckedData(); - respVO.setTogetherUserName(userRespDTO.getNickname()); + if (CollectionUtil.isNotEmpty(evection.getTogetherUserIds())) { + List userRespDTOs = userApi.getUserList(respVO.getTogetherUserIds()).getCheckedData(); + respVO.setTogetherUserName(String.join("、", convertList(userRespDTOs, AdminUserRespDTO::getNickname))); } return success(respVO); @@ -71,9 +76,9 @@ public class BpmOAEvectionController { BpmOAEvectionRespVO respVO = BpmOAEvectionConvert.INSTANCE.convert(evection); - if (evection.getTogetherUserId() != null) { - AdminUserRespDTO userRespDTO = userApi.getUser(evection.getTogetherUserId()).getCheckedData(); - respVO.setTogetherUserName(userRespDTO.getNickname()); + if (CollectionUtil.isNotEmpty(evection.getTogetherUserIds())) { + List userRespDTOs = userApi.getUserList(evection.getTogetherUserIds()).getCheckedData(); + respVO.setTogetherUserName(String.join("、", convertList(userRespDTOs, AdminUserRespDTO::getNickname))); } return success(respVO); diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionCreateReqVO.java index 6f11302f..f73ff020 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionCreateReqVO.java @@ -11,6 +11,7 @@ import javax.validation.constraints.NotNull; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.Set; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -30,7 +31,7 @@ public class BpmOAEvectionCreateReqVO { private String reason; @Schema(description = "随行人用户编号") - private Long togetherUserId; + private Set togetherUserIds; @Schema(description = "出差起点", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "出差起点不能为空") diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionRespVO.java index b62c17ea..0e882979 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/evection/BpmOAEvectionRespVO.java @@ -12,6 +12,7 @@ import javax.validation.constraints.NotNull; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.Set; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -29,7 +30,7 @@ public class BpmOAEvectionRespVO extends BpmOABaseRespVO { private String reason; @Schema(description = "随行人用户编号") - private Long togetherUserId; + private Set togetherUserIds; @Schema(description = "随行人用户名称") private String togetherUserName; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOAEvectionDO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOAEvectionDO.java index 10d2006d..08b8bbbe 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOAEvectionDO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOAEvectionDO.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.oa; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.common.pojo.UploadUserFile; +import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -12,6 +13,7 @@ import lombok.*; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; +import java.util.Set; /** * OA 出差申请 DO @@ -48,9 +50,10 @@ public class BpmOAEvectionDO extends BaseDO { private String reason; /** - * 随行人用户编号 + * 随行人用户编号组 */ - private Long togetherUserId; + @TableField(typeHandler = JsonLongSetTypeHandler.class) + private Set togetherUserIds; /** * 出差地点 起点 From 53678a7ec2b043371ed9edd8be8dbab2ef6ddbd6 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 15:03:25 +0800 Subject: [PATCH 04/27] =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E5=9C=A8=E5=B7=A5?= =?UTF-8?q?=E4=BD=9C=E6=97=A5=E5=BF=97=E8=AF=BB=E5=8F=96=E5=92=8C=E6=9C=AA?= =?UTF-8?q?=E8=AF=BB=E7=BB=9F=E8=AE=A1=E6=9F=A5=E8=AF=A2=E4=B8=AD=E8=80=83?= =?UTF-8?q?=E8=99=91=E5=B7=B2=E5=88=A0=E9=99=A4=E8=AE=B0=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通过在工作日志模块的查询逻辑中加入对已删除记录的判断,从而精确地区分了已读和未读工作日志的统计。避免了因未考虑删除状态可能导致的数据不一致问题。 --- .../module/system/dal/mysql/worklog/LogInstanceMapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java index db0446d2..cda20f3b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java @@ -65,8 +65,8 @@ public interface LogInstanceMapper extends BaseMapperX { .eq(LogReadDo::getLogInstanceId, LogInstanceDO::getId) .eq(LogReadDo::getReadUserId, userId) .eq(LogReadDo::getDeleted, 0)); - queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS readCount FROM work_log_read where read_status = 1 GROUP BY log_instance_id) c on t.id = c.log_instance_id"); - queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS unReadCount FROM work_log_read where read_status = 0 GROUP BY log_instance_id) AS d ON t.id = d.log_instance_id"); + queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS readCount FROM work_log_read where read_status = 1 and deleted = 0 GROUP BY log_instance_id) c on t.id = c.log_instance_id"); + queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS unReadCount FROM work_log_read where read_status = 0 and deleted = 0 GROUP BY log_instance_id) AS d ON t.id = d.log_instance_id"); queryWrapper.leftJoin("(SELECT work_log_id, COUNT(work_log_id) AS comment FROM work_log_comment GROUP BY work_log_id) AS b ON t.id = b.work_log_id"); queryWrapper.eqIfPresent(LogInstanceDO::getDeptId, reqVO.getDeptId()); queryWrapper.eqIfPresent(LogInstanceDO::getFormId, reqVO.getFormId()); From 2936acc8b0e462da34adc40cd8379f11c2578cea Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 15:17:13 +0800 Subject: [PATCH 05/27] =?UTF-8?q?```=E5=B7=A5=E5=8E=82=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=B9=E6=B3=95=E8=B0=83=E6=95=B4=EF=BC=8C?= =?UTF-8?q?=E6=98=8E=E7=A1=AE=E4=BD=BF=E7=94=A8=E6=9B=B4=E6=96=B0=E5=B7=A5?= =?UTF-8?q?=E5=8E=82=E9=83=A8=E9=97=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为确保工厂信息更新逻辑的准确性,FactoryInfoServiceImpl类中的更新操作现明确通过调用updateFactoryDept方法来执行,而不是之前的updateDept方法,以反映更新操作专用于工厂部门。 ``` --- .../service/factoryinfo/FactoryInfoServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/factoryinfo/FactoryInfoServiceImpl.java b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/factoryinfo/FactoryInfoServiceImpl.java index 48027ff4..d6123a7d 100644 --- a/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/factoryinfo/FactoryInfoServiceImpl.java +++ b/zn-module-smartfactory/zn-module-smartfactory-biz/src/main/java/cn/iocoder/yudao/module/smartfactory/service/factoryinfo/FactoryInfoServiceImpl.java @@ -91,7 +91,7 @@ public class FactoryInfoServiceImpl implements FactoryInfoService { deptRespDTO.setName(updateReqVO.getShortName()); deptRespDTO.setLeaderUserId(updateReqVO.getLeaderUserId()); deptRespDTO.setFactoryId(updateReqVO.getId()); - deptApi.updateDept(deptRespDTO); + deptApi.updateFactoryDept(deptRespDTO); } @Override @@ -259,5 +259,11 @@ public class FactoryInfoServiceImpl implements FactoryInfoService { // 更新 FactoryInfoDO updateObj = BeanUtils.toBean(updateReqVO, FactoryInfoDO.class); factoryInfoMapper.updateById(updateObj); + + //同步更新 工厂部门状态 + DeptRespDTO deptRespDTO = new DeptRespDTO(); + deptRespDTO.setFactoryId(updateReqVO.getId()); + deptRespDTO.setStatus(updateReqVO.getStatus()); + deptApi.updateFactoryDept(deptRespDTO); } } From d84effdc62e40b6dd75161bcf4e73e8c55a01643 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 17:07:59 +0800 Subject: [PATCH 06/27] =?UTF-8?q?=E6=9C=9F=E6=9C=9B=E8=BD=AC=E6=AD=A3?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0=E5=88=B0?= =?UTF-8?q?=E8=BD=AC=E6=AD=A3=E7=94=B3=E8=AF=B7=E8=A1=A8=E5=8D=95=E5=92=8C?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E4=B8=AD=E5=9C=A8=E8=BD=AC=E6=AD=A3=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E7=9A=84=E5=88=9B=E5=BB=BA=E8=AF=B7=E6=B1=82=E5=92=8C?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=AF=B9=E8=B1=A1=E4=B8=AD=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=BA=86=E4=B8=80=E4=B8=AA=E6=96=B0=E7=9A=84=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E2=80=9C=E6=9C=9F=E6=9C=9B=E8=BD=AC=E6=AD=A3?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E2=80=9D=E3=80=82=E8=AF=A5=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E4=B8=BA=E9=9D=9E=E5=BF=85=E5=A1=AB=E9=A1=B9=EF=BC=8C=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E7=94=B3=E8=AF=B7=E4=BA=BA=E6=8C=87=E5=AE=9A=E4=BB=96?= =?UTF-8?q?=E4=BB=AC=E5=B8=8C=E6=9C=9B=E8=BD=AC=E6=AD=A3=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E3=80=82=E5=90=8E=E7=AB=AF=E6=95=B0=E6=8D=AE=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E4=B9=9F=E7=9B=B8=E5=BA=94=E6=9B=B4=E6=96=B0=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E5=AD=98=E5=82=A8=E8=BF=99=E4=B8=80=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/oa/vo/regular/BpmOARegularCreateReqVO.java | 4 ++++ .../admin/oa/vo/regular/BpmOARegularRespVO.java | 4 ++++ .../module/bpm/dal/dataobject/oa/BpmOARegularDO.java | 8 ++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularCreateReqVO.java index 1ef6b506..41030e41 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularCreateReqVO.java @@ -37,6 +37,10 @@ public class BpmOARegularCreateReqVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) private LocalDate confirmationDate; + @Schema(description = "期望转正时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate desireDate; + @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private String notes; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularRespVO.java index a2c20fd3..9a0d45ca 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/regular/BpmOARegularRespVO.java @@ -36,6 +36,10 @@ public class BpmOARegularRespVO extends BpmOABaseRespVO { @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) private LocalDate confirmationDate; + @Schema(description = "期望转正时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY) + private LocalDate desireDate; + @Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private String notes; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOARegularDO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOARegularDO.java index 12db2ee2..e2aefb23 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOARegularDO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOARegularDO.java @@ -36,7 +36,6 @@ public class BpmOARegularDO extends BaseDO { /** * 申请人的用户编号 - * * 关联 AdminUserDO 的 id 属性 */ private Long userId; @@ -56,13 +55,18 @@ public class BpmOARegularDO extends BaseDO { */ private LocalDate confirmationDate; + /** + * 期望转正时间 + */ + private LocalDate desireDate; + /** * 备注 */ private String notes; /** - * 出差的结果 + * 结果 * * 枚举 {@link BpmProcessInstanceResultEnum} * 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈 From 21d513317165c0029022d72938f7ef7a9ec985fc Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 17:08:09 +0800 Subject: [PATCH 07/27] =?UTF-8?q?=E6=96=B0=E5=A2=9EfactoryId=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E6=94=AF=E6=8C=81=E5=9C=A8=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=96=AA=E8=B5=84=E7=94=B3=E8=AF=B7=E6=97=B6=E5=85=B3=E8=81=94?= =?UTF-8?q?=E5=B7=A5=E5=8E=82=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/controller/admin/oa/BpmOASalaryController.java | 4 ++++ .../admin/oa/vo/salary/BpmOASalaryCreateReqVO.java | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java index 969e6cad..d89a8cd2 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java @@ -42,6 +42,10 @@ public class BpmOASalaryController { @Operation(summary = "创建请求申请") public CommonResult createSalary(@Valid @RequestBody BpmOASalaryCreateReqVO createReqVO) { + if (createReqVO.getFactoryId() != null) { + DeptRespDTO dto = deptApi.getDeptByFactoryId(createReqVO.getFactoryId()).getCheckedData(); + createReqVO.setCompanyDeptId(dto.getId()); + } return success(salaryService.createSalary(getLoginUserId(), createReqVO)); } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java index d96b67ba..fa597f04 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java @@ -29,10 +29,12 @@ public class BpmOASalaryCreateReqVO { @NotNull(message = "申请原因不能为空") private String reason; - @Schema(description = "付款公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") - @NotNull(message = "付款公司不能为空") + @Schema(description = "付款公司") private Long companyDeptId; + @Schema(description = "付款工厂编号") + private Long factoryId; + @Schema(description = "付款总额", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "付款总额不能为空") private BigDecimal paymentTotal; From 43714e792d37f5c617fe6277fc500ffbe07186e3 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 17:08:37 +0800 Subject: [PATCH 08/27] =?UTF-8?q?fix(system):=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E9=83=A8=E9=97=A8=E4=BF=AE=E6=94=B9=E5=92=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A5=E9=80=82=E5=BA=94=E5=B7=A5=E5=8E=82?= =?UTF-8?q?=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整`DeptApi`和`DeptApiImpl`中的方法命名,从`updateDept`改为`updateFactoryDept`,以明确其对工厂部门信息的修改。- 在`DeptService`和`DeptServiceImpl`中新增`updateFactoryDept`方法,实现对工厂部门信息的更新。 - 在`DeptServiceImpl`中添加`validateFactoryDeptExists`方法,用于校验工厂部门是否存在。 - 错误码常量新增`FACTORY_DEPT_NOT_FOUND`,用于标识当前工厂不存在对应部门的错误。 BREAKING CHANGE: 方法命名的变更及新增可能会影响调用系统部门修改和删除逻辑的客户端。 --- .../yudao/module/system/api/dept/DeptApi.java | 4 ++-- .../system/enums/ErrorCodeConstants.java | 1 + .../module/system/api/dept/DeptApiImpl.java | 14 +++-------- .../system/service/dept/DeptService.java | 6 +++++ .../system/service/dept/DeptServiceImpl.java | 23 +++++++++++++++++++ 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java index 7ddbabdd..e5f2f663 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java @@ -53,8 +53,8 @@ public interface DeptApi { CommonResult createDept(@RequestBody DeptRespDTO deptRespDTO); @PostMapping(PREFIX + "/update") - @Operation(summary = "修改部门信息") - void updateDept(@RequestBody DeptRespDTO deptRespDTO); + @Operation(summary = "修改工厂部门信息") + void updateFactoryDept(@RequestBody DeptRespDTO deptRespDTO); @PostMapping(PREFIX + "/delete") @Operation(summary = "删除部门信息") diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java index 690d3328..2f1de939 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java @@ -53,6 +53,7 @@ public interface ErrorCodeConstants { ErrorCode DEPT_EXISTS_USER = new ErrorCode(1_002_004_005, "部门中存在员工,无法删除"); ErrorCode DEPT_NOT_ENABLE = new ErrorCode(1_002_004_006, "部门({})不处于开启状态,不允许选择"); ErrorCode DEPT_PARENT_IS_CHILD = new ErrorCode(1_002_004_007, "不能设置自己的子部门为父部门"); + ErrorCode FACTORY_DEPT_NOT_FOUND = new ErrorCode(1_002_004_008, "当前工厂没有对应部门"); // ========== 职称模块 1-002-005-000 ========== ErrorCode POST_NOT_FOUND = new ErrorCode(1_002_005_000, "当前职称不存在"); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java index 832256a5..de37f2f3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java @@ -74,18 +74,10 @@ public class DeptApiImpl implements DeptApi { } @Override - public void updateDept(DeptRespDTO deptRespDTO) { + public void updateFactoryDept(DeptRespDTO deptRespDTO) { - DeptDO deptDO = deptService.getDeptByFactoryId(deptRespDTO.getFactoryId()); - - if (deptDO != null) { - - DeptSaveReqVO deptSaveReqVO = BeanUtils.toBean(deptDO, DeptSaveReqVO.class); - deptSaveReqVO.setLeaderUserId(deptRespDTO.getLeaderUserId()); - deptSaveReqVO.setName(deptRespDTO.getName()); - - deptService.updateDept(deptSaveReqVO); - } + DeptSaveReqVO deptSaveReqVO = BeanUtils.toBean(deptRespDTO, DeptSaveReqVO.class); + deptService.updateFactoryDept(deptSaveReqVO); } @Override diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java index bb7a5689..3ccccb35 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptService.java @@ -30,6 +30,12 @@ public interface DeptService { */ void updateDept(DeptSaveReqVO updateReqVO); + /** + * 更新工厂部门 + * @param updateReqVO 更新信息 + */ + void updateFactoryDept(DeptSaveReqVO updateReqVO); + /** * 删除部门 * diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index 117d2e12..b5166d29 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptListReqVO; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptSaveReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; @@ -128,6 +129,17 @@ public class DeptServiceImpl implements DeptService { deptMapper.updateById(updateObj); } + @Override + public void updateFactoryDept(DeptSaveReqVO updateReqVO) { + + // 校验自己存在 + validateFactoryDeptExists(updateReqVO.getFactoryId()); + + DeptDO update = BeanUtils.toBean(updateReqVO, DeptDO.class); + deptMapper.update(update, new LambdaQueryWrapperX() + .eq(DeptDO::getFactoryId, updateReqVO.getFactoryId())); + } + @Override @CacheEvict(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, allEntries = true) // allEntries 清空所有缓存,因为操作一个部门,涉及到多个缓存 @@ -153,6 +165,17 @@ public class DeptServiceImpl implements DeptService { } } + @VisibleForTesting + void validateFactoryDeptExists(Long factoryId) { + if (factoryId == null) { + return; + } + DeptDO dept = deptMapper.selectOne(DeptDO::getFactoryId, factoryId); + if (dept == null) { + throw exception(FACTORY_DEPT_NOT_FOUND); + } + } + @VisibleForTesting void validateParentDept(Long id, Long parentId) { if (parentId == null || DeptDO.PARENT_ID_ROOT.equals(parentId)) { From 1aa2d17b8007b4e1986644ecf9a5dd9ce739abb4 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 17:09:18 +0800 Subject: [PATCH 09/27] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=BF=85=E8=A6=81?= =?UTF-8?q?=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/controller/admin/oa/BpmOAEvectionController.java | 2 -- .../controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java | 4 ---- .../module/system/dal/mysql/worklog/LogInstanceMapper.java | 1 - .../system/service/laborcontract/LaborContractService.java | 1 - .../service/laborcontract/LaborContractServiceImpl.java | 1 - 5 files changed, 9 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java index a5d23909..941fe8f3 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOAEvectionController.java @@ -17,9 +17,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.validation.Valid; - import java.util.List; -import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java index fa597f04..17f537b3 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryCreateReqVO.java @@ -5,15 +5,11 @@ import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.ToString; -import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotNull; import java.math.BigDecimal; -import java.time.LocalDate; import java.util.List; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; - /** * 薪资付款申请 创建 Request VO * diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java index cda20f3b..1e8f913f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.dal.mysql.worklog; import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; -import cn.iocoder.yudao.framework.datapermission.core.aop.DataPermissionContextHolder; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java index 4a821ee4..d78f804e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractService.java @@ -4,7 +4,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO; -import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.SigningDateRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO; import javax.validation.Valid; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java index 5aa03550..199df81f 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java @@ -7,7 +7,6 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO; -import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.SigningDateRespVO; import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO; import cn.iocoder.yudao.module.system.dal.mysql.laborcontract.LaborContractMapper; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; From 03bddb17e8c1fa4022cc26259e26d7de4b5cb091 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Mon, 23 Sep 2024 19:39:03 +0800 Subject: [PATCH 10/27] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86BpmOASalaryCon?= =?UTF-8?q?troller=E4=B8=AD=E8=8E=B7=E5=8F=96=E9=83=A8=E9=97=A8=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E5=B9=B6=E5=9C=A8?= =?UTF-8?q?BpmOASalaryRespVO=E4=B8=AD=E6=96=B0=E5=A2=9E=E4=BA=86factoryId?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/oa/BpmOASalaryController.java | 24 +++++++++++++++---- .../admin/oa/vo/salary/BpmOASalaryRespVO.java | 3 +++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java index d89a8cd2..c96b82b8 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASalaryController.java @@ -15,6 +15,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.naming.spi.ObjectFactory; import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @@ -55,9 +56,18 @@ public class BpmOASalaryController { public CommonResult getSalary(@RequestParam("id") Long id) { BpmOASalaryDO salary = salaryService.getSalary(id); + if (salary == null) { + return success(new BpmOASalaryRespVO()); + } - return success(BpmOASalaryConvert.INSTANCE.convert(salary) - .setCompanyName(getDept(salary.getCompanyDeptId()).getName())); + // 获取部门详情 + DeptRespDTO dto = getDept(salary.getCompanyDeptId()); + + BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary) + .setCompanyName(dto.getName()) + .setFactoryId(dto.getFactoryId()); + + return success(respVO); } @GetMapping("/getByProcessInstanceId") @@ -67,8 +77,14 @@ public class BpmOASalaryController { BpmOASalaryDO salary = salaryService.getByProcessInstanceId(processInstanceId); - return success(BpmOASalaryConvert.INSTANCE.convert(salary) - .setCompanyName(getDept(salary.getCompanyDeptId()).getName())); + // 获取部门详情 + DeptRespDTO dto = getDept(salary.getCompanyDeptId()); + + BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary) + .setCompanyName(dto.getName()) + .setFactoryId(dto.getFactoryId()); + + return success(respVO); } /** diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryRespVO.java index 5e73265f..c46e3add 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/salary/BpmOASalaryRespVO.java @@ -33,6 +33,9 @@ public class BpmOASalaryRespVO extends BpmOABaseRespVO { @Schema(description = "付款公司名称") private String companyName; + @Schema(description = "付款工厂") + private Long FactoryId; + @Schema(description = "付款总额") private BigDecimal paymentTotal; From 38c4fda5cef22119aa615e610ce5238fd85a2bbb Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Tue, 24 Sep 2024 11:12:55 +0800 Subject: [PATCH 11/27] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E5=8A=B3?= =?UTF-8?q?=E5=8A=A8=E5=90=88=E5=90=8C=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF=E6=8C=81=E5=A4=9A=E9=83=A8?= =?UTF-8?q?=E9=97=A8ID=E6=9F=A5=E8=AF=A2=E4=B8=8E=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E3=80=82=E8=B0=83=E6=95=B4=E4=BA=86LaborContractPageReqVO?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E5=A4=9A=E9=83=A8=E9=97=A8ID?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=EF=BC=8C=E6=9B=B4=E6=94=B9=E4=BA=86AdminUser?= =?UTF-8?q?Mapper=E4=B8=AD=E7=9A=84=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BB=A5=E4=BD=BF=E7=94=A8IN=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E7=AC=A6=E5=A4=84=E7=90=86=E5=A4=9A=E9=83=A8=E9=97=A8ID?= =?UTF-8?q?=E3=80=82=E5=90=8C=E6=97=B6=EF=BC=8C=E5=AE=9E=E7=8E=B0=E4=BA=86?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E7=94=A8=E6=88=B7ID=E7=9A=84=E5=8D=87?= =?UTF-8?q?=E5=BA=8F=E6=8E=92=E5=88=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在获取部门数据时,若提供了部门ID,则会获取该部门及其所有子部门,以支持更复杂的查询需求。 本次更新确保了劳动合同分页查询功能更加灵活和高效。 --- .../laborcontract/vo/LaborContractPageReqVO.java | 4 ++++ .../system/dal/mysql/user/AdminUserMapper.java | 3 ++- .../laborcontract/LaborContractServiceImpl.java | 13 +++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/LaborContractPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/LaborContractPageReqVO.java index a9be2932..b399fe49 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/LaborContractPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/vo/LaborContractPageReqVO.java @@ -8,6 +8,7 @@ import lombok.ToString; import org.springframework.format.annotation.DateTimeFormat; import java.time.LocalDate; +import java.util.List; import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; @@ -23,6 +24,9 @@ public class LaborContractPageReqVO extends PageParam { @Schema(description = "部门id", example = "128") private Long deptId; + @Schema(description = "部门id", example = "128") + private List deptIds; + @Schema(description = "签约日期") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDate[] signingDate; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java index 1df19a5d..9feeb1e3 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/user/AdminUserMapper.java @@ -152,7 +152,7 @@ public interface AdminUserMapper extends BaseMapperX { " AND lc.create_time = max.max_create_time) a on a.user_id = t.id"); queryWrapper.eq(AdminUserDO::getUserType, 1); queryWrapper.likeIfPresent(AdminUserDO::getNickname, pageReqVO.getUserName()); - queryWrapper.eqIfPresent(AdminUserDO::getDeptId, pageReqVO.getDeptId()); + queryWrapper.inIfPresent(AdminUserDO::getDeptId, pageReqVO.getDeptIds()); if (Objects.nonNull(pageReqVO.getSigningDate())) { queryWrapper.between("a.signing_date", pageReqVO.getSigningDate()[0], pageReqVO.getSigningDate()[1]); } @@ -162,6 +162,7 @@ public interface AdminUserMapper extends BaseMapperX { queryWrapper.eq(Objects.nonNull(pageReqVO.getStatus()),"a.status", pageReqVO.getStatus()); queryWrapper.groupBy(AdminUserDO::getId); queryWrapper.orderByAsc("a.status"); + queryWrapper.orderByAsc(AdminUserDO::getId); return selectJoinPage(mpPage, LaborContractRespVO.class, queryWrapper); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java index 199df81f..9dd84289 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/laborcontract/LaborContractServiceImpl.java @@ -7,9 +7,11 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO; import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO; import cn.iocoder.yudao.module.system.dal.mysql.laborcontract.LaborContractMapper; import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; +import cn.iocoder.yudao.module.system.service.dept.DeptService; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.springframework.stereotype.Service; @@ -21,6 +23,7 @@ import java.util.List; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList; import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.LABOR_CONTRACT_NOT_EXISTS; /** @@ -38,6 +41,9 @@ public class LaborContractServiceImpl implements LaborContractService { @Resource private AdminUserMapper userMapper; + @Resource + private DeptService deptService; + @Override public Long createLaborContract(LaborContractSaveReqVO createReqVO) { // 插入 @@ -94,6 +100,13 @@ public class LaborContractServiceImpl implements LaborContractService { @Override public PageResult getLaborContractPage(LaborContractPageReqVO pageReqVO) { + if (pageReqVO.getDeptId() != null) { + + // 获取所有子级部门 + List deptDOS = deptService.getChildDept(pageReqVO.getDeptId()); + pageReqVO.setDeptIds(convertList(deptDOS, DeptDO::getId)); + } + Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); IPage pageList = userMapper.selectContractPage(page, pageReqVO); From ecfd6098b2e4942f533d56a0ea24e9e255f09005 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Tue, 24 Sep 2024 11:56:57 +0800 Subject: [PATCH 12/27] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=BD=AC=E6=AD=A3?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E4=BB=BB=E5=8A=A1=E5=88=A4=E6=96=AD=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E5=8F=8A=E5=85=B3=E8=81=94=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bpm/service/task/BpmTaskServiceImpl.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java index 9f25b6c4..3d58ccce 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/task/BpmTaskServiceImpl.java @@ -17,6 +17,7 @@ import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.BpmProcessI import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.*; import cn.iocoder.yudao.module.bpm.convert.task.BpmTaskConvert; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAEntryDO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASalaryDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASealDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; @@ -28,6 +29,7 @@ import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService; import cn.iocoder.yudao.module.bpm.service.definition.BpmProcessDefinitionService; import cn.iocoder.yudao.module.bpm.service.message.BpmMessageService; import cn.iocoder.yudao.module.bpm.service.oa.BpmOAEntryService; +import cn.iocoder.yudao.module.bpm.service.oa.BpmOARegularService; import cn.iocoder.yudao.module.bpm.service.oa.BpmOASalaryService; import cn.iocoder.yudao.module.bpm.service.oa.BpmOASealService; import cn.iocoder.yudao.module.system.api.dept.DeptApi; @@ -117,6 +119,9 @@ public class BpmTaskServiceImpl implements BpmTaskService { @Resource private BpmOASalaryService bpmOASalaryService; + @Resource + private BpmOARegularService bpmOARegularService; + @Override public PageResult getCCTaskPage(Long userId, BpmTaskDonePageReqVO pageVO) { // 查询被抄送的Task @@ -555,7 +560,17 @@ public class BpmTaskServiceImpl implements BpmTaskService { if (salaryDO != null) { DeptRespDTO dto = deptApi.getDept(salaryDO.getCompanyDeptId()).getCheckedData(); - paramMap.put("company_dept_flag", dto.getFlag()); //配置工厂idflag + paramMap.put("company_dept_flag", dto.getFlag()); //配置工厂编号flag + } + } + + // 判断 转正流程时 + if (instance.getProcessDefinitionId().contains("oa_regular")) { + BpmOARegularDO regularDO = bpmOARegularService.getByProcessInstanceId(instance.getProcessInstanceId()); + if (regularDO != null) { + + DeptRespDTO dto = deptApi.getDept(regularDO.getDeptId()).getCheckedData(); + paramMap.put("regular_dept_flag", dto.getFlag()); //配置转正部门flag } } From 48a671de70be60a730b3ec032685a3b97b14a762 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Tue, 24 Sep 2024 15:05:44 +0800 Subject: [PATCH 13/27] =?UTF-8?q?```=E9=87=87=E8=B4=AD=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91=E5=B7=B2?= =?UTF-8?q?=E4=BB=8E=E8=AF=B7=E5=81=87=E6=B5=81=E7=A8=8B=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E6=93=8D=E4=BD=9C=E4=B8=AD=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 已更新请假流程,以纠正关于采购申请状态更改的逻辑。此更改避免了在请假流程结束时错误地更新采购申请状态。 ``` --- .../yudao/module/bpm/service/oa/BpmOAGoOutServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOAGoOutServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOAGoOutServiceImpl.java index c241e274..9af9f160 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOAGoOutServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOAGoOutServiceImpl.java @@ -97,7 +97,6 @@ public class BpmOAGoOutServiceImpl extends BpmOABaseService implements BpmOAGoOu // -- 自己取消 // -- 审核拒绝 - //所有关联的采购申请改为 未支付状态 if (BpmProcessInstanceResultEnum.REJECT.getResult().equals(result) || BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result) || BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) { From 7cad618be52572db8b7f112cda0b8f839261f750 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Tue, 24 Sep 2024 15:23:01 +0800 Subject: [PATCH 14/27] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=BC=96=E5=88=B6=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在AdminUserApi和AdminUserService接口中,以及对应的实现类AdminUserApiImpl和AdminUserServiceImpl中,添加了新的方法updateUserStaffing,允许修改用户的编制状态。该功能通过用户ID和新的编制状态值进行操作。 --- .../yudao/module/system/api/user/AdminUserApi.java | 7 +++++++ .../yudao/module/system/api/user/AdminUserApiImpl.java | 6 ++++++ .../module/system/service/user/AdminUserService.java | 8 ++++++++ .../module/system/service/user/AdminUserServiceImpl.java | 6 ++++++ 4 files changed, 27 insertions(+) diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java index 4b7f6d74..d36ee377 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApi.java @@ -84,6 +84,13 @@ public interface AdminUserApi { void updateFieldworkType(@RequestParam("userId") Long userId, @RequestParam("fieldworkFlag") Integer fieldworkFlag); + @PostMapping(PREFIX + "/updateUserStaffing") + @Operation(summary = "修改用户信息") + @Parameter(name = "userId", description = "用户id", example = "1024", required = true) + @Parameter(name = "userStaffing", description = "用户编制", example = "1", required = true) + void updateUserStaffing(@RequestParam("userId") Long userId, + @RequestParam("userStaffing") Integer userStaffing); + @GetMapping(PREFIX + "/getUserIdsByUserNature") @Operation(summary = "获取所有用户性质为外勤的用户") @Parameter(name = "userNature", description = "用户性质", example = "3", required = true) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java index 8ebf04bc..5f090bfb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/user/AdminUserApiImpl.java @@ -96,6 +96,12 @@ public class AdminUserApiImpl implements AdminUserApi { userService.updateFieldworkType(userId, fieldworkFlag); } + @Override + public void updateUserStaffing(Long userId, Integer userStaffing) { + + userService.updateUserStaffing(userId, userStaffing); + } + @Override public CommonResult> getUserIdsByUserNature(Integer userNature) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java index bd2a30dd..9dbd3527 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserService.java @@ -102,6 +102,14 @@ public interface AdminUserService { */ void updateFieldwork(Long id, Integer fieldworkFlag); + /** + * 修改用户编制 + * + * @param id 用户编号 + * @param userStaffing 编制 + */ + void updateUserStaffing(Long id, Integer userStaffing); + /** * 修改外勤打卡状态 * 用于临时开启外勤打卡 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 009b8538..2928a9ef 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -278,6 +278,12 @@ public class AdminUserServiceImpl implements AdminUserService { userMapper.updateById(updateObj); } + @Override + public void updateUserStaffing(Long id, Integer userStaffing) { + + userMapper.updateById(new AdminUserDO().setId(id).setUserStaffing(userStaffing)); + } + @Override public void updateFieldworkType(Long id, Integer fieldworkFlag) { // 更新状态 From f6eaab85bf602a74882e3bafc1469195a3d804f0 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Tue, 24 Sep 2024 15:23:14 +0800 Subject: [PATCH 15/27] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=9B=91=E5=90=AC=E5=99=A8=E5=92=8C=E8=BD=AC?= =?UTF-8?q?=E6=AD=A3=E7=94=B3=E8=AF=B7=E6=9C=8D=E5=8A=A1=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更改内容: - 扩展了BpmOARegularResultListener中的onEvent方法,使其使用流程实例ID作为参数。 - 在BpmOARegularService接口中,updateRegularResult方法现在接收额外的流程实例ID参数。 - 在BpmOARegularServiceImpl中,updateRegularResult方法被更新以使用新的流程实例ID参数,并且在审批通过时,会根据流程实例的开始用户ID更新用户编制状态为在职状态。 这些更改增强了在流程实例结果处理期间的用户状态管理,并确保在审核转正申请时考虑了完整的上下文。 --- .../bpm/service/oa/BpmOARegularService.java | 2 +- .../service/oa/BpmOARegularServiceImpl.java | 36 ++++++++++++++++++- .../listener/BpmOARegularResultListener.java | 2 +- .../service/user/AdminUserServiceImpl.java | 2 -- 4 files changed, 37 insertions(+), 5 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularService.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularService.java index 375afa6b..f3e3c3c6 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularService.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularService.java @@ -28,7 +28,7 @@ public interface BpmOARegularService { * @param id 编号 * @param result 结果 */ - void updateRegularResult(Long id, Integer result); + void updateRegularResult(String processInstanceId, Long id, Integer result); /** * 获得转正申请 diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularServiceImpl.java index 9c25d532..dbaf8160 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOARegularServiceImpl.java @@ -1,21 +1,37 @@ package cn.iocoder.yudao.module.bpm.service.oa; +import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi; import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO; +import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcureListEditReqVO; import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularCreateReqVO; import cn.iocoder.yudao.framework.common.pojo.UploadUserFile; +import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimbursement; import cn.iocoder.yudao.module.bpm.convert.oa.BpmOARegularConvert; +import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO; import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO; +import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO; import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOARegularMapper; import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService; +import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; +import org.flowable.engine.runtime.ProcessInstance; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_REGULAR_NOT_EXISTS; @@ -44,6 +60,12 @@ public class BpmOARegularServiceImpl extends BpmOABaseService implements BpmOARe @Resource private BpmHistoryProcessInstanceService historyProcessInstanceService; + @Resource + private BpmProcessInstanceService bpmProcessInstanceService; + + @Resource + private AdminUserApi userApi; + @Override public Long createRegular(Long userId, BpmOARegularCreateReqVO createReqVO) { @@ -76,9 +98,21 @@ public class BpmOARegularServiceImpl extends BpmOABaseService implements BpmOARe } @Override - public void updateRegularResult(Long id, Integer result) { + public void updateRegularResult(String processInstanceId, Long id, Integer result) { validateLeaveExists(id); + //审核通过 (最后节点) + if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) { + + ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId); + + if (instance.isEnded()) { + + // 同步修改用户编制状态为在职状态 + userApi.updateUserStaffing(Long.valueOf(instance.getStartUserId()), 7); + } + } + regularMapper.updateById(new BpmOARegularDO().setId(id).setResult(result)); } diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/listener/BpmOARegularResultListener.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/listener/BpmOARegularResultListener.java index 85da3c7a..0e00ac6e 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/listener/BpmOARegularResultListener.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/listener/BpmOARegularResultListener.java @@ -27,6 +27,6 @@ public class BpmOARegularResultListener extends BpmProcessInstanceResultEventLis @Override protected void onEvent(BpmProcessInstanceResultEvent event) { - regularService.updateRegularResult(Long.parseLong(event.getBusinessKey()), event.getResult()); + regularService.updateRegularResult(event.getId(), Long.parseLong(event.getBusinessKey()), event.getResult()); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java index 2928a9ef..4046deb4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/user/AdminUserServiceImpl.java @@ -18,8 +18,6 @@ import cn.iocoder.yudao.framework.common.util.string.StrUtils; import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission; import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils; import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils; -import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder; -import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import cn.iocoder.yudao.module.infra.api.file.FileApi; import cn.iocoder.yudao.module.system.controller.admin.user.dto.UserPageDTO; import cn.iocoder.yudao.module.system.controller.admin.user.vo.factoryUser.FactoryUserPageReqVO; From 17d99d0cee380b78f5e80a775cbd6407c79ac4bb Mon Sep 17 00:00:00 2001 From: aikai Date: Wed, 25 Sep 2024 14:44:16 +0800 Subject: [PATCH 16/27] =?UTF-8?q?=E6=96=B0=E5=AE=B6=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A1=E5=88=92=E4=B8=AD=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=B7=B2=E7=BB=8F=E5=88=86=E9=85=8D=E5=88=B0?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E4=B8=AD=20-=20=E9=81=BF=E5=85=8D=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E9=95=BF=E4=BC=A0=E9=87=87=E8=B4=AD=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=88=B0=E8=B4=A7=E5=87=AD=E8=AF=81=E5=AF=BC=E8=87=B4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E5=88=86=E9=85=8D=E5=88=B0=E8=B5=84=E4=BA=A7=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BpmOASupplierProcurementPlanPageReqVO.java | 3 +++ .../BpmOASupplierProcurementPlanReqVO.java | 3 +++ .../BpmOASupplierProcurementPlanRespVO.java | 3 +++ .../BpmOASupplierProcurementPlanSaveReqVO.java | 3 +++ .../dal/dataobject/oa/BpmOASupplierProcurementPlanDO.java | 4 ++++ .../service/oa/BpmOASupplierProcurementPlanServiceImpl.java | 5 +++-- 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanPageReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanPageReqVO.java index f435c36f..527e0919 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanPageReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanPageReqVO.java @@ -48,6 +48,9 @@ public class BpmOASupplierProcurementPlanPageReqVO extends PageParam { @Schema(description = "是否上传凭证 0否 1是") private Integer certificateFlag; + @Schema(description = "是否已分配到资产中 0否 1是", example = "5984") + private Integer assignedFlag; + @Schema(description = "创建时间") @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) private LocalDateTime[] createTime; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanReqVO.java index 16c7fcca..5a03073a 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanReqVO.java @@ -17,6 +17,9 @@ public class BpmOASupplierProcurementPlanReqVO { @Schema(description = "供应商id", example = "123") private Long supplierId; + @Schema(description = "是否已分配到资产中 0否 1是", example = "5984") + private Integer assignedFlag; + @Schema(description = "流程实例的编号", example = "5984") private String processInstanceId; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanRespVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanRespVO.java index 5aa316a5..37a1f4c8 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanRespVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanRespVO.java @@ -41,6 +41,9 @@ public class BpmOASupplierProcurementPlanRespVO { @Schema(description = "备注") private String remark; + @Schema(description = "是否已分配到资产中 0否 1是", example = "5984") + private Integer assignedFlag; + @Schema(description = "流程实例的编号", example = "5984") private String processInstanceId; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanSaveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanSaveReqVO.java index ff3ffe2e..4b8ddeea 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanSaveReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierprocurementplan/BpmOASupplierProcurementPlanSaveReqVO.java @@ -42,6 +42,9 @@ public class BpmOASupplierProcurementPlanSaveReqVO { @Schema(description = "备注") private String remark; + @Schema(description = "是否已分配到资产中 0否 1是", example = "5984") + private Integer assignedFlag; + @Schema(description = "流程实例的编号", example = "5984") private String processInstanceId; diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOASupplierProcurementPlanDO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOASupplierProcurementPlanDO.java index 4140eeb5..e0c6a569 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOASupplierProcurementPlanDO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/dal/dataobject/oa/BpmOASupplierProcurementPlanDO.java @@ -70,6 +70,10 @@ public class BpmOASupplierProcurementPlanDO extends BaseDO { * 备注 */ private String remark; + /** + * 是否已分配到资产中 0否 1是 + */ + private Integer assignedFlag; /** * 流程实例的编号 */ diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierProcurementPlanServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierProcurementPlanServiceImpl.java index 1affb7f2..7b29c774 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierProcurementPlanServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierProcurementPlanServiceImpl.java @@ -165,10 +165,11 @@ public class BpmOASupplierProcurementPlanServiceImpl extends BpmOABaseService im public void uploadDeliveryReceipt(TheArrivalFileItemsVO vo) { BpmOASupplierProcurementPlanDO supplierProcurementPlanDO = oaSupplierProcurementPlanMapper.selectById(vo.getId()); //判断是否需要更新到资产 - Boolean updateAssetFlag = false; - if (CollectionUtil.isEmpty(supplierProcurementPlanDO.getTheArrivalFileItems())) { + boolean updateAssetFlag = false; + if (supplierProcurementPlanDO.getAssignedFlag() == 0) { updateAssetFlag = true; } + supplierProcurementPlanDO.setAssignedFlag(1); supplierProcurementPlanDO.setTheArrivalFileItems(vo.getTheArrivalFileItems()); oaSupplierProcurementPlanMapper.updateById(supplierProcurementPlanDO); // ----- 如果需要更新到资产 - From 89db6f8fe7216ee4e874d89788b7b6137d99e008 Mon Sep 17 00:00:00 2001 From: aikai Date: Wed, 25 Sep 2024 17:46:28 +0800 Subject: [PATCH 17/27] =?UTF-8?q?=E5=A4=84=E7=90=86=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E8=AF=A6=E6=83=85=E9=99=84=E4=BB=B6=E5=BA=94?= =?UTF-8?q?=E4=BD=BF=E7=94=A8mybatisPlus=E6=9F=A5=E8=AF=A2=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E4=B8=8D=E8=83=BD=E8=87=AA=E5=8A=A8=E7=BB=84=E8=A3=85?= =?UTF-8?q?=E6=88=90list=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../oa/BpmOASupplierProcurementPlanController.java | 8 ++++++++ .../BpmOASupplierPurchasePaymentSaveReqVO.java | 1 - .../oa/BpmOASupplierPurchasePaymentServiceImpl.java | 11 ++++++++--- .../yudao/module/system/api/supplier/SupplierApi.java | 9 ++++++++- .../module/system/api/supplier/SupplierApiImpl.java | 7 +++++++ .../system/controller/admin/user/dto/UserPageDTO.java | 2 ++ .../main/resources/mapper/user/AdminUserMapper.xml | 3 +++ 7 files changed, 36 insertions(+), 5 deletions(-) diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASupplierProcurementPlanController.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASupplierProcurementPlanController.java index a59bf6f3..69ef4a46 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASupplierProcurementPlanController.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/BpmOASupplierProcurementPlanController.java @@ -78,6 +78,14 @@ public class BpmOASupplierProcurementPlanController { return success(BeanUtils.toBean(pageResult, BpmOASupplierProcurementPlanRespVO.class)); } + @GetMapping("/getPlanItem") + @Operation(summary = "获得供应商采购计划商品列表") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + public CommonResult> getPlanItem(@RequestParam("id") Long id) { + List items = oaSupplierProcurementPlanItemService.getByProcurementPlanId(id); + List itemVos = BeanUtils.toBean(items, BpmOASupplierProcurementPlanItemRespVO.class); + return success(itemVos); + } @GetMapping("/getListBySupplierId") @Operation(summary = "根据供应商id获取采购计划列表") diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierpurchasepayment/BpmOASupplierPurchasePaymentSaveReqVO.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierpurchasepayment/BpmOASupplierPurchasePaymentSaveReqVO.java index 5eee9148..1c75da61 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierpurchasepayment/BpmOASupplierPurchasePaymentSaveReqVO.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/controller/admin/oa/vo/supplierpurchasepayment/BpmOASupplierPurchasePaymentSaveReqVO.java @@ -18,7 +18,6 @@ public class BpmOASupplierPurchasePaymentSaveReqVO { private Long id; @Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14357") - @NotNull(message = "申请人的用户编号不能为空") private Long userId; @Schema(description = "供应商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13580") diff --git a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierPurchasePaymentServiceImpl.java b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierPurchasePaymentServiceImpl.java index 3d32538b..aede1898 100644 --- a/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierPurchasePaymentServiceImpl.java +++ b/yudao-module-bpm/yudao-module-bpm-biz/src/main/java/cn/iocoder/yudao/module/bpm/service/oa/BpmOASupplierPurchasePaymentServiceImpl.java @@ -22,6 +22,7 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum; import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService; import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService; import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService; +import cn.iocoder.yudao.module.system.api.supplier.SupplierApi; import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -66,7 +67,8 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im private BpmOASupplierProcurementPlanMapper supplierProcurementPlanMapper; @Resource private BpmOASupplierProcurementPlanItemMapper supplierProcurementPlanItemMapper; - + @Resource + private SupplierApi supplierApi; /** * 供应商采购支付 @@ -76,9 +78,9 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im @Override public Long createOASupplierPurchasePayment(BpmOASupplierPurchasePaymentSaveReqVO createReqVO) { // 插入 + Long userId = WebFrameworkUtils.getLoginUserId(); BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = BeanUtils.toBean(createReqVO, BpmOASupplierPurchasePaymentDO.class); supplierPurchasePaymentMapper.insert(supplierPurchasePaymentDO); - Long userId = WebFrameworkUtils.getLoginUserId(); // 发起 BPM 流程 Map processInstanceVariables = new HashMap<>(); @@ -118,7 +120,10 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im @Override public BpmOASupplierPurchasePaymentDO getOASupplierPurchasePayment(Long id) { - BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = supplierPurchasePaymentMapper.getById(id); + BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = supplierPurchasePaymentMapper.selectById(id); + // 根据supplierId 供应商id查询供应商 + CommonResult result = supplierApi.getNameById(supplierPurchasePaymentDO.getSupplierId()); + supplierPurchasePaymentDO.setSupplierName(result.getData()); List supplierProcurementPlanIds = Arrays.stream(supplierPurchasePaymentDO.getSupplierProcurementPlanIds().split(",")).map(Long::valueOf).collect(Collectors.toList()); List planDOS = supplierProcurementPlanMapper.selectList(new LambdaQueryWrapper().in(BpmOASupplierProcurementPlanDO::getId, supplierProcurementPlanIds)); List planItemDOS = supplierProcurementPlanItemMapper.selectList(new LambdaQueryWrapper().in(BpmOASupplierProcurementPlanItemDO::getProcurementPlanId, supplierProcurementPlanIds)); diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApi.java index 11a54b57..2d307596 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApi.java @@ -1,14 +1,16 @@ package cn.iocoder.yudao.module.system.api.supplier; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO; import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO; import cn.iocoder.yudao.module.system.enums.ApiConstants; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; @FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory = @Tag(name = "RPC 服务 - 供应商新增编辑") @@ -20,4 +22,9 @@ public interface SupplierApi { @Operation(summary = "新增编辑供应商") CommonResult saveOrEdit(@RequestBody SupplierRpcDTO supplier); + + @GetMapping(PREFIX + "/getNameById") + @Operation(summary = "获取供应商名称") + @Parameter(name = "id", description = "供应商id", example = "1", required = true) + CommonResult getNameById(@RequestParam("id") Long id); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApiImpl.java index aaec46de..d3268598 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/supplier/SupplierApiImpl.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.api.supplier; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO; +import cn.iocoder.yudao.module.system.dal.dataobject.supplier.SupplierDO; import cn.iocoder.yudao.module.system.service.supplier.SupplierService; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.RestController; @@ -23,4 +24,10 @@ public class SupplierApiImpl implements SupplierApi { supplierService.saveOrEdit(supplier); return success(true); } + + @Override + public CommonResult getNameById(Long id) { + SupplierDO supplier = supplierService.getSupplier(id); + return success(supplier == null ? "其他" : supplier.getSupplierName()); + } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/dto/UserPageDTO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/dto/UserPageDTO.java index 206bea70..9ec18627 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/dto/UserPageDTO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/dto/UserPageDTO.java @@ -14,4 +14,6 @@ public class UserPageDTO extends PageParam { private String name; @Schema(description = "状态(0正常 1停用)不传则全部", example = "1") private Integer status; + @Schema(description = "部门id", example = "1") + private Long deptId; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/user/AdminUserMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/user/AdminUserMapper.xml index 2f4cf71b..ffb0e44e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/user/AdminUserMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/user/AdminUserMapper.xml @@ -73,6 +73,9 @@ #{groupId} + + and a.dept_id = #{dto.deptId} + and a.nickname like concat('%', #{dto.name}, '%') From a4dfe1a5a17786cc155995ec06704d7801e5ce3f Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Wed, 25 Sep 2024 18:38:59 +0800 Subject: [PATCH 18/27] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BC=98=E5=8C=96=EF=BC=9A=E5=9C=A8=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=E4=B8=AD=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=95=B0=E6=8D=AE=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 此次提交禁用了以下接口的数据权限管理,以确保在处理部门数据时不会进行额外的数据权限验证: - 在`DeptApiImpl`中的`deleteDept`和`getDeptByFactoryId`方法上禁用数据权限。 - 在`DeptController`中,新增的`getVirtuallyDeptList`方法和已有的`all-list`方法上禁用数据权限。 - 在`DeptServiceImpl`中的`getDeptByFactoryId`方法上禁用数据权限。这些更改确保了在执行相关操作时,能够直接获取和修改数据,避免了数据权限管理的干扰。 --- .../yudao/module/system/api/dept/DeptApiImpl.java | 2 ++ .../system/controller/admin/dept/DeptController.java | 9 +++++++++ .../module/system/service/dept/DeptServiceImpl.java | 1 + 3 files changed, 12 insertions(+) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java index 02b7904c..9ecd4202 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApiImpl.java @@ -82,6 +82,7 @@ public class DeptApiImpl implements DeptApi { } @Override + @DataPermission(enable = false) public void deleteDept(Long factoryId) { DeptDO deptDO = deptService.getDeptByFactoryId(factoryId); @@ -92,6 +93,7 @@ public class DeptApiImpl implements DeptApi { } @Override + @DataPermission(enable = false) public CommonResult getDeptByFactoryId(Long factoryId) { DeptDO deptDO = deptService.getDeptByFactoryId(factoryId); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java index 2f1c3685..4262dd1d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/dept/DeptController.java @@ -128,6 +128,15 @@ public class DeptController { return success(BeanUtils.toBean(list, DeptSimpleRespVO.class)); } + @GetMapping(value = { "/virtually-list"}) + @Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项") + public CommonResult> getVirtuallyDeptList() { + List list = deptService.getDeptList( + new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus())); + + return success(BeanUtils.toBean(list, DeptSimpleRespVO.class)); + } + @GetMapping(value = {"/all-list"}) @Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项") @DataPermission(enable = false) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index 790a7fb0..ccbc738d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -311,6 +311,7 @@ public class DeptServiceImpl implements DeptService { } @Override + @DataPermission(enable = false) public DeptDO getDeptByFactoryId(Long factoryId) { return deptMapper.selectOne(DeptDO::getFactoryId, factoryId); From 9c30d82029b3a80fcf7f86719da43098aa84d116 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Wed, 25 Sep 2024 18:39:06 +0800 Subject: [PATCH 19/27] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C=E4=BB=A5=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=99=BB=E5=BD=95=E7=94=A8=E6=88=B7=E7=9A=84?= =?UTF-8?q?=E5=85=A5=E8=81=8C=E5=92=8C=E8=BD=AC=E6=AD=A3=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/laborcontract/LaborContractController.java | 1 - 1 file changed, 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java index b228fe48..5da17d0b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/laborcontract/LaborContractController.java @@ -108,7 +108,6 @@ public class LaborContractController { @GetMapping("/getSigningDate") @Operation(summary = "获得当前登录用户的入职时间和转正时间") - @PreAuthorize("@ss.hasPermission('system:labor-contract:query')") public CommonResult getSigningDate() { LaborContractDO contractDO = laborContractService.getSigningDate(getLoginUserId()); From e362850576628538a49622a92cb88621bc483380 Mon Sep 17 00:00:00 2001 From: furongxin <419481438@qq.com> Date: Wed, 25 Sep 2024 18:39:41 +0800 Subject: [PATCH 20/27] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96=EF=BC=9A=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=E5=92=8C=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本次提交实现了工作日志模块的分页查询功能,允许用户高效地查询与其相关的上一个或下一个日志实例。通过新增`getMyNextOrUp`方法及相应的SQL映射,支持基于用户个性化需求的日志实例检索。同时,对`getNextOrUp`方法进行了默认实现调整,以支持更灵活的日志数据检索需求。这些改进提升了用户在工作日志模块的交互体验,并增强了系统的整体性能。 --- .../dal/mysql/worklog/LogInstanceMapper.java | 72 ++++++++++++++++++- .../worklog/LogInstanceServiceImpl.java | 29 ++++++-- .../mapper/worklog/LogInstanceMapper.xml | 67 ++++++++--------- 3 files changed, 128 insertions(+), 40 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java index 1e8f913f..966f338e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/worklog/LogInstanceMapper.java @@ -15,6 +15,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.worklog.LogInstanceDO; import cn.iocoder.yudao.module.system.dal.dataobject.worklog.LogReadDo; import cn.iocoder.yudao.module.system.service.worklog.dto.LogReadUserRespDTO; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -107,9 +108,76 @@ public interface LogInstanceMapper extends BaseMapperX { * @param type * @return */ - LogInstanceRespVO getNextOrUp(@Param("reqVO") LogInstancePageReqVO dto, + LogInstanceRespVO getMyNextOrUp(@Param("reqVO") LogInstancePageReqVO dto, @Param("id") Long id, @Param("userId") Long userId, @Param("type") Integer type, - @Param("pagingType") Integer pagingType, @Param("userIds") List userIds); + + default IPage getNextOrUp(@Param("reqVO") LogInstancePageReqVO reqVO, + @Param("id") Long id, + @Param("userId") Long userId, + @Param("type") Integer type, + @Param("userIds") List userIds){ + + String sql = ""; + + MPJLambdaWrapperX queryWrapper = new MPJLambdaWrapperX<>(); + queryWrapper.selectAs(LogInstanceDO::getId, LogInstanceRespVO::getId); + queryWrapper.selectAs(LogInstanceDO::getName, LogInstanceRespVO::getName); + queryWrapper.innerJoin(UserPostDO.class, "userPost", UserPostDO::getUserId, LogInstanceDO::getStartUserId); + queryWrapper.innerJoin(DeptDO.class, "dept", DeptDO::getId, LogInstanceDO::getDeptId); + queryWrapper.innerJoin(PostDO.class, "post", PostDO::getId, UserPostDO::getPostId); + if (type == 1) { + sql = " (t.time > tt.time) or\n" + + " (t.time = tt.time and tt.sort > post.sort) or\n" + + " (t.time = tt.time and tt.sort = post.sort and tt.create_time < t.create_time)"; + + queryWrapper.orderByAsc(LogInstanceDO::getTime); + queryWrapper.orderByDesc(PostDO::getSort); + queryWrapper.orderByAsc(LogInstanceDO::getCreateTime); + } + if (type == 0) { + sql = " (t.time < tt.time) or\n" + + " (t.time = tt.time and tt.sort < post.sort) or\n" + + " (t.time = tt.time and tt.sort = post.sort and tt.create_time > t.create_time)"; + + queryWrapper.orderByDesc(LogInstanceDO::getTime); + queryWrapper.orderByAsc(PostDO::getSort); + queryWrapper.orderByDesc(LogInstanceDO::getCreateTime); + } + queryWrapper.innerJoin("(\n" + + "SELECT \n" + + " a.id,\n" + + " a.name,\n" + + " a.time,\n" + + " d.sort,\n" + + " a.create_time\n" + + "FROM \n" + + " work_log_instance_ext a\n" + + " INNER JOIN system_user_post b ON (b.user_id = a.start_user_id) \n" + + " INNER JOIN system_dept c ON (c.id = a.dept_id) \n" + + " INNER JOIN system_post d ON (d.id = b.post_id) \n" + + "WHERE \n" + + " a.id = " + id + "\n" + + " AND a.deleted = 0 \n" + + " AND b.deleted = 0 \n" + + " AND c.deleted = 0 \n" + + " AND d.deleted = 0\n" + + ") tt on \n" + sql); + queryWrapper.eqIfPresent(LogInstanceDO::getDeptId, reqVO.getDeptId()); + queryWrapper.eqIfPresent(LogInstanceDO::getFormId, reqVO.getFormId()); + queryWrapper.eqIfPresent(LogInstanceDO::getStartUserId, reqVO.getStartUserId()); + queryWrapper.betweenIfPresent(LogInstanceDO::getTime, reqVO.getCreateTime()); + queryWrapper.inIfPresent(LogInstanceDO::getStartUserId, userIds); + queryWrapper.ne(LogInstanceDO::getStartUserId, userId); + + if (reqVO.getIsProduce() != null && reqVO.getIsProduce() == 1) { + queryWrapper.like(DeptDO::getFlag, "166"); + } + if (reqVO.getIsProduce() != null && reqVO.getIsProduce() == 2) { + queryWrapper.notLike(DeptDO::getFlag, "166"); + } + + return selectJoinPage(new Page<>(1, 1), LogInstanceRespVO.class, queryWrapper); + } } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/worklog/LogInstanceServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/worklog/LogInstanceServiceImpl.java index ebde0cd3..873fc912 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/worklog/LogInstanceServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/worklog/LogInstanceServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.service.worklog; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.json.JSONObject; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -256,14 +257,14 @@ public class LogInstanceServiceImpl implements LogInstanceService { if (!records.isEmpty()) { //模版ids过滤 - List workFormIds = records.stream().map(LogInstanceRespVO::getFormId).collect(Collectors.toList()); + Set workFormIds = records.stream().map(LogInstanceRespVO::getFormId).collect(Collectors.toSet()); // 查询模版列表 List formList = logFormService.getFormList(workFormIds); Map formMap = formList.stream().collect(Collectors.toMap(LogFormDO::getId, item -> item)); //查询用户信息列表 - List userIds = records.stream().map(LogInstanceRespVO::getStartUserId).collect(Collectors.toList()); + Set userIds = records.stream().map(LogInstanceRespVO::getStartUserId).collect(Collectors.toSet()); Map userMap = adminUserService.getUserMap(userIds); //遍历 @@ -400,10 +401,26 @@ public class LogInstanceServiceImpl implements LogInstanceService { //以及岗位为总监或副总监的用户 leaderUserIds = adminUserService.getUserByBoss(); } - LogInstanceRespVO upLogInstance = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 1, pagingType, leaderUserIds); - LogInstanceRespVO nextLogInstance = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 0, pagingType, leaderUserIds); - vo.setUpLogInstance(upLogInstance); - vo.setNextLogInstance(nextLogInstance); + if (pagingType == 0) { + IPage upLogInstances = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 1, leaderUserIds); + IPage nextLogInstances = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 0, leaderUserIds); + + if (CollectionUtil.isNotEmpty(upLogInstances.getRecords())) { + vo.setUpLogInstance(upLogInstances.getRecords().get(0)); + } + if (CollectionUtil.isNotEmpty(nextLogInstances.getRecords())) { + vo.setNextLogInstance(nextLogInstances.getRecords().get(0)); + } + } + + if (pagingType == 1) { + LogInstanceRespVO upLogInstance = logInstanceMapper.getMyNextOrUp(dto, id, getLoginUserId(), 1, leaderUserIds); + LogInstanceRespVO nextLogInstance = logInstanceMapper.getMyNextOrUp(dto, id, getLoginUserId(), 0, leaderUserIds); + + vo.setUpLogInstance(upLogInstance); + vo.setNextLogInstance(nextLogInstance); + } + //获取日志详情 return vo; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/worklog/LogInstanceMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/worklog/LogInstanceMapper.xml index d6c4932b..bbb92770 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/worklog/LogInstanceMapper.xml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/worklog/LogInstanceMapper.xml @@ -94,61 +94,66 @@ or result.data_scope = 1 ) - @@ -156,13 +161,11 @@