| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.dto.pp.*; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.Report; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | |
| | | import com.example.erp.mapper.pp.FlowCardMapper; |
| | | import com.example.erp.mapper.pp.ProductionSchedulingMapper; |
| | | import com.example.erp.mapper.pp.ReportMapper; |
| | | import com.example.erp.mapper.pp.ReportingWorkMapper; |
| | | import com.example.erp.mapper.sd.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.sql.Date; |
| | | import java.time.LocalDate; |
| | | import java.util.*; |
| | | import java.util.concurrent.Executor; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private final OrderDetailMapper orderDetailMapper; |
| | | |
| | | FlowCardMapper flowCardMapper; |
| | | private ReportingWorkMapper reportingWorkMapper; |
| | | |
| | | |
| | | //上工序报工班组 |
| | |
| | | .eq("order_number", dto1.getOrderNumber()) |
| | | .eq("technology_number",dto1.getTechnologyNumber()) |
| | | ); |
| | | System.out.println(orderGlassDetailGroup.getGroup()); |
| | | |
| | | String glassName = productDetailMapper.getGlassNameByGroup( |
| | | orderDetail.getProductId(), |
| | |
| | | } |
| | | |
| | | |
| | | public ReportService(ReportMapper reportMapper, OrderProcessDetailMapper orderProcessDetailMapper, ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper, OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper, ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper) { |
| | | public ReportService(ReportMapper reportMapper, OrderProcessDetailMapper orderProcessDetailMapper, |
| | | ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper, |
| | | OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper, |
| | | ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper, |
| | | ReportingWorkMapper reportingWorkMapper) { |
| | | this.reportMapper = reportMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | this.productionSchedulingMapper = productionSchedulingMapper; |
| | |
| | | this.basicDataMapper = basicDataMapper; |
| | | this.productDetailMapper = productDetailMapper; |
| | | this.orderDetailMapper = orderDetailMapper; |
| | | this.reportingWorkMapper = reportingWorkMapper; |
| | | } |
| | | |
| | | //流程卡进度方法 |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> selectDamageReportSv(Integer pageNum, Integer pageSize, Date selectTime1, Date selectTime2, DamageReportDTO damageReportDTO) { |
| | | public Map<String, Object> selectDamageReportSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, DamageReportDTO damageReportDTO) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportMapper.selectDamageReportMp(offset, pageSize, selectTime1, selectTime2, damageReportDTO)); |
| | |
| | | return reportMapper.exportYieldMp(date,process); |
| | | } |
| | | |
| | | public Map<String, Object> teamOutputSv(Integer pageNum, Integer pageSize, Date selectTime1, Date selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO) { |
| | | public Map<String, Object> teamOutputSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String selectProcesses, TeamOutputDTO teamOutputDTO) { |
| | | if (selectProcesses.equals("全部")){ |
| | | selectProcesses=""; |
| | | } |
| | |
| | | String laminating = reportMapper.getLaminating(process); |
| | | return reportMapper.exportTeamOutputMp(date,process,laminating); |
| | | } |
| | | |
| | | public Map<String, Object> workInProgressCombinationSv(Integer pageNum, Integer pageSize,String orderId, String inputProject, String selectProcesses, String optionVal, WorkInProgressDTO workInProgressDTO) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | if ("null".equals(orderId)) { |
| | | orderId = ""; |
| | | } |
| | | if ("null".equals(inputProject)) { |
| | | inputProject = ""; |
| | | } |
| | | if ("null".equals(optionVal)) { |
| | | optionVal = (""); |
| | | } |
| | | if (selectProcesses.equals("全部")){ |
| | | selectProcesses=""; |
| | | } |
| | | String laminating = ""; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // 获取所有工序 |
| | | List<String> processList = reportMapper.selectProcess(); |
| | | // 遍历每个工序并调用新方法 |
| | | List<Map<String, Object>> resultList = new ArrayList<>(); |
| | | if (selectProcesses!=""){ |
| | | laminating = reportingWorkMapper.getProcessLaminating(selectProcesses); |
| | | List<Map<String, Object>> singleResult = reportMapper.getWorkInProgressCombination(selectProcesses,laminating,optionVal); |
| | | |
| | | resultList.addAll(singleResult); |
| | | }else { |
| | | for (String process : processList) { |
| | | //获取报工工序是否为复合工程 |
| | | laminating = reportingWorkMapper.getProcessLaminating(process); |
| | | List<Map<String, Object>> singleResult = reportMapper.getWorkInProgressCombination(process,laminating,optionVal); |
| | | |
| | | if (singleResult != null && !singleResult.isEmpty()) { |
| | | resultList.addAll(singleResult); |
| | | } |
| | | } |
| | | } |
| | | |
| | | map.put("data",resultList); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | return map; |
| | | } |
| | | } |