廖井涛
2025-09-09 b2cefd84dfd1aa051ae4ab342874fbafef74ab3b
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -89,9 +89,23 @@
    }
    //分架查询
    public Map<String, Object> selectAddProcess(Date selectTime1, Date selectTime2, FlowCard flowCard) {
    public Map<String, Object> selectAddProcess(List<String> selectDate, FlowCard flowCard) {
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
        if(selectDate !=null && selectDate.size()==2){
            if(!selectDate.get(0).isEmpty()){
                startDate = selectDate.get(0);
            }
            if(!selectDate.get(1).isEmpty()){
                endDate = selectDate.get(1);
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.selectFlowCardMp(selectTime1, selectTime2, flowCard));
        map.put("data", flowCardMapper.selectFlowCardMp( startDate, endDate, flowCard));
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
@@ -248,23 +262,51 @@
        return map;
    }
    public Object selectPrintFlowCardSv(Date selectTime1, Date selectTime2, String orderId, String project, String userId, Integer state, FlowCard flowCard) {
    public Object selectPrintFlowCardSv(List<String> selectDate, String orderId, String project, String userId, Integer state, FlowCard flowCard) {
        if ("null".equals(orderId)) {
            orderId = "";
        }
        if ("null".equals(project)) {
            project = "";
        }
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
        if(selectDate !=null && selectDate.size()==2){
            if(!selectDate.get(0).isEmpty()){
                startDate = selectDate.get(0);
            }
            if(!selectDate.get(1).isEmpty()){
                endDate = selectDate.get(1);
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.selectPrintFlowCardMp(selectTime1, selectTime2, orderId, project,state, flowCard));
        map.put("data", flowCardMapper.selectPrintFlowCardMp(startDate, endDate, orderId, project,state, flowCard));
        String roleId = flowCardMapper.selectUserMp(userId);
        map.put("user", roleId);
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
    public Object selectPrintFlowCard(Date selectTime1, Date selectTime2) {
    public Object selectPrintFlowCard(List<String> selectDate) {
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
        if(selectDate !=null && selectDate.size()==2){
            if(!selectDate.get(0).isEmpty()){
                startDate = selectDate.get(0);
            }
            if(!selectDate.get(1).isEmpty()){
                endDate = selectDate.get(1);
            }
        }
        Map<String, Object> map = new HashMap<>();
        map.put("data", flowCardMapper.selectPrintFlowCard(selectTime1, selectTime2));
        map.put("data", flowCardMapper.selectPrintFlowCard(startDate, endDate));
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
@@ -1214,26 +1256,29 @@
    }
    public Boolean updateProcessSv(String processId,String orderNumber, String technologyNumber, String orderId, String Orderprocess, Map<String, Object> object) {
        List<OrderProcessDetail> resultList = new ArrayList<>();
        //获取已报工工艺流程
        String processOk = flowCardMapper.getProcessOk(processId,orderNumber,technologyNumber);
        List<String> okList = Arrays.asList(processOk.split("->"));
        List<String> orderList = Arrays.asList(Orderprocess.split("->"));
        if (processOk != null && !processOk.isEmpty()){
            List<String> okList = Arrays.asList(processOk.split("->"));
            List<String> orderList = Arrays.asList(Orderprocess.split("->"));
        // 判断 processOk 的每个工序是否都包含在 orderProcess 中
        for (String p : okList) {
            if (!orderList.contains(p)) {
                return false;
            // 判断 processOk 的每个工序是否都包含在 orderProcess 中
            for (String p : okList) {
                if (!orderList.contains(p)) {
                    return false;
                }
            }
        }
        List<OrderProcessDetail> resultList = new ArrayList<>();
        for (String process : okList) {
            List<OrderProcessDetail> details =
                    flowCardMapper.getProcessDetail(processId,orderNumber, technologyNumber, process);
            if (details != null && !details.isEmpty()) {
                resultList.addAll(details);
            for (String process : okList) {
                List<OrderProcessDetail> details =
                        flowCardMapper.getProcessDetail(processId,orderNumber, technologyNumber, process);
                if (details != null && !details.isEmpty()) {
                    resultList.addAll(details);
                }
            }
        }