Merge remote-tracking branch 'origin/master'

master
anthonyywj2 3 years ago
commit d145d2c7e3

@ -1,5 +1,6 @@
package com.glxp.api.admin.controller.business;
import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.controller.inventory.InvPrintController;
@ -18,6 +19,7 @@ import com.glxp.api.admin.req.inout.DeleteRequest;
import com.glxp.api.admin.req.inventory.PostStockPrintRequest;
import com.glxp.api.admin.res.PageSimpleResponse;
import com.glxp.api.admin.res.basic.UdiRelevanceResponse;
import com.glxp.api.admin.res.business.StockOrderExportResponse;
import com.glxp.api.admin.res.inout.ErpOrderResponse;
import com.glxp.api.admin.service.basic.UdiInfoService;
import com.glxp.api.admin.service.basic.UdiRelevanceService;
@ -37,12 +39,12 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
@ -451,4 +453,19 @@ public class StockOrderController {
return ResultVOUtils.success(billNo);
}
/**
*
*
* @param request
* @return
*/
@PostMapping("/udiwms/stock/order/exportOrderData")
public BaseResponse exportOrderData(StockOrderFilterRequest request) {
if (null == request || BeanUtil.isEmpty(request)) {
return ResultVOUtils.success(Collections.emptyList());
}
List<StockOrderExportResponse> data = stockOrderService.exportOrderData(request);
return ResultVOUtils.success(data);
}
}

@ -29,4 +29,6 @@ public class StockOrderFilterRequest extends ListPageRequest {
private String orderIdFk;
private BigDecimal totalPrice;
private String thirdOrderFk;
private String locStorageCode; //当前仓库号
}

@ -0,0 +1,10 @@
package com.glxp.api.admin.res.business;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
import lombok.Data;
@Data
@JsonIgnoreProperties("orderIdFk")
public class StockOrderDetailEntityVo extends StockOrderDetailEntity {
}

@ -0,0 +1,29 @@
package com.glxp.api.admin.res.business;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.List;
/**
*
*/
@Data
public class StockOrderExportResponse {
private String id;
private String billNo;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private String billdate;
private String corpId;
private String corpName;
private String billType;
private String locStorageCode;
/**
*
*/
private List<StockOrderDetailEntityVo> orderDetails;
}

@ -5,6 +5,7 @@ import com.glxp.api.admin.entity.business.StockOrderEntity;
import com.glxp.api.admin.entity.business.StockOrderPrintEntity;
import com.glxp.api.admin.req.business.StockOrderFilterRequest;
import com.glxp.api.admin.req.business.StockOrderQueryRequest;
import com.glxp.api.admin.res.business.StockOrderExportResponse;
import java.util.List;
@ -36,4 +37,12 @@ public interface StockOrderService {
List<StockOrderPrintEntity> listOrderPrint(String orderId);
/**
*
*
* @param request
* @return
*/
List<StockOrderExportResponse> exportOrderData(StockOrderFilterRequest request);
}

@ -1,15 +1,24 @@
package com.glxp.api.admin.service.business.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.business.StockOrderDao;
import com.glxp.api.admin.dao.business.StockOrderDetailDao;
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
import com.glxp.api.admin.entity.business.StockOrderEntity;
import com.glxp.api.admin.entity.business.StockOrderPrintEntity;
import com.glxp.api.admin.req.business.StockOrderDetailFilterRequest;
import com.glxp.api.admin.req.business.StockOrderFilterRequest;
import com.glxp.api.admin.req.business.StockOrderQueryRequest;
import com.glxp.api.admin.res.business.StockOrderDetailEntityVo;
import com.glxp.api.admin.res.business.StockOrderExportResponse;
import com.glxp.api.admin.service.business.StockOrderService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -18,6 +27,8 @@ public class StockOrderServiceImpl implements StockOrderService {
@Resource
StockOrderDao stockOrderDao;
@Resource
StockOrderDetailDao stockOrderDetailDao;
@Override
public List<StockOrderEntity> listStockOrders(StockOrderQueryRequest stockOrderQueryRequest) {
@ -107,4 +118,26 @@ public class StockOrderServiceImpl implements StockOrderService {
return stockOrderDao.listOrderPrint(stockOrderFilterRequest);
}
@Override
public List<StockOrderExportResponse> exportOrderData(StockOrderFilterRequest request) {
//单据状态为已验收
request.setStatus("5");
List<StockOrderEntity> stockOrderEntities = stockOrderDao.filterListOr(request);
if (CollUtil.isNotEmpty(stockOrderEntities)) {
List<StockOrderExportResponse> result = new ArrayList<>();
for (StockOrderEntity stockOrderEntity : stockOrderEntities) {
StockOrderExportResponse response = new StockOrderExportResponse();
BeanUtils.copyProperties(stockOrderEntity, response);
StockOrderDetailFilterRequest filterRequest = new StockOrderDetailFilterRequest();
filterRequest.setOrderIdFk(stockOrderEntity.getOrderIdFk());
List<StockOrderDetailEntity> stockOrderDetailEntities = stockOrderDetailDao.filterStockOrderDetail(filterRequest);
List<StockOrderDetailEntityVo> vos = BeanUtil.copyToList(stockOrderDetailEntities, StockOrderDetailEntityVo.class);
response.setOrderDetails(vos);
result.add(response);
}
return result;
}
return Collections.emptyList();
}
}

@ -140,6 +140,9 @@
<if test="totalPrice != '' and totalPrice!=null">
and totalPrice = #{totalPrice}
</if>
<if test="locStorageCode != null and locStorageCode != ''">
and locStorageCode = #{locStorageCode}
</if>
<if test="startTime!=null and startTime!=''">
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startTime}, '%Y-%m-%d') ]]>
</if>

Loading…
Cancel
Save