Compare commits

...

4 Commits

Author SHA1 Message Date
furongxin
9b61650fef Merge branch 'dev' of http://git.znkjfw.com/ak/zn-cloud into frx 2024-12-04 11:51:40 +08:00
furongxin
973f7e4bcf refactor(bpm): 优化报销控制器中的项目编号判断逻辑
- 将 Strings.isNotEmpty() 替换为 StringUtil.isNotEmpty()
- 引入 jodd.util.StringUtil 替换 org.mapstruct.ap.internal.util.Strings- 提高代码可读性和维护性
2024-12-04 11:51:30 +08:00
aikai
18447d04df 修改公众号发消息bug 2024-12-04 11:33:00 +08:00
furongxin
1d80ee957e feat(bpm): 为采购申请功能增加项目名称展示
- 在 BpmOAProcureDO 中添加 projectNo 字段,用于存储项目编号
- 在 BpmOAProcureRespVO 中添加 projectNo 和 projectName 字段,用于展示项目编号和名称
- 在 BpmOAProcureSaveReqVO 中添加 projectNo 字段,允许用户在创建采购申请时选择项目
- 修改 BpmOAProcureController 中的 getOaProcure 和 getByProcessInstanceId 方法,通过 ProjectApi 获取项目名称并设置到响应中
2024-12-04 10:32:58 +08:00
7 changed files with 37 additions and 7 deletions

View File

@ -7,6 +7,8 @@ import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.BpmOAProcureSa
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAProcureConvert;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAProcureService;
import cn.iocoder.yudao.module.system.api.project.ProjectApi;
import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -27,6 +29,9 @@ public class BpmOAProcureController {
@Resource
private BpmOAProcureService bpmOaProcureService;
@Resource
private ProjectApi projectApi;
@PostMapping("/create")
@Operation(summary = "创建OA 采购申请")
// @PreAuthorize("@ss.hasPermission('bpm:oa-procure:create')")
@ -57,7 +62,13 @@ public class BpmOAProcureController {
// @PreAuthorize("@ss.hasPermission('bpm:oa-procure:query')")
public CommonResult<BpmOAProcureRespVO> getOaProcure(@RequestParam("id") Long id) {
BpmOAProcureDO oaProcure = bpmOaProcureService.getOaProcure(id);
return success(BpmOAProcureConvert.INSTANCE.convert(oaProcure));
BpmOAProcureRespVO respVO = BpmOAProcureConvert.INSTANCE.convert(oaProcure);
if (respVO != null && respVO.getProjectNo() != null) {
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}
return success(respVO);
}
@ -74,7 +85,13 @@ public class BpmOAProcureController {
public CommonResult<BpmOAProcureRespVO> getByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
BpmOAProcureDO oaProcure = bpmOaProcureService.getByProcessInstanceId(processInstanceId);
return success(BpmOAProcureConvert.INSTANCE.convert(oaProcure));
BpmOAProcureRespVO respVO = BpmOAProcureConvert.INSTANCE.convert(oaProcure);
if (respVO != null && respVO.getProjectNo() != null) {
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
}
return success(respVO);
}
}

View File

@ -10,7 +10,9 @@ import cn.iocoder.yudao.module.system.api.project.dto.ProjectDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jodd.util.StringUtil;
import org.mapstruct.ap.internal.util.Strings;
import org.springframework.util.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -52,7 +54,7 @@ public class BpmOAReimbursementController {
BpmOAReimbursementDO reimbursement = service.getReimbursement(id);
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
// 设置项目名称
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());
@ -75,7 +77,7 @@ public class BpmOAReimbursementController {
BpmOAReimbursementDO reimbursement = service.getByProcessInstanceId(processInstanceId);
BpmOAReimbursementRespVO respVO = service.convert(reimbursement);
if (respVO != null && Strings.isNotEmpty(respVO.getProjectNo())) {
if (respVO != null && StringUtil.isNotEmpty(respVO.getProjectNo())) {
// 设置项目名称
ProjectDTO projectDTO = projectApi.getProject(respVO.getProjectNo()).getCheckedData();
respVO.setProjectName(projectDTO.getName());

View File

@ -22,6 +22,12 @@ public class BpmOAProcureRespVO {
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26976")
private Long userId;
@Schema(description = "项目编号", example = "26976")
private String projectNo;
@Schema(description = "项目名称", example = "26976")
private String projectName;
@Schema(description = "申请事由", example = "不喜欢")
private String reason;

View File

@ -21,6 +21,9 @@ public class BpmOAProcureSaveReqVO {
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "26976")
private Long userId;
@Schema(description = "项目编号", example = "26976")
private String projectNo;
@Schema(description = "申请事由", example = "不喜欢")
private String reason;

View File

@ -49,6 +49,10 @@ public class BpmOAProcureDO extends BaseDO {
* 申请人的用户编号
*/
private Long userId;
/**
* 项目编号
*/
private String projectNo;
/**
* 申请事由
*/

View File

@ -12,7 +12,7 @@ public class AdminOauthUserOtherInfoApiDTO {
/**
* 社交平台的类型 (参见 {@link SocialTypeEnum} 枚举)
*/
private Integer socialType = SocialTypeEnum.WECHAT_MINI_APP.getType();
private Integer socialType;
/**
* 用户状态 0开启 1关闭
*/

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.system.api.subscribe;
import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage;
import cn.iocoder.yudao.framework.common.enums.SocialTypeEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.template.vo.MsgData;
import cn.iocoder.yudao.framework.common.template.vo.SubscribeMessageReqDTO;
@ -16,7 +15,6 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;