guoyujie
2025-06-11 67ab08691cdd5b505a252c9e3e3df564a2c85186
提交 订单报表模糊查询
7个文件已修改
91 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/BasicTable.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/OrderReport.vue 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderDetailMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderDetailMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/BasicTable.vue
@@ -173,6 +173,17 @@
}
const  getReportData = () => {
  if(props.childrenData.model!=null){
    request.post(`${props.childrenData.url}/${basicProp.value.pageNum}/${basicProp.value.pageSize}/${orderInfo.reportFormDate}/${props.childrenData.model}/${props.childrenData.scope}`,filterData.value).then(res => {
      if(res.code === '200'){
        props.childrenData.data = res.data.data
        basicProp.value.pageTotal = res.data.total.pageTotal
        basicProp.value.dataTotal = res.data.total.total
        orderInfo.reportFormDate = res.data.selectDate
      }
    })
    return
  }
  request.post(`${props.childrenData.url}/${basicProp.value.pageNum}/${basicProp.value.pageSize}/${orderInfo.reportFormDate}`,filterData.value).then(res => {
    if(res.code === '200'){
      props.childrenData.data = res.data.data
@@ -228,7 +239,7 @@
        <template #num1_filter="{ column, $panel }">
          <div>
            <div v-for="(option, index) in column.filters" :key="index">
              <input type="type"
              <input type="text"
                     v-model="option.data"
                     @keyup.enter.native="$panel.confirmFilter()"
                     @input="changeFilterEvent($event, option, $panel)"/>
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
@@ -148,7 +148,7 @@
  {
    tid: '此面为室内面', title: '此面为室内面', data: '', type: 'text',
    options: {
      field: '',
      title: '此面为室内面',
      testData: '',
      width:100,
      height: 16,
@@ -160,7 +160,7 @@
  {
    tid: '此面为室外面', title: '此面为室外面', data: '', type: 'text',
    options: {
      field: '',
      title: '此面为室外面',
      testData: '',
      width:100,
      height: 16,
@@ -597,7 +597,7 @@
  {
    tid: 'custom1', title: '自定义1', data: '', type: 'text',
    options: {
      field: '',
      title: '自定义1',
      testData: '',
      width:270,
      height: 16,
@@ -609,7 +609,7 @@
  {
    tid: 'custom2', title: '自定义2', data: '', type: 'text',
    options: {
      field: '',
      title: '自定义2',
      testData: '',
      width:270,
      height: 16,
@@ -621,7 +621,7 @@
  {
    tid: 'custom3', title: '自定义3', data: '', type: 'text',
    options: {
      field: '',
      title: '自定义3',
      testData: '',
      width:270,
      height: 16,
@@ -633,7 +633,7 @@
  {
    tid: 'custom4', title: '自定义4', data: '', type: 'text',
    options: {
      field: 'custom4',
      title: '自定义4',
      testData: '',
      width:270,
      height: 16,
@@ -645,7 +645,7 @@
  {
    tid: 'custom5', title: '自定义5', data: '', type: 'text',
    options: {
      field: 'custom4',
      title: '自定义5',
      testData: '',
      width:270,
      height: 16,
@@ -738,7 +738,7 @@
  TgaStyleSet.value.forEach(item => {
    let para = {
      text: item.title,
      field: item.options.field
      field: item.options.field || item.options.title
    }
    list.push(para)
  })
@@ -941,8 +941,6 @@
const printOrder = (type) => {
  const list = hiprintTemplate.value.getJson()
  console.log(list)
  list.panels[0].printElements.forEach(element => {
    element.options.fontFamily = 'Arial'
    if(element.printElementType.title!==''){
north-glass-erp/northglass-erp/src/views/sd/order/OrderReport.vue
@@ -52,9 +52,14 @@
  url :'/order/getOrderReport',
  exportUrl :'/order/exportOrderReport',
  exportName:t('order.orderDetailsReport'),
  footList:['quantity','grossArea','computeGrossArea','perimeter','price','grossAmount','weight']
})
  footList:['quantity','grossArea','computeGrossArea','perimeter','price','grossAmount','weight'],
  model:0,//0:精确查询 1:模糊查询
  scope:10
})
const changeModel = () => {
  childrenData.value.model = childrenData.value.model === 0 ? 1 : 0
}
</script>
@@ -62,8 +67,17 @@
  <basic-table
      :childrenData="childrenData">
    <template #buttons>
      <el-button>模糊模式</el-button>
      <el-input style="width: 100px" :value="10" :disabled="true"/>
      <el-button
          @click="changeModel"
          type="primary"
      >
        {{childrenData.model === 0 ? '精确模式' : '模糊模式'}}</el-button>
      <el-input
          v-model="childrenData.scope"
          type="number"
          v-show="childrenData.model===1"
          style="width: 140px;margin-left: 5px"
           placeholder="玻璃尺寸范围"/>
    </template>
  </basic-table>
north-glass-erp/src/main/java/com/example/erp/controller/sd/OrderController.java
@@ -141,12 +141,14 @@
    @SaCheckPermission("orderReport.search")
    @ApiOperation("查询订单报表")
    @PostMapping("/getOrderReport/{pageNum}/{pageSize}/{selectDate}")
    @PostMapping("/getOrderReport/{pageNum}/{pageSize}/{selectDate}/{model}/{scope}")
    public Result getOrderReport(@PathVariable Integer pageNum,
                                 @PathVariable Integer pageSize,
                                 @PathVariable List<String> selectDate,
                                 @PathVariable Integer model,//0:精确查找,1:模糊查询
                                 @PathVariable Integer scope,//模糊范围
                                 @RequestBody OrderDetail orderDetail)  {
        return  Result.seccess(orderService.getOrderReport(pageNum,pageSize,selectDate,orderDetail));
        return  Result.seccess(orderService.getOrderReport(pageNum,pageSize,selectDate,orderDetail,model,scope));
    }
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderDetailMapper.java
@@ -18,7 +18,7 @@
    boolean updateOrderMoney( List<OrderDetail> orderDetails);
    List<OrderDetail> getOrderReport(Integer offset, Integer pageSize, String startDate, String endDate, OrderDetail orderDetail);
    List<OrderDetail> getOrderReport(Integer offset, Integer pageSize, String startDate, String endDate, OrderDetail orderDetail, Integer model, Integer scope);
    //type为了区别需不需要根据产品分类
    Map<String,Integer> getOrderReportTotal(Integer offset, Integer pageSize, String startDate, String endDate, OrderDetail orderDetail, String type);
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -11,7 +11,6 @@
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.example.erp.common.Constants;
import com.example.erp.dto.sd.OrderDTO;
import com.example.erp.dto.sd.OrderDetailProductDTO;
import com.example.erp.dto.sd.OrderSearchDTO;
import com.example.erp.entity.sd.*;
import com.example.erp.entity.userInfo.Log;
@@ -22,20 +21,16 @@
import com.example.erp.mapper.sd.*;
import com.example.erp.service.userInfo.LogService;
import com.example.erp.service.userInfo.SysErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.SQLOutput;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.util.stream.Collectors;
import static org.apache.coyote.http11.Constants.a;
@Service
@DS("sd")
@@ -545,7 +540,7 @@
    }
    public Map<String,Object> getOrderReport(Integer pageNum, Integer pageSize, List<String> selectDate, OrderDetail orderDetail) {
    public Map<String,Object> getOrderReport(Integer pageNum, Integer pageSize, List<String> selectDate, OrderDetail orderDetail, Integer model, Integer scope) {
        Integer offset = (pageNum-1)*pageSize;
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
@@ -557,9 +552,8 @@
                endDate = selectDate.get(1);
            }
        }
        Map<String,Object> map = new HashMap<>();
        map.put("data",orderDetailMapper.getOrderReport(offset, pageSize, startDate, endDate, orderDetail));
        map.put("data",orderDetailMapper.getOrderReport(offset, pageSize, startDate, endDate, orderDetail,model,scope));
        map.put("total",orderDetailMapper.getOrderReportTotal(offset, pageSize, startDate, endDate, orderDetail,"order"));
        List<String> list = new ArrayList<>();
        list.add(startDate);
north-glass-erp/src/main/resources/mapper/sd/OrderDetailMapper.xml
@@ -316,14 +316,30 @@
            and a.order_number like concat('%',#{orderDetail.orderNumber},'%')
        </if>
        <if test="orderDetail.width != null and orderDetail.width != ''">
        <if test="orderDetail.width != null and orderDetail.width != '' and model==0">
            and a.width regexp REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
        </if>
        <if test="orderDetail.height != null and orderDetail.height != ''">
        <if test="orderDetail.height != null and orderDetail.height != '' and model==0 ">
            and a.height regexp REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
        </if>
        <if test="orderDetail.width != null and orderDetail.width != '' and model==1">
            and a.width >= REGEXP_REPLACE(#{orderDetail.width } - #{scope} ,'\\.0+$','')
            and a.width &lt;= REGEXP_REPLACE(#{orderDetail.width } + #{scope} ,'\\.0+$','')
        </if>
        <if test="orderDetail.height != null and orderDetail.height != '' and model==1 ">
            and a.height > REGEXP_REPLACE(#{orderDetail.height } - #{scope} ,'\\.0+$','')
            and a.height &lt; REGEXP_REPLACE(#{orderDetail.height } + #{scope} ,'\\.0+$','')
        </if>
        <if test="orderDetail.quantity != null and orderDetail.quantity != ''">
            and a.quantity like concat('%',#{orderDetail.quantity},'%')
        </if>