guoyuji
2024-01-30 2eed507a4dfffda298bcd3de479a66db5a69bbab
修改订单明细实体类
8个文件已修改
5个文件已添加
715 ■■■■ 已修改文件
north-glass-erp/.idea/dataSources.local.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue 166 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/sd/DeliveryDetail.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderDetail.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/Customer.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/mm/FinishedGoodsInventory.xml 398 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/Customer.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/sd/OrderDetail.xml 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/.idea/dataSources.local.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="dataSourceStorageLocal" created-in="IU-232.8660.185">
  <component name="dataSourceStorageLocal" created-in="IU-232.9559.62">
    <data-source name="@localhost [2]" uuid="165c5447-d19a-4aaf-af5f-cee92ae696c2">
      <database-info product="MySQL" version="8.0.22" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.22" exact-driver-version="8.0">
        <extra-name-characters>#@</extra-name-characters>
@@ -30,7 +30,12 @@
      <user-name>root</user-name>
      <schema-mapping>
        <introspection-scope>
          <node kind="schema" negative="1" />
          <node kind="schema">
            <name qname="erp_user_info" />
            <name qname="mm" />
            <name qname="pp" />
            <name qname="sd" />
          </node>
        </introspection-scope>
      </schema-mapping>
    </data-source>
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -5,7 +5,8 @@
import {ElMessage} from "element-plus"
import request from "@/utils/request"
import deepClone from "@/utils/deepClone"
import  useUserInfoStore from '@/stores/userInfo'
const userStore = useUserInfoStore()
const router = useRouter()
const xGrid = ref()
const gridOptions = reactive({
@@ -13,7 +14,7 @@
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮
  rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
  id: 'OrderList',
  showFooter: true,//显示脚
  printConfig: {},
@@ -168,7 +169,6 @@
            ElMessage.error('没有表格数据!')
            return
          }
          console.log($grid.getTableData().tableData)
          if ($grid) {
            const errMap = await $grid.validate(true)
            if (errMap) {
@@ -216,11 +216,29 @@
const titleUploadData = ref({
  project:'',
  orderType:'',
  alType:'',
  customerId:'',
  customerName:'',
  icon:'',
  orderClassify:'',
  packType:'',
  deliveryDate:''
  orderId:'',
  deliveryDate:'',
  batch:'',
  calculateType:'',
  salesmanId:'',
  salesman:'',
  alType:'',
  money:'',
  contractId:'',
  customerBatch:'',
  contacts:'',
  contactNumber:'',
  deliveryAddress:'',
  otherMoney:'',
  otherMoneyRemarks:'',
  processingNote:'',
  creatorId:userStore.user.userName,
  creator:userStore.user.userId,
})
//定义接收加载表头下拉数据
@@ -230,16 +248,19 @@
  icon:[],
  orderClassify:[],
  packType:[],
  customer:[],
  saleMan:[]
})
//页面第一次加载执行
request.get(`/basicData/orderBasicData`).then((res) => {
  if(res.code==200){
    titleSelectJson.value=deepClone(res.data)
    titleUploadData.value.orderType = titleSelectJson.value.orderType[0].id
    titleUploadData.value.orderClassify = titleSelectJson.value.orderClassify[0].id
    titleUploadData.value.icon = titleSelectJson.value.icon[0].id
    titleUploadData.value.packType = titleSelectJson.value.packType[0].id
    titleUploadData.value.alType = titleSelectJson.value.alType[0].id
    titleUploadData.value.orderType = titleSelectJson.value.orderType[0].basicName
    titleUploadData.value.orderClassify = titleSelectJson.value.orderClassify[0].basicName
    titleUploadData.value.icon = titleSelectJson.value.icon[0].basicName
    titleUploadData.value.packType = titleSelectJson.value.packType[0].basicName
    titleUploadData.value.alType = titleSelectJson.value.alType[0].basicName
    const today = new Date
    today.setTime(today.getTime() + (15 * 24 * 60 * 60 * 1000))
    titleUploadData.value.deliveryDate = today.getFullYear() +
@@ -261,21 +282,36 @@
}
const countAmount = (row) => {
  return
const changeCustomer =  () => {
  const changedCustomerId = titleUploadData.value.customerId
  const customer = titleSelectJson.value.customer.filter(item => item.id === changedCustomerId)
  titleUploadData.value.customerName = customer[0].customerName
  //titleSelectJson.value.customer
}
const changeSaleMan = () => {
  const changedSaleManId = titleUploadData.value.salesmanId
  const SaleMan = titleSelectJson.value.saleMan.filter(item => item.id === changedSaleManId)
  titleUploadData.value.salesman = SaleMan[0].basicName
}
const area = (row) => {
  return parseFloat((row.width * row.height/1000000).toFixed(2))
}
const countArea = (row) => {
  return parseFloat((row.width * row.height/1000000).toFixed(2))*row.quantity
  const area = parseFloat((row.width * row.height/1000000).toFixed(2))
  return parseFloat((area * row.quantity).toFixed(2))
}
const countMoney = (list) => {
  let  countMoney = 0
  list.forEach((item)=>{
    countMoney += parseFloat(item.grossAmount)
  })
  return countMoney
}
//导入功能
const impotEvent = async () => {
const importEvent = async () => {
  const $grid = xGrid.value
  const { files } = await $grid.readFile({
    types: ['xls', 'xlsx']
@@ -290,13 +326,15 @@
      return
    }
    jsonData.forEach((item,index) => {
      //item.computeArea
      //console.log()
      if(item.computeArea === undefined){
        item.computeArea = area(item)
      }
      item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toString())
      item.area = area(item)
      item.grossArea = countArea(item)
      item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2))
      item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2))
    })
    titleUploadData.value.money=countMoney(jsonData).toString()
    xGrid.value.loadData(jsonData)
  }
@@ -311,11 +349,13 @@
      row.grossArea = countArea(row)
      row.computeArea = row.area
      row.computeGrossArea = row.grossArea
      row.grossAmount=row.price * row.computeGrossArea
      row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2))
   }else if(column.property === 'computeArea'){
     row.computeGrossArea=parseFloat((row.computeArea*row.quantity).toString())
     row.grossAmount=row.price * row.computeGrossArea
     row.computeGrossArea=parseFloat((row.computeArea*row.quantity).toFixed(2))
     row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2))
   }
    titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString()
}
</script>
@@ -324,11 +364,19 @@
    <div class="order-primary" style="background-color: white">
      <el-row>
        <el-col  :span="2"><el-text>*项目名称:</el-text></el-col>
        <el-col  :span="2"><el-input/></el-col>
        <el-col  :span="2"><el-input v-model="titleUploadData.project"/></el-col>
        <el-col  :span="2"><el-text>*客户选择:</el-text></el-col>
        <el-col  :span="2">
          <el-select  clearable placeholder=" " >
            <el-option/>
          <el-select  v-model="titleUploadData.customerId"
                      @change="changeCustomer"
                      filterable
                      clearable
                      placeholder="" >
            <el-option v-for="item in titleSelectJson['customer']"
                       :key="item.id"
                       :label="item.id+' '+item.customerName"
                       :value="item.id"
                       />
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>*订单类型:</el-text></el-col>
@@ -338,64 +386,72 @@
                v-for="item in titleSelectJson['orderType']"
                :key="item.id"
                :label="item.basicName"
                :value="item.id"
                :value="item.basicName"
            />
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>订单分类:</el-text></el-col>
        <el-col  :span="2">
          <el-select v-model="titleUploadData.orderClassify" clearable placeholder=" " >
          <el-select v-model="titleUploadData.orderClassify"  clearable placeholder=" " >
            <el-option
                v-for="item in titleSelectJson['orderClassify']"
                :key="item.id"
                :label="item.basicName"
                :value="item.id"
                :value="item.basicName"
            />
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>商标选项:</el-text></el-col>
        <el-col  :span="2">
          <el-select v-model="titleUploadData.icon" clearable placeholder=" " >
          <el-select v-model="titleUploadData.icon"  clearable placeholder=" " >
            <el-option  v-for="item in titleSelectJson['icon']"
                       :key="item.id"
                       :label="item.basicName"
                       :value="item.id"/>
                       :value="item.basicName"/>
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>包装方式:</el-text></el-col>
        <el-col  :span="2">
          <el-select v-model="titleUploadData.packType" clearable placeholder=" " >
          <el-select v-model="titleUploadData.packType"  clearable placeholder=" " >
            <el-option v-for="item in titleSelectJson['packType']"
                       :key="item.id"
                       :label="item.basicName"
                       :value="item.id"/>
                       :value="item.basicName"/>
          </el-select>
        </el-col>
        <!--      <el-col :span="2"><el-text  /></el-col>-->
      </el-row>
      <el-row>
        <el-col  :span="2"><el-text>销售单号:</el-text></el-col>
        <el-col  :span="2"><el-text  /></el-col>
        <el-col  :span="2"><el-text  >{{titleUploadData.orderId}}</el-text></el-col>
        <el-col  :span="2"><el-text>交货日期:</el-text></el-col>
        <el-col  :span="2">
          <el-date-picker
              v-model="titleUploadData.deliveryDate"
              type="date"
              placeholder="Pick a day"
              placeholder=""
              />
        </el-col>
        <el-col  :span="2"><el-text>批次:</el-text></el-col>
        <el-col  :span="2"><el-input/></el-col>
        <el-col  :span="2"><el-input  v-model="titleUploadData.batch"/></el-col>
        <el-col  :span="2"><el-text>计算方式:</el-text></el-col>
        <el-col  :span="2">
          <el-select  clearable placeholder=" " >
            <el-option/>
          <el-select v-model="titleUploadData.calculateType"  clearable placeholder=" " >
            <el-option value="1" label="1"/>
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>*业务员:</el-text></el-col>
        <el-col  :span="2">
          <el-select  clearable placeholder=" " >
            <el-option/>
          <el-select
              v-model="titleUploadData.salesmanId"
              @change = "changeSaleMan"
              clearable
              placeholder=" "
          >
            <el-option v-for="item in titleSelectJson['saleMan']"
                       :key="item.id"
                       :label="item.basicName"
                       :value="item.id"/>
          </el-select>
        </el-col>
        <el-col  :span="2"><el-text>铝条方式:</el-text></el-col>
@@ -404,32 +460,32 @@
            <el-option v-for="item in titleSelectJson['alType']"
                       :key="item.id"
                       :label="item.basicName"
                       :value="item.id"/>
                       :value="item.basicName"/>
          </el-select>
        </el-col>
      </el-row>
      <el-row>
        <el-col  :span="2"><el-text>总金额:</el-text></el-col>
        <el-col  :span="2"><el-text /></el-col>
        <el-col  :span="2"><el-text >{{titleUploadData.money}}</el-text></el-col>
        <el-col  :span="2"><el-text>合同编号:</el-text></el-col>
        <el-col  :span="2"><el-input/></el-col>
        <el-col  :span="2"><el-input v-model="titleUploadData.contractId"/></el-col>
        <el-col  :span="2"><el-text>客户批次:</el-text></el-col>
        <el-col  :span="2"><el-text /></el-col>
        <el-col  :span="2"><el-input v-model="titleUploadData.customerBatch"/></el-col>
        <el-col  :span="2"><el-text>联系人:</el-text></el-col>
        <el-col  :span="2"><el-input/></el-col>
        <el-col  :span="2"><el-input v-model="titleUploadData.contacts" /></el-col>
        <el-col  :span="2"><el-text>联系电话:</el-text></el-col>
        <el-col  :span="2"><el-input/></el-col>
        <el-col  :span="2"><el-text>送货地址:</el-text></el-col>
        <el-col  :span="2"><el-input/></el-col>
        <el-col  :span="2"><el-input v-model="titleUploadData.contactNumber"/></el-col>
        <el-col  :span="2"><el-text >送货地址:</el-text></el-col>
        <el-col  :span="2"><el-input v-model="titleUploadData.deliveryAddress"/></el-col>
      </el-row>
      <el-row>
        <el-col  :span="2"><el-text>其他金额:</el-text></el-col>
        <el-col  :span="2"><el-text /></el-col>
        <el-col  :span="2"><el-text>其他金额备注:</el-text></el-col>
        <el-col  :span="2"><el-text /></el-col>
<!--      <el-row>-->
<!--        <el-col  :span="2"><el-text>其他金额:</el-text></el-col>-->
<!--        <el-col  :span="2"><el-text /></el-col>-->
<!--        <el-col  :span="2"><el-text>其他金额备注:</el-text></el-col>-->
<!--        <el-col  :span="2"><el-text /></el-col>-->
      </el-row>
<!--      </el-row>-->
    </div>
    <div class="order-detail">
      <vxe-grid
@@ -448,7 +504,7 @@
          </div>
        </template>
        <template #toolbar_buttons>
          <vxe-button  @click="impotEvent">导入</vxe-button>
          <vxe-button  @click="importEvent">导入</vxe-button>
        </template>
north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
@@ -24,7 +24,7 @@
    keepSource: true,//保持源数据
    align: 'center',//文字居中
    stripe:true,//斑马纹
    rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮
    rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮
    id: 'OrderList',
    showFooter: true,//显示脚
    printConfig: {},
north-glass-erp/northglass-erp/src/views/sd/product/SelectProduct.vue
@@ -174,7 +174,7 @@
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 60, useKey: true},//鼠标移动或选择高亮
  rowConfig: {isCurrent: true, isHover: true,height: 30, useKey: true},//鼠标移动或选择高亮
  id: 'demo_1',
  showFooter: true,//显示脚
  printConfig: {},
north-glass-erp/src/main/java/com/example/erp/entity/sd/DeliveryDetail.java
@@ -12,7 +12,9 @@
    @TableId(type = IdType.AUTO)
    private Long id;
    private String deliveryId;
    private Integer deliveryNumber;
    private String orderId;
    private Integer orderNumber;
    private Double area;
    private String quantity;
@@ -21,7 +23,6 @@
    private Integer deliveryDetailState;
    private LocalDate createTime;
    private LocalDate updateTime;
    private  Delivery delivery;
    private  OrderDetail orderDetail;
north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderDetail.java
@@ -11,7 +11,7 @@
    @TableId(type = IdType.AUTO)
    private Long id;
    private String orderId;
    private Integer orderNumber;
    private String buildingNumber;
    private Integer productId;
@@ -38,8 +38,8 @@
    private Integer state;
    private LocalDate createTime;
    private LocalDate updateTime;
    private Order order;
    private Delivery delivery;
    //private Product product;
}
north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java
New file
@@ -0,0 +1,11 @@
package com.example.erp.mapper.sd;
import com.example.erp.entity.sd.Customer;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface CustomerMapper {
    List<Customer> getCustomerList();
}
north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
@@ -1,21 +1,24 @@
package com.example.erp.service.sd;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.example.erp.entity.sd.Customer;
import com.example.erp.mapper.sd.BasicDateMapper;
import com.example.erp.mapper.sd.CustomerMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.erp.entity.sd.BasicData;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
@DS("sd")
public class BasicDateService {
    @Autowired
    BasicDateMapper basicDateMapper;
    private BasicDateMapper basicDateMapper;
    @Autowired
    private CustomerMapper customerMapper;
    //获取订单基本数据
public Map<String, List<Object>> getOrderBasicData() {
        //获取订单基本数据类型
@@ -37,6 +40,16 @@
            //将数据放入List中
            orderBasicDataMap.get(item.getBasicCategory()).add(item);
        }
        //获取客户列表
        List<Object> orderBasicDataList = new ArrayList<>();
        orderBasicDataMap.put("customer",orderBasicDataList);
        List<Customer> customerList = customerMapper.getCustomerList();
        for (Customer customer : customerList){
            orderBasicDataMap.get("customer").add(customer);
        }
        //返回Map对象
        return orderBasicDataMap;
    }
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -21,6 +21,7 @@
@Service
@DS("sd")
@Transactional
public class OrderService {
    @Autowired
    private OrderMapper orderMapper;
@@ -33,8 +34,9 @@
        List<OrderDetail> OrderDetails = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("detail")), OrderDetail.class);
        boolean saveState = true;
        //判断传入id参数是否为空,未传入id为空插入订单表,传入更新表
        if(order.getOrderId() == null){
            saveState = insertOrder(order,OrderDetails);
       // System.out.println(order);
        if(order.getOrderId() == null || order.getOrderId().isEmpty()){
            insertOrder(order,OrderDetails);
        }else {
            saveState = updateOrder(order,OrderDetails);
        }
@@ -42,10 +44,10 @@
        return false;
        return true;
    }
    @Transactional
    public boolean insertOrder(Order order,List<OrderDetail> OrderDetails) {
    public void insertOrder(Order order,List<OrderDetail> OrderDetails) {
        Integer maxOrderId = orderMapper.selectMaxOrderId();
        //查询订单id,并且自增
        String formattedNumber = String.format("%02d", maxOrderId+1);
@@ -53,17 +55,19 @@
        Date currentDate = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
        String formattedDate = dateFormat.format(currentDate);
        String orderId =  "NG"+formattedDate+formattedNumber;
        //往主表插数据
        order.setOrderId(orderId);
        orderMapper.insert(order);
        //循环给订单明细表字段添加序号和周长
        for (int i = 0; i < OrderDetails.size(); i++) {
            OrderDetails.get(i).setOrderNumber(i+1);
            order.setOrderId(formattedDate);
            OrderDetails.get(i).setOrderId(orderId);
            OrderDetails.get(i).setPerimeter(OrderDetails.get(i).getWidth()*OrderDetails.get(i).getHeight()*2);
            OrderDetails.get(i).setWeight(1.0);
        }
        //往明细表插数据
        orderDetailMapper.insertBatch(OrderDetails);
        return false;
    }
    public boolean updateOrder(Order order,List<OrderDetail> OrderDetails) {
north-glass-erp/src/main/resources/mapper/sd/Customer.xml
New file
@@ -0,0 +1,11 @@
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.sd.CustomerMapper">
    <select id="getCustomerList">
        select
            *
        from
            customer
    </select>
</mapper>
north-glass-erp/target/classes/mapper/mm/FinishedGoodsInventory.xml
New file
@@ -0,0 +1,398 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.mm.FinishedGoodsInventoryMapper">
    <resultMap id="selectFinishedGoodsInventory" type="com.example.erp.entity.mm.FinishedGoodsInventory">
        <id column="fid" property="id"/>
        <result column="inventory" property="inventory"/>
        <result column="area" property="area"/>
        <result column="actual_signal_area" property="actualSignalArea"/>
        <result column="quantity_available" property="quantityAvailable"/>
        <result column="warehouse_number" property="warehouseNumber"/>
        <result column="storage_region" property="storageRegion"/>
        <result column="status" property="status"/>
        <result column="enter_storage_time" property="enterStorageTime"/>
        <result column="remark" property="remark"/>
        <result column="update_time" property="updateTime"/>
        <result column="end_time" property="endTime"/>
        <result column="order_id" property="order.orderId"/>
        <result column="project" property="order.project"/>
        <result column="order_type" property="order.orderType"/>
        <result column="order_number" property="orderDetail.orderNumber"/>
        <result column="width" property="orderDetail.width"/>
        <result column="height" property="orderDetail.height"/>
        <result column="product_name" property="orderDetail.productName"/>
        <result column="product_id" property="orderDetail.productId"/>
    </resultMap>
    <resultMap id="selectFlowCard" type="com.example.erp.entity.pp.FlowCard">
        <id column="id" property="id"/>
        <result column="order_number" property="orderNumber"/>
        <result column="inventory_quantity" property="inventoryQuantity"/>
        <result column="process_id" property="processId"/>
        <result column="received_quantity" property="receivedQuantity"/>
        <result column="order_id" property="order.orderId"/>
        <result column="project" property="order.project"/>
        <result column="creater" property="order.creater"/>
        <result column="area" property="order.area"/>
        <result column="batch" property="order.batch"/>
        <result column="building_number" property="orderDetail.buildingNumber"/>
        <result column="width" property="orderDetail.width"/>
        <result column="height" property="orderDetail.height"/>
        <result column="product_name" property="orderDetail.productName"/>
        <result column="product_id" property="orderDetail.productId"/>
        <result column="quantity" property="orderDetail.quantity"/>
    </resultMap>
    <update id="updateflowcard">
        update pp.flow_card
        set received_quantity=received_quantity+${inventoryQuantity}
        where order_number=#{orderNumber} and process_id=#{processId}
    </update>
    <update id="updateInventory">
        update mm.finished_goods_inventory
        set inventory=inventory+${inventoryQuantity},quantity_available=quantity_available+${inventoryQuantity},
            update_time=now(),area=area+actual_signal_area*${inventoryQuantity}
        where order_number=#{orderNumber}
    </update>
    <insert id="insertFinishedGoodsInventory"  useGeneratedKeys="true"  >
        insert into mm.finished_goods_inventory (order_id,
                                                 order_number,
                                                 inventory,
                                                 actual_signal_area,
                                                 area,
                                                 quantity_available,
                                                 warehouse_number,
                                                 storage_region,
                                                 `status`,
                                                 enter_storage_time,
                                                 update_time,
                                                 end_time,
                                                 remark
        )
        values (
                   #{flowCard.order.orderId} ,#{flowCard.orderNumber},#{flowCard.inventoryQuantity},ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}/1000000,2),
                   ROUND(#{flowCard.orderDetail.width}*#{flowCard.orderDetail.height}*#{flowCard.inventoryQuantity}/1000000,2),
                #{flowCard.inventoryQuantity},null,#{storageRegion},
                0,now(),now(),null,#{remark}
               )
    </insert>
    <select id="findOrderNumberdcount" >
        select count(*)
        from  mm.`finished_goods_inventory`
        where order_number = #{orderNumber}
    </select>
    <select id="findOrderNumberd" >
        select *
        from  sd.finished_goods_inventory
         where order_number = #{orderNumber}
    </select>
    <select id="getseletwarehousing" resultMap="selectFlowCard">
        select
        fc.id,
        o.order_id,
        od.building_number,
        od.product_id,
        od.product_name,
        od.width,
        od.height,
        o.creater,
        o.project,
        fc.order_number,
        od.quantity,
        fc.inventory_quantity,
        o.area,
        fc.process_id,
        fc.received_quantity,
        o.batch
        from pp.flow_card fc left join sd.order_detail od on fc.order_number=od.order_number inner join sd.`order` o on
        o.order_id=fc.order_id
        <where>
                and fc.received_quantity <![CDATA[<]]> fc.inventory_quantity
            <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
                and o.order_id regexp #{flowCard.order.orderId}
            </if>
            <if test="flowCard.orderDetail.buildingNumber != null and flowCard.orderDetail.buildingNumber != ''">
                and od.building_number regexp #{flowCard.orderDetail.buildingNumber}
            </if>
            <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
                and od.product_id regexp #{flowCard.orderDetail.productId}
            </if>
            <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''">
                and od.product_name regexp #{flowCard.orderDetail.productName}
            </if>
            <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''">
                and od.width regexp #{flowCard.orderDetail.width}
            </if>
            <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''">
                and od.height regexp #{flowCard.orderDetail.height}
            </if>
            <if test="flowCard.order.creater != null and flowCard.order.creater != ''">
                and o.creater regexp #{flowCard.order.creater}
            </if>
            <if test="flowCard.order.project != null and flowCard.order.project != ''">
                and o.project regexp #{flowCard.order.project}
            </if>
            <if test="flowCard.orderNumber != null and flowCard.orderNumber != ''">
                and fc.order_number regexp #{flowCard.orderNumber}
            </if>
            <if test="flowCard.orderDetail.quantity != null and flowCard.orderDetail.quantity != ''">
                and od.quantity regexp #{flowCard.orderDetail.quantity}
            </if>
            <if test="flowCard.inventoryQuantity != null and flowCard.inventoryQuantity != ''">
                and fc.inventory_quantity regexp #{flowCard.inventoryQuantity}
            </if>
            <if test="flowCard.order.area != null and flowCard.order.area != ''">
                and o.area regexp #{flowCard.order.area}
            </if>
            <if test="flowCard.order.batch != null and flowCard.order.batch != ''">
                and o.batch regexp #{flowCard.order.batch}
            </if>
            <if test="flowCard.processId != null and flowCard.processId != ''">
                and fc.process_id regexp #{flowCard.processId}
            </if>
            <if test="flowCard.receivedQuantity != null and flowCard.receivedQuantity != ''">
                and fc.received_quantity regexp #{flowCard.receivedQuantity}
            </if>
        </where>
        group by fc.order_number,fc.process_id order by fc.create_time
        limit #{offset},#{pageSize};
    </select>
    <select id="getseletwarehousingPageTotal" >
        select  CEILING(count(zu.order_number)/#{pageSize}) from (
        select fc.order_number as order_number,fc.process_id from pp.flow_card fc left join sd.order_detail od on
        fc.order_number=od.order_number inner join sd.`order` o on o.order_id=fc.order_id
        <where>
            and fc.received_quantity <![CDATA[<]]> fc.inventory_quantity
            <if test="flowCard.order.orderId != null and flowCard.order.orderId != ''">
                and o.order_id regexp #{flowCard.order.orderId}
            </if>
            <if test="flowCard.orderDetail.buildingNumber != null and flowCard.orderDetail.buildingNumber != ''">
                and od.building_number regexp #{flowCard.orderDetail.buildingNumber}
            </if>
            <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">
                and od.product_id regexp #{flowCard.orderDetail.productId}
            </if>
            <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName != ''">
                and od.product_name regexp #{flowCard.orderDetail.productName}
            </if>
            <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''">
                and od.width regexp #{flowCard.orderDetail.width}
            </if>
            <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''">
                and od.height regexp #{flowCard.orderDetail.height}
            </if>
            <if test="flowCard.order.creater != null and flowCard.order.creater != ''">
                and o.creater regexp #{flowCard.order.creater}
            </if>
            <if test="flowCard.order.project != null and flowCard.order.project != ''">
                and o.project regexp #{flowCard.order.project}
            </if>
            <if test="flowCard.orderNumber != null and flowCard.orderNumber != ''">
                and fc.order_number regexp #{flowCard.orderNumber}
            </if>
            <if test="flowCard.orderDetail.quantity != null and flowCard.orderDetail.quantity != ''">
                and od.quantity regexp #{flowCard.orderDetail.quantity}
            </if>
            <if test="flowCard.inventoryQuantity != null and flowCard.inventoryQuantity != ''">
                and fc.inventory_quantity regexp #{flowCard.inventoryQuantity}
            </if>
            <if test="flowCard.order.area != null and flowCard.order.area != ''">
                and o.area regexp #{flowCard.order.area}
            </if>
            <if test="flowCard.order.batch != null and flowCard.order.batch != ''">
                and o.batch regexp #{flowCard.order.batch}
            </if>
            <if test="flowCard.processId != null and flowCard.processId != ''">
                and fc.process_id regexp #{flowCard.processId}
            </if>
            <if test="flowCard.receivedQuantity != null and flowCard.receivedQuantity != ''">
                and fc.received_quantity regexp #{flowCard.receivedQuantity}
            </if>
        </where>
        group by fc.order_number,fc.process_id order by fc.create_time) as zu
    </select>
    <select id="defaultfinishedGoods" resultMap="selectFinishedGoodsInventory">
        select od.order_number,
        o.order_id,
        o.project,
        o.order_type,
        od.product_name,
        od.product_id,
        od.width,
        od.height,
        fgi.inventory,
        fgi.quantity_available,
        fgi.actual_signal_area,
        fgi.area,
        fgi.warehouse_number,
        fgi.storage_region,
        fgi.`status`,
        fgi.update_time,
        fgi.enter_storage_time,
        fgi.end_time,
        fgi.remark
        from finished_goods_inventory fgi
        left join sd.order_detail od on fgi.order_number = od.order_number
        inner join sd.`order` o on fgi.order_id = o.order_id
        <where>
            <if test="finishedGoodsInventory.orderDetail.width != null and finishedGoodsInventory.orderDetail.width != ''">
                and od.width regexp #{finishedGoodsInventory.orderDetail.width}
            </if>
            <if test="finishedGoodsInventory.orderDetail.orderNumber != null and finishedGoodsInventory.orderDetail.orderNumber != ''">
                and od.order_number regexp #{finishedGoodsInventory.orderDetail.orderNumber}
            </if>
            <if test="finishedGoodsInventory.orderDetail.productName != null and finishedGoodsInventory.orderDetail.productName != ''">
                and od.product_name regexp #{finishedGoodsInventory.orderDetail.productName}
            </if>
            <if test="finishedGoodsInventory.orderDetail.productId != null and finishedGoodsInventory.orderDetail.productId != ''">
                and od.product_id regexp #{finishedGoodsInventory.orderDetail.productId}
            </if>
            <if test="finishedGoodsInventory.order.orderId != null and finishedGoodsInventory.order.orderId != ''">
                and o.order_id regexp #{finishedGoodsInventory.order.orderId}
            </if>
            <if test="finishedGoodsInventory.order.project != null and finishedGoodsInventory.order.project != ''">
                and o.project regexp #{finishedGoodsInventory.order.project}
            </if>
            <if test="finishedGoodsInventory.order.orderType != null and finishedGoodsInventory.order.orderType != ''">
                and o.order_type regexp #{finishedGoodsInventory.order.orderType}
            </if>
            <if test="finishedGoodsInventory.orderDetail.height != null and finishedGoodsInventory.orderDetail.height != ''">
                and od.height regexp #{finishedGoodsInventory.orderDetail.height}
            </if>
            <if test="finishedGoodsInventory.inventory != null and finishedGoodsInventory.inventory != ''">
                and fgi.inventory regexp #{finishedGoodsInventory.inventory}
            </if>
            <if test="finishedGoodsInventory.quantityAvailable != null and finishedGoodsInventory.quantityAvailable != ''">
                and fgi.quantity_available regexp #{finishedGoodsInventory.quantityAvailable}
            </if>
            <if test="finishedGoodsInventory.actualSignalArea != null and finishedGoodsInventory.actualSignalArea != ''">
                and fgi.actual_signal_area regexp #{finishedGoodsInventory.actualSignalArea}
            </if>
            <if test="finishedGoodsInventory.area != null and finishedGoodsInventory.area != ''">
                and fgi.area regexp #{finishedGoodsInventory.area}
            </if>
            <if test="finishedGoodsInventory.warehouseNumber != null and finishedGoodsInventory.warehouseNumber != ''">
                and fgi.warehouse_number regexp #{finishedGoodsInventory.warehouseNumber}
            </if>
            <if test="finishedGoodsInventory.storageRegion != null and finishedGoodsInventory.storageRegion != ''">
                and fgi.storage_region regexp #{finishedGoodsInventory.storageRegion}
            </if>
            <if test="finishedGoodsInventory.status != null and finishedGoodsInventory.status != ''">
                and fgi.`status` regexp #{finishedGoodsInventory.status}
            </if>
            <if test="finishedGoodsInventory.enterStorageTime != null and finishedGoodsInventory.enterStorageTime != ''">
                and fgi.enter_storage_time regexp #{finishedGoodsInventory.enterStorageTime}
            </if>
            <if test="finishedGoodsInventory.updateTime != null and finishedGoodsInventory.updateTime != ''">
                and fgi.update_time regexp #{finishedGoodsInventory.updateTime}
            </if>
            <if test="finishedGoodsInventory.endTime != null and finishedGoodsInventory.endTime != ''">
                and fgi.end_time regexp #{finishedGoodsInventory.endTime}
            </if>
            <if test="finishedGoodsInventory.remark != null and finishedGoodsInventory.remark != ''">
                and fgi.remark regexp #{finishedGoodsInventory.remark}
            </if>
        </where>
        order by fgi.id
        limit #{offset},#{pageSize}
        ;
    </select>
    <select id="getPageTotal">
        select
        CEILING(count(fgi.id)/#{pageSize})
        from finished_goods_inventory fgi
        left join sd.order_detail od on fgi.order_number = od.order_number
        inner join sd.`order` o on fgi.order_id = o.order_id
        <where>
            <if test="finishedGoodsInventory.orderDetail.width != null and finishedGoodsInventory.orderDetail.width != ''">
                and od.width regexp #{finishedGoodsInventory.orderDetail.width}
            </if>
            <if test="finishedGoodsInventory.orderDetail.orderNumber != null and finishedGoodsInventory.orderDetail.orderNumber != ''">
                and od.order_number regexp #{finishedGoodsInventory.orderDetail.orderNumber}
            </if>
            <if test="finishedGoodsInventory.orderDetail.productName != null and finishedGoodsInventory.orderDetail.productName != ''">
                and od.product_name regexp #{finishedGoodsInventory.orderDetail.productName}
            </if>
            <if test="finishedGoodsInventory.orderDetail.productId != null and finishedGoodsInventory.orderDetail.productId != ''">
                and od.product_id regexp #{finishedGoodsInventory.orderDetail.productId}
            </if>
            <if test="finishedGoodsInventory.order.orderId != null and finishedGoodsInventory.order.orderId != ''">
                and o.order_id regexp #{finishedGoodsInventory.order.orderId}
            </if>
            <if test="finishedGoodsInventory.order.project != null and finishedGoodsInventory.order.project != ''">
                and o.project regexp #{finishedGoodsInventory.order.project}
            </if>
            <if test="finishedGoodsInventory.order.orderType != null and finishedGoodsInventory.order.orderType != ''">
                and o.order_type regexp #{finishedGoodsInventory.order.orderType}
            </if>
            <if test="finishedGoodsInventory.orderDetail.height != null and finishedGoodsInventory.orderDetail.height != ''">
                and od.height regexp #{finishedGoodsInventory.orderDetail.height}
            </if>
            <if test="finishedGoodsInventory.inventory != null and finishedGoodsInventory.inventory != ''">
                and fgi.inventory regexp #{finishedGoodsInventory.inventory}
            </if>
            <if test="finishedGoodsInventory.quantityAvailable != null and finishedGoodsInventory.quantityAvailable != ''">
                and fgi.quantity_available regexp #{finishedGoodsInventory.quantityAvailable}
            </if>
            <if test="finishedGoodsInventory.actualSignalArea != null and finishedGoodsInventory.actualSignalArea != ''">
                and fgi.actual_signal_area regexp #{finishedGoodsInventory.actualSignalArea}
            </if>
            <if test="finishedGoodsInventory.area != null and finishedGoodsInventory.area != ''">
                and fgi.area regexp #{finishedGoodsInventory.area}
            </if>
            <if test="finishedGoodsInventory.warehouseNumber != null and finishedGoodsInventory.warehouseNumber != ''">
                and fgi.warehouse_number regexp #{finishedGoodsInventory.warehouseNumber}
            </if>
            <if test="finishedGoodsInventory.storageRegion != null and finishedGoodsInventory.storageRegion != ''">
                and fgi.storage_region regexp #{finishedGoodsInventory.storageRegion}
            </if>
            <if test="finishedGoodsInventory.status != null and finishedGoodsInventory.status != ''">
                and fgi.`status` regexp #{finishedGoodsInventory.status}
            </if>
            <if test="finishedGoodsInventory.enterStorageTime != null and finishedGoodsInventory.enterStorageTime != ''">
                and fgi.enter_storage_time regexp #{finishedGoodsInventory.enterStorageTime}
            </if>
            <if test="finishedGoodsInventory.updateTime != null and finishedGoodsInventory.updateTime != ''">
                and fgi.update_time regexp #{finishedGoodsInventory.updateTime}
            </if>
            <if test="finishedGoodsInventory.endTime != null and finishedGoodsInventory.endTime != ''">
                and fgi.end_time regexp #{finishedGoodsInventory.endTime}
            </if>
            <if test="finishedGoodsInventory.remark != null and finishedGoodsInventory.remark != ''">
                and fgi.remark regexp #{finishedGoodsInventory.remark}
            </if>
        </where>
        order by fgi.id desc
        limit #{offset},#{pageSize}
        ;
    </select>
</mapper>
north-glass-erp/target/classes/mapper/sd/Customer.xml
New file
@@ -0,0 +1,11 @@
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.sd.CustomerMapper">
    <select id="getCustomerList">
        select
            *
        from
            customer
    </select>
</mapper>
north-glass-erp/target/classes/mapper/sd/OrderDetail.xml
New file
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.sd.OrderDetailMapper">
    <insert id="insertBatch" parameterType="java.util.List">
        INSERT INTO
            order_detail (order_id,
                            order_number,
                            building_number,
                            product_id,
                            product_name,
                            price,
                            quantity,
                            gross_amount,
                            width,
                            height,
                            shape,
                            area,
                            gross_area,
                            compute_area,
                            compute_gross_area,
                            processing_note,
                            remarks,
                            bend_radius,
                            edging_type,
                            weight,
                            perimeter
                          )
        values
        <foreach collection ="orderDetails" item="orderDetail" separator =",">
            (#{orderDetail.orderId},
            #{orderDetail.orderNumber},
            #{orderDetail.buildingNumber},
            #{orderDetail.productId},
            #{orderDetail.productName},
            #{orderDetail.price},
            #{orderDetail.quantity},
            #{orderDetail.grossAmount},
            #{orderDetail.width},
            #{orderDetail.height},
            #{orderDetail.shape},
            #{orderDetail.area},
            #{orderDetail.grossArea},
            #{orderDetail.computeArea},
            #{orderDetail.computeGrossArea},
            #{orderDetail.processingNote},
            #{orderDetail.remarks},
            #{orderDetail.bendRadius},
            #{orderDetail.edgingType},
            #{orderDetail.weight},
            #{orderDetail.perimeter}
             )
        </foreach>
    </insert>
</mapper>