|
@@ -26,7 +26,6 @@ import com.kxs.store.api.model.*;
|
|
|
import com.kxs.store.api.vo.kxsapp.store.StoreAdvanceMachineVO;
|
|
import com.kxs.store.api.vo.kxsapp.store.StoreAdvanceMachineVO;
|
|
|
import com.kxs.store.api.vo.kxsapp.storeAdvance.UserWarehouseListVO;
|
|
import com.kxs.store.api.vo.kxsapp.storeAdvance.UserWarehouseListVO;
|
|
|
import com.kxs.store.api.vo.kxsapp.userAdvance.AdvanceDevModalVO;
|
|
import com.kxs.store.api.vo.kxsapp.userAdvance.AdvanceDevModalVO;
|
|
|
-import com.kxs.store.api.vo.kxsapp.userAdvance.UserAdvanceListInfoVO;
|
|
|
|
|
import com.kxs.store.api.vo.kxsapp.userAdvance.UserAdvanceListVO;
|
|
import com.kxs.store.api.vo.kxsapp.userAdvance.UserAdvanceListVO;
|
|
|
import com.kxs.store.biz.constant.enums.StoreErrorTypeEnum;
|
|
import com.kxs.store.biz.constant.enums.StoreErrorTypeEnum;
|
|
|
import com.kxs.store.biz.constant.enums.WarehouseLimitTypeEnum;
|
|
import com.kxs.store.biz.constant.enums.WarehouseLimitTypeEnum;
|
|
@@ -48,6 +47,8 @@ import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
+import static org.bouncycastle.asn1.x500.style.RFC4519Style.sn;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 客小爽预发机表(KxsMachineAdvance)表服务实现类
|
|
* 客小爽预发机表(KxsMachineAdvance)表服务实现类
|
|
|
*
|
|
*
|
|
@@ -251,6 +252,9 @@ public class KxsMachineAdvanceServiceImpl extends ServiceImpl<KxsMachineAdvanceM
|
|
|
KxsMachine machine = RetOps.of(kxsMachineR)
|
|
KxsMachine machine = RetOps.of(kxsMachineR)
|
|
|
.getData()
|
|
.getData()
|
|
|
.orElseThrow(() -> new GlobalCustomerException(StoreErrorTypeEnum.SN_FIND_NULL.getDescription()));
|
|
.orElseThrow(() -> new GlobalCustomerException(StoreErrorTypeEnum.SN_FIND_NULL.getDescription()));
|
|
|
|
|
+ if(machine.getPreUserId() > 0){
|
|
|
|
|
+ throw new GlobalCustomerException("机具已"+machine.getPosSn()+"预发,不能重复预发");
|
|
|
|
|
+ }
|
|
|
//新增预发机明细
|
|
//新增预发机明细
|
|
|
KxsMachineAdvanceInfo kxsMachineAdvanceInfo = new KxsMachineAdvanceInfo();
|
|
KxsMachineAdvanceInfo kxsMachineAdvanceInfo = new KxsMachineAdvanceInfo();
|
|
|
kxsMachineAdvanceInfo.setOrderId(kxsMachineAdvance.getId());
|
|
kxsMachineAdvanceInfo.setOrderId(kxsMachineAdvance.getId());
|
|
@@ -380,19 +384,22 @@ public class KxsMachineAdvanceServiceImpl extends ServiceImpl<KxsMachineAdvanceM
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public IPage<UserAdvanceListVO> advanceUserList(Page<UserAdvanceListVO> page) {
|
|
|
|
|
|
|
+ public List<UserAdvanceListVO> advanceUserList() {
|
|
|
|
|
+
|
|
|
Long userId = SecurityUtils.getUser().getId();
|
|
Long userId = SecurityUtils.getUser().getId();
|
|
|
- IPage<UserAdvanceListVO> listPage = baseMapper.advanceUserList(page, userId);
|
|
|
|
|
- for (UserAdvanceListVO record : listPage.getRecords()) {
|
|
|
|
|
- for (UserAdvanceListInfoVO mch : record.getSnList()) {
|
|
|
|
|
- R<KxsMachine> machineResult = remoteKxsProductService.loadMachineById(mch.getMachineId(), SecurityConstants.FROM_IN);
|
|
|
|
|
- KxsMachine machine = RetOps.of(machineResult)
|
|
|
|
|
|
|
+ List<UserAdvanceListVO> userAdvanceList = baseMapper.advanceUserList(userId);
|
|
|
|
|
+ for (UserAdvanceListVO advanceListVO : userAdvanceList) {
|
|
|
|
|
+
|
|
|
|
|
+ //只有广电卡查询地址信息
|
|
|
|
|
+ if(advanceListVO.getBrandId() == 14){
|
|
|
|
|
+ R<KxsMachine> kxsMachineR = remoteKxsProductService.loadMachineBySn(advanceListVO.getPosSn(), SecurityConstants.FROM_IN);
|
|
|
|
|
+ KxsMachine machine = RetOps.of(kxsMachineR)
|
|
|
.getData()
|
|
.getData()
|
|
|
.orElseThrow(() -> new GlobalCustomerException(StoreErrorTypeEnum.SN_FIND_NULL.getDescription()));
|
|
.orElseThrow(() -> new GlobalCustomerException(StoreErrorTypeEnum.SN_FIND_NULL.getDescription()));
|
|
|
- mch.setAreas(machine.getDevLocation());
|
|
|
|
|
|
|
+ advanceListVO.setAreas(machine.getDevLocation());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return listPage;
|
|
|
|
|
|
|
+ return userAdvanceList;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|