| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | |
| | | @Service |
| | | @AllArgsConstructor |
| | | @Slf4j |
| | |
| | | |
| | | return processRouteMapper.pageProcessRouteDto(page, processRouteDto); |
| | | } |
| | | |
| | | @Override |
| | | public Integer saveProcessRoute(ProcessRoute processRoute) { |
| | | this.save(processRoute); |
| | | String dateStr = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd")); |
| | | String idStr = String.format("%06d", processRoute.getId()); |
| | | String newProductCode = "GY" + dateStr + idStr; |
| | | // 更新数据库中的productCode |
| | | processRoute.setProcessRouteCode(newProductCode); |
| | | return processRouteMapper.updateById(processRoute); |
| | | } |
| | | } |