Commit b61e7278 authored by 姬鋆屾's avatar 姬鋆屾
parents c1e0aa20 4fe7e741
...@@ -168,7 +168,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -168,7 +168,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
} }
WindowOwnerEntity windowOwnerEntity = this.selectOne(new WindowOwnerQuery().staffId(entity.getStaffId())); WindowOwnerEntity windowOwnerEntity = this.selectOne(new WindowOwnerQuery().staffId(entity.getStaffId()));
if(ObjectUtils.isEmpty(windowOwnerEntity)){ if(!ObjectUtils.isEmpty(windowOwnerEntity)){
throw new AppException("已经存在该负责人窗口记录!"); throw new AppException("已经存在该负责人窗口记录!");
} }
} }
...@@ -246,8 +246,11 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -246,8 +246,11 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
protected void removeBefore(Long[] ids, Context context) throws AppException { protected void removeBefore(Long[] ids, Context context) throws AppException {
super.removeBefore(ids, context); super.removeBefore(ids, context);
//删除窗口人员 //删除窗口人员
List<WindowOwnerEntity> windowOwnerEntities = this.get(ids, context); WindowOwnerQuery windowOwnerQuery = new WindowOwnerQuery();
List<Long> collect = windowOwnerEntities.stream().map(item -> item.getWindowId()).collect(Collectors.toList()); windowOwnerQuery.setIdList(Arrays.asList(ids));
List<WindowOwnerEntity> windowOwnerEntities = this.find(windowOwnerQuery);
List<Long> collect = windowOwnerEntities.stream().map(item -> item.getStaffId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect)) { if (!ObjectUtils.isEmpty(collect)) {
WindowOwnerDetailQuery detailQuery = new WindowOwnerDetailQuery(); WindowOwnerDetailQuery detailQuery = new WindowOwnerDetailQuery();
detailQuery.ownerIdList(collect); detailQuery.ownerIdList(collect);
......
...@@ -13,6 +13,7 @@ import com.mortals.xhx.module.staff.model.StaffEntity; ...@@ -13,6 +13,7 @@ import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.*; import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo; import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformService; import com.mortals.xhx.module.window.service.WindowWorkmanPerformService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -46,6 +47,8 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf ...@@ -46,6 +47,8 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
private WindowWorkmanPerformService windowWorkmanPerformService; private WindowWorkmanPerformService windowWorkmanPerformService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired
private WindowOwnerDetailService windowOwnerDetailService;
@Override @Override
...@@ -58,6 +61,13 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf ...@@ -58,6 +61,13 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
entity.setSalaId(staff.getSalaId()); entity.setSalaId(staff.getSalaId());
entity.setSalaName(staff.getSalaName()); entity.setSalaName(staff.getSalaName());
} }
if(entity.getWindowId()!=null) {
WindowOwnerDetailEntity windowOwnerDetailEntity = windowOwnerDetailService.selectOne(new WindowOwnerDetailQuery().windowId(entity.getWindowId()));
if(windowOwnerDetailEntity!=null){
entity.setWindowCode(windowOwnerDetailEntity.getWindowCode());
entity.setWindowName(windowOwnerDetailEntity.getWindowName());
}
}
deleteExistBill(entity, context); deleteExistBill(entity, context);
} }
......
...@@ -14,8 +14,8 @@ import com.mortals.xhx.module.check.service.CheckWindowPerformService; ...@@ -14,8 +14,8 @@ import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService; import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import com.mortals.xhx.module.staff.model.StaffEntity; import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService; import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailEntity; import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailQuery; import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformDetailService; import com.mortals.xhx.module.window.service.WindowWorkmanPerformDetailService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -25,7 +25,6 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; ...@@ -25,7 +25,6 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.xhx.module.window.dao.WindowWorkmanPerformDao; import com.mortals.xhx.module.window.dao.WindowWorkmanPerformDao;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformEntity;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformService; import com.mortals.xhx.module.window.service.WindowWorkmanPerformService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
...@@ -51,7 +50,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -51,7 +50,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService; private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired
private WindowOwnerDetailService windowOwnerDetailService;
@Autowired @Autowired
private IWindowFeign windowFeign; private IWindowFeign windowFeign;
...@@ -67,6 +67,13 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -67,6 +67,13 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
entity.setSalaId(staff.getSalaId()); entity.setSalaId(staff.getSalaId());
entity.setSalaName(staff.getSalaName()); entity.setSalaName(staff.getSalaName());
} }
if(entity.getWindowId()!=null) {
WindowOwnerDetailEntity windowOwnerDetailEntity = windowOwnerDetailService.selectOne(new WindowOwnerDetailQuery().windowId(entity.getWindowId()));
if(windowOwnerDetailEntity!=null){
entity.setWindowCode(windowOwnerDetailEntity.getWindowCode());
entity.setWindowName(windowOwnerDetailEntity.getWindowName());
}
}
super.saveBefore(entity, context); super.saveBefore(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