feat: 完成采购看板与异议管理模块功能升级
1. 新增报表下钻跳转支持,为供应商、RFQ、采购单、物料等页面添加路由参数解析 2. 优化异议管理模块:新增发货单关联、详情弹窗、审批流程优化 3. 完善采购看板功能:支持累计数据展示、图表导出、数据补全与趋势优化 4. 新增供应商评分历史趋势统计与品类分布聚合逻辑 5. 修复异议API路径与通知跳转路径问题,新增模拟测试数据
This commit is contained in:
@@ -8,13 +8,19 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.domain.bid.BizApprovalConfig;
|
||||
import com.ruoyi.system.domain.bid.BizNotifyMessage;
|
||||
import com.ruoyi.system.domain.bid.BizOrderObjection;
|
||||
import com.ruoyi.system.service.bid.IBizApprovalConfigService;
|
||||
import com.ruoyi.system.service.bid.IBizNotifyMessageService;
|
||||
import com.ruoyi.system.service.bid.IBizOrderObjectionService;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/bid/objection")
|
||||
public class BizOrderObjectionController extends BaseController {
|
||||
@Autowired private IBizOrderObjectionService service;
|
||||
@Autowired private IBizNotifyMessageService notifyMessageService;
|
||||
@Autowired private IBizApprovalConfigService approvalConfigService;
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('bid:objection:list')")
|
||||
@GetMapping("/list")
|
||||
@@ -32,15 +38,58 @@ public class BizOrderObjectionController extends BaseController {
|
||||
@Log(title = "订单异议", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BizOrderObjection record) {
|
||||
Long tenantId = getDeptId();
|
||||
if (tenantId == null) tenantId = 1L;
|
||||
record.setTenantId(tenantId);
|
||||
record.setCreateBy(getUsername());
|
||||
return toAjax(service.insertBizOrderObjection(record));
|
||||
int rows = service.insertBizOrderObjection(record);
|
||||
// 通知审批人有新异议待处理
|
||||
if (rows > 0 && record.getObjectionId() != null) {
|
||||
sendNewObjectionNotification(record);
|
||||
}
|
||||
return toAjax(rows);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建异议后通知审批人
|
||||
*/
|
||||
private void sendNewObjectionNotification(BizOrderObjection record) {
|
||||
try {
|
||||
BizApprovalConfig config = approvalConfigService.selectByBizType("ORDER_OBJECTION");
|
||||
if (config == null || config.getUserIds() == null || config.getUserIds().isEmpty()) return;
|
||||
|
||||
String title = "新异议待处理: 订单异议 " + (record.getDoId() != null ? "发货单#" + record.getDoId() : "");
|
||||
StringBuilder content = new StringBuilder();
|
||||
content.append("有新的订单异议提交,等待处理。");
|
||||
if (record.getSupplierId() != null) content.append("供应商ID: ").append(record.getSupplierId()).append(";");
|
||||
if (record.getReason() != null) content.append("异议原因: ").append(record.getReason()).append(";");
|
||||
content.append("提交人: ").append(getUsername());
|
||||
|
||||
for (Long approverUserId : config.getUserIds()) {
|
||||
if (approverUserId == null) continue;
|
||||
BizNotifyMessage msg = new BizNotifyMessage();
|
||||
msg.setUserId(approverUserId);
|
||||
msg.setNoticeType("approval");
|
||||
msg.setPriority(1);
|
||||
msg.setBizType("ORDER_OBJECTION");
|
||||
msg.setBizId(record.getObjectionId());
|
||||
msg.setBizUrl("/fulfill/supplierFulfill/objection?id=" + record.getObjectionId());
|
||||
msg.setCreateBy(getUsername());
|
||||
msg.setTitle(title);
|
||||
msg.setContent(content.toString());
|
||||
msg.setIsRead("0");
|
||||
notifyMessageService.insertNotifyMessage(msg);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 通知发送失败不影响业务操作
|
||||
}
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('bid:objection:edit')")
|
||||
@Log(title = "处理异议", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/resolve")
|
||||
public AjaxResult resolve(@RequestBody BizOrderObjection record) {
|
||||
record.setStatus("resolved");
|
||||
// 只保存处理结果,不直接修改状态,状态由审批流程控制
|
||||
return toAjax(service.updateBizOrderObjection(record));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user