This commit is contained in:
2024-10-02 12:21:07 +08:00
parent 7cf789d208
commit e7369de7f6

View File

@@ -16,6 +16,7 @@ import cn.lihongjie.coal.common.FreeMakerUtils;
import cn.lihongjie.coal.common.JpaUtils;
import cn.lihongjie.coal.exception.BizException;
import cn.lihongjie.coal.product.service.ProductService;
import com.google.common.base.CaseFormat;
import jakarta.annotation.PostConstruct;
@@ -63,7 +64,7 @@ public class CoalWashingDailyAnalysisService
validate(entity);
if (entity.getProduct()!=null){
entity.setName(entity.getProduct().getName());
entity.setName(productService.get(entity.getProduct().getId()).getName());
}
this.repository.save(entity);
@@ -93,6 +94,9 @@ public class CoalWashingDailyAnalysisService
return mapper.toDto(roundMapper.round(entity));
}
@Autowired
ProductService productService;
public CoalWashingDailyAnalysisDto update(UpdateCoalWashingDailyAnalysisDto request) {
@@ -108,7 +112,8 @@ public class CoalWashingDailyAnalysisService
validate(entity);
if (entity.getProduct()!=null){
entity.setName(entity.getProduct().getName());
entity.setName(productService.get(entity.getProduct().getId()).getName());
}
this.repository.save(entity);