| | |
| | | return map; |
| | | } |
| | | |
| | | //删除工单 |
| | | //删除流程卡 |
| | | public Boolean DeleteFlowCardSv(String orderId, String processId) { |
| | | if (!orderId.isEmpty() && !processId.isEmpty()) { |
| | | Integer count=flowCardMapper.ReportingWorkCount(processId); |
| | | if (count==0){ |
| | | Integer count = flowCardMapper.ReportingWorkCount(processId); |
| | | if (count == 0) { |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | flowCardMapper.UpdateProcessingCard(orderId, 1); |
| | | //修改分架状态 |
| | | flowCardMapper.UpdateDeleteState(orderId, processId); |
| | | //删除分架明细 |
| | | flowCardMapper.DeleteFlowCardMp(orderId, processId); |
| | | return true; |
| | | } |
| | | else { |
| | | } else { |
| | | return false; |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //保存流程卡数据 |
| | | public Boolean AddFlowCardSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | |
| | | List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class); |
| | | if (!FlowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : FlowCardList) { |
| | | //查询每个序号的层数 |
| | | Integer layer = flowCardMapper.SelectLayer(productionId, flowCard.getOrderNumber()); |
| | | //添加流程卡数据 |
| | | flowCardMapper.AddFlowCardMp(flowCard.getProcessId(),flowCard.getOrderNumber(),flowCard.getLandingSequence(),flowCard.getQuantity(),productionId,userName); |
| | | flowCardMapper.AddFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName,layer); |
| | | //修改分架状态,将状态改为1 |
| | | flowCardMapper.UpdateFlowState(productionId,flowCard.getOrderNumber()); |
| | | flowCardMapper.UpdateFlowState(productionId, flowCard.getOrderNumber()); |
| | | //查询该订单未分架数量 |
| | | Integer FlowCount= flowCardMapper.SelectFlowCount(productionId); |
| | | |
| | | if (FlowCount==0){ |
| | | //修改订单表分架状态为2 |
| | | System.out.println("我来试试1"); |
| | | flowCardMapper.UpdateProcessingCard(productionId,2); |
| | | } |
| | | else{ |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | System.out.println("我来试试2"); |
| | | flowCardMapper.UpdateProcessingCard(productionId,1); |
| | | } |
| | | Integer FlowCount = flowCardMapper.SelectFlowCount(productionId); |
| | | if (FlowCount == 0) { |
| | | //修改订单表分架状态为2 |
| | | flowCardMapper.UpdateProcessingCard(productionId, 2); |
| | | } else { |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | flowCardMapper.UpdateProcessingCard(productionId, 1); |
| | | } |
| | | } |
| | | return true; |
| | | return true; |
| | | } else { |
| | | return false; |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (state==2){//已排产 |
| | | map.put("data", flowCardMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard)); |
| | | |
| | | }else if (state==1){//未排产 |
| | | map.put("data", flowCardMapper.SelectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard)); |
| | | |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | //首次查询排版数据 |
| | | public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.selectLastSchedulingMp(selectTime1, selectTime2, flowCard)); |
| | | return map; |
| | | } |
| | | } |