Commit 9f702dca authored by liuzeheng's avatar liuzeheng

空数据判断、查询修改

parent f1954200
......@@ -392,4 +392,6 @@ public interface ErrorCodeConstants {
ErrorCode NO_WAREHOUSE_IN_CAN_NOT_PACKED = new ErrorCode(1004001152, "no.warehouse.in.can.not.packed");
ErrorCode ORDER_IS_PRE_INSTALLED = new ErrorCode(1004001153, "order.is.pre.installed");
ErrorCode ORDER_IS_NOT_PRE_INSTALLED = new ErrorCode(1004001154, "order.is.not.pre.installed");
}
......@@ -91,8 +91,10 @@ import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.BeanUtils;
......@@ -880,6 +882,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
if (Objects.isNull(query.getLang())) {
query.setLang(I18nMessage.getLang());
}
caseStatus(query.getStatus(),query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
log.warn(I18nMessage.getLang().toString());
......@@ -890,6 +893,163 @@ public class OrderQueryServiceImpl implements OrderQueryService {
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
public void caseStatus(List<Integer> status,OrderQueryDTO query){
if (CollectionUtils.isNotEmpty(status) ) {
List<Integer> statusList =new ArrayList<>() ;
status.forEach(statu->{
if(statu>10000){
combinedState(statu, query,statusList);
}
});
statusList.stream().distinct();
List<Integer> list= new ArrayList<>() ;
list.addAll(status.stream().filter(s->s <10000).collect(Collectors.toList())) ;
list.addAll(statusList.stream().distinct().collect(Collectors.toList()));
query.setStatusList(list) ;
}
}
private void combinedState(Integer asStatus, OrderQueryDTO query,List<Integer> statusList) {
switch (asStatus) {
case 12325:
//this.status = 12;
statusList.add(12);
query.setShipmentState(325);
break;
case 10501:
// 空运待出
//this.status = 5;
statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setAirShipment(1);
//this.auditType = 0;
if(CollectionUtils.isEmpty(query.getAuditType())){
List<Integer> audits= new ArrayList<>();
query.setAuditType(audits) ;
query.getAuditType().add(0) ;
}else {
query.getAuditType().add(0) ;
}
//this.abnormalState = 0;
if(CollectionUtils.isEmpty(query.getAbnormalState())){
List<Integer> audits= new ArrayList<>();
query.setAbnormalState(audits);
query.getAbnormalState().add(0) ;
}else {
query.getAbnormalState().add(0) ;
}
break;
case 10502:
// 空运可出
//this.status = 5;
statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setAirShipment(12) ; // 可出、备货中
break;
case 10503:
// 空运已备货
//this.status = 5;
statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setAirShipment(4) ; // 已备货
break;
case 10504:
// 待排单
//this.status = 5;
statusList.add(5);
if (Objects.nonNull(query.getTransportId()) && query.getTransportId() == 3) {
// 空运无需判断备货状态 可出、备货中、已备货
query.setAirShipment(10) ;
}else {
// 兼容空运已入仓的可出、备货中、已备货,且无异常无审批,海运的已入仓无异常无审批
query.setAirShipment(20) ;
}
//this.auditType = 0;
if(CollectionUtils.isEmpty(query.getAuditType())){
List<Integer> audits= new ArrayList<>();
query.setAuditType(audits) ;
query.getAuditType().add(0);
}else {
query.getAuditType().add(0) ;
}
//this.abnormalState = 0;
if(CollectionUtils.isEmpty(query.getAbnormalState())){
List<Integer> audits= new ArrayList<>();
query.setAbnormalState(audits);
query.getAbnormalState().add(0) ;
}else {
query.getAbnormalState().add(0) ;
}
break;
case 132411:
// 空运已出货
//this.status = 32;
statusList.add(32);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState(411);
break;
case 132412:
// 空运已出仓
//this.status = 32;
statusList.add(32);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState(412);
break;
case 132409:
// 空运已理货
//this.status = 32;
statusList.add(32);
// 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState( 409);
break;
case 118428:
// 空运已到港
//this.status = 18;
statusList.add(18);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState( 428);
break;
}
}
@Override
public long orderCount(OrderQueryVO query) {
return orderMapper.orderCount(query);
......@@ -910,6 +1070,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
@Override
public PageResult<OrderBackPageVO> deptOrderPage1(OrderQueryDTO query, PageVO page) {
query.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
IPage<OrderBackPageVO> mpPage = MyBatisUtils.buildPage(page);
long total = orderMapper.deptOrderCount1(query);
log.warn(I18nMessage.getLang().toString());
......@@ -1509,6 +1670,7 @@ public class OrderQueryServiceImpl implements OrderQueryService {
@Override
public StatisticsOrderVO statisticsMyOrder(OrderQueryDTO query) {
caseStatus(query.getStatus(),query);
StatisticsOrderVO vo = orderMapper.statisticsMyOrder(query);
if (Objects.nonNull(vo)) {
vo.setTotalVolume(new BigDecimal(vo.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString());
......
......@@ -1003,26 +1003,26 @@
</if>
</if>
<!-- <if test="query.status != null and query.status.size()>0">-->
<if test="query.statusList != null and query.statusList.size()>0">
<!-- <if test="query.status != null and query.status != '' and query.status.size()==1 ">-->
<!-- AND o.`status` =-->
<!-- <foreach item='status' index="index" collection='query.status' >-->
<!-- #{status}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()==1 ">
AND o.`status` =
<foreach item='status' index="index" collection='query.statusList' >
#{status}
</foreach>
</if>
<!-- <if test="query.status != null and query.status != '' and query.status.size()>1 ">-->
<!-- AND o.`status` in-->
<!-- <foreach item='status' index="index" collection='query.status' open='(' separator=',' close=')'>-->
<!-- #{status}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="query.statusList != null and query.statusList != '' and query.statusList.size()>1 ">
AND o.`status` in
<foreach item='status' index="index" collection='query.statusList' open='(' separator=',' close=')'>
#{status}
</foreach>
</if>
<!-- </if>-->
<if test="query.status != null">
AND o.`status` = #{query.status}
</if>
<!-- <if test="query.status != null">-->
<!-- AND o.`status` = #{query.status}-->
<!-- </if>-->
<!-- <if test="query.abnormalState != null">-->
<!-- <choose>-->
<!-- <when test="query.abnormalState != 0">-->
......
......@@ -3327,7 +3327,27 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
List<ProductPriceStepDO> fullPriceStepList = new ArrayList<>( );
ProductPriceStepDO freightPriceStep = new ProductPriceStepDO();
ProductPriceStepDO clear = new ProductPriceStepDO();
if(createReqVO.getPriceType()==1){
if(CollectionUtil.isNotEmpty(respVO.getFullPricePackagingList())){
List<ProductPriceStepPackagingDO> specialDOList = new ArrayList<>();
respVO.getFullPricePackagingList().forEach(pack->{
ProductPriceStepDO packagingDO = new ProductPriceStepDO() ;
BeanUtils.copyProperties(pack,packagingDO);
packagingDO.setId(null);
packagingDO.setStartNum(BigDecimal.valueOf(0));
packagingDO.setEndNum(BigDecimal.valueOf(0));
packagingDO.setWeightUnit(price.getTransportPriceUnit());
// packagingDO.setTransportPrice(pack.getPackagingPrice());
// packagingDO.setTransportPriceUnit(pack.getPackagingPriceUnit());
// packagingDO.setTransportVolumeUnit(pack.getPackagingVolumeUnit());
packagingDO.setAllPrice(pack.getPackagingPrice());
packagingDO.setAllPriceUnit(pack.getPackagingPriceUnit()) ;
packagingDO.setAllVolumeUnit(pack.getPackagingVolumeUnit());
fullPriceStepList.add(packagingDO) ;
});
createReqVO.setFullPriceStepList(fullPriceStepList);
}
}else{
if(CollectionUtil.isEmpty(respVO.getFreightPriceStepList()) ){
BeanUtils.copyProperties(price,freightPriceStep);
freightPriceStep.setStartNum(BigDecimal.valueOf(0));
......@@ -3355,6 +3375,23 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
});
stepPackagingDOS.stream().distinct();
freightPriceStep.setPackagingList(stepPackagingDOS) ;
}
if(respVO.getPriceType()==1){
if(CollectionUtil.isNotEmpty(respVO.getFullPricePackagingList())){
List<ProductPriceStepPackagingDO> specialDOList = new ArrayList<>();
respVO.getFullPricePackagingList().forEach(pack->{
ProductPriceStepPackagingDO packagingDO = new ProductPriceStepPackagingDO() ;
BeanUtils.copyProperties(pack,packagingDO);
packagingDO.setId(null);
specialDOList.add(packagingDO) ;
});
freightPriceStep.setPackagingList(specialDOList) ;
}
}else{
}
freightPriceStepList.add(freightPriceStep);
......@@ -3388,8 +3425,25 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
}else{
createReqVO.setClearancePriceStepList(respVO.getClearancePriceStepList()) ;
}
}
// if(CollectionUtil.isNotEmpty(respVO.getFullPricePackagingList())){
//
// respVO.getFullPricePackagingList().forEach(pack->{
// ProductPriceStepDO packagingDO = new ProductPriceStepDO() ;
// BeanUtils.copyProperties(pack,packagingDO);
// packagingDO.setId(null);
//
// packagingDO.setTransportPrice(pack.getPackagingPrice());
// packagingDO.setTransportPriceUnit(pack.getPackagingPriceUnit());
//
// fullPriceStepList.add(packagingDO) ;
// });
//
// createReqVO.setFullPriceStepList(fullPriceStepList);
// }
//ProductDO productDO = checkUpdateStatus(lineChannelList, createReqVO.getProductId());
ProductDO productDO = productService.getProduct(createReqVO.getProductId());
......@@ -3779,6 +3833,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
}
}
}
}
// List<ProductPriceSpecialDO> priceSpecialInsert = new ArrayList<>();
// List<ProductPriceSpecialDO> priceSpecialUpdate = new ArrayList<>();
......
......@@ -181,6 +181,9 @@ public class BoxOrderCheckInfoServiceImpl extends AbstractService<BoxOrderCheckI
} else if (createReqVO.getType() == 1) {//合包
List<BoxPkgOrderDO> boxPkgOrderDOS = boxPkgOrderService.selectList(BoxPkgOrderDO::getPkgId, createReqVO.getPkgId());
orderIdList = boxPkgOrderDOS.stream().map(BoxPkgOrderDO::getOrderId).collect(Collectors.toSet());
if(orderIdList.isEmpty() || CollectionUtil.isEmpty(orderIdList)){
throw exception(ErrorCodeConstants.ORDER_IS_NOT_PRE_INSTALLED);
}
orderDOList = orderQueryService.getOrderList(orderIdList);
boolean isParentOrder = false;
if(!orderIdList.contains(orderId)) {
......
......@@ -83,6 +83,20 @@ public class BoxPkgOrderServiceImpl extends AbstractService<BoxPkgOrderMapper, B
@Transactional(rollbackFor = Exception.class)
public String scanOrderNoCreate(BoxPkgOrderScanCodeVO createReqVO){
BoxPkgOrderCreateReqVO vo = new BoxPkgOrderCreateReqVO();
String orderNumCode = createReqVO.getOrderNo();
int position = orderNumCode.lastIndexOf("-");
if(position >= 0) {
String orderNumber = orderNumCode.substring(0, position);
Long orderId = orderService.getOrderIdByOrderNo(orderNumber);
vo.setOrderId(orderId);
BoxMergePkgDO boxMergePkgDO = boxMergePkgService.selectOne(new LambdaQueryWrapperX<BoxMergePkgDO>().eq(BoxMergePkgDO::getPkgNum,createReqVO.getPkgNum()));
vo.setPkgId(boxMergePkgDO.getId()) ;
if(vo.getOrderId()!=null && vo.getPkgId()!=null){//订单和包裹id 不为空,调用装箱方法
this.create(vo);
}
}else if(!createReqVO.getOrderNo().contains("-")){
Long orderId = orderService.getOrderIdByOrderNo(createReqVO.getOrderNo());
vo.setOrderId(orderId);
BoxMergePkgDO boxMergePkgDO = boxMergePkgService.selectOne(new LambdaQueryWrapperX<BoxMergePkgDO>().eq(BoxMergePkgDO::getPkgNum,createReqVO.getPkgNum()));
......@@ -91,6 +105,8 @@ public class BoxPkgOrderServiceImpl extends AbstractService<BoxPkgOrderMapper, B
if(vo.getOrderId()!=null && vo.getPkgId()!=null){//订单和包裹id 不为空,调用装箱方法
this.create(vo);
}
}
// 返回
return "success";
}
......
......@@ -260,3 +260,4 @@ case.num.in.merge.pkg=
order.already.in.merge.pkg=
customer.is.new.or.old.no.change=
order.is.pre.installed=
order.is.not.pre.installed=
......@@ -1000,3 +1000,4 @@ case.num.in.merge.pkg=\u6B64\u7BB1\u5DF2\u88AB\u5408\u5305\uFF0C\u8BF7\u626B\u63
order.already.in.merge.pkg=\u8BA2\u5355\u5DF2\u5728\u5408\u5305\u7BB1\u4E0B
customer.is.new.or.old.no.change=\u5BA2\u6237\u5F53\u524D\u4E1A\u7EE9\u7C7B\u578B\u662F{}\u5BA2\u6237\uFF0C\u4E0D\u9700\u8981\u66F4\u65B0
order.is.pre.installed=\u8BA2\u5355\u5DF2\u9884\u88C5
order.is.not.pre.installed =\u8BA2\u5355\u672A\u88C5\u7BB1\uFF0C\u4E0D\u80FD\u5408\u5305
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