sgj
2026-03-25 8bb88ec2ed80687858d0aa9f53b78f407f4045dd
fzzy-igdss-web/src/main/java/com/fzzy/work/WorkOrderController.java
@@ -1,8 +1,16 @@
package com.fzzy.work;
import com.fzzy.igds.utils.DateUtil;
import com.fzzy.work.data.WorkNode;
import com.fzzy.work.data.WorkStatus;
import com.fzzy.work.domain.WorkOrder;
import com.fzzy.work.domain.WorkOrderConf;
import com.fzzy.work.domain.WorkOrderProcess;
import com.fzzy.work.service.WorkOrderConfService;
import com.fzzy.work.service.WorkOrderProcessService;
import com.fzzy.work.service.WorkOrderService;
import com.ruoyi.common.core.controller.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
@@ -10,10 +18,13 @@
import org.springframework.web.bind.annotation.RequestParam;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
 * 工单管理
 */
@Slf4j
@Controller
@RequestMapping("/work")
public class WorkOrderController extends BaseController {
@@ -23,6 +34,10 @@
    @Resource
    private WorkOrderConfService workOrderConfService;
    @Resource
    private WorkOrderProcessService workOrderProcessService;
    @Resource
    private WorkOrderService workOrderService;
    /**
@@ -69,9 +84,50 @@
     */
    @GetMapping("/flow-his")
    public String flowHis(@RequestParam("orderId") String orderId, ModelMap mmap) {
        log.info("工单记录-工单ID:{}", orderId);
        List<WorkOrderProcess> list = workOrderProcessService.queryList(orderId);
        mmap.put("list", list);
        mmap.put("tipTime", "0分钟");
        mmap.put("tipCount", "0次");
        mmap.put("list", null);
        if (null == list || list.isEmpty()) return prefix + "/flow-his";
        //次数默认减去第一次提交
        mmap.put("tipCount", list.size() - 1 + "次");
        WorkOrderProcess last = list.get(0);
        if(!last.getNode().equals(WorkNode.NODE_END.getCode())){
            long tipTime = DateUtil.difMin(list.get(0).getCreateTime(), new Date());
            mmap.put("tipTime", tipTime + "分钟");
        }
        return prefix + "/flow-his";
    }
}
    @GetMapping("/flow-his2")
    public String flowHis2(@RequestParam("businessId") String businessId, ModelMap mmap) {
        log.info("工单记录-业务ID:{}", businessId);
        //获取工单
        WorkOrder order = workOrderService.selectByBusinessId(businessId);
        mmap.put("list", null);
        mmap.put("tipTime", "0分钟");
        mmap.put("tipCount", "0次");
        if (null == order) return prefix + "/flow-his";
        List<WorkOrderProcess> list = workOrderProcessService.queryList(order.getId());
        if (null == list || list.isEmpty()) return prefix + "/flow-his";
        //次数默认减去第一次提交
        mmap.put("tipCount", list.size() - 1 + "次");
        WorkOrderProcess last = list.get(0);
        if(!last.getNode().equals(WorkNode.NODE_END.getCode())){
            long tipTime = DateUtil.difMin(list.get(0).getCreateTime(), new Date());
            mmap.put("tipTime", tipTime + "分钟");
        }
        return prefix + "/flow-his";
    }
}