Commit 927adf84 authored by 赵啸非's avatar 赵啸非

修改根据业务查询部门逻辑

parent febeb799
...@@ -118,7 +118,10 @@ public class DemoWebApiController { ...@@ -118,7 +118,10 @@ public class DemoWebApiController {
if (deptEntity.getId() != windowEntity.getDeptId()) { if (deptEntity.getId() != windowEntity.getDeptId()) {
log.info("部门:{},更新部门id:orgin deptId:{} ,updateDeptId:{}", deptName, windowEntity.getDeptId(), deptEntity.getId()); log.info("部门:{},更新部门id:orgin deptId:{} ,updateDeptId:{}", deptName, windowEntity.getDeptId(), deptEntity.getId());
windowEntity.setDeptId(deptEntity.getId()); windowEntity.setDeptId(deptEntity.getId());
windowService.update(windowEntity);
windowService.getDao().update(windowEntity);
// windowService.update(windowEntity);
} }
} }
} }
...@@ -130,7 +133,8 @@ public class DemoWebApiController { ...@@ -130,7 +133,8 @@ public class DemoWebApiController {
if (deptEntity.getId() != windowMatterEntity.getDeptId()) { if (deptEntity.getId() != windowMatterEntity.getDeptId()) {
windowMatterEntity.setDeptId(deptEntity.getId()); windowMatterEntity.setDeptId(deptEntity.getId());
windowMatterEntity.setDeptCode(deptEntity.getDeptNumber()); windowMatterEntity.setDeptCode(deptEntity.getDeptNumber());
windowMatterService.update(windowMatterEntity); windowMatterService.getDao().update(windowMatterEntity);
// windowMatterService.update(windowMatterEntity);
} }
} }
} }
...@@ -143,7 +147,9 @@ public class DemoWebApiController { ...@@ -143,7 +147,9 @@ public class DemoWebApiController {
if (deptEntity.getId() != siteMatterEntity.getDeptId()) { if (deptEntity.getId() != siteMatterEntity.getDeptId()) {
siteMatterEntity.setDeptId(deptEntity.getId()); siteMatterEntity.setDeptId(deptEntity.getId());
siteMatterEntity.setDeptCode(deptEntity.getDeptNumber()); siteMatterEntity.setDeptCode(deptEntity.getDeptNumber());
siteMatterService.update(siteMatterEntity); siteMatterService.getDao().update(siteMatterEntity);
//siteMatterService.update(siteMatterEntity);
} }
} }
} }
......
package com.mortals.xhx.module.site.service; package com.mortals.xhx.module.site.service;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.site.dao.SiteMatterDao;
import com.mortals.xhx.module.site.model.SiteMatterEntity; import com.mortals.xhx.module.site.model.SiteMatterEntity;
/** /**
* SiteMatterService * SiteMatterService
* * <p>
* 站点事项 service接口 * 站点事项 service接口
* *
* @author zxfei * @author zxfei
* @date 2022-01-12 * @date 2022-01-12
*/ */
public interface SiteMatterService extends ICRUDService<SiteMatterEntity,Long>{ public interface SiteMatterService extends ICRUDService<SiteMatterEntity, Long> {
void deleteBysiteIdAndSource(Long siteId,Integer source, Context context);
SiteMatterDao getDao();
void deleteBysiteIdAndSource(Long siteId, Integer source, Context context);
} }
\ No newline at end of file
...@@ -55,7 +55,7 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao ...@@ -55,7 +55,7 @@ public class SiteMatterServiceImpl extends AbstractCRUDServiceImpl<SiteMatterDao
protected void updateBefore(SiteMatterEntity entity, Context context) throws AppException { protected void updateBefore(SiteMatterEntity entity, Context context) throws AppException {
super.updateBefore(entity, context); super.updateBefore(entity, context);
SiteMatterEntity beforeSiteMatterEntity = this.get(entity.getId(), context); SiteMatterEntity beforeSiteMatterEntity = this.get(entity.getId(), context);
if (!beforeSiteMatterEntity.getDeptId().equals(entity.getDeptId())) { if (!ObjectUtils.isEmpty(beforeSiteMatterEntity.getDeptId())&&!beforeSiteMatterEntity.getDeptId().equals(entity.getDeptId())) {
//更新事项中的部门编号 //更新事项中的部门编号
MatterEntity matterEntity = matterService.get(entity.getMatterId(), context); MatterEntity matterEntity = matterService.get(entity.getMatterId(), context);
if (!ObjectUtils.isEmpty(matterEntity)) { if (!ObjectUtils.isEmpty(matterEntity)) {
......
package com.mortals.xhx.module.window.service; package com.mortals.xhx.module.window.service;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.window.dao.WindowMatterDao;
import com.mortals.xhx.module.window.model.WindowMatterEntity; import com.mortals.xhx.module.window.model.WindowMatterEntity;
/** /**
* WindowMatterService * WindowMatterService
* * <p>
* 窗口事项 service接口 * 窗口事项 service接口
* *
* @author zxfei * @author zxfei
* @date 2022-01-12 * @date 2022-01-12
*/ */
public interface WindowMatterService extends ICRUDService<WindowMatterEntity,Long>{ public interface WindowMatterService extends ICRUDService<WindowMatterEntity, Long> {
WindowMatterDao getDao();
} }
\ No newline at end of file
package com.mortals.xhx.module.window.service; package com.mortals.xhx.module.window.service;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.window.dao.WindowDao;
import com.mortals.xhx.module.window.model.WindowEntity; import com.mortals.xhx.module.window.model.WindowEntity;
/** /**
* WindowService * WindowService
* * <p>
* 站点部门窗口 service接口 * 站点部门窗口 service接口
* *
* @author zxfei * @author zxfei
* @date 2022-01-12 * @date 2022-01-12
*/ */
public interface WindowService extends ICRUDCacheService<WindowEntity,Long> { public interface WindowService extends ICRUDCacheService<WindowEntity, Long> {
WindowDao getDao();
/** /**
* 添加业务到窗口 * 添加业务到窗口
*
* @param businessIds * @param businessIds
* @param windowId * @param windowId
* @param context * @param context
...@@ -23,5 +29,4 @@ public interface WindowService extends ICRUDCacheService<WindowEntity,Long> { ...@@ -23,5 +29,4 @@ public interface WindowService extends ICRUDCacheService<WindowEntity,Long> {
void addBusinessToWindow(String businessIds, Long windowId, Context context); void addBusinessToWindow(String businessIds, Long windowId, Context context);
} }
\ No newline at end of file
...@@ -108,7 +108,7 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte ...@@ -108,7 +108,7 @@ public class WindowMatterServiceImpl extends AbstractCRUDServiceImpl<WindowMatte
protected void updateBefore(WindowMatterEntity entity, Context context) throws AppException { protected void updateBefore(WindowMatterEntity entity, Context context) throws AppException {
super.updateBefore(entity, context); super.updateBefore(entity, context);
WindowMatterEntity beforeWindowMatterEntity = this.get(entity.getId(), context); WindowMatterEntity beforeWindowMatterEntity = this.get(entity.getId(), context);
if(!beforeWindowMatterEntity.getDeptCode().equals(entity.getDeptCode())){ if(!ObjectUtils.isEmpty(beforeWindowMatterEntity.getDeptCode())&&!beforeWindowMatterEntity.getDeptCode().equals(entity.getDeptCode())){
//更新 //更新
MatterEntity matterEntity = matterService.get(entity.getSiteMatterId()); MatterEntity matterEntity = matterService.get(entity.getSiteMatterId());
if(!ObjectUtils.isEmpty(matterEntity)){ if(!ObjectUtils.isEmpty(matterEntity)){
......
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