|
@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
|
|
import com.platform.common.bean.AbstractPageResultBean;
|
|
import com.platform.common.bean.AbstractPageResultBean;
|
|
import com.platform.common.exception.BusinessException;
|
|
import com.platform.common.exception.BusinessException;
|
|
import com.platform.common.util.IdGeneratorUtils;
|
|
import com.platform.common.util.IdGeneratorUtils;
|
|
|
|
+import com.platform.common.util.StringUtils;
|
|
import com.platform.dao.bean.MyPage;
|
|
import com.platform.dao.bean.MyPage;
|
|
import com.platform.dao.dto.sb.SbInfoDTO;
|
|
import com.platform.dao.dto.sb.SbInfoDTO;
|
|
import com.platform.dao.dto.sb.SbStoreCheckJobDTO;
|
|
import com.platform.dao.dto.sb.SbStoreCheckJobDTO;
|
|
@@ -13,6 +14,7 @@ import com.platform.dao.dto.store.StoreCheckJobDTO;
|
|
import com.platform.dao.dto.store.StoreCheckPlanDTO;
|
|
import com.platform.dao.dto.store.StoreCheckPlanDTO;
|
|
import com.platform.dao.entity.firm.FirmSupplier;
|
|
import com.platform.dao.entity.firm.FirmSupplier;
|
|
import com.platform.dao.entity.sb.SbInfo;
|
|
import com.platform.dao.entity.sb.SbInfo;
|
|
|
|
+import com.platform.dao.entity.sb.SbPosition;
|
|
import com.platform.dao.entity.sb.SbStoreCheckJob;
|
|
import com.platform.dao.entity.sb.SbStoreCheckJob;
|
|
import com.platform.dao.entity.sb.SbStoreCheckPlan;
|
|
import com.platform.dao.entity.sb.SbStoreCheckPlan;
|
|
import com.platform.dao.entity.sqarepartmanage.SpareType;
|
|
import com.platform.dao.entity.sqarepartmanage.SpareType;
|
|
@@ -52,6 +54,7 @@ import java.math.BigDecimal;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description 盘点计划 service 实现类
|
|
* @Description 盘点计划 service 实现类
|
|
@@ -125,10 +128,15 @@ public class SbStoreCheckPlanServiceImpl extends BaseServiceImpl<SbStoreCheckPla
|
|
if(!plan.getStatus().equals(StoreCheckPlanStatusEnum.NOT_EXECUTE.getValue())){
|
|
if(!plan.getStatus().equals(StoreCheckPlanStatusEnum.NOT_EXECUTE.getValue())){
|
|
throw new BusinessException("计划已经在执行中,请重新建立计划");
|
|
throw new BusinessException("计划已经在执行中,请重新建立计划");
|
|
}
|
|
}
|
|
- SbInfoDTO spareStoreDTO = new SbInfoDTO();
|
|
|
|
- spareStoreDTO.setUseProject(plan.getStoreId());
|
|
|
|
- List<SbInfoVO> sbInfoVOS = sbInfoMapper.selectVOList(spareStoreDTO);
|
|
|
|
- List<SbStoreCheckJob> addItems = new ArrayList<SbStoreCheckJob>();
|
|
|
|
|
|
+ SbInfoDTO sbInfoDTO = new SbInfoDTO();
|
|
|
|
+ sbInfoDTO.setTypeId(plan.getSpareType());
|
|
|
|
+ sbInfoDTO.setPositionId(plan.getStoreId());
|
|
|
|
+ // TODO: 支持选择区域和子区域的
|
|
|
|
+ List<SbInfoVO> sbInfoVOS = sbInfoMapper.selectVOList(sbInfoDTO);
|
|
|
|
+ if(CollectionUtils.isEmpty(sbInfoVOS)){
|
|
|
|
+ throw new BusinessException("该盘点计划无需要盘点的设备,请重新设置类型或者区域");
|
|
|
|
+ }
|
|
|
|
+ List<SbStoreCheckJob> addItems = new ArrayList<>();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
sbInfoVOS.forEach(item -> {
|
|
sbInfoVOS.forEach(item -> {
|
|
SbStoreCheckJob job = new SbStoreCheckJob();
|
|
SbStoreCheckJob job = new SbStoreCheckJob();
|
|
@@ -191,8 +199,8 @@ public class SbStoreCheckPlanServiceImpl extends BaseServiceImpl<SbStoreCheckPla
|
|
@Override
|
|
@Override
|
|
public SbStoreCheckPlan getModelById(Object id) {
|
|
public SbStoreCheckPlan getModelById(Object id) {
|
|
SbStoreCheckPlan checkPlan = super.getModelById(id);
|
|
SbStoreCheckPlan checkPlan = super.getModelById(id);
|
|
- SysDept sysDept = sysDeptMapper.selectByPrimaryKey(checkPlan.getStoreId());
|
|
|
|
- checkPlan.setStoreName(sysDept.getName());
|
|
|
|
|
|
+ /* SysDept sysDept = sysDeptMapper.selectByPrimaryKey(checkPlan.getStoreId());
|
|
|
|
+ checkPlan.setStoreName(sysDept.getName());*/
|
|
// 查询项目
|
|
// 查询项目
|
|
//List<StoreCheckJobVO> projectList = storeCheckJobMapper.selectJobList(checkPlan.getId());
|
|
//List<StoreCheckJobVO> projectList = storeCheckJobMapper.selectJobList(checkPlan.getId());
|
|
//checkPlan.setJobList(projectList);
|
|
//checkPlan.setJobList(projectList);
|