This commit is contained in:
parent
aa4cbdfe47
commit
651fe9b938
|
|
@ -257,7 +257,19 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
saleOrderMapper.selectPageV2(page,pageReqVO);
|
||||
PageResult<SaleOrderDO> saleOrderDOPageResult = new PageResult<>(page.getRecords(), page.getTotal());
|
||||
saleOrderDOPageResult.setOtherMap(MapUtil.of("querySumTotalQty",BigDecimal.ZERO));
|
||||
if(!StringUtils.isAllBlank(pageReqVO.getCustomerName(),pageReqVO.getBrandName(),pageReqVO.getMaterialName())){
|
||||
if(
|
||||
StringUtils.isNotBlank(pageReqVO.getBillno())
|
||||
||StringUtils.isNotBlank(pageReqVO.getBillStatus())
|
||||
||StringUtils.isNotBlank(pageReqVO.getPhone())
|
||||
||StringUtils.isNotBlank(pageReqVO.getRemarks())
|
||||
||ObjectUtil.isNotEmpty(pageReqVO.getBizdate())
|
||||
||ObjectUtil.isNotEmpty(pageReqVO.getPlansenddate())
|
||||
||ObjectUtil.isNotEmpty(pageReqVO.getConfirmdate())
|
||||
||StringUtils.isNotBlank(pageReqVO.getOrderStatus())
|
||||
||StringUtils.isNotBlank(pageReqVO.getCustomerName())
|
||||
||StringUtils.isNotBlank(pageReqVO.getBrandName())
|
||||
||StringUtils.isNotBlank(pageReqVO.getMaterialName())
|
||||
){
|
||||
long sumTotalQty = saleOrderMapper.querySumTotalQty(pageReqVO);
|
||||
saleOrderDOPageResult.setOtherMap(MapUtil.of("querySumTotalQty",sumTotalQty));
|
||||
}
|
||||
|
|
@ -863,7 +875,7 @@ public class SaleOrderServiceImpl implements SaleOrderService {
|
|||
saleOrderMapper.insert(order);
|
||||
saleOrderEntryMapper.insertBatch(entryList);
|
||||
skuOrderSkuMapper.insertBatch(skuList);
|
||||
|
||||
saleOrderMapper.updateSumQtyOrAmount(Collections.singletonList(order.getId()));
|
||||
updateCustomerInvoiceData(order);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -93,15 +93,24 @@
|
|||
|
||||
|
||||
<select id="querySumTotalQty" resultType="Long" >
|
||||
select sum(a.total_qty) from oms_saleorder a
|
||||
select sum(b.qty) 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.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>
|
||||
<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>
|
||||
|
||||
<update id="updateSumQtyOrAmount" parameterType="Long">
|
||||
|
|
|
|||
|
|
@ -35,10 +35,10 @@
|
|||
class="!w-240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="materialName">
|
||||
<el-form-item label="物料" prop="materialName">
|
||||
<el-input
|
||||
v-model="queryParams.materialName"
|
||||
placeholder="请输入物料编码/名称"
|
||||
placeholder="可按物料编码或名称进行搜索"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
|
|
@ -336,7 +336,7 @@
|
|||
@pagination="getList"
|
||||
/>
|
||||
<br/>
|
||||
<h2 v-if="querySumTotalQtyOpen">条件查询汇总订单数量:{{querySumTotalQty}}</h2>
|
||||
<h2 v-if="querySumTotalQtyOpen">查询条件汇总订单数量:{{querySumTotalQty}} PCS</h2>
|
||||
</ContentWrap>
|
||||
|
||||
<!-- 表单弹窗:添加/修改 -->
|
||||
|
|
@ -432,6 +432,7 @@ const tabsData = ref([
|
|||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
isOpenQuery: 0,
|
||||
billno: undefined,
|
||||
customerId: undefined,
|
||||
customerName: undefined,
|
||||
|
|
@ -476,9 +477,22 @@ const getList = async () => {
|
|||
const data = await SaleOrderApi.getSaleOrderPage(queryParams)
|
||||
list.value = data.list
|
||||
total.value = data.total
|
||||
if((queryParams.customerName && queryParams.customerName.trim().length>0) || (queryParams.brandName && queryParams.brandName.trim().length>0) || (queryParams.materialName && queryParams.materialName.trim().length>0)){
|
||||
if(
|
||||
(queryParams.billno && queryParams.billno.trim().length>0)
|
||||
|| (queryParams.customerName && queryParams.customerName.trim().length>0)
|
||||
|| (queryParams.brandName && queryParams.brandName.trim().length>0)
|
||||
|| (queryParams.materialName && queryParams.materialName.trim().length>0)
|
||||
|| (queryParams.phone && queryParams.phone.trim().length>0)
|
||||
|| (queryParams.remarks && queryParams.remarks.trim().length>0)
|
||||
|| (queryParams.bizdate && queryParams.bizdate.trim().length>0)
|
||||
|| (queryParams.confirmdate && queryParams.confirmdate.trim().length>0)
|
||||
|| (queryParams.plansenddate && queryParams.plansenddate.trim().length>0)
|
||||
){
|
||||
querySumTotalQtyOpen.value = true
|
||||
querySumTotalQty.value = data.otherMap['querySumTotalQty']
|
||||
}else {
|
||||
querySumTotalQtyOpen.value = false
|
||||
querySumTotalQty.value = 0
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
|
|
@ -504,6 +518,7 @@ const getTabsCount = async () => {
|
|||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.pageNo = 1
|
||||
queryParams.isOpenQuery = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue