|
@@ -9,6 +9,7 @@ import com.platform.common.exception.BusinessException;
|
|
import com.platform.common.model.UserInfo;
|
|
import com.platform.common.model.UserInfo;
|
|
import com.platform.common.util.*;
|
|
import com.platform.common.util.*;
|
|
import com.platform.dao.bean.MyPage;
|
|
import com.platform.dao.bean.MyPage;
|
|
|
|
+import com.platform.dao.dto.repair.RepairApplicationFormDTO;
|
|
import com.platform.dao.dto.store.*;
|
|
import com.platform.dao.dto.store.*;
|
|
import com.platform.dao.entity.purchase.PurchaseDispatchOrder;
|
|
import com.platform.dao.entity.purchase.PurchaseDispatchOrder;
|
|
import com.platform.dao.entity.purchase.PurchaseDispatchOrderList;
|
|
import com.platform.dao.entity.purchase.PurchaseDispatchOrderList;
|
|
@@ -22,15 +23,10 @@ import com.platform.dao.enums.*;
|
|
import com.platform.dao.mapper.purchase.PurchaseDispatchOrderListMapper;
|
|
import com.platform.dao.mapper.purchase.PurchaseDispatchOrderListMapper;
|
|
import com.platform.dao.mapper.purchase.PurchaseDispatchOrderMapper;
|
|
import com.platform.dao.mapper.purchase.PurchaseDispatchOrderMapper;
|
|
import com.platform.dao.mapper.purchase.PurchaseListMapper;
|
|
import com.platform.dao.mapper.purchase.PurchaseListMapper;
|
|
-import com.platform.dao.mapper.store.InStoreDetailMapper;
|
|
|
|
-import com.platform.dao.mapper.store.InStoreFormMapper;
|
|
|
|
-import com.platform.dao.mapper.store.SpareBackFormMapper;
|
|
|
|
-import com.platform.dao.mapper.store.SpareStoreMapper;
|
|
|
|
|
|
+import com.platform.dao.mapper.store.*;
|
|
import com.platform.dao.util.MessageTemplateUtil;
|
|
import com.platform.dao.util.MessageTemplateUtil;
|
|
-import com.platform.dao.vo.query.store.InStoreFormVO;
|
|
|
|
-import com.platform.dao.vo.query.store.SpareBackDetailVO;
|
|
|
|
-import com.platform.dao.vo.query.store.StoreCheckJobVO;
|
|
|
|
-import com.platform.dao.vo.query.store.StoreVO;
|
|
|
|
|
|
+import com.platform.dao.vo.query.store.*;
|
|
|
|
+import com.platform.dao.vo.repair.RepairApplicationFormVO;
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
import com.platform.service.base.impl.BaseServiceImpl;
|
|
import com.platform.service.business.PurchaseBusinessService;
|
|
import com.platform.service.business.PurchaseBusinessService;
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
import com.platform.service.event.WorkplaceBacklogEvent;
|
|
@@ -46,8 +42,10 @@ import tk.mybatis.mapper.weekend.WeekendCriteria;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
|
+import java.time.format.TextStyle;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Locale;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -63,6 +61,11 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
|
|
private SpareStoreMapper spareStoreMapper;
|
|
private SpareStoreMapper spareStoreMapper;
|
|
private StoreService storeService;
|
|
private StoreService storeService;
|
|
private SpareBackFormMapper spareBackFormMapper;
|
|
private SpareBackFormMapper spareBackFormMapper;
|
|
|
|
+ private InStoreDetailMapper inStoreDetailMapper;
|
|
|
|
+ private OutStoreDetailMapper outStoreDetailMapper;
|
|
|
|
+ private InStoreFormMapper inStoreFormMapper;
|
|
|
|
+ private OutStoreFormMapper outStoreFormMapper;
|
|
|
|
+
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int batchDelete(List<String> ids) {
|
|
public int batchDelete(List<String> ids) {
|
|
@@ -76,6 +79,142 @@ public class InStoreFormServiceImpl extends BaseServiceImpl<InStoreFormMapper, I
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public StoreWorkBenchVO getCurrentlyList(String userId) {
|
|
|
|
+ StoreWorkBenchVO storeWorkBenchVO=new StoreWorkBenchVO();
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
+
|
|
|
|
+ List<LocalDateTime> currentWeekStartAndEndList = DateUtils.currentWeek();
|
|
|
|
+ LocalDateTime searchStartTime = now.plusDays(-6).withHour(0).withMinute(0).withSecond(0);
|
|
|
|
+ LocalDateTime searchEndTime = now.withHour(23).withMinute(59).withSecond(59);
|
|
|
|
+ // 总数
|
|
|
|
+ InStoreFormDTO queryDTO = new InStoreFormDTO();
|
|
|
|
+ OutStoreFormDTO queryDTO2=new OutStoreFormDTO();
|
|
|
|
+ queryDTO2.setSearchStartTime(searchStartTime);
|
|
|
|
+ queryDTO.setSearchStartTime(searchStartTime);
|
|
|
|
+ queryDTO.setSearchEndTime(searchEndTime);
|
|
|
|
+ queryDTO2.setSearchEndTime(searchEndTime);
|
|
|
|
+ queryDTO.setUserId(userId);
|
|
|
|
+ queryDTO2.setUserId(userId);
|
|
|
|
+ List<InStoreDetailVO> list = inStoreDetailMapper.getCurrentlyList(queryDTO) == null ? new ArrayList<>() : inStoreDetailMapper.getCurrentlyList(queryDTO);
|
|
|
|
+ List<OutStoreDetailVO> list2=outStoreDetailMapper.getCurrentlyList(queryDTO2) == null ? new ArrayList<>() : outStoreDetailMapper.getCurrentlyList(queryDTO2);
|
|
|
|
+ List<InStoreDetailVO> result = new ArrayList<>();
|
|
|
|
+ List<OutStoreDetailVO> result2=new ArrayList<>();
|
|
|
|
+ for(LocalDateTime tempDate: currentWeekStartAndEndList){
|
|
|
|
+ InStoreDetailVO vo = new InStoreDetailVO();
|
|
|
|
+ OutStoreDetailVO vo1=new OutStoreDetailVO();
|
|
|
|
+ int tempTotalNum = 0;
|
|
|
|
+ vo.setWeekDayName(tempDate.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.CHINA));
|
|
|
|
+ vo1.setWeekDayName(tempDate.getDayOfWeek().getDisplayName(TextStyle.FULL, Locale.CHINA));
|
|
|
|
+ for(InStoreDetailVO useVO: list){
|
|
|
|
+ if(useVO.getCreatedTime().toLocalDate().isEqual(tempDate.toLocalDate())){
|
|
|
|
+ tempTotalNum+=1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for(OutStoreDetailVO useVO: list2){
|
|
|
|
+ if(useVO.getCreatedTime().toLocalDate().isEqual(tempDate.toLocalDate())){
|
|
|
|
+ tempTotalNum+=1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ result.add(vo);
|
|
|
|
+ result2.add(vo1);
|
|
|
|
+ }
|
|
|
|
+ storeWorkBenchVO.setInStoreDetailVOS(result);
|
|
|
|
+ storeWorkBenchVO.setOutStoreDetailVOS(result2);
|
|
|
|
+ return storeWorkBenchVO;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public StoreWorkBenchVO getStoreWorkBenchVO(String userId) {
|
|
|
|
+ SpareStoreDTO spareStoreDTO=new SpareStoreDTO();
|
|
|
|
+ spareStoreDTO.setUserId(userId);
|
|
|
|
+ List<SpareStoreVO> spareStoreVOS=spareStoreMapper.selectList(spareStoreDTO);
|
|
|
|
+ int totalNum=0;
|
|
|
|
+ for(SpareStoreVO vo:spareStoreVOS){
|
|
|
|
+ totalNum+=vo.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ InStoreFormDTO queryDTO=new InStoreFormDTO();
|
|
|
|
+ queryDTO.setUserId(userId);
|
|
|
|
+ OutStoreFormDTO queryDTO2=new OutStoreFormDTO();
|
|
|
|
+ queryDTO2.setUserId(userId);
|
|
|
|
+ List<OutStoreFormVO> outStoreFormVOS=outStoreFormMapper.selectOutStoreList();
|
|
|
|
+ List<InStoreFormVO> inStoreFormVOS=inStoreFormMapper.getInStoreDetailVOs();
|
|
|
|
+ StoreWorkBenchVO storeWorkBenchVO=new StoreWorkBenchVO();
|
|
|
|
+ int num=0;
|
|
|
|
+ int purchaseNum=0;
|
|
|
|
+ int xzNum=0;
|
|
|
|
+ int dbNum=0;
|
|
|
|
+ int otherNum=0;
|
|
|
|
+ int num1=0;
|
|
|
|
+ int lyNum=0;
|
|
|
|
+ int dbNum2=0;
|
|
|
|
+ int bfNum=0;
|
|
|
|
+ int otherNum2=0;
|
|
|
|
+ int pdNum=0;
|
|
|
|
+ for(OutStoreFormVO vo:outStoreFormVOS){
|
|
|
|
+ List<OutStoreDetailVO> outStoreDetailVOS=vo.getDetailList();
|
|
|
|
+ //待出库
|
|
|
|
+ if(vo.getStatus()!=null&&vo.getStatus().equals(OutStoreStatusEnum.NOT_EXECUTE)){
|
|
|
|
+ for(OutStoreDetailVO vo1:outStoreDetailVOS){
|
|
|
|
+ num1+=vo1.getNum().intValue();
|
|
|
|
+ if(vo1.getType()==OutStoreTypeEnum.CHUKU_LINGYONG.getValue()){
|
|
|
|
+ lyNum+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ if(vo1.getType()==OutStoreTypeEnum.CHUKU_DIAOBO.getValue()){
|
|
|
|
+ dbNum2+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ if(vo1.getType()==OutStoreTypeEnum.CHUKU_BAOFEI.getValue()){
|
|
|
|
+ bfNum+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ if(vo1.getType()==OutStoreTypeEnum.CHUKU_QITA.getValue()){
|
|
|
|
+ otherNum2+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ if(vo1.getType()==OutStoreTypeEnum.STORE_CHECK.getValue()){
|
|
|
|
+ pdNum+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for(InStoreFormVO vo:inStoreFormVOS){
|
|
|
|
+ List<InStoreDetailVO> inStoreDetailVOS=vo.getDetailList();
|
|
|
|
+ //待入库数据
|
|
|
|
+ if(vo.getStatus()!=null&&vo.getStatus().equals(InStoreStatusEnum.NOT_EXECUTE.getValue())){
|
|
|
|
+ for (InStoreDetailVO vo1:inStoreDetailVOS){
|
|
|
|
+ num+=vo1.getNum().intValue();
|
|
|
|
+ //采购
|
|
|
|
+ if(vo1.getType()==InStoreTypeEnum.CAIGOU_RUKU.getValue()){
|
|
|
|
+ purchaseNum+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ //闲置入库
|
|
|
|
+ if(vo1.getType()==InStoreTypeEnum.XIANZHI_RUKU.getValue()){
|
|
|
|
+ xzNum+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ //调拨入库
|
|
|
|
+ if(vo1.getType()==InStoreTypeEnum.DIAOBO_RUKU.getValue()){
|
|
|
|
+ dbNum+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ if(vo1.getType()==InStoreTypeEnum.FAYUN_RUKU.getValue()||vo1.getType()==InStoreTypeEnum.STORE_CHECK.getValue()){
|
|
|
|
+ otherNum+=vo1.getNum().intValue();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ storeWorkBenchVO.setInTotalNum(num);
|
|
|
|
+ storeWorkBenchVO.setPurchaseApplyNum(purchaseNum);
|
|
|
|
+ storeWorkBenchVO.setSpareBackApplyNum(xzNum);
|
|
|
|
+ storeWorkBenchVO.setOtherNum(otherNum);
|
|
|
|
+ storeWorkBenchVO.setDbApplyNum(dbNum);
|
|
|
|
+ storeWorkBenchVO.setBFNum(bfNum);
|
|
|
|
+ storeWorkBenchVO.setLYNum(lyNum);
|
|
|
|
+ storeWorkBenchVO.setDBOutNum(dbNum2);
|
|
|
|
+ storeWorkBenchVO.setOtherOutNum(otherNum2);
|
|
|
|
+ storeWorkBenchVO.setPDOutNum(pdNum);
|
|
|
|
+ storeWorkBenchVO.setOutTotalNum(num1);
|
|
|
|
+ storeWorkBenchVO.setTotalNum(totalNum);
|
|
|
|
+ return storeWorkBenchVO;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public AbstractPageResultBean<InStoreFormVO> selectPageList(InStoreFormDTO model, int pageNum, int pageSize) {
|
|
public AbstractPageResultBean<InStoreFormVO> selectPageList(InStoreFormDTO model, int pageNum, int pageSize) {
|
|
// 登录人负责的仓库,入库单
|
|
// 登录人负责的仓库,入库单
|