From 67124ffce73fad675be9645eb5c071dcf980e5f2 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期三, 10 七月 2024 14:04:07 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/router/index.js                                    |    6 +
 north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue                     |    4 
 north-glass-erp/northglass-erp/src/lang/en.js                                         |    2 
 north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java         |    2 
 north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi2.vue     |    6 
 north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue                |    3 
 north-glass-erp/northglass-erp/src/components/sd/order/OrderDetail.vue                |    4 
 north-glass-erp/northglass-erp/src/lang/zh.js                                         |    6 +
 north-glass-erp/src/main/resources/mapper/userInfo/User.xml                           |    6 +
 north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java |    6 +
 north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue                     |   31 ++++---
 north-glass-erp/northglass-erp/src/lang/ru.js                                         |    2 
 north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue         |    1 
 north-glass-erp/northglass-erp/src/views/LoginView.vue                                |    2 
 north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue       |    7 +
 north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserName.vue       |  102 +++++++++++++++++++++++++
 north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java       |   19 ++++
 north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue   |    2 
 18 files changed, 186 insertions(+), 25 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/OrderDetail.vue b/north-glass-erp/northglass-erp/src/components/sd/order/OrderDetail.vue
index 2df711e..3c6f0be 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/order/OrderDetail.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/OrderDetail.vue
@@ -42,12 +42,12 @@
     {field: 'width',width:120,  title: t('order.width') ,editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
     {field: 'height',width:140,  title: t('order.height'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
     {field: 'quantity',width:140,  title: t('order.quantity'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
+    {field: 'processingNote',width:200,  title: t('order.processingNote'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
     {field: 'area',width:150,  title: t('order.trueArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged},
     {field: 'grossArea',width:160,  title: t('order.trueGrossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged},
     {field: 'computeArea',width:180,  title: t('order.computeArea'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
     {field: 'computeGrossArea',width:200,  title: t('order.computeGrossArea'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
     {field: 'perimeter',width:200,  title: t('order.perimeter'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
-    {field: 'processingNote',width:200,  title: t('order.processingNote'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
     {field: 'remarks',width:140,  title: t('basicData.remarks'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
     {field: 'shape',width:120,
       title: t('order.shape'),
@@ -58,6 +58,8 @@
     {field: 'edgingType',width:160,  title: t('order.edgingType'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
 
   ],
+
+
   footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
     return[
       columns.map((column, columnIndex) => {
diff --git a/north-glass-erp/northglass-erp/src/lang/en.js b/north-glass-erp/northglass-erp/src/lang/en.js
index 2af3200..bbc88a7 100644
--- a/north-glass-erp/northglass-erp/src/lang/en.js
+++ b/north-glass-erp/northglass-erp/src/lang/en.js
@@ -61,6 +61,8 @@
             max255:"The value contains a maximum of 255 characters",
             range99999Dec2:
                 "Please enter a number between 0 and 99999 with a maximum of two decimals",
+            range999999Dec2:
+                "Please enter a number between 0 and 999999 with a maximum of two decimals",
             greater0:"Please enter an integer greater than 0",
             checkoutLose:'Check fail',
             saveSuccess:'save successfully',
diff --git a/north-glass-erp/northglass-erp/src/lang/ru.js b/north-glass-erp/northglass-erp/src/lang/ru.js
index 96ec526..46dbc45 100644
--- a/north-glass-erp/northglass-erp/src/lang/ru.js
+++ b/north-glass-erp/northglass-erp/src/lang/ru.js
@@ -61,6 +61,8 @@
             max255:"袙胁械写懈褌械 255 褋懈屑胁芯谢芯胁.",
             range99999Dec2:
                 "袙胁械写懈褌械 褔懈褋谢芯 屑械卸写褍 0 - 99999 懈 褋芯褏褉邪薪懈褌械 写芯 写胁褍褏 写械褋褟褌懈褔薪褘褏 蟹薪邪泻芯胁.",
+            range999999Dec2:
+                "袙胁械写懈褌械 褔懈褋谢芯 屑械卸写褍 0 - 999999 懈 褋芯褏褉邪薪懈褌械 写芯 写胁褍褏 写械褋褟褌懈褔薪褘褏 蟹薪邪泻芯胁.",
             greater0:"袙胁械写懈褌械 褑械谢芯械 褔懈褋谢芯 斜芯谢褜褕械 0",
             checkoutLose:'袩褉芯胁械褉泻邪 薪械 锌褉芯褕谢邪',
             saveSuccess:'小芯褏褉邪薪懈褌褜 褍褋锌械褕薪芯',
diff --git a/north-glass-erp/northglass-erp/src/lang/zh.js b/north-glass-erp/northglass-erp/src/lang/zh.js
index c606b99..0f7ab4f 100644
--- a/north-glass-erp/northglass-erp/src/lang/zh.js
+++ b/north-glass-erp/northglass-erp/src/lang/zh.js
@@ -61,6 +61,8 @@
             max255:"鏈�澶氳緭鍏�255涓瓧绗�",
             range99999Dec2:
                 "璇疯緭鍏�0-99999涔嬮棿鐨勬暟瀛楋紝鏈�澶氫繚鐣欎袱浣嶅皬鏁�",
+            range999999Dec2:
+                "璇疯緭鍏�0-999999涔嬮棿鐨勬暟瀛楋紝鏈�澶氫繚鐣欎袱浣嶅皬鏁�",
             greater0:"璇疯緭鍏ュぇ浜�0鐨勬暣鏁�",
             checkoutLose:'鏍¢獙涓嶉�氳繃',
             saveSuccess:'淇濆瓨鎴愬姛',
@@ -712,6 +714,10 @@
         ConfirmPasswordCannotBeEmpty:'纭瀵嗙爜涓嶈兘涓虹┖',
         TheTwoPasswordsAreNotTheSame:'涓ゆ瀵嗙爜涓嶇浉鍚�',
         OldPasswordError:'鏃у瘑鐮侀敊璇�',
+
+        userName:'鐢ㄦ埛鍚嶇О',
+        changeUserName:'淇敼鐢ㄦ埛鍚嶇О',
+        userNameCannotBeEmpty:'鐢ㄦ埛鍚嶇О涓嶈兘涓虹┖',
     },
     orderBasicData:{
         order:'璁㈠崟',
diff --git a/north-glass-erp/northglass-erp/src/router/index.js b/north-glass-erp/northglass-erp/src/router/index.js
index f8dc756..bbfae56 100644
--- a/north-glass-erp/northglass-erp/src/router/index.js
+++ b/north-glass-erp/northglass-erp/src/router/index.js
@@ -72,6 +72,11 @@
               component: () => import('../views/system/userPassWord/UpdateUserPassWord.vue')
             },
             {
+              path: 'updateUserName',
+              name: 'updateUserName',
+              component: () => import('../views/system/userPassWord/UpdateUserName.vue')
+            },
+            {
               name:'userPassWord',
               path: '',
               redirect:'/main/userPassWord/updateUserPassWord'
@@ -79,6 +84,7 @@
           ]
         },
 
+
           //sd妯″潡
         {
           path:'orderBasicData',
diff --git a/north-glass-erp/northglass-erp/src/views/LoginView.vue b/north-glass-erp/northglass-erp/src/views/LoginView.vue
index 7c5a415..fa8e2a4 100644
--- a/north-glass-erp/northglass-erp/src/views/LoginView.vue
+++ b/north-glass-erp/northglass-erp/src/views/LoginView.vue
@@ -86,7 +86,7 @@
 
 const keyDown = (e) => {
   // 鍥炶溅鍒欐墽琛岀櫥褰曟柟娉� enter閿殑ASCII鏄�13
-  if (e.keyCode == 13 || e.keyCode == 100) {
+  if (e.keyCode == 13 ) {
     submitForm(ruleFormRef.value)
   }
 }
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi2.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi2.vue
index ff0b4ad..66e682a 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi2.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintCustomLabelSemi2.vue
@@ -104,9 +104,9 @@
       <div class="row1">
         <span>{{ item.customer_name }}</span>&nbsp;
         <span>{{ item.order_id }}</span>&nbsp;
-        <span v-if="item.type_name.includes('涓┖')">涓┖</span>
-        <span v-else-if="item.type_name.includes('澶瑰眰')">澶瑰眰</span>
-        <span v-else-if="item.type_name.includes('澶硅兌')">澶硅兌</span>
+        <span v-if="item.process.includes('澶硅兌')">鑳剁墖</span>
+        <span v-else-if="item.process.includes('涓┖')">涓┖</span>
+        <span v-else-if="item.process.includes('鐧惧彾')">鐧惧彾</span>
         <span v-else></span>
       </div>
       <div class="row2">
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue
index 8af974a..0e37ea8 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/PrintLabel.vue
@@ -129,8 +129,9 @@
         <div class="row1">
           <span>{{ item.customer_name }}</span>&nbsp;
           <span>{{ item.order_id }}</span>&nbsp;
-          <span v-if="item.process.includes('澶硅兌')">澶硅兌</span>
+          <span v-if="item.process.includes('澶硅兌')">鑳剁墖</span>
           <span v-else-if="item.process.includes('涓┖')">涓┖</span>
+          <span v-else-if="item.process.includes('鐧惧彾')">鐧惧彾</span>
           <span v-else></span>
         </div>
 
diff --git a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
index fe55697..4ec5525 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -703,7 +703,7 @@
 request.post(`/reportingWork/selectProcess`).then((res) => {
   if (res.code == 200) {
     titleSelectJson.value.processType = res.data.process
-    if(user.user.address!==null || user.user.address!==''){
+    if(user.user.address!==null && user.user.address!==''){
       titleUploadData.value.thisProcess = user.user.address
       titleUploadData.value.teamsGroupsName = user.user.userName
     }
@@ -773,7 +773,8 @@
   })
 
   for(let item of uniqueByOrderNum){
-    if(!checkSameNumForId(notFinishList,item.order_number)){
+    if(!checkSameNumForId(notFinishList,item.order_number )){
+      alert(1)
       ElMessage.error(`${t('reportingWorks.pleaseCheckTheOrderNumber1')}':'
       ${item.order_number}
        ${t('reportingWorks.pleaseCheckTheOrderNumber1')}`)
@@ -789,7 +790,7 @@
     const b = (row.breakageQuantity !== undefined && row.breakageQuantity !== null && row.breakageQuantity !== '' && row.breakageQuantity*1!==0)
     return (a || b)
   })
-  if(requestDetailData.length === 0){
+  if(requestDetailData.length === 0 &&  (route.query.reportingWorkId===undefined)){
     ElMessage.warning(t('reportingWorks.atLeastOneFinishedAndWornEligible'))
     return false
   }
diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
index 2a943f7..00bada2 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue
@@ -210,9 +210,9 @@
     bendRadius:[
       {
         validator ({ cellValue }) {
-          const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/
+          const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,5})(\.\d{1,2})?|999999(\.9{1,2})?)$/
           if (cellValue && !regex.test(cellValue)) {
-            return new Error(t('basicData.msg.range99999Dec2'))
+            return new Error(t('basicData.msg.range999999Dec2'))
           }
         }
       }
@@ -552,7 +552,6 @@
                 }
               })
             }else{
-              console.log(dataList)
               const val = getNestedProperty(dataList[result.start],result.cell)
               dataList.forEach((item,index) =>{
                 if(index>=result.start ){
@@ -804,7 +803,7 @@
       titleUploadData.value.icon = titleSelectJson.value.icon[0].basicName
       titleUploadData.value.packType = titleSelectJson.value.packType[0].basicName
       titleUploadData.value.alType = titleSelectJson.value.alType[0].basicName
-      titleUploadData.value.calculateType = 2
+      titleUploadData.value.calculateType = 1
       const today = new Date
       today.setTime(today.getTime() + (7 * 24 * 60 * 60 * 1000))
       titleUploadData.value.deliveryDate = today.getFullYear() +
@@ -989,21 +988,25 @@
         }
       }
 
-
       if(item.computeArea === undefined){
         item.computeArea = area(item)
+      }else{
+        item.computeGrossArea = item.computeArea * item.quantity
       }
       item.area = area(item)
       item.grossArea = countArea(item)
-      if(titleUploadData.value.calculateType===1){
-        item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2))
-      }else if(titleUploadData.value.calculateType===2){
-        item.computeGrossArea = item.grossArea
-      }
-      if(titleUploadData.value.calculateType===3){
-        item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2))
-      }else{
-        item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2))
+
+      if(item.computeGrossArea === undefined){
+        if(titleUploadData.value.calculateType===1){
+          item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2))
+        }else if(titleUploadData.value.calculateType===2){
+          item.computeGrossArea = item.grossArea
+        }
+        if(titleUploadData.value.calculateType===3){
+          item.grossAmount=parseFloat((item.price * item.quantity).toFixed(2))
+        }else{
+          item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2))
+        }
       }
 
     })
diff --git a/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
index 0a5037c..9f4dea1 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
@@ -81,7 +81,7 @@
               prefixIcon: 'vxe-icon-print',
               name: '鍔犲伐鍗�',
               children: [
-                { code: 'sheet1', name: '妯増-鏅��' },
+                // { code: 'sheet1', name: '妯増-鏅��' },
                 { code: 'sheet2', name: '妯増-澶氬眰鏄庣粏' },
                 { code: 'sheet4', name: '鐢熶骇鍔犲伐鍗曠旱鐗�' },
                 { code: 'sheet3', name: '娴忚鍙戣揣淇℃伅' },
@@ -427,7 +427,7 @@
 const exportFile = ()=>{
   const html = document.getElementById("child").innerHTML // 鑾峰彇闇�瑕佸鍑虹殑HTML鍐呭
   const blob = new Blob([html], { type: 'application/vnd.ms-excel' }) // 鍒涘缓Blob瀵硅薄
-  saveAs(blob, rowClickIndex.value.orderId+".xlsx");
+  saveAs(blob, rowClickIndex.value.orderId+".xls");
 }
 
 const reviewOrder = ()=>{
diff --git a/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserName.vue b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserName.vue
new file mode 100644
index 0000000..c7d4a85
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserName.vue
@@ -0,0 +1,102 @@
+<script setup lang="ts">
+import { reactive, ref } from 'vue'
+import type { FormProps,FormInstance, FormRules } from 'element-plus'
+import {ElMessage,ElMessageBox} from "element-plus";
+import request from "@/utils/request";
+import {Avatar, UserFilled} from "@element-plus/icons-vue";
+import useUserInfoStore from "@/stores/userInfo";
+import {useRoute, useRouter} from "vue-router";
+import {useI18n} from "vue-i18n";
+
+const router = useRouter()
+const route = useRoute()
+const { t } = useI18n()
+const userStore = useUserInfoStore()
+//娉ㄥ唽鐢ㄦ埛鍙傛暟
+const register = reactive({
+  userId: userStore.user.id,
+  userName: ''
+})
+
+
+
+
+
+
+
+
+const submitForm = () => {
+  console.log(register.userName)
+  if(register.userName==""||register.userName==null){
+    ElMessage.warning(t('user.userNameCannotBeEmpty'))
+    return
+  }
+      request.post('/user/updateUserName', register).then((res) => {
+        if (res.data === true) {
+          ElMessage.success(t('basicData.msg.saveSuccess'))
+          router.push("/login")
+        } else {
+          ElMessage.error(t('basicData.msg.saveFail'))
+          return false
+        }
+      }).catch(error => {
+        ElMessage.error(t('basicData.msg.ServerConnectionError'))
+        return false
+      })
+}
+
+</script>
+
+<template>
+  <div id="main-div">
+
+    <div id="register">
+      <el-form
+          label-width="100px"
+          :model="register"
+          ref="ruleFormRef"
+          status-icon
+          :rules="rules"
+      >
+        <el-form-item :label="$t('user.userName')">
+          <el-input  type="text"   v-model="register.userName" />
+        </el-form-item>
+
+        <el-form-item >
+          <el-button
+              type="primary"
+              @click="submitForm(ruleFormRef)"
+          >{{ $t('basicData.save') }}
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<style scoped>
+#main-div{
+  width: 1000px;
+  height: 600px;
+  margin: auto;
+}
+h2{
+  text-align: center;
+  width: 100vw;
+  margin-top: 10vh;
+}
+#register{
+  background-color: #FAFAFA;
+  width: 50vw;
+  height: 50vh;
+  border-radius: 12px;
+  box-shadow: 0 8px 16px 0 rgba(0,0,0,0), 0 6px 5px 0 rgba(0,0,0,0.19);
+  display:flex;
+  align-items:center;
+  justify-content:center;
+  min-height: 280px;
+}
+.el-form{
+  max-width: 300px;
+}
+</style>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue
index 2fdebf8..eccd06d 100644
--- a/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue
+++ b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UpdateUserPassWord.vue
@@ -6,9 +6,11 @@
 import {Avatar, UserFilled} from "@element-plus/icons-vue";
 import useUserInfoStore from "@/stores/userInfo";
 import {useRoute, useRouter} from "vue-router";
+import {useI18n} from "vue-i18n";
 
 const router = useRouter()
 const route = useRoute()
+const { t } = useI18n()
 const userStore = useUserInfoStore()
 //娉ㄥ唽鐢ㄦ埛鍙傛暟
 const register = reactive({
diff --git a/north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue
index d23f922..fed6ff6 100644
--- a/north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue
+++ b/north-glass-erp/northglass-erp/src/views/system/userPassWord/UserPassWord.vue
@@ -20,6 +20,7 @@
     <div id="div-title">
       <el-breadcrumb :separator-icon="ArrowRight">
         <el-breadcrumb-item @click="changeRouter(1)" :class="indexFlag===1?'indexTag':''" :to="{ path: '/main/userPassWord/updateUserPassWord' }">{{$t('user.changePassword')}}</el-breadcrumb-item>
+        <el-breadcrumb-item @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/userPassWord/updateUserName' }">{{$t('user.changeUserName')}}</el-breadcrumb-item>
         <el-breadcrumb-item v-show="false" @click="changeRouter(2)" :class="indexFlag===2?'indexTag':''" :to="{ path: '/main/order/createOrder' }">{{$t('basicData.create')}}</el-breadcrumb-item>
       </el-breadcrumb>
     </div>
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java b/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
index 00110cd..9878300 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/userInfo/UserController.java
@@ -61,4 +61,10 @@
     public Result updatePassWord(@RequestBody Map<String,Object> object){
         return Result.seccess( userService.updatePassWord(object));
     }
+
+    @ApiOperation("淇敼鐢ㄦ埛鍚�")
+    @PostMapping("/updateUserName")
+    public Result updateUserName(@RequestBody Map<String,Object> object){
+        return Result.seccess( userService.updateUserName(object));
+    }
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
index 1a0c719..3a87237 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/userInfo/UserMapper.java
@@ -34,4 +34,6 @@
     Boolean userDelete(Integer id);
 
     Boolean updatePassWordById(Integer id,String passWord);
+
+    Boolean updateUserNameById(Integer id,String userName);
 }
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
index de68916..d3ffa44 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/userInfo/UserService.java
@@ -108,6 +108,25 @@
 
     }
 
+    @Transactional
+    public Boolean updateUserName(Map<String,Object> object) {
+        boolean saveState = false;
+        int userId =0;
+        String userName = "";
+        if (object.get("userId") != null) {
+            userId = Integer.parseInt(object.get("userId").toString());
+        }
+        if (object.get("userName") != null) {
+            userName = object.get("userName").toString();
+        }
+
+        if (userMapper.updateUserNameById(userId,userName)){
+            saveState = true;
+        }
+        return saveState;
+
+    }
+
     /*----------------鏂扮増鏈櫥闄�*/
     public UserDTO doLogin(UserDTO userDTO) {
         User user = userMapper.selectOne(new QueryWrapper<User>().
diff --git a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
index a27247d..a593cf5 100644
--- a/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
+++ b/north-glass-erp/src/main/resources/mapper/userInfo/User.xml
@@ -78,4 +78,10 @@
         set password=#{passWord},update_time=now()
         where id=#{id}
     </update>
+
+    <update id="updateUserNameById">
+        update erp_user_info.user
+        set user_name=#{userName},update_time=now()
+        where id=#{id}
+    </update>
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0