feat(erp): 为请购单增加审批意见功能

- 在ErpPurchaseRequisition实体类中添加一审和二审审批意见字段
- 在ErpPurchaseRequisitionBo和ErpPurchaseRequisitionVo中同步添加审批意见字段
- 修改approve和reject方法接口,支持传递审批意见参数
- 在服务实现层将审批意见保存到对应字段中
- 更新前端控制器接收审批意见参数并传递给服务层
- 在前端页面显示审批意见,并调整审批进度布局样式
- 添加数据库表结构变更SQL脚本,增加审批意见字段
This commit is contained in:
jhd
2026-07-08 11:37:35 +08:00
parent dde1ade8b9
commit 3acb6d7f54
9 changed files with 56 additions and 17 deletions

View File

@@ -94,14 +94,16 @@ public class ErpPurchaseRequisitionController extends BaseController {
/** 审批通过(审批中 → 已通过) */
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
@PutMapping("/{reqId}/approve")
public R<Void> approve(@NotNull(message = "主键不能为空") @PathVariable Long reqId) {
return toAjax(iErpPurchaseRequisitionService.approve(reqId));
public R<Void> approve(@NotNull(message = "主键不能为空") @PathVariable Long reqId,
@RequestParam(required = false) String approvalOpinion) {
return toAjax(iErpPurchaseRequisitionService.approve(reqId, approvalOpinion));
}
/** 驳回(审批中 → 已驳回) */
@Log(title = "请购及采购单", businessType = BusinessType.UPDATE)
@PutMapping("/{reqId}/reject")
public R<Void> reject(@NotNull(message = "主键不能为空") @PathVariable Long reqId) {
return toAjax(iErpPurchaseRequisitionService.reject(reqId));
public R<Void> reject(@NotNull(message = "主键不能为空") @PathVariable Long reqId,
@RequestParam(required = false) String approvalOpinion) {
return toAjax(iErpPurchaseRequisitionService.reject(reqId, approvalOpinion));
}
}

View File

@@ -106,6 +106,12 @@ public class ErpPurchaseRequisition extends BaseEntity {
@TableLogic
private String delFlag;
/** 一审审批意见 */
private String firstApprovalOpinion;
/** 二审审批意见 */
private String secondApprovalOpinion;
/** 备注 */
private String remark;
}

View File

@@ -100,6 +100,12 @@ public class ErpPurchaseRequisitionBo extends BaseEntity {
/** 状态 */
private String formStatus;
/** 一审审批意见 */
private String firstApprovalOpinion;
/** 二审审批意见 */
private String secondApprovalOpinion;
/** 备注 */
private String remark;

View File

@@ -100,6 +100,12 @@ public class ErpPurchaseRequisitionVo implements Serializable {
@ExcelProperty(value = "状态")
private String formStatus;
@ExcelProperty(value = "一审审批意见")
private String firstApprovalOpinion;
@ExcelProperty(value = "二审审批意见")
private String secondApprovalOpinion;
@ExcelProperty(value = "备注")
private String remark;

View File

@@ -38,8 +38,8 @@ public interface IErpPurchaseRequisitionService {
Boolean submitApproval(Long reqId, Long firstApproverId, String firstApproverName);
/** 审批通过(审批中 → 已通过) */
Boolean approve(Long reqId);
Boolean approve(Long reqId, String approvalOpinion);
/** 驳回(审批中 → 已驳回) */
Boolean reject(Long reqId);
Boolean reject(Long reqId, String approvalOpinion);
}

View File

@@ -149,7 +149,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean approve(Long reqId) {
public Boolean approve(Long reqId, String approvalOpinion) {
ErpPurchaseRequisition entity = baseMapper.selectById(reqId);
if (entity == null) return false;
String currentNickName = LoginHelper.getNickName();
@@ -161,6 +161,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
throw new RuntimeException("您不是该请购单指定的审批人");
}
entity.setFormStatus("6");
entity.setFirstApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else if ("6".equals(entity.getFormStatus())) {
@@ -170,6 +171,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
}
entity.setFormStatus("2");
entity.setSignRequestGm("陈清鑫");
entity.setSecondApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else {
@@ -179,7 +181,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean reject(Long reqId) {
public Boolean reject(Long reqId, String approvalOpinion) {
ErpPurchaseRequisition entity = baseMapper.selectById(reqId);
if (entity == null) return false;
String currentNickName = LoginHelper.getNickName();
@@ -191,6 +193,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
throw new RuntimeException("您不是该请购单指定的审批人");
}
entity.setFormStatus("5");
entity.setFirstApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else if ("6".equals(entity.getFormStatus())) {
@@ -199,6 +202,7 @@ public class ErpPurchaseRequisitionServiceImpl implements IErpPurchaseRequisitio
throw new RuntimeException("二审仅限指定审批人操作");
}
entity.setFormStatus("5");
entity.setSecondApprovalOpinion(approvalOpinion);
return baseMapper.updateById(entity) > 0;
} else {