| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.entity.userInfo.Log; |
| | |
| | | |
| | | import java.sql.Date; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.example.erp.service.sd.OrderService.getOrderProcessDetails; |
| | | |
| | |
| | | flowCardMapper.deleteReportingWork(processId); |
| | | //删除分架明细 |
| | | flowCardMapper.deleteFlowCardMp(orderId, processId); |
| | | //删除排序表数据 |
| | | flowCardMapper.deleteflowCardSort(orderId, processId); |
| | | //判断该订单流程卡是否全部删除 |
| | | Integer flowNumber = flowCardMapper.selectFlowCardCount(orderId); |
| | | if (flowNumber == 0) { |
| | |
| | | public Boolean updateLayoutStatusSv(String processId, Integer state) { |
| | | |
| | | if (!processId.isEmpty()) { |
| | | // Integer Status = flowCardMapper.selectLayoutStatus(processId); |
| | | |
| | | flowCardMapper.updateLayoutStatusMp(processId, state); |
| | | |
| | | |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | } |
| | | |
| | | //保存流程卡数据 |
| | | public Boolean addFlowCardSv(Map<String, Object> object) { |
| | | public Boolean addFlowCardSv(String orderId, Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | |
| | | String productionId = ""; |
| | | if (object.get("productionId") != null) { |
| | | productionId = object.get("productionId").toString(); |
| | |
| | | //修改分架状态,将状态改为1 |
| | | flowCardMapper.updateFlowState(productionId, flowCard.getOrderNumber()); |
| | | //查询该订单未分架数量 |
| | | Integer FlowCount = flowCardMapper.selectFlowCount(productionId); |
| | | Integer FlowCount = flowCardMapper.selectFlowCount(orderId); |
| | | if (FlowCount == 0) { |
| | | //修改订单表分架状态为2 |
| | | flowCardMapper.updateProcessingCard(productionId, 2); |
| | | flowCardMapper.updateProcessingCard(orderId, 2); |
| | | } else { |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | flowCardMapper.updateProcessingCard(productionId, 1); |
| | | flowCardMapper.updateProcessingCard(orderId, 1); |
| | | } |
| | | //查询订单小片表获取工艺传入小片工艺表 |
| | | List<OrderGlassDetail> orderGlassDetailList = |
| | | orderGlassDetailMapper.selectList( |
| | | new QueryWrapper<OrderGlassDetail>() |
| | | .eq("order_id", flowCard.getProcessId().substring(0, 10)) |
| | | .eq("order_id", orderId) |
| | | .eq("order_number", flowCard.getOrderNumber()) |
| | | ); |
| | | List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList); |
| | | orderProcessDetailList.forEach( |
| | | orderGlassDetail -> orderGlassDetail.setProcessId(flowCard.getProcessId())); |
| | | |
| | | |
| | | //赋值订单工艺表 |
| | | orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList); |
| | |
| | | map.put("data", flowCardMapper.selectNoSchedulingMp(selectTime1, selectTime2, orderId, processes, flowCard)); |
| | | |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | if ("1".equals(inquiryMode)){ |
| | | if ("1".equals(inquiryMode)){//合并流程卡 |
| | | itemmap.put("detail", flowCardMapper.selectPrintMp(flowCard.getOrderId())); |
| | | } else if ("3".equals(inquiryMode)) { |
| | | } else if ("3".equals(inquiryMode)) {//合并流程卡不按配置显示 |
| | | itemmap.put("detail", flowCardMapper.selectPrintAllMp(flowCard.getOrderId())); |
| | | } else { |
| | | } else {//非合并流程卡 |
| | | itemmap.put("detail", flowCardMapper.selectPrintNotMp(flowCard.getOrderId())); |
| | | } |
| | | |
| | |
| | | return null; |
| | | } |
| | | } |
| | | public Map<String, Object> getSelectPrintingSv(Map<String, Object> object, String printMerge, String printLike) { |
| | | public Map<String, Object> getSelectPrintingSv(Map<String, Object> object, String printMerge, String printLike, String merge) { |
| | | if (printMerge == null){ |
| | | printMerge= ""; |
| | | } |
| | | if (printLike == null){ |
| | | printLike= ""; |
| | | } |
| | | if (merge == null){ |
| | | merge= ""; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | //流程卡表头表尾数据 |
| | |
| | | //是否包含切割 |
| | | //boolean containsCutting = flowCard.getProcess().contains("切割"); |
| | | String processSub=flowCard.getProcess().substring(0, 2); |
| | | if(processSub.equals("夹胶") || processSub.equals("中空")){ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListLimt(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess())); |
| | | if(processSub.equals("夹胶") || processSub.equals("中空")){//工艺是否包含夹胶中空 |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListLimt(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess(),flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | else { |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess())); |
| | | if(merge.equals("1")&& flowCard.getMerge().equals(1)){ |
| | | // 检查是否已经处理过该 processId,如果处理过则跳过 |
| | | if (processedProcessIds.contains(flowCard.getProcessId())) { |
| | | continue; |
| | | } |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(flowCard.getProcessId()); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess(),flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListMerge(flowCard.getProcessId(),flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | }else{ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess(),flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | else { |
| | | |
| | | //流程卡明细数据 |
| | | if (printLike.equals("")||printLike.equals("null") ){ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListMerge(flowCard.getProcessId(), printMerge)); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListMerge(flowCard.getProcessId(), printMerge, flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber(), flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | else { |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getGlassChild(), flowCard.getProcess())); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()), flowCard.getGlassChild(), flowCard.getProcess(), flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), printMerge, flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectPrintProject(String printProject,String merge) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | if (merge == null){ |
| | | merge= ""; |
| | | } |
| | | List<FlowCard> flowCardList = flowCardMapper.getFlowCardListPrintProject(printProject); |
| | | if (!flowCardList.isEmpty()) { |
| | | Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | |
| | | |
| | | //是否包含切割 |
| | | //boolean containsCutting = flowCard.getProcess().contains("切割"); |
| | | String processSub=flowCard.getProcess().substring(0, 2); |
| | | if(processSub.equals("夹胶") || processSub.equals("中空")){ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListLimt(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess(),flowCard.getOrderId())); |
| | | if(flowCard.getPatchState().equals(0)){ |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | }else{ |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailLists(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getProcess(),flowCard.getOrderNumber()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | |
| | | } |
| | | else { |
| | | |
| | | if(flowCard.getPatchState().equals(0)){ |
| | | if(merge.equals("1")&& flowCard.getMerge().equals(1)){ |
| | | // 检查是否已经处理过该 processId,如果处理过则跳过 |
| | | if (processedProcessIds.contains(flowCard.getProcessId())) { |
| | | continue; |
| | | } |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(flowCard.getProcessId()); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess(),flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListMerge(flowCard.getProcessId(),flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | }else{ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryList(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess(),flowCard.getOrderId())); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLike(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getProcess()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | |
| | | }else{ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryLists(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getGlassChild(),flowCard.getProcess(),flowCard.getOrderId(),flowCard.getQuantity())); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLikes(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getProcess(),printProject,flowCard.getQuantity()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //工艺流程 |
| | | //List<Map<String, Object>> processList = flowCardMapper.getProcessList(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | String input = flowCard.getProcess(); |
| | | String delimiter = "->"; |
| | | |
| | | // 分割字符串 |
| | | String[] parts = input.split(delimiter); |
| | | |
| | | // 创建 List<Map<String, Object>> |
| | | List<Map<String, Object>> processList = new ArrayList<>(); |
| | | |
| | | // 遍历分割后的部分并将其存入 List<Map<String, Object>> |
| | | for (int i = 0; i < parts.length; i++) { |
| | | Map<String, Object> maps = new HashMap<>(); |
| | | maps.put("id", i); // 添加一个索引字段 |
| | | maps.put("process", parts[i]); // 添加实际的值 |
| | | |
| | | processList.add(maps); |
| | | } |
| | | |
| | | itemmap.put("processList", processList); |
| | | // itemmap.put("numberList", numberList); |
| | | |
| | | if(flowCard.getPatchState().equals(0)){ |
| | | itemmap.put("count", flowCardMapper.countFlowCard(flowCard.getOrderId())); |
| | | }else{ |
| | | itemmap.put("count", flowCardList.size()); |
| | | } |
| | | itemmap.put("state", flowCard.getPatchState()); |
| | | itemmap.put("remarkList", flowCardMapper.remakList(flowCard.getProcessId())); |
| | | list.add(itemmap); |
| | | |
| | | } |
| | | } |
| | | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean updateComposingSv(Map<String, Object> object) { |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("composing")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | flowCardMapper.updateComposing(flowCard.getProcessId()); |
| | | } |
| | | return true; |
| | | } |
| | | else { |
| | | return false; |
| | | |
| | | } |
| | | } |
| | | |
| | | public Boolean updateProcessCardRack(Map<String, Object> object) { |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("composing")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | flowCardMapper.updateProcessCardRack(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getRack()); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | map.put("data", flowCardMapper.getPrintLabel(projectNo)); |
| | | } else if (Objects.equals(type, "2")) { |
| | | map.put("data", flowCardMapper.getPrintLabel2(projectNo)); |
| | | } else if (Objects.equals(type, "3")) { |
| | | map.put("data", flowCardMapper.getPrintLabel3(projectNo)); |
| | | } |
| | | |
| | | return map; |
| | |
| | | |
| | | public Map<String, Object> getSelectPrintLabelSv1(Map<String, Object> object) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | // Integer count=flowCardMapper.getPrintLabelCount(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | // for (int i = 0; i < count; i++) { |
| | | itemmap.put("data", flowCardMapper.getPrintLabel1(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | list.add(itemmap); |
| | | //} |
| | | |
| | | } |
| | | } |
| | | map.put("data", list); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectPrintLabelDetails(Map<String, Object> object) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintLabelDetail(flowCard)); |
| | | list.add(itemmap); |
| | | } |
| | | } |
| | | map.put("data", list); |
| | | |
| | | return map; |
| | | } |
| | |
| | | List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class); |
| | | if (!FlowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : FlowCardList) { |
| | | // flowCardMapper.printSortMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getTechnologyNumber(),flowCard.getSort()); |
| | | //判断保存的数据是否已存在 |
| | | Integer count = flowCardMapper.printAddSortCountMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getTechnologyNumber(),flowCard.getSort(),flowCard.getProcess()); |
| | | if (count >0){ |
| | |
| | | if (!flowCardList.isEmpty()) { |
| | | Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId |
| | | |
| | | if (lableType != 2){ |
| | | if (lableType != 2){//成品标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | String processId = flowCard.getProcessId(); |
| | | |
| | |
| | | continue; |
| | | } |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomData(flowCard.getProcessId(),flowCard.getTechnologyNumber())); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomData(flowCard.getProcessId(),flowCard.getOrderNumber())); |
| | | list.add(itemmap); |
| | | |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(processId); |
| | | } |
| | | } |
| | | else{ |
| | | else{//小片标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataSemi(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getProcess())); |
| | | list.add(itemmap); |
| | | } |
| | | } |
| | | } |
| | | map.put("data", list); |
| | | map.put("title", flowCardMapper.getPrintTitle(type)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectPrintCustomLabelSv2(String type, Integer lableType, Map<String, Object> object) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId |
| | | |
| | | if (lableType != 2){//成品标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | String processId = flowCard.getProcessId(); |
| | | |
| | | // 检查是否已经处理过该 processId,如果处理过则跳过 |
| | | if (processedProcessIds.contains(processId)) { |
| | | continue; |
| | | } |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomData2(flowCard.getProcessId())); |
| | | list.add(itemmap); |
| | | |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(processId); |
| | | } |
| | | } |
| | | else{//小片标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataSemi(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getProcess())); |
| | |
| | | //流程卡表头表尾数据 |
| | | //是否传入合并层数 |
| | | if (printMerge.equals("")||printMerge.equals("null") ){ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRefund(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(),flowCard.getReportingWorkId(),mergeTechnologyNumber)); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListRefund(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getOrderNumber(),flowCard.getReportingWorkId()); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRefund(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(),flowCard.getReportingWorkId(),mergeTechnologyNumber,flowCard.getPatchReason(),flowCard.getOrderId())); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListRefund(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getOrderNumber(),flowCard.getReportingWorkId(),flowCard.getPatchReason()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | else { |
| | | |
| | | //流程卡明细数据 |
| | | if (printLike.equals("")||printLike.equals("null") ){ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListMergeRefund(flowCard.getProcessId(), printMerge,flowCard.getOrderNumber())); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListMergeRefund(flowCard.getProcessId(), printMerge,flowCard.getOrderNumber(),flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListRefund(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getOrderNumber(), flowCard.getReportingWorkId()); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListRefund(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getOrderNumber(), flowCard.getReportingWorkId(), flowCard.getPatchReason()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | else { |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRefund(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(), flowCard.getReportingWorkId(), mergeTechnologyNumber)); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRefund(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(), flowCard.getReportingWorkId(), mergeTechnologyNumber, flowCard.getPatchReason(), flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLikeRefund(flowCard.getProcessId(), printMerge,flowCard.getOrderNumber(),flowCard.getReportingWorkId()); |
| | | itemmap.put("detailList", detailList); |
| | |
| | | //流程卡表头表尾数据 |
| | | //是否传入合并层数 |
| | | if (printMerge.equals("")||printMerge.equals("null") ){ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRework(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(),flowCard.getReportingWorkId())); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRework(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(),flowCard.getReportingWorkId(),flowCard.getOrderId())); |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListRework(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getOrderNumber(),flowCard.getReportingWorkId()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | |
| | | |
| | | //流程卡明细数据 |
| | | if (printLike.equals("")||printLike.equals("null") ){ |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListMergeRework(flowCard.getProcessId(), printMerge,flowCard.getOrderNumber())); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListMergeRework(flowCard.getProcessId(), printMerge,flowCard.getOrderNumber(), flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListRework(flowCard.getProcessId(), flowCard.getTechnologyNumber(),flowCard.getOrderNumber(), flowCard.getReportingWorkId()); |
| | | itemmap.put("detailList", detailList); |
| | | } |
| | | else { |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRework(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(), flowCard.getReportingWorkId())); |
| | | itemmap.put("detail", flowCardMapper.getPrimaryListRework(flowCard.getProcessId(), String.valueOf(flowCard.getTechnologyNumber()),flowCard.getOrderNumber(), flowCard.getReportingWorkId(), flowCard.getOrderId())); |
| | | |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailListLikeRework(flowCard.getProcessId(), printMerge,flowCard.getOrderNumber(),flowCard.getReportingWorkId()); |
| | | itemmap.put("detailList", detailList); |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Object selectPrintDetailsSv(Map<String, Object> object, String inquiryMode) { |
| | | public Object selectPrintDetailsSv(Map<String, Object> object, String inquiryMode,Integer type) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("detail", flowCardMapper.selectPrintDetailsMp(flowCard.getOrderId())); |
| | | if(type==1){ |
| | | itemmap.put("detail", flowCardMapper.selectPrintDetailsMp(flowCard.getOrderId())); |
| | | }else if(type==2){ |
| | | itemmap.put("detail", flowCardMapper.selectPrintDetailsMp1(flowCard.getOrderId())); |
| | | } |
| | | |
| | | list.add(itemmap); |
| | | } |
| | | } |
| | |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId |
| | | |
| | | if (lableType != 2){ |
| | | if (lableType != 2){//成品标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | String processId = flowCard.getProcessId(); |
| | | String orderNumber = flowCard.getOrderNumber().toString(); |
| | | |
| | | // 检查是否已经处理过该 processId,如果处理过则跳过 |
| | | if (processedProcessIds.contains(processId)&&processedProcessIds.contains(orderNumber)) { |
| | | continue; |
| | | } |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataDetails(flowCard.getProcessId(),flowCard.getOrderNumber())); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataDetails(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getPrintQuantity())); |
| | | list.add(itemmap); |
| | | |
| | | // 将该 processId 加入已处理集合 |
| | | processedProcessIds.add(processId); |
| | | processedProcessIds.add(orderNumber); |
| | | } |
| | | } |
| | | else{ |
| | | else{//小片标签 |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataSemi(flowCard.getProcessId(),flowCard.getTechnologyNumber(),flowCard.getProcess())); |
| | |
| | | } |
| | | } |
| | | map.put("data", list); |
| | | map.put("title", flowCardMapper.getPrintTitle(type)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getPrintCustomDataProjectNo(String type, String projectNo) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.getPrintCustomDataProjectNo(projectNo)); |
| | | map.put("title", flowCardMapper.getPrintTitle(type)); |
| | | return map; |
| | | } |
| | |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | List<Map<String, Object>> flowCardList1=flowCardMapper.selectFlowCardMerge(flowCardList.get(0).getProcessId()); |
| | | if(flowCardList1.size()==1){ |
| | | flowCardMapper.updateFlowCardMerge(flowCardList.get(0).getProcessId()); |
| | | returns="true"; |
| | | int index=1; |
| | | for(int i = 0;i < flowCardList1.size();i++){ |
| | | if(Integer.valueOf(flowCardList1.get(i).get("count2").toString())>1){ |
| | | List<Integer> technologyNumber = Arrays.stream(flowCardList1.get(i).get("count1").toString().split(",")) |
| | | .map(Integer::parseInt) |
| | | .collect(Collectors.toList()); |
| | | flowCardMapper.updateFlowCardMerge(flowCardList.get(0).getProcessId(),technologyNumber,index); |
| | | index+=1; |
| | | returns="true"; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public List<FlowCard> getProcessCard(String processCard) { |
| | | public List<FlowCard> getProcessCard(Map<String, String> processCards) { |
| | | String processCard = processCards.get("processCard"); |
| | | if(!processCard.contains("/")){ |
| | | throw new ServiceException(Constants.Code_600, "错误的流程卡号,请检查!"); |
| | | } |
| | |
| | | return flowCardList; |
| | | } |
| | | |
| | | public Boolean checkboxDeleteSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | String userId = ""; |
| | | if (object.get("userId") != null) { |
| | | userId = object.get("userId").toString(); |
| | | } |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("composing")), FlowCard.class); |
| | | for (FlowCard flowCard : flowCardList) { |
| | | //查询是否报工 |
| | | Integer count = flowCardMapper.reportingWorkCount(flowCard.getProcessId()); |
| | | if (count == 0) { |
| | | //修改分架状态 |
| | | flowCardMapper.updateDeleteState(flowCard.getOrderId(), flowCard.getProcessId()); |
| | | //删除报工流程明细表数据 |
| | | flowCardMapper.deleteReportingWork(flowCard.getProcessId()); |
| | | //删除分架明细 |
| | | flowCardMapper.deleteFlowCardMp(flowCard.getOrderId(), flowCard.getProcessId()); |
| | | //删除排序表数据 |
| | | flowCardMapper.deleteflowCardSort(flowCard.getOrderId(), flowCard.getProcessId()); |
| | | //判断该订单流程卡是否全部删除 |
| | | Integer flowNumber = flowCardMapper.selectFlowCardCount(flowCard.getOrderId()); |
| | | if (flowNumber == 0) { |
| | | //修改订单表分架状态为0,全部删除 |
| | | flowCardMapper.updateProcessingCard(flowCard.getOrderId(), 0); |
| | | } else { |
| | | //修改订单表分架状态为1,删除部分 |
| | | flowCardMapper.updateProcessingCard(flowCard.getOrderId(), 1); |
| | | } |
| | | |
| | | //保存日志 |
| | | Log log = new Log(); |
| | | log.setContent(flowCard.getOrderId()+flowCard.getProcessId()); |
| | | log.setFunction("checkboxDeleteSv流程卡删除"); |
| | | log.setOperatorId(userId); |
| | | log.setOperator(userName); |
| | | logService.saveLog(log); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | return true; |
| | | |
| | | |
| | | } |
| | | |
| | | public Map<String, Object> getPrintProjectDetails(String projectNo) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.getPrintProjectDetailsMp(projectNo)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getPrintCustomDataProjectNoDetailSv(String type, Integer detailType, Map<String, Object> object) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | Set<String> processedProcessIds = new HashSet<>(); // 用来存放已处理过的 processId |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | //是否是工程明细打印 |
| | | if (detailType==0){//工程打印明细 |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataProjectDetail(flowCard.getProjectNo(),flowCard.getStockId())); |
| | | |
| | | } |
| | | //非工程打印 |
| | | else if (detailType==1) { |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataProject(flowCard.getProjectNo())); |
| | | |
| | | } |
| | | else { |
| | | itemmap.put("data", flowCardMapper.getPrintCustomDataProject(flowCard.getProjectNo())); |
| | | |
| | | } |
| | | list.add(itemmap); |
| | | } |
| | | } |
| | | map.put("data", list); |
| | | map.put("title", flowCardMapper.getPrintTitle(type)); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean updateProcessSv(String processId, String technologyNumber, String orderId, String Orderprocess, Map<String, Object> object) { |
| | | |
| | | //判断该流程卡是否报工 |
| | | Integer count = flowCardMapper.reportingWorkCount(processId); |
| | | if (count == 0) { |
| | | //删除小片工艺表对应的数据 |
| | | flowCardMapper.deleteProcessMp(processId,technologyNumber); |
| | | //重新插入修改好工艺流程卡的数据 |
| | | List<String> newCraftList = (List<String>) object.get("newCraft"); |
| | | List<String> numberList = (List<String>) object.get("technologyNumber"); |
| | | // 判断 newCraftList 是否为空 |
| | | if (newCraftList != null) { |
| | | for (String number : numberList) { |
| | | //修改订单小片表工艺流程 |
| | | flowCardMapper.updateOrderProcessMp(orderId,number,technologyNumber,Orderprocess); |
| | | for (String process : newCraftList) { |
| | | flowCardMapper.updateProcessMp(processId,technologyNumber,process,number); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | }else { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | public Integer updateProjectLabelPrintCount(String projectNo) { |
| | | flowCardMapper.updateProjectLabelPrintCount(projectNo); |
| | | return flowCardMapper.selectProjectLabelPrintCount(projectNo); |
| | | } |
| | | |
| | | public Integer updateProjectProcessPrintCount(String projectNo) { |
| | | flowCardMapper.updateProjectProcessPrintCount(projectNo); |
| | | return flowCardMapper.selectProjectProcessPrintCount(projectNo); |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> flowCardDetail(Map<String, Object> object) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();//最终结果 |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Map<String, Object> itemmap = new HashMap<>(); |
| | | itemmap.put("detail", flowCardMapper.getFlowCardDetail(flowCard.getProcessId())); |
| | | list.add(itemmap); |
| | | |
| | | } |
| | | } |
| | | |
| | | map.put("data", list); |
| | | return map; |
| | | } |
| | | |
| | | public Object processCardAutoRack(Map<String, Object> object) { |
| | | String orderId = "NG25000004"; |
| | | String productionId = "NG25000004B"; |
| | | /*String orderId = object.get("orderId").toString(); |
| | | String productionId = object.get("productionId").toString(); |
| | | Integer inMaxQuantity = Integer.parseInt(object.get("inMaxQuantity").toString()); |
| | | Float inWeight = Float.parseFloat(object.get("inWeight").toString()); |
| | | Float shelfThickness = Float.parseFloat(object.get("shelfThickness").toString())*1000; |
| | | Float spacerThickness = Float.parseFloat(object.get("spacerThickness").toString()); |
| | | */ |
| | | Integer inMaxQuantity = 30; |
| | | Float inWeight = 100.0f; |
| | | Float shelfThickness = 2000.0f; |
| | | /*垫片厚度*/ |
| | | Float spacerThickness = 0.0f; |
| | | Map<String,Object> thickness = flowCardMapper.getGlassThicknessByProdutionId(orderId,productionId); |
| | | |
| | | Float glassTotalThickness = Float.parseFloat(thickness.get("totalThickness").toString()) ; |
| | | Float glassThickness = Float.parseFloat(thickness.get("thickness").toString()); |
| | | |
| | | //获取此工程号订单明细信息 |
| | | List<OrderDetail> orderDetails = flowCardMapper.getOrderDetailByProductionId(orderId,productionId); |
| | | |
| | | //根据玻璃厚度和垫片厚度当前架子最大可放数量 |
| | | Integer shelfMaxQuantityByThickness = (int) (shelfThickness / (glassTotalThickness+spacerThickness)); |
| | | |
| | | //用于接收最终生成的流程卡 |
| | | List<FlowCard> flowCardList = new ArrayList<>(); |
| | | |
| | | //流程卡自增符号 |
| | | int flowCardNo = 1; |
| | | // 当前架子剩余可放数量 |
| | | Integer shelfQuantity = 0; |
| | | for(OrderDetail orderDetail : orderDetails){ |
| | | //架子根据尺寸重量最大能放多少 |
| | | int shelfQuantityByWeight = (int) (inWeight/ |
| | | (orderDetail.getHeight() |
| | | *orderDetail.getWidth() |
| | | *glassThickness |
| | | *2.5/1000000) |
| | | ); |
| | | System.out.println(shelfQuantityByWeight); |
| | | //当前订单明细剩余数量 |
| | | if(shelfQuantity==0){ |
| | | shelfQuantity = shelfQuantityByWeight; |
| | | } |
| | | //取最小值 |
| | | Integer maxQuantity = 0; |
| | | while (orderDetail.getQuantity() > 0 ) { |
| | | FlowCard flowCard = new FlowCard(); |
| | | //当死循环中,当前架子剩余数量为0时,重新计算架子剩余数量 |
| | | if(shelfQuantity==0){ |
| | | shelfQuantity = shelfQuantityByWeight; |
| | | System.out.println("flowCardNo:"+flowCardNo); |
| | | } |
| | | String processId = productionId+String.format("%05d",flowCardNo); |
| | | //取最小值 |
| | | maxQuantity = Math.min(shelfQuantity, Math.min(inMaxQuantity, shelfMaxQuantityByThickness)); |
| | | System.out.println(shelfQuantity+","+inMaxQuantity+","+shelfMaxQuantityByThickness); |
| | | System.out.println(flowCardNo+","+maxQuantity); |
| | | System.out.println("------"); |
| | | |
| | | if (orderDetail.getQuantity() > maxQuantity){ |
| | | flowCard.setProcessId(processId); |
| | | flowCard.setQuantity(maxQuantity); |
| | | flowCardList.add(flowCard); |
| | | orderDetail.setQuantity(orderDetail.getQuantity()-maxQuantity); |
| | | flowCardNo+=1; |
| | | }else{ |
| | | flowCard.setProcessId(processId); |
| | | flowCard.setQuantity(Math.toIntExact(orderDetail.getQuantity())); |
| | | flowCardList.add(flowCard); |
| | | //当前架子剩余数量 |
| | | shelfQuantity= shelfQuantity-Math.toIntExact(orderDetail.getQuantity()); |
| | | if(shelfQuantity==0){ |
| | | flowCardNo+=1; |
| | | } |
| | | orderDetail.setQuantity(0L); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | return flowCardList; |
| | | } |
| | | |
| | | |
| | | |
| | | public Object processCardAutoRack1(Map<String, Object> object) { |
| | | String orderId = "NG25000004"; |
| | | String productionId = "NG25000004B"; |
| | | /*String orderId = object.get("orderId").toString(); |
| | | String productionId = object.get("productionId").toString(); |
| | | Integer inMaxQuantity = Integer.parseInt(object.get("inMaxQuantity").toString()); |
| | | Float inWeight = Float.parseFloat(object.get("inWeight").toString()); |
| | | Float shelfThickness = Float.parseFloat(object.get("shelfThickness").toString())*1000; |
| | | Float spacerThickness = Float.parseFloat(object.get("spacerThickness").toString()); |
| | | */ |
| | | Integer inMaxQuantity = 30; |
| | | Float inWeight = 100.0f; |
| | | Float shelfThickness = 2000.0f; |
| | | /*垫片厚度*/ |
| | | Float spacerThickness = 0.0f; |
| | | Map<String,Object> thickness = flowCardMapper.getGlassThicknessByProdutionId(orderId,productionId); |
| | | |
| | | Float glassTotalThickness = Float.parseFloat(thickness.get("totalThickness").toString()) ; |
| | | Float glassThickness = Float.parseFloat(thickness.get("thickness").toString()); |
| | | |
| | | //获取此工程号订单明细信息 |
| | | List<OrderDetail> orderDetails = flowCardMapper.getOrderDetailByProductionId(orderId,productionId); |
| | | Integer flowCardQuantity = 0; |
| | | for(OrderDetail orderDetail:orderDetails){ |
| | | flowCardQuantity+=Math.toIntExact(orderDetail.getQuantity()); |
| | | } |
| | | |
| | | |
| | | //根据玻璃厚度和垫片厚度当前架子最大可放数量 |
| | | Integer shelfMaxQuantityByThickness = (int) (shelfThickness / (glassTotalThickness+spacerThickness)); |
| | | |
| | | //用于接收最终生成的流程卡 |
| | | List<FlowCard> flowCardList = new ArrayList<>(); |
| | | |
| | | //流程卡自增符号 |
| | | int flowCardNo = 1; |
| | | // 当前架子剩余可放数量 |
| | | Integer shelfQuantity = 0; |
| | | |
| | | while(flowCardQuantity>0){ |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | return flowCardList; |
| | | } |
| | | } |
| | | |
| | | |