已删除3个文件
已修改48个文件
已添加45个文件
| | |
| | | <vol-box |
| | | v-model="showDetialBox" |
| | | :lazy="true" |
| | | width="75%" |
| | | width="60%" |
| | | :padding="15" |
| | | title="æå®åºå" |
| | | > |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: '', |
| | | gridBody: '', |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
| | | //è¿åfalseï¼åä¸ä¼æ§è¡æ¥è¯¢ |
| | | return true; |
| | | }, |
| | | searchAfter(result) { |
| | | //æ¥è¯¢åï¼resultè¿åçæ¥è¯¢æ°æ®,å¯ä»¥å¨æ¾ç¤ºå°è¡¨æ ¼åå¤çè¡¨æ ¼çå¼ |
| | | return true; |
| | | }, |
| | | addBefore(formData) { |
| | | //æ°å»ºä¿ååformData为对象ï¼å
æ¬æç»è¡¨ï¼å¯ä»¥ç»ç»è¡¨å设置å¼ï¼èªå·±è¾åºçformDataçå¼ |
| | | return true; |
| | | }, |
| | | updateBefore(formData) { |
| | | //ç¼è¾ä¿ååformData为对象ï¼å
æ¬æç»è¡¨ãå é¤è¡çId |
| | | return true; |
| | | }, |
| | | rowClick({ row, column, event }) { |
| | | //æ¥è¯¢çé¢ç¹å»è¡äºä»¶ |
| | | // this.$refs.table.$refs.table.toggleRowSelection(row); //åå»è¡æ¶éä¸å½åè¡; |
| | | }, |
| | | modelOpenAfter(row) { |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | | |
| | |
| | | path: '/task', |
| | | name: 'task', |
| | | component: () => import('@/views/taskinfo/task.vue') |
| | | }, { |
| | | path: '/stockView', |
| | | name: 'stockView', |
| | | component: () => import('@/views/stock/stockView.vue') |
| | | }] |
| | | |
| | | export default viewgird |
| | |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "è´§ä½ç±»å", required: true, field: "locationType", type: "string" }, |
| | | { |
| | | title: "è´§ä½ç±»å", |
| | | required: true, |
| | | field: "locationType", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "è´§ä½ç¶æ", |
| | | required: true, |
| | |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | { |
| | | title: "å··éç¼å·", |
| | | required: true, |
| | | field: "roadwayNo", |
| | | type: "string", |
| | | }, |
| | | ] |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | locationCode: "", |
| | |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationName", |
| | | title: "è´§ä½åç§°", |
| | | type: "string", |
| | | width: 150, |
| | | width: 220, |
| | | align: "left", |
| | | }, |
| | | { |
| | |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "column", |
| | |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "layer", |
| | |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "depth", |
| | |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "locationType", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <template> |
| | | <view-grid |
| | | ref="grid" |
| | | :columns="columns" |
| | | :detail="detail" |
| | | :editFormFields="editFormFields" |
| | | :editFormOptions="editFormOptions" |
| | | :searchFormFields="searchFormFields" |
| | | :searchFormOptions="searchFormOptions" |
| | | :table="table" |
| | | :extend="extend" |
| | | > |
| | | </view-grid> |
| | | </template> |
| | | <script> |
| | | import extend from "@/extension/stock/stockView.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "stockId", |
| | | footer: "Foots", |
| | | cnName: "åºåè§å¾", |
| | | name: "stockView", |
| | | url: "/stockView/", |
| | | sortName: "stockId", |
| | | }); |
| | | const editFormFields = ref({ |
| | | palletCode: "", |
| | | locationCode: "", |
| | | locationName: "", |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "æçç¼å·", |
| | | required: true, |
| | | field: "palletCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "è´§ä½ç¼å·", |
| | | required: true, |
| | | field: "locationCode", |
| | | type: "string", |
| | | }, |
| | | { |
| | | title: "è´§ä½åç§°", |
| | | required: true, |
| | | field: "locationName", |
| | | type: "string", |
| | | }, |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | palletCode: "", |
| | | locationCode: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æçç¼å·", field: "palletCode" }, |
| | | { title: "è´§ä½ç¼å·", field: "locationCode" }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "stockId", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "palletCode", |
| | | title: "æçç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | link: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationCode", |
| | | title: "è´§ä½ç¼å·", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationName", |
| | | title: "è´§ä½åç§°", |
| | | type: "string", |
| | | width: 220, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "roadwayNo", |
| | | title: "å··éç¼å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "row", |
| | | title: "è´§ä½è¡", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "column", |
| | | title: "è´§ä½å", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "layer", |
| | | title: "è´§ä½å±", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "depth", |
| | | title: "è´§ä½æ·±åº¦", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "stockStatus", |
| | | title: "åºåç¶æ", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationType", |
| | | title: "è´§ä½ç±»å", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "locationStatus", |
| | | title: "è´§ä½ç¶æ", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "enalbeStatus", |
| | | title: "ç¦ç¨ç¶æ", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "isFull", |
| | | title: "æ¯å¦æ»¡ç", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "åºåæç»ä¿¡æ¯", |
| | | table: "StockInfoDetail", |
| | | columns: [ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockId", |
| | | title: "åºåä¿¡æ¯ä¸»é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielName", |
| | | title: "ç©æåç§°", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "decimal", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "batchNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "serialNumber", |
| | | title: "åºåå·", |
| | | type: "int", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "stockQuantity", |
| | | title: "åºåæ°é", |
| | | type: "string", |
| | | width: 200, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "outboundQuantity", |
| | | title: "åºåºæ°é", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "status", |
| | | title: "åºåæç»ç¶æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | <template> |
| | | <div class="menu-container"> |
| | | <!-- <el-input/> --> |
| | | <vol-box :width="940" :mask="true" :height="500" title="徿 å表" v-model="model"> |
| | | <vol-box |
| | | :width="940" |
| | | :mask="true" |
| | | :height="500" |
| | | title="徿 å表" |
| | | v-model="model" |
| | | > |
| | | <Icons :onSelect="onSelect"></Icons> |
| | | <template #footer> |
| | | <el-button type="primary" size="mini" @click="model = false">确 认</el-button> |
| | | <el-button type="primary" size="mini" @click="model = false" |
| | | >确 认</el-button |
| | | > |
| | | </template> |
| | | </vol-box> |
| | | <vol-box :width="600" :mask="true" :height="270" title="å
¶ä»æé" v-model="actionModel"> |
| | | <vol-form ref="actionForm" :formRules="actionOptions" :formFields="actionFields"> |
| | | <vol-box |
| | | :width="600" |
| | | :mask="true" |
| | | :height="270" |
| | | title="å
¶ä»æé" |
| | | v-model="actionModel" |
| | | > |
| | | <vol-form |
| | | ref="actionForm" |
| | | :formRules="actionOptions" |
| | | :formFields="actionFields" |
| | | > |
| | | <template #header> |
| | | <div> |
| | | <el-alert show-icon type="success"> |
| | |
| | | </template> |
| | | </vol-form> |
| | | <template #footer> |
| | | <el-button type="primary" size="mini" @click="otherAction">确 认</el-button> |
| | | <el-button type="primary" size="mini" @click="otherAction" |
| | | >确 认</el-button |
| | | > |
| | | </template> |
| | | </vol-box> |
| | | |
| | |
| | | <div class="menu-left"> |
| | | <div class="m-title"><i class="el-icon-warning-outline"></i>èåå表</div> |
| | | <el-scrollbar style="height: 100%; width: 200px"> |
| | | <VolMenu :onSelect="getTreeItem" :list="tree" :isCollapse="false"></VolMenu> |
| | | <VolMenu |
| | | :onSelect="getTreeItem" |
| | | :list="tree" |
| | | :isCollapse="false" |
| | | ></VolMenu> |
| | | </el-scrollbar> |
| | | </div> |
| | | <div class="menu-right"> |
| | | <el-scrollbar style="height: 100%"> |
| | | <el-alert title="èåé
置说æ" type="warning" :closable="false" show-icon> |
| | | <el-alert |
| | | title="èåé
置说æ" |
| | | type="warning" |
| | | :closable="false" |
| | | show-icon |
| | | > |
| | | <div> |
| | | 1ã妿æ¯ç¨ä»£ç çå¨çæçVue页é¢,Url为Vue项ç®ä¸src->router->viewGrid.js对åºè¡¨åçpath屿§ |
| | | </div> |
| | |
| | | </div> |
| | | </el-alert> |
| | | <div style="padding: 0px 30px 0 20px"> |
| | | <vol-form class="form-content" ref="form" :formRules="options" :formFields="fields"> |
| | | <vol-form |
| | | class="form-content" |
| | | ref="form" |
| | | :formRules="options" |
| | | :formFields="fields" |
| | | > |
| | | </vol-form> |
| | | <div> |
| | | <div class="auth-group"> |
| | | <label style="width: 100px">æéæé®ï¼</label> |
| | | <div class="ck"> |
| | | <el-checkbox-group v-model="actions"> |
| | | <el-checkbox v-for="(item, index) in action" :key="index" :label="item.value">{{ item.text + "(" + |
| | | item.value + ")" }}</el-checkbox> |
| | | <el-checkbox |
| | | v-for="(item, index) in action" |
| | | :key="index" |
| | | :label="item.value" |
| | | >{{ item.text + "(" + item.value + ")" }}</el-checkbox |
| | | > |
| | | </el-checkbox-group> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div style="padding-left: 100px"> |
| | | <el-button @click="handleCheckAll" size="mini" type="success" plain><i class="el-icon-check"></i>å
¨ |
| | | é</el-button> |
| | | <el-button @click="actionModel = true" size="mini" type="primary" plain><i |
| | | class="el-icon-plus"></i>å
¶ä»æé</el-button> |
| | | <el-button @click="handleCheckAll" size="mini" type="success" plain |
| | | ><i class="el-icon-check"></i>å
¨ é</el-button |
| | | > |
| | | <el-button |
| | | @click="actionModel = true" |
| | | size="mini" |
| | | type="primary" |
| | | plain |
| | | ><i class="el-icon-plus"></i>å
¶ä»æé</el-button |
| | | > |
| | | </div> |
| | | <div class="m-btn"> |
| | | <el-button type="primary" @click="save"><i class="el-icon-check"></i>ä¿å</el-button> |
| | | <el-button type="success" @click="add"><i class="el-icon-plus"></i>æ°å»º</el-button> |
| | | <el-button type="warning" @click="addChild"><i class="el-icon-plus"></i>æ·»å å级</el-button> |
| | | <el-button type="primary" plain @click="addBrother"><i class="el-icon-circle-plus"></i> æ·»å å级</el-button> |
| | | <el-button type="warning" plain @click="delMenu"><i class="el-icon-delete"></i> å é¤èå</el-button> |
| | | <el-button type="primary" @click="save" |
| | | ><i class="el-icon-check"></i>ä¿å</el-button |
| | | > |
| | | <el-button type="success" @click="add" |
| | | ><i class="el-icon-plus"></i>æ°å»º</el-button |
| | | > |
| | | <el-button type="warning" @click="addChild" |
| | | ><i class="el-icon-plus"></i>æ·»å å级</el-button |
| | | > |
| | | <el-button type="primary" plain @click="addBrother" |
| | | ><i class="el-icon-circle-plus"></i> æ·»å å级</el-button |
| | | > |
| | | <el-button type="warning" plain @click="delMenu" |
| | | ><i class="el-icon-delete"></i> å é¤èå</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </el-scrollbar> |
| | |
| | | tigger = true; |
| | | let menuId = this.fields.menuId; |
| | | this.http |
| | | .post("/api/Sys_Menu/delMenu?menuId=" + menuId, {}, "æ£å¨å 餿°æ®....") |
| | | .post( |
| | | "/api/Sys_Menu/delMenu?menuId=" + menuId, |
| | | {}, |
| | | "æ£å¨å 餿°æ®...." |
| | | ) |
| | | .then((x) => { |
| | | if (!x.status) return this.$Message.error(x.message); |
| | | this.$refs.form.reset(); |
| | |
| | | orderNo: this.fields.orderNo, |
| | | parentId: this.fields.parentId, |
| | | }); |
| | | console.log(this.tree) |
| | | console.log(this.tree); |
| | | }); |
| | | }); |
| | | }, |
| | |
| | | onOpenChange(node) { |
| | | if (node.length == 0) return; |
| | | this.getTreeItem(node[node.length > 1 ? node.length - 1 : 0]); |
| | | } |
| | | }, |
| | | }, |
| | | created(){ |
| | | |
| | | }, |
| | | created() {}, |
| | | setup() { |
| | | const tree = ref([]); |
| | | const actionValues = ref([]); |
| | |
| | | }); |
| | | const initTree = () => { |
| | | http.post("/api/Sys_Menu/getMenu", {}, true).then((x) => { |
| | | x.forEach(item => { |
| | | item.icon = 'el-icon-menu'; |
| | | }) |
| | | |
| | | x.forEach((item) => { |
| | | item.icon = "el-icon-menu"; |
| | | }); |
| | | |
| | | tree.value = x; |
| | | }); |
| | | }; |
| | |
| | | icon: "", |
| | | orderNo: "", |
| | | enable: 1, |
| | | createDate: "", |
| | | creator: "", |
| | | modifyDate: "", |
| | | menuType: 0, |
| | | }); |
| | | |
| | | const actionFields = ref({ |
| | |
| | | { key: 0, value: "ç¦ç¨" }, |
| | | ], |
| | | }, |
| | | // { |
| | | // // 2022.03.26å¢ç§»å¨ç«¯å èåç±»å |
| | | // title: "èåç±»å", |
| | | // field: "menuType", |
| | | // required: true, |
| | | // type: "select", |
| | | // colSize: 4, |
| | | // data: [ |
| | | // { key: 1, value: "WCSèå" }, |
| | | // { key: 0, value: "WMSèå" }, |
| | | // { key: 99, value: "å
±ç¨" } |
| | | // ], |
| | | // }, |
| | | { |
| | | // 2022.03.26å¢ç§»å¨ç«¯å èåç±»å |
| | | title: "èåç±»å", |
| | | field: "menuType", |
| | | required: true, |
| | | type: "select", |
| | | colSize: 4, |
| | | data: [ |
| | | { key: 0, value: "PC端èå" }, |
| | | { key: 1, value: "ç§»å¨ç«¯èå" }, |
| | | ], |
| | | }, |
| | | { |
| | | title: "徿 Icon", |
| | | field: "icon", |
| | |
| | | ]); |
| | | const refForm = ref(); |
| | | const getTreeItem = (node) => { |
| | | http.post("api/Sys_Menu/getTreeItem?menuId=" + node, {}, true).then((x) => { |
| | | try { |
| | | fields.value.icon = x.icon; |
| | | if (x.auth) { |
| | | x.auth = JSON.parse(x.auth); |
| | | action.value.splice(8, action.value.length); |
| | | http |
| | | .post("api/Sys_Menu/getTreeItem?menuId=" + node, {}, true) |
| | | .then((x) => { |
| | | try { |
| | | fields.value.icon = x.icon; |
| | | if (x.auth) { |
| | | x.auth = JSON.parse(x.auth); |
| | | action.value.splice(8, action.value.length); |
| | | |
| | | actions.value = x.auth.map((element) => { |
| | | if (actionValues.value.indexOf(element.value) == -1) { |
| | | action.value.push(element); |
| | | } |
| | | return element.value; |
| | | }); |
| | | } else { |
| | | action.value.splice(8, action.value.length); |
| | | actions.value = x.auth.map((element) => { |
| | | if (actionValues.value.indexOf(element.value) == -1) { |
| | | action.value.push(element); |
| | | } |
| | | return element.value; |
| | | }); |
| | | } else { |
| | | action.value.splice(8, action.value.length); |
| | | x.auth = []; |
| | | fields.value.icon = ""; |
| | | actions.value = []; |
| | | } |
| | | } catch (error) { |
| | | console.log("èååè½æéè½¬æ¢æJSON失败:" + x.auth); |
| | | x.auth = []; |
| | | fields.value.icon = ""; |
| | | // this.icon = ""; |
| | | actions.value = []; |
| | | } |
| | | } catch (error) { |
| | | console.log("èååè½æéè½¬æ¢æJSON失败:" + x.auth); |
| | | x.auth = []; |
| | | // this.icon = ""; |
| | | actions.value = []; |
| | | } |
| | | refForm.value.reset(x); |
| | | }); |
| | | refForm.value.reset(x); |
| | | }); |
| | | }; |
| | | return { |
| | | tree, |
| | |
| | | actionOptions, |
| | | options, |
| | | form: refForm, |
| | | getTreeItem |
| | | getTreeItem, |
| | | }; |
| | | }, |
| | | data() { |
| | |
| | | margin-top: 1px; |
| | | } |
| | | |
| | | >div { |
| | | > div { |
| | | float: left; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicRepository |
| | | { |
| | | public class AreaRouterRepository : RepositoryBase<Dt_AreaRouter>, IAreaRouterRepository |
| | | { |
| | | public AreaRouterRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IBasicRepository; |
| | | |
| | | namespace WIDESEA_BasicRepository |
| | | { |
| | | public class BasicRepository : IBasicRepository |
| | | { |
| | | public IAreaInfoRepository AreaInfoRepository { get; } |
| | | |
| | | public ILocationInfoRepository LocationInfoRepository { get; } |
| | | |
| | | public IMaterielInfoRepository MaterielInfoRepository { get; } |
| | | |
| | | public IRoadwayInfoRepository RoadwayInfoRepository { get; } |
| | | |
| | | public IWarehouseRepository WarehouseRepository { get; } |
| | | |
| | | public IAreaRouterRepository AreaRouterRepository { get; } |
| | | |
| | | public ICachePointRepository CachePointRepository { get; } |
| | | |
| | | public BasicRepository(IAreaInfoRepository areaInfoRepository, ILocationInfoRepository locationInfoRepository, IMaterielInfoRepository materielInfoRepository, IRoadwayInfoRepository roadwayInfoRepository, IWarehouseRepository warehouseRepository, IAreaRouterRepository areaRouterRepository, ICachePointRepository cachePointRepository) |
| | | { |
| | | AreaInfoRepository = areaInfoRepository; |
| | | LocationInfoRepository = locationInfoRepository; |
| | | MaterielInfoRepository = materielInfoRepository; |
| | | RoadwayInfoRepository = roadwayInfoRepository; |
| | | WarehouseRepository = warehouseRepository; |
| | | AreaRouterRepository = areaRouterRepository; |
| | | CachePointRepository = cachePointRepository; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicRepository |
| | | { |
| | | public class CachePointRepository : RepositoryBase<Dt_CachePoint>, ICachePointRepository |
| | | { |
| | | public CachePointRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | |
| | | public List<CachePointGroupDTO> GetCachePointGroups(int areaId, LocationStatusEnum locationAStatus, LocationStatusEnum locationBStatus) |
| | | { |
| | | return Db.Queryable<Dt_CachePoint>().Where(a => a.Depth == 1 && a.AreaId == areaId && a.PointStatus == locationAStatus.ObjToInt() && a.PointStatus == locationAStatus.ObjToInt()).InnerJoin(Db.Queryable<Dt_CachePoint>().Where(b => b.Depth == 2 && b.AreaId == areaId && b.PointStatus == locationBStatus.ObjToInt() && b.PointStatus == locationBStatus.ObjToInt()), (a, b) => a.Column == b.Column && a.AreaId == b.AreaId && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1).Select((a, b) => new CachePointGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnableStatus, EnableStatusB = b.EnableStatus, IdA = a.Id, IdB = b.Id, PointCodeA = a.PointCode, PointCodeB = b.PointCode, PointStatusA = a.PointStatus, PointStatusB = b.PointStatus, PointTypeA = a.PointType, PointTypeB = b.PointType }).ToList(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public List<LocationGroupDTO> GetAllLocationGroups(string roadway) |
| | | { |
| | | return QueryTabs<Dt_LocationInfo, Dt_LocationInfo, LocationGroupDTO>((a, b) => a.Column == b.Column && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, (a, b) => new LocationGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnalbeStatus, EnableStatusB = b.EnalbeStatus, IdA = a.Id, IdB = b.Id, LocationCodeA = a.LocationCode, LocationCodeB = b.LocationCode, LocationStatusA = a.LocationStatus, LocationStatusB = b.LocationStatus, LocationTypeA = a.LocationType, LocationTypeB = b.LocationType }, a => a.Depth == 1 && a.RoadwayNo == roadway, b => b.Depth == 2 && b.RoadwayNo == roadway, x => true); |
| | | return QueryTabs<Dt_LocationInfo, Dt_LocationInfo, LocationGroupDTO>((a, b) => a.Column == b.Column && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, (a, b) => new LocationGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnableStatus, EnableStatusB = b.EnableStatus, IdA = a.Id, IdB = b.Id, LocationCodeA = a.LocationCode, LocationCodeB = b.LocationCode, LocationStatusA = a.LocationStatus, LocationStatusB = b.LocationStatus, LocationTypeA = a.LocationType, LocationTypeB = b.LocationType }, a => a.Depth == 1 && a.RoadwayNo == roadway, b => b.Depth == 2 && b.RoadwayNo == roadway, x => true); |
| | | } |
| | | |
| | | public List<LocationGroupDTO> GetLocationGroups(string roadway, LocationStatusEnum locationAStatus, LocationStatusEnum locationBStatus) |
| | | { |
| | | return QueryTabs<Dt_LocationInfo, Dt_LocationInfo, LocationGroupDTO>((a, b) => a.Column == b.Column && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, (a, b) => new LocationGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnalbeStatus, EnableStatusB = b.EnalbeStatus, IdA = a.Id, IdB = b.Id, LocationCodeA = a.LocationCode, LocationCodeB = b.LocationCode, LocationStatusA = a.LocationStatus, LocationStatusB = b.LocationStatus, LocationTypeA = a.LocationType, LocationTypeB = b.LocationType }, a => a.Depth == 1 && a.RoadwayNo == roadway && a.LocationStatus == locationAStatus.ObjToInt(), b => b.Depth == 2 && b.RoadwayNo == roadway && b.LocationStatus == locationBStatus.ObjToInt(), x => true); |
| | | return QueryTabs<Dt_LocationInfo, Dt_LocationInfo, LocationGroupDTO>( |
| | | (a, b) => a.Column == b.Column && a.Layer == b.Layer && a.Row != b.Row && SqlFunc.Abs(a.Row - b.Row) == 1, |
| | | (a, b) => new LocationGroupDTO { DepthA = a.Depth, DepthB = b.Depth, EnableStatusA = a.EnableStatus, EnableStatusB = b.EnableStatus, IdA = a.Id, IdB = b.Id, LocationCodeA = a.LocationCode, LocationCodeB = b.LocationCode, LocationStatusA = a.LocationStatus, LocationStatusB = b.LocationStatus, LocationTypeA = a.LocationType, LocationTypeB = b.LocationType }, |
| | | a => a.Depth == 1 && a.RoadwayNo == roadway && a.LocationStatus == locationAStatus.ObjToInt(), |
| | | b => b.Depth == 2 && b.RoadwayNo == roadway && b.LocationStatus == locationBStatus.ObjToInt(), |
| | | x => true); |
| | | } |
| | | |
| | | public override bool UpdateData(Dt_LocationInfo entity) |
| | |
| | | |
| | | public List<string> GetCanOutLocationCodes(List<string> roadways, List<int> areaIds) |
| | | { |
| | | return QueryData(x => x.LocationCode, x => roadways.Contains(x.RoadwayNo) && (areaIds.Contains(x.AreaId) || x.AreaId == 0) && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || x.EnalbeStatus == LocationEnalbeStatusEnum.Normal.ObjToInt())).Distinct().ToList(); |
| | | return QueryData(x => x.LocationCode, x => roadways.Contains(x.RoadwayNo) && (areaIds.Contains(x.AreaId) || x.AreaId == 0) && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || x.EnableStatus == LocationEnalbeStatusEnum.Normal.ObjToInt())).Distinct().ToList(); |
| | | } |
| | | |
| | | public List<Dt_LocationInfo> GetLocationInfos(List<string> locationCodes) |
| | |
| | | /// <summary> |
| | | /// å¯åºåºçå··éç¼å·éå |
| | | /// </summary> |
| | | public List<string> CanOutRoadwayNos => QueryData(x => x.RoadwayNo, x => x.EnalbeStatus == RoadwayStatusEnum.Normal.ObjToInt() || x.EnalbeStatus == RoadwayStatusEnum.OnlyOut.ObjToInt()).Distinct().ToList(); |
| | | public List<string> CanOutRoadwayNos => QueryData(x => x.RoadwayNo, x => x.EnableStatus == RoadwayStatusEnum.Normal.ObjToInt() || x.EnableStatus == RoadwayStatusEnum.OnlyOut.ObjToInt()).Distinct().ToList(); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | |
| | | } |
| | | |
| | | public IAreaInfoRepository Repository => BaseDal; |
| | | |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public class AreaRouterService : ServiceBase<Dt_AreaRouter, IAreaRouterRepository>, IAreaRouterService |
| | | { |
| | | public AreaRouterService(IAreaRouterRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public IAreaRouterRepository Repository => BaseDal; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_Core.Helper; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public class BasicService : IBasicService |
| | | { |
| | | public IAreaInfoService AreaInfoService { get; } |
| | | |
| | | public ILocationInfoService LocationInfoService { get; } |
| | | |
| | | public IMaterielInfoService MaterielInfoService { get; } |
| | | |
| | | public IRoadwayInfoService RoadwayInfoService { get; } |
| | | |
| | | public IWarehouseService WarehouseService { get; } |
| | | |
| | | public IAreaRouterService AreaRouterService { get; } |
| | | |
| | | public ICachePointService CachePointService { get; } |
| | | |
| | | public BasicService(IAreaInfoService areaInfoService, ILocationInfoService locationInfoService, IMaterielInfoService materielInfoService, IRoadwayInfoService roadwayInfoService, IWarehouseService warehouseService, IAreaRouterService areaRouterService, ICachePointService cachePointService) |
| | | { |
| | | AreaInfoService = areaInfoService; |
| | | LocationInfoService = locationInfoService; |
| | | MaterielInfoService = materielInfoService; |
| | | RoadwayInfoService = roadwayInfoService; |
| | | WarehouseService = warehouseService; |
| | | AreaRouterService = areaRouterService; |
| | | CachePointService = cachePointService; |
| | | } |
| | | |
| | | #region AreaInfo |
| | | public WebResponseContent AreaEnableStatus(int[] keys) |
| | | { |
| | | List<Dt_AreaInfo> areaInfos = AreaInfoService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | areaInfos.ForEach(x => |
| | | { |
| | | x.AreaStatus = EnableEnum.Enable.ObjToInt(); |
| | | }); |
| | | AreaInfoService.Repository.UpdateData(areaInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent AreaDisableStatus(int[] keys) |
| | | { |
| | | List<Dt_AreaInfo> areaInfos = AreaInfoService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | areaInfos.ForEach(x => |
| | | { |
| | | x.AreaStatus = EnableEnum.Disable.ObjToInt(); |
| | | }); |
| | | AreaInfoService.Repository.UpdateData(areaInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent AreaEnableStatus(int key) |
| | | { |
| | | return AreaEnableStatus(new int[] { key }); |
| | | } |
| | | |
| | | public WebResponseContent AreaDisableStatus(int key) |
| | | { |
| | | return AreaDisableStatus(new int[] { key }); |
| | | } |
| | | #endregion |
| | | |
| | | #region CachePoint |
| | | public WebResponseContent CachePointEnableStatus(int[] keys) |
| | | { |
| | | List<Dt_CachePoint> cachePoints = CachePointService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | cachePoints.ForEach(x => |
| | | { |
| | | x.EnableStatus = EnableEnum.Enable.ObjToInt(); |
| | | }); |
| | | CachePointService.Repository.UpdateData(cachePoints); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent CachePointDisableStatus(int[] keys) |
| | | { |
| | | List<Dt_CachePoint> cachePoints = CachePointService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | cachePoints.ForEach(x => |
| | | { |
| | | x.EnableStatus = EnableEnum.Disable.ObjToInt(); |
| | | }); |
| | | CachePointService.Repository.UpdateData(cachePoints); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent CachePointEnableStatus(int key) |
| | | { |
| | | return CachePointEnableStatus(new int[] { key }); |
| | | } |
| | | |
| | | public WebResponseContent CachePointDisableStatus(int key) |
| | | { |
| | | return CachePointDisableStatus(new int[] { key }); |
| | | } |
| | | #endregion |
| | | |
| | | #region LocationInfo |
| | | public WebResponseContent LocationEnableStatus(int[] keys) |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = LocationInfoService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | locationInfos.ForEach(x => |
| | | { |
| | | x.EnableStatus = EnableEnum.Enable.ObjToInt(); |
| | | }); |
| | | LocationInfoService.Repository.UpdateData(locationInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent LocationDisableStatus(int[] keys) |
| | | { |
| | | List<Dt_LocationInfo> locationInfos = LocationInfoService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | locationInfos.ForEach(x => |
| | | { |
| | | x.EnableStatus = EnableEnum.Disable.ObjToInt(); |
| | | }); |
| | | LocationInfoService.Repository.UpdateData(locationInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent LocationEnableStatus(int key) |
| | | { |
| | | return LocationEnableStatus(new int[] { key }); |
| | | } |
| | | |
| | | public WebResponseContent LocationDisableStatus(int key) |
| | | { |
| | | return LocationDisableStatus(new int[] { key }); |
| | | } |
| | | #endregion |
| | | |
| | | #region RoadwayInfo |
| | | public WebResponseContent RoadwayEnableStatus(int[] keys) |
| | | { |
| | | List<Dt_RoadwayInfo> roadwayInfos = RoadwayInfoService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | roadwayInfos.ForEach(x => |
| | | { |
| | | x.EnableStatus = EnableEnum.Enable.ObjToInt(); |
| | | }); |
| | | RoadwayInfoService.Repository.UpdateData(roadwayInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent RoadwayDisableStatus(int[] keys) |
| | | { |
| | | List<Dt_RoadwayInfo> roadwayInfos = RoadwayInfoService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | roadwayInfos.ForEach(x => |
| | | { |
| | | x.EnableStatus = EnableEnum.Disable.ObjToInt(); |
| | | }); |
| | | RoadwayInfoService.Repository.UpdateData(roadwayInfos); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent RoadwayEnableStatus(int key) |
| | | { |
| | | return RoadwayEnableStatus(new int[] { key }); |
| | | } |
| | | |
| | | public WebResponseContent RoadwayDisableStatus(int key) |
| | | { |
| | | return RoadwayDisableStatus(new int[] { key }); |
| | | } |
| | | #endregion |
| | | |
| | | #region Warehouse |
| | | public WebResponseContent WarehouseEnableStatus(int[] keys) |
| | | { |
| | | List<Dt_Warehouse> warehouses = WarehouseService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | warehouses.ForEach(x => |
| | | { |
| | | x.WarehouseStatus = EnableEnum.Enable.ObjToInt(); |
| | | }); |
| | | WarehouseService.Repository.UpdateData(warehouses); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent WarehouseDisableStatus(int[] keys) |
| | | { |
| | | List<Dt_Warehouse> warehouses = WarehouseService.Repository.QueryData(x => keys.Contains(x.Id)); |
| | | warehouses.ForEach(x => |
| | | { |
| | | x.WarehouseStatus = EnableEnum.Disable.ObjToInt(); |
| | | }); |
| | | WarehouseService.Repository.UpdateData(warehouses); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent WarehouseEnableStatus(int key) |
| | | { |
| | | return WarehouseEnableStatus(new int[] { key }); |
| | | } |
| | | |
| | | public WebResponseContent WarehouseDisableStatus(int key) |
| | | { |
| | | return WarehouseDisableStatus(new int[] { key }); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_BasicService |
| | | { |
| | | public class CachePointService : ServiceBase<Dt_CachePoint, ICachePointRepository>, ICachePointService |
| | | { |
| | | public CachePointService(ICachePointRepository BaseDal) : base(BaseDal) |
| | | { |
| | | } |
| | | |
| | | public ICachePointRepository Repository => BaseDal; |
| | | |
| | | private readonly Dictionary<string, OrderByType> _emptyAssignOrderBy = new() |
| | | { |
| | | { nameof(Dt_CachePoint.Depth), OrderByType.Desc }, |
| | | { nameof(Dt_CachePoint.Column), OrderByType.Asc }, |
| | | { nameof(Dt_CachePoint.Row), OrderByType.Asc }, |
| | | }; |
| | | |
| | | public Dt_CachePoint? AssignCachePoint(int areaId) |
| | | { |
| | | List<CachePointGroupDTO> cachePointGroups = Repository.GetCachePointGroups(areaId, LocationStatusEnum.InStock, LocationStatusEnum.Free); |
| | | if (cachePointGroups != null && cachePointGroups.Count > 0) |
| | | { |
| | | CachePointGroupDTO? pointGroupDTO = cachePointGroups.FirstOrDefault(x => x.EnableStatusB == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatusB == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = pointGroupDTO?.IdB ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | cachePointGroups = Repository.GetCachePointGroups(areaId, LocationStatusEnum.Free, LocationStatusEnum.Free); |
| | | if (cachePointGroups != null && cachePointGroups.Count > 0) |
| | | { |
| | | CachePointGroupDTO? pointGroupDTO = cachePointGroups.FirstOrDefault(x => x.EnableStatusA == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatusA == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = pointGroupDTO?.IdA ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | |
| | | return BaseDal.QueryFirst(x => x.PointStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == LocationEnalbeStatusEnum.Normal.ObjToInt() && x.AreaId == areaId), _emptyAssignOrderBy); |
| | | } |
| | | |
| | | public Dt_CachePoint? GetIbStockCachePoint(int areaId) |
| | | { |
| | | List<CachePointGroupDTO> cachePointGroups = Repository.GetCachePointGroups(areaId, LocationStatusEnum.InStock, LocationStatusEnum.Free); |
| | | if (cachePointGroups != null && cachePointGroups.Count > 0) |
| | | { |
| | | CachePointGroupDTO? pointGroupDTO = cachePointGroups.FirstOrDefault(x => x.EnableStatusA == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || x.EnableStatusA == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = pointGroupDTO?.IdA ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | cachePointGroups = Repository.GetCachePointGroups(areaId, LocationStatusEnum.InStock, LocationStatusEnum.InStock); |
| | | if (cachePointGroups != null && cachePointGroups.Count > 0) |
| | | { |
| | | CachePointGroupDTO? pointGroupDTO = cachePointGroups.FirstOrDefault(x => x.EnableStatusB == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || x.EnableStatusB == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = pointGroupDTO?.IdB ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | |
| | | return BaseDal.QueryFirst(x => x.PointStatus == LocationStatusEnum.InStock.ObjToInt() && (x.EnableStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || x.EnableStatus == LocationEnalbeStatusEnum.Normal.ObjToInt() && x.AreaId == areaId), _emptyAssignOrderBy); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | public class LocationInfoService : ServiceBase<Dt_LocationInfo, ILocationInfoRepository>, ILocationInfoService |
| | | { |
| | | private readonly IAreaInfoRepository _areaInfoRepository; |
| | | private readonly IWarehouseRepository _warehouseRepository; |
| | | private readonly IRoadwayInfoRepository _roadwayInfoRepository; |
| | | private readonly IBasicRepository _basicRepository; |
| | | |
| | | private Dictionary<string, OrderByType> _emptyAssignOrderBy = new Dictionary<string, OrderByType>() |
| | | { |
| | |
| | | |
| | | public ILocationInfoRepository Repository => BaseDal; |
| | | |
| | | public LocationInfoService(ILocationInfoRepository BaseDal, IAreaInfoRepository areaInfoRepository, IWarehouseRepository warehouseRepository, IRoadwayInfoRepository roadwayInfoRepository) : base(BaseDal) |
| | | public LocationInfoService(ILocationInfoRepository BaseDal, IBasicRepository basicRepository) : base(BaseDal) |
| | | { |
| | | _areaInfoRepository = areaInfoRepository; |
| | | _warehouseRepository = warehouseRepository; |
| | | _roadwayInfoRepository = roadwayInfoRepository; |
| | | _basicRepository = basicRepository; |
| | | } |
| | | |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | |
| | | { |
| | | try |
| | | { |
| | | Dt_RoadwayInfo roadwayInfo = _roadwayInfoRepository.QueryFirst(x => x.InStationCode == stationCode) ?? throw new Exception("æªæ¾å°è¯¥ç«å°å¯¹åºçå··éï¼è¯·æ£æ¥åºç¡é
置信æ¯"); |
| | | if (roadwayInfo.EnalbeStatus != RoadwayStatusEnum.Normal.ObjToInt() && roadwayInfo.EnalbeStatus != RoadwayStatusEnum.OnlyIn.ObjToInt()) |
| | | Dt_RoadwayInfo roadwayInfo = _basicRepository.RoadwayInfoRepository.QueryFirst(x => x.InStationCode == stationCode) ?? throw new Exception("æªæ¾å°è¯¥ç«å°å¯¹åºçå··éï¼è¯·æ£æ¥åºç¡é
置信æ¯"); |
| | | if (roadwayInfo.EnableStatus != RoadwayStatusEnum.Normal.ObjToInt() && roadwayInfo.EnableStatus != RoadwayStatusEnum.OnlyIn.ObjToInt()) |
| | | { |
| | | throw new Exception("该巷éä¸å¯å
¥åºï¼è¯·æ£æ¥å··éç¦ç¨ä¿¡æ¯"); |
| | | } |
| | | if (roadwayInfo.WarehouseId > 0) |
| | | if (roadwayInfo.AreaId > 0) |
| | | { |
| | | Dt_Warehouse warehouse = _warehouseRepository.QueryFirst(x => x.Id == roadwayInfo.WarehouseId); |
| | | if (warehouse != null && warehouse.WarehouseStatus == EnableEnum.Disable.ObjToInt()) |
| | | Dt_AreaInfo areaInfo = _basicRepository.AreaInfoRepository.QueryFirst(x => x.Id == roadwayInfo.AreaId); |
| | | if (areaInfo != null && areaInfo.AreaStatus == EnableEnum.Disable.ObjToInt()) |
| | | { |
| | | throw new Exception("ä»åºè¢«ç¦ç¨ï¼ä¸å¯å
¥åº"); |
| | | throw new Exception("åºå被ç¦ç¨ï¼ä¸å¯å
¥åº"); |
| | | } |
| | | } |
| | | if (inboundType == TaskTypeEnum.PalletInbound.ObjToInt())//空çå
¥åºåé
é»è¾ |
| | |
| | | |
| | | private Dt_LocationInfo EmptyAssignLocation(string roadway) |
| | | { |
| | | List<LocationGroupDTO> locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.Free, LocationStatusEnum.Pallet); |
| | | List<LocationGroupDTO> locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.Pallet, LocationStatusEnum.Free); |
| | | if (locationGroups != null && locationGroups.Count > 0) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Id == locationGroups.FirstOrDefault().IdA); |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusA == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatusA == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = locationGroup?.IdA ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.Free, LocationStatusEnum.Free); |
| | | if (locationGroups != null && locationGroups.Count > 0) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Id == locationGroups.FirstOrDefault().IdB); |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusB == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatusB == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = locationGroup?.IdB ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | |
| | | return BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnalbeStatus == LocationEnalbeStatusEnum.Normal.ObjToInt() && x.RoadwayNo == roadway), _emptyAssignOrderBy); |
| | | return BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == LocationEnalbeStatusEnum.Normal.ObjToInt() && x.RoadwayNo == roadway), _emptyAssignOrderBy); |
| | | } |
| | | |
| | | private Dt_LocationInfo StoredAssignLocation(string roadway) |
| | | { |
| | | List<LocationGroupDTO> locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.Free, LocationStatusEnum.InStock); |
| | | if (locationGroups != null && locationGroups.Count > 0) |
| | | List<LocationGroupDTO> locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.InStock, LocationStatusEnum.Free); |
| | | if (locationGroups != null) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Id == locationGroups.FirstOrDefault().IdA); |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusA == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatusA == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = locationGroup?.IdA ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | locationGroups = BaseDal.GetLocationGroups(roadway, LocationStatusEnum.Free, LocationStatusEnum.Free); |
| | | if (locationGroups != null && locationGroups.Count > 0) |
| | | { |
| | | return BaseDal.QueryFirst(x => x.Id == locationGroups.FirstOrDefault().IdB); |
| | | LocationGroupDTO? locationGroup = locationGroups.FirstOrDefault(x => x.EnableStatusB == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatusB == LocationEnalbeStatusEnum.Normal.ObjToInt()); |
| | | int id = locationGroup?.IdB ?? 0; |
| | | return BaseDal.QueryFirst(x => x.Id == id); |
| | | } |
| | | |
| | | return BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnalbeStatus == LocationEnalbeStatusEnum.Normal.ObjToInt() && x.RoadwayNo == roadway), _emptyAssignOrderBy); |
| | | return BaseDal.QueryFirst(x => x.LocationStatus == LocationStatusEnum.Free.ObjToInt() && (x.EnableStatus == LocationEnalbeStatusEnum.OnlyIn.ObjToInt() || x.EnableStatus == LocationEnalbeStatusEnum.Normal.ObjToInt() && x.RoadwayNo == roadway), _emptyAssignOrderBy); |
| | | } |
| | | |
| | | public Dt_LocationInfo AdjacentDepthLocation(string locationCode) |
| | |
| | | { |
| | | AreaId = 0, |
| | | Column = j + 1, |
| | | EnalbeStatus = LocationEnalbeStatusEnum.Normal.ObjToInt(), |
| | | EnableStatus = LocationEnalbeStatusEnum.Normal.ObjToInt(), |
| | | Layer = k + 1, |
| | | LocationStatus = LocationStatusEnum.Free.ObjToInt(), |
| | | LocationType = LocationTypeEnum.Cube.ObjToInt(), |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common |
| | | { |
| | | public class AGVTaskFeedBackModel |
| | | { |
| | | public string Task_id { get; set; } |
| | | |
| | | public string Task_status { get; set; } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Utilities; |
| | | |
| | | namespace WIDESEA_Core |
| | | { |
| | |
| | | /// æ¥è¯¢æ¡ä»¶ |
| | | /// </summary> |
| | | public List<SearchParameters> Filter { get; set; } |
| | | |
| | | public string ValidatePageOptions(PropertyInfo[] entityProperties) |
| | | { |
| | | string where = string.Empty; |
| | | List<SearchParameters> searchParametersList = new List<SearchParameters>(); |
| | | if (this.Filter != null && this.Filter.Count > 0) |
| | | { |
| | | searchParametersList.AddRange(Filter); |
| | | } |
| | | else if (!string.IsNullOrEmpty(Wheres)) |
| | | { |
| | | try |
| | | { |
| | | searchParametersList = Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | Filter = searchParametersList; |
| | | } |
| | | catch { } |
| | | } |
| | | for (int i = 0; i < searchParametersList.Count; i++) |
| | | { |
| | | if (string.IsNullOrEmpty(searchParametersList[i].Value)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | PropertyInfo? property = entityProperties.Where(c => c.Name.ToUpper() == searchParametersList[i].Name.ToUpper()).FirstOrDefault(); |
| | | |
| | | if (property == null) continue; |
| | | |
| | | List<(bool, string, object)> results = property.ValidationValueForDbType(searchParametersList[i].Value.Split(',')).ToList(); |
| | | if (results == null || results.Count() == 0) |
| | | { |
| | | continue; |
| | | } |
| | | for (int j = 0; j < results.Count(); j++) |
| | | { |
| | | if (j == 0) |
| | | { |
| | | where += "("; |
| | | } |
| | | LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition(); |
| | | if (expressionType == LinqExpressionType.Equal) |
| | | { |
| | | where += $"{searchParametersList[i].Name} = '{results[j].Item3}'"; |
| | | } |
| | | else |
| | | { |
| | | where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{results[j].Item3}'"; |
| | | } |
| | | |
| | | if (j == results.Count() - 1) |
| | | { |
| | | where += ")"; |
| | | } |
| | | else |
| | | { |
| | | where += " or "; |
| | | } |
| | | } |
| | | if (i < searchParametersList.Count - 1) |
| | | where += " and "; |
| | | } |
| | | return where; |
| | | } |
| | | |
| | | |
| | | public Dictionary<string, OrderByType> GetPageDataSort(PropertyInfo[] propertyInfo) |
| | | { |
| | | if (!string.IsNullOrEmpty(Sort)) |
| | | { |
| | | if (Sort.Contains(",")) |
| | | { |
| | | List<string> sortArr = Sort.Split(",").Where(x => propertyInfo.Any(p => p.Name == x)).ToList(); |
| | | Dictionary<string, OrderByType> sortDic = new Dictionary<string, OrderByType>(); |
| | | foreach (var item in sortArr) |
| | | { |
| | | sortDic[item] = Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc; |
| | | } |
| | | return sortDic; |
| | | } |
| | | else if (propertyInfo.Any(x => x.Name == Sort.FirstLetterToLower() || x.Name == Sort.FirstLetterToUpper())) |
| | | { |
| | | return new Dictionary<string, OrderByType> { |
| | | { |
| | | Sort,Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc |
| | | } }; |
| | | } |
| | | } |
| | | return new Dictionary<string, OrderByType> { { "CreateDate", Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc } }; |
| | | } |
| | | } |
| | | public class SearchParameters |
| | | { |
| | |
| | | using System.Linq.Expressions; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Core.BaseRepository |
| | | { |
| | |
| | | |
| | | Task<bool> DeleteDataByIdAsync(object id); |
| | | |
| | | bool DeleteAndMoveIntoHty(TEntity entity, OperateType operateType); |
| | | |
| | | bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateType operateType); |
| | | |
| | | /// <summary> |
| | | /// éè¿ä¸»é®æ°æ®å é¤å¤æ¡æ°æ® |
| | | /// </summary> |
| | |
| | | using WIDESEA_Core.Const; |
| | | using WIDESEA_Core.AOP; |
| | | using OfficeOpenXml.FormulaParsing.ExpressionGraph; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Utilities; |
| | | using Microsoft.AspNetCore.Mvc.RazorPages; |
| | | using NetTaste; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Core.BaseRepository |
| | | { |
| | |
| | | public virtual List<TResult> QueryTabs<T, T2, TResult>( |
| | | Expression<Func<T, T2, object[]>> joinExpression, |
| | | Expression<Func<T, T2, TResult>> selectExpression, |
| | | Expression<Func<T,T2, bool>> whereExpressionT1, |
| | | Expression<Func<T, T2, bool>> whereExpressionT1, |
| | | Expression<Func<TResult, bool>> whereExpression) |
| | | { |
| | | List<TResult> list = _db.Queryable(joinExpression).WhereIF(whereExpressionT1 != null, whereExpressionT1) |
| | |
| | | .WhereIF(whereExpression != null, whereExpression).ToListAsync(); |
| | | } |
| | | |
| | | public bool DeleteAndMoveIntoHty(TEntity entity, OperateType operateType) |
| | | { |
| | | Type type = entity.GetType(); |
| | | Assembly assembly = type.Assembly; |
| | | Type? htyType = assembly.GetType(type.FullName + "_Hty"); |
| | | if (htyType != null) |
| | | { |
| | | object? obj = Activator.CreateInstance(htyType); |
| | | PropertyInfo keyPro = typeof(TEntity).GetKeyProperty(); |
| | | PropertyInfo? operateTypePro = htyType.GetProperty(nameof(OperateType)); |
| | | PropertyInfo? sourceIdPro = htyType.GetProperty("SourceId"); |
| | | if (obj != null && keyPro != null && operateTypePro != null && sourceIdPro != null) |
| | | { |
| | | operateTypePro.SetValue(obj, operateType.ToString()); |
| | | sourceIdPro.SetValue(obj, keyPro.GetValue(entity)); |
| | | |
| | | List<PropertyInfo> propertyInfos = htyType.GetProperties().Where(x => x.Name != operateTypePro.Name && x.Name != sourceIdPro.Name && x.Name != keyPro.Name).ToList(); |
| | | |
| | | for (int i = 0; i < propertyInfos.Count; i++) |
| | | { |
| | | PropertyInfo propertyInfo = propertyInfos[i]; |
| | | PropertyInfo? property = type.GetProperty(propertyInfo.Name); |
| | | |
| | | if (property != null) |
| | | { |
| | | if (propertyInfo.Name == nameof(BaseEntity.Modifier)) |
| | | { |
| | | propertyInfo.SetValue(obj, App.User.UserId > 0 ? App.User.UserName : App.User.UserId.ToString()); |
| | | } |
| | | else if (propertyInfo.Name == nameof(BaseEntity.ModifyDate)) |
| | | { |
| | | propertyInfo.SetValue(obj, DateTime.Now); |
| | | } |
| | | else |
| | | { |
| | | propertyInfo.SetValue(obj, property.GetValue(entity)); |
| | | } |
| | | } |
| | | } |
| | | _db.InsertableByObject(obj).AS(type.Name + "_Hty").ExecuteCommand(); |
| | | } |
| | | } |
| | | return DeleteData(entity); |
| | | } |
| | | |
| | | public bool DeleteAndMoveIntoHty(List<TEntity> entities, OperateType operateType) |
| | | { |
| | | Type type = typeof(TEntity); |
| | | Assembly assembly = type.Assembly; |
| | | Type? htyType = assembly.GetType(type.FullName + "_Hty"); |
| | | if (htyType != null) |
| | | { |
| | | object? obj2 = Activator.CreateInstance(htyType); |
| | | PropertyInfo keyPro = typeof(TEntity).GetKeyProperty(); |
| | | PropertyInfo? operateTypePro = htyType.GetProperty(nameof(OperateType)); |
| | | PropertyInfo? sourceIdPro = htyType.GetProperty("SourceId"); |
| | | if (obj2 != null && keyPro != null && operateTypePro != null && sourceIdPro != null) |
| | | { |
| | | List<PropertyInfo> propertyInfos = htyType.GetProperties().Where(x => x.Name != operateTypePro.Name && x.Name != sourceIdPro.Name && x.Name != keyPro.Name).ToList(); |
| | | List<object> list = new List<object>(); |
| | | foreach (var item in entities) |
| | | { |
| | | object? obj = Activator.CreateInstance(htyType); |
| | | if (obj != null) |
| | | { |
| | | operateTypePro.SetValue(obj, operateType.ToString()); |
| | | sourceIdPro.SetValue(obj, keyPro.GetValue(item)); |
| | | for (int i = 0; i < propertyInfos.Count; i++) |
| | | { |
| | | PropertyInfo propertyInfo = propertyInfos[i]; |
| | | PropertyInfo? property = type.GetProperty(propertyInfo.Name); |
| | | |
| | | if (property != null) |
| | | { |
| | | if (propertyInfo.Name == nameof(BaseEntity.Modifier)) |
| | | { |
| | | propertyInfo.SetValue(obj, App.User.UserId > 0 ? App.User.UserName : App.User.UserId.ToString()); |
| | | } |
| | | else if (propertyInfo.Name == nameof(BaseEntity.ModifyDate)) |
| | | { |
| | | propertyInfo.SetValue(obj, DateTime.Now); |
| | | } |
| | | else |
| | | { |
| | | propertyInfo.SetValue(obj, property.GetValue(item)); |
| | | } |
| | | } |
| | | } |
| | | list.Add(obj); |
| | | } |
| | | } |
| | | _db.InsertableByObject(list).AS(type.Name + "_Hty").ExecuteCommand(); |
| | | |
| | | } |
| | | } |
| | | return DeleteData(entities); |
| | | } |
| | | //List<TResult> QueryMuch<T, T2, T3, TResult>( |
| | | // Expression<Func<T, T2, T3, object[]>> joinExpression, |
| | | // Expression<Func<T, T2, T3, TResult>> selectExpression, |
| | |
| | | public ISqlSugarClient Db => BaseDal.Db; |
| | | |
| | | private PropertyInfo[] _propertyInfo { get; set; } = null; |
| | | private PropertyInfo[] TProperties |
| | | public PropertyInfo[] TProperties |
| | | { |
| | | get |
| | | { |
| | |
| | | |
| | | public virtual PageGridData<TEntity> GetPageData(PageDataOptions options) |
| | | { |
| | | string wheres = ValidatePageOptions(options); |
| | | string wheres = options.ValidatePageOptions(TProperties); |
| | | //è·åæåºå段 |
| | | Dictionary<string, OrderByType> orderbyDic = GetPageDataSort(options, TProperties); |
| | | Dictionary<string, OrderByType> orderbyDic = options.GetPageDataSort(TProperties); |
| | | |
| | | PageGridData<TEntity> pageGridData = new PageGridData<TEntity>(); |
| | | pageGridData = BaseDal.QueryPage(wheres, options.Page, options.Rows, orderbyDic); |
| | | |
| | | return pageGridData; |
| | | } |
| | | |
| | | protected string ValidatePageOptions(PageDataOptions options) |
| | | { |
| | | options = options ?? new PageDataOptions(); |
| | | string where = ""; |
| | | List<SearchParameters> searchParametersList = new List<SearchParameters>(); |
| | | if (options.Filter != null && options.Filter.Count > 0) |
| | | { |
| | | searchParametersList.AddRange(options.Filter); |
| | | } |
| | | else if (!string.IsNullOrEmpty(options.Wheres)) |
| | | { |
| | | try |
| | | { |
| | | searchParametersList = options.Wheres.DeserializeObject<List<SearchParameters>>(); |
| | | options.Filter = searchParametersList; |
| | | } |
| | | catch { } |
| | | } |
| | | QueryRelativeList?.Invoke(searchParametersList); |
| | | |
| | | for (int i = 0; i < searchParametersList.Count; i++) |
| | | { |
| | | if (string.IsNullOrEmpty(searchParametersList[i].Value)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | PropertyInfo property = TProperties.Where(c => c.Name.ToUpper() == searchParametersList[i].Name.ToUpper()).FirstOrDefault(); |
| | | |
| | | if (property == null) continue; |
| | | |
| | | List<(bool, string, object)> results = property.ValidationValueForDbType(searchParametersList[i].Value.Split(',')).ToList(); |
| | | if (results == null || results.Count() > 0) |
| | | { |
| | | continue; |
| | | } |
| | | for (int j = 0; j < results.Count(); j++) |
| | | { |
| | | if (j == 0) |
| | | { |
| | | where += "("; |
| | | } |
| | | LinqExpressionType expressionType = searchParametersList[i].DisplayType.GetLinqCondition(); |
| | | if (expressionType == LinqExpressionType.Equal) |
| | | { |
| | | where += $"{searchParametersList[i].Name} = '{results[j].Item3}'"; |
| | | } |
| | | else |
| | | { |
| | | where += $"{searchParametersList[i].Name} {searchParametersList[i].DisplayType} '{results[j].Item3}'"; |
| | | } |
| | | |
| | | if (j == results.Count() - 1) |
| | | { |
| | | where += ")"; |
| | | } |
| | | else |
| | | { |
| | | where += " or "; |
| | | } |
| | | } |
| | | if (i < searchParametersList.Count - 1) |
| | | where += " and "; |
| | | } |
| | | return where; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åæåºå段 |
| | | /// </summary> |
| | | /// <param name="pageData"></param> |
| | | /// <param name="propertyInfo"></param> |
| | | /// <returns></returns> |
| | | private Dictionary<string, OrderByType> GetPageDataSort(PageDataOptions pageData, PropertyInfo[] propertyInfo) |
| | | { |
| | | if (!string.IsNullOrEmpty(pageData.Sort)) |
| | | { |
| | | if (pageData.Sort.Contains(",")) |
| | | { |
| | | List<string> sortArr = pageData.Sort.Split(",").Where(x => propertyInfo.Any(p => p.Name == x)).ToList(); |
| | | Dictionary<string, OrderByType> sortDic = new Dictionary<string, OrderByType>(); |
| | | foreach (var item in sortArr) |
| | | { |
| | | sortDic[item] = pageData.Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc; |
| | | } |
| | | return sortDic; |
| | | } |
| | | else if (propertyInfo.Any(x => x.Name == pageData.Sort.FirstLetterToLower() || x.Name == pageData.Sort.FirstLetterToUpper())) |
| | | { |
| | | return new Dictionary<string, OrderByType> { |
| | | { |
| | | pageData.Sort,pageData.Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc |
| | | } }; |
| | | } |
| | | } |
| | | return new Dictionary<string, OrderByType> { { "CreateDate", pageData.Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc } }; |
| | | } |
| | | |
| | | public virtual object GetDetailPage(PageDataOptions pageData) |
| | |
| | | } |
| | | else if (keyPro.PropertyType == typeof(int) || keyPro.PropertyType == typeof(long)) |
| | | { |
| | | SugarColumn sugarColumn = keyPro.GetCustomAttribute<SugarColumn>(); |
| | | if (sugarColumn.IsIdentity) |
| | | SugarColumn? sugarColumn = keyPro.GetCustomAttribute<SugarColumn>(); |
| | | if (sugarColumn?.IsIdentity ?? true) |
| | | { |
| | | saveModel.MainData.Remove(keyPro.Name.FirstLetterToUpper()); |
| | | saveModel.MainData.Remove(keyPro.Name.FirstLetterToLower()); |
| | |
| | | |
| | | string savePath = AppDomain.CurrentDomain.BaseDirectory + $"ExcelExport"; |
| | | IExporter exporter = new ExcelExporter(); |
| | | string wheres = ValidatePageOptions(options); |
| | | string wheres = options.ValidatePageOptions(TProperties); |
| | | //è·åæåºå段 |
| | | Dictionary<string, OrderByType> orderbyDic = GetPageDataSort(options, TProperties); |
| | | Dictionary<string, OrderByType> orderbyDic = options.GetPageDataSort(TProperties); |
| | | |
| | | List<TEntity> entities = BaseDal.QueryData(wheres, orderbyDic); |
| | | |
| | |
| | | |
| | | #endregion åºåç¶æ |
| | | |
| | | public enum OperateTypeEnum |
| | | public enum OperateType |
| | | { |
| | | 人工å é¤ = 1, |
| | | èªå¨å é¤ = 2, |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Core.Enums |
| | | { |
| | | public enum SequenceEnum |
| | | { |
| | | SeqTaskNum |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public enum TaskTypeEnum |
| | | { |
| | | |
| | | |
| | | /// <summary> |
| | | /// åºåº =100 |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// åºå¤ç§»åº |
| | | /// </summary> |
| | | RelocationOut = 302 |
| | | RelocationOut = 302, |
| | | |
| | | AGVCarry = 500, |
| | | } |
| | | |
| | | #endregion ä»»å¡ç±»å |
| | |
| | | /// æ°å»ºå
¥åºä»»å¡ |
| | | /// </summary> |
| | | InNew = 200, |
| | | |
| | | /// <summary> |
| | | /// AGVå
¥åºæ§è¡ä¸ |
| | | /// </summary> |
| | | AGV_InExecuting = 210, |
| | | |
| | | /// <summary> |
| | | /// AGVå
¥åºå®æ |
| | | /// </summary> |
| | | AGV_InFinish = 215, |
| | | |
| | | /// <summary> |
| | | /// è¾é线å
¥åºæ§è¡ä¸ |
| | | /// </summary> |
| | | Line_InExecuting = 220, |
| | | |
| | | /// <summary> |
| | | /// è¾é线å
¥åºå®æ |
| | | /// </summary> |
| | | Line_InFinish = 225, |
| | | |
| | | /// <summary> |
| | | /// å åæºå
¥åºæ§è¡ä¸ |
| | | /// </summary> |
| | |
| | | /// æ°å»ºä»»å¡ |
| | | /// </summary> |
| | | OutNew = 100, |
| | | |
| | | /// <summary> |
| | | /// AGVæ§è¡ä¸ |
| | | /// </summary> |
| | | AGV_OutExecuting = 110, |
| | | |
| | | /// <summary> |
| | | /// AGVåºåºå®æ |
| | | /// </summary> |
| | | AGV_OutFinish = 115, |
| | | |
| | | /// <summary> |
| | | /// è¾é线åºåºæ§è¡ä¸ |
| | | /// </summary> |
| | | Line_OutExecuting = 120, |
| | | |
| | | /// <summary> |
| | | /// è¾é线åºåºå®æ |
| | | /// </summary> |
| | | Line_OutFinish = 125, |
| | | |
| | | /// <summary> |
| | | /// å åæºåºåºæ§è¡ä¸ |
| | | /// </summary> |
| | |
| | | OutException = 199 |
| | | } |
| | | |
| | | public enum AGVTaskStatusEnum |
| | | { |
| | | AGV_New = 500, |
| | | |
| | | AGV_Executing = 510, |
| | | |
| | | AGV_Finish = 520 |
| | | } |
| | | } |
| | |
| | | |
| | | public string Token => GetToken(); |
| | | |
| | | public int MenuType => (_accessor.HttpContext?.Request.Headers.ContainsKey("uniapp") ?? false) ? 1 : 0; |
| | | |
| | | public bool IsAuthenticated() |
| | | { |
| | | return _accessor.HttpContext?.User?.Identity?.IsAuthenticated ?? false; |
| | |
| | | |
| | | string Token { get; } |
| | | |
| | | int MenuType { get; } |
| | | |
| | | void UpdateToke(string token); |
| | | |
| | | /// <summary> |
| | |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.LogHelper; |
| | |
| | | /// |
| | | /// </summary> |
| | | private readonly RequestDelegate _next; |
| | | private readonly ILogger<ApiLogMiddleware> _logger; |
| | | |
| | | public ApiLogMiddleware(RequestDelegate next, ILogger<ApiLogMiddleware> logger) |
| | | public ApiLogMiddleware(RequestDelegate next) |
| | | { |
| | | _next = next; |
| | | _logger = logger; |
| | | } |
| | | |
| | | //todo |
| | | public async Task InvokeAsync(HttpContext context) |
| | | { |
| | | //if (AppSettings.app("Middleware", "RequestResponseLog", "Enabled").ObjToBool()) |
| | | // è¿æ»¤ï¼åªææ¥å£ |
| | | if (context.Request.Path.Value?.Contains("api") ?? false) |
| | | { |
| | | // è¿æ»¤ï¼åªææ¥å£ |
| | | if (context.Request.Path.Value.Contains("api")) |
| | | { |
| | | context.Request.EnableBuffering(); |
| | | //Stream originalBody = context.Response.Body; |
| | | context.Request.EnableBuffering(); |
| | | Stream originalBody = context.Response.Body; |
| | | |
| | | try |
| | | { |
| | | try |
| | | { |
| | | // åå¨è¯·æ±æ°æ® |
| | | //string requestParam = GetRequestData(context); |
| | | //DateTime beginDate = DateTime.Now; |
| | | await RequestDataLog(context); |
| | | context.Request.Body.Position = 0; |
| | | } |
| | | catch { } |
| | | using MemoryStream ms = new(); |
| | | context.Response.Body = ms; |
| | | |
| | | //using var ms = new MemoryStream(); |
| | | //context.Response.Body = ms; |
| | | await _next(context); |
| | | |
| | | await _next(context); |
| | | |
| | | try |
| | | { |
| | | // åå¨ååºæ°æ® |
| | | //DateTime endDate = DateTime.Now; |
| | | //string responseParam = GetResponsetData(context); |
| | | ResponseDataLog(context.Response, ms); |
| | | } |
| | | catch { } |
| | | |
| | | //context.Response.Body.Position = 0; |
| | | //await context.Response.Body.CopyToAsync(originalBody); |
| | | ms.Position = 0; |
| | | await ms.CopyToAsync(originalBody); |
| | | |
| | | //Logger.WriteApiLog2DB(context,requestParam, beginDate, responseParam, endDate, context.Response.StatusCode == 200 ? LoggerStatus.Success : LoggerStatus.Error); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | // è®°å½å¼å¸¸ |
| | | _logger.LogError(ex.Message + "" + ex.InnerException); |
| | | } |
| | | finally |
| | | { |
| | | //context.Response.Body = originalBody; |
| | | } |
| | | } |
| | | //else |
| | | //{ |
| | | // await _next(context); |
| | | //} |
| | | catch (Exception ex) |
| | | { |
| | | // è®°å½å¼å¸¸ |
| | | |
| | | } |
| | | finally |
| | | { |
| | | context.Response.Body = originalBody; |
| | | } |
| | | } |
| | | //else |
| | | //{ |
| | | // await _next(context); |
| | | //} |
| | | } |
| | | |
| | | private string GetRequestData(HttpContext context) |
| | | { |
| | | try |
| | | else |
| | | { |
| | | using StreamReader sr = new StreamReader(context.Request.Body); |
| | | string request = JsonConvert.SerializeObject(sr.ReadToEnd()); ; |
| | | context.Request.Body.Position = 0; |
| | | return request; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return $"请æ±åæ°è·åé误,{ex.Message}"; |
| | | await _next(context); |
| | | } |
| | | } |
| | | |
| | | private string GetResponsetData(HttpContext context) |
| | | |
| | | private async Task RequestDataLog(HttpContext context) |
| | | { |
| | | try |
| | | var request = context.Request; |
| | | var sr = new StreamReader(request.Body); |
| | | //long length = request.Body.Length; |
| | | RequestLogInfo requestResponse = new RequestLogInfo() |
| | | { |
| | | using StreamReader sr = new StreamReader(context.Response.Body); |
| | | string response = JsonConvert.SerializeObject(sr.ReadToEnd()); ; |
| | | context.Response.Body.Position = 0; |
| | | return response; |
| | | } |
| | | catch (Exception ex) |
| | | Path = request.Path, |
| | | QueryString = request.QueryString.ToString(), |
| | | BodyData = await sr.ReadToEndAsync() |
| | | }; |
| | | var content = JsonConvert.SerializeObject(requestResponse); |
| | | if (!string.IsNullOrEmpty(content)) |
| | | { |
| | | return $"ååºåæ°è·åé误,{ex.Message}"; |
| | | LogLock.OutLogAOP("æ¥å£æ¥å¿", new string[] { "è¯·æ±æ°æ® - è¯·æ±æ°æ®ç±»å:" + requestResponse.GetType().ToString(), content }); |
| | | request.Body.Position = 0; |
| | | } |
| | | } |
| | | |
| | | private void ResponseDataLog(HttpResponse response, MemoryStream ms) |
| | | { |
| | | ms.Position = 0; |
| | | var responseBody = new StreamReader(ms).ReadToEnd(); |
| | | |
| | | // å»é¤ Html |
| | | var reg = "<[^>]+>"; |
| | | var isHtml = Regex.IsMatch(responseBody, reg); |
| | | |
| | | if (!string.IsNullOrEmpty(responseBody)) |
| | | { |
| | | Parallel.For(0, 1, e => |
| | | { |
| | | LogLock.OutLogAOP("æ¥å£æ¥å¿", new string[] { "ååºæ°æ® - ååºæ°æ®ç±»å:" + responseBody.GetType().ToString(), responseBody }); |
| | | |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public class RequestLogInfo |
| | | { |
| | | /// <summary> |
| | | /// 请æ±å°å |
| | | /// </summary> |
| | | public string Path { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 请æ±åæ° |
| | | /// </summary> |
| | | public string QueryString { get; set; } |
| | | |
| | | /// <summary> |
| | | /// Bodyåæ° |
| | | /// </summary> |
| | | public string BodyData { get; set; } |
| | | } |
| | | } |
| | |
| | | { |
| | | foreach (PropertyInfo property in properties) |
| | | { |
| | | SugarColumn sugarColumn = property.GetCustomAttribute<SugarColumn>(); |
| | | if (sugarColumn.IsPrimaryKey) |
| | | return property.Name; |
| | | SugarColumn? sugarColumn = property.GetCustomAttribute<SugarColumn>(); |
| | | if (sugarColumn != null) |
| | | { |
| | | if (sugarColumn.IsPrimaryKey) |
| | | return property.Name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | |
| | | Type[] types = propertyInfo.PropertyType.GenericTypeArguments; |
| | | if (types.Length == 1) |
| | | { |
| | | string str = value.Serialize(); |
| | | if (str == "[]") |
| | | if (tempValue.ChangeType(property.PropertyType).ToString() == propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1].ChangeType(property.PropertyType).ToString()) |
| | | { |
| | | return (false, $"ã{property.Name}ã屿§çå¼ä¸ºã{propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1]}ãæ¶ã{propertyInfo.Name}ã屿§çå¼ä¸å¯ä¸ºç©º", data); |
| | | string str = value.Serialize(); |
| | | if (str == "[]") |
| | | { |
| | | return (false, $"ã{property.Name}ã屿§çå¼ä¸ºã{propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1]}ãæ¶ã{propertyInfo.Name}ã屿§çå¼ä¸å¯ä¸ºç©º", data); |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (types.Length == 0) |
| | | { |
| | | if (tempValue.ChangeType(property.PropertyType) != propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1].ChangeType(property.PropertyType) && value == null && string.IsNullOrEmpty(value.ToString())) |
| | | if (tempValue.ChangeType(property.PropertyType).ToString() == propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1].ChangeType(property.PropertyType).ToString() && value == null && string.IsNullOrEmpty(value.ToString())) |
| | | { |
| | | return (false, $"ã{property.Name}ã屿§çå¼ä¸ºã{propertyAttribute.NotNullAndEmptyWithPropertyAndValue[1]}ãæ¶ã{propertyInfo.Name}ã屿§çå¼ä¸å¯ä¸ºç©º", data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_DTO.Basic |
| | | { |
| | | public class CachePointGroupDTO |
| | | { |
| | | public int IdA { get; set; } |
| | | |
| | | public int IdB { get; set; } |
| | | |
| | | public string PointCodeA { get; set; } |
| | | |
| | | public string PointCodeB { get; set; } |
| | | |
| | | public int PointTypeA { get; set; } |
| | | |
| | | public int PointTypeB { get; set; } |
| | | |
| | | public int PointStatusA { get; set; } |
| | | |
| | | public int PointStatusB { get; set; } |
| | | |
| | | public int DepthA { get; set; } |
| | | |
| | | public int DepthB { get; set; } |
| | | |
| | | public int EnableStatusA { get; set; } |
| | | |
| | | public int EnableStatusB { get; set; } |
| | | } |
| | | } |
| | |
| | |  |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | |
| | | namespace WIDESEA_DTO.Stock |
| | | { |
| | | public class StockViewDTO : Dt_LocationInfo |
| | | public class StockViewDTO |
| | | { |
| | | public int AreaId { get; set; } |
| | | |
| | | public string LocationCode { get; set; } |
| | | |
| | | public string LocationName { get; set; } |
| | | |
| | | public int Column { get; set; } |
| | | |
| | | public int Row { get; set; } |
| | | |
| | | public int Layer { get; set; } |
| | | |
| | | public int Depth { get; set; } |
| | | |
| | | public int LocationStatus { get; set; } |
| | | |
| | | public int LocationType { get; set; } |
| | | |
| | | public string RoadwayNo { get; set; } |
| | | |
| | | public int EnalbeStatus { get; set; } |
| | | |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int StockId { get; set; } |
| | | |
| | | public string PalletCode { get; set; } |
| | |
| | | |
| | | public string StockRemark { get; set; } |
| | | |
| | | public string Creater { get; set; } |
| | | |
| | | public DateTime CreateDate { get; set; } |
| | | |
| | | public string Modifier { get; set; } |
| | | |
| | | public DateTime? ModifyDate { get; set; } |
| | | |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_StockInfoDetail.StockId), nameof(StockId))] |
| | | public List<Dt_StockInfoDetail> Details { get; set; } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicRepository |
| | | { |
| | | public interface IAreaRouterRepository : IRepository<Dt_AreaRouter> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IBasicRepository |
| | | { |
| | | public interface IBasicRepository : IDependency |
| | | { |
| | | IAreaInfoRepository AreaInfoRepository { get; } |
| | | |
| | | ILocationInfoRepository LocationInfoRepository { get; } |
| | | |
| | | IMaterielInfoRepository MaterielInfoRepository { get; } |
| | | |
| | | IRoadwayInfoRepository RoadwayInfoRepository { get; } |
| | | |
| | | IWarehouseRepository WarehouseRepository { get; } |
| | | |
| | | IAreaRouterRepository AreaRouterRepository { get; } |
| | | |
| | | ICachePointRepository CachePointRepository { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicRepository |
| | | { |
| | | public interface ICachePointRepository : IRepository<Dt_CachePoint> |
| | | { |
| | | List<CachePointGroupDTO> GetCachePointGroups(int areaId, LocationStatusEnum locationAStatus, LocationStatusEnum locationBStatus); |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | { |
| | | public interface IAreaInfoService : IService<Dt_AreaInfo> |
| | | { |
| | | IAreaInfoRepository Repository { get; } |
| | | IAreaInfoRepository Repository { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface IAreaRouterService : IService<Dt_AreaRouter> |
| | | { |
| | | IAreaRouterRepository Repository { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface IBasicService: IDependency |
| | | { |
| | | IAreaInfoService AreaInfoService { get; } |
| | | |
| | | ILocationInfoService LocationInfoService { get; } |
| | | |
| | | IMaterielInfoService MaterielInfoService { get; } |
| | | |
| | | IRoadwayInfoService RoadwayInfoService { get; } |
| | | |
| | | IWarehouseService WarehouseService { get; } |
| | | |
| | | IAreaRouterService AreaRouterService { get; } |
| | | |
| | | ICachePointService CachePointService { get; } |
| | | |
| | | |
| | | WebResponseContent AreaEnableStatus(int[] keys); |
| | | |
| | | WebResponseContent AreaDisableStatus(int[] keys); |
| | | |
| | | WebResponseContent AreaEnableStatus(int key); |
| | | |
| | | WebResponseContent AreaDisableStatus(int key); |
| | | |
| | | |
| | | WebResponseContent CachePointEnableStatus(int[] keys); |
| | | |
| | | WebResponseContent CachePointDisableStatus(int[] keys); |
| | | |
| | | WebResponseContent CachePointEnableStatus(int key); |
| | | |
| | | WebResponseContent CachePointDisableStatus(int key); |
| | | |
| | | |
| | | WebResponseContent LocationEnableStatus(int[] keys); |
| | | |
| | | WebResponseContent LocationDisableStatus(int[] keys); |
| | | |
| | | WebResponseContent LocationEnableStatus(int key); |
| | | |
| | | WebResponseContent LocationDisableStatus(int key); |
| | | |
| | | |
| | | WebResponseContent RoadwayEnableStatus(int[] keys); |
| | | |
| | | WebResponseContent RoadwayDisableStatus(int[] keys); |
| | | |
| | | WebResponseContent RoadwayEnableStatus(int key); |
| | | |
| | | WebResponseContent RoadwayDisableStatus(int key); |
| | | |
| | | |
| | | WebResponseContent WarehouseEnableStatus(int[] keys); |
| | | |
| | | WebResponseContent WarehouseDisableStatus(int[] keys); |
| | | |
| | | WebResponseContent WarehouseEnableStatus(int key); |
| | | |
| | | WebResponseContent WarehouseDisableStatus(int key); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IBasicService |
| | | { |
| | | public interface ICachePointService : IService<Dt_CachePoint> |
| | | { |
| | | ICachePointRepository Repository { get; } |
| | | |
| | | Dt_CachePoint? AssignCachePoint(int areaId); |
| | | |
| | | Dt_CachePoint? GetIbStockCachePoint(int areaId); |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | Dt_LocationInfo AdjacentDepthLocation(string locationCode); |
| | | |
| | | Dt_LocationInfo? AssignLocation(string stationCode, int inboundType); |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | Dt_MaterielInfo GetMaterielInfo(string materielCode); |
| | | |
| | | List<Dt_MaterielInfo> GetMaterielInfos(List<string> materielCodes); |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public interface IRoadwayInfoService : IService<Dt_RoadwayInfo> |
| | | { |
| | | IRoadwayInfoRepository Repository { get; } |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_Model.Models; |
| | |
| | | public interface IWarehouseService : IService<Dt_Warehouse> |
| | | { |
| | | IWarehouseRepository Repository { get; } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IInboundRepository |
| | | { |
| | | public interface IInboundRepository : IDependency |
| | | { |
| | | IInboundOrderDetailRepository InboundOrderDetailRepository { get; } |
| | | |
| | | IInboundOrderRepository InboundOrderRepository { get; } |
| | | } |
| | | } |
| | |
| | | WebResponseContent AddInboundOrder(InboundOrderAddDTO orderAddDTO); |
| | | |
| | | WebResponseContent MaterielGroup(MaterielGroupDTO materielGroupDTO); |
| | | |
| | | WebResponseContent QueryOrderInfo(int pageNo, string orderNo); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IInboundService |
| | | { |
| | | public interface IInboundService:IDependency |
| | | { |
| | | IInboundOrderDetailService InboundOrderDetailService { get; } |
| | | |
| | | IInboundOrderService InbounOrderService { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IOutboundRepository |
| | | { |
| | | public interface IOutboundRepository : IDependency |
| | | { |
| | | IOutboundOrderDetailRepository OutboundOrderDetailRepository { get; } |
| | | |
| | | IOutboundOrderRepository OutboundOrderRepository { get; } |
| | | |
| | | IOutStockLockInfoRepository OutboundStockLockInfoRepository { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | | public interface IOutboundService:IDependency |
| | | { |
| | | IOutboundOrderDetailService OutboundOrderDetailService { get; } |
| | | |
| | | IOutboundOrderService OutboundOrderService { get; } |
| | | |
| | | IOutStockLockInfoService OutboundStockLockInfoService { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IRecordRepository |
| | | { |
| | | public interface IRecordRepository : IDependency |
| | | { |
| | | ILocationStatusChangeRecordRepository LocationStatusChangeRecordRepository { get; } |
| | | |
| | | IStockQuantityChangeRecordRepository StockQuantityChangeRecordRepository { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IRecordService |
| | | { |
| | | public interface IRecordService : IDependency |
| | | { |
| | | ILocationStatusChangeRecordSetvice LocationStatusChangeRecordSetvice { get; } |
| | | |
| | | IStockQuantityChangeRecordService StockQuantityChangeRecordService { get; } |
| | | } |
| | | } |
| | |
| | | List<Dt_StockInfo> GetStockInfosExclude(string materielCode, List<string> palletCodes); |
| | | |
| | | bool UpdateDataWithDetail(Dt_StockInfo stockInfo); |
| | | |
| | | Dt_StockInfo GetPalletStockInfo(string roadwayNo); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IStockRepository |
| | | { |
| | | public interface IStockRepository : IDependency |
| | | { |
| | | IStockInfoDetailRepository StockInfoDetailRepository { get; } |
| | | |
| | | IStockInfoRepository StockInfoRepository { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | |
| | | namespace WIDESEA_IStockService |
| | | { |
| | | public interface IStockService:IDependency |
| | | { |
| | | IStockInfoDetailService StockInfoDetailService { get; } |
| | | |
| | | IStockInfoService StockInfoService { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_DTO.Stock; |
| | | |
| | | namespace WIDESEA_IStockService |
| | | { |
| | | public interface IStockViewService : IDependency |
| | | { |
| | | PageGridData<StockViewDTO> GetPageData(PageDataOptions options); |
| | | |
| | | object GetDetailPage(PageDataOptions pageData); |
| | | } |
| | | } |
| | |
| | | WebResponseContent GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews); |
| | | |
| | | WebResponseContent GenerateOutboundTask(int[] keys); |
| | | |
| | | WebResponseContent PalletOutboundTask(string roadwayNo, string endStation); |
| | | |
| | | WebResponseContent CallMateriel(string endPoint); |
| | | |
| | | WebResponseContent MaterielCarry(string startPoint); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IInboundRepository; |
| | | |
| | | namespace WIDESEA_InboundRepository |
| | | { |
| | | public class InboundRepository : IInboundRepository |
| | | { |
| | | public IInboundOrderDetailRepository InboundOrderDetailRepository { get; } |
| | | |
| | | public IInboundOrderRepository InboundOrderRepository { get; } |
| | | |
| | | public InboundRepository(IInboundOrderDetailRepository inboundOrderDetailRepository, IInboundOrderRepository inboundOrderRepository) |
| | | { |
| | | InboundOrderDetailRepository = inboundOrderDetailRepository; |
| | | InboundOrderRepository = inboundOrderRepository; |
| | | } |
| | | } |
| | | } |
| | |
| | | using AutoMapper; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | |
| | | public class InboundOrderService : ServiceBase<Dt_InboundOrder, IInboundOrderRepository>, IInboundOrderService |
| | | { |
| | | private readonly IMapper _mapper; |
| | | private readonly IMaterielInfoService _materielInfoService; |
| | | private readonly IStockInfoService _stockInfoService; |
| | | private readonly IStockInfoDetailService _stockDetailService; |
| | | private readonly ITaskRepository _taskRepository; |
| | | private readonly IInboundOrderDetailService _inboundOrderDetailService; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly ITaskRepository _taskRepository; |
| | | |
| | | private IBasicService _basicService; |
| | | private IStockService _stockService; |
| | | private IInboundOrderDetailService _inboundOrderDetailService; |
| | | |
| | | public IInboundOrderRepository Repository => BaseDal; |
| | | |
| | | public InboundOrderService(IInboundOrderRepository BaseDal, IMapper mapper, IMaterielInfoService materielInfoService, IStockInfoDetailService stockDetailService, IStockInfoService stockInfoService, ITaskRepository taskRepository, IInboundOrderDetailService inboundOrderDetailService, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | public InboundOrderService(IInboundOrderRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, ITaskRepository taskRepository, IBasicService basicService, IStockService stockService, IInboundOrderDetailService inboundOrderDetailService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _materielInfoService = materielInfoService; |
| | | _stockDetailService = stockDetailService; |
| | | _stockInfoService = stockInfoService; |
| | | _taskRepository = taskRepository; |
| | | _inboundOrderDetailService = inboundOrderDetailService; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _taskRepository = taskRepository; |
| | | _basicService = basicService; |
| | | _stockService = stockService; |
| | | _inboundOrderDetailService = inboundOrderDetailService; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | List<string> materielCodes = inboundOrderAddDTO.Details.Select(x => x.MaterielCode).ToList(); |
| | | if (!_materielInfoService.ExsitMateriels(materielCodes)) |
| | | if (!_basicService.MaterielInfoService.ExsitMateriels(materielCodes)) |
| | | { |
| | | return (false, "æç©æä¿¡æ¯æªå½å
¥ï¼è¯·å½å
¥ç©æä¿¡æ¯", inboundOrderAddDTO); |
| | | } |
| | |
| | | |
| | | List<string> materielCodes = matSerialNumberDTOs.GroupBy(x => x.MaterielCode).Select(x => x.Key).ToList(); |
| | | |
| | | List<Dt_MaterielInfo> materielInfos = _materielInfoService.GetMaterielInfos(materielCodes); |
| | | List<Dt_MaterielInfo> materielInfos = _basicService.MaterielInfoService.GetMaterielInfos(materielCodes); |
| | | |
| | | Dt_InboundOrder inboundOrder = GetInboundOrder(materielGroupDTO.OrderNo); |
| | | |
| | | |
| | | Dt_StockInfo? stockInfo = _stockInfoService.GetStockByPalletCode(materielGroupDTO.PalletCode); |
| | | Dt_StockInfo? stockInfo = _stockService.StockInfoService.GetStockByPalletCode(materielGroupDTO.PalletCode); |
| | | |
| | | (bool, string, object?) result = CheckMaterielGroupParam(materielGroupDTO, matSerialNumberDTOs, materielInfos, materielCodes, inboundOrder, stockInfo); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | |
| | | _unitOfWorkManage.BeginTran(); |
| | | UpdateData(inboundOrder); |
| | | _inboundOrderDetailService.UpdateData(inboundOrderDetails); |
| | | _stockInfoService.AddMaterielGroup(stockInfo); |
| | | _stockService.StockInfoService.AddMaterielGroup(stockInfo); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | return (false, "已䏿¶çæçä¸è½å次ç»ç", materielGroupDTO); |
| | | } |
| | | |
| | | if (_stockDetailService.ExistSerialNumbers(materielGroupDTO.SerialNumbers)) |
| | | if (_stockService.StockInfoDetailService.ExistSerialNumbers(materielGroupDTO.SerialNumbers)) |
| | | { |
| | | return (false, "æåºåå·å¨åºåä¸å·²åå¨", materielGroupDTO); |
| | | } |
| | |
| | | |
| | | return (true, "æå", materielGroupDTO); |
| | | } |
| | | |
| | | public WebResponseContent QueryOrderInfo(int pageNo, string orderNo) |
| | | { |
| | | if (string.IsNullOrEmpty(orderNo)) |
| | | { |
| | | object obj = Repository.QueryPage(x => true, pageNo, 10, new Dictionary<string, OrderByType> { { nameof(Dt_InboundOrder.CreateDate), OrderByType.Desc } }).Rows.Select(x => new |
| | | { |
| | | x.OrderNo, |
| | | x.UpperOrderNo, |
| | | x.CreateDate, |
| | | x.Creater |
| | | }); |
| | | return WebResponseContent.Instance.OK(data: obj); |
| | | } |
| | | else |
| | | { |
| | | object obj = Repository.QueryPage(x => x.OrderNo == orderNo, pageNo, 10, new Dictionary<string, OrderByType> { { nameof(Dt_InboundOrder.CreateDate), OrderByType.Desc } }).Rows.Select(x => new |
| | | { |
| | | x.OrderNo, |
| | | x.UpperOrderNo, |
| | | x.CreateDate, |
| | | x.Creater |
| | | }); |
| | | return WebResponseContent.Instance.OK(data: obj); |
| | | } |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IInboundService; |
| | | |
| | | namespace WIDESEA_InboundService |
| | | { |
| | | public class InboundService : IInboundService |
| | | { |
| | | public IInboundOrderDetailService InboundOrderDetailService { get; } |
| | | |
| | | public IInboundOrderService InbounOrderService { get; } |
| | | |
| | | public InboundService(IInboundOrderDetailService inboundOrderDetailService, IInboundOrderService inbounOrderService) |
| | | { |
| | | InboundOrderDetailService = inboundOrderDetailService; |
| | | InbounOrderService = inbounOrderService; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_AreaRouter))] |
| | | public class Dt_AreaRouter : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·ç¹åºå |
| | | /// </summary> |
| | | [ImporterHeader(Name = "èµ·ç¹")] |
| | | [ExporterHeader(DisplayName = "èµ·ç¹")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "èµ·ç¹")] |
| | | public string StartArea { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç»ç¹åºå |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç»ç¹")] |
| | | [ExporterHeader(DisplayName = "ç»ç¹")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "ç»ç¹")] |
| | | public string NextArea { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è·¯ç±ç±»å")] |
| | | public int RouterType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¯å¦æ¯æç»ç¹ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æ¯å¦æ¯æç»ç¹")] |
| | | [ExporterHeader(DisplayName = "æ¯å¦æ¯æç»ç¹")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¯å¦æ¯æç»ç¹")] |
| | | public bool IsEnd { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "夿³¨")] |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_CachePoint), "ç¼åç¹ä½")] |
| | | public class Dt_CachePoint : BaseEntity |
| | | { |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "åºå主é®")] |
| | | public int AreaId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "ç¼åç¹ç¼å·")] |
| | | public string PointCode { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¼åç¹ç¶æ")] |
| | | public int PointStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¼åç¹å¯ç¨ç¶æ")] |
| | | public int EnableStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è´§ä½è¡")] |
| | | public int Row { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è´§ä½å")] |
| | | public int Column { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "è´§ä½æ·±åº¦")] |
| | | public int Depth { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¼åç¹ç±»å")] |
| | | public int PointType { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 500, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
| | |
| | | public int LocationStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¦ç¨ç¶æ")] |
| | | public int EnalbeStatus { get; set; } |
| | | public int EnableStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | |
| | | public string RoadwayNo { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºä¸»é®")] |
| | | public int WarehouseId { get; set; } |
| | | public int AreaId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ç¦ç¨ç¶æ")] |
| | | public int EnalbeStatus { get; set; } |
| | | public int EnableStatus { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "设å¤ç¼å·")] |
| | | public string DeviceNo { get; set; } |
| | |
| | | /// <summary> |
| | | /// èåç±»å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "èåç±»å")] |
| | | public int? MenuType { get; set; } |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "èåç±»å")] |
| | | public int MenuType { get; set; } |
| | | |
| | | [Navigate(NavigateType.OneToMany, nameof(ParentId), nameof(MenuId)), SugarColumn(IsIgnore = true, IsNullable = true)] |
| | | public List<Sys_Menu> Menus { get; set; } |
| | | |
| | | } |
| | | } |
| | |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.DB.Models; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡å·")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡å·")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡å·"), SequenceAttirbute("SeqTaskNum", 6000)] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡å·"), SequenceAttirbute(nameof(SequenceEnum.SeqTaskNum), 6000)] |
| | | public int TaskNum { get; set; } |
| | | |
| | | /// <summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Magicodes.ExporterAndImporter.Core; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.Attributes; |
| | | using WIDESEA_Core.Enums; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | [SugarTable(nameof(Dt_Task_Hty), "ä»»å¡ä¿¡æ¯åå²")] |
| | | public class Dt_Task_Hty |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [ImporterHeader(Name = "主é®")] |
| | | [ExporterHeader(DisplayName = "主é®")] |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int TaskId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡å·")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡å·")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡å·"), SequenceAttirbute(nameof(SequenceEnum.SeqTaskNum), 6000)] |
| | | public int TaskNum { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æçç¼å· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "æçç¼å·")] |
| | | [ExporterHeader(DisplayName = "æçç¼å·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æçç¼å·")] |
| | | public string PalletCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å··éå· |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å··éå·")] |
| | | [ExporterHeader(DisplayName = "å··éå·")] |
| | | [SugarColumn(IsNullable = false, Length = 10, ColumnDescription = "å··éå·")] |
| | | public string Roadway { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç±»å |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ç±»å")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç±»å")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡ç±»å")] |
| | | public int TaskType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ç¶æ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ç¶æ")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ç¶æ")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»»å¡ç¶æ")] |
| | | public int TaskStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// èµ·å§å°å |
| | | /// </summary> |
| | | [ImporterHeader(Name = "èµ·å§å°å")] |
| | | [ExporterHeader(DisplayName = "èµ·å§å°å")] |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "èµ·å§å°å")] |
| | | public string SourceAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç®æ å°å |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ç®æ å°å")] |
| | | [ExporterHeader(DisplayName = "ç®æ å°å")] |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "ç®æ å°å")] |
| | | public string TargetAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å½åä½ç½® |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å½åä½ç½®")] |
| | | [ExporterHeader(DisplayName = "å½åä½ç½®")] |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "å½åä½ç½®")] |
| | | public string CurrentAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¸ä¸å°å |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä¸ä¸å°å")] |
| | | [ExporterHeader(DisplayName = "ä¸ä¸å°å")] |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "ä¸ä¸å°å")] |
| | | public string NextAddress { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¼å¸¸ä¿¡æ¯ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "åæ®ç¼å·")] |
| | | [ExporterHeader(DisplayName = "åæ®ç¼å·")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | public string? OrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¼å
级 |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä¼å
级")] |
| | | [ExporterHeader(DisplayName = "ä¼å
级")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä¼å
级")] |
| | | public int Grade { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "æºä¸»é®")] |
| | | public int SourceKey { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡ä¸åæ¶é´ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä»»å¡ä¸åæ¶é´")] |
| | | [ExporterHeader(DisplayName = "ä»»å¡ä¸åæ¶é´")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä»»å¡ä¸åæ¶é´")] |
| | | public DateTime? Dispatchertime { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "夿³¨")] |
| | | [ExporterHeader(DisplayName = "夿³¨")] |
| | | [SugarColumn(IsNullable = true, Length = 255, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, DefaultValue = "0", ColumnDescription = "æºä¸»é®")] |
| | | public int SourceId { get; set; } |
| | | |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "夿³¨")] |
| | | public string OperateType { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å建人")] |
| | | [ExporterHeader(DisplayName = "å建人")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "å建人")] |
| | | public string Creater { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建æ¶é´ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "å建æ¶é´")] |
| | | [ExporterHeader(DisplayName = "å建æ¶é´")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "å建æ¶é´")] |
| | | public DateTime CreateDate { get; set; } = DateTime.Now; |
| | | |
| | | /// <summary> |
| | | /// æ´æ°è
|
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä¿®æ¹äºº")] |
| | | [ExporterHeader(DisplayName = "ä¿®æ¹äºº")] |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "ä¿®æ¹äºº")] |
| | | public string Modifier { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹æ¥æ |
| | | /// </summary> |
| | | [ImporterHeader(Name = "ä¿®æ¹æ¥æ")] |
| | | [ExporterHeader(DisplayName = "ä¿®æ¹æ¥æ")] |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "ä¿®æ¹æ¥æ")] |
| | | public DateTime? ModifyDate { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IOutboundRepository; |
| | | |
| | | namespace WIDESEA_OutboundRepository |
| | | { |
| | | public class OutboundRepository : IOutboundRepository |
| | | { |
| | | public IOutboundOrderDetailRepository OutboundOrderDetailRepository { get; } |
| | | |
| | | public IOutboundOrderRepository OutboundOrderRepository { get; } |
| | | |
| | | public IOutStockLockInfoRepository OutboundStockLockInfoRepository { get; } |
| | | |
| | | public OutboundRepository(IOutboundOrderDetailRepository outboundOrderDetailRepository, IOutboundOrderRepository outboundOrderRepository, IOutStockLockInfoRepository outboundStockLockInfoRepository) |
| | | { |
| | | OutboundOrderDetailRepository = outboundOrderDetailRepository; |
| | | OutboundOrderRepository = outboundOrderRepository; |
| | | OutboundStockLockInfoRepository = outboundStockLockInfoRepository; |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | public class OutboundOrderDetailService : ServiceBase<Dt_OutboundOrderDetail, IOutboundOrderDetailRepository>, IOutboundOrderDetailService |
| | | { |
| | | private readonly IStockInfoService _stockInfoService; |
| | | private readonly IStockInfoDetailService _stockInfoDetailService; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly ILocationStatusChangeRecordSetvice _locationStatusChangeRecordSetvice; |
| | | private readonly IOutboundOrderService _outboundOrderService; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | |
| | | private readonly IStockService _stockService; |
| | | private readonly IBasicService _basicService; |
| | | private readonly IRecordService _recordService; |
| | | private readonly IOutboundRepository _outboundRepository; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | |
| | | public IOutboundOrderDetailRepository Repository => BaseDal; |
| | | |
| | | public OutboundOrderDetailService(IOutboundOrderDetailRepository BaseDal, IStockInfoService stockInfoService, IOutStockLockInfoService outStockLockInfoService, IUnitOfWorkManage unitOfWorkManage, ILocationStatusChangeRecordSetvice locationStatusChangeRecordSetvice, IOutboundOrderService outboundOrderService, ILocationInfoService locationInfoService, IStockInfoDetailService stockInfoDetailService) : base(BaseDal) |
| | | public OutboundOrderDetailService(IOutboundOrderDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, IStockService stockService, IBasicService basicService, IRecordService recordService, IOutboundRepository outboundRepository, IOutStockLockInfoService outStockLockInfoService) : base(BaseDal) |
| | | { |
| | | _stockInfoService = stockInfoService; |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _locationStatusChangeRecordSetvice = locationStatusChangeRecordSetvice; |
| | | _outboundOrderService = outboundOrderService; |
| | | _locationInfoService = locationInfoService; |
| | | _stockInfoDetailService = stockInfoDetailService; |
| | | _stockService = stockService; |
| | | _basicService = basicService; |
| | | _recordService = recordService; |
| | | _outboundRepository = outboundRepository; |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | } |
| | | // |
| | | public WebResponseContent LockOutboundStock(int orderDetailId) |
| | |
| | | |
| | | List<Dt_StockInfo> outStock = new List<Dt_StockInfo>(); |
| | | |
| | | List<Dt_StockInfo> stockInfos = _stockInfoService.GetUseableStocks(outboundOrderDetail.MaterielCode); |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(outboundOrderDetail.MaterielCode); |
| | | decimal stockTotalQuantity = stockInfos.Select(x => x.Details.Sum(v => v.StockQuantity - v.OutboundQuantity)).Sum(x => x); |
| | | if (stockTotalQuantity >= needQuantity)//åºåå¤ |
| | | { |
| | |
| | | (bool, string) checkResult = CheckSelectStockDeital(outboundOrderDetail, stockSelectViews); |
| | | if (!checkResult.Item1) throw new Exception(checkResult.Item2); |
| | | |
| | | Dt_OutboundOrder outboundOrder = _outboundOrderService.Repository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId); |
| | | Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetail.OrderId); |
| | | decimal originalNeedQuantity = outboundOrderDetail.OrderQuantity - outboundOrderDetail.LockQuantity; |
| | | |
| | | decimal needQuantity = originalNeedQuantity; |
| | | |
| | | List<Dt_StockInfo> outStocks = _stockInfoService.Repository.GetStockInfosByPalletCodes(stockSelectViews.Select(x => x.PalletCode).ToList()); |
| | | List<Dt_StockInfo> outStocks = _stockService.StockInfoService.Repository.GetStockInfosByPalletCodes(stockSelectViews.Select(x => x.PalletCode).ToList()); |
| | | decimal assignQuantity = 0; |
| | | outStocks.ForEach(x => |
| | | { |
| | |
| | | needQuantity -= assignQuantity; |
| | | if (outboundOrderDetail.OrderQuantity > outboundOrderDetail.LockQuantity) |
| | | { |
| | | List<Dt_StockInfo> stockInfos = _stockInfoService.GetUseableStocks(outboundOrderDetail.MaterielCode); |
| | | List<Dt_StockInfo> stockInfos = _stockService.StockInfoService.GetUseableStocks(outboundOrderDetail.MaterielCode); |
| | | stockInfos = stockInfos.Where(x => !stockSelectViews.Select(v => v.PalletCode).Contains(x.PalletCode)).ToList(); |
| | | List<Dt_StockInfo> autoAssignStocks = _stockInfoService.GetOutboundStocks(stockInfos, outboundOrderDetail.MaterielCode, needQuantity, out decimal residueQuantity); |
| | | List<Dt_StockInfo> autoAssignStocks = _stockService.StockInfoService.GetOutboundStocks(stockInfos, outboundOrderDetail.MaterielCode, needQuantity, out decimal residueQuantity); |
| | | outboundOrderDetail.LockQuantity += needQuantity - residueQuantity; |
| | | outStocks.AddRange(autoAssignStocks); |
| | | outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.AssignOver.ObjToInt(); |
| | |
| | | |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = _outStockLockInfoService.GetOutStockLockInfos(outboundOrder, outboundOrderDetail, outStocks); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = _locationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()); |
| | | List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.GetLocationInfos(outStocks.Select(x => x.LocationCode).ToList()); |
| | | |
| | | return (outStocks, outboundOrderDetail, outStockLockInfos, locationInfos); |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | _stockInfoService.Repository.UpdateData(stockInfos); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfos); |
| | | List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); |
| | | foreach (var item in stockInfos) |
| | | { |
| | | stockInfoDetails.AddRange(item.Details); |
| | | } |
| | | _stockInfoDetailService.Repository.UpdateData(stockInfoDetails); |
| | | _stockService.StockInfoDetailService.Repository.UpdateData(stockInfoDetails); |
| | | BaseDal.UpdateData(outboundOrderDetails); |
| | | |
| | | List<Dt_OutStockLockInfo> addOutStockLockInfos = outStockLockInfos.Where(x => x.Id == 0).ToList(); |
| | |
| | | _outStockLockInfoService.Repository.UpdateData(updateOutStockLockInfos); |
| | | } |
| | | |
| | | _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, locationStatus.ObjToInt(), StockChangeType.Outbound.ObjToInt(), "", tasks?.Select(x => x.TaskNum).ToList()); |
| | | _locationInfoService.Repository.UpdateLocationStatus(locationInfos, locationStatus); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfos, locationStatus.ObjToInt(), StockChangeType.Outbound.ObjToInt(), "", tasks?.Select(x => x.TaskNum).ToList()); |
| | | _basicService.LocationInfoService.Repository.UpdateLocationStatus(locationInfos, locationStatus); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | |
| | | List<Dt_OutStockLockInfo> outStockLockInfos = _outStockLockInfoService.GetByOrderDetailId(orderDetailId, OutStockStatus.å·²åé
); |
| | | if (outStockLockInfos.Count > 0) |
| | | { |
| | | List<Dt_StockInfo> stocks = _stockInfoService.Repository.GetStockInfosByPalletCodes(outStockLockInfos.Select(x => x.PalletCode).ToList()); |
| | | List<Dt_StockInfo> stocks = _stockService.StockInfoService.Repository.GetStockInfosByPalletCodes(outStockLockInfos.Select(x => x.PalletCode).ToList()); |
| | | if (stocks.Count > 0) |
| | | { |
| | | stocks.ForEach(x => |
| | |
| | | x.Status = OutStockStatus.æ¤é.ObjToInt(); |
| | | }); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = _locationInfoService.Repository.GetLocationInfos(stocks.Select(x => x.LocationCode).ToList()); |
| | | List<Dt_LocationInfo> locationInfos = _basicService.LocationInfoService.Repository.GetLocationInfos(stocks.Select(x => x.LocationCode).ToList()); |
| | | |
| | | return LockOutboundStockDataUpdate(stocks, new List<Dt_OutboundOrderDetail> { outboundOrderDetail }, outStockLockInfos, locationInfos, LocationStatusEnum.InStock); |
| | | } |
| | |
| | | { |
| | | private readonly IMapper _mapper; |
| | | private readonly IMaterielInfoService _materielInfoService; |
| | | private readonly IStockInfoService _stockInfoService; |
| | | private readonly IStockInfoService _stockService; |
| | | private readonly IStockInfoDetailService _stockDetailService; |
| | | |
| | | public IOutboundOrderRepository Repository => BaseDal; |
| | |
| | | _mapper = mapper; |
| | | _materielInfoService = materielInfoService; |
| | | _stockDetailService = stockDetailService; |
| | | _stockInfoService = stockInfoService; |
| | | _stockService = stockInfoService; |
| | | } |
| | | |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IOutboundService; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public class OutboundService : IOutboundService |
| | | { |
| | | public IOutboundOrderDetailService OutboundOrderDetailService { get; } |
| | | |
| | | public IOutboundOrderService OutboundOrderService { get; } |
| | | |
| | | public IOutStockLockInfoService OutboundStockLockInfoService { get; } |
| | | |
| | | public OutboundService(IOutboundOrderDetailService outboundOrderDetailService, IOutboundOrderService outboundOrderService, IOutStockLockInfoService outboundStockLockInfoService) |
| | | { |
| | | OutboundOrderDetailService = outboundOrderDetailService; |
| | | OutboundOrderService = outboundOrderService; |
| | | OutboundStockLockInfoService = outboundStockLockInfoService; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IRecordRepository; |
| | | |
| | | namespace WIDESEA_RecordRepository |
| | | { |
| | | public class RecordRepository : IRecordRepository |
| | | { |
| | | public ILocationStatusChangeRecordRepository LocationStatusChangeRecordRepository { get; } |
| | | |
| | | public IStockQuantityChangeRecordRepository StockQuantityChangeRecordRepository { get; } |
| | | |
| | | public RecordRepository(ILocationStatusChangeRecordRepository locationStatusChangeRecordRepository, IStockQuantityChangeRecordRepository stockQuantityChangeRecordRepository) |
| | | { |
| | | LocationStatusChangeRecordRepository = locationStatusChangeRecordRepository; |
| | | StockQuantityChangeRecordRepository = stockQuantityChangeRecordRepository; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IRecordService; |
| | | |
| | | namespace WIDESEA_RecordService |
| | | { |
| | | public class RecordService : IRecordService |
| | | { |
| | | public ILocationStatusChangeRecordSetvice LocationStatusChangeRecordSetvice { get; } |
| | | |
| | | public IStockQuantityChangeRecordService StockQuantityChangeRecordService { get; } |
| | | |
| | | public RecordService(ILocationStatusChangeRecordSetvice locationStatusChangeRecordSetvice, IStockQuantityChangeRecordService stockQuantityChangeRecordService) |
| | | { |
| | | LocationStatusChangeRecordSetvice = locationStatusChangeRecordSetvice; |
| | | StockQuantityChangeRecordService = stockQuantityChangeRecordService; |
| | | } |
| | | } |
| | | } |
| | |
| | | using Org.BouncyCastle.Crypto; |
| | | using SqlSugar; |
| | | using SqlSugar.Extensions; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IStockRepository; |
| | |
| | | { |
| | | public class StockInfoRepository : RepositoryBase<Dt_StockInfo>, IStockInfoRepository |
| | | { |
| | | private readonly ILocationInfoRepository _locationInfoRepository; |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage, ILocationInfoRepository locationInfoRepository) : base(unitOfWorkManage) |
| | | public StockInfoRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | _locationInfoRepository = locationInfoRepository; |
| | | } |
| | | |
| | | public List<StockViewDTO> GetAllStockViews() |
| | |
| | | AreaId = a.AreaId, |
| | | LocationCode = b.LocationCode, |
| | | Column = a.Column, |
| | | CreateDate = a.CreateDate, |
| | | Creater = a.Creater, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | | Depth = a.Depth, |
| | | EnalbeStatus = a.EnalbeStatus, |
| | | Id = a.Id, |
| | | EnalbeStatus = a.EnableStatus, |
| | | IsFull = b.IsFull, |
| | | Layer = a.Layer, |
| | | LocationName = a.LocationName, |
| | | LocationStatus = a.LocationStatus, |
| | | LocationType = a.LocationType, |
| | | Modifier = a.Modifier, |
| | | ModifyDate = a.ModifyDate, |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | | Remark = a.Remark, |
| | | StockRemark = b.Remark, |
| | | RoadwayNo = a.RoadwayNo, |
| | | Row = a.Row, |
| | | StockId = b.Id, |
| | | StockRemark = b.Remark, |
| | | StockStatus = b.StockStatus, |
| | | Details = b.Details, |
| | | }).Includes(x => x.Details).ToList(); |
| | |
| | | { |
| | | return Db.UpdateNav(stockInfo).Include(x => x.Details).ExecuteCommand(); |
| | | } |
| | | |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo) |
| | | { |
| | | //ISugarQueryable<string> locationCodes = Db.Queryable<Dt_LocationInfo>().Where(x => x.RoadwayNo == roadwayNo && x.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (x.EnalbeStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == x.EnalbeStatus)).Select(x => x.LocationCode); |
| | | |
| | | return Db.Queryable<Dt_StockInfo>().Where(x => x.StockStatus == StockStatusEmun.å·²å
¥åº.ObjToInt() && SqlFunc.Subqueryable<Dt_LocationInfo>().Where(v => v.LocationCode == x.LocationCode && v.RoadwayNo == roadwayNo && v.LocationStatus == LocationStatusEnum.Pallet.ObjToInt() && (v.EnableStatus == LocationEnalbeStatusEnum.OnlyOut.ObjToInt() || LocationEnalbeStatusEnum.Normal.ObjToInt() == v.EnableStatus)).Any()).OrderBy(x => x.ModifyDate).First(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IStockRepository; |
| | | |
| | | namespace WIDESEA_StockRepository |
| | | { |
| | | public class StockRepository : IStockRepository |
| | | { |
| | | public IStockInfoDetailRepository StockInfoDetailRepository { get; } |
| | | |
| | | public IStockInfoRepository StockInfoRepository { get; } |
| | | |
| | | public StockRepository(IStockInfoDetailRepository stockInfoDetailRepository, IStockInfoRepository stockInfoRepository) |
| | | { |
| | | StockInfoDetailRepository = stockInfoDetailRepository; |
| | | StockInfoRepository = stockInfoRepository; |
| | | } |
| | | } |
| | | } |
| | |
| | | public class StockInfoService : ServiceBase<Dt_StockInfo, IStockInfoRepository>, IStockInfoService |
| | | { |
| | | private readonly IMapper _mapper; |
| | | private readonly IStockQuantityChangeRecordService _stockQuantityChangeRecordService; |
| | | private readonly IStockInfoDetailRepository _stockInfoDetailRepository; |
| | | private readonly IWarehouseRepository _warehouseRepository; |
| | | private readonly IRoadwayInfoRepository _roadwayInfoRepository; |
| | | private readonly IAreaInfoRepository _areaInfoRepository; |
| | | private readonly ILocationInfoRepository _locationInfoRepository; |
| | | |
| | | private readonly IBasicRepository _basicRepository; |
| | | private readonly IStockRepository _stockRepository; |
| | | private readonly IRecordService _recordService; |
| | | |
| | | public IStockInfoRepository Repository => BaseDal; |
| | | |
| | | public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IStockQuantityChangeRecordService stockQuantityChangeRecordService, IStockInfoDetailRepository stockInfoDetailRepository, IWarehouseRepository warehouseRepository, IRoadwayInfoRepository roadwayInfoRepository, IAreaInfoRepository areaInfoRepository, ILocationInfoRepository locationInfoRepository) : base(BaseDal) |
| | | public StockInfoService(IStockInfoRepository BaseDal, IMapper mapper, IBasicRepository basicRepository, IStockRepository stockRepository,IRecordService recordService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _stockQuantityChangeRecordService = stockQuantityChangeRecordService; |
| | | _stockInfoDetailRepository = stockInfoDetailRepository; |
| | | _warehouseRepository = warehouseRepository; |
| | | _roadwayInfoRepository = roadwayInfoRepository; |
| | | _areaInfoRepository = areaInfoRepository; |
| | | _locationInfoRepository = locationInfoRepository; |
| | | _basicRepository = basicRepository; |
| | | _stockRepository = stockRepository; |
| | | _recordService = recordService; |
| | | } |
| | | |
| | | public Dt_StockInfo? GetStockByPalletCode(string palletCode) |
| | |
| | | Dt_StockInfo stockInfo = BaseDal.QueryFirst(x => x.PalletCode == palletCode); |
| | | if (stockInfo != null) |
| | | { |
| | | stockInfo.Details = _stockInfoDetailRepository.QueryData(x => x.StockId == stockInfo.Id); |
| | | stockInfo.Details = _stockRepository.StockInfoDetailRepository.QueryData(x => x.StockId == stockInfo.Id); |
| | | } |
| | | return stockInfo; |
| | | } |
| | |
| | | { |
| | | if (stockInfo.Details[i].Id == 0) |
| | | { |
| | | details.Add(_stockInfoDetailRepository.Db.Insertable(stockInfo.Details[i]).ExecuteReturnEntity()); |
| | | details.Add(_stockRepository.StockInfoDetailRepository.Db.Insertable(stockInfo.Details[i]).ExecuteReturnEntity()); |
| | | } |
| | | |
| | | } |
| | |
| | | } |
| | | //_stockQuantityChangeRecordRepository.AddData(stockQuantityChangeRecords); |
| | | stockInfo.Details = details; |
| | | _stockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.MaterielGroup); |
| | | _recordService.StockQuantityChangeRecordService.AddStockChangeRecord(stockInfo, stockInfo.Details, beforeQuantity, stockInfo.Details.Sum(x => x.StockQuantity) + beforeQuantity, StockChangeType.MaterielGroup); |
| | | } |
| | | |
| | | public List<Dt_StockInfo> GetUseableStocks(string materielCode) |
| | | { |
| | | List<string> roadways = _roadwayInfoRepository.CanOutRoadwayNos; |
| | | List<string> roadways = _basicRepository.RoadwayInfoRepository.CanOutRoadwayNos; |
| | | |
| | | List<int> warehouseIds = _warehouseRepository.EnableWarehouseIds; |
| | | List<int> warehouseIds = _basicRepository.WarehouseRepository.EnableWarehouseIds; |
| | | |
| | | List<int> areaIds = _areaInfoRepository.GetEnableAreaIds(warehouseIds); |
| | | List<int> areaIds = _basicRepository.AreaInfoRepository.GetEnableAreaIds(warehouseIds); |
| | | |
| | | List<string> locationCodes = _locationInfoRepository.GetCanOutLocationCodes(roadways, areaIds); |
| | | List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(roadways, areaIds); |
| | | |
| | | return BaseDal.GetStockInfos(materielCode, locationCodes); |
| | | } |
| | | |
| | | public List<StockSelectViewDTO> GetStockSelectViews(string materielCode) |
| | | { |
| | | List<string> roadways = _roadwayInfoRepository.CanOutRoadwayNos; |
| | | List<string> roadways = _basicRepository.RoadwayInfoRepository.CanOutRoadwayNos; |
| | | |
| | | List<int> warehouseIds = _warehouseRepository.EnableWarehouseIds; |
| | | List<int> warehouseIds = _basicRepository.WarehouseRepository.EnableWarehouseIds; |
| | | |
| | | List<int> areaIds = _areaInfoRepository.GetEnableAreaIds(warehouseIds); |
| | | List<int> areaIds = _basicRepository.AreaInfoRepository.GetEnableAreaIds(warehouseIds); |
| | | |
| | | List<string> locationCodes = _locationInfoRepository.GetCanOutLocationCodes(roadways, areaIds); |
| | | List<string> locationCodes = _basicRepository.LocationInfoRepository.GetCanOutLocationCodes(roadways, areaIds); |
| | | |
| | | return BaseDal.QueryTabs<Dt_StockInfo, Dt_StockInfoDetail, StockSelectViewDTO>((a, b) => a.Id == b.StockId, (a, b) => new StockSelectViewDTO |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_IStockService; |
| | | |
| | | namespace WIDESEA_StockService |
| | | { |
| | | public class StockSerivce:IStockService |
| | | { |
| | | public IStockInfoDetailService StockInfoDetailService { get; } |
| | | |
| | | public IStockInfoService StockInfoService { get; } |
| | | |
| | | public StockSerivce(IStockInfoDetailService stockInfoDetailService, IStockInfoService stockInfoService) |
| | | { |
| | | StockInfoDetailService = stockInfoDetailService; |
| | | StockInfoService = stockInfoService; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | |  |
| | | using Microsoft.AspNetCore.Http; |
| | | using SqlSugar; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Drawing.Printing; |
| | | using System.Dynamic; |
| | | using System.Linq; |
| | | using System.Reflection; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Core.Utilities; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockRepository; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_StockService |
| | | { |
| | | public class StockViewService : IStockViewService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly SqlSugarClient _dbBase; |
| | | |
| | | public StockViewService(IUnitOfWorkManage unitOfWorkManage) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _dbBase = unitOfWorkManage.GetDbClient(); |
| | | } |
| | | |
| | | public virtual PageGridData<StockViewDTO> GetPageData(PageDataOptions options) |
| | | { |
| | | string where = options.ValidatePageOptions(typeof(StockViewDTO).GetProperties()); |
| | | //è·åæåºå段 |
| | | //Dictionary<string, OrderByType> orderbyDic = options.GetPageDataSort(typeof(StockViewDTO).GetProperties()); |
| | | //List<OrderByModel> orderByModels = new List<OrderByModel>(); |
| | | //foreach (var item in orderbyDic) |
| | | //{ |
| | | // OrderByModel orderByModel = new OrderByModel() |
| | | // { |
| | | // FieldName = item.Key, |
| | | // OrderByType = item.Value |
| | | // }; |
| | | // orderByModels.Add(orderByModel); |
| | | //} |
| | | int totalCount = 0; |
| | | |
| | | ISugarQueryable<Dt_StockInfo> sugarQueryable1 = _dbBase.Queryable<Dt_StockInfo>(); |
| | | ISugarQueryable<Dt_LocationInfo> sugarQueryable = _dbBase.Queryable<Dt_LocationInfo>(); |
| | | |
| | | List<StockViewDTO> list = sugarQueryable1.InnerJoin(sugarQueryable, (b, a) => a.LocationCode == b.LocationCode).WhereIF(!string.IsNullOrEmpty(where), where).Select((b, a) => new StockViewDTO |
| | | { |
| | | AreaId = a.AreaId, |
| | | LocationCode = b.LocationCode, |
| | | Column = a.Column, |
| | | CreateDate = b.CreateDate, |
| | | Creater = b.Creater, |
| | | Depth = a.Depth, |
| | | EnalbeStatus = a.EnableStatus, |
| | | IsFull = b.IsFull, |
| | | Layer = a.Layer, |
| | | LocationName = a.LocationName, |
| | | LocationStatus = a.LocationStatus, |
| | | LocationType = a.LocationType, |
| | | Modifier = b.Modifier, |
| | | ModifyDate = b.ModifyDate, |
| | | PalletCode = b.PalletCode, |
| | | StockRemark = b.Remark, |
| | | RoadwayNo = a.RoadwayNo, |
| | | Row = a.Row, |
| | | StockId = b.Id, |
| | | StockStatus = b.StockStatus, |
| | | Details = b.Details, |
| | | }).ToPageList(options.Page, options.Rows, ref totalCount); |
| | | return new PageGridData<StockViewDTO>(totalCount, list); |
| | | |
| | | } |
| | | |
| | | public virtual object GetDetailPage(PageDataOptions pageData) |
| | | { |
| | | Type t = typeof(StockViewDTO); |
| | | |
| | | if (pageData.Value == null) return new PageGridData<object>(total: 0, null); |
| | | string keyName = t.GetKeyName(); |
| | | ////çææ¥è¯¢æ¡ä»¶ |
| | | //Expression<Func<TEntity, bool>> whereExpression = keyName.CreateExpression<TEntity>(pageData.Value, LinqExpressionType.Equal); |
| | | int totalCount = 0; |
| | | PropertyInfo? propertyInfo = t.GetProperties().FirstOrDefault(x => x.GetCustomAttribute<Navigate>() != null); |
| | | if (propertyInfo != null) |
| | | { |
| | | Type detailType = propertyInfo.PropertyType.GetGenericArguments()[0]; |
| | | Navigate? navigate = propertyInfo.GetCustomAttribute<Navigate>(); |
| | | if (navigate != null) |
| | | { |
| | | List<ExpandoObject> list = _dbBase.Queryable(detailType.Name, "detail").Where(navigate.GetName(), "=", pageData.Value).ToPageList(pageData.Page, pageData.Rows, ref totalCount); |
| | | return new PageGridData<ExpandoObject>(totalCount, list); |
| | | } |
| | | } |
| | | return new PageGridData<object>(total: 0, null); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | public List<MenuDTO> GetAllMenu() |
| | | { |
| | | List<Sys_Menu> menus = base.QueryData(x => x.Enable == 1 || x.Enable == 2).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); |
| | | List<Sys_Menu> menus = base.QueryData(x => (x.Enable == 1 || x.Enable == 2) && x.MenuType == App.User.MenuType).OrderByDescending(a => a.OrderNo).ThenByDescending(q => q.ParentId).ToList(); |
| | | List<MenuDTO> _menus = _mapper.Map<List<MenuDTO>>(menus); |
| | | _menus.ForEach(x => |
| | | { |
| | | x.MenuType ??= 0; |
| | | if (!string.IsNullOrEmpty(x.Auth) && x.Auth.Length > 10) |
| | | { |
| | | try |
| | |
| | | ParentId = a.ParentId, |
| | | TableName = (a.TableName ?? "").ToLower(), |
| | | UserAuth = a.Auth, |
| | | MenuType = a.MenuType ?? 0 |
| | | MenuType = a.MenuType |
| | | }).ToList(); |
| | | return MenuActionToArray(permissions); |
| | | } |
| | |
| | | { |
| | | //没æredis/memoryç¼åè§è²ççæ¬å·æä¸å½åæå¡å¨çè§è²çæ¬å·ä¸åæ¶ï¼å·æ°ç¼å |
| | | |
| | | List<Permissions> _permissions = QueryTabs<Sys_Menu, Sys_RoleAuth, Permissions>((a, b) => new object[] { JoinType.Inner, a.MenuId == b.MenuId }, (a, b) => new Permissions { MenuId = a.MenuId, ParentId = a.ParentId, TableName = (a.TableName ?? "").ToLower(), MenuAuth = a.Auth, UserAuth = b.AuthValue ?? "", MenuType = a.MenuType ?? 0 }, (a, b) => b.RoleId == roleId, x => true); |
| | | List<Permissions> _permissions = QueryTabs<Sys_Menu, Sys_RoleAuth, Permissions>((a, b) => new object[] { JoinType.Inner, a.MenuId == b.MenuId }, (a, b) => new Permissions { MenuId = a.MenuId, ParentId = a.ParentId, TableName = (a.TableName ?? "").ToLower(), MenuAuth = a.Auth, UserAuth = b.AuthValue ?? "", MenuType = a.MenuType }, (a, b) => b.RoleId == roleId, x => true); |
| | | |
| | | ActionToArray(_permissions); |
| | | |
| | |
| | | p.Icon, |
| | | p.Enable, |
| | | // 2022.03.26å¢ç§»å¨ç«¯å èåç±»å |
| | | MenuType = p.MenuType ?? 0, |
| | | p.MenuType, |
| | | p.CreateDate, |
| | | p.Creater, |
| | | p.TableName, |
| | |
| | | Sys_Menu sysMenu = BaseDal.QueryFirst(x => x.TableName == menu.TableName); |
| | | if (sysMenu != null) |
| | | { |
| | | sysMenu.MenuType ??= 0; |
| | | if (sysMenu.MenuType == menu.MenuType) |
| | | { |
| | | if ((menu.MenuId > 0 && sysMenu.MenuId != menu.MenuId) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | /// <summary> |
| | | /// ç«åºåºåºAGVæ¬è¿ |
| | | /// </summary> |
| | | /// <param name="outTask"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent ShelfOutboundCarry(Dt_Task outTask) |
| | | { |
| | | Dt_CachePoint cachePoint = GetCachePointByStartPoint(outTask.TargetAddress); |
| | | |
| | | Dt_Task task = new() |
| | | { |
| | | CurrentAddress = outTask.TargetAddress, |
| | | Grade = 0, |
| | | NextAddress = cachePoint.PointCode, |
| | | OrderNo = outTask.OrderNo, |
| | | PalletCode = outTask.PalletCode + "-AGV", |
| | | Roadway = "", |
| | | SourceAddress = outTask.TargetAddress, |
| | | TargetAddress = cachePoint.PointCode, |
| | | SourceKey = outTask.TaskId, |
| | | TaskNum = outTask.TaskNum, |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.AGVCarry.ObjToInt(), |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 嫿 |
| | | /// </summary> |
| | | /// <param name="endPoint"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CallMateriel(string endPoint) |
| | | { |
| | | Dt_CachePoint cachePoint = GetCachePointByEndPoint(endPoint); |
| | | |
| | | Dt_Task task = new Dt_Task() |
| | | { |
| | | CurrentAddress = cachePoint.PointCode, |
| | | Grade = 0, |
| | | NextAddress = endPoint, |
| | | OrderNo = "", |
| | | PalletCode = cachePoint.Remark, |
| | | Roadway = "", |
| | | SourceAddress = cachePoint.PointCode, |
| | | TargetAddress = endPoint, |
| | | SourceKey = 0, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.AGVCarry.ObjToInt(), |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ç©ææ¬è¿ |
| | | /// </summary> |
| | | /// <param name="startPoint"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent MaterielCarry(string startPoint) |
| | | { |
| | | Dt_CachePoint cachePoint = GetCachePointByStartPoint(startPoint); |
| | | |
| | | Dt_Task task = new() |
| | | { |
| | | CurrentAddress = startPoint, |
| | | Grade = 0, |
| | | NextAddress = cachePoint.PointCode, |
| | | OrderNo = "", |
| | | PalletCode = startPoint + "-AGV", |
| | | Roadway = "", |
| | | SourceAddress = startPoint, |
| | | TargetAddress = cachePoint.PointCode, |
| | | SourceKey = 0, |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)), |
| | | TaskStatus = AGVTaskStatusEnum.AGV_New.ObjToInt(), |
| | | TaskType = TaskTypeEnum.AGVCarry.ObjToInt(), |
| | | }; |
| | | cachePoint.PointStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | |
| | | _basicService.CachePointService.Repository.UpdateData(cachePoint); |
| | | Repository.AddData(task); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | private Dt_CachePoint GetCachePointByStartPoint(string startPoint) |
| | | { |
| | | Dt_AreaRouter areaRouter = _basicService.AreaRouterService.Repository.QueryFirst(x => x.StartArea == startPoint); |
| | | if (areaRouter == null) |
| | | { |
| | | throw new Exception("æªæ¾å°è·¯ç±ä¿¡æ¯"); |
| | | } |
| | | Dt_AreaInfo areaInfo = _basicService.AreaInfoService.Repository.QueryFirst(x => x.AreaCode == areaRouter.NextArea); |
| | | if (areaInfo == null) |
| | | { |
| | | throw new Exception("æªæ¾å°ä¸ä¸åºåä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_CachePoint? cachePoint = _basicService.CachePointService.AssignCachePoint(areaInfo.Id); |
| | | if (cachePoint == null) |
| | | { |
| | | throw new Exception("æªæ¾å°ç©ºé²ç¼åç¹"); |
| | | } |
| | | |
| | | return cachePoint; |
| | | } |
| | | |
| | | private Dt_CachePoint GetCachePointByEndPoint(string endPoint) |
| | | { |
| | | Dt_AreaRouter areaRouter = _basicService.AreaRouterService.Repository.QueryFirst(x => x.NextArea == endPoint); |
| | | if (areaRouter == null) |
| | | { |
| | | throw new Exception("æªæ¾å°è·¯ç±ä¿¡æ¯"); |
| | | } |
| | | Dt_AreaInfo areaInfo = _basicService.AreaInfoService.Repository.QueryFirst(x => x.AreaCode == areaRouter.StartArea); |
| | | if (areaInfo == null) |
| | | { |
| | | throw new Exception("æªæ¾å°èµ·ç¹ç¼ååºåä¿¡æ¯"); |
| | | } |
| | | |
| | | Dt_CachePoint? cachePoint = _basicService.CachePointService.GetIbStockCachePoint(areaInfo.Id); |
| | | if (cachePoint == null) |
| | | { |
| | | throw new Exception("æªæ¾å°æè´§ç¼åç¹"); |
| | | } |
| | | return cachePoint; |
| | | } |
| | | |
| | | public object AGVTaskFeedBack(AGVTaskFeedBackModel model) |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskId == Convert.ToInt32(model.Task_id)); |
| | | if (task == null) |
| | | { |
| | | return new { code = 404, message = "æªæ¾å°è¯¥ä»»å¡" }; |
| | | } |
| | | |
| | | Dt_CachePoint startCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == task.SourceAddress); |
| | | if (startCachePoint != null) |
| | | { |
| | | startCachePoint.PointStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.CachePointService.Repository.UpdateData(startCachePoint); |
| | | } |
| | | |
| | | Dt_CachePoint endCachePoint = _basicService.CachePointService.Repository.QueryFirst(x => x.PointCode == task.TargetAddress); |
| | | if (endCachePoint != null) |
| | | { |
| | | endCachePoint.PointStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | _basicService.CachePointService.Repository.UpdateData(endCachePoint); |
| | | } |
| | | |
| | | BaseDal.DeleteData(task); |
| | | |
| | | return new { code = 200, message = "æå" }; |
| | | } |
| | | } |
| | | } |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockInfoService.Repository.GetStockInfo(palletCode); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(palletCode); |
| | | (bool, string) result = CheckRequestInbound(stationCode, palletCode, true, stockInfo); |
| | | if (!result.Item1) return content = WebResponseContent.Instance.Error(result.Item2); |
| | | content = AssignLocUpdateData(stationCode, TaskTypeEnum.Inbound.ObjToInt(), palletCode, true, stockInfo); |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_LocationInfo? locationInfo = _locationInfoService.AssignLocation(stationCode, taskType); |
| | | Dt_LocationInfo? locationInfo = _basicService.LocationInfoService.AssignLocation(stationCode, taskType); |
| | | if (locationInfo != null) |
| | | { |
| | | Dt_Task task = new() |
| | |
| | | orderNo = stockInfo.Details.FirstOrDefault()?.OrderNo ?? ""; |
| | | |
| | | stockInfo.StockStatus = StockStatusEmun.å
¥åºç¡®è®¤.ObjToInt(); |
| | | _stockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | } |
| | | else |
| | | { |
| | | return content = WebResponseContent.Instance.Error("æªæ¾å°åºåä¿¡æ¯"); |
| | | } |
| | | } |
| | | _locationInfoService.Repository.UpdateData(locationInfo); |
| | | _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), orderNo, task.TaskNum); |
| | | |
| | | return content = WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | if (_stockInfoService.Repository.QueryFirst(x => x.PalletCode == palletCode) != null) |
| | | if (_stockService.StockInfoService.Repository.QueryFirst(x => x.PalletCode == palletCode) != null) |
| | | { |
| | | return (false, "该æçå·²åå¨åºå
"); |
| | | } |
| | |
| | | return (true, "æå"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æçå
¥åºå®æå¤ç |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½å¯¹è±¡</param> |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | public WebResponseContent PalletInboundTaskCompleted(Dt_Task task) |
| | | { |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | PalletCode = task.PalletCode, |
| | | LocationCode = task.TargetAddress, |
| | | StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt() |
| | | }; |
| | | Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | |
| | | CheckInboundCompleted(stockInfo, locationInfo); |
| | | |
| | | _stockInfoService.Repository.AddData(stockInfo); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | _locationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | |
| | | BaseDal.DeleteData(task); |
| | | |
| | | _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | |
| | | /// <summary> |
| | | /// åºåæ°æ®è½¬åºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="stockInfos"></param> |
| | | /// <returns></returns> |
| | | public List<Dt_Task> GetTasks(List<Dt_StockInfo> stockInfos) |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | |
| | | |
| | | if (stockInfo != null) |
| | | { |
| | | Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode); |
| | | Dt_RoadwayInfo roadwayInfo = _roadwayInfoRepository.QueryFirst(x => x.RoadwayNo == locationInfo.RoadwayNo); |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode); |
| | | Dt_RoadwayInfo roadwayInfo = _basicService.RoadwayInfoService.Repository.QueryFirst(x => x.RoadwayNo == locationInfo.RoadwayNo); |
| | | if (roadwayInfo != null) |
| | | { |
| | | Dt_Task task = new() |
| | |
| | | Roadway = locationInfo.RoadwayNo, |
| | | SourceAddress = stockInfo.LocationCode, |
| | | TargetAddress = roadwayInfo.OutStationCode, |
| | | TaskStatus = InTaskStatusEnum.InNew.ObjToInt(), |
| | | TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.Outbound.ObjToInt(), |
| | | TaskNum = BaseDal.GetTaskNum("SeqTaskNum") |
| | | TaskNum = BaseDal.GetTaskNum(nameof(SequenceEnum.SeqTaskNum)) |
| | | }; |
| | | tasks.Add(task); |
| | | } |
| | |
| | | return tasks; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åºåºä»»å¡æ°æ®å¤ç |
| | | /// </summary> |
| | | /// <param name="orderDetailId"></param> |
| | | /// <param name="stockSelectViews"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="Exception"></exception> |
| | | public (List<Dt_Task>, List<Dt_StockInfo>?, List<Dt_OutboundOrderDetail>?, List<Dt_OutStockLockInfo>?, List<Dt_LocationInfo>?) OutboundTaskDataHandle(int orderDetailId, List<StockSelectViewDTO> stockSelectViews) |
| | | { |
| | | List<Dt_Task> tasks = new List<Dt_Task>(); |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundOrderDetailService.Repository.QueryFirst(x => x.Id == orderDetailId); |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == orderDetailId); |
| | | |
| | | if (outboundOrderDetail == null) |
| | | { |
| | |
| | | List<Dt_LocationInfo>? locationInfos = null; |
| | | if (outboundOrderDetail.OrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | | (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews); |
| | | (List<Dt_StockInfo>, Dt_OutboundOrderDetail, List<Dt_OutStockLockInfo>, List<Dt_LocationInfo>) result = _outboundService.OutboundOrderDetailService.AssignStockOutbound(outboundOrderDetail, stockSelectViews); |
| | | if (result.Item1 != null && result.Item1.Count > 0) |
| | | { |
| | | tasks = GetTasks(result.Item1); |
| | |
| | | } |
| | | else |
| | | { |
| | | List<Dt_OutStockLockInfo> stockLockInfos = _outStockLockInfoService.GetByOrderDetailId(outboundOrderDetail.OrderId); |
| | | List<Dt_OutStockLockInfo> stockLockInfos = _outboundService.OutboundStockLockInfoService.GetByOrderDetailId(outboundOrderDetail.OrderId); |
| | | if (stockLockInfos != null && stockLockInfos.Count > 0) |
| | | { |
| | | List<Dt_StockInfo> stocks = _stockInfoService.Repository.GetStockInfosByPalletCodes(stockLockInfos.Select(x => x.PalletCode).Distinct().ToList()); |
| | | List<Dt_StockInfo> stocks = _stockService.StockInfoService.Repository.GetStockInfosByPalletCodes(stockLockInfos.Select(x => x.PalletCode).Distinct().ToList()); |
| | | tasks = GetTasks(stocks); |
| | | } |
| | | } |
| | |
| | | return (tasks, stockInfos, orderDetail == null ? null : new List<Dt_OutboundOrderDetail> { orderDetail }, outStockLockInfos, locationInfos); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæåºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="orderDetailId"></param> |
| | | /// <param name="stockSelectViews"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GenerateOutboundTask(int orderDetailId, List<StockSelectViewDTO> stockSelectViews) |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæåºåºä»»å¡åæ°æ®æ´æ°å°æ°æ®åº |
| | | /// </summary> |
| | | /// <param name="tasks"></param> |
| | | /// <param name="stockInfos"></param> |
| | | /// <param name="outboundOrderDetails"></param> |
| | | /// <param name="outStockLockInfos"></param> |
| | | /// <param name="locationInfos"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GenerateOutboundTaskDataUpdate(List<Dt_Task> tasks, List<Dt_StockInfo>? stockInfos = null, List<Dt_OutboundOrderDetail>? outboundOrderDetails = null, List<Dt_OutStockLockInfo>? outStockLockInfos = null, List<Dt_LocationInfo>? locationInfos = null) |
| | | { |
| | | try |
| | |
| | | BaseDal.AddData(tasks); |
| | | if (stockInfos != null && outboundOrderDetails != null && outStockLockInfos != null && locationInfos != null) |
| | | { |
| | | WebResponseContent content = _outboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks); |
| | | WebResponseContent content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks); |
| | | |
| | | if (content.Status) |
| | | { |
| | |
| | | x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | }); |
| | | |
| | | _outboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | } |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// çæåºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="keys"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent GenerateOutboundTask(int[] keys) |
| | | { |
| | | try |
| | |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æçåºåºä»»å¡ |
| | | /// </summary> |
| | | /// <param name="inTask"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent PalletOutboundTask(string roadwayNo, string endStation) |
| | | { |
| | | try |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetPalletStockInfo(roadwayNo); |
| | | if (stockInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ç©ºæçåºå"); |
| | | } |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == stockInfo.LocationCode && x.RoadwayNo == roadwayNo); |
| | | if (locationInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ç©ºæçåºå对åºçè´§ä½ä¿¡æ¯"); |
| | | } |
| | | Dt_RoadwayInfo roadwayInfo = _basicService.RoadwayInfoService.Repository.QueryFirst(x => x.InStationCode == endStation && x.RoadwayNo == roadwayNo); |
| | | if (roadwayInfo == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ç»ç¹å··éä¿¡æ¯"); |
| | | } |
| | | Dt_Task task = new Dt_Task() |
| | | { |
| | | CurrentAddress = stockInfo.LocationCode, |
| | | Grade = 0, |
| | | NextAddress = endStation, |
| | | PalletCode = stockInfo.PalletCode, |
| | | Roadway = roadwayNo, |
| | | SourceAddress = stockInfo.LocationCode, |
| | | TargetAddress = endStation, |
| | | TaskStatus = OutTaskStatusEnum.OutNew.ObjToInt(), |
| | | TaskType = TaskTypeEnum.PalletOutbound.ObjToInt(), |
| | | }; |
| | | |
| | | _unitOfWorkManage.BeginTran(); |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | locationInfo.LocationStatus = LocationStatusEnum.Lock.ObjToInt(); |
| | | BaseDal.AddData(task); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_IRecordService; |
| | |
| | | { |
| | | private readonly IMapper _mapper; |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | private readonly ILocationInfoService _locationInfoService; |
| | | private readonly IStockInfoService _stockInfoService; |
| | | private readonly ILocationStatusChangeRecordSetvice _locationStatusChangeRecordSetvice; |
| | | private readonly IOutboundOrderDetailService _outboundOrderDetailService; |
| | | private readonly IRoadwayInfoRepository _roadwayInfoRepository; |
| | | private readonly IOutStockLockInfoService _outStockLockInfoService; |
| | | |
| | | private readonly IBasicService _basicService; |
| | | private readonly IOutboundService _outboundService; |
| | | private readonly IInboundService _inboundService; |
| | | private readonly IRecordService _recordService; |
| | | private readonly IStockService _stockService; |
| | | |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, ILocationInfoService locationInfoService, IStockInfoRepository stockInfoRepository, ILocationStatusChangeRecordSetvice locationStatusChangeRecordSetvice, IOutboundOrderDetailService outboundOrderDetailService, IRoadwayInfoRepository roadwayInfoRepository, IOutStockLockInfoService outStockLockInfoService, IStockInfoService stockInfoService) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IBasicService basicService, IOutboundService outboundService, IInboundService inboundService, IRecordService recordService, IStockService stockService) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _locationInfoService = locationInfoService; |
| | | _stockInfoService = stockInfoService; |
| | | _locationStatusChangeRecordSetvice = locationStatusChangeRecordSetvice; |
| | | _outboundOrderDetailService = outboundOrderDetailService; |
| | | _roadwayInfoRepository = roadwayInfoRepository; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | _outStockLockInfoService = outStockLockInfoService; |
| | | _basicService = basicService; |
| | | _outboundService = outboundService; |
| | | _inboundService = inboundService; |
| | | _recordService = recordService; |
| | | _stockService = stockService; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | public WebResponseContent TaskCompleted(int taskNum) |
| | | { |
| | | try |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCompleted"); |
| | | if (methodInfo != null) |
| | | { |
| | | WebResponseContent? responseContent = (WebResponseContent?)methodInfo.Invoke(this, new object[] { task }); |
| | | if (responseContent != null) |
| | | { |
| | | return responseContent; |
| | | } |
| | | } |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ç±»å对åºä¸å¡å¤çé»è¾"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | public WebResponseContent InboundTaskCompleted(Dt_Task task) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | |
| | | Dt_LocationInfo locationInfo = _locationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | |
| | | CheckInboundCompleted(stockInfo, locationInfo); |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt(); |
| | | _stockInfoService.Repository.UpdateData(stockInfo); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | _locationInfoService.Repository.UpdateData(locationInfo); |
| | | locationInfo.LocationStatus = LocationStatusEnum.InStock.ObjToInt(); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | BaseDal.DeleteData(task); |
| | | |
| | | _locationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 空æçå
¥åºå®æå¤ç |
| | | /// </summary> |
| | | /// <param name="task">ä»»å¡å®ä½å¯¹è±¡</param> |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | public WebResponseContent PalletInboundTaskCompleted(Dt_Task task) |
| | | { |
| | | Dt_StockInfo stockInfo = new Dt_StockInfo() |
| | | { |
| | | PalletCode = task.PalletCode, |
| | | LocationCode = task.TargetAddress, |
| | | StockStatus = StockStatusEmun.å·²å
¥åº.ObjToInt() |
| | | }; |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.TargetAddress); |
| | | |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | |
| | | _stockService.StockInfoService.Repository.AddData(stockInfo); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Pallet.ObjToInt(); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | |
| | | BaseDal.DeleteData(task); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), "", task.TaskNum); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | |
| | | /// <param name="stockInfo"></param> |
| | | /// <param name="locationInfo"></param> |
| | | /// <returns></returns> |
| | | private (bool, string) CheckInboundCompleted(Dt_StockInfo stockInfo, Dt_LocationInfo locationInfo, bool isCheckStockDetail = true) |
| | | private (bool, string) CheckCompleted(Dt_StockInfo stockInfo, Dt_LocationInfo locationInfo, bool isCheckStockDetail = true) |
| | | { |
| | | if (stockInfo == null) |
| | | { |
| | |
| | | return (true, "æå"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä»»å¡å®æ |
| | | /// </summary> |
| | | /// <param name="taskNum">ä»»å¡å·</param> |
| | | /// <returns>è¿åå¤çç»æ</returns> |
| | | public WebResponseContent TaskCompleted(int taskNum) |
| | | public WebResponseContent OutboundTaskCompleted(Dt_Task task) |
| | | { |
| | | Dt_Task task = BaseDal.QueryFirst(x => x.TaskNum == taskNum); |
| | | if (task == null) |
| | | { |
| | | return WebResponseContent.Instance.Error("æªæ¾å°ä»»å¡ä¿¡æ¯"); |
| | | } |
| | | MethodInfo? methodInfo = GetType().GetMethod(((TaskTypeEnum)task.TaskType) + "TaskCompleted"); |
| | | if (methodInfo != null) |
| | | { |
| | | WebResponseContent? responseContent = (WebResponseContent?)methodInfo.Invoke(this, new object[] { task }); |
| | | if (responseContent != null) |
| | | { |
| | | return responseContent; |
| | | } |
| | | } |
| | | return WebResponseContent.Instance.Error(); |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | |
| | | stockInfo.LocationCode = locationInfo.LocationCode; |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | | _stockService.StockInfoService.Repository.UpdateData(stockInfo); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | | return OnOutboundTaskCompleted?.Invoke(task) ?? WebResponseContent.Instance.OK(); |
| | | } |
| | | |
| | | public WebResponseContent PalletOutboundTaskCompleted(Dt_Task task) |
| | | { |
| | | Dt_StockInfo stockInfo = _stockService.StockInfoService.Repository.GetStockInfo(task.PalletCode); |
| | | |
| | | Dt_LocationInfo locationInfo = _basicService.LocationInfoService.Repository.QueryFirst(x => x.LocationCode == task.SourceAddress); |
| | | |
| | | CheckCompleted(stockInfo, locationInfo); |
| | | |
| | | _stockService.StockInfoService.Repository.DeleteData(stockInfo); |
| | | |
| | | int beforeStatus = locationInfo.LocationStatus; |
| | | locationInfo.LocationStatus = LocationStatusEnum.Free.ObjToInt(); |
| | | _basicService.LocationInfoService.Repository.UpdateData(locationInfo); |
| | | |
| | | BaseDal.DeleteAndMoveIntoHty(task, App.User.UserId == 0 ? OperateType.èªå¨å®æ : OperateType.äººå·¥å®æ); |
| | | |
| | | _recordService.LocationStatusChangeRecordSetvice.AddLocationStatusChangeRecord(locationInfo, beforeStatus, StockChangeType.Inbound.ObjToInt(), stockInfo.Details.FirstOrDefault()?.OrderNo ?? "", task.TaskNum); |
| | | |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_TaskInfoService |
| | | { |
| | | public partial class TaskService |
| | | { |
| | | public Func<Dt_Task, WebResponseContent>? OnOutboundTaskCompleted => ShelfOutboundCarry; |
| | | } |
| | | } |
| | |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IStockRepository\WIDESEA_IStockRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IStockService\WIDESEA_IStockService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ITaskInfoService\WIDESEA_ITaskInfoService.csproj" /> |
| | | </ItemGroup> |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Swashbuckle.AspNetCore.Annotations; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_DTO; |
| | | using WIDESEA_DTO.Basic; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | |
| | | [ApiController] |
| | | public class AreaInfoController : ApiBaseController<IAreaInfoService, Dt_AreaInfo> |
| | | { |
| | | public AreaInfoController(IAreaInfoService service) : base(service) |
| | | private readonly IBasicService _basicService; |
| | | public AreaInfoController(IAreaInfoService service,IBasicService basicService) : base(service) |
| | | { |
| | | _basicService = basicService; |
| | | } |
| | | |
| | | [HttpPost, Route("GetAllLocationGroups"), AllowAnonymous] |
| | | |
| | | public List<LocationGroupDTO> GetAllLocationGroups(string roadway) |
| | | { |
| | | List<LocationGroupDTO> locations = _basicService.LocationInfoService.Repository.GetAllLocationGroups(roadway); |
| | | return locations; |
| | | } |
| | | } |
| | | } |
| | |
| | | return Service.AddInboundOrder(orderAddDTO); |
| | | } |
| | | |
| | | [HttpPost, Route("MaterielGroup")] |
| | | public WebResponseContent MaterielGroup([FromBody] MaterielGroupDTO materielGroupDTO) |
| | | { |
| | | return Service.MaterielGroup(materielGroupDTO); |
| | | } |
| | | |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Inbound; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_ITaskInfoService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers |
| | | { |
| | | [Route("api/PDA")] |
| | | [ApiController] |
| | | public class PDAController : ApiBaseController<ITaskService, Dt_Task> |
| | | { |
| | | private readonly IInboundService _inboundService; |
| | | public PDAController(ITaskService service, IInboundService inboundService) : base(service) |
| | | { |
| | | _inboundService = inboundService; |
| | | } |
| | | |
| | | [HttpPost, Route("CallMateriel")] |
| | | public WebResponseContent CallMateriel(string endPoint) |
| | | { |
| | | return Service.CallMateriel(endPoint); |
| | | } |
| | | |
| | | [HttpPost, Route("MaterielCarry")] |
| | | public WebResponseContent MaterielCarry(string startPoint) |
| | | { |
| | | return Service.MaterielCarry(startPoint); |
| | | } |
| | | |
| | | [HttpPost, Route("MaterielGroup")] |
| | | public WebResponseContent MaterielGroup([FromBody] MaterielGroupDTO materielGroupDTO) |
| | | { |
| | | return _inboundService.InbounOrderService.MaterielGroup(materielGroupDTO); |
| | | } |
| | | |
| | | [HttpPost, Route("QueryOrderInfo")] |
| | | public WebResponseContent QueryOrderInfo(int pageNo, string orderNo) |
| | | { |
| | | return _inboundService.InbounOrderService.QueryOrderInfo(pageNo, orderNo); |
| | | } |
| | | } |
| | | } |
| | |
| | | [ApiController] |
| | | public class StockInfoController : ApiBaseController<IStockInfoService, Dt_StockInfo> |
| | | { |
| | | private readonly IStockInfoRepository _stockInfoRepository; |
| | | public StockInfoController(IStockInfoService service, IStockInfoRepository stockInfoRepository) : base(service) |
| | | public StockInfoController(IStockInfoService service) : base(service) |
| | | { |
| | | _stockInfoRepository = stockInfoRepository; |
| | | } |
| | | |
| | | [HttpPost, Route("GetAllStockViews"), AllowAnonymous] |
| | | public List<StockViewDTO> GetAllStockViews() |
| | | { |
| | | return _stockInfoRepository.GetAllStockViews(); |
| | | return Service.Repository.GetAllStockViews(); |
| | | } |
| | | |
| | | [HttpPost, Route("GetStockSelectViews"), AllowAnonymous] |
| | |
| | | { |
| | | return Service.GetStockSelectViews(materielCode); |
| | | } |
| | | [HttpPost, Route("GetPalletStockInfo"), AllowAnonymous] |
| | | public Dt_StockInfo GetPalletStockInfo(string roadwayNo) |
| | | { |
| | | return Service.Repository.GetPalletStockInfo(roadwayNo); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_DTO.Stock; |
| | | using WIDESEA_IStockService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Stock |
| | | { |
| | | [Route("api/StockView")] |
| | | [ApiController] |
| | | public class StockViewController : ApiBaseController<IStockViewService, StockViewDTO> |
| | | { |
| | | public StockViewController(IStockViewService service) : base(service) |
| | | { |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | { |
| | | return Json(Service.Login(loginInfo)); |
| | | } |
| | | |
| | | [HttpPost, Route("getCurrentUserInfo")] |
| | | public WebResponseContent GetCurrentUser() |
| | | { |
| | |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.7.3" /> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_BasicService\WIDESEA_BasicService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_InboundService\WIDESEA_InboundService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_OutboundService\WIDESEA_OutboundService.csproj" /> |