Commit 59c7f342 authored by 赵啸非's avatar 赵啸非

事项添加区域字段

parent 04992cdd
...@@ -352,7 +352,9 @@ public class DemoWebApiController { ...@@ -352,7 +352,9 @@ public class DemoWebApiController {
List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteQuery.getAreaCode()).source(SourceEnum.政务网.getValue())); List<MatterEntity> matterList = matterService.getDao().getMatterListByAreaCode(new MatterQuery().areaCode(siteQuery.getAreaCode()).source(SourceEnum.政务网.getValue()));
List<SiteMatterEntity> targetSiteMatterEntities = new ArrayList<>(); List<SiteMatterEntity> targetSiteMatterEntities = new ArrayList<>();
for (MatterEntity matterEntity : matterList) { for (MatterEntity matterEntity : matterList) {
DeptEntity deptEntity = deptService.getExtCache(matterEntity.getDeptCode()); DeptEntity deptEntity =deptService.selectOne(new DeptQuery().deptNumber(matterEntity.getDeptCode()));
//DeptEntity deptEntity = deptService.getExtCache(matterEntity.getDeptCode());
SiteMatterEntity siteMatterEntity = new SiteMatterEntity(); SiteMatterEntity siteMatterEntity = new SiteMatterEntity();
siteMatterEntity.initAttrValue(); siteMatterEntity.initAttrValue();
//SiteEntity siteEntity = siteService.get(siteId); //SiteEntity siteEntity = siteService.get(siteId);
......
...@@ -10,6 +10,7 @@ import com.mortals.framework.util.DataUtil; ...@@ -10,6 +10,7 @@ import com.mortals.framework.util.DataUtil;
import com.mortals.xhx.common.code.SourceEnum; import com.mortals.xhx.common.code.SourceEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.utils.SpringUtils; import com.mortals.xhx.utils.SpringUtils;
...@@ -201,7 +202,8 @@ public class MatterHtmlParseUtil { ...@@ -201,7 +202,8 @@ public class MatterHtmlParseUtil {
//todo 如果部门编码与初始编码不一致,切不在部门列表中,添加默认部门 //todo 如果部门编码与初始编码不一致,切不在部门列表中,添加默认部门
String sourceDeptCode = params.getOrDefault("deptCode", ""); String sourceDeptCode = params.getOrDefault("deptCode", "");
DeptService deptService = SpringUtils.getBean(DeptService.class); DeptService deptService = SpringUtils.getBean(DeptService.class);
DeptEntity cache = deptService.getCache(deptCode); // DeptEntity cache = deptService.getCache(deptCode);
DeptEntity cache =deptService.selectOne(new DeptQuery().deptNumber(deptCode));
if(ObjectUtils.isEmpty(cache)){ if(ObjectUtils.isEmpty(cache)){
//抓取事项的部门编码未找到 用初始的部门编码 //抓取事项的部门编码未找到 用初始的部门编码
deptCode=sourceDeptCode; deptCode=sourceDeptCode;
......
...@@ -68,7 +68,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -68,7 +68,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
@Override @Override
protected String getExtKey(DeptEntity data) { protected String getExtKey(DeptEntity data) {
return data.getDeptNumber(); return data.getDeptNumber()+"_"+data.getSiteId();
} }
/** /**
...@@ -79,8 +79,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -79,8 +79,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
@Override @Override
protected void saveBefore(DeptEntity entity, Context context) throws AppException { protected void saveBefore(DeptEntity entity, Context context) throws AppException {
super.saveBefore(entity, context); super.saveBefore(entity, context);
//新增校验部门编码是否重复 //新增校验部门编码与站点是否重复
DeptEntity extCache = this.getExtCache(entity.getDeptNumber()); DeptEntity extCache = this.getExtCache(entity.getDeptNumber()+"_"+entity.getSiteId());
if (!ObjectUtils.isEmpty(extCache)) { if (!ObjectUtils.isEmpty(extCache)) {
throw new AppException("部门编码重复!deptCode:" + extCache.getDeptNumber()); throw new AppException("部门编码重复!deptCode:" + extCache.getDeptNumber());
} }
...@@ -95,8 +95,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -95,8 +95,8 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
protected void updateBefore(DeptEntity entity, Context context) throws AppException { protected void updateBefore(DeptEntity entity, Context context) throws AppException {
super.updateBefore(entity, context); super.updateBefore(entity, context);
DeptEntity beforeEntity = this.get(entity.getId(), context); DeptEntity beforeEntity = this.get(entity.getId(), context);
if (!beforeEntity.getDeptNumber().equals(entity.getDeptNumber())) { if (!(beforeEntity.getDeptNumber()+"_"+beforeEntity.getSiteId()).equals(entity.getDeptNumber()+"_"+entity.getSiteId())) {
DeptEntity extCache = this.getExtCache(entity.getDeptNumber()); DeptEntity extCache = this.getExtCache(entity.getDeptNumber()+"_"+entity.getSiteId());
if (!ObjectUtils.isEmpty(extCache)) { if (!ObjectUtils.isEmpty(extCache)) {
throw new AppException("部门编码重复!deptCode:" + extCache.getDeptNumber()); throw new AppException("部门编码重复!deptCode:" + extCache.getDeptNumber());
} }
...@@ -142,7 +142,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -142,7 +142,7 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
for (Map.Entry<String, String> item : data.entrySet()) { for (Map.Entry<String, String> item : data.entrySet()) {
String deptCode = item.getKey(); String deptCode = item.getKey();
String deptName = item.getValue(); String deptName = item.getValue();
DeptEntity deptEntity = deptService.selectOne(new DeptQuery().deptNumber(deptCode)); DeptEntity deptEntity = deptService.selectOne(new DeptQuery().siteId(siteEntity.getId()).deptNumber(deptCode));
if (ObjectUtils.isEmpty(deptEntity)) { if (ObjectUtils.isEmpty(deptEntity)) {
deptEntity = new DeptEntity(); deptEntity = new DeptEntity();
deptEntity.initAttrValue(); deptEntity.initAttrValue();
......
...@@ -88,7 +88,9 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao, ...@@ -88,7 +88,9 @@ public class MatterExtServiceImpl extends AbstractCRUDServiceImpl<MatterExtDao,
//差集进行插入 //差集进行插入
if (!ObjectUtils.isEmpty(subList)) { if (!ObjectUtils.isEmpty(subList)) {
for (MatterEntity matterEntity : subList) { for (MatterEntity matterEntity : subList) {
DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode()); DeptEntity deptCache = deptService.selectOne(new DeptQuery().deptNumber(matterEntity.getDeptCode()));
// DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName()); matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName());
matterEntity.setCreateTime(new Date()); matterEntity.setCreateTime(new Date());
matterEntity.setMatterEdition("0"); matterEntity.setMatterEdition("0");
......
...@@ -32,6 +32,7 @@ import com.mortals.xhx.module.business.model.BusinessMatterEntity; ...@@ -32,6 +32,7 @@ import com.mortals.xhx.module.business.model.BusinessMatterEntity;
import com.mortals.xhx.module.business.model.BusinessMatterQuery; import com.mortals.xhx.module.business.model.BusinessMatterQuery;
import com.mortals.xhx.module.business.service.BusinessMatterService; import com.mortals.xhx.module.business.service.BusinessMatterService;
import com.mortals.xhx.module.dept.model.DeptEntity; import com.mortals.xhx.module.dept.model.DeptEntity;
import com.mortals.xhx.module.dept.model.DeptQuery;
import com.mortals.xhx.module.dept.service.DeptService; import com.mortals.xhx.module.dept.service.DeptService;
import com.mortals.xhx.module.matter.dao.MatterDao; import com.mortals.xhx.module.matter.dao.MatterDao;
import com.mortals.xhx.module.matter.model.*; import com.mortals.xhx.module.matter.model.*;
...@@ -133,7 +134,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -133,7 +134,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
if (!ObjectUtils.isEmpty(entity.getSiteId())) { if (!ObjectUtils.isEmpty(entity.getSiteId())) {
SiteEntity siteEntity = siteService.get(entity.getSiteId(), context); SiteEntity siteEntity = siteService.get(entity.getSiteId(), context);
entity.setAreaCode(siteEntity.getAreaCode()); entity.setAreaCode(siteEntity.getAreaCode());
DeptEntity extCache = deptService.getExtCache(entity.getDeptCode()); DeptEntity extCache = deptService.getExtCache(entity.getDeptCode()+"_"+entity.getSiteId());
entity.setDeptName(extCache == null ? "" : extCache.getName()); entity.setDeptName(extCache == null ? "" : extCache.getName());
} }
...@@ -188,7 +189,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -188,7 +189,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
if (!ObjectUtils.isEmpty(entity.getSiteId())) { if (!ObjectUtils.isEmpty(entity.getSiteId())) {
SiteEntity siteEntity = siteService.get(entity.getSiteId(), context); SiteEntity siteEntity = siteService.get(entity.getSiteId(), context);
entity.setAreaCode(siteEntity.getAreaCode()); entity.setAreaCode(siteEntity.getAreaCode());
DeptEntity extCache = deptService.getExtCache(entity.getDeptCode()); DeptEntity extCache = deptService.getExtCache(entity.getDeptCode()+"_"+entity.getSiteId());
entity.setDeptName(extCache == null ? "" : extCache.getName()); entity.setDeptName(extCache == null ? "" : extCache.getName());
} }
MatterEntity beforeMatterEntity = this.get(entity.getId(), context); MatterEntity beforeMatterEntity = this.get(entity.getId(), context);
...@@ -199,7 +200,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -199,7 +200,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
SiteMatterQuery condition = new SiteMatterQuery(); SiteMatterQuery condition = new SiteMatterQuery();
condition.setMatterId(entity.getId()); condition.setMatterId(entity.getId());
SiteMatterQuery siteMatterQuery = new SiteMatterQuery(); SiteMatterQuery siteMatterQuery = new SiteMatterQuery();
DeptEntity extCache = deptService.getExtCache(entity.getDeptCode()); DeptEntity extCache = deptService.getExtCache(entity.getDeptCode()+"_"+entity.getSiteId());
siteMatterQuery.setDeptId(extCache == null ? 0L : extCache.getId()); siteMatterQuery.setDeptId(extCache == null ? 0L : extCache.getId());
siteMatterQuery.setDeptCode(entity.getDeptCode()); siteMatterQuery.setDeptCode(entity.getDeptCode());
...@@ -334,7 +335,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -334,7 +335,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
@Override @Override
public Rest<SiteMatterEntity> switchMatterToSiteMatter(MatterEntity item, SiteEntity siteEntity, Context context) { public Rest<SiteMatterEntity> switchMatterToSiteMatter(MatterEntity item, SiteEntity siteEntity, Context context) {
try { try {
DeptEntity deptEntity = deptService.getExtCache(item.getDeptCode()); DeptEntity deptEntity = deptService.getExtCache(item.getDeptCode()+"_"+item.getSiteId());
SiteMatterEntity siteMatterEntity = new SiteMatterEntity(); SiteMatterEntity siteMatterEntity = new SiteMatterEntity();
siteMatterEntity.initAttrValue(); siteMatterEntity.initAttrValue();
//SiteEntity siteEntity = siteService.get(siteId); //SiteEntity siteEntity = siteService.get(siteId);
...@@ -1136,7 +1137,8 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -1136,7 +1137,8 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
// log.info("更新详细事项==>{},id===>{},localVersion===>{},newVersion==>{}", matterEntity.getMatterName(),matterEntity.getId(),matterEntity.getMatterEdition(), matterEditionRemote); // log.info("更新详细事项==>{},id===>{},localVersion===>{},newVersion==>{}", matterEntity.getMatterName(),matterEntity.getId(),matterEntity.getMatterEdition(), matterEditionRemote);
//更新部门信息 //更新部门信息
DeptEntity extCache = deptService.getExtCache(matterEntity.getDeptCode()); DeptEntity extCache =deptService.selectOne(new DeptQuery().deptNumber(matterEntity.getDeptCode()));
// DeptEntity extCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(extCache == null ? "" : extCache.getName()); matterEntity.setDeptName(extCache == null ? "" : extCache.getName());
//构建基础信息参数 //构建基础信息参数
savebaseInfo(matterEntity, baseInfoMap, baseInfoSetting); savebaseInfo(matterEntity, baseInfoMap, baseInfoSetting);
......
...@@ -785,7 +785,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE ...@@ -785,7 +785,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
//差集进行插入并更新详细数据 //差集进行插入并更新详细数据
if (!ObjectUtils.isEmpty(subList)) { if (!ObjectUtils.isEmpty(subList)) {
for (MatterEntity matterEntity : subList) { for (MatterEntity matterEntity : subList) {
DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode()); DeptEntity deptCache =deptService.selectOne(new DeptQuery().deptNumber(matterEntity.getDeptCode()));
// DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName()); matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName());
matterEntity.setCreateTime(new Date()); matterEntity.setCreateTime(new Date());
matterService.save(matterEntity, context); matterService.save(matterEntity, context);
......
...@@ -22,9 +22,11 @@ ...@@ -22,9 +22,11 @@
<property name="showSql" value="false" /> <property name="showSql" value="false" />
</plugin> </plugin>
<!--
<plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor"> <plugin interceptor="com.mortals.framework.thirty.dm.DmTransInterceptor">
<property name="showSql" value="false" /> <property name="showSql" value="false" />
</plugin> </plugin>
-->
</plugins> </plugins>
</configuration> </configuration>
\ No newline at end of file
...@@ -146,7 +146,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId ...@@ -146,7 +146,7 @@ POST {{baseUrl}}/site/syncGovMatterBySiteId
Content-Type: application/json Content-Type: application/json
{ {
"id":1 "id":73
} }
......
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