From 91f291a2c3b4e41fc0b44f2395ad5c956803ee8c Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期六, 11 五月 2024 08:34:24 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override

---
 north-glass-erp/northglass-erp/src/router/index.js                                        |    5 
 north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml                            |    2 
 north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicGlassTypeController.java |   31 ++
 north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicGlassType.java               |    2 
 north-glass-erp/target/classes/mapper/sd/BasicGlassTypeMapper.xml                         |   29 +++
 north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml                              |    2 
 north-glass-erp/northglass-erp/src/views/sd/basicData/SearchGlassType.vue                 |  204 ++++++++++++++++++++++
 north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicGlassTypeMapper.java         |   11 +
 /dev/null                                                                                 |   48 -----
 north-glass-erp/northglass-erp/src/layout/MainErpView.vue                                 |    4 
 north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java       |  102 +++++++++++
 north-glass-erp/target/classes/mapper/sd/ProductMapper.xml                                |    2 
 north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue                 |   25 --
 north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml                     |   29 +++
 north-glass-erp/northglass-erp/src/views/sd/basicData/BasicData.vue                       |    1 
 15 files changed, 413 insertions(+), 84 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/layout/MainErpView.vue b/north-glass-erp/northglass-erp/src/layout/MainErpView.vue
index 1271591..86a58c2 100644
--- a/north-glass-erp/northglass-erp/src/layout/MainErpView.vue
+++ b/north-glass-erp/northglass-erp/src/layout/MainErpView.vue
@@ -17,6 +17,7 @@
 const router = useRouter()
 const userStore = useUserInfoStore()
 const user = userStore.user.userName
+//鐩戝惉寮傛杩斿洖浠g爜
 watch(()=>userStore.responseCode,(newVal) => {
     switch (newVal){
       case 401:{
@@ -41,6 +42,8 @@
 )
 
 store.createWebSocket();
+
+// 閫�鍑虹櫥褰�
 function quit(){
   userStore.$patch({
     user:null
@@ -59,7 +62,6 @@
 let menuList=$ref([])
 onMounted(()=>{
   request.get(`/menu/getMenu/${lang}`).then((res) => {
-
     if(res.code==200){
       menuList= deepClone(res.data)
     }
diff --git a/north-glass-erp/northglass-erp/src/router/index.js b/north-glass-erp/northglass-erp/src/router/index.js
index 9fef966..e65b51b 100644
--- a/north-glass-erp/northglass-erp/src/router/index.js
+++ b/north-glass-erp/northglass-erp/src/router/index.js
@@ -74,6 +74,11 @@
               component: () => import('../views/sd/basicData/SearchBasicData.vue')
             },
             {
+              path: 'searchGlassType',
+              name: 'searchGlassType',
+              component: () => import('../views/sd/basicData/SearchGlassType.vue')
+            },
+            {
               name: 'OrderBasicData',
               path: '',
               redirect:'/main/orderBasicData/searchBasicData'
diff --git a/north-glass-erp/northglass-erp/src/views/sd/basicData/BasicData.vue b/north-glass-erp/northglass-erp/src/views/sd/basicData/BasicData.vue
index 760686d..73180af 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/basicData/BasicData.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/BasicData.vue
@@ -21,6 +21,7 @@
     <div id="div-title">
       <el-breadcrumb :separator-icon="ArrowRight">
         <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/orderBasicData/searchBasicData' }">鍩虹鏁版嵁</el-breadcrumb-item>
+        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/orderBasicData/searchGlassType' }">鐜荤拑绫诲埆</el-breadcrumb-item>
         <el-breadcrumb-item v-show="false" :to="{ path: '/main/order/orderReport' }">鎶ヨ〃</el-breadcrumb-item>
       </el-breadcrumb>
     </div>
diff --git a/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue
index 9d8ceb5..a7ffc0b 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue
@@ -18,7 +18,6 @@
   stripe:true,//鏂戦┈绾�
   rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
   id: 'OrderList',
-  showFooter: true,//鏄剧ず鑴�
   printConfig: {},
   importConfig: {},
   exportConfig: {},
@@ -62,21 +61,6 @@
     zoom: true,
     custom: true
   },
-
-  footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
-    return[
-      columns.map((column, columnIndex) => {
-        // if (columnIndex === 0) {
-        //   return t('basicData.total')
-        // }
-        // if (props.tableProp.footList.includes(column.field)) {
-        //   return sumNum(data, column.field)
-        // }
-        return ''
-      })
-    ]
-  }
-
 })
 const gridEvents = {
   toolbarButtonClick ({ code }) {
@@ -88,15 +72,6 @@
           dialogTableVisible.value = true
           break
         }
-
-      }
-    }
-  },
-  menuClick ({ menu, row, column }) {
-    const $grid = xGrid.value
-    if ($grid) {
-      switch (menu.code) {
-
 
       }
     }
diff --git a/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchGlassType.vue b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchGlassType.vue
new file mode 100644
index 0000000..cada649
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchGlassType.vue
@@ -0,0 +1,204 @@
+<script setup>
+import {onMounted, reactive, ref} from "vue";
+import {VXETable} from "vxe-table";
+import {ElMessage} from "element-plus";
+import request from "@/utils/request"
+import CreateBasicData from "@/views/sd/basicData/CreateBasicData.vue"
+import {useRouter,useRoute} from "vue-router"
+import {useI18n} from "vue-i18n"
+const { t } = useI18n()
+
+let dialogTableVisible = ref(false)
+const router = useRouter()
+const xGrid = ref()
+const gridOptions = reactive({
+  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  keepSource: true,//淇濇寔婧愭暟鎹�
+  align: 'center',//鏂囧瓧灞呬腑
+  stripe:true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  id: 'OrderList',
+  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:[
+    {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left",},
+    {type: 'seq', title: '搴忓彿', width: 80 ,fixed:"left",},
+    {field:'level',title: '绫诲埆绛夌骇'},
+    {field:'typeName',title: '鍚嶇О'},
+    {field:'createTime',title: '鍒涘缓鏃ユ湡'}
+  ],
+
+  //琛ㄥご鎸夐挳
+  toolbarConfig: {
+    buttons: [
+      {'code': 'add', 'name': '鏂板',status: 'primary'},
+    ],
+
+    // import: false,
+    // export: true,
+    // print: true,
+    zoom: true,
+    custom: true
+  },
+})
+const rowIndex = ref(null)
+const glassType = reactive([
+  {
+    value:1,
+    label:'涓�绾х被鍒�'
+  },
+  {
+    value: 2,
+    label: '浜岀骇绫诲埆',
+    children: []
+  }
+])
+const submit = ref({
+  glassLevel:[null,null],
+  value:null,
+  type:null,
+  id:null
+})
+
+onMounted(()=>{
+  request.get(`/basicGlassType/findAll`).then(res => {
+    xGrid.value.reloadData(res.data)
+    console.log(res.data)
+  })
+
+  request.get(`/basicGlassType/getOneLevelListMap`).then(res => {
+    glassType[1].children = res.data
+  })
+})
+
+const gridEvents = {
+  toolbarButtonClick ({ code }) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (code) {
+        case 'add': {
+          dialogTableVisible.value = true
+          break
+        }
+      }
+    }
+  }
+}
+
+const getTableRow =  (row,type) => {
+  switch (type) {
+    case 'edit': {
+      rowIndex.value = row
+      submit.value.glassLevel = row.belong===''?[parseInt(row.level)]:[parseInt(row.level),row.belong]
+      submit.value.value = row.typeName
+      submit.value.id = row.id
+      dialogTableVisible.value = true
+      break
+    }
+    case 'delete': {
+      request.get(`/basicGlassType/deleteById/${row.id}`).then((res) => {
+        if(res.code==='200' && res.data===true){
+          ElMessage.success(t('searchOrder.msgDeleteSuccess'))
+          router.push({
+            path:'/main/orderBasicData/searchGlassType',
+            query:{random:Math.random()
+            }
+          })
+        }else{
+          ElMessage.warning(t('searchOrder.msgDeleteFail'))
+        }
+      })
+      break
+    }
+
+  }
+}
+
+
+const saveBasicData =  (type) =>{
+  submit.value.type = type
+  request.post(`/basicGlassType/add`, submit.value).then(res => {
+    if (res.code==='200') {
+      ElMessage.success('淇濆瓨鎴愬姛')
+      router.push({
+        path:'/main/orderBasicData/searchGlassType',
+        query:{random:Math.random()
+        }
+      })
+    }
+  })
+}
+
+
+</script>
+
+<template>
+  <div>
+    <vxe-grid
+        style="width: 40vw;"
+        class="mytable-scrollbar"
+        max-height="500px"
+        ref="xGrid"
+        v-bind="gridOptions"
+        v-on="gridEvents"
+    >
+      <template #button_slot="{ row }">
+        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('basicData.edit') }}</el-button>
+        <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')">
+          <template #reference>
+            <el-button  link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
+          </template>
+        </el-popconfirm>
+      </template>
+    </vxe-grid>
+    <el-dialog
+        v-model="dialogTableVisible"
+        destroy-on-close
+        style="width: 30%;height:30% ">
+      <el-row>
+        <el-cascader
+            v-model="submit.glassLevel"
+            :options="glassType"
+            clearable
+            placeholder=""
+            :disabled="rowIndex"
+        />
+      </el-row>
+      <el-row>
+          <el-input v-model="submit.value"/>
+      </el-row>
+      <el-row>
+        <el-button v-if="!rowIndex" @click="saveBasicData('add')"   type="primary">鏂板</el-button>
+        <el-button v-else @click="saveBasicData('update')" type="primary">淇敼</el-button>
+      </el-row>
+    </el-dialog>
+
+  </div>
+
+</template>
+
+<style scoped>
+.el-row{
+  margin-top: 10px;
+}
+</style>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicGlassTypeController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicGlassTypeController.java
index 36b9848..e05c8fd 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicGlassTypeController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicGlassTypeController.java
@@ -1,17 +1,17 @@
 package com.example.erp.controller.sd;
 
 import com.example.erp.common.Result;
-import com.example.erp.service.sd.BasicGlassTypeServise;
+import com.example.erp.service.sd.BasicGlassTypeService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
 
 @RestController
 @RequestMapping("/basicGlassType")
 public class BasicGlassTypeController {
     @Autowired
-    BasicGlassTypeServise basicGlassTypeServise;
+    BasicGlassTypeService basicGlassTypeServise;
 
     @GetMapping("/getOneLevel")
     public Result getOneLevel(){
@@ -26,4 +26,25 @@
     public Result getAll(){
         return Result.seccess(basicGlassTypeServise.getAll());
     }
+
+    @GetMapping("/findAll")
+    public Result findAll(){
+        return Result.seccess(basicGlassTypeServise.findAll());
+    }
+
+    @GetMapping("/deleteById/{id}")
+    public Result deleteById(@PathVariable Integer id){
+        return Result.seccess(basicGlassTypeServise.deleteById(id));
+    }
+
+    @GetMapping("/getOneLevelListMap")
+    public Result getOneLevelListMap(){
+        return Result.seccess(basicGlassTypeServise.getOneLevelListMap());
+    }
+
+    @PostMapping("/add")
+    public Result add(@RequestBody Map<String,Object> map){
+        return Result.seccess(basicGlassTypeServise.add(map));
+    }
+
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicGlassType.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicGlassType.java
index 07e11a9..103116f 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicGlassType.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicGlassType.java
@@ -10,7 +10,7 @@
     private Integer id;
     private Integer level;
     private String belong;
-    private String typeID;
+    private String typeId;
     private String typeName;
     private String createTime;
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicGlassTypeMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicGlassTypeMapper.java
index f34ce44..661aaf5 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicGlassTypeMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicGlassTypeMapper.java
@@ -1,13 +1,22 @@
 package com.example.erp.mapper.sd;
 
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.example.erp.entity.sd.BasicGlassType;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
 @Mapper
-public interface BasicGlassTypeMapper {
+public interface BasicGlassTypeMapper extends BaseMapper<BasicGlassType> {
     List<BasicGlassType> getOneLevel();
 
     List<BasicGlassType> getTwoLevel();
+
+    BasicGlassType selectMaxType(Integer type);
+
+    BasicGlassType selectMaxTowLevelType(String type);
+
+
+    Boolean updateGlassTypeName(@Param("basicGlassType") BasicGlassType basicGlassType);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java
new file mode 100644
index 0000000..779dd52
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeService.java
@@ -0,0 +1,102 @@
+package com.example.erp.service.sd;
+
+import com.alibaba.fastjson.JSON;
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.erp.entity.sd.BasicGlassType;
+import com.example.erp.mapper.sd.BasicGlassTypeMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+@Service
+@DS("sd")
+public class BasicGlassTypeService {
+    @Autowired
+    BasicGlassTypeMapper basicGlassTypeMapper;
+    public List<BasicGlassType> getOneLevel() {
+        return basicGlassTypeMapper.getOneLevel();
+    }
+
+    public List<BasicGlassType>  getTwoLevel() {
+        return basicGlassTypeMapper.getTwoLevel();
+    }
+
+    public List<Map<String,String>> getAll() {
+        List<BasicGlassType> oneGlassType = basicGlassTypeMapper.getOneLevel();
+        List<BasicGlassType> twoGlassType = basicGlassTypeMapper.getTwoLevel();
+        List<Map<String,String>> list = new ArrayList<>();
+        for (BasicGlassType glassType : oneGlassType) {
+            Map<String, String> map = new HashMap<>();
+            map.put("value", glassType.getTypeId());
+            map.put("label", glassType.getTypeName());
+            map.put("children", "");
+            List<String> equalList = new ArrayList<>();
+            for (BasicGlassType basicGlassType : twoGlassType) {
+                if (Objects.equals(basicGlassType.getBelong(), glassType.getTypeId())) {
+                    Map<String,String> getMap = JSON.parseObject(JSON.toJSONString(basicGlassType), Map.class);
+                    getMap.put("value",getMap.get("typeId"));
+                    getMap.put("label",getMap.get("typeName"));
+                    equalList.add(JSON.toJSONString(getMap)   );
+                }
+            }
+            map.replace("children",equalList.toString());
+            list.add(map);
+        }
+        return list;
+    }
+
+    public List<BasicGlassType> findAll() {
+        return basicGlassTypeMapper.selectList(null);
+    }
+
+    public Boolean deleteById(Integer id) {
+        return basicGlassTypeMapper.deleteById(id) > 0;
+    }
+
+    public List<Map<String,Object>> getOneLevelListMap() {
+        List<BasicGlassType> oneGlassType = basicGlassTypeMapper.getOneLevel();
+        List<Map<String,Object>> list = new ArrayList<>();
+        for (BasicGlassType glassType : oneGlassType) {
+            Map<String,Object> map = new HashMap<>();
+            map.put("value", glassType.getTypeId());
+            map.put("label", glassType.getTypeName());
+            list.add(map);
+        }
+        return list;
+    }
+
+    public Boolean add(Map<String, Object> map) {
+        List<Object> list = (List<Object>) map.get("glassLevel");
+        if(list.get(0)==null
+                || map.get("value") == null
+                || map.get("value").equals("")){
+            return false;
+        }
+        BasicGlassType basicGlassTypeS = new BasicGlassType();
+        if(map.get("type").equals("add")){
+            if(list.size()==1){
+                BasicGlassType basicGlassType =  basicGlassTypeMapper.selectMaxType((Integer) list.get(0));
+                int maxId = Integer.parseInt(basicGlassType.getTypeId());
+                String newTypeId = String.format("%02d", maxId+1);
+                basicGlassTypeS.setLevel((Integer) list.get(0));
+                basicGlassTypeS.setTypeId(newTypeId);
+                basicGlassTypeS.setTypeName((String) map.get("value"));
+            }else if(list.size()==2) {
+                BasicGlassType basicGlassType =  basicGlassTypeMapper.selectMaxTowLevelType((String) list.get(1));
+                int maxId = Integer.parseInt(basicGlassType.getTypeId().substring(2));
+                String newTypeId =list.get(1) + String.format("%02d", maxId+1);
+                basicGlassTypeS.setLevel((Integer) list.get(0));
+                basicGlassTypeS.setTypeId(newTypeId);
+                basicGlassTypeS.setTypeName((String) map.get("value"));
+                basicGlassTypeS.setBelong((String) list.get(1));
+            }
+            return basicGlassTypeMapper.insert(basicGlassTypeS)>0;
+        }else{
+            basicGlassTypeS.setId((Integer) map.get("id"));
+            basicGlassTypeS.setTypeName((String) map.get("value"));
+           return basicGlassTypeMapper.updateGlassTypeName(basicGlassTypeS);
+        }
+
+    }
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeServise.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeServise.java
deleted file mode 100644
index e66848b..0000000
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicGlassTypeServise.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.example.erp.service.sd;
-
-import com.alibaba.fastjson.JSON;
-import com.baomidou.dynamic.datasource.annotation.DS;
-import com.example.erp.entity.sd.BasicGlassType;
-import com.example.erp.mapper.sd.BasicGlassTypeMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.*;
-
-@Service
-@DS("sd")
-public class BasicGlassTypeServise {
-    @Autowired
-    BasicGlassTypeMapper basicGlassTypeMapper;
-    public List<BasicGlassType> getOneLevel() {
-        return basicGlassTypeMapper.getOneLevel();
-    }
-
-    public List<BasicGlassType>  getTwoLevel() {
-        return basicGlassTypeMapper.getTwoLevel();
-    }
-
-    public List<Map<String,String>> getAll() {
-        List<BasicGlassType> oneGlassType = basicGlassTypeMapper.getOneLevel();
-        List<BasicGlassType> twoGlassType = basicGlassTypeMapper.getTwoLevel();
-        List<Map<String,String>> list = new ArrayList<>();
-        for (BasicGlassType glassType : oneGlassType) {
-            Map<String, String> map = new HashMap<>();
-            map.put("value", glassType.getTypeID());
-            map.put("label", glassType.getTypeName());
-            map.put("children", "");
-            List<String> equalList = new ArrayList<>();
-            for (BasicGlassType basicGlassType : twoGlassType) {
-                if (Objects.equals(basicGlassType.getBelong(), glassType.getTypeID())) {
-                    Map<String,String> getMap = JSON.parseObject(JSON.toJSONString(basicGlassType), Map.class);
-                    getMap.put("value",getMap.get("typeID"));
-                    getMap.put("label",getMap.get("typeName"));
-                    equalList.add(JSON.toJSONString(getMap)   );
-                }
-            }
-            map.replace("children",equalList.toString());
-            list.add(map);
-        }
-        return list;
-    }
-}
diff --git a/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml
index ea19fab..4f8836a 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/BasicGlassTypeMapper.xml
@@ -19,4 +19,33 @@
         ORDER BY  a.id ;
     </select>
 
+    <select id="selectMaxType">
+        select
+            *
+        from
+            basic_glass_type  as a
+        where a.level=1
+        ORDER BY  a.id  desc limit 1;
+
+    </select>
+
+    <select id="selectMaxTowLevelType">
+        select
+            *
+        from
+            basic_glass_type  as a
+        where
+            a.level=2
+            and a.belong = #{type}
+
+        ORDER BY  a.id  desc limit 1;
+    </select>
+    
+    <update id="updateGlassTypeName" parameterType="com.example.erp.entity.sd.BasicGlassType" >
+        update
+            basic_glass_type as a
+        set a.type_name = #{basicGlassType.typeName}
+        where a.id = #{basicGlassType.id}
+    </update>
+
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
index 363a41e..93a2ab0 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderMapper.xml
@@ -47,7 +47,7 @@
     <select id="getOrderList">
         select
             *,
-        sum(fgi.quantity_available) as goodsQuantity
+        ifnull(sum(fgi.quantity_available),0) as goodsQuantity
         from
             `order` as o
         left join mm.finished_goods_inventory as  fgi
diff --git a/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml
index 3212ae3..c1956ba 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml
@@ -17,7 +17,7 @@
         <result column="update_time" property="updateTime"/>
         <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
         <association property="basicGlassType" javaType="com.example.erp.entity.sd.BasicGlassType">
-            <result column="type_id" property="typeID"/>
+            <result column="type_id" property="typeId"/>
             <result column="type_name" property="typeName"/>
         </association>
 
diff --git a/north-glass-erp/target/classes/mapper/sd/BasicGlassTypeMapper.xml b/north-glass-erp/target/classes/mapper/sd/BasicGlassTypeMapper.xml
index ea19fab..4f8836a 100644
--- a/north-glass-erp/target/classes/mapper/sd/BasicGlassTypeMapper.xml
+++ b/north-glass-erp/target/classes/mapper/sd/BasicGlassTypeMapper.xml
@@ -19,4 +19,33 @@
         ORDER BY  a.id ;
     </select>
 
+    <select id="selectMaxType">
+        select
+            *
+        from
+            basic_glass_type  as a
+        where a.level=1
+        ORDER BY  a.id  desc limit 1;
+
+    </select>
+
+    <select id="selectMaxTowLevelType">
+        select
+            *
+        from
+            basic_glass_type  as a
+        where
+            a.level=2
+            and a.belong = #{type}
+
+        ORDER BY  a.id  desc limit 1;
+    </select>
+    
+    <update id="updateGlassTypeName" parameterType="com.example.erp.entity.sd.BasicGlassType" >
+        update
+            basic_glass_type as a
+        set a.type_name = #{basicGlassType.typeName}
+        where a.id = #{basicGlassType.id}
+    </update>
+
 </mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/sd/ProductMapper.xml b/north-glass-erp/target/classes/mapper/sd/ProductMapper.xml
index 3212ae3..c1956ba 100644
--- a/north-glass-erp/target/classes/mapper/sd/ProductMapper.xml
+++ b/north-glass-erp/target/classes/mapper/sd/ProductMapper.xml
@@ -17,7 +17,7 @@
         <result column="update_time" property="updateTime"/>
         <!--鎺ユ敹鍏朵粬澶栭敭瀹炰綋绫绘暟鎹�-->
         <association property="basicGlassType" javaType="com.example.erp.entity.sd.BasicGlassType">
-            <result column="type_id" property="typeID"/>
+            <result column="type_id" property="typeId"/>
             <result column="type_name" property="typeName"/>
         </association>
 

--
Gitblit v1.8.0