guoyuji
2024-04-19 5314634fbbe6fd099d9b134614dba450cba2b5b9
Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
18个文件已修改
2个文件已添加
1606 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/router/index.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomerOrder.vue 345 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue 414 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryDetailMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java 267 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/Customer.xml 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/Delivery.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/Customer.xml 156 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/Delivery.xml 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/router/index.js
@@ -132,6 +132,11 @@
              name: 'createDelivery',
              component: () => import('../views/sd/delivery/CreateDelivery.vue'),
            },
            {
              path: 'deliveryPrinting',
              name: 'deliveryPrinting',
              component: () => import('../views/sd/delivery/DeliveryPrinting.vue'),
            },
            {
@@ -192,6 +197,11 @@
              path: 'createCustomer',
              name: 'createCustomer',
              component: () => import('../views/sd/customer/CreateCustomer.vue'),
            },
            {
              path: 'selectCustomerOrder',
              name: 'selectCustomerOrder',
              component: () => import('../views/sd/customer/SelectCustomerOrder.vue'),
            }
          ]
        },
north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue
@@ -734,9 +734,9 @@
            </el-select>
        </el-row>
      </div>
      <div class="main-div-customers">
      <div class="main-div-customers" style="height: 350px">
        <vxe-grid
            height="400px"
            height="100%"
            class="mytable-scrollbar"
            ref="xGrids"
            v-bind="gridOption"
north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
@@ -151,7 +151,7 @@
    // }],
    // import: false,
    // export: true,
    // print: true,
     print: true,
    zoom: true,
    custom: true
  },
north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue
@@ -24,6 +24,11 @@
      router.push({path: '/main/customer/CreateCustomer', query: { id: row.id }})
      break
    }
    case 'customerOrder' :{
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/customer/selectCustomerOrder', query: { id: row.id }})
      break
    }
    case 'delete':{
      let ruleForm = ref({
        id:0,
@@ -189,7 +194,7 @@
  columns:[
          {type:'expand',fixed:"left",slots: { content:'content' },width: 60},
          {type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 },
          {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left"},
          {title: t('basicData.operate'), width: 180, slots: { default: 'button_slot' },fixed:"left"},
          {field: 'id', title: t('customer.customerNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
          {field: 'customerName', title: t('customer.customerName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
          {field: 'grade', title: t('customer.customerGrade'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
@@ -250,6 +255,7 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
        <el-button @click="getTableRow(row,'customerOrder')" link type="primary" size="small">客户订单</el-button>
        <el-popconfirm @confirm="getTableRow(row,'delete')" title="确定删除?">
          <template #reference>
            <el-button  link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomerOrder.vue
New file
@@ -0,0 +1,345 @@
<script setup>
import {Search} from "@element-plus/icons-vue"
import {useRoute, useRouter} from "vue-router"
import {onMounted, reactive, ref} from "vue";
import request from "@/utils/request"
import deepClone from "@/utils/deepClone"
import VXETable from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
import {ElMessage} from "element-plus";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
const router = useRouter()
const route = useRoute()
const userStore = useUserInfoStore()
const username = userStore.user.userName
const userid = userStore.user.userId
let produceList = ref([])
const getTableRow = (row,type) =>{
  switch (type) {
  }
}
const hasDecimal=(value)=>{
  const regex=/\./ // 定义正则表达式,查找小数点
  return regex.test(value) //返回true/false
}
const hasDecimalhtml=(item,row)=>{
  let aa=item.split('.').length
  if (aa===2){
    return row[item.split('.')[0]][item.split('.')[1]]
  }else if(aa===3){
    return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]]
  }
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
    order:{
      customerId:''
    }
})
let selectDate = ref(["",""])
let pageNum=ref(1)
let total = reactive({
  pageTotal : 0,
  dataTotal : 0,
  pageSize : 100
})
onMounted(()=>{
  //获取传过来的数据进行判断
  const str = route.query.id
  if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){
    filterData.value.order.customerId = Number(str)
    request.post(`/customer/getSelectCustomerOderDate/1/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
      if(res.code==200){
        console.log(res.data.data)
        total.dataTotal = res.data.total.total*1
        total.pageTotal= res.data.total.pageTotal
        selectDate.value = res.data.selectDate
        pageNum.value=1
        produceList = deepClone(res.data.data)
        xGrid.value.loadData(produceList)
        gridOptions.loading=false
      }else{
        ElMessage.warning(res.msg)
        router.push("/login")
      }
    })
  }
})
const changeFilterEvent = (event, option, $panel,) => {
  // 手动触发筛选
  $panel.changeOption(event, !!option.data, option)
}
function filterChanged(column){
  gridOptions.loading=true
  //筛选条件发生变化条件发生变化
  let value = column.datas[0]!=undefined?column.datas[0]:''
  value = value.trim()
  //判断是否存在外键
  if (column.property.indexOf('.')>-1){
    const  columnArr = column.property.split('.')
    filterData.value[columnArr[0]] = {
      [columnArr[1]]:value
    }
  }else{
    filterData.value[column.property] = value
  }
  request.post(`/customer/getSelectCustomerOderDate/1/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
    if(res.code==200){
      total.dataTotal = res.data.total.total*1
      total.pageTotal= res.data.total.pageTotal
      selectDate.value = res.data.selectDate
      pageNum.value=1
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
    }
  })
}
const selectOrderList = ()=>{
  request.post(`/customer/getSelectCustomerOderDate/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
    if(res.code==200){
      if (res.data.total!=null){
        total.dataTotal = res.data.total.total*1
        total.pageTotal= res.data.total.pageTotal
      }
      produceList = deepClone(res.data.data)
      xGrid.value.loadData(produceList)
      gridOptions.loading=false
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
    }
  })
}
const changeDate =  ()=>{
  pageNum.value=1
  selectOrderList()
}
//页脚跳转
const handlePageChange = ({ currentPage, pageSize }) => {
  total.pageTotal = pageSize
  pageNum.value=currentPage
  selectOrderList()
}
const xGrid = ref()
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'OrderList',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
  exportConfig: {},
  scrollY:{ enabled: true },//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
  filterConfig: {   //筛选配置项
    remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  columns:[
    {type:'expand',slots: { content:'content' },width: 60,fixed:"left"},
    {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left"},
    {field: 'orderId',width:120,  title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.customerId',width:120,  title: t('customer.customerNumber')},
    {field: 'order.customerName',width:120,  title: t('customer.customerName')},
    {field: 'quantity',width:120,  title: t('order.quantity')},
    {field: 'productId',width:120,  title: "产品编号",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'productName',width:120,  title: "产品名称",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'shape',width:120,  title: "形状",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'width',width:120,  title: "宽度",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'height',width:120,  title: "高度",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.project',width:120,  title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.batch',width:120,  title: t('order.batch'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.money',width:120,   title: "订单金额",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'area',width:120,  title: t('productStock.totalArea')},
    {field: 'order.orderType',width:120,  title: t('order.orderType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.salesman',width:120,  title:t('order.salesman'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'order.createTime',width:120,  title:"创建时间"},
  ],//表头按钮
  toolbarConfig: {
    buttons: [
    ],
    /*import: false,
   export: true,
   print: true,*/
    zoom: true,
    custom: true
  },
  footerMethod ({ columns, data }) {//页脚函数
    let footList = ['quantity','area']
    return[
      columns.map((column, columnIndex) => {
        if (columnIndex === 0) {
          return t('basicData.total')
        }
        if (footList.includes(column.field)) {
          return sumNum(data, column.field)
        }
        return ''
      })
    ]
  }
})
//表尾求和
const sumNum = (list, field) => {
  let count = 0
  list.forEach(item => {
    count += Number(item[field])
  })
  return count.toFixed(2)
}
const gridEvents = {
  toolbarButtonClick ({ code }) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
      }
    }
  }
}
//数组数据验重
function isAllEqual(array){
  if(array.length>0){
    return !array.some(function(value,index){
      return value !== array[0];
    });
  }else{
    return true;
  }
}
</script>
<template>
  <div  style="width: 100%;height: 100%">
    <el-date-picker
        v-model="selectDate"
        type="daterange"
        start-placeholder="开始时间"
        end-placeholder="结束时间"
        format="YYYY-MM-DD"
        value-format="YYYY-MM-DD"
    />
    <el-button @click="changeDate" style="margin-top: -5px"  id="searchButton" type="primary" :icon="Search">{{$t('basicData.search')}}</el-button>
    <vxe-grid
        max-height="97%"
        class="mytable-scrollbar"
        @filter-change="filterChanged"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row }">
        <ul class="expand-wrapper">
          <li  v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined ">
            <span style="font-weight: bold">{{item.title+':  '}}</span>
            <span>{{ row[item.field] }}</span>
          </li>
        </ul>
      </template>
      <template #state="{ row,column}">
        <el-checkbox @click.native.prevent :indeterminate="row[column.field]===1" :checked="row[column.field]===2"/>
      </template>
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</el-button>
      </template>
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
          </div>
        </div>
      </template>
      <template #pager>
        <!--使用 pager 插槽-->
        <vxe-pager
            @page-change="handlePageChange"
            :layouts="[  'PrevPage', 'Jump','PageCount', 'NextPage',  'Total']"
            v-model:current-page="pageNum"
            v-model:page-size="total.pageSize"
            v-model:pager-count="total.pageTotal"
            :total="total.dataTotal"
        >
        </vxe-pager>
      </template>
    </vxe-grid>
  </div>
</template>
<style scoped>
</style>
north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue
New file
@@ -0,0 +1,414 @@
<script setup>
import request from "@/utils/request"
import {ElDatePicker, ElMessage} from "element-plus"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {Search} from "@element-plus/icons-vue"
import {useRoute, useRouter} from "vue-router"
import {changeFilterEvent, filterChanged} from "@/hook"
import { useI18n } from 'vue-i18n'
import deepClone from "@/utils/deepClone";
//语言获取
const { t } = useI18n()
let router=useRouter()
const route = useRoute()
let produceList = ref([])
let delivery = ref([])
let money = ref("")
let takeCare = "注意:请妥善保管好我司的玻璃架,如有丢失或损坏,按1500元只赔偿。谢谢配合!"
let remark = "备注:本批玻璃为优等合格品,请在卸货时,当面消点验收、如有质量问题在一周内与本公司联系,否则概不负责!"
let props = defineProps({
  deliveryId:null
})
const form = ref({
})
const Printing =  ()=>{
  // 需要打印的局部区域赋予"print-wrap"的id
  let el = document.getElementById("pis");
  let doc = document;
  let body = doc.body || doc.getElementsByTagName("body")[0];
  let printId = "print-" + Date.now();
  // 创建无副作用的打印容器(因不确定页面的打印元素有无其它样式)
  let content = doc.createElement("div");
  content.id = printId;
  // 样式控制与打印无关的元素隐藏
  let style = doc.createElement("style");
  style.innerHTML =
      "body>#" +
      printId +
      "{display:none}@media print{body>:not(#" +
      printId +
      "){display:none !important}body>#" +
      printId +
      "{display:block;padding-top:1px}}";
  content.innerHTML = el.outerHTML;
  // console.log("el.outerHTML", el.outerHTML);
  body.appendChild(style);
  // 与style元素设置的样式相配合
  // 把打印内容的元素添加到body(作为body的子元素,可用body的子选择器 '>' 控制打印样式)
  body.appendChild(content);
  setTimeout(() => {
    window.print();
    body.removeChild(content);
    body.removeChild(style);
  }, 20);
}
onMounted(()=>{
  console.log(props.deliveryId)
  /*if(props.deliveryId===null  || props.deliveryId===undefined || props.deliveryId===''){
    return
  }
  form.value.deliveryId = props.deliveryId*/
  if(route.query.deliveryID===null  || route.query.deliveryID===undefined || route.query.deliveryID===''){
    return
  }
  form.value.deliveryId=route.query.deliveryID
  request.post(`/Delivery/getSelectDeliveryPrinting`,form.value).then((res) => {
    if(res.code==200){
      produceList.value = deepClone(res.data.data)
      delivery.value=deepClone(res.data.delivery)
      money.value=deepClone(res.data.money)
    }else{
      ElMessage.warning(res.msg)
      router.push("/login")
    }
  })
})
setTimeout(function(){
  Printing()
}, 1000);
</script>
<template>
  <div>
    <el-button @click="Printing" style="margin-top: -5px"  id="searchButton" type="primary" >打印</el-button>
    <div id="pis" style="width: 100%;height: 100%">
      <div style="font-size: 30px;text-align: center;font-weight: bold;">常州市吉利玻璃有限公司</div>
      <el-row :gutter="20">
        <el-col :span="7"><div></div></el-col>
        <el-col :span="10"><div style="font-size: 25px;text-align: center;font-weight: bold;">销售发货单</div></el-col>
        <el-col :span="7">
          <div style="display: flex;margin-top: 10px">
            <div style="font-weight: bold;font-size: 15px">发货单号:</div>
            <div style="font-weight: bold;font-size: 15px">{{delivery.deliveryId}}</div>
          </div>
        </el-col>
      </el-row>
      <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
        <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
          <tr>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">客户名称:<span>{{delivery.customerName}}</span></th>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">项目名称:<span>{{delivery.project}}</span></th>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">联系人:<span>{{delivery.contacts}}</span></th>
          </tr>
          <tr>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="6">送货地址:<span>{{delivery.deliveryAddress}}</span></th>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">联系电话:<span>{{delivery.contactNumber}}</span></th>
          </tr>
          <tr>
            <th style="width: 6%;font-size: 15px;font-weight: bold;">序号</th>
            <th style="width: 20%;font-size: 15px;font-weight: bold;">楼层编号</th>
            <th style="width: 20%;font-size: 15px;font-weight: bold;">宽(弧度)*高</th>
            <th style="width: 10%;font-size: 15px;font-weight: bold;">数量</th>
            <th style="width: 10%;font-size: 15px;font-weight: bold;">面积</th>
            <th style="width: 10%;font-size: 15px;font-weight: bold;">单价</th>
            <th style="width: 12%;font-size: 15px;font-weight: bold;">金额</th>
            <th style="width: 12%;font-size: 15px;font-weight: bold;">加工要求</th>
          </tr>
          <template v-for="(item, index) in produceList" :key="index" >
            <tr>
              <td style="font-size: 15px;font-weight: bold;" colspan="3">产品名称:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
              <td style="font-size: 15px;font-weight: bold;" colspan="3">对方单号:</td>
              <td style="font-size: 15px;font-weight: bold;" colspan="2">订单编号:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td>
            </tr>
            <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
              <td>{{items.order_number}}</td>
              <td>{{items.buildingNumber}}</td>
              <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
              <td>{{items.quantity}}</td>
              <td>{{items.area}}</td>
              <td>{{items.price}}</td>
              <td>{{items.money}}</td>
              <td>{{items.processingNote}}</td>
            </tr>
            <tr class="day-in">
              <td style="font-size: 15px;font-weight: bold;" colspan="3">小计:</td>
              <td>{{item.DeliveryDetail.quantity}}</td>
              <td>{{item.DeliveryDetail.area}}</td>
              <td></td>
              <td>{{item.DeliveryDetail.money}}</td>
              <td></td>
            </tr>
          </template>
          <tr class="day-in">
            <td style="font-size: 15px;font-weight: bold;" colspan="3">合计:</td>
            <td>{{delivery.quantity}}</td>
            <td>{{delivery.area}}</td>
            <td></td>
            <td>{{delivery.money}}</td>
            <td></td>
          </tr>
          <tr class="day-in">
            <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3">
              <div style="display: flex;font-size: 10px;">
                <div>加工费用</div>
                <div  style="margin-left: 20%">单价</div>
                <div  style="margin-left: 20%">数量</div>
                <div  style="margin-left: 20%">金额</div>
              </div>
            </td>
            <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">总金额:&nbsp;&nbsp;&nbsp;&nbsp;{{delivery.money}}</td>
          </tr>
          <tr class="day-in">
            <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td>
            <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">大写金额:&nbsp;&nbsp;&nbsp;&nbsp;{{money}}</td>
          </tr>
        </table>
      </div>
      <el-row :gutter="20">
        <el-col :span="3"><div class="bottom">制单员:<span style="font-size: 10px">{{delivery.creator}}</span></div></el-col>
        <el-col :span="5"><div class="bottom">制单日期:<span style="font-size: 10px">{{delivery.createTime}}</span></div></el-col>
        <el-col :span="4"><div class="bottom">发货员:</div></el-col>
        <el-col :span="4"><div class="bottom">司机:</div></el-col>
        <el-col :span="4"><div class="bottom">客户签字:</div></el-col>
        <el-col :span="4"><div class="bottom">签收日期:</div></el-col>
      </el-row>
      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :span="3"><div class="bottom">架子&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;只</div></el-col>
        <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col>
      </el-row>
      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
      </el-row>
    </div>
  </div>
</template>
<style>
@media print{
  @page {
    mso-header:none;
    margin: 10mm 16mm;
    margin-bottom: 8mm;
    margin-top:8mm;
  }
}
#table1 tr{
  height: 30px;
}
#table1 th{
  height: 30px;
  border: 1px solid #d3dce6;
  border-collapse: collapse;
}
.day-in td{
text-align: center;
}
#table1 td{
  border: 1px solid #d3dce6;
  border-collapse: collapse;
}
#deliveryPrinting .el-dialog__header{
  visibility:hidden
}
.el-overlay-dialog{
  overflow-y: scroll;
}
::-webkit-scrollbar {
  display: none;
}
.bottom{
  font-size: 10px;
  font-weight: bold;
}
</style>
<!--
<template>
  <div>
    <div id="pis" style="width: 100%;height: 100%">
      <div style="font-size: 35px;text-align: center;font-weight: bold;">常州市吉利玻璃有限公司</div>
      <el-row :gutter="20">
        <el-col :span="6"><div></div></el-col>
        <el-col :span="12"><div style="font-size: 30px;text-align: center;font-weight: bold;">销售发货单</div></el-col>
        <el-col :span="6">
          <div style="font-size: 20px;display: flex;margin-top: 10px">
            <div style="font-weight: bold;">发货单号:</div>
            <div style="font-weight: bold;">{{delivery.deliveryId}}</div>
          </div>
        </el-col>
      </el-row>
      <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
        <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
          <tr>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">客户名称:{{delivery.customerName}}</th>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">项目名称:{{delivery.project}}</th>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">联系人:{{delivery.contacts}}</th>
          </tr>
          <tr>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="6">送货地址:{{delivery.deliveryAddress}}</th>
            <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">联系电话:{{delivery.contactNumber}}</th>
          </tr>
          <tr>
            <th style="width: 6%;font-size: 15px;font-weight: bold;">序号</th>
            <th style="width: 20%;font-size: 15px;font-weight: bold;">楼层编号</th>
            <th style="width: 20%;font-size: 15px;font-weight: bold;">宽(弧度)*高</th>
            <th style="width: 10%;font-size: 15px;font-weight: bold;">数量</th>
            <th style="width: 10%;font-size: 15px;font-weight: bold;">面积</th>
            <th style="width: 10%;font-size: 15px;font-weight: bold;">单价</th>
            <th style="width: 12%;font-size: 15px;font-weight: bold;">金额</th>
            <th style="width: 12%;font-size: 15px;font-weight: bold;">加工要求</th>
          </tr>
          <template v-for="(item, index) in produceList" :key="index" >
            <tr>
              <td style="font-size: 15px;font-weight: bold;" colspan="3">产品名称:{{item.DeliveryDetail.orderDetail.productName}}</td>
              <td style="font-size: 15px;font-weight: bold;" colspan="3">对方单号:</td>
              <td style="font-size: 15px;font-weight: bold;" colspan="2">订单编号:{{item.DeliveryDetail.orderDetail.orderId}}</td>
            </tr>
            <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
              <td>{{items.order_number}}</td>
              <td>{{items.buildingNumber}}</td>
              <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
              <td>{{items.quantity}}</td>
              <td>{{items.area}}</td>
              <td>{{items.price}}</td>
              <td>{{items.money}}</td>
              <td>{{items.processingNote}}</td>
            </tr>
            <tr class="day-in">
              <td style="font-size: 15px;font-weight: bold;" colspan="3">小计:</td>
              <td>{{item.DeliveryDetail.quantity}}</td>
              <td>{{item.DeliveryDetail.area}}</td>
              <td></td>
              <td>{{item.DeliveryDetail.money}}</td>
              <td></td>
            </tr>
          </template>
          <tr class="day-in">
            <td style="font-size: 15px;font-weight: bold;" colspan="3">合计:</td>
            <td>{{delivery.quantity}}</td>
            <td>{{delivery.area}}</td>
            <td></td>
            <td>{{delivery.money}}</td>
            <td></td>
          </tr>
          <tr class="day-in">
            <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3">
              <div style="display: flex">
                <div>加工费用</div>
                <div  style="margin-left: 20%">单价</div>
                <div  style="margin-left: 20%">数量</div>
                <div  style="margin-left: 20%">金额</div>
              </div>
            </td>
            <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">总金额:&nbsp;&nbsp;&nbsp;&nbsp;{{delivery.money}}</td>
          </tr>
          <tr class="day-in">
            <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td>
            <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">大写金额:&nbsp;&nbsp;&nbsp;&nbsp;{{money}}</td>
          </tr>
        </table>
      </div>
      <el-row :gutter="20">
        <el-col :span="3"><div class="bottom">制单员:<span style="font-size: 15px">{{delivery.creator}}</span></div></el-col>
        <el-col :span="5"><div class="bottom">制单日期:<span style="font-size: 15px">{{delivery.createTime}}</span></div></el-col>
        <el-col :span="4"><div class="bottom">发货员:</div></el-col>
        <el-col :span="4"><div class="bottom">司机:</div></el-col>
        <el-col :span="4"><div class="bottom">客户签字:</div></el-col>
        <el-col :span="4"><div class="bottom">签收日期:</div></el-col>
      </el-row>
      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :span="3"><div class="bottom">架子&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;只</div></el-col>
        <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col>
      </el-row>
      <el-row :gutter="20" style="margin-top: 20px;">
        <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
      </el-row>
    </div>
  </div>
</template>
<style >
#table1 tr{
  height: 30px;
}
#table1 th{
  height: 30px;
  border: 1px solid #d3dce6;
  border-collapse: collapse;
}
.day-in td{
  text-align: center;
}
#table1 td{
  border: 1px solid #d3dce6;
  border-collapse: collapse;
}
#deliveryPrinting .el-dialog__header{
  visibility:hidden
}
.el-overlay-dialog{
  overflow-y: scroll;
}
::-webkit-scrollbar {
  display: none;
}
.bottom{
  font-size: 20px;
  font-weight: bold;
}
</style>-->
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
@@ -8,6 +8,7 @@
import useUserInfoStore from "@/stores/userInfo";
import {ElMessage} from "element-plus";
import { useI18n } from 'vue-i18n'
import DeliveryPrinting from "@/views/sd/delivery/DeliveryPrinting.vue";
//语言获取
const { t } = useI18n()
@@ -15,11 +16,20 @@
const userStore = useUserInfoStore()
const username = userStore.user.userName
const userid = userStore.user.userId
const dialogTableVisible = ref(false)
let rowClickIndex = ref(null)
let produceList = ref([])
const getTableRow = (row,type) =>{
  switch (type) {
    case 'edit' :{
      router.push({path: '/main/delivery/createDelivery', query: { deliveryID: row.deliveryId }})
      break
    }
    case 'printing' :{
      /*const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
      window.open(url.href, '_blank')
      break*/
      router.push({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
      break
    }
    case 'delete':{
@@ -162,6 +172,29 @@
  selectOrderList()
}
const gridEvents = {
  menuClick ({ menu, row, column }) {
    const $grid = xGrid.value
    if ($grid) {
      switch (menu.code) {
        case 'getProcessList': {
          if(rowClickIndex.value===null){
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
            return
          }
          dialogTableVisible.value = true
          break
        }
      }
    }
  },
  cellClick({ row }){
    rowClickIndex.value = row
  }
}
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
@@ -189,10 +222,20 @@
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  },
  menuConfig: {
    body: {
      options: [
        [
          { code: 'getProcessList', name: "打印", prefixIcon: 'vxe-icon-file-txt', visible: true}
        ]
      ]
    }
  },
  //表头参数
  columns:[
    {type:'expand',slots: { content:'content' },width: 60},
    {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' }},
    {title: t('basicData.operate'), width: 150, slots: { default: 'button_slot' }},
    {type: 'seq', title: t('basicData.Number'), width: 80 },
    {field: 'deliveryState',title: t('basicData.review'), width: 40, slots: { default: 'state' }},
@@ -258,6 +301,7 @@
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <!--      下拉显示所有信息插槽-->
@@ -280,6 +324,7 @@
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
        <el-button @click="getTableRow(row,'printing')" :disabled="row.deliveryState!==2" link type="primary" size="small">打印</el-button>
        <el-popconfirm @confirm="getTableRow(row,'delete')" title="确定删除?">
          <template #reference>
            <el-button  link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
@@ -308,6 +353,16 @@
        </vxe-pager>
      </template>
    </vxe-grid>
    <el-dialog
        v-model="dialogTableVisible"
        destroy-on-close
        id="deliveryPrinting"
        style="width: 100%;height:100%;margin-top: 0; ">
      <DeliveryPrinting
          :deliveryId="rowClickIndex.deliveryId"
          style="width: 100%;height: 100%;" />
    </el-dialog>
  </div>
</template>
north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java
@@ -59,6 +59,12 @@
        }
    }
    @ApiOperation("客户订单查询接口")
    @PostMapping("/getSelectCustomerOderDate/{pageNum}/{pageSize}/{selectDate}")
    public Result getSelectCustomerOderDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody OrderDetail orderDetail){
        return Result.seccess(customerService.getSelectCustomerOderDate(pageNum,pageSize,selectDate,orderDetail));
    }
north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java
@@ -95,6 +95,12 @@
        }
    }
    @ApiOperation("发货订单查询接口")
    @PostMapping("/getSelectDeliveryPrinting")
    public Result getSelectDeliveryPrinting( @RequestBody DeliveryDetail deliveryDetail){
        return Result.seccess(deliveryService.getSelectDeliveryPrinting(deliveryDetail));
    }
north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java
@@ -2,6 +2,8 @@
import com.example.erp.entity.sd.Customer;
import com.example.erp.entity.sd.Delivery;
import com.example.erp.entity.sd.DeliveryDetail;
import com.example.erp.entity.sd.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.repository.CrudRepository;
@@ -25,4 +27,10 @@
    Boolean updateCustomer(@Param("customer") Customer customer);
    Boolean deleteCustomer(@Param("customer") Customer customer);
    List<OrderDetail> getSelectCustomerOderDate(@Param("offset") Integer offset,
                                                    @Param("pageSize") Integer pageSize, String startDate, String endDate,
                                                    @Param("orderDetail") OrderDetail orderDetail);
    Map<String,Integer> getSelectCustomerOderDatePageTotal(Integer offset, Integer pageSize,String startDate, String endDate, OrderDetail orderDetail);
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryDetailMapper.java
@@ -22,6 +22,11 @@
    Integer getSelectShippingOrderDetailPageTotal(Integer offset, Integer pageSize,OrderDetail orderDetail);
    List<DeliveryDetail> getSelectDeliveryPrinting(@Param("deliveryDetail") DeliveryDetail deliveryDetail);
    List <Map<String, Object>> getSelectDeliveryDetailPrinting(@Param("deliveryId") String deliveryId,
                                                         @Param("productId") Integer productId,@Param("orderId") String orderId);
    List<DeliveryDetail> getSelectDeliveryDetailReport(@Param("offset") Integer offset,
                                                      @Param("pageSize") Integer pageSize,String startDate, String endDate,
                                                      @Param("deliveryDetail") DeliveryDetail deliveryDetail);
north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryMapper.java
@@ -23,6 +23,8 @@
                                                             @Param("pageSize") Integer pageSize,
                                                             @Param("orderDetail") OrderDetail orderDetail);
   Delivery getSelectShippingOrderDetailDeliveryPrinting(@Param("deliveryDetail") DeliveryDetail deliveryDetail);
    Order getSelectShippingOrderDetailDeliverys(@Param("offset") Integer offset,
                                                 @Param("pageSize") Integer pageSize,
                                                 @Param("orderDetail") OrderDetail orderDetail);
north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
@@ -97,5 +97,29 @@
    }
    public Map<String, Object> getSelectCustomerOderDate(Integer pageNum, Integer pageSize,List<String> selectDate, OrderDetail orderDetail) {
        Integer offset = (pageNum - 1) * pageSize;
        String endDate = LocalDate.now().toString();
        String startDate = LocalDate.now().minusDays(15).toString();
        if(selectDate !=null && selectDate.size()==2){
            if(!selectDate.get(0).isEmpty()){
                startDate = selectDate.get(0);
            }
            if(!selectDate.get(1).isEmpty()){
                endDate = selectDate.get(1);
            }
        }
        System.out.println(orderDetail);
        System.out.println(orderDetail.getOrder());
        Map<String, Object> map = new HashMap<>();
        map.put("data", customerMapper.getSelectCustomerOderDate(offset, pageSize,startDate,endDate, orderDetail));
        map.put("total", customerMapper.getSelectCustomerOderDatePageTotal(offset, pageSize,startDate,endDate, orderDetail));
        List<String> list = new ArrayList<>();
        list.add(startDate);
        list.add(endDate);
        map.put("selectDate",list);
        return map;
    }
}
north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
@@ -1,5 +1,6 @@
package com.example.erp.service.sd;
import com.alibaba.excel.util.StringUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
@@ -22,6 +23,7 @@
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
import java.math.BigDecimal;
@Service
@DS("sd")
@@ -265,6 +267,271 @@
    }
    public Map<String, Object> getSelectDeliveryPrinting( DeliveryDetail deliveryDetail) {
        Map<String, Object> map = new HashMap<>();
        List <Map<String, Object>> list=new ArrayList<Map<String, Object>>();//最终结果
        List<DeliveryDetail> deliveryDetailList=deliveryDetailMapper.getSelectDeliveryPrinting(deliveryDetail);
        for (DeliveryDetail detail : deliveryDetailList) {
            Map<String, Object> itemmap = new HashMap<>();
            List<Map<String, Object>> deliveryDetailList2 = deliveryDetailMapper.getSelectDeliveryDetailPrinting(detail.getDeliveryId(),
                    detail.getOrderDetail().getProductId(), detail.getOrderDetail().getOrderId());
            itemmap.put("DeliveryDetail", detail);
            itemmap.put("DeliveryDetailList", deliveryDetailList2);
            list.add(itemmap);
        }
        Delivery delivery=deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail);
        map.put("data", list);
        map.put("delivery", deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail));
        map.put("money", toChinese(delivery.getMoney().toString(), false));
        return map;
    }
    private static final String[] NUMBERS = {"零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖"};
    private static final String[] IUNIT = {"元", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟"};
    private static final String[] DUNIT = {"角", "分"};
    private static final String[] CN_NUMBERS = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
    private static final String[] CN_IUNIT = {"", "十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千"};
    /**
     *  转换为大写的中文金额,支持负数
     * @param amount 金额
     * @param isSimplified 是否简体中文:true:简体,false:繁体
     * @return
     */
    public static String toChinese(String amount, boolean isSimplified) {
        // 判断输入的金额字符串是否符合要求
        if (StringUtils.isBlank(amount) || !amount.matches("(-)?[\\d]*(.)?[\\d]*")) {
            throw new RuntimeException("请输入数字");
        }
        if ("0".equals(amount) || "0.00".equals(amount) || "0.0".equals(amount)) {
            return isSimplified ? "零" : "零元";
        }
        // 判断金额数字中是否存在负号"-"
        boolean flag = false;
        if (amount.startsWith("-")) {
            // 标志位,标志此金额数字为负数
            flag = true;
            amount = amount.replaceAll("-", "");
        }
        // 去掉金额数字中的逗号","
        amount = amount.replaceAll(",", "");
        // 初始化:分离整数部分和小数部分
        String[] separateNum = separateNum(amount);
        // 整数部分数字
        String integerStr = separateNum[0];
        // 小数部分数字
        String decimalStr = separateNum[1];
        // beyond超出计算能力,直接返回
        if (integerStr.length() > IUNIT.length) {
            throw new RuntimeException("输入数字超限");
        }
        // 整数部分数字
        int[] integers = toIntArray(integerStr);
        // 判断整数部分是否存在输入012的情况
        if (integers.length > 1 && integers[0] == 0) {
            throw new RuntimeException("输入数字不符合要求");
        }
        // 设置万单位
        boolean isWan = isWan5(integerStr);
        // 小数部分数字
        int[] decimals = toIntArray(decimalStr);
        // 返回最终的大写金额
        String result = "";
        String chineseInteger = getChineseInteger(integers, isWan, isSimplified);
        String chineseDecimal = getChineseDecimal(decimals, isSimplified);
        if (decimals.length > 0 && isSimplified) {
            result = chineseInteger;
            if (!chineseDecimal.equals("零零")) {
                result = result + "点" + chineseDecimal;
            }
        } else {
            result = chineseInteger + chineseDecimal;
        }
        if (flag) {
            // 如果是负数,加上"负"
            return "负" + result;
        } else {
            return result;
        }
    }
    /**
     * 分离整数部分和小数部分
     * @param str
     * @return
     */
    private static String[] separateNum(String str) {
        String integerStr;// 整数部分数字
        String decimalStr;// 小数部分数字
        if (str.indexOf('.') >= 1) {
            integerStr = str.substring(0, str.indexOf('.'));
            decimalStr = str.substring(str.indexOf('.') + 1);
            if (decimalStr.length() > 2) {
                decimalStr = decimalStr.substring(0, 2);
            }
        } else if (str.indexOf('.') == 0) {
            integerStr = "";
            decimalStr = str.substring(1);
        } else {
            integerStr = str;
            decimalStr = "";
        }
        return new String[] {integerStr, decimalStr};
    }
    /**
     *  将字符串转为int数组
     * @param number  数字
     * @return
     */
    private static int[] toIntArray(String number) {
        int[] array = new int[number.length()];
        for (int i = 0; i < number.length(); i++) {
            array[i] = Integer.parseInt(number.substring(i, i + 1));
        }
        return array;
    }
    /**
     *  将整数部分转为大写的金额
     * @param integers 整数部分数字
     * @param isWan  整数部分是否已经是达到【万】
     * @return
     */
    private static String getChineseInteger(int[] integers, boolean isWan, boolean isSimplified) {
        int length = integers.length;
        if (!isSimplified && length == 1 && integers[0] == 0) {
            return "";
        }
        if (!isSimplified) {
            return traditionalChineseInteger(integers, isWan);
        } else {
            return simplifiedChineseInteger(integers, isWan);
        }
    }
    /**
     * 繁体中文整数
     * @param integers
     * @param isWan
     * @return
     */
    private static String traditionalChineseInteger(int[] integers, boolean isWan) {
        StringBuilder chineseInteger = new StringBuilder("");
        int length = integers.length;
        for (int i = 0; i < length; i++) {
            String key = "";
            if (integers[i] == 0) {
                if ((length - i) == 13)// 万(亿)
                    key = IUNIT[4];
                else if ((length - i) == 9) {// 亿
                    key = IUNIT[8];
                } else if ((length - i) == 5 && isWan) {// 万
                    key = IUNIT[4];
                } else if ((length - i) == 1) {// 元
                    key = IUNIT[0];
                }
                if ((length - i) > 1 && integers[i + 1] != 0) {
                    key += NUMBERS[0];
                }
            }
            chineseInteger.append(integers[i] == 0 ? key : (NUMBERS[integers[i]] + IUNIT[length - i - 1]));
        }
        return chineseInteger.toString();
    }
    /**
     * 简体中文整数
     * @param integers
     * @param isWan
     * @return
     */
    private static String simplifiedChineseInteger(int[] integers, boolean isWan) {
        StringBuilder chineseInteger = new StringBuilder("");
        int length = integers.length;
        for (int i = 0; i < length; i++) {
            String key = "";
            if (integers[i] == 0) {
                if ((length - i) == 13) {// 万(亿)
                    key = CN_IUNIT[4];
                } else if ((length - i) == 9) {// 亿
                    key = CN_IUNIT[8];
                } else if ((length - i) == 5 && isWan) {// 万
                    key = CN_IUNIT[4];
                } else if ((length - i) == 1) {// 元
                    key = CN_IUNIT[0];
                }
                if ((length - i) > 1 && integers[i + 1] != 0) {
                    key += CN_NUMBERS[0];
                }
                if (length == 1 && integers[i] == 0) {
                    key += CN_NUMBERS[0];
                }
            }
            chineseInteger.append(integers[i] == 0 ? key : (CN_NUMBERS[integers[i]] + CN_IUNIT[length - i - 1]));
        }
        return chineseInteger.toString();
    }
    /**
     *  将小数部分转为大写的金额
     * @param decimals 小数部分的数字
     * @return
     */
    private static String getChineseDecimal(int[] decimals, boolean isSimplified) {
        StringBuilder chineseDecimal = new StringBuilder("");
        if (!isSimplified) {
            for (int i = 0; i < decimals.length; i++) {
                String key = "";
                if ((decimals.length - i) > 1 && decimals[i + 1] != 0) {
                    key += NUMBERS[0];
                }
                chineseDecimal.append(decimals[i] == 0 ? key : (NUMBERS[decimals[i]] + DUNIT[i]));
            }
        } else {
            for (int i = 0; i < decimals.length; i++) {
                chineseDecimal.append(CN_NUMBERS[decimals[i]]);
            }
        }
        return chineseDecimal.toString();
    }
    /**
     *  判断当前整数部分是否已经是达到【万】
     * @param integerStr  整数部分数字
     * @return
     */
    private static boolean isWan5(String integerStr) {
        int length = integerStr.length();
        if (length > 4) {
            String subInteger = "";
            if (length > 8) {
                subInteger = integerStr.substring(length - 8, length - 4);
            } else {
                subInteger = integerStr.substring(0, length - 4);
            }
            return Integer.parseInt(subInteger) > 0;
        } else {
            return false;
        }
    }
    public String orderNumberSetting(String type) {
        //根据类型自动生成不同的操作单号
north-glass-erp/src/main/resources/mapper/sd/Customer.xml
@@ -3,6 +3,162 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.sd.CustomerMapper">
    <resultMap id="selectCustomerOrderDetail" type="com.example.erp.entity.sd.OrderDetail">
        <result column="order_id" property="orderId"/>
        <result column="order_number" property="orderNumber"/>
        <result column="quantity" property="quantity"/>
        <result column="building_number" property="buildingNumber"/>
        <result column="product_name" property="productName"/>
        <result column="product_id" property="productId"/>
        <result column="price" property="price"/>
        <result column="width" property="width"/>
        <result column="height" property="height"/>
        <result column="area" property="area"/>
        <result column="shape" property="shape"/>
        <result column="gross_area" property="grossArea"/>
        <result column="compute_area" property="computeArea"/>
        <result column="compute_gross_area" property="computeGrossArea"/>
        <result column="processing_note" property="processingNote"/>
        <result column="edging_type" property="edgingType"/>
        <result column="perimeter" property="perimeter"/>
        <result column="batch" property="order.batch"/>
        <result column="project" property="order.project"/>
        <result column="customer_id" property="order.customerId"/>
        <result column="customer_name" property="order.customerName"/>
        <result column="money" property="order.money"/>
        <result column="order_type" property="order.orderType"/>
        <result column="salesman" property="order.salesman"/>
        <result column="create_time" property="order.createTime"/>
    </resultMap>
    <select id="getSelectCustomerOderDate" resultMap="selectCustomerOrderDetail">
        select od.order_id,
               od.order_number,
               o.project,
               od.product_id,
               od.product_name,
               o.customer_id,
               o.customer_name,
               sum(od.quantity) as quantity,
               sum(od.area) as area,
               od.shape,
               od.width,
               od.height,
               o.batch,
               o.money,
               o.order_type,
               o.salesman,
               o.create_time
        from order_detail od
                 left join `order` o on o.order_id = od.order_id
        <where>
                and date(o.create_time)>=#{startDate} and date(o.create_time) &lt;= #{endDate}
            <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
                and o.customer_id = #{orderDetail.order.customerId}
            </if>
            <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
                and o.project regexp #{orderDetail.order.project}
            </if>
            <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
                and o.batch regexp #{orderDetail.order.batch}
            </if>
            <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
                and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
            </if>
            <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
                and o.order_type regexp #{orderDetail.order.orderType}
            </if>
            <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
                and o.salesman regexp #{orderDetail.order.salesman}
            </if>
            <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
                and od.order_id regexp #{orderDetail.orderId}
            </if>
            <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
                and od.order_number regexp #{orderDetail.orderNumber}
            </if>
            <if test="orderDetail.productId != null and orderDetail.productId != ''">
                and od.product_id regexp #{orderDetail.productId}
            </if>
            <if test="orderDetail.productName != null and orderDetail.productName != ''">
                and od.product_name regexp #{orderDetail.productName}
            </if>
            <if test="orderDetail.shape != null and orderDetail.shape != ''">
                and od.shape regexp #{orderDetail.shape}
            </if>
            <if test="orderDetail.width != null and orderDetail.width != ''">
                and od.width regexp  REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
            </if>
            <if test="orderDetail.height != null and orderDetail.height != ''">
                and od.height regexp  REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
            </if>
        </where>
        group by od.product_id, od.width, od.height
        limit #{offset},#{pageSize};
    </select>
    <select id="getSelectCustomerOderDatePageTotal" >
        select
        CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
        count(zu.id) as 'total' from (select od.product_id,od.id
        from order_detail od
        left join `order` o on o.order_id = od.order_id
        <where>
            and date(o.create_time)>=#{startDate} and date(o.create_time) &lt;= #{endDate}
            <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
                and o.customer_id = #{orderDetail.order.customerId}
            </if>
            <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
                and o.project regexp #{orderDetail.order.project}
            </if>
            <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
                and o.batch regexp #{orderDetail.order.batch}
            </if>
            <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
                and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
            </if>
            <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
                and o.order_type regexp #{orderDetail.order.orderType}
            </if>
            <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
                and o.salesman regexp #{orderDetail.order.salesman}
            </if>
            <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
                and od.order_id regexp #{orderDetail.orderId}
            </if>
            <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
                and od.order_number regexp #{orderDetail.orderNumber}
            </if>
            <if test="orderDetail.productId != null and orderDetail.productId != ''">
                and od.product_id regexp #{orderDetail.productId}
            </if>
            <if test="orderDetail.productName != null and orderDetail.productName != ''">
                and od.product_name regexp #{orderDetail.productName}
            </if>
            <if test="orderDetail.shape != null and orderDetail.shape != ''">
                and od.shape regexp #{orderDetail.shape}
            </if>
            <if test="orderDetail.width != null and orderDetail.width != ''">
                and od.width regexp  REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
            </if>
            <if test="orderDetail.height != null and orderDetail.height != ''">
                and od.height regexp  REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
            </if>
        </where>
        group by od.product_id, od.width, od.height) as zu
    </select>
    <select id="getCustomerList">
        select
            *
north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
@@ -202,6 +202,20 @@
        limit 0,1
    </select>
    <select id="getSelectShippingOrderDetailDeliveryPrinting" >
        select
        d.delivery_id,d.quantity,d.money,d.area,d.project,
        d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number,
        d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id
        from sd.delivery d
        <where>
            <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
                and d.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
            </if>
        </where>
    </select>
    <select id="getSelectShippingOrderDetailDeliverys" >
        select customer_id,customer_name,project,salesman,salesman_id,contacts,contact_number,delivery_address from sd.`order`
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml
@@ -87,6 +87,28 @@
    </resultMap>
    <resultMap id="selectDeliveryDetailOrderDetail" type="com.example.erp.entity.sd.DeliveryDetail">
        <result column="order_number" property="orderNumber"/>
        <result column="o_quantity" property="quantity"/>
        <result column="delivery_id" property="deliveryId"/>
        <result column="delivery_number" property="deliveryNumber"/>
        <result column="quantity" property="quantity"/>
        <result column="area" property="area"/>
        <result column="money" property="money"/>
        <result column="delivery_detail_remakes" property="deliveryDetailRemakes"/>
        <result column="delivery_detail_state" property="deliveryDetailState"/>
        <result column="create_time" property="createTime"/>
        <result column="product_id" property="orderDetail.productId"/>
        <result column="product_name" property="orderDetail.productName"/>
        <result column="order_id" property="orderDetail.orderId"/>
    </resultMap>
    <delete id="deleteDeliveryDetail">
        delete from sd.delivery_detail where delivery_id=#{deliveryId}
    </delete>
@@ -645,4 +667,35 @@
        </where>
        order by dd.delivery_id,dd.delivery_number
    </select>
    <select id="getSelectDeliveryPrinting" resultMap="selectDeliveryDetailOrderDetail" >
        select dd.delivery_id,od.order_id,od.product_id,od.product_name,sum(dd.area) as area,sum(dd.money) as money,sum(dd.quantity) as quantity from
        delivery_detail dd left join order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number
        <where>
            <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
                and dd.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
            </if>
        </where>
        group by od.order_id,od.product_name,od.product_id
    </select>
    <select id="getSelectDeliveryDetailPrinting" >
        select od.order_id,
               od.order_number,
               od.product_name,
               od.width,
               od.height,
               dd.quantity,
               dd.money,
               dd.area,
               ifnull(od.processing_note,"") as processingNote,
               ifnull(od.building_number,"") as buildingNumber,
               od.price
        from delivery_detail dd
                 left join order_detail od on dd.order_id = od.order_id and dd.order_number = od.order_number
        where delivery_id = #{deliveryId}
          and od.order_id = #{orderId}
          and od.product_id = #{productId}
    </select>
</mapper>
north-glass-erp/target/classes/mapper/sd/Customer.xml
@@ -3,6 +3,162 @@
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.sd.CustomerMapper">
    <resultMap id="selectCustomerOrderDetail" type="com.example.erp.entity.sd.OrderDetail">
        <result column="order_id" property="orderId"/>
        <result column="order_number" property="orderNumber"/>
        <result column="quantity" property="quantity"/>
        <result column="building_number" property="buildingNumber"/>
        <result column="product_name" property="productName"/>
        <result column="product_id" property="productId"/>
        <result column="price" property="price"/>
        <result column="width" property="width"/>
        <result column="height" property="height"/>
        <result column="area" property="area"/>
        <result column="shape" property="shape"/>
        <result column="gross_area" property="grossArea"/>
        <result column="compute_area" property="computeArea"/>
        <result column="compute_gross_area" property="computeGrossArea"/>
        <result column="processing_note" property="processingNote"/>
        <result column="edging_type" property="edgingType"/>
        <result column="perimeter" property="perimeter"/>
        <result column="batch" property="order.batch"/>
        <result column="project" property="order.project"/>
        <result column="customer_id" property="order.customerId"/>
        <result column="customer_name" property="order.customerName"/>
        <result column="money" property="order.money"/>
        <result column="order_type" property="order.orderType"/>
        <result column="salesman" property="order.salesman"/>
        <result column="create_time" property="order.createTime"/>
    </resultMap>
    <select id="getSelectCustomerOderDate" resultMap="selectCustomerOrderDetail">
        select od.order_id,
               od.order_number,
               o.project,
               od.product_id,
               od.product_name,
               o.customer_id,
               o.customer_name,
               sum(od.quantity) as quantity,
               sum(od.area) as area,
               od.shape,
               od.width,
               od.height,
               o.batch,
               o.money,
               o.order_type,
               o.salesman,
               o.create_time
        from order_detail od
                 left join `order` o on o.order_id = od.order_id
        <where>
                and date(o.create_time)>=#{startDate} and date(o.create_time) &lt;= #{endDate}
            <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
                and o.customer_id = #{orderDetail.order.customerId}
            </if>
            <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
                and o.project regexp #{orderDetail.order.project}
            </if>
            <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
                and o.batch regexp #{orderDetail.order.batch}
            </if>
            <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
                and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
            </if>
            <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
                and o.order_type regexp #{orderDetail.order.orderType}
            </if>
            <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
                and o.salesman regexp #{orderDetail.order.salesman}
            </if>
            <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
                and od.order_id regexp #{orderDetail.orderId}
            </if>
            <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
                and od.order_number regexp #{orderDetail.orderNumber}
            </if>
            <if test="orderDetail.productId != null and orderDetail.productId != ''">
                and od.product_id regexp #{orderDetail.productId}
            </if>
            <if test="orderDetail.productName != null and orderDetail.productName != ''">
                and od.product_name regexp #{orderDetail.productName}
            </if>
            <if test="orderDetail.shape != null and orderDetail.shape != ''">
                and od.shape regexp #{orderDetail.shape}
            </if>
            <if test="orderDetail.width != null and orderDetail.width != ''">
                and od.width regexp  REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
            </if>
            <if test="orderDetail.height != null and orderDetail.height != ''">
                and od.height regexp  REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
            </if>
        </where>
        group by od.product_id, od.width, od.height
        limit #{offset},#{pageSize};
    </select>
    <select id="getSelectCustomerOderDatePageTotal" >
        select
        CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
        count(zu.id) as 'total' from (select od.product_id,od.id
        from order_detail od
        left join `order` o on o.order_id = od.order_id
        <where>
            and date(o.create_time)>=#{startDate} and date(o.create_time) &lt;= #{endDate}
            <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
                and o.customer_id = #{orderDetail.order.customerId}
            </if>
            <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
                and o.project regexp #{orderDetail.order.project}
            </if>
            <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
                and o.batch regexp #{orderDetail.order.batch}
            </if>
            <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
                and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
            </if>
            <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
                and o.order_type regexp #{orderDetail.order.orderType}
            </if>
            <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
                and o.salesman regexp #{orderDetail.order.salesman}
            </if>
            <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
                and od.order_id regexp #{orderDetail.orderId}
            </if>
            <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
                and od.order_number regexp #{orderDetail.orderNumber}
            </if>
            <if test="orderDetail.productId != null and orderDetail.productId != ''">
                and od.product_id regexp #{orderDetail.productId}
            </if>
            <if test="orderDetail.productName != null and orderDetail.productName != ''">
                and od.product_name regexp #{orderDetail.productName}
            </if>
            <if test="orderDetail.shape != null and orderDetail.shape != ''">
                and od.shape regexp #{orderDetail.shape}
            </if>
            <if test="orderDetail.width != null and orderDetail.width != ''">
                and od.width regexp  REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
            </if>
            <if test="orderDetail.height != null and orderDetail.height != ''">
                and od.height regexp  REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
            </if>
        </where>
        group by od.product_id, od.width, od.height) as zu
    </select>
    <select id="getCustomerList">
        select
            *
north-glass-erp/target/classes/mapper/sd/Delivery.xml
@@ -202,6 +202,20 @@
        limit 0,1
    </select>
    <select id="getSelectShippingOrderDetailDeliveryPrinting" >
        select
        d.delivery_id,d.quantity,d.money,d.area,d.project,
        d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number,
        d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id
        from sd.delivery d
        <where>
            <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
                and d.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
            </if>
        </where>
    </select>
    <select id="getSelectShippingOrderDetailDeliverys" >
        select customer_id,customer_name,project,salesman,salesman_id,contacts,contact_number,delivery_address from sd.`order`
north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml
@@ -87,6 +87,28 @@
    </resultMap>
    <resultMap id="selectDeliveryDetailOrderDetail" type="com.example.erp.entity.sd.DeliveryDetail">
        <result column="order_number" property="orderNumber"/>
        <result column="o_quantity" property="quantity"/>
        <result column="delivery_id" property="deliveryId"/>
        <result column="delivery_number" property="deliveryNumber"/>
        <result column="quantity" property="quantity"/>
        <result column="area" property="area"/>
        <result column="money" property="money"/>
        <result column="delivery_detail_remakes" property="deliveryDetailRemakes"/>
        <result column="delivery_detail_state" property="deliveryDetailState"/>
        <result column="create_time" property="createTime"/>
        <result column="product_id" property="orderDetail.productId"/>
        <result column="product_name" property="orderDetail.productName"/>
        <result column="order_id" property="orderDetail.orderId"/>
    </resultMap>
    <delete id="deleteDeliveryDetail">
        delete from sd.delivery_detail where delivery_id=#{deliveryId}
    </delete>
@@ -645,4 +667,35 @@
        </where>
        order by dd.delivery_id,dd.delivery_number
    </select>
    <select id="getSelectDeliveryPrinting" resultMap="selectDeliveryDetailOrderDetail" >
        select dd.delivery_id,od.order_id,od.product_id,od.product_name,sum(dd.area) as area,sum(dd.money) as money,sum(dd.quantity) as quantity from
        delivery_detail dd left join order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number
        <where>
            <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
                and dd.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
            </if>
        </where>
        group by od.order_id,od.product_name,od.product_id
    </select>
    <select id="getSelectDeliveryDetailPrinting" >
        select od.order_id,
               od.order_number,
               od.product_name,
               od.width,
               od.height,
               dd.quantity,
               dd.money,
               dd.area,
               ifnull(od.processing_note,"") as processingNote,
               ifnull(od.building_number,"") as buildingNumber,
               od.price
        from delivery_detail dd
                 left join order_detail od on dd.order_id = od.order_id and dd.order_number = od.order_number
        where delivery_id = #{deliveryId}
          and od.order_id = #{orderId}
          and od.product_id = #{productId}
    </select>
</mapper>