Commit 89acb2fd authored by 赵啸非's avatar 赵啸非

更新申报次数

parent a014102c
......@@ -8,6 +8,7 @@ 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.model.CompanyQuery;
import com.mortals.xhx.module.company.service.CompanyService;
import com.mortals.xhx.module.declare.model.*;
import com.mortals.xhx.module.declare.service.DeclareFinImagesService;
......@@ -137,9 +138,20 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
}).count();
declareFinImagesService.save(entity.getDeclareFinImagesList());
}
//更新帮办数量
updateCompanyCount(entity, context);
super.saveAfter(entity, context);
}
private void updateCompanyCount(DeclareEntity entity, Context context) {
if (!ObjectUtils.isEmpty(entity.getCompanyId())) {
int count = this.count(new DeclareQuery().companyId(entity.getCompanyId()), context);
companyService.update(new CompanyQuery().id(entity.getId()).declarationCount(count), context);
}
}
@Override
protected void updateAfter(DeclareEntity entity, Context context) throws AppException {
if (!ObjectUtils.isEmpty(entity.getDeclareImagesList())) {
......@@ -167,6 +179,7 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
}).count();
declareFinImagesService.save(entity.getDeclareFinImagesList());
}
updateCompanyCount(entity, context);
super.updateAfter(entity, context);
}
......
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