This commit is contained in:
parent
ca1e497945
commit
ce39bc2895
|
|
@ -32,8 +32,6 @@ import org.springframework.validation.annotation.Validated;
|
|||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.annotation.security.PermitAll;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
|
|
@ -156,14 +154,14 @@ public class AppSaleOrderController{
|
|||
|
||||
@GetMapping("/get-count")
|
||||
@Operation(summary = "获得销售订单 分页 tab count")
|
||||
public CommonResult<Map<String, Long>> getSpuCount() {
|
||||
public CommonResult<Map<String, Long>> getSpuCount(@Valid SaleOrderPageReqVO pageReqVO) {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
CustomerDO customer = customerService.getCustomerByUserId(loginUser.getId());
|
||||
Long customerId = null;
|
||||
if(customer!=null){
|
||||
customerId = customer.getId();
|
||||
}
|
||||
return success(saleOrderService.getTabsCount(customerId));
|
||||
return success(saleOrderService.getTabsCount(pageReqVO, customerId));
|
||||
}
|
||||
|
||||
@PostMapping("/updateSaleOrderBillStatus")
|
||||
|
|
|
|||
|
|
@ -156,8 +156,8 @@ public class SaleOrderController {
|
|||
@GetMapping("/get-count")
|
||||
@Operation(summary = "获得销售订单 分页 tab count")
|
||||
@PreAuthorize("@ss.hasPermission('oms:sale-order:query')")
|
||||
public CommonResult<Map<String, Long>> getSpuCount() {
|
||||
return success(saleOrderService.getTabsCount(null));
|
||||
public CommonResult<Map<String, Long>> getSpuCount(@Valid SaleOrderPageReqVO pageReqVO) {
|
||||
return success(saleOrderService.getTabsCount(pageReqVO,null));
|
||||
}
|
||||
|
||||
@PostMapping("/updateSaleOrderBillStatus")
|
||||
|
|
|
|||
|
|
@ -72,12 +72,12 @@ public interface SaleOrderMapper extends BaseMapperX<SaleOrderDO> {
|
|||
|
||||
IPage<SaleOrderDO> selectPageV2(IPage<SaleOrderDO> page, @Param("reqVO") SaleOrderPageReqVO reqVO);
|
||||
|
||||
Long selectTabCount(@Param("reqVO") SaleOrderPageReqVO reqVO);
|
||||
|
||||
TradeOrderSummaryRespVO selectOrderQtySummaryByOrderStatusAndCreateTimeBetween(@Param("orderStatus") String orderStatus,
|
||||
@Param("beginTime") LocalDateTime beginTime,
|
||||
@Param("endTime") LocalDateTime endTime,@Param("customerId") Long customerId);
|
||||
|
||||
|
||||
/**
|
||||
* 按照支付时间统计订单(按天分组)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -1,23 +1,25 @@
|
|||
package cn.hangtag.module.oms.service.saleorder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.*;
|
||||
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
import cn.hangtag.module.oms.controller.admin.common.vo.DataComparisonRespVO;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.front.dto.CreateSaleOrderDTO;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.front.vo.SaleOrderFollowerUserVO;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.vo.*;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.vo.SaleOrderPageReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.vo.SaleOrderRemarkReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.saleorder.vo.SaleOrderSaveReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderSummaryRespVO;
|
||||
import cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderTrendReqVO;
|
||||
import cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderTrendRespVO;
|
||||
import cn.hangtag.module.oms.dal.dataobject.saleorder.SaleOrderDO;
|
||||
import cn.hangtag.module.oms.dal.dataobject.saleorderentry.SaleOrderEntryDO;
|
||||
import cn.hangtag.framework.common.pojo.PageResult;
|
||||
import cn.hangtag.module.oms.dal.dataobject.saleordersku.SaleOrderSkuDO;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 销售订单 Service 接口
|
||||
*
|
||||
|
|
@ -73,7 +75,7 @@ public interface SaleOrderService {
|
|||
*/
|
||||
List<SaleOrderEntryDO> getSaleOrderEntryListByParentId(Long parentId);
|
||||
|
||||
Map<String, Long> getTabsCount(Long customerId);
|
||||
Map<String, Long> getTabsCount(SaleOrderPageReqVO pageReqVO, Long customerId);
|
||||
|
||||
void updateSaleOrderBillStatus(List<Long> ids, String status);
|
||||
void updateSaleOrderBillStatus(List<Long> ids, String status,Map<String,Object> params);
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ import org.thymeleaf.TemplateEngine;
|
|||
import org.thymeleaf.context.Context;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -283,25 +283,23 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Long> getTabsCount(Long customerId) {
|
||||
public Map<String, Long> getTabsCount(SaleOrderPageReqVO pageReqVO, Long customerId) {
|
||||
Map<String, Long> counts = Maps.newLinkedHashMapWithExpectedSize(3);
|
||||
|
||||
LambdaQueryWrapper<SaleOrderDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SaleOrderDO::getBillStatus, BillStatusEnum.SUBMIT.getValue());
|
||||
SaleOrderPageReqVO pageReqVO0 = ObjectUtil.clone(pageReqVO);
|
||||
pageReqVO0.setBillStatus(BillStatusEnum.SUBMIT.getValue());
|
||||
if (customerId != null) {
|
||||
lambdaQueryWrapper.eq(SaleOrderDO::getCustomerId, customerId);
|
||||
pageReqVO0.setCustomerId(customerId);
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<SaleOrderDO> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper1.eq(SaleOrderDO::getBillStatus, BillStatusEnum.AUDIT.getValue());
|
||||
SaleOrderPageReqVO pageReqVO1 = ObjectUtil.clone(pageReqVO);
|
||||
pageReqVO1.setBillStatus(BillStatusEnum.AUDIT.getValue());
|
||||
if (customerId != null) {
|
||||
lambdaQueryWrapper1.eq(SaleOrderDO::getCustomerId, customerId);
|
||||
pageReqVO1.setCustomerId(customerId);
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<SaleOrderDO> lambdaQueryWrapper2 = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper2.eq(SaleOrderDO::getBillStatus, BillStatusEnum.YPLAN.getValue());
|
||||
SaleOrderPageReqVO pageReqVO2 = ObjectUtil.clone(pageReqVO);
|
||||
pageReqVO2.setBillStatus(BillStatusEnum.YPLAN.getValue());
|
||||
if (customerId != null) {
|
||||
lambdaQueryWrapper2.eq(SaleOrderDO::getCustomerId, customerId);
|
||||
pageReqVO2.setCustomerId(customerId);
|
||||
}
|
||||
|
||||
/* LambdaQueryWrapper<SaleOrderDO> lambdaQueryWrapper2 = new LambdaQueryWrapper<>();
|
||||
|
|
@ -310,14 +308,31 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
lambdaQueryWrapper2.eq(SaleOrderDO::getCustomerId, customerId);
|
||||
}*/
|
||||
counts.put("All", 0L);
|
||||
// 查询已下单订单数量
|
||||
counts.put(BillStatusEnum.SUBMIT.getValue(),
|
||||
saleOrderMapper.selectCount(lambdaQueryWrapper));
|
||||
// 查询已生产订单数量
|
||||
counts.put(BillStatusEnum.AUDIT.getValue(),
|
||||
saleOrderMapper.selectCount(lambdaQueryWrapper1));
|
||||
// 查询已排产订单数量
|
||||
counts.put(BillStatusEnum.YPLAN.getValue(), saleOrderMapper.selectCount(lambdaQueryWrapper2));
|
||||
if(StringUtils.isBlank(pageReqVO.getBillStatus())) {
|
||||
// 查询已下单订单数量
|
||||
counts.put(BillStatusEnum.SUBMIT.getValue(), saleOrderMapper.selectTabCount(pageReqVO0));
|
||||
// 查询已生产订单数量
|
||||
counts.put(BillStatusEnum.AUDIT.getValue(), saleOrderMapper.selectTabCount(pageReqVO1));
|
||||
// 查询已排产订单数量
|
||||
counts.put(BillStatusEnum.YPLAN.getValue(), saleOrderMapper.selectTabCount(pageReqVO2));
|
||||
}else {
|
||||
Long tabCount = saleOrderMapper.selectTabCount(pageReqVO);
|
||||
if(BillStatusEnum.SUBMIT.getValue().equals(pageReqVO.getBillStatus())){
|
||||
counts.put(BillStatusEnum.SUBMIT.getValue(),tabCount);
|
||||
}else {
|
||||
counts.put(BillStatusEnum.SUBMIT.getValue(), 0L);
|
||||
}
|
||||
if(BillStatusEnum.AUDIT.getValue().equals(pageReqVO.getBillStatus())){
|
||||
counts.put(BillStatusEnum.AUDIT.getValue(),tabCount);
|
||||
}else {
|
||||
counts.put(BillStatusEnum.AUDIT.getValue(), 0L);
|
||||
}
|
||||
if(BillStatusEnum.YPLAN.getValue().equals(pageReqVO.getBillStatus())){
|
||||
counts.put(BillStatusEnum.YPLAN.getValue(),tabCount);
|
||||
}else {
|
||||
counts.put(BillStatusEnum.YPLAN.getValue(), 0L);
|
||||
}
|
||||
}
|
||||
// 查询已完成订单数量
|
||||
counts.put(BillStatusEnum.COMPLETED.getValue(), 0L);
|
||||
return counts;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
|
||||
<select id="selectPageV2" resultType="cn.hangtag.module.oms.dal.dataobject.saleorder.SaleOrderDO">
|
||||
select a.* from oms_saleorder a
|
||||
select DISTINCT a.* from oms_saleorder a
|
||||
left join oms_saleorder_entry b on a.id = b.parent_id
|
||||
left join oms_customer cus on cus.id = a.customer_id
|
||||
left join oms_brand brand on brand.id = a.brand_id
|
||||
|
|
@ -26,6 +26,26 @@
|
|||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectTabCount" resultType="Long">
|
||||
select count(DISTINCT a.id) from oms_saleorder a
|
||||
left join oms_saleorder_entry b on a.id = b.parent_id
|
||||
left join oms_customer cus on cus.id = a.customer_id
|
||||
left join oms_brand brand on brand.id = a.brand_id
|
||||
<where>
|
||||
<if test="reqVO.billno != null and reqVO.billno != '' "> AND a.billno = #{reqVO.billno} </if>
|
||||
<if test="reqVO.customerId != null "> AND a.customer_id = #{reqVO.customerId} </if>
|
||||
<if test="reqVO.bizdate != null "> AND a.bizdate between #{reqVO.bizdate[0]} AND #{reqVO.bizdate[1]}</if>
|
||||
<if test="reqVO.confirmdate != null "> AND a.confirmdate between #{reqVO.confirmdate[0]} AND #{reqVO.confirmdate[1}</if>
|
||||
<if test="reqVO.plansenddate != null "> AND a.plansenddate between #{reqVO.plansenddate[0]} AND #{reqVO.plansenddate[1}</if>
|
||||
<if test="reqVO.phone != null and reqVO.phone != '' "> AND a.phone = #{reqVO.phone} </if>
|
||||
<if test="reqVO.remarks != null and reqVO.remarks != '' "> AND a.remarks = #{reqVO.remarks} </if>
|
||||
<if test="reqVO.billStatus != null and reqVO.billStatus != '' "> AND a.bill_status = #{reqVO.billStatus} </if>
|
||||
<if test="reqVO.orderStatus != null and reqVO.orderStatus != '' "> AND a.order_status = #{reqVO.orderStatus} </if>
|
||||
<if test="reqVO.materialName != null and reqVO.materialName != '' "> AND (b.material_number LIKE CONCAT('%',#{reqVO.materialName},'%') OR b.material_name LIKE CONCAT('%',#{reqVO.materialName},'%')) </if>
|
||||
<if test="reqVO.customerName != null and reqVO.customerName != '' "> AND cus.name LIKE CONCAT('%',#{reqVO.customerName},'%') </if>
|
||||
<if test="reqVO.brandName != null and reqVO.brandName != '' "> AND brand.name LIKE CONCAT('%',#{reqVO.brandName},'%') </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOrderQtySummaryByOrderStatusAndCreateTimeBetween"
|
||||
resultType="cn.hangtag.module.oms.controller.admin.trade.vo.TradeOrderSummaryRespVO">
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ export const SaleOrderApi = {
|
|||
},
|
||||
|
||||
// 获得 销售 列表 tabsCount
|
||||
getTabsCount: async () => {
|
||||
return request.get({ url: '/oms/sale-order/get-count' })
|
||||
getTabsCount: async (params: any) => {
|
||||
return request.get({ url: '/oms/sale-order/get-count',params})
|
||||
},
|
||||
|
||||
// 更新订单状态
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ const getList = async () => {
|
|||
|
||||
/** 获得每个 Tab 的数量 */
|
||||
const getTabsCount = async () => {
|
||||
const res = await SaleOrderApi.getTabsCount()
|
||||
const res = await SaleOrderApi.getTabsCount(queryParams)
|
||||
for (let objName in res) {
|
||||
let data = tabsData.value
|
||||
for (let obj in data){
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ export const SaleOrderApi = {
|
|||
},
|
||||
|
||||
// 获得 销售 列表 tabsCount
|
||||
getTabsCount: async () => {
|
||||
return request.get({ url: '/oms/app/sale-order/get-count' })
|
||||
getTabsCount: async (params: any) => {
|
||||
return request.get({ url: '/oms/sale-order/get-count',params})
|
||||
},
|
||||
|
||||
// 更新订单状态
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ const getList = async () => {
|
|||
|
||||
/** 获得每个 Tab 的数量 */
|
||||
const getTabsCount = async () => {
|
||||
const res = await SaleOrderApi.getTabsCount()
|
||||
const res = await SaleOrderApi.getTabsCount(queryParams)
|
||||
for (let objName in res) {
|
||||
let data = tabsData.value
|
||||
for (let obj in data){
|
||||
|
|
|
|||
Loading…
Reference in New Issue