This commit is contained in:
2023-09-13 09:17:41 +08:00
parent dabc2ecbdd
commit e415d9c835
2 changed files with 14 additions and 3 deletions

View File

@@ -1,9 +1,10 @@
package cn.lihongjie.coal.base.mapper;
import cn.lihongjie.coal.dictionary.entity.DictionaryEntity;
import cn.lihongjie.coal.dictionary.entity.DictionaryItemEntity;
import cn.lihongjie.coal.base.dto.BaseDto;
import cn.lihongjie.coal.base.entity.BaseEntity;
import cn.lihongjie.coal.coalInfo.entity.CoalInfoEntity;
import cn.lihongjie.coal.dictionary.entity.DictionaryEntity;
import cn.lihongjie.coal.dictionary.entity.DictionaryItemEntity;
import cn.lihongjie.coal.organization.entity.OrganizationEntity;
import cn.lihongjie.coal.permission.entity.PermissionEntity;
import cn.lihongjie.coal.resource.entity.ResourceEntity;
@@ -141,7 +142,17 @@ public interface CommonMapper {
return e;
}
public default CoalInfoEntity createCoalInfo(String id) {
if (StringUtils.isEmpty(id)) {
return null;
}
CoalInfoEntity e = new CoalInfoEntity();
e.setId(id);
return e;
}
public default String toString(Object o) {

View File

@@ -57,7 +57,7 @@ public class CoalInfoService extends BaseService<CoalInfoEntity, CoalInfoReposit
public CoalInfoDto update(UpdateCoalInfoDto request) {
CoalInfoEntity entity = this.repository.get(request.getId());
Double old = request.getInitPrice();
Double old = entity.getInitPrice();
this.mapper.updateEntity(entity, request);
this.repository.save(entity);