| | |
| | | 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.exception.ServiceException; |
| | | import com.ruoyi.common.utils.MatrixToImageWriter; |
| | | import com.ruoyi.production.dto.ProductWorkOrderDto; |
| | | import com.ruoyi.production.mapper.ProductWorkOrderFileMapper; |
| | |
| | | import com.ruoyi.production.pojo.ProductWorkOrder; |
| | | import com.ruoyi.production.pojo.ProductWorkOrderFile; |
| | | import com.ruoyi.production.service.ProductWorkOrderService; |
| | | import com.ruoyi.quality.pojo.QualityInspectParam; |
| | | import lombok.AllArgsConstructor; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | @Value("${file.temp-dir}") |
| | | private String tempDir; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public IPage<ProductWorkOrderDto> listPage(Page<ProductWorkOrderDto> page, ProductWorkOrderDto productWorkOrder) { |
| | | return productWorkOrdermapper.pageProductWorkOrder(page, productWorkOrder); |
| | | } |
| | | |
| | | @Override |
| | | public int updateProductWorkOrder(ProductWorkOrderDto productWorkOrderDto) { |
| | | return productWorkOrdermapper.updateById(productWorkOrderDto); |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateProductWorkOrder(ProductWorkOrderDto dto) { |
| | | if (dto == null) { |
| | | throw new ServiceException("指派失败,数据不能为空"); |
| | | } |
| | | if (dto.getWorkerId() == null) { |
| | | throw new ServiceException("指派失败,指派工人不能为空"); |
| | | } |
| | | SysUser worker = sysUserMapper.selectUserById(dto.getWorkerId()); |
| | | if (worker == null) { |
| | | throw new ServiceException("指派失败,指派工人不存在"); |
| | | } |
| | | |
| | | if (dto.getHandoverUserId() != null) { |
| | | if (dto.getWorkerId().equals(dto.getHandoverUserId())) { |
| | | throw new ServiceException("交接失败,交接人不能与指派工人相同"); |
| | | } |
| | | SysUser handoverUser = sysUserMapper.selectUserById(dto.getHandoverUserId()); |
| | | if (handoverUser == null) { |
| | | throw new ServiceException("交接失败,交接人员不存在"); |
| | | } |
| | | dto.setHandoverUserName(handoverUser.getNickName()); |
| | | } |
| | | dto.setWorkerName(worker.getNickName()); |
| | | |
| | | return productWorkOrdermapper.updateById(dto); |
| | | } |
| | | @Override |
| | | public void down(HttpServletResponse response, ProductWorkOrder productWorkOrder) { |
| | | ProductWorkOrderDto productWorkOrderDto = productWorkOrdermapper.getProductWorkOrderFlowCard(productWorkOrder.getId()); |