| | |
| | | import java.io.IOException; |
| | | |
| | | |
| | | import java.sql.Date; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | |
| | | } |
| | | |
| | | } |
| | | itemmap.put("processName",processName); |
| | | |
| | | } |
| | | |
| | |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | |
| | | Integer sumQuantity = flowCardMapper.getSumQuantity(flowCard.getOrderId()); |
| | | List<Map<String, Object>> details = flowCardMapper.getPrintCustomData(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getPrintQuantity()); |
| | | Integer printQuantity = flowCard.getPrintQuantity(); |
| | | if (printQuantity==null){ |
| | | printQuantity=0; |
| | | } |
| | | List<Map<String, Object>> details = flowCardMapper.getPrintCustomData(flowCard.getProcessId(), flowCard.getOrderNumber(), printQuantity); |
| | | |
| | | for (Map<String, Object> detail : details) { |
| | | detail.put("sumQuantity", sumQuantity); |
| | |
| | | List<Map<String, Object>> processList = flowCardMapper.getProcessList(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | //工序列表 |
| | | List<Map<String, Object>> processNameList = flowCardMapper.getProcessNameList(); |
| | | itemmap.put("count", flowCardMapper.countFlowCard(flowCard.getOrderId())); |
| | | itemmap.put("processList", processList); |
| | | itemmap.put("processNameList", processNameList); |
| | | // itemmap.put("numberList", numberList); |
| | | list.add(itemmap); |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | map.put("data", list); |
| | | //初始化值 |
| | | printLike = null; |
| | |
| | | } |
| | | //将原来已报工的数据更新 |
| | | if (resultList != null && !resultList.isEmpty()) { |
| | | for (OrderProcessDetail d : resultList) { |
| | | flowCardMapper.updateOrderProcessDetail(d.getProcessId(),d.getOrderNumber(),d.getTechnologyNumber(), |
| | | d.getReportingWorkNumCount(),d.getReportingWorkNum(),d.getBrokenNum(),d.getProcess()); |
| | | |
| | | for (String number : numberList) { |
| | | for (OrderProcessDetail d : resultList) { |
| | | flowCardMapper.updateOrderProcessDetail(d.getProcessId(),number,d.getTechnologyNumber(), |
| | | d.getReportingWorkNumCount(),d.getReportingWorkNum(),d.getBrokenNum(),d.getProcess()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return true; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public boolean getNewProcessSv(String processId, String orderNumber, String technologyNumber, List<String> orderProcess) { |
| | | |
| | | // 获取最新报工工序 |
| | | List<Map<String, Object>> newProcess = flowCardMapper.getNewProcessMp(processId, orderNumber, technologyNumber); |
| | | |
| | | if (newProcess == null || newProcess.isEmpty()) { |
| | | return false; // 找不到标准值 |
| | | } |
| | | |
| | | // 最新工序排序号 |
| | | int standardSort = Integer.parseInt(newProcess.get(0).get("sort").toString()); |
| | | |
| | | // 循环 orderProcess 的每一个工序,查询它们的 sort |
| | | for (String processName : orderProcess) { |
| | | Map<String, Object> data = flowCardMapper.getProcessInfo(processName); |
| | | |
| | | if (data == null) { |
| | | return false; // 工序查不到 |
| | | } |
| | | int orderSort = Integer.parseInt(data.get("sort").toString()); |
| | | // orderSort 必须 > standardSort |
| | | if (orderSort <= standardSort) { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | public Map<String, Object> PrintProgressProcessCardSv(List<String> selectDate, List<String> columns) { |
| | | 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<>(); |
| | | //获取表格内容数据 |
| | | List<Map<String, String>> dataList = flowCardMapper.PrintProgressProcessCardData(startDate, endDate); |
| | | //获取表头工序筛选数据 |
| | | List<Map<String, String>> uniqueList = flowCardMapper.OrderProcess(); |
| | | map.put("title", uniqueList); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | | list.add(endDate); |
| | | map.put("selectDate",list); |
| | | map.put("data",dataList ); |
| | | return map; |
| | | } |
| | | } |
| | | |
| | | |