| | |
| | | import com.ruoyi.common.utils.HackLoopTableRenderPolicy; |
| | | import com.ruoyi.common.utils.MatrixToImageWriter; |
| | | import com.ruoyi.production.dto.ProductWorkOrderDto; |
| | | import com.ruoyi.production.mapper.ProductProcessRouteItemMapper; |
| | | import com.ruoyi.production.mapper.ProductWorkOrderFileMapper; |
| | | import com.ruoyi.production.mapper.ProductWorkOrderMapper; |
| | | import com.ruoyi.production.mapper.ProductionProductMainMapper; |
| | | import com.ruoyi.production.pojo.ProductProcessRouteItem; |
| | | import com.ruoyi.production.pojo.ProductWorkOrder; |
| | | import com.ruoyi.production.pojo.ProductWorkOrderFile; |
| | | import com.ruoyi.production.pojo.ProductionProductMain; |
| | | import com.ruoyi.production.service.ProductWorkOrderService; |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | private ProductWorkOrderMapper productWorkOrdermapper; |
| | | @Autowired |
| | | private ProductWorkOrderFileMapper productWorkOrderFileMapper; |
| | | @Autowired |
| | | private ProductProcessRouteItemMapper productProcessRouteItemMapper; |
| | | @Autowired |
| | | private ProductionProductMainMapper productionProductMainMapper; |
| | | |
| | | @Value("${file.temp-dir}") |
| | | private String tempDir; |
| | | |
| | | @Override |
| | | public IPage<ProductWorkOrderDto> listPage(Page<ProductWorkOrderDto> page, ProductWorkOrderDto productWorkOrder) { |
| | | return productWorkOrdermapper.pageProductWorkOrder(page, productWorkOrder); |
| | | IPage<ProductWorkOrderDto> productWorkOrderDtoIPage = productWorkOrdermapper.pageProductWorkOrder(page, productWorkOrder); |
| | | productWorkOrderDtoIPage.getRecords().forEach(record -> { |
| | | //检查上一个工序是否已报工 |
| | | Integer currentDragSort = record.getDragSort(); |
| | | if (currentDragSort == null || currentDragSort == 1) { |
| | | record.setIsCanReport(true); |
| | | } else { |
| | | //查找上一个工序 |
| | | ProductProcessRouteItem previousItem = productProcessRouteItemMapper.selectOne( |
| | | Wrappers.<ProductProcessRouteItem>lambdaQuery() |
| | | .eq(ProductProcessRouteItem::getProductRouteId, record.getProductRouteId()) |
| | | .eq(ProductProcessRouteItem::getDragSort, currentDragSort - 1) |
| | | ); |
| | | |
| | | if (previousItem != null) { |
| | | //检查上一个工序是否有报工记录 |
| | | Long count = productionProductMainMapper.selectCount( |
| | | Wrappers.<ProductionProductMain>lambdaQuery() |
| | | .eq(ProductionProductMain::getProductProcessRouteItemId, previousItem.getId()) |
| | | ); |
| | | record.setIsCanReport(count > 0); |
| | | } else { |
| | | record.setIsCanReport(true); |
| | | } |
| | | } |
| | | }); |
| | | return productWorkOrderDtoIPage; |
| | | } |
| | | |
| | | @Override |