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

添加站点更新日志

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