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