|
@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.contract.api.RemoteContractService;
|
|
import com.sckw.contract.api.RemoteContractService;
|
|
|
import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
|
|
import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
|
|
|
import com.sckw.core.common.enums.enums.DictEnum;
|
|
import com.sckw.core.common.enums.enums.DictEnum;
|
|
@@ -13,6 +15,7 @@ import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.constant.NumberConstant;
|
|
import com.sckw.core.model.constant.NumberConstant;
|
|
|
import com.sckw.core.model.enums.LogisticsOrderEnum;
|
|
import com.sckw.core.model.enums.LogisticsOrderEnum;
|
|
|
|
|
+import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
import com.sckw.core.utils.*;
|
|
import com.sckw.core.utils.*;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
@@ -891,10 +894,15 @@ public class KwtTransportCommonService {
|
|
|
* @return 合同信息
|
|
* @return 合同信息
|
|
|
*/
|
|
*/
|
|
|
public HttpResult getLogisticsOrderByContractId(ContractParam contractParam) {
|
|
public HttpResult getLogisticsOrderByContractId(ContractParam contractParam) {
|
|
|
|
|
+ PageHelper.startPage(contractParam.getPage(), contractParam.getPageSize());
|
|
|
List<Long> contractIds = StringUtils.splitStrToList(contractParam.getContractIds(), Long.class);
|
|
List<Long> contractIds = StringUtils.splitStrToList(contractParam.getContractIds(), Long.class);
|
|
|
Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(Collections.singletonList(LoginUserHolder.getEntId()));
|
|
Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(Collections.singletonList(LoginUserHolder.getEntId()));
|
|
|
List<SckwLogisticsOrderVO> list = logisticsOrderMapper.selectOrderListByContractId(contractParam.getContractType(), entMap.get(LoginUserHolder.getEntId()).getId(), contractIds);
|
|
List<SckwLogisticsOrderVO> list = logisticsOrderMapper.selectOrderListByContractId(contractParam.getContractType(), entMap.get(LoginUserHolder.getEntId()).getId(), contractIds);
|
|
|
List<SckwLogisticsOrderVO> returnList = new ArrayList<>();
|
|
List<SckwLogisticsOrderVO> returnList = new ArrayList<>();
|
|
|
|
|
+ PageInfo<SckwLogisticsOrderVO> pageInfo = new PageInfo<>(list);
|
|
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
|
|
+ return HttpResult.ok(PageRes.build(pageInfo, list));
|
|
|
|
|
+ }
|
|
|
/**计量单位*/
|
|
/**计量单位*/
|
|
|
Map<String, String> dictResDtoMap = getDictData(DictTypeEnum.UNIT_TYPE.getType());
|
|
Map<String, String> dictResDtoMap = getDictData(DictTypeEnum.UNIT_TYPE.getType());
|
|
|
/**支付方式*/
|
|
/**支付方式*/
|
|
@@ -920,11 +928,43 @@ public class KwtTransportCommonService {
|
|
|
vo.setSettlementCycleLabel(vo.getSettlementCycle() == null ? null : settlementDictData.get(vo.getSettlementCycle().toString()));
|
|
vo.setSettlementCycleLabel(vo.getSettlementCycle() == null ? null : settlementDictData.get(vo.getSettlementCycle().toString()));
|
|
|
UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(vo.getCreateBy());
|
|
UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(vo.getCreateBy());
|
|
|
vo.setCreateByName(userCacheResDto == null ? null : userCacheResDto.getName());
|
|
vo.setCreateByName(userCacheResDto == null ? null : userCacheResDto.getName());
|
|
|
|
|
+ Long lOrderId = vo.getLOrderId();
|
|
|
|
|
+ List<String> loadName = new ArrayList<String>();
|
|
|
|
|
+ List<String> loadAddressList = new ArrayList<String>();
|
|
|
|
|
+ List<KwtLogisticsOrderAddress> loadAddress = logisticsOrderAddressMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderAddress>()
|
|
|
|
|
+ .eq(KwtLogisticsOrderAddress::getAddressType, NumberConstant.ONE)
|
|
|
|
|
+ .eq(KwtLogisticsOrderAddress::getDelFlag, NumberConstant.ZERO)
|
|
|
|
|
+ .eq(KwtLogisticsOrderAddress::getLOrderId, lOrderId)
|
|
|
|
|
+ );
|
|
|
|
|
+ loadAddress.forEach(address -> {
|
|
|
|
|
+ loadName.add(address.getName());
|
|
|
|
|
+ loadAddressList.add(address.getDetailAddress());
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ List<String> unloadName = new ArrayList<String>();
|
|
|
|
|
+ List<String> unloadAddressList = new ArrayList<String>();
|
|
|
|
|
+ List<KwtLogisticsOrderAddress> unloadAddress = logisticsOrderAddressMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderAddress>()
|
|
|
|
|
+ .eq(KwtLogisticsOrderAddress::getAddressType, NumberConstant.TWO)
|
|
|
|
|
+ .eq(KwtLogisticsOrderAddress::getDelFlag, NumberConstant.ZERO)
|
|
|
|
|
+ .eq(KwtLogisticsOrderAddress::getLOrderId, lOrderId)
|
|
|
|
|
+ );
|
|
|
|
|
+ unloadAddress.forEach(address -> {
|
|
|
|
|
+ unloadName.add(address.getName());
|
|
|
|
|
+ unloadAddressList.add(address.getDetailAddress());
|
|
|
|
|
+ });
|
|
|
|
|
+ vo.setLoadNames(loadName);
|
|
|
|
|
+ vo.setLoadAddresses(loadAddressList);
|
|
|
|
|
+ vo.setUnloadNames(unloadName);
|
|
|
|
|
+ vo.setUnloadAddresses(unloadAddressList);
|
|
|
|
|
+ List<LoadAddressVo> loadAddressAmount = logisticsOrderAddressMapper.findByAddressAndLoadAmount(lOrderId, NumberConstant.ONE);
|
|
|
|
|
+ vo.setLoading(loadAddressAmount);
|
|
|
|
|
+ List<UnLoadAddressVo> unloadAddressAmount = logisticsOrderAddressMapper.findByAddressAndUnLoadAmount(lOrderId, NumberConstant.TWO);
|
|
|
|
|
+ vo.setUnloading(unloadAddressAmount);
|
|
|
}
|
|
}
|
|
|
- returnList = list.stream().skip((contractParam.getPage() - 1) * contractParam.getPageSize()).limit(contractParam.getPageSize()).collect(Collectors.toList());
|
|
|
|
|
|
|
+// returnList = list.stream().skip((contractParam.getPage() - 1) * contractParam.getPageSize()).limit(contractParam.getPageSize()).collect(Collectors.toList());
|
|
|
}
|
|
}
|
|
|
- PageResult build = PageResult.build(contractParam.getPage(), contractParam.getPageSize(), list.stream().count(), returnList);
|
|
|
|
|
- return HttpResult.ok(build);
|
|
|
|
|
|
|
+// PageResult build = PageResult.build(contractParam.getPage(), contractParam.getPageSize(), list.stream().count(), returnList);
|
|
|
|
|
+ return HttpResult.ok(PageRes.build(pageInfo, list));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|