| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.pp.ProductionScheduling; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.mapper.pp.FlowCardMapper; |
| | | import com.example.erp.mapper.sd.OrderGlassDetailMapper; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.sql.Date; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | //修改分架状态 |
| | | flowCardMapper.updateDeleteState(orderId, processId); |
| | | //删除报工流程明细表数据 |
| | | flowCardMapper.deleteReportingWork(processId); |
| | | //删除分架明细 |
| | | flowCardMapper.deleteFlowCardMp(orderId, processId); |
| | | //判断该订单流程卡是否全部删除 |
| | |
| | | map.put("data", flowCardMapper.flowCardDetailMp(processId, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | | public Object selectPrintFlowCardSv(Date selectTime1, Date selectTime2, String orderId, String project, FlowCard flowCard) { |
| | | if ("null".equals(orderId)) { |
| | | orderId = ""; |
| | | } |
| | | if ("null".equals(project)) { |
| | | project = ""; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.selectPrintFlowCardMp(selectTime1, selectTime2, orderId, project, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | | public Object selectPrintSv(String orderId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.selectPrintMp(orderId, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> getSelectPrintingSv(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.getPrimaryList(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | //流程卡明细数据 |
| | | List<Map<String, Object>> detailList = flowCardMapper.getDetailList(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | //工艺流程 |
| | | List<Map<String, Object>> processList = flowCardMapper.getProcessList(flowCard.getProcessId(), flowCard.getTechnologyNumber()); |
| | | itemmap.put("detailList", detailList); |
| | | itemmap.put("processList", processList); |
| | | 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 Map<String, Object> getSelectPrintLabelSv(Map<String, Object> object) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<FlowCard> flowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("printList")), FlowCard.class); |
| | | if (!flowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : flowCardList) { |
| | | Integer count=flowCard.getQuantity(); |
| | | for (int i = 0; i < count; i++) { |
| | | map.put("data", flowCardMapper.getPrintLabel(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | //System.out.println(flowCardMapper.getPrintLabel(flowCard.getProcessId(), flowCard.getTechnologyNumber())); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | } |