From 8f53694cc7ed5b9965d172a511ab39b914edbfb6 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期五, 19 四月 2024 14:18:02 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
---
north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderOtherMoney.java | 21
north-glass-erp/target/classes/mapper/sd/Delivery.xml | 2
north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicOtherMoney.java | 25 +
north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java | 18
north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderOtherMoneyMapper.java | 9
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue | 9
north-glass-erp/northglass-erp/src/lang/zh.js | 2
north-glass-erp/target/classes/mapper/sd/OrderDetail.xml | 6
north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicDataController.java | 8
north-glass-erp/northglass-erp/src/views/sd/order/CreateOrder.vue | 134 +++++
north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java | 8
north-glass-erp/src/main/resources/mapper/sd/Delivery.xml | 2
north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderDetail.java | 1
north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicOtherMoneyController.java | 34 +
north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java | 258 ++++++++++
north-glass-erp/src/main/resources/mapper/sd/OrderDetail.xml | 6
north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue | 191 ++++++++
north-glass-erp/northglass-erp/src/views/LoginView.vue | 16
north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue | 529 +++++++++++++++-------
north-glass-erp/src/main/java/com/example/erp/service/sd/BasicOtherMoneyService.java | 33 +
north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java | 46 +
north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicOtherMoneyMapper.java | 9
22 files changed, 1,137 insertions(+), 230 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue b/north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue
new file mode 100644
index 0000000..3d167c2
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/components/sd/order/OrderOtherMoney.vue
@@ -0,0 +1,191 @@
+<script setup>
+import {onMounted, reactive, ref, watch} from "vue"
+import {filterChanged} from "@/hook"
+import {useI18n} from "vue-i18n"
+import {ElMessage} from "element-plus";
+const { t } = useI18n()
+let rowClickIndex = ref(null)
+const xGrid = ref()
+const gridOptions = reactive({
+ border: "full",//琛ㄦ牸鍔犺竟妗�
+ keepSource: true,//淇濇寔婧愭暟鎹�
+ align: 'center',//鏂囧瓧灞呬腑
+ stripe:true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ id: 'OrderList',
+ showFooter: true,//鏄剧ず鑴�
+ scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
+ showOverflow:true,
+
+ columnConfig: {
+ // resizable: true,
+ useKey: true
+ },
+ filterConfig: { //绛涢�夐厤缃」
+ //remote: true //杩滅绛涢��
+ },
+ // customConfig: {
+ // storage: true
+ // },
+ editConfig: {
+ trigger: 'click',
+ mode: 'cell',
+ showStatus: true
+ },//琛ㄥご鍙傛暟
+ columns:[
+ // {field: 'buildingNumber',width:120, title: '妤煎彿',editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter'}, sortable: true,filterMethod:filterChanged},
+ {field: 'alias', title:'鍏朵粬鍔犲伐',editRender: { name: 'input'},minWith:'130'},
+ {field: 'price', title:'鍗曚环',editRender: { name: 'input'}},
+ {field: 'quantity', title:'鏁伴噺',editRender: { name: 'input'} },
+ {field: 'money', slots:{default:'default'}, title:'閲戦'}
+ ],
+ //琛ㄥ崟楠岃瘉
+ editRules: {
+ price: [
+ {
+ validator ({ cellValue }) {
+ const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/
+ if (cellValue && !regex.test(cellValue) ) {
+ return new Error(t('basicData.msg.range99999Dec2') )
+ }
+ }
+ }
+ ],
+ quantity: [
+ {
+ validator ({ cellValue }) {
+ const regex = /^[1-9]\d*$|^0$/
+ if (cellValue && !regex.test(cellValue) ) {
+ return new Error('璇疯緭鍏ュぇ浜庣瓑浜�0鐨勬暣鏁�')
+ }
+ }
+ }
+ ]
+
+ },
+ toolbarConfig: {
+ buttons: [
+ {'code': 'add', 'name': '鏂板',status: 'primary'},
+ {'code': 'delete', 'name': '鍒犻櫎',status: 'primary'}
+ ],
+
+
+ // import: false,
+ // export: true,
+ // print: true,
+ // zoom: true,
+ // custom: true
+ }
+ ,
+ //table body瀹為檯鏁版嵁
+ footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+ return[
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return t('basicData.total')+':'
+ }
+ const footList = ['quantity']
+ if (footList.includes(column.field)) {
+ return sumNum(data, column.field)
+ }
+ if(column.field==='money'){
+ let count = 0
+ data.forEach(item => {
+ count+=countAmount(item)
+ })
+ return parseFloat(count.toFixed(2))
+ }
+ return ''
+ })
+ ]
+ }
+
+})
+const gridEvents = {
+ async toolbarButtonClick({code}) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (code) {
+ case 'add': {
+ if ($grid.getTableData().tableData.length >=240){
+ ElMessage.error(t('order.msg.tableLengthMax'))
+ return
+ }
+ $grid.insert({})
+ break
+ }
+ case 'delete': {
+ if(rowClickIndex.value === null){
+ ElMessage.warning('璇峰厛鍗曞嚮閫夋嫨琛�')
+ return
+ }
+ $grid.remove(rowClickIndex.value)
+ rowClickIndex.value = null
+ break
+ }
+ }
+ }
+ },
+ cellClick({ row }){
+ rowClickIndex.value = row
+ }
+}
+
+const sumNum = (list, field) => {
+ let count = 0
+ list.forEach(item => {
+ count += Number(item[field])
+ })
+ return count.toFixed(2)==='NaN' ? null : parseFloat(count.toFixed(2))
+}
+
+let prop = defineProps({
+ otherMoney:{}
+})
+onMounted(()=>{
+ xGrid.value.reloadData(prop.otherMoney)
+})
+watch(prop,(newVal)=>{
+ xGrid.value.reloadData(prop.otherMoney)
+})
+
+const countAmount = (row)=>{
+ return parseFloat((row.price * row.quantity).toFixed(2))
+}
+
+const validate = async () => {
+ const errMap = await xGrid.value.validate(true)
+ if (errMap) {
+ ElMessage.error(`鏍¢獙涓嶉�氳繃锛乣)
+ return false
+ }
+ return true
+}
+defineExpose({
+ validate
+})
+
+</script>
+
+<template>
+ <div style="height: 100%;width: 100%">
+ <vxe-grid
+ @filter-change="filterChanged"
+ ref="xGrid"
+ max-height="350px"
+ :width="'100%'"
+ v-bind="gridOptions"
+ v-on="gridEvents"
+ >
+ <template #default="{ row }">
+ <span>{{ countAmount(row) }} </span>
+ </template>
+ </vxe-grid>
+ </div>
+
+
+</template>
+
+<style scoped>
+
+</style>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/lang/zh.js b/north-glass-erp/northglass-erp/src/lang/zh.js
index 0e7f925..f4bd98c 100644
--- a/north-glass-erp/northglass-erp/src/lang/zh.js
+++ b/north-glass-erp/northglass-erp/src/lang/zh.js
@@ -138,7 +138,7 @@
width:'瀹�',
height:'楂�',
area:'闈㈢Н',
- trueArea:'瀹為檯鍗曠墖閲戦',
+ trueArea:'瀹為檯鍗曠墖闈㈢Н',
trueGrossArea:'瀹為檯鎬婚潰绉�',
computeArea:'缁撶畻鍗曠墖闈㈢Н',
computeGrossArea:'璁$畻鎬婚潰绉�',
diff --git a/north-glass-erp/northglass-erp/src/views/LoginView.vue b/north-glass-erp/northglass-erp/src/views/LoginView.vue
index e18ae22..c821584 100644
--- a/north-glass-erp/northglass-erp/src/views/LoginView.vue
+++ b/north-glass-erp/northglass-erp/src/views/LoginView.vue
@@ -110,14 +110,14 @@
<img id="img-pic" src="@/assets/img.png" alt="">
</div>
<div id="div-login">
- <el-select
- @change="changeLanguage"
- v-model="language"
- placeholder=" "
- style="float: right;width: 6rem">
- <el-option value="zh" label="涓枃" />
- <el-option value="en" label="English" />
- </el-select>
+<!-- <el-select-->
+<!-- @change="changeLanguage"-->
+<!-- v-model="language"-->
+<!-- placeholder=" "-->
+<!-- style="float: right;width: 6rem">-->
+<!-- <el-option value="zh" label="涓枃" />-->
+<!-- <el-option value="en" label="English" />-->
+<!-- </el-select>-->
<h2>{{$t('login.SysName')}}</h2>
<el-form
@submit.native.prevent
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue
index 4896f10..24a3ce0 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue
@@ -1,9 +1,11 @@
<script setup>
+
+
import request from "@/utils/request"
import {ElDatePicker, ElMessage} from "element-plus"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {Search} from "@element-plus/icons-vue"
-import {useRouter} from 'vue-router'
+import {useRoute, useRouter} from "vue-router"
import {changeFilterEvent, filterChanged} from "@/hook"
import { useI18n } from 'vue-i18n'
@@ -11,8 +13,12 @@
//璇█鑾峰彇
const { t } = useI18n()
let router=useRouter()
+const route = useRoute()
let produceList = ref([])
let delivery = ref([])
+let money = ref("")
+let takeCare = "娉ㄦ剰:璇峰Ε鍠勪繚绠″ソ鎴戝徃鐨勭幓鐠冩灦锛屽鏈変涪澶辨垨鎹熷潖锛屾寜1500鍏冨彧璧斿伩銆傝阿璋㈤厤鍚�!"
+let remark = "澶囨敞:鏈壒鐜荤拑涓轰紭绛夊悎鏍煎搧锛岃鍦ㄥ嵏璐ф椂,褰撻潰娑堢偣楠屾敹銆佸鏈夎川閲忛棶棰樺湪涓�鍛ㄥ唴涓庢湰鍏徃鑱旂郴,鍚﹀垯姒備笉璐熻矗锛�"
let props = defineProps({
deliveryId:null
@@ -21,18 +27,65 @@
const form = ref({
})
+
+
+
+const Printing = ()=>{
+
+ // 闇�瑕佹墦鍗扮殑灞�閮ㄥ尯鍩熻祴浜�"print-wrap"鐨刬d
+ let el = document.getElementById("pis");
+ let doc = document;
+ let body = doc.body || doc.getElementsByTagName("body")[0];
+ let printId = "print-" + Date.now();
+
+ // 鍒涘缓鏃犲壇浣滅敤鐨勬墦鍗板鍣�(鍥犱笉纭畾椤甸潰鐨勬墦鍗板厓绱犳湁鏃犲叾瀹冩牱寮�)
+ let content = doc.createElement("div");
+ content.id = printId;
+
+ // 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
+ let style = doc.createElement("style");
+ style.innerHTML =
+ "body>#" +
+ printId +
+ "{display:none}@media print{body>:not(#" +
+ printId +
+ "){display:none !important}body>#" +
+ printId +
+ "{display:block;padding-top:1px}}";
+
+ content.innerHTML = el.outerHTML;
+ // console.log("el.outerHTML", el.outerHTML);
+ body.appendChild(style);
+
+ // 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
+ // 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
+ body.appendChild(content);
+ setTimeout(() => {
+ window.print();
+ body.removeChild(content);
+ body.removeChild(style);
+ }, 20);
+}
+
+
onMounted(()=>{
console.log(props.deliveryId)
- if(props.deliveryId===null || props.deliveryId===undefined || props.deliveryId===''){
+ /*if(props.deliveryId===null || props.deliveryId===undefined || props.deliveryId===''){
return
}
- form.value.deliveryId = props.deliveryId
+ form.value.deliveryId = props.deliveryId*/
+ if(route.query.deliveryID===null || route.query.deliveryID===undefined || route.query.deliveryID===''){
+ return
+ }
+ form.value.deliveryId=route.query.deliveryID
+
+
request.post(`/Delivery/getSelectDeliveryPrinting`,form.value).then((res) => {
if(res.code==200){
- produceList = deepClone(res.data.data)
- delivery=deepClone(res.data.delivery)
- console.log(produceList)
- console.log(delivery)
+ produceList.value = deepClone(res.data.data)
+ delivery.value=deepClone(res.data.delivery)
+ money.value=deepClone(res.data.money)
+
}else{
ElMessage.warning(res.msg)
router.push("/login")
@@ -41,184 +94,324 @@
})
+setTimeout(function(){
+ Printing()
+}, 1000);
+
+
</script>
<template>
- <div style="width: 100%;height: 100%">
- <div style="font-size: 30px;text-align: center">甯稿窞甯傚悏鍒╃幓鐠冩湁闄愬叕鍙�</div>
- <el-row :gutter="20">
- <el-col :span="6"><div></div></el-col>
- <el-col :span="12"><div style="font-size: 25px;text-align: center">閿�鍞彂璐у崟</div></el-col>
- <el-col :span="6">
- <div style="font-size: 20px;text-align: center;display: flex">
- <div>鍙戣揣鍗曞彿锛�</div>
- <div>{{delivery.deliveryId}}</div>
- </div>
- </el-col>
- </el-row>
- <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%">
- <table id="day-in" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%">
- <tr>
- <th>搴忓彿</th>
- <th>妤煎眰缂栧彿</th>
- <th>瀹�(寮у害)*楂�</th>
- <th>鏁伴噺</th>
- <th>闈㈢Н</th>
- <th>鍗曚环</th>
- <th>閲戦</th>
- <th>鍔犲伐瑕佹眰</th>
- </tr>
- <template v-for="(item, index) in produceList" :key="index" >
- <tr>
- <td colspan="3">浜у搧鍚嶇О:{{item.DeliveryDetail.orderDetail.productName}}</td>
- <td colspan="3">瀵规柟鍗曞彿:</td>
- <td colspan="2">璁㈠崟缂栧彿:{{item.DeliveryDetail.orderDetail.orderId}}</td>
- </tr>
+ <div>
+ <el-button @click="Printing" style="margin-top: -5px" id="searchButton" type="primary" >鎵撳嵃</el-button>
- <tr v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
- <td>{{items.order_number}}</td>
- <td>{{items.buildingNumber}}</td>
- <td>{{items.width}}x{{items.height}}</td>
- <td>{{items.quantity}}</td>
- <td>{{items.area}}</td>
- <td>{{items.price}}</td>
- <td>{{items.money}}</td>
- <td>{{items.processingNote}}</td>
- </tr>
- <tr>
- <td colspan="3">灏忚:</td>
- <td>{{item.DeliveryDetail.quantity}}</td>
- <td>{{item.DeliveryDetail.area}}</td>
- <td></td>
- <td>{{item.DeliveryDetail.money}}</td>
- <td></td>
- </tr>
+ <div id="pis" style="width: 100%;height: 100%">
+ <div style="font-size: 30px;text-align: center;font-weight: bold;">甯稿窞甯傚悏鍒╃幓鐠冩湁闄愬叕鍙�</div>
+ <el-row :gutter="20">
+ <el-col :span="7"><div></div></el-col>
+ <el-col :span="10"><div style="font-size: 25px;text-align: center;font-weight: bold;">閿�鍞彂璐у崟</div></el-col>
+ <el-col :span="7">
+ <div style="display: flex;margin-top: 10px;">
+ <div style="font-weight: bold;font-size: 15px">鍙戣揣鍗曞彿锛�</div>
+ <div style="font-weight: bold;font-size: 15px">{{delivery.deliveryId}}</div>
+ </div>
+ </el-col>
+ </el-row>
+ <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <tr>
+ <th style="text-align: left;border:none;" colspan="3">瀹㈡埛鍚嶇О锛�<span>{{delivery.customerName}}</span></th>
+ <th style="text-align: left;border:none;" colspan="3">椤圭洰鍚嶇О锛�<span>{{delivery.project}}</span></th>
+ <th style="text-align: left;border:none;" colspan="2">鑱旂郴浜猴細<span>{{delivery.contacts}}</span></th>
- </template>
- <tr>
- <td colspan="3">鍚堣:</td>
- <td>{{delivery.quantity}}</td>
- <td>{{delivery.area}}</td>
- <td></td>
- <td>{{delivery.money}}</td>
- <td></td>
- </tr>
- </table>
+ </tr>
+ <tr>
+ <th style="text-align: left;border:none;" colspan="6">閫佽揣鍦板潃锛�<span>{{delivery.deliveryAddress}}</span></th>
+ <th style="text-align: left;border:none;" colspan="2">鑱旂郴鐢佃瘽锛�<span>{{delivery.contactNumber}}</span></th>
+
+ </tr>
+ <tr>
+ <th style="width: 6%;">搴忓彿</th>
+ <th style="width: 20%;">妤煎眰缂栧彿</th>
+ <th style="width: 20%;">瀹�(寮у害)*楂�</th>
+ <th style="width: 10%;">鏁伴噺</th>
+ <th style="width: 10%;">闈㈢Н</th>
+ <th style="width: 10%;">鍗曚环</th>
+ <th style="width: 12%;">閲戦</th>
+ <th style="width: 12%;">鍔犲伐瑕佹眰</th>
+ </tr>
+
+ <template v-for="(item, index) in produceList" :key="index" >
+ <tr>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">浜у搧鍚嶇О:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">瀵规柟鍗曞彿:</td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="2">璁㈠崟缂栧彿:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td>
+ </tr>
+
+ <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
+ <td>{{items.order_number}}</td>
+ <td>{{items.buildingNumber}}</td>
+ <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
+ <td>{{items.quantity}}</td>
+ <td>{{items.area}}</td>
+ <td>{{items.price}}</td>
+ <td>{{items.money}}</td>
+ <td>{{items.processingNote}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">灏忚:</td>
+ <td>{{item.DeliveryDetail.quantity}}</td>
+ <td>{{item.DeliveryDetail.area}}</td>
+ <td></td>
+ <td>{{item.DeliveryDetail.money}}</td>
+ <td></td>
+ </tr>
+
+ </template>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">鍚堣:</td>
+ <td>{{delivery.quantity}}</td>
+ <td>{{delivery.area}}</td>
+ <td></td>
+ <td>{{delivery.money}}</td>
+ <td></td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3">
+ <div style="display: flex;font-size: 10px;">
+ <div>鍔犲伐璐圭敤</div>
+ <div style="margin-left: 20%">鍗曚环</div>
+ <div style="margin-left: 20%">鏁伴噺</div>
+ <div style="margin-left: 20%">閲戦</div>
+ </div>
+
+ </td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">鎬婚噾棰�: {{delivery.money}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">澶у啓閲戦: {{money}}</td>
+ </tr>
+ </table>
+ </div>
+ <el-row :gutter="20">
+ <el-col :span="3"><div class="bottom">鍒跺崟鍛橈細<span style="font-size: 10px">{{delivery.creator}}</span></div></el-col>
+ <el-col :span="5"><div class="bottom">鍒跺崟鏃ユ湡锛�<span style="font-size: 10px">{{delivery.createTime}}</span></div></el-col>
+ <el-col :span="4"><div class="bottom">鍙戣揣鍛橈細</div></el-col>
+ <el-col :span="4"><div class="bottom">鍙告満锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">瀹㈡埛绛惧瓧锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">绛炬敹鏃ユ湡锛�</div></el-col>
+
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="3"><div class="bottom">鏋跺瓙 鍙�</div></el-col>
+ <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col>
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
+ </el-row>
+
+
+
</div>
-<!-- <div style="border: 1px solid #d3dce6;border-collapse: collapse;">-->
-<!-- <el-row :gutter="20" >-->
-
-<!-- <el-col :span="9">-->
-<!-- <div style="font-size: 20px;display: flex">-->
-<!-- <div>瀹㈡埛鍚嶇О锛�</div>-->
-<!-- <div>甯稿窞甯傞噾瀹濈煶闂ㄧ獥鏈夐檺鍏徃</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="9">-->
-<!-- <div style="font-size: 20px;display: flex">-->
-<!-- <div>椤圭洰鍚嶇О锛�</div>-->
-<!-- <div>鍏洯閬�</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="6">-->
-<!-- <div style="font-size: 20px;display: flex">-->
-<!-- <div>鑱旂郴浜猴細</div>-->
-<!-- <div></div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
-
-<!-- <el-row :gutter="20" >-->
-<!-- <el-col :span="18">-->
-<!-- <div style="font-size: 20px;display: flex">-->
-<!-- <div>閫佽揣鍦板潃锛�</div>-->
-<!-- <div></div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="6">-->
-<!-- <div style="font-size: 20px;display: flex">-->
-<!-- <div>鑱旂郴鐢佃瘽锛�</div>-->
-<!-- <div></div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
-<!-- </div>-->
-
-<!-- <div style="border: 1px solid #d3dce6;border-collapse: collapse;">-->
-<!-- <el-row :gutter="20" >-->
-
-<!-- <el-col :span="2">-->
-<!-- <div class="alias">-->
-<!-- <div>搴忓彿</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="5">-->
-<!-- <div class="alias">-->
-<!-- <div>妤煎眰缂栧彿</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="5">-->
-<!-- <div class="alias">-->
-<!-- <div>瀹�(寮ч暱)*楂�</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="2">-->
-<!-- <div class="alias">-->
-<!-- <div>鏁伴噺</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="2">-->
-<!-- <div class="alias">-->
-<!-- <div>闈㈢Н</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="2">-->
-<!-- <div class="alias">-->
-<!-- <div>鍗曚环</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="2">-->
-<!-- <div class="alias" >-->
-<!-- <div>閲戦</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- <el-col :span="4">-->
-<!-- <div class="alias" >-->
-<!-- <div>鍔犲伐瑕佹眰</div>-->
-<!-- </div>-->
-<!-- </el-col>-->
-<!-- </el-row>-->
-
-
-<!-- </div>-->
-
-
</div>
+</template>
+
+<style>
+@media print{
+ @page {
+ mso-header:none;
+ margin: 10mm 16mm;
+ margin-bottom: 8mm;
+ margin-top:8mm;
+
+ }
+}
+#table1 tr{
+ height: 30px;
+}
+#table1 th{
+ height: 30px;
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
+ font-size: 15px;
+ font-weight: bold;
+}
+.day-in td{
+text-align: center;
+}
+#table1 td{
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
+}
+#deliveryPrinting .el-dialog__header{
+ visibility:hidden
+}
+
+.el-overlay-dialog{
+ overflow-y: scroll;
+}
+::-webkit-scrollbar {
+ display: none;
+}
+.bottom{
+ font-size: 10px;
+ font-weight: bold;
+
+}
+
+</style>
+<!--
+<template>
+
+ <div>
+ <div id="pis" style="width: 100%;height: 100%">
+ <div style="font-size: 35px;text-align: center;font-weight: bold;">甯稿窞甯傚悏鍒╃幓鐠冩湁闄愬叕鍙�</div>
+ <el-row :gutter="20">
+ <el-col :span="6"><div></div></el-col>
+ <el-col :span="12"><div style="font-size: 30px;text-align: center;font-weight: bold;">閿�鍞彂璐у崟</div></el-col>
+ <el-col :span="6">
+ <div style="font-size: 20px;display: flex;margin-top: 10px">
+ <div style="font-weight: bold;">鍙戣揣鍗曞彿锛�</div>
+ <div style="font-weight: bold;">{{delivery.deliveryId}}</div>
+ </div>
+ </el-col>
+ </el-row>
+ <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <tr>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">瀹㈡埛鍚嶇О锛歿{delivery.customerName}}</th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">椤圭洰鍚嶇О锛歿{delivery.project}}</th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">鑱旂郴浜猴細{{delivery.contacts}}</th>
+
+ </tr>
+ <tr>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="6">閫佽揣鍦板潃锛歿{delivery.deliveryAddress}}</th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">鑱旂郴鐢佃瘽锛歿{delivery.contactNumber}}</th>
+
+ </tr>
+ <tr>
+ <th style="width: 6%;font-size: 15px;font-weight: bold;">搴忓彿</th>
+ <th style="width: 20%;font-size: 15px;font-weight: bold;">妤煎眰缂栧彿</th>
+ <th style="width: 20%;font-size: 15px;font-weight: bold;">瀹�(寮у害)*楂�</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">鏁伴噺</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">闈㈢Н</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">鍗曚环</th>
+ <th style="width: 12%;font-size: 15px;font-weight: bold;">閲戦</th>
+ <th style="width: 12%;font-size: 15px;font-weight: bold;">鍔犲伐瑕佹眰</th>
+ </tr>
+
+ <template v-for="(item, index) in produceList" :key="index" >
+ <tr>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">浜у搧鍚嶇О:{{item.DeliveryDetail.orderDetail.productName}}</td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">瀵规柟鍗曞彿:</td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="2">璁㈠崟缂栧彿:{{item.DeliveryDetail.orderDetail.orderId}}</td>
+ </tr>
+
+ <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
+ <td>{{items.order_number}}</td>
+ <td>{{items.buildingNumber}}</td>
+ <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
+ <td>{{items.quantity}}</td>
+ <td>{{items.area}}</td>
+ <td>{{items.price}}</td>
+ <td>{{items.money}}</td>
+ <td>{{items.processingNote}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">灏忚:</td>
+ <td>{{item.DeliveryDetail.quantity}}</td>
+ <td>{{item.DeliveryDetail.area}}</td>
+ <td></td>
+ <td>{{item.DeliveryDetail.money}}</td>
+ <td></td>
+ </tr>
+
+ </template>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">鍚堣:</td>
+ <td>{{delivery.quantity}}</td>
+ <td>{{delivery.area}}</td>
+ <td></td>
+ <td>{{delivery.money}}</td>
+ <td></td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3">
+ <div style="display: flex">
+ <div>鍔犲伐璐圭敤</div>
+ <div style="margin-left: 20%">鍗曚环</div>
+ <div style="margin-left: 20%">鏁伴噺</div>
+ <div style="margin-left: 20%">閲戦</div>
+ </div>
+
+ </td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">鎬婚噾棰�: {{delivery.money}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">澶у啓閲戦: {{money}}</td>
+ </tr>
+ </table>
+ </div>
+ <el-row :gutter="20">
+ <el-col :span="3"><div class="bottom">鍒跺崟鍛橈細<span style="font-size: 15px">{{delivery.creator}}</span></div></el-col>
+ <el-col :span="5"><div class="bottom">鍒跺崟鏃ユ湡锛�<span style="font-size: 15px">{{delivery.createTime}}</span></div></el-col>
+ <el-col :span="4"><div class="bottom">鍙戣揣鍛橈細</div></el-col>
+ <el-col :span="4"><div class="bottom">鍙告満锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">瀹㈡埛绛惧瓧锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">绛炬敹鏃ユ湡锛�</div></el-col>
+
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="3"><div class="bottom">鏋跺瓙 鍙�</div></el-col>
+ <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col>
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
+ </el-row>
+
+
+
+ </div>
+ </div>
</template>
<style >
-.el-row {
- margin-bottom: 10px;
+#table1 tr{
+ height: 30px;
}
-.el-row:last-child {
- margin-bottom: 0;
+#table1 th{
+ height: 30px;
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
}
-.el-col {
- border-radius: 4px;
-}
-
-.grid-content {
- border-radius: 4px;
- min-height: 36px;
-}
-.alias{
+.day-in td{
text-align: center;
- font-size: 20px;
+}
+#table1 td{
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
+}
+#deliveryPrinting .el-dialog__header{
+ visibility:hidden
}
-</style>
\ No newline at end of file
+.el-overlay-dialog{
+ overflow-y: scroll;
+}
+::-webkit-scrollbar {
+ display: none;
+}
+.bottom{
+ font-size: 20px;
+ font-weight: bold;
+
+}
+
+</style>-->
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
index 6d21a00..fe180ed 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
@@ -26,8 +26,10 @@
break
}
case 'printing' :{
- const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
+ /*const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
window.open(url.href, '_blank')
+ break*/
+ router.push({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
break
}
case 'delete':{
@@ -355,10 +357,11 @@
<el-dialog
v-model="dialogTableVisible"
destroy-on-close
- style="width: 75%;height:70% ">
+ id="deliveryPrinting"
+ style="width: 100%;height:100%;margin-top: 0; ">
<DeliveryPrinting
:deliveryId="rowClickIndex.deliveryId"
- style="width: 100%;height: 100%" />
+ style="width: 100%;height: 100%;" />
</el-dialog>
</div>
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 2b482a9..45bd176 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
@@ -7,6 +7,7 @@
import deepClone from "@/utils/deepClone"
import useUserInfoStore from '@/stores/userInfo'
import SelectProduct from "@/views/sd/product/SelectProduct.vue"
+import OrderOtherMoney from "@/components/sd/order/OrderOtherMoney.vue"
import {changeFilterEvent,filterChanged} from "@/hook"
import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove"
import downLoadFile from "@/hook/downLoadFile"
@@ -15,6 +16,9 @@
let dialogTableVisible = ref(false)
let productVisible = ref(false)
+let errorAreaVisible = ref(false)
+let otherMoneyVisible = ref(false)
+let errorArea = ref(null)
const userStore = useUserInfoStore()
const router = useRouter()
const route = useRoute()
@@ -53,6 +57,7 @@
})
//瀹氫箟鎺ユ敹鍔犺浇琛ㄥご涓嬫媺鏁版嵁
const titleSelectJson = ref({
+ orderOtherMoney:[],
orderType:[],
alType:[],
icon:[],
@@ -64,6 +69,7 @@
let filterData = ref({})
let rowIndex = ref(null)
let rowClickIndex = ref(null)
+let otherMoney = ref(null)
const gridOptions = reactive({
border: "full",//琛ㄦ牸鍔犺竟妗�
@@ -88,6 +94,8 @@
{ code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false },
{ code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false },
{ code: 'computedMoney', name: t('basicData.calculateAmount'), prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: true },
+ { code: 'errorArea', name: '璇樊缁撶畻闈㈢Н', prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false },
+ { code: 'otherMoney', name: '鍏朵粬閲戦', prefixIcon: 'vxe-icon-chart-bar-x', visible: true, disabled: false }
]
]
}
@@ -105,7 +113,8 @@
editConfig: {
trigger: 'click',
mode: 'cell',
- showStatus: true
+ showStatus: true,
+ showIcon:false
},//琛ㄥご鍙傛暟
columns:[
{type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 },
@@ -129,7 +138,8 @@
{field: 'bendRadius',width:160, title: t('order.bendRadius'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
{field: 'edgingType',width:160, title: t('order.edgingType'),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: 'remarks',width:140, title: t('basicData.remarks'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged},
+
],
//琛ㄥ崟楠岃瘉
@@ -297,7 +307,8 @@
}
let order ={
title:titleUploadData.value,
- detail:$grid.getTableData().tableData
+ detail:$grid.getTableData().tableData,
+ otherMoney:otherMoney.value
}
saveOrder(order)
}
@@ -305,7 +316,8 @@
}
}
}
- },//鍙抽敭鎸夐挳浜嬩欢
+ },
+ //鍙抽敭鎸夐挳浜嬩欢
menuClick ({ menu, row, column }) {
const $grid = xGrid.value
if ($grid) {
@@ -383,6 +395,14 @@
titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString()
gridOptions.menuConfig.body.options[0][5].disabled=true
+ break
+ }
+ case 'errorArea' :{
+ errorAreaVisible.value=true
+ break
+ }
+ case 'otherMoney' :{
+ otherMoneyVisible.value=true
break
}
}
@@ -470,11 +490,14 @@
}
if(res.data.order.productionOrder !==0 ){
gridOptions.toolbarConfig.buttons[2].disabled = true
-
}
+ const orderDetails = res.data.orderDetails
+ orderDetails.forEach(item => {
+ item.otherColumns = JSON.parse(item.otherColumns)
+ })
//鍔犺浇鍓〃鏁版嵁
- xGrid.value.reloadData(res.data.orderDetails)
+ xGrid.value.reloadData(orderDetails)
}else{
ElMessage.error(res.msg)
}
@@ -495,9 +518,17 @@
//椤甸潰绗竴娆″姞杞芥墽琛�
request.get(`/basicData/orderBasicData`).then((res) => {
-
if(res.code==200){
titleSelectJson.value=deepClone(res.data)
+ //鍏朵粬閲戦
+ otherMoney.value = titleSelectJson.value.orderOtherMoney[0]
+ //let columns = []
+ otherMoney.value.forEach(item => {
+ let column = {field: `otherColumns.${item.column}`,width:50, title: item.alias,editRender: { name: 'input'}}
+ //columns.push(column)
+ gridOptions.columns.push(column)
+ })
+
//杩涘叆椤甸潰涓嬫媺妗嗚缃粯璁ゅ��
titleUploadData.value.orderType = titleSelectJson.value.orderType[0].basicName
titleUploadData.value.orderClassify = titleSelectJson.value.orderClassify[0].basicName
@@ -595,6 +626,9 @@
list.forEach((item)=>{
countMoney += parseFloat(item.grossAmount)
})
+ otherMoney.value.forEach(item => {
+ countMoney+=item.quantity*item.price
+ })
return parseFloat((countMoney).toFixed(2))
}
//瀵煎叆鍔熻兘
@@ -636,6 +670,16 @@
downLoadFile('/importTemplate.xlsx','importTemplate.xlsx')
}
+//瀛楃涓茶浆object
+
+function getNestedProperty(obj, path) {
+ return path.split('.').reduce(function(o, p) {
+ if(o && o.hasOwnProperty(p)) {
+ return o[p];
+ }
+ }, obj);
+}
+
//琛屽崟鍏冩牸淇敼淇敼瑙﹀彂姝や簨浠�
const editClosedEvent = ({ row, column }) => {
//鍒ゆ柇淇敼鐩稿簲鐨勬暟鍊间慨鏀归潰绉笌閲戦
@@ -648,11 +692,57 @@
}else if(column.property === 'computeArea'){
row.computeGrossArea=parseFloat((row.computeArea*row.quantity).toFixed(2))
row.grossAmount=parseFloat((row.price * row.computeGrossArea).toFixed(2))
+ }else if(column.property.indexOf('otherColumns.M')>-1){
+ let quantity = 0
+ xGrid.value.getTableData().fullData.forEach(item => {
+ quantity += item.quantity*(getNestedProperty(item,column.property)*1)
+ })
+ if(!isNaN(quantity)){
+ otherMoney.value.forEach(item => {
+ if(item.column===column.property.split('.')[1]){
+ item.quantity = quantity
+ }
+ })
+ }
}
+ titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString()
- titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString()
+
}
+//璇樊闈㈢Н璁$畻鏂规硶
+const errorAreaComputed = () => {
+ const regex = /^(0(\.\d{1,2})?|([1-9]\d{0,4})(\.\d{1,2})?|99999(\.9{1,2})?)$/
+ if (!regex.test(errorArea.value)) {
+ ElMessage.warning(t('basicData.msg.range99999Dec2'))
+ return
+ }
+ const fullData = xGrid.value.getTableData().fullData
+ if (!fullData.length){
+ ElMessage.warning("琛ㄦ牸涓棤浜у搧鏁版嵁")
+ }
+ fullData.forEach((item,index) => {
+ if( !isNaN(item.computeArea*1) && item.computeArea != null && item.computeArea*1 < errorArea.value){
+ item.computeArea = errorArea.value
+ item.computeGrossArea = parseFloat((item.computeArea*item.quantity).toFixed(2))
+ item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2))
+ }
+ })
+ titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString()
+ errorAreaVisible.value= false
+}
+
+
+
+//鍏抽棴鍏朵粬閲戦鐣岄潰
+const refOtherMoney = ref()
+const closeOtherMoneyDialog = async (done) => {
+ const flag = await refOtherMoney.value.validate()
+ if(flag){
+ done()
+ titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString()
+ }
+}
</script>
@@ -765,7 +855,7 @@
<el-row>
<el-col :span="2"><el-text>{{$t('order.money')}}锛�</el-text></el-col>
<el-col :span="2"><el-text >{{titleUploadData.money}}</el-text></el-col>
- <el-col :span="2"><el-text>{{$t('order.customers')}}锛�</el-text></el-col>
+ <el-col :span="2"><el-text>{{$t('order.contractId')}}锛�</el-text></el-col>
<el-col :span="2"><el-input v-model="titleUploadData.contractId"/></el-col>
<el-col :span="2"><el-text>{{$t('order.customerBatch')}}:</el-text></el-col>
<el-col :span="2"><el-input v-model="titleUploadData.customerBatch"/></el-col>
@@ -825,7 +915,31 @@
<el-dialog v-model="productVisible" style="width: 80%;height:75% ">
<select-product :rowIndex="rowIndex" @getProductRow="getProductRow" style="width: 100%;height: 100%" />
</el-dialog>
-
+<!--璇樊缁撶畻-->
+ <el-dialog v-model="errorAreaVisible" style="width: 300px;height:150px ">
+ <el-row>
+ <el-col :span="10">
+ <el-input
+ v-model="errorArea"
+ :placeholder="'璇樊鍊�'"
+ />
+ </el-col>
+ <el-col :span="6">
+ <el-button @click="errorAreaComputed">纭</el-button>
+ </el-col>
+ </el-row>
+ </el-dialog>
+ <el-dialog v-model="otherMoneyVisible"
+ :title="'鍏朵粬閲戦'"
+ :close-on-click-modal="false"
+ :close-on-press-escape="false"
+ :before-close="closeOtherMoneyDialog"
+ style="width: 614px;height:445px ">
+ <order-other-money
+ ref="refOtherMoney"
+ :otherMoney="otherMoney"
+ style="width: 100%;height: 100%" />
+ </el-dialog>
</div>
</template>
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicDataController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicDataController.java
index d53e458..ecc355f 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicDataController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicDataController.java
@@ -3,7 +3,6 @@
import com.example.erp.common.Result;
import com.example.erp.entity.sd.BasicData;
import com.example.erp.service.sd.BasicDateService;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
@@ -11,8 +10,13 @@
@RestController
@RequestMapping("/basicData")
public class BasicDataController {
- @Autowired
+ final
BasicDateService basicDateService;
+
+ public BasicDataController(BasicDateService basicDateService) {
+ this.basicDateService = basicDateService;
+ }
+
@GetMapping("/orderBasicData")
public Result getOrderBasicData(){
return Result.seccess(basicDateService.getOrderBasicData());
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicOtherMoneyController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicOtherMoneyController.java
new file mode 100644
index 0000000..b82fd64
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/BasicOtherMoneyController.java
@@ -0,0 +1,34 @@
+package com.example.erp.controller.sd;
+
+import com.example.erp.common.Result;
+import com.example.erp.entity.sd.BasicData;
+import com.example.erp.service.sd.BasicOtherMoneyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/basicOtherMoney")
+public class BasicOtherMoneyController {
+ private final BasicOtherMoneyService basicOtherMoneyService;
+
+ public BasicOtherMoneyController(BasicOtherMoneyService basicOtherMoneyService) {
+ this.basicOtherMoneyService = basicOtherMoneyService;
+ }
+
+ @GetMapping("findAll")
+ @PostMapping("findAll")
+ public Result findAll(){
+ return Result.seccess(basicOtherMoneyService.findAll());
+ }
+
+ @PostMapping("deleteById/{id}")
+ public Result deleteById(@PathVariable("id") Integer id){
+ return Result.seccess(basicOtherMoneyService.deleteById(id));
+ }
+
+ @PostMapping("save")
+ public Result save(String alias){
+ return Result.seccess(basicOtherMoneyService.save(alias));
+ }
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicOtherMoney.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicOtherMoney.java
new file mode 100644
index 0000000..68323cf
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/BasicOtherMoney.java
@@ -0,0 +1,25 @@
+package com.example.erp.entity.sd;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+import org.apache.poi.hpsf.Decimal;
+
+import javax.persistence.Column;
+import java.math.BigDecimal;
+
+@Data
+public class BasicOtherMoney {
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+ @TableField(value = "`column`")
+ private String column;
+ private String alias;
+ @Column(length=7 ,scale=2)
+ private BigDecimal quantity;
+ @Column(length=7 ,scale=2)
+ private BigDecimal price;
+ private Boolean state;
+
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderDetail.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderDetail.java
index b36b3aa..6da7abe 100644
--- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderDetail.java
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderDetail.java
@@ -35,6 +35,7 @@
private String edgingType;
private Double weight;
private Double perimeter;
+ private String otherColumns;
private Integer warehouseNum;
private Integer deliveryNum;
private Integer returnNum;
diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderOtherMoney.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderOtherMoney.java
new file mode 100644
index 0000000..6e7d91f
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderOtherMoney.java
@@ -0,0 +1,21 @@
+package com.example.erp.entity.sd;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Data
+public class OrderOtherMoney {
+ @TableId(type = IdType.AUTO)
+ private Integer id;
+ private String orderId;
+ @TableField(value = "`column`")
+ private String column;
+ private Double quantity;
+ private Double price;
+ private Double money;
+ private LocalDateTime createTime;
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicOtherMoneyMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicOtherMoneyMapper.java
new file mode 100644
index 0000000..29d9b14
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/BasicOtherMoneyMapper.java
@@ -0,0 +1,9 @@
+package com.example.erp.mapper.sd;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.erp.entity.sd.BasicOtherMoney;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface BasicOtherMoneyMapper extends BaseMapper<BasicOtherMoney> {
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderOtherMoneyMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderOtherMoneyMapper.java
new file mode 100644
index 0000000..b432ebf
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/OrderOtherMoneyMapper.java
@@ -0,0 +1,9 @@
+package com.example.erp.mapper.sd;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.example.erp.entity.sd.OrderOtherMoney;
+import org.apache.ibatis.annotations.Mapper;
+
+@Mapper
+public interface OrderOtherMoneyMapper extends BaseMapper<OrderOtherMoney> {
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java b/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
index 38df1b3..30b5cad 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/mm/FinishedGoodsInventoryService.java
@@ -88,7 +88,7 @@
Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(flowCard.getOrder().getOrderId());
Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(flowCard.getOrder().getOrderId());
- System.out.println("璁㈠崟鎬绘暟:" + ordersum + "宸插叆搴撴暟閲忥細" + ordernumbersum + "鍑嗗鍏ュ簱鏁伴噺" + flowCard.getInventoryQuantity());
+ /*System.out.println("璁㈠崟鎬绘暟:" + ordersum + "宸插叆搴撴暟閲忥細" + ordernumbersum + "鍑嗗鍏ュ簱鏁伴噺" + flowCard.getInventoryQuantity());*/
if (finishedGoodsInventorycount > 0) {
//淇敼搴撳瓨琛ㄥ叆搴撴暟閲�
finishedGoodsInventoryMapper.updateInventory(flowCard,storageRegion, remark);
@@ -183,9 +183,9 @@
deliverydetailsum=0;
}
- System.out.println("璁㈠崟鎬绘暟:" + ordersum + "璁㈠崟宸插彂鏁伴噺锛�" + orderDeliveryQuantitySum + "鍑嗗鍑哄簱鏁伴噺" +
+ /*System.out.println("璁㈠崟鎬绘暟:" + ordersum + "璁㈠崟宸插彂鏁伴噺锛�" + orderDeliveryQuantitySum + "鍑嗗鍑哄簱鏁伴噺" +
orderDetail.getWarehouseNum()+ "鍙戣揣鏁伴噺" + orderDetail.getDeliveryDetail().getQuantity()+ "鍙戣揣鎬绘暟" +
- deliverysum+ "宸插彂鏁伴噺" + deliverydetailsum);
+ deliverysum+ "宸插彂鏁伴噺" + deliverydetailsum);*/
if (finishedGoodsInventorycount > 0) {
if(orderDetail.getWarehouseNum()>=orderDetail.getDeliveryDetail().getQuantity()){
//淇敼搴撳瓨琛ㄥ簱瀛樻暟閲�
@@ -607,7 +607,7 @@
for (FinishedOperateLog finishedOperateLog : finishedOperateLogslist) {
Integer ordersum = finishedGoodsInventoryMapper.findOrderQuantity(finishedOperateLog.getOrderId());
Integer ordernumbersum = finishedGoodsInventoryMapper.findOrderNumberdsum(finishedOperateLog.getOrderId());
- System.out.println(finishedOperateLog.getOperateType());
+
if(Objects.equals(finishedOperateLog.getOperateType(), "鍏ュ簱")){
//淇敼璁板綍琛�
finishedOperateLogMapper.updateFinishedOperateLogState(finishedOperateLog,"宸蹭綔搴�");
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
index d88eddb..818301d 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicDateService.java
@@ -1,23 +1,29 @@
package com.example.erp.service.sd;
import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.erp.entity.sd.BasicData;
import com.example.erp.entity.sd.Customer;
import com.example.erp.mapper.sd.BasicDateMapper;
+import com.example.erp.mapper.sd.BasicOtherMoneyMapper;
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.*;
@Service
@DS("sd")
public class BasicDateService {
- @Autowired
- private BasicDateMapper basicDateMapper;
+ private final BasicDateMapper basicDateMapper;
- @Autowired
- private CustomerMapper customerMapper;
+ private final CustomerMapper customerMapper;
+ private final BasicOtherMoneyMapper basicOtherMoneyMapper;
+
+ public BasicDateService(BasicDateMapper basicDateMapper, CustomerMapper customerMapper, BasicOtherMoneyMapper basicOtherMoneyMapper) {
+ this.basicDateMapper = basicDateMapper;
+ this.customerMapper = customerMapper;
+ this.basicOtherMoneyMapper = basicOtherMoneyMapper;
+ }
//鑾峰彇璁㈠崟鍩烘湰鏁版嵁
public Map<String, List<Object>> getOrderBasicData() {
@@ -36,6 +42,8 @@
orderBasicDataMap.get("customer").add(customer);
}
+ orderBasicDataMap.put("orderOtherMoney", Collections.singletonList(basicOtherMoneyMapper.selectList(null)));
+
//杩斿洖Map瀵硅薄
return orderBasicDataMap;
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicOtherMoneyService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicOtherMoneyService.java
new file mode 100644
index 0000000..14d50af
--- /dev/null
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/BasicOtherMoneyService.java
@@ -0,0 +1,33 @@
+package com.example.erp.service.sd;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.example.erp.entity.sd.BasicOtherMoney;
+import com.example.erp.mapper.sd.BasicOtherMoneyMapper;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+@DS("sd")
+public class BasicOtherMoneyService {
+ private final BasicOtherMoneyMapper basicOtherMoneyMapper;
+
+ public BasicOtherMoneyService(BasicOtherMoneyMapper basicOtherMoneyMapper) {
+ this.basicOtherMoneyMapper = basicOtherMoneyMapper;
+ }
+
+ public List<BasicOtherMoney> findAll() {
+ return basicOtherMoneyMapper.selectList(null);
+
+ }
+
+ public int deleteById(Integer id) {
+ return basicOtherMoneyMapper.deleteById(id);
+ }
+
+ public int save(String alias) {
+ BasicOtherMoney basicOtherMoney = new BasicOtherMoney();
+ basicOtherMoney.setAlias(alias);
+ return basicOtherMoneyMapper.insert(basicOtherMoney);
+ }
+}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
index 87e2360..c14a556 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
@@ -1,5 +1,6 @@
package com.example.erp.service.sd;
+import com.alibaba.excel.util.StringUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
@@ -22,6 +23,7 @@
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
+import java.math.BigDecimal;
@Service
@DS("sd")
@@ -268,26 +270,268 @@
public Map<String, Object> getSelectDeliveryPrinting( DeliveryDetail deliveryDetail) {
Map<String, Object> map = new HashMap<>();
List <Map<String, Object>> list=new ArrayList<Map<String, Object>>();//鏈�缁堢粨鏋�
- System.out.println(deliveryDetail);
List<DeliveryDetail> deliveryDetailList=deliveryDetailMapper.getSelectDeliveryPrinting(deliveryDetail);
- for (int i = 0; i < deliveryDetailList.size(); i++) {
+ for (DeliveryDetail detail : deliveryDetailList) {
Map<String, Object> itemmap = new HashMap<>();
-
- List <Map<String, Object>> deliveryDetailList2=deliveryDetailMapper.getSelectDeliveryDetailPrinting(deliveryDetailList.get(i).getDeliveryId(),
- deliveryDetailList.get(i).getOrderDetail().getProductId(),deliveryDetailList.get(i).getOrderDetail().getOrderId());
- itemmap.put("DeliveryDetail",deliveryDetailList.get(i));
- itemmap.put("DeliveryDetailList",deliveryDetailList2);
+ List<Map<String, Object>> deliveryDetailList2 = deliveryDetailMapper.getSelectDeliveryDetailPrinting(detail.getDeliveryId(),
+ detail.getOrderDetail().getProductId(), detail.getOrderDetail().getOrderId());
+ itemmap.put("DeliveryDetail", detail);
+ itemmap.put("DeliveryDetailList", deliveryDetailList2);
list.add(itemmap);
}
+ Delivery delivery=deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail);
map.put("data", list);
map.put("delivery", deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail));
+ map.put("money", toChinese(delivery.getMoney().toString(), false));
return map;
}
+ private static final String[] NUMBERS = {"闆�", "澹�", "璐�", "鍙�", "鑲�", "浼�", "闄�", "鏌�", "鎹�", "鐜�"};
+
+ private static final String[] IUNIT = {"鍏�", "鎷�", "浣�", "浠�", "涓�", "鎷�", "浣�", "浠�", "浜�", "鎷�", "浣�", "浠�"};
+
+ private static final String[] DUNIT = {"瑙�", "鍒�"};
+
+ private static final String[] CN_NUMBERS = {"闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�"};
+
+ private static final String[] CN_IUNIT = {"", "鍗�", "鐧�", "鍗�", "涓�", "鍗�", "鐧�", "鍗�", "浜�", "鍗�", "鐧�", "鍗�"};
+
+
+
+ /**
+ * 杞崲涓哄ぇ鍐欑殑涓枃閲戦,鏀寔璐熸暟
+ * @param amount 閲戦
+ * @param isSimplified 鏄惁绠�浣撲腑鏂囷細true:绠�浣擄紝false锛氱箒浣�
+ * @return
+ */
+ public static String toChinese(String amount, boolean isSimplified) {
+ // 鍒ゆ柇杈撳叆鐨勯噾棰濆瓧绗︿覆鏄惁绗﹀悎瑕佹眰
+ if (StringUtils.isBlank(amount) || !amount.matches("(-)?[\\d]*(.)?[\\d]*")) {
+ throw new RuntimeException("璇疯緭鍏ユ暟瀛�");
+ }
+
+ if ("0".equals(amount) || "0.00".equals(amount) || "0.0".equals(amount)) {
+ return isSimplified ? "闆�" : "闆跺厓";
+ }
+
+ // 鍒ゆ柇閲戦鏁板瓧涓槸鍚﹀瓨鍦ㄨ礋鍙�"-"
+ boolean flag = false;
+ if (amount.startsWith("-")) {
+ // 鏍囧織浣嶏紝鏍囧織姝ら噾棰濇暟瀛椾负璐熸暟
+ flag = true;
+ amount = amount.replaceAll("-", "");
+ }
+ // 鍘绘帀閲戦鏁板瓧涓殑閫楀彿","
+ amount = amount.replaceAll(",", "");
+ // 鍒濆鍖栵細鍒嗙鏁存暟閮ㄥ垎鍜屽皬鏁伴儴鍒�
+ String[] separateNum = separateNum(amount);
+ // 鏁存暟閮ㄥ垎鏁板瓧
+ String integerStr = separateNum[0];
+ // 灏忔暟閮ㄥ垎鏁板瓧
+ String decimalStr = separateNum[1];
+ // beyond瓒呭嚭璁$畻鑳藉姏锛岀洿鎺ヨ繑鍥�
+ if (integerStr.length() > IUNIT.length) {
+ throw new RuntimeException("杈撳叆鏁板瓧瓒呴檺");
+ }
+ // 鏁存暟閮ㄥ垎鏁板瓧
+ int[] integers = toIntArray(integerStr);
+ // 鍒ゆ柇鏁存暟閮ㄥ垎鏄惁瀛樺湪杈撳叆012鐨勬儏鍐�
+ if (integers.length > 1 && integers[0] == 0) {
+ throw new RuntimeException("杈撳叆鏁板瓧涓嶇鍚堣姹�");
+ }
+ // 璁剧疆涓囧崟浣�
+ boolean isWan = isWan5(integerStr);
+ // 灏忔暟閮ㄥ垎鏁板瓧
+ int[] decimals = toIntArray(decimalStr);
+ // 杩斿洖鏈�缁堢殑澶у啓閲戦
+ String result = "";
+ String chineseInteger = getChineseInteger(integers, isWan, isSimplified);
+ String chineseDecimal = getChineseDecimal(decimals, isSimplified);
+ if (decimals.length > 0 && isSimplified) {
+ result = chineseInteger;
+ if (!chineseDecimal.equals("闆堕浂")) {
+ result = result + "鐐�" + chineseDecimal;
+ }
+ } else {
+ result = chineseInteger + chineseDecimal;
+
+ }
+ if (flag) {
+ // 濡傛灉鏄礋鏁帮紝鍔犱笂"璐�"
+ return "璐�" + result;
+ } else {
+ return result;
+ }
+ }
+
+ /**
+ * 鍒嗙鏁存暟閮ㄥ垎鍜屽皬鏁伴儴鍒�
+ * @param str
+ * @return
+ */
+ private static String[] separateNum(String str) {
+ String integerStr;// 鏁存暟閮ㄥ垎鏁板瓧
+ String decimalStr;// 灏忔暟閮ㄥ垎鏁板瓧
+ if (str.indexOf('.') >= 1) {
+ integerStr = str.substring(0, str.indexOf('.'));
+ decimalStr = str.substring(str.indexOf('.') + 1);
+ if (decimalStr.length() > 2) {
+ decimalStr = decimalStr.substring(0, 2);
+ }
+ } else if (str.indexOf('.') == 0) {
+ integerStr = "";
+ decimalStr = str.substring(1);
+ } else {
+ integerStr = str;
+ decimalStr = "";
+ }
+ return new String[] {integerStr, decimalStr};
+ }
+
+ /**
+ * 灏嗗瓧绗︿覆杞负int鏁扮粍
+ * @param number 鏁板瓧
+ * @return
+ */
+ private static int[] toIntArray(String number) {
+ int[] array = new int[number.length()];
+ for (int i = 0; i < number.length(); i++) {
+ array[i] = Integer.parseInt(number.substring(i, i + 1));
+ }
+ return array;
+ }
+
+ /**
+ * 灏嗘暣鏁伴儴鍒嗚浆涓哄ぇ鍐欑殑閲戦
+ * @param integers 鏁存暟閮ㄥ垎鏁板瓧
+ * @param isWan 鏁存暟閮ㄥ垎鏄惁宸茬粡鏄揪鍒般�愪竾銆�
+ * @return
+ */
+ private static String getChineseInteger(int[] integers, boolean isWan, boolean isSimplified) {
+
+ int length = integers.length;
+ if (!isSimplified && length == 1 && integers[0] == 0) {
+ return "";
+ }
+ if (!isSimplified) {
+ return traditionalChineseInteger(integers, isWan);
+ } else {
+ return simplifiedChineseInteger(integers, isWan);
+ }
+ }
+
+ /**
+ * 绻佷綋涓枃鏁存暟
+ * @param integers
+ * @param isWan
+ * @return
+ */
+ private static String traditionalChineseInteger(int[] integers, boolean isWan) {
+ StringBuilder chineseInteger = new StringBuilder("");
+ int length = integers.length;
+ for (int i = 0; i < length; i++) {
+ String key = "";
+ if (integers[i] == 0) {
+ if ((length - i) == 13)// 涓囷紙浜匡級
+ key = IUNIT[4];
+ else if ((length - i) == 9) {// 浜�
+ key = IUNIT[8];
+ } else if ((length - i) == 5 && isWan) {// 涓�
+ key = IUNIT[4];
+ } else if ((length - i) == 1) {// 鍏�
+ key = IUNIT[0];
+ }
+ if ((length - i) > 1 && integers[i + 1] != 0) {
+ key += NUMBERS[0];
+ }
+ }
+ chineseInteger.append(integers[i] == 0 ? key : (NUMBERS[integers[i]] + IUNIT[length - i - 1]));
+ }
+ return chineseInteger.toString();
+ }
+
+ /**
+ * 绠�浣撲腑鏂囨暣鏁�
+ * @param integers
+ * @param isWan
+ * @return
+ */
+ private static String simplifiedChineseInteger(int[] integers, boolean isWan) {
+ StringBuilder chineseInteger = new StringBuilder("");
+ int length = integers.length;
+ for (int i = 0; i < length; i++) {
+ String key = "";
+ if (integers[i] == 0) {
+ if ((length - i) == 13) {// 涓囷紙浜匡級
+ key = CN_IUNIT[4];
+ } else if ((length - i) == 9) {// 浜�
+ key = CN_IUNIT[8];
+ } else if ((length - i) == 5 && isWan) {// 涓�
+ key = CN_IUNIT[4];
+ } else if ((length - i) == 1) {// 鍏�
+ key = CN_IUNIT[0];
+ }
+ if ((length - i) > 1 && integers[i + 1] != 0) {
+ key += CN_NUMBERS[0];
+ }
+ if (length == 1 && integers[i] == 0) {
+ key += CN_NUMBERS[0];
+ }
+ }
+ chineseInteger.append(integers[i] == 0 ? key : (CN_NUMBERS[integers[i]] + CN_IUNIT[length - i - 1]));
+ }
+ return chineseInteger.toString();
+ }
+
+ /**
+ * 灏嗗皬鏁伴儴鍒嗚浆涓哄ぇ鍐欑殑閲戦
+ * @param decimals 灏忔暟閮ㄥ垎鐨勬暟瀛�
+ * @return
+ */
+ private static String getChineseDecimal(int[] decimals, boolean isSimplified) {
+ StringBuilder chineseDecimal = new StringBuilder("");
+ if (!isSimplified) {
+ for (int i = 0; i < decimals.length; i++) {
+ String key = "";
+
+ if ((decimals.length - i) > 1 && decimals[i + 1] != 0) {
+ key += NUMBERS[0];
+ }
+
+ chineseDecimal.append(decimals[i] == 0 ? key : (NUMBERS[decimals[i]] + DUNIT[i]));
+ }
+ } else {
+ for (int i = 0; i < decimals.length; i++) {
+ chineseDecimal.append(CN_NUMBERS[decimals[i]]);
+ }
+
+ }
+ return chineseDecimal.toString();
+ }
+
+ /**
+ * 鍒ゆ柇褰撳墠鏁存暟閮ㄥ垎鏄惁宸茬粡鏄揪鍒般�愪竾銆�
+ * @param integerStr 鏁存暟閮ㄥ垎鏁板瓧
+ * @return
+ */
+ private static boolean isWan5(String integerStr) {
+ int length = integerStr.length();
+ if (length > 4) {
+ String subInteger = "";
+ if (length > 8) {
+ subInteger = integerStr.substring(length - 8, length - 4);
+ } else {
+ subInteger = integerStr.substring(0, length - 4);
+ }
+ return Integer.parseInt(subInteger) > 0;
+ } else {
+ return false;
+ }
+ }
public String orderNumberSetting(String type) {
//鏍规嵁绫诲瀷鑷姩鐢熸垚涓嶅悓鐨勬搷浣滃崟鍙�
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
index 6c06526..0e409e3 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/OrderService.java
@@ -7,17 +7,12 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.example.erp.common.Constants;
-import com.example.erp.entity.sd.Order;
-import com.example.erp.entity.sd.OrderDetail;
-import com.example.erp.entity.sd.OrderGlassDetail;
-import com.example.erp.entity.sd.OrderProcessDetail;
+import com.example.erp.entity.sd.*;
import com.example.erp.entity.userInfo.SysError;
import com.example.erp.exception.ServiceException;
-import com.example.erp.mapper.sd.OrderDetailMapper;
-import com.example.erp.mapper.sd.OrderGlassDetailMapper;
-import com.example.erp.mapper.sd.OrderMapper;
-import com.example.erp.mapper.sd.OrderProcessDetailMapper;
+import com.example.erp.mapper.sd.*;
import com.example.erp.service.userInfo.SysErrorService;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -34,29 +29,32 @@
private final OrderDetailMapper orderDetailMapper;
private final OrderGlassDetailMapper orderGlassDetailMapper;
private final SysErrorService sysErrorService;
+ private final OrderOtherMoneyMapper orderOtherMoneyMapper;
private final OrderProcessDetailMapper orderProcessDetailMapper;
- public OrderService(OrderMapper orderMapper, OrderDetailMapper orderDetailMapper, OrderGlassDetailMapper orderGlassDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, SysErrorService sysErrorService) {
+ public OrderService(OrderMapper orderMapper, OrderDetailMapper orderDetailMapper, OrderGlassDetailMapper orderGlassDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, SysErrorService sysErrorService, OrderOtherMoneyMapper orderOtherMoneyMapper) {
this.orderMapper = orderMapper;
this.orderDetailMapper = orderDetailMapper;
this.orderGlassDetailMapper = orderGlassDetailMapper;
this.orderProcessDetailMapper = orderProcessDetailMapper;
this.sysErrorService = sysErrorService;
+ this.orderOtherMoneyMapper = orderOtherMoneyMapper;
}
public boolean saveOrder(Map<String,Object> orderMap) throws Exception {
JSONObject orderJson = new JSONObject(orderMap);
Order order = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("title")), Order.class);
List<OrderDetail> OrderDetails = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("detail")), OrderDetail.class);
+ List<OrderOtherMoney> orderOtherMoneyList = JSONArray.parseArray(JSONObject.toJSONString(orderJson.get("otherMoney")), OrderOtherMoney.class);
boolean saveState = true;
//璁剧疆鍥炴粴鐐�
Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
//鍒ゆ柇浼犲叆id鍙傛暟鏄惁涓虹┖锛屾湭浼犲叆id涓虹┖鎻掑叆璁㈠崟琛紝浼犲叆鏇存柊琛�
try{
if(order.getOrderId() == null || order.getOrderId().isEmpty()){
- insertOrder(order,OrderDetails);
+ insertOrder(order,OrderDetails,orderOtherMoneyList);
}else {
- updateOrder(order,OrderDetails);
+ updateOrder(order,OrderDetails,orderOtherMoneyList);
}
}catch (Exception e){
TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
@@ -72,7 +70,7 @@
return saveState;
}
//鐢熸垚璁㈠崟鏁版嵁
- public void insertOrder(Order order,List<OrderDetail> OrderDetails) {
+ public void insertOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) {
Integer maxOrderId = orderMapper.selectMaxOrderId();
//鏌ヨ璁㈠崟id锛屽苟涓旇嚜澧�
String formattedNumber = String.format("%02d", maxOrderId+1);
@@ -85,11 +83,11 @@
order.setOrderId(orderId);
order.setCreateOrder(2);
orderMapper.insert(order);
- insertOtherDetail(orderId,OrderDetails);
+ insertOtherDetail(orderId,OrderDetails,orderOtherMoneyList);
}
//淇敼璁㈠崟鏁版嵁锛屽苟涓旈噸鏂扮敓鎴愬涓壇琛ㄦ暟鎹�
- public void updateOrder(Order order,List<OrderDetail> OrderDetails) {
+ public void updateOrder(Order order,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) {
LambdaUpdateWrapper<Order> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(Order::getOrderId, order.getOrderId());
orderMapper.update(order,updateWrapper);
@@ -97,14 +95,17 @@
orderDetailMapper.delete(new LambdaQueryWrapper<OrderDetail>().eq(OrderDetail::getOrderId, order.getOrderId()));
//鍒犻櫎璁㈠崟灏忕墖琛�
orderGlassDetailMapper.delete(new LambdaQueryWrapper<OrderGlassDetail>().eq(OrderGlassDetail::getOrderId, order.getOrderId()));
+ //鍒犻櫎鍏朵粬閲戦鏄庣粏琛�
+ orderOtherMoneyMapper.delete(new LambdaQueryWrapper<OrderOtherMoney>().eq(OrderOtherMoney::getOrderId, order.getOrderId()));
+
//鍒犻櫎璁㈠崟宸ヨ壓琛�
// orderProcessDetailMapper.delete(new LambdaQueryWrapper<OrderProcessDetail>().eq(OrderProcessDetail::getOrderId, order.getOrderId()));
- insertOtherDetail(order.getOrderId(),OrderDetails);
+ insertOtherDetail(order.getOrderId(),OrderDetails,orderOtherMoneyList);
}
//鎻掑叆鍏朵粬鍓〃鏁版嵁锛岃鍏朵粬鏂规硶寮曠敤
- public void insertOtherDetail(String orderId,List<OrderDetail> OrderDetails) {
+ public void insertOtherDetail(String orderId,List<OrderDetail> OrderDetails,List<OrderOtherMoney> orderOtherMoneyList) {
//寰幆缁欒鍗曟槑缁嗚〃瀛楁娣诲姞搴忓彿鍜屽懆闀�
for (int i = 0; i < OrderDetails.size(); i++) {
OrderDetails.get(i).setOrderNumber(i+1);
@@ -112,12 +113,25 @@
OrderDetails.get(i).setPerimeter(OrderDetails.get(i).getWidth()*OrderDetails.get(i).getHeight()*2/1000);
OrderDetails.get(i).setWeight(1.0);
}
+
+
+
//寰�鏄庣粏琛ㄦ彃鏁版嵁
orderDetailMapper.insertBatch(OrderDetails);
//淇敼璁㈠崟涓昏〃闈㈢Н涓庡懆闀夸互鍙婇噸閲�
orderMapper.updateOrderParameter(orderId);
//寰�灏忕墖琛ㄤ紶鍏ヤ骇鍝佹暟鎹�
orderGlassDetailMapper.insertOrderGlassDetail(orderId);
+ //寰�璁㈠崟鍏朵粬閲戦鍓〃浼犲叆鏁版嵁
+ orderOtherMoneyList.forEach(orderOtherMoney ->{
+ orderOtherMoney.setId(null);
+ orderOtherMoney.setOrderId(orderId);
+ if(orderOtherMoney.getQuantity()!=null && orderOtherMoney.getPrice()!=null){
+ orderOtherMoney.setMoney((orderOtherMoney.getQuantity()*orderOtherMoney.getPrice()));
+ }
+ orderOtherMoneyMapper.insert(orderOtherMoney);
+ });
+
//鏌ヨ璁㈠崟灏忕墖琛ㄨ幏鍙栧伐鑹轰紶鍏ュ皬鐗囧伐鑹鸿〃
//List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetail(orderId);
/*List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetails);
diff --git a/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml b/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
index bf2a184..9ab2ac2 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
@@ -204,7 +204,7 @@
<select id="getSelectShippingOrderDetailDeliveryPrinting" >
select
- d.delivery_id,d.quantity,d.money,d.area,
+ d.delivery_id,d.quantity,d.money,d.area,d.project,
d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number,
d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id
from sd.delivery d
diff --git a/north-glass-erp/src/main/resources/mapper/sd/OrderDetail.xml b/north-glass-erp/src/main/resources/mapper/sd/OrderDetail.xml
index b4409d1..f5cbe6d 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/OrderDetail.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/OrderDetail.xml
@@ -25,7 +25,8 @@
bend_radius,
edging_type,
weight,
- perimeter
+ perimeter,
+ other_columns
)
values
<foreach collection ="orderDetails" item="orderDetail" separator =",">
@@ -49,7 +50,8 @@
#{orderDetail.bendRadius},
#{orderDetail.edgingType},
#{orderDetail.weight},
- #{orderDetail.perimeter}
+ #{orderDetail.perimeter},
+ #{orderDetail.otherColumns}
)
</foreach>
</insert>
diff --git a/north-glass-erp/target/classes/mapper/sd/Delivery.xml b/north-glass-erp/target/classes/mapper/sd/Delivery.xml
index bf2a184..9ab2ac2 100644
--- a/north-glass-erp/target/classes/mapper/sd/Delivery.xml
+++ b/north-glass-erp/target/classes/mapper/sd/Delivery.xml
@@ -204,7 +204,7 @@
<select id="getSelectShippingOrderDetailDeliveryPrinting" >
select
- d.delivery_id,d.quantity,d.money,d.area,
+ d.delivery_id,d.quantity,d.money,d.area,d.project,
d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number,
d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id
from sd.delivery d
diff --git a/north-glass-erp/target/classes/mapper/sd/OrderDetail.xml b/north-glass-erp/target/classes/mapper/sd/OrderDetail.xml
index b4409d1..f5cbe6d 100644
--- a/north-glass-erp/target/classes/mapper/sd/OrderDetail.xml
+++ b/north-glass-erp/target/classes/mapper/sd/OrderDetail.xml
@@ -25,7 +25,8 @@
bend_radius,
edging_type,
weight,
- perimeter
+ perimeter,
+ other_columns
)
values
<foreach collection ="orderDetails" item="orderDetail" separator =",">
@@ -49,7 +50,8 @@
#{orderDetail.bendRadius},
#{orderDetail.edgingType},
#{orderDetail.weight},
- #{orderDetail.perimeter}
+ #{orderDetail.perimeter},
+ #{orderDetail.otherColumns}
)
</foreach>
</insert>
--
Gitblit v1.8.0