| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.deepoove.poi.XWPFTemplate; |
| | | import com.deepoove.poi.config.Configure; |
| | | import com.deepoove.poi.data.PictureRenderData; |
| | | import com.deepoove.poi.data.Pictures; |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | 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 |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<ProductWorkOrderDto> getByProductOrderId(Long productOrderId) { |
| | | return productWorkOrdermapper.getByProductOrderId(productOrderId); |
| | | } |
| | | |
| | | } |