guoyujie
23 小时以前 91b61fe723df498d62c596372521d426299f0f8b
north-glass-erp/src/main/java/com/example/erp/service/pp/ProductionSchedulingService.java
@@ -22,12 +22,12 @@
    ProductionSchedulingMapper productionSchedulingMapper;
    //未排产查询
    public Map<String, Object> selectSchedulingSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling ) {
    public Map<String, Object> selectSchedulingSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String orderIds, String processes, Integer state, ProductionScheduling productionScheduling ) {
        Integer offset = (pageNum - 1) * pageSize;
        Map<String, Object> map = new HashMap<>();
        if("null".equals(orderId)){
            orderId="";
        if("null".equals(orderIds)){
            orderIds="";
        }
        if ("null".equals(processes)){
@@ -35,12 +35,14 @@
        }
        if (state==2){//已排产
            map.put("data", productionSchedulingMapper.selectOkSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderId,processes, productionScheduling));
            map.put("data", productionSchedulingMapper.selectOkSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
            map.put("total", productionSchedulingMapper.getOkPageTotal(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
        }else if (state==1){//未排产
            map.put("data", productionSchedulingMapper.selectNoSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderId,processes, productionScheduling));
            map.put("data", productionSchedulingMapper.selectNoSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
            map.put("total", productionSchedulingMapper.getPageTotal(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling));
        }
        map.put("total", productionSchedulingMapper.getPageTotal(offset, pageSize,selectTime1, selectTime2,orderId,processes, productionScheduling));
        return map;
    }
@@ -48,24 +50,11 @@
    //首次查询排产数据
    public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,String processes,String orderId,ProductionScheduling productionScheduling ) {
        Map<String, Object> map = new HashMap<>();
        if("null".equals(orderId)){
            orderId="";
        }
        if ("null".equals(processes)){
            processes="";
        }
        map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2,processes,orderId, productionScheduling));
        map.put("process", productionSchedulingMapper.selectProcess());
        return map;
    }
    //带订单号查询
    public Map<String, Object> selectSchedulingNotSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling) {
        Map<String, Object> map = new HashMap<>();
        map.put("data", productionSchedulingMapper.selectSchedulingNotMp(selectTime1, selectTime2,orderId,processes, productionScheduling));
        return map;
    }
    public Boolean addSchedulingSv(Map<String, Object> object) {
        String userName = "";
@@ -89,11 +78,7 @@
        List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class);
        if (!schedulinglist.isEmpty()) {
            for (ProductionScheduling productionScheduling : schedulinglist) {
                //查询已排产工序数量
             // Integer num =  productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes);
             productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),productionScheduling.getTechnologyNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes());
                //System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getTechnologyNumber());
             productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderGlassDetail().getOrderId(),productionScheduling.getOrderNumber(),productionScheduling.getTechnologyNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes());
            }
            return true;
        }
@@ -110,7 +95,6 @@
        if (!Scheduling.isEmpty()) {
            for (ProductionScheduling productionScheduling : Scheduling) {
                productionSchedulingMapper.deleteSchedulingMp(productionScheduling.getSchedulingId());
                // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
            }
            return true;
        }
@@ -128,8 +112,21 @@
        if (!schedulinglist.isEmpty()) {
            for (ProductionScheduling productionScheduling : schedulinglist) {
                productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName);
                // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId());
                productionSchedulingMapper.examineSchedulingMp(productionScheduling.getSchedulingId(),userName,productionScheduling.getSchedulingQuantity(),productionScheduling.getNotes());
            }
            return true;
        }
        else {
            return false;
        }
    }
    public boolean cancelReviewSchedulingSv(Map<String, Object> object) {
        List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class);
        if (!schedulinglist.isEmpty()) {
            for (ProductionScheduling productionScheduling : schedulinglist) {
                productionSchedulingMapper.cancelReviewSchedulingMp(productionScheduling.getSchedulingId());
            }
            return true;
        }