Commit e5ec3eb5 authored by 赵啸非's avatar 赵啸非

添加站点更新日志

parent 9509e587
...@@ -57,12 +57,6 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -57,12 +57,6 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
private MattersDeptService mattersDeptService; private MattersDeptService mattersDeptService;
@Autowired @Autowired
private WindowService windowService; private WindowService windowService;
@Autowired
private BusinessService businessService;
@Autowired
private SiteBusinessService siteBusinessService;
@Autowired
private WindowBusinessService windowBusinessService;
@Override @Override
...@@ -70,6 +64,20 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -70,6 +64,20 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
return data.getDeptNumber(); return data.getDeptNumber();
} }
/**
* @param entity
* @param context
* @throws AppException
*/
@Override
protected void saveBefore(DeptEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
//新增校验部门编码是否重复
DeptEntity extCache = this.getExtCache(entity.getDeptNumber());
if (!ObjectUtils.isEmpty(extCache)) {
throw new AppException("部门编码重复!deptCode:" + extCache.getDeptNumber());
}
}
/** /**
* @param entity * @param entity
...@@ -77,14 +85,16 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE ...@@ -77,14 +85,16 @@ public class DeptServiceImpl extends AbstractCRUDCacheServiceImpl<DeptDao, DeptE
* @throws AppException * @throws AppException
*/ */
@Override @Override
protected void validData(DeptEntity entity, Context context) throws AppException { protected void updateBefore(DeptEntity entity, Context context) throws AppException {
super.validData(entity, context); super.updateBefore(entity, context);
//校验部门编码是否重复 DeptEntity beforeEntity = this.get(entity.getId(), context);
if(!beforeEntity.getDeptNumber().equals(entity.getDeptNumber())){
DeptEntity extCache = this.getExtCache(entity.getDeptNumber()); DeptEntity extCache = this.getExtCache(entity.getDeptNumber());
if (!ObjectUtils.isEmpty(extCache) && SourceEnum.自定义.getValue() == entity.getSource()) { if (!ObjectUtils.isEmpty(extCache)) {
throw new AppException("部门编码重复!deptCode:" + extCache.getDeptNumber()); throw new AppException("部门编码重复!deptCode:" + extCache.getDeptNumber());
} }
} }
}
@Override @Override
public void syncDept(String areaCode, Context context) { public void syncDept(String areaCode, Context 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