mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 23:57:12 +08:00
bugfix
This commit is contained in:
@@ -16,6 +16,7 @@ import cn.lihongjie.coal.common.FreeMakerUtils;
|
|||||||
import cn.lihongjie.coal.common.JpaUtils;
|
import cn.lihongjie.coal.common.JpaUtils;
|
||||||
import cn.lihongjie.coal.exception.BizException;
|
import cn.lihongjie.coal.exception.BizException;
|
||||||
|
|
||||||
|
import cn.lihongjie.coal.product.service.ProductService;
|
||||||
import com.google.common.base.CaseFormat;
|
import com.google.common.base.CaseFormat;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
@@ -63,7 +64,7 @@ public class CoalWashingDailyAnalysisService
|
|||||||
validate(entity);
|
validate(entity);
|
||||||
|
|
||||||
if (entity.getProduct()!=null){
|
if (entity.getProduct()!=null){
|
||||||
entity.setName(entity.getProduct().getName());
|
entity.setName(productService.get(entity.getProduct().getId()).getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
this.repository.save(entity);
|
this.repository.save(entity);
|
||||||
@@ -93,6 +94,9 @@ public class CoalWashingDailyAnalysisService
|
|||||||
return mapper.toDto(roundMapper.round(entity));
|
return mapper.toDto(roundMapper.round(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
ProductService productService;
|
||||||
|
|
||||||
public CoalWashingDailyAnalysisDto update(UpdateCoalWashingDailyAnalysisDto request) {
|
public CoalWashingDailyAnalysisDto update(UpdateCoalWashingDailyAnalysisDto request) {
|
||||||
|
|
||||||
|
|
||||||
@@ -108,7 +112,8 @@ public class CoalWashingDailyAnalysisService
|
|||||||
|
|
||||||
validate(entity);
|
validate(entity);
|
||||||
if (entity.getProduct()!=null){
|
if (entity.getProduct()!=null){
|
||||||
entity.setName(entity.getProduct().getName());
|
|
||||||
|
entity.setName(productService.get(entity.getProduct().getId()).getName());
|
||||||
}
|
}
|
||||||
this.repository.save(entity);
|
this.repository.save(entity);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user