Commit 33c3a503 authored by 赵啸非's avatar 赵啸非

添加申报相关信息

parent 8f8a512d
...@@ -5,8 +5,14 @@ import cn.hutool.core.date.DateUtil; ...@@ -5,8 +5,14 @@ import cn.hutool.core.date.DateUtil;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.common.code.DeclareStatusEnum; import com.mortals.xhx.common.code.DeclareStatusEnum;
import com.mortals.xhx.module.category.model.CategoryEntity;
import com.mortals.xhx.module.category.service.CategoryService;
import com.mortals.xhx.module.company.model.CompanyEntity;
import com.mortals.xhx.module.company.service.CompanyService;
import com.mortals.xhx.module.declare.model.*; import com.mortals.xhx.module.declare.model.*;
import com.mortals.xhx.module.declare.service.DeclareFinImagesService; import com.mortals.xhx.module.declare.service.DeclareFinImagesService;
import com.mortals.xhx.module.park.model.ParkEntity;
import com.mortals.xhx.module.park.service.ParkService;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.util.Map; import java.util.Map;
...@@ -44,6 +50,12 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl ...@@ -44,6 +50,12 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
@Autowired @Autowired
private DeclareFinImagesService declareFinImagesService; private DeclareFinImagesService declareFinImagesService;
@Autowired
private CategoryService categoryService;
@Autowired
private ParkService parkService;
@Autowired
private CompanyService companyService;
@Override @Override
...@@ -74,6 +86,26 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl ...@@ -74,6 +86,26 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
} }
@Override
protected void saveBefore(DeclareEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getCategoryId())){
CategoryEntity categoryEntity = categoryService.get(entity.getCategoryId());
entity.setCategoryName(categoryEntity==null?"":categoryEntity.getCategoryName());
entity.setCategoryCode(categoryEntity==null?"":categoryEntity.getCategoryCode());
}
if(!ObjectUtils.isEmpty(entity.getParkId())){
ParkEntity parkEntity = parkService.get(entity.getParkId());
entity.setParkName(parkEntity==null?"":parkEntity.getName());
}
if(!ObjectUtils.isEmpty(entity.getCompanyId())){
CompanyEntity companyEntity = companyService.get(entity.getCompanyId());
entity.setCompanyName(companyEntity==null?"":companyEntity.getName());
}
super.saveBefore(entity, context);
}
@Override @Override
protected void saveAfter(DeclareEntity entity, Context context) throws AppException { protected void saveAfter(DeclareEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getDeclareImagesList())) { if (!ObjectUtils.isEmpty(entity.getDeclareImagesList())) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment