| | |
| | | } |
| | | if (task.PalletCode!= agvCallbackBox.ContainerCode) |
| | | { |
| | | string Address = task.CurrentAddress switch |
| | | string Address = task?.CurrentAddress switch |
| | | { |
| | | "5206" => "5105", |
| | | "5212" => "5111", |
| | | "5218" => "5117", |
| | | "8005" => "8001", |
| | | "5135" => "5236", |
| | | _ => throw new Exception("æªæ¾å°å°åä¿¡æ¯"), |
| | | }; |
| | | AgvCTUCancelDTO agvCTUCancel=new AgvCTUCancelDTO() |
| | | { |
| | |
| | | { |
| | | if (agvUpdateModel == null) throw new Exception("æªè·åå°è¯·æ±åæ°"); |
| | | agvResponseContent.ReqCode = agvUpdateModel.ReqCode; |
| | | var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum); |
| | | //æ¯å¦åå¨è¾é线ä½å¾
AGVæ¬è¿ä»»å¡ |
| | | var taskExecutes = _taskRepository.QueryData(x => x.NextAddress == task.CurrentAddress && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.TaskType == TaskTypeEnum.InProduct.ObjToInt()); |
| | | var taskExecutesFL = _taskRepository.QueryData(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode=="AGV_FL" && !string.IsNullOrEmpty(x.DeviceCode)); |
| | | if (task == null) throw new Exception($"æªæ¾å°ä»»å¡,ä»»å¡å·ã{agvUpdateModel.TaskCode}ã"); |
| | | |
| | | var task = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum) ?? throw new Exception($"æªæ¾å°ä»»å¡,ä»»å¡å·ã{agvUpdateModel.TaskCode}ã"); |
| | | switch (agvUpdateModel.Method.ToUpper()) |
| | | { |
| | | case "END": |
| | |
| | | //æ´æ¹æåå
¥åºAGVåè´§ä»»å¡ç¶æ |
| | | if (task.TaskType == TaskTypeEnum.InProduct.ObjToInt() || task.TaskType == TaskTypeEnum.InProductBack.ObjToInt()) |
| | | { |
| | | //for (int i = 0; i < 100; i++) |
| | | //{ |
| | | // task.TaskState = TaskStatusEnum.AGV_WaitToExecute.ObjToInt(); |
| | | // task.Remark = task.TaskState.ToString(); |
| | | // _taskRepository.UpdateData(task); |
| | | // var taskOk = _taskRepository.QueryFirst(x => agvUpdateModel.TaskCode == x.AgvTaskNum); |
| | | // if (taskOk.TaskState==TaskStatusEnum.AGV_WaitToExecute.ObjToInt() || taskOk.Remark.Contains("320")) |
| | | // { |
| | | // agvResponseContent.Code = "0"; |
| | | // agvResponseContent.Message = ""+i; |
| | | // break; |
| | | // } |
| | | //} |
| | | |
| | | //æ¯å¦åå¨è¾é线ä½å¾
AGVæ¬è¿ä»»å¡ |
| | | var taskExecutes = _taskRepository.QueryData(x => x.NextAddress == task.CurrentAddress && x.TaskState == TaskStatusEnum.Line_Executing.ObjToInt() && x.TaskType == TaskTypeEnum.InProduct.ObjToInt()); |
| | | if (taskExecutes.Count > 0) |
| | | { |
| | | string address = task.CurrentAddress switch |
| | | { |
| | | "5206" => "5105", |
| | | "5212" => "5111", |
| | | "5218" => "5117", |
| | | "5218" => "5117" |
| | | }; |
| | | //è°ç¨AGVé¢è°åº¦æ¥å£ |
| | | AgvScheduleTaskDTO agvScheduleTask = new AgvScheduleTaskDTO() |
| | |
| | | else //æ´æ¹è¾
æåè´§ |
| | | { |
| | | //æ¯å¦åå¨è¾é线ä½å¾
AGVæ¬è¿ä»»å¡ |
| | | var taskExecutesFL = _taskRepository.QueryData(x => x.TaskState == TaskStatusEnum.New.ObjToInt() && x.DeviceCode == "AGV_FL" && !string.IsNullOrEmpty(x.DeviceCode)); |
| | | if (taskExecutesFL.Count > 0) |
| | | { |
| | | //è°ç¨AGVé¢è°åº¦æ¥å£ |
| | | AgvScheduleTaskDTO agvScheduleTask = new AgvScheduleTaskDTO() |
| | | { |
| | | PositionCode = "8001", |
| | | NextTask = "90", |
| | | NextTask = "60", |
| | | UseableLayers = "1", |
| | | CacheCount = "1", |
| | | Update = "0", |
| | |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = router.ChildPosi; |
| | | } |
| | | else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || (item.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() && item.RoadWay.Contains("BC"))) |
| | | else if (item.TaskType == TaskTypeEnum.MesOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt() || item.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || ((item.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || item.TaskType == TaskTypeEnum.OutQuality.ObjToInt() || item.TaskType == TaskTypeEnum.OutInventory.ObjToInt()) && item.RoadWay.Contains("BC"))) |
| | | { |
| | | task.NextAddress = router.NextPosi; |
| | | task.DeviceCode = stationManger.StackerCraneCode; |
| | |
| | | { |
| | | task.DeviceCode = stationManger.StationDeviceCode; |
| | | task.AgvTaskNum = task.Roadway + DateTime.Now.ToString("yyyyMMdd") + item.TaskNum; |
| | | } |
| | | else if (item.RoadWay.Contains("PP") && taskTypeGroup == TaskTypeGroup.OutbondGroup) |
| | | { |
| | | task.DeviceCode = router.StartPosi; |
| | | } |
| | | else |
| | | { |
| | |
| | | router = routers.FirstOrDefault(); |
| | | task.NextAddress = router?.StartPosi ?? ""; |
| | | task.DeviceCode = item.RoadWay; |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | if (item.RoadWay.Contains("ZH")) |
| | | { |
| | | task.TaskState = TaskStatusEnum.New.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | task.TaskState = TaskStatusEnum.SC_Execute.ObjToInt(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | if (!string.IsNullOrEmpty(boxcode)) |
| | | { |
| | | string sc = device.Communicator.Read<string>("DB900.580.0"); |
| | | string sc = device.Communicator.Read<string>("DB900.578.0"); |
| | | WriteError(device.DeviceName, $"读åå¼ï¼{boxcode},对æ¯{sc}"); |
| | | string boxEndCode = ""; |
| | | if (boxcode.LastIndexOf(",PO:") >= 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",PO:")) + sc.Substring(sc.IndexOf(",PO:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",PO") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",PO")) + sc.Substring(sc.IndexOf("PO:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",P") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",P")) + sc.Substring(sc.IndexOf("PO:")).Replace("\0", ""); |
| | | } |
| | | |
| | | //å
¥åºç³è¯·ä»»å¡ |
| | |
| | | Dt_Task task = _taskRepository.QueryFirst(x => _taskService.TaskOutboundTypes.Contains(x.TaskType) && x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && string.IsNullOrEmpty(x.TargetAddress) && !string.IsNullOrEmpty(x.NextAddress)); |
| | | if (task != null) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StackerCraneStationCode, deviceCode: item.StackerCraneCode, targetAddress: item.StationCode); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (!string.IsNullOrEmpty(boxcode)) |
| | | { |
| | | string sc = device.Communicator.Read<string>("DB900.508.0"); |
| | | string sc = device.Communicator.Read<string>("DB900.478.0"); |
| | | WriteError(device.DeviceName, $"读åå¼ï¼{boxcode},对æ¯{sc}"); |
| | | string boxEndCode = ""; |
| | | if (boxcode.LastIndexOf(",SC:") >=0) |
| | | if (boxcode.LastIndexOf(",PO:") >=0) |
| | | { |
| | | boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",SC:")) + sc.Substring(sc.IndexOf(",SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",SC") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",SC")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | } |
| | | else if (boxcode.LastIndexOf(",S") > 0) |
| | | { |
| | | boxEndCode = "M" + boxcode.Substring(0, boxcode.LastIndexOf(",S")) + sc.Substring(sc.IndexOf("SC:")).Replace("\0", ""); |
| | | boxEndCode = "M"+ boxcode.Substring(0,boxcode.LastIndexOf(",PO:")) + sc.Substring(sc.IndexOf(",PO:")).Replace("\0", ""); |
| | | } |
| | | |
| | | //å
¥åºç³è¯·ä»»å¡ |
| | |
| | | ////夿AGVä»»å¡å®æï¼ååç»å°é¢ç«åè´§å®æ |
| | | //device.SetValue(GroundStationDBName.W_TakeRequest, false, item.StationCode); |
| | | //device.SetValue(GroundStationDBName.W_TakeFinish, false, item.StationCode); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.SC_Execute.ObjToInt() && string.IsNullOrEmpty(x.NextAddress)); |
| | | Dt_Task task = _taskRepository.QueryFirst(x => x.DeviceCode == item.StackerCraneCode && x.TaskState == TaskStatusEnum.New.ObjToInt() && x.NextAddress==item.StationCode); |
| | | if (task != null && isCanPut && !isCanTake && !putRequest && !putFinish && !takeRequest && !takeFinish) |
| | | { |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StationCode); |
| | | _taskService.UpdateTask(task, TaskStatusEnum.SC_Execute, nextAddress: item.StackerCraneStationCode); |
| | | } |
| | | } |
| | | if (item.StationType == StationTypeEnum.StationType_OnlyInbound.ObjToInt()) |
| | |
| | | // import {getCurrentInstance} from 'vue' |
| | | import { useRouter, useRoute } from 'vue-router' |
| | | const router = useRouter(); |
| | | axios.defaults.timeout = 50000; |
| | | axios.defaults.timeout = 60000; |
| | | axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; |
| | | |
| | | import { ElLoading as Loading, ElMessage as Message } from 'element-plus'; |
| | |
| | | this.formFields.checkCount = this.rowData.receivedQuantity; |
| | | //sampleCountä¿ç两ä½å°æ° |
| | | this.formFields.sampleCount = (this.rowData.receivedQuantity/10).toFixed(2); |
| | | console.log(this.rowData); |
| | | }, |
| | | onModelClose() { |
| | | this.$refs.form.reset(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <vol-box |
| | | :lazy="true" |
| | | v-model="model" |
| | | :show-fullscreen="false" |
| | | title="æ£éª" |
| | | :width="550" |
| | | :padding="5" |
| | | :onModelClose="onModelClose" |
| | | > |
| | | <div style="width: 520px; margin-left: 0px" :style="height + 'px'"> |
| | | <div style="text-align: center; margin-top: 10px"></div> |
| | | <vol-form |
| | | ref="form" |
| | | :loadKey="true" |
| | | :formFields="formFields" |
| | | :formRules="formRules" |
| | | > |
| | | </vol-form> |
| | | </div> |
| | | <template #footer> |
| | | <div> |
| | | <el-button type="primary" size="small" @click="IsCheck">确认</el-button> |
| | | <el-button type="default" size="small" @click="closeModel" |
| | | >å
³é</el-button |
| | | > |
| | | </div> |
| | | </template> |
| | | </vol-box> |
| | | </template> |
| | | <script> |
| | | import VolBox from "@/components/basic/VolBox.vue"; |
| | | import VolForm from "@/components/basic/VolForm.vue"; |
| | | //è¿é使ç¨çvue2è¯æ³ï¼ä¹å¯ä»¥åævue3è¯æ³ |
| | | export default { |
| | | components: { "vol-box": VolBox, "vol-form": VolForm }, |
| | | methods: {}, |
| | | data() { |
| | | return { |
| | | model: false, |
| | | height: 200, |
| | | rowData: null, //å½åè¡çæ°æ® |
| | | //è¡¨åæ°æ® |
| | | formFields: { |
| | | accpetVal: null, //设置åéæ¡é»è®¤å¼ |
| | | isReturn: null, |
| | | decimalVal: null, |
| | | Remark: null, |
| | | defectCode: null, |
| | | checkCount: null, |
| | | sampleCount: null |
| | | }, |
| | | formRules: [ |
| | | [ |
| | | { |
| | | data: [ |
| | | { key: 1, value: "æ¥å" }, |
| | | { key: 2, value: "䏿¥å" }, |
| | | { key: 3, value: "ç¹éæ¥å" }, |
| | | ], //loadKey设置为true,伿 ¹æ®dataKeyä»åå°çä¸ææ¡æ°æ®æºä¸èªå¨å è½½æ°æ® |
| | | title: "æ¯å¦æ¥å", |
| | | filter: true, |
| | | // required: true, //设置为å¿
é项 |
| | | field: "accpetVal", |
| | | type: "select", |
| | | labelWidth: 80, |
| | | validator: (rule, val) => { |
| | | if (!val) { |
| | | return "è¯·éæ©æ¯å¦æ¥å"; |
| | | } |
| | | }, |
| | | onChange: (val, option) => { |
| | | var select = option.find((x) => x.key == val)?.value; |
| | | if (select == "æ¥å") { |
| | | this.$Message.success(select); |
| | | } else if (select == "䏿¥å" || select == "ç¹éæ¥å") { |
| | | this.formFields.isReturn =1; |
| | | this.formRules[2][0].hidden = false; |
| | | this.formRules[2][0].required = true; |
| | | this.formRules[2][1].hidden = false; |
| | | this.formRules[2][1].required = true; |
| | | this.formRules[3][0].hidden = false; |
| | | this.$Message.error(select); |
| | | } else { |
| | | this.$Message.warning("è¯·éæ©æ¯å¦æ¥å"); |
| | | } |
| | | }, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ¯å¦æ£æ°", |
| | | field: "isReturn", |
| | | data: [], |
| | | required: false, |
| | | type: "switch", |
| | | onChange: (val) => { |
| | | if (val == 1) { |
| | | this.formRules[2][0].hidden = false; |
| | | this.formRules[2][0].required = true; |
| | | this.formRules[2][1].hidden = false; |
| | | this.formRules[2][1].required = true; |
| | | this.formRules[3][0].hidden = false; |
| | | } else { |
| | | this.formRules[2][0].hidden = true; |
| | | this.formRules[2][0].required = false; |
| | | this.formRules[2][1].hidden = true; |
| | | this.formRules[2][1].required = false; |
| | | this.formRules[3][0].hidden = true; |
| | | } |
| | | }, |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | type: "select", |
| | | title: "缺é·ä»£ç ", |
| | | required: false, |
| | | hidden: true, |
| | | placeholder: "缺é·ä»£ç ", |
| | | field: "defectCode", |
| | | data: [{key:'WMSReturn',value:'WMSåè´¨éè´§'},{key:'0223',value:'WMSæ¥åº'},{key:'4529',value:'WMSç¹é'}] |
| | | }, |
| | | { |
| | | type: "decimal", |
| | | title: "æ°é", |
| | | required: false, |
| | | hidden: true, |
| | | placeholder: "æ°é", |
| | | field: "decimalVal", |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "夿³¨", |
| | | required: false, |
| | | hidden: true, |
| | | field: "Remark", |
| | | placeholder: "夿³¨", |
| | | min: 1, |
| | | max: 3, |
| | | type: "textarea", |
| | | colSize: 12, //设置宽度100% |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "æ£éªæ°é", |
| | | field: "checkCount", |
| | | type: "label", |
| | | inputStyle: { color: "#000000" }, //èªå®ä¹æ ·å¼,å
¶ä»çinputä¹çæ |
| | | }, |
| | | { |
| | | title: "æ½æ ·æ°é", |
| | | field: "sampleCount", |
| | | type: "label", |
| | | inputStyle: { color: "#e6a23c" }, //èªå®ä¹æ ·å¼,å
¶ä»çinputä¹çæ |
| | | }, |
| | | ], |
| | | ], |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(res) { |
| | | this.model = true; |
| | | this.rowData = res[0]; |
| | | this.formFields.checkCount = this.rowData.receivedQuantity; |
| | | //sampleCountä¿ç两ä½å°æ° |
| | | this.formFields.sampleCount = (this.rowData.receivedQuantity/10).toFixed(2); |
| | | }, |
| | | onModelClose() { |
| | | this.$refs.form.reset(); |
| | | this.model = false; |
| | | this.formRules[2][0].hidden = true; |
| | | this.formRules[2][0].required = false; |
| | | this.formRules[2][1].hidden = true; |
| | | this.formRules[2][1].required = false; |
| | | this.formRules[3][0].hidden = true; |
| | | }, |
| | | closeModel() { |
| | | this.$refs.form.reset(); |
| | | this.model = false; |
| | | this.formRules[2][0].hidden = true; |
| | | this.formRules[2][0].required = false; |
| | | this.formRules[2][1].hidden = true; |
| | | this.formRules[2][1].required = false; |
| | | this.formRules[3][0].hidden = true; |
| | | }, |
| | | IsCheck() { |
| | | //è·åaccpetValçå¼ |
| | | this.$refs.form.validate(() => { |
| | | var requestData = null; |
| | | if (this.formFields.isReturn == 1) { |
| | | var ResultInfo=""; |
| | | if(this.formFields.defectCode == "WMSReturn") { |
| | | ResultInfo="Return"; |
| | | }else if(this.formFields.defectCode == "0223") { |
| | | ResultInfo="Scrapped"; |
| | | }else if(this.formFields.defectCode == "4529") { |
| | | ResultInfo="Defect"; |
| | | } |
| | | requestData = { |
| | | checkOrderId: this.rowData.checkOrderId, |
| | | defectCode: this.formFields.defectCode, |
| | | quantity: this.formFields.decimalVal, |
| | | note: this.formFields.Remark, |
| | | result: ResultInfo, |
| | | sampleCount: this.formFields.sampleCount, |
| | | }; |
| | | } |
| | | this.http |
| | | .post( |
| | | "/api/CheckOrderResult/CommitInspectResult?checkOrderId=" + |
| | | this.rowData.checkOrderId + |
| | | "&isAccept=" + |
| | | this.formFields.accpetVal, |
| | | requestData ? requestData : {}, |
| | | "请æ±ä¸" |
| | | ) |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$refs.form.reset(); |
| | | this.model = false; |
| | | this.formRules[2][0].hidden = true; |
| | | this.formRules[2][0].required = false; |
| | | this.formRules[3][0].hidden = true; |
| | | this.$Message.success("æäº¤æå"); |
| | | this.$parent.refresh(); |
| | | } else { |
| | | this.$Message.error(x.message); |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style> |
| | | /* éèå
¨å±æ¾å¤§æé® */ |
| | | .el-icon-full-screen { |
| | | display: none; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <!-- å¼¹åºæ¡ä¸ --> |
| | | <vol-box :lazy="true" v-model="model1" title="æ£éªä¿¡æ¯" :width="500" :padding="5" :onModelClose="onModelClose"> |
| | | <div style="height:350px;"> |
| | | <div style="width:450px;margin: 10px auto;"> |
| | | <el-descriptions column="1"> |
| | | <el-descriptions-item label="æ£éªç»æï¼"> |
| | | <el-tag size="small" :type="!model1Rows?'success':'error'"> |
| | | {{!model1Rows?"åæ ¼":"æ¥åº" }} |
| | | </el-tag> |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :label="!model1Rows?'':'缺é·ä»£ç ï¼'" > |
| | | {{!model1Rows?"":model1Rows.defectCode}} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :label="!model1Rows?'':'æ£éªæ°éï¼'"> |
| | | {{!model1Rows?"":model1Rows.checkquantity}} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :label="!model1Rows?'':'æ½æ ·æ°éï¼'"> |
| | | {{!model1Rows?"":model1Rows.sampleCount}} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :label="!model1Rows?'':'æ¥åºæ°éï¼'"> |
| | | {{!model1Rows?"":model1Rows.quantity}} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :label="!model1Rows?'':'æ£éªåå·¥ï¼'"> |
| | | {{!model1Rows?"":model1Rows.creater}} |
| | | </el-descriptions-item> |
| | | <el-descriptions-item :label="!model1Rows?'':'æ£éªå¤æ³¨ï¼'"> |
| | | {{!model1Rows?"":model1Rows.note}} |
| | | </el-descriptions-item> |
| | | </el-descriptions> |
| | | </div> |
| | | </div> |
| | | <template #footer> |
| | | <div> |
| | | <!-- <el-button type="primary" plain size="small" @click="callParent">è°ç¨çæ(ç¶)页é¢å¯¹è±¡</el-button> --> |
| | | <!-- <el-button type="primary" size="small" @click="closeModel1">确认</el-button> --> |
| | | <el-button type="default" size="small" @click="model1 = false">å
³é</el-button> |
| | | </div> |
| | | </template> |
| | | </vol-box> |
| | | </template> |
| | | <script> |
| | | import VolBox from '@/components/basic/VolBox.vue'; |
| | | //è¿é使ç¨çvue2è¯æ³ï¼ä¹å¯ä»¥åævue3è¯æ³ |
| | | export default { |
| | | components: { 'vol-box': VolBox }, |
| | | methods: {}, |
| | | data() { |
| | | return { |
| | | model1: false, |
| | | model1Rows: null, |
| | | }; |
| | | }, |
| | | methods: { |
| | | open(info) { //å¼¹åºæ¡1 |
| | | this.model1Rows = info; |
| | | this.model1 = true; |
| | | console.log(info); |
| | | }, |
| | | closeModel1() { |
| | | this.model1 = false; |
| | | this.model1Rows=null; |
| | | }, |
| | | // callParent() { |
| | | // this.$emit('parentCall', $parent => { |
| | | // //$parentå°±æ¯çæé¡µé¢çå¯¹è±¡ï¼æ¯å¦å¯ä»¥è°ç¨é¡µé¢å·æ°ï¼å¯è·åç屿§ä¸æ¹æ³è§ãçæé¡µé¢ææ¡£ã,$parent.xxxç´æ¥è°ç¨ |
| | | // //è°ç¨å·æ° |
| | | // $parent.search(); |
| | | // //è·åææéä¸çè¡æ°æ® |
| | | // // $parent.getSelectRows(); |
| | | // this.$message.success('è°ç¨äºå·æ°') |
| | | // }) |
| | | // }, |
| | | onModelClose() { |
| | | this.model1 = false; |
| | | this.model1Rows=null; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /***************************************************************************************** |
| | | ** Author:jxx 2022 |
| | | ** QQ:283591387 |
| | | **宿´ææ¡£è§ï¼http://v2.volcore.xyz/document/api ã代ç çæé¡µé¢ViewGridã |
| | | **常ç¨ç¤ºä¾è§ï¼http://v2.volcore.xyz/document/vueDev |
| | | **åå°æä½è§ï¼http://v2.volcore.xyz/document/netCoreDev |
| | | *****************************************************************************************/ |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from './extend/inspectResult.vue' |
| | | import gridHeader from './extend/inspectResultInfo.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: gridHeader, |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { //æ¡æ¶åå§åé
ç½®åï¼ |
| | | //示ä¾ï¼å¨æé®çæå颿·»å ä¸ä¸ªæé® |
| | | // this.buttons.unshift({ //ä¹å¯ä»¥ç¨pushæè
spliceæ¹æ³æ¥ä¿®æ¹buttonsæ°ç» |
| | | // name: 'æé®', //æé®åç§° |
| | | // icon: 'el-icon-document', //æé®å¾æ vue2çæ¬è§iviewææ¡£iconï¼vue3çæ¬è§element uiææ¡£icon(注æä¸æ¯element pulsææ¡£) |
| | | // type: 'primary', //æé®æ ·å¼vue2çæ¬è§iviewææ¡£buttonï¼vue3çæ¬è§element uiææ¡£button |
| | | // onClick: function () { |
| | | // this.$Message.success('ç¹å»äºæé®'); |
| | | // } |
| | | // }); |
| | | this.columns.push({ |
| | | title: 'æä½', |
| | | field: 'æä½', |
| | | width: 120, |
| | | align: 'center', |
| | | render: (h, { row, column, index }) => { |
| | | if ( row.checkOrderStatus == 0 ) { |
| | | return ( |
| | | <div> |
| | | <el-button |
| | | onClick={($e) => { |
| | | this.$refs.gridBody.open([row],true); |
| | | }} |
| | | type="primary" |
| | | plain |
| | | size="small" |
| | | style="height:26px; padding: 10px !important;" |
| | | > |
| | | å®¡æ ¸ |
| | | </el-button> |
| | | </div> |
| | | ) |
| | | } |
| | | if ( row.checkOrderStatus == 1 ) { |
| | | return ( |
| | | <div> |
| | | <el-button |
| | | onClick={($e) => { |
| | | this.http |
| | | .post("api/CheckOrderResult/GetCheckResultInfo?checkId="+row.checkOrderId, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | if (x.data) { |
| | | x.data.checkquantity=row.receivedQuantity |
| | | } |
| | | this.$refs.gridHeader.open(x.data); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | |
| | | }} |
| | | type="primary" |
| | | plain |
| | | size="small" |
| | | style="height:26px; padding: 10px !important;" |
| | | > |
| | | æ£éªä¿¡æ¯ |
| | | </el-button> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | }); |
| | | this.columns.forEach(x=>{ |
| | | //设置titleååºå® |
| | | if (x.field=='æä½') { |
| | | x.fixed = 'right'; |
| | | // x.align="center"//è®¾ç½®ææ¬å±
ä¸ |
| | | } |
| | | }) |
| | | //示ä¾ï¼è®¾ç½®ä¿®æ¹æ°å»ºãç¼è¾å¼¹åºæ¡å段æ ç¾çé¿åº¦ |
| | | // this.boxOptions.labelWidth = 150; |
| | | }, |
| | | 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; |
| | |
| | | // x.numberLength = 4; |
| | | } |
| | | }); |
| | | // this.boxButtons.forEach((btn) => { |
| | | // if (btn.name == 'ä¿ å') { |
| | | // btn.hidden = true; |
| | | // //æè
设置åªè¯» |
| | | // //btn.readonly=true; |
| | | // } |
| | | // }); |
| | | }, |
| | | searchBefore(param) { |
| | | //ç颿¥è¯¢å,å¯ä»¥ç»param.wheresæ·»å æ¥è¯¢åæ° |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | //æ¤jsæä»¶æ¯ç¨æ¥èªå®ä¹æ©å±ä¸å¡ä»£ç ï¼å¯ä»¥æ©å±ä¸äºèªå®ä¹é¡µé¢æè
éæ°é
ç½®çæç代ç |
| | | import gridBody from './extend/MesOutOrderDetail.vue' |
| | | import gridHeader from './extend/addMesOutOrder.vue' |
| | | let extension = { |
| | | components: { |
| | | //æ¥è¯¢ç颿©å±ç»ä»¶ |
| | | gridHeader: gridHeader, |
| | | gridBody: gridBody, |
| | | gridFooter: '', |
| | | //æ°å»ºãç¼è¾å¼¹åºæ¡æ©å±ç»ä»¶ |
| | | modelHeader: '', |
| | | modelBody: '', |
| | | modelFooter: '' |
| | | }, |
| | | tableAction: '', //æå®æå¼ 表çæé(è¿éå¡«å表å,é»è®¤ä¸ç¨å¡«å) |
| | | buttons: { view: [], box: [], detail: [] }, //æ©å±çæé® |
| | | methods: { |
| | | //ä¸é¢è¿äºæ¹æ³å¯ä»¥ä¿çä¹å¯ä»¥å é¤ |
| | | onInit() { |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 120, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ ¸åæ¥åº</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | // let addButton = this.buttons.find(item => item.value == 'Add'); |
| | | // if (addButton) { |
| | | // addButton.onClick = () => { |
| | | // this.$refs.gridHeader.open(); |
| | | // } |
| | | // } |
| | | |
| | | // let executeOutbound = this.buttons.find(item => item.value == 'ExecuteOutbound'); |
| | | // if (executeOutbound) { |
| | | // executeOutbound.onClick = () => { |
| | | // let rows = this.$refs.table.getSelected(); |
| | | // if (rows.length == 0) return this.$error("è¯·éæ©æ°æ®!"); |
| | | // if (rows.length > 1) return this.$error("è¯·éæ©ä¸æ¡æ°æ®!"); |
| | | // var param = rows[0].taskNum; |
| | | // this.http |
| | | // .post("api/Task/HandSubstrateOut?orderId=" + rows[0].id, null, "æ°æ®å¤çä¸...") |
| | | // .then((x) => { |
| | | // if (x.status) { |
| | | // this.$Message.success('æ°æ®å¤çæå.'); |
| | | // this.refresh(); |
| | | // } else { |
| | | // return this.$error(x.message); |
| | | // } |
| | | // }); |
| | | // } |
| | | // } |
| | | |
| | | // //æ©å±é¡µé¢åå§åæä½ |
| | | // this.columns.push({ |
| | | // field: 'æä½', |
| | | // title: 'æä½', |
| | | // width: 90, |
| | | // fixed: 'right', |
| | | // align: 'center', |
| | | // formatter: (row) => { |
| | | // return ( |
| | | // '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥çæç»</i>' |
| | | // ); |
| | | // }, |
| | | // click: (row) => { |
| | | // this.$refs.gridBody.open(row); |
| | | // } |
| | | // }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | | //妿è¦é
ç½®æç»è¡¨,卿¤æ¹æ³æä½ |
| | | //this.detailOptions.columns.forEach(column=>{ }); |
| | | const isAdd=this.currentAction=='Update';//夿æ¯å¦ä¸ºæ°å»ºæä½ |
| | | }, |
| | | 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) { |
| | | //éèæç»è¡¨æé® |
| | | this.detailOptions.buttons.forEach((btn) => { |
| | | if (btn.name == '导å
¥') { |
| | | btn.hidden = true; |
| | | //æè
设置åªè¯» |
| | | //btn.readonly=true; |
| | | } |
| | | }); |
| | | //ç¹å»ç¼è¾ãæ°å»ºæé®å¼¹åºæ¡åï¼å¯ä»¥å¨æ¤å¤åé»è¾ï¼å¦ï¼ä»åå°è·åæ°æ® |
| | | //(1)夿æ¯ç¼è¾è¿æ¯æ°å»ºæä½ï¼ this.currentAction=='Add'; |
| | | //(2)ç»å¼¹åºæ¡è®¾ç½®é»è®¤å¼ |
| | | //(3)this.editFormFields.åæ®µ='xxx'; |
| | | //妿éè¦ç»ä¸ææ¡è®¾ç½®é»è®¤å¼ï¼è¯·éåthis.editFormOptionsæ¾å°å段é
置对åºdata屿§çkeyå¼ |
| | | //ç䏿就æè¾åºçï¼console.log(this.editFormOptions) |
| | | } |
| | | } |
| | | }; |
| | | export default extension; |
| | |
| | | <el-button type="primary" size="small" @click="outbound" |
| | | >ç´æ¥åºåº</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="lockStock" |
| | | <!-- <el-button type="primary" size="small" @click="lockStock" |
| | | >éå®åºå</el-button |
| | | > |
| | | > --> |
| | | <el-button type="danger" size="small" @click="showDetialBox = false" |
| | | >å
³é</el-button |
| | | > |
| | |
| | | <el-button type="primary" size="small" @click="outbound" |
| | | >ç´æ¥åºåº</el-button |
| | | > |
| | | <el-button type="primary" size="small" @click="lockStock" |
| | | <!-- <el-button type="primary" size="small" @click="lockStock" |
| | | >éå®åºå</el-button |
| | | > |
| | | > --> |
| | | <el-button type="danger" size="small" @click="showDetialBox = false" |
| | | >å
³é</el-button |
| | | > |
| | |
| | | <span>å·²éä¸ {{ selection.length }} 项</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-link |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link |
| | | > |
| | | > --> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | |
| | | <span>å·²éä¸ {{ selection.length }} 项</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-link |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link |
| | | > |
| | | > --> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | |
| | | <span>å·²éä¸ {{ selection.length }} 项</span> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-link |
| | | <!-- <el-link |
| | | type="primary" |
| | | size="small" |
| | | style="float: right; height: 20px" |
| | | @click="lockstocks" |
| | | >éå®åºå</el-link |
| | | > |
| | | > --> |
| | | <el-link |
| | | type="primary" |
| | | size="small" |
| | |
| | | onInit() { |
| | | //æ©å±é¡µé¢åå§åæä½ |
| | | this.columns.push({ |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥çæç»</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | field: 'æä½', |
| | | title: 'æä½', |
| | | width: 90, |
| | | fixed: 'right', |
| | | align: 'center', |
| | | formatter: (row) => { |
| | | return ( |
| | | '<i style="cursor: pointer;color: #2d8cf0;"class="el-icon-view">æ¥çæç»</i>' |
| | | ); |
| | | }, |
| | | click: (row) => { |
| | | this.$refs.gridBody.open(row); |
| | | } |
| | | }); |
| | | }, |
| | | onInited() { |
| | | //æ¡æ¶åå§åé
ç½®å |
| | |
| | | path: '/erpProInOrder', |
| | | name: 'erpProInOrder', |
| | | component: () => import('@/views/inbound/erpProInOrder.vue') |
| | | }, |
| | | { |
| | | path: '/erpProScrapSheet', |
| | | name: 'erpProScrapSheet', |
| | | component: () => import('@/views/outbound/erpProScrapSheet.vue') |
| | | }, |
| | | { |
| | | path: '/inspectOrder', |
| | | name: 'inspectOrder', |
| | | component: () => import('@/views/check/inspectOrder.vue') |
| | | } |
| | | ] |
| | | export default viewgird |
| | |
| | | receiveOrderNo: "", |
| | | checkOrderStatus: "", |
| | | auditStatus: "", |
| | | orderType: "0", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderType", |
| | | title: "æ£éªåç±»å", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "checkTypeEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "receiveOrderNo", |
| | | title: "æ¶è´§åå·", |
| | | type: "string", |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | *Authorï¼jxx |
| | | *Contactï¼283591387@qq.com |
| | | *代ç ç±æ¡æ¶çæ,任使´æ¹é½å¯è½å¯¼è´è¢«ä»£ç çæå¨è¦ç |
| | | *ä¸å¡è¯·å¨@/extension/widesea_wcs/order/Dt_CheckOrder.jsæ¤å¤ç¼å |
| | | --> |
| | | <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/check/inspectOrder.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "checkOrderId", |
| | | footer: "Foots", |
| | | cnName: "鿣å", |
| | | name: "checkOrder", |
| | | url: "/CheckOrder/", |
| | | sortName: "checkOrderId", |
| | | }); |
| | | const editFormFields = ref({}); |
| | | const editFormOptions = ref([]); |
| | | const searchFormFields = ref({ |
| | | checkOrderNo: "", |
| | | receiveOrderNo: "", |
| | | checkOrderStatus: "", |
| | | auditStatus: "", |
| | | orderType: "1", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "æ£éªåå·", field: "checkOrderNo", type: "like" }, |
| | | { title: "鿣åå·", field: "receiveOrderNo", type: "like" }, |
| | | { |
| | | title: "è´¨æ£åç¶æ", |
| | | field: "checkOrderStatus", |
| | | type: "select", |
| | | dataKey: "checkOrderStatusEnum", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { title: "ç©æç¼å·", field: "materielCode", type: "like" }, |
| | | { title: "ç©ææ¹æ¬¡", field: "lotNo", type: "like" }, |
| | | { |
| | | title: "æ£éªç»æ", |
| | | field: "result", |
| | | type: "select", |
| | | dataKey: "inspectAcceptEnum", |
| | | data: [], |
| | | }, |
| | | ], |
| | | [ |
| | | { |
| | | title: "ä¸ä¼ ç¶æ", |
| | | field: "UploadStatus", |
| | | type: "select", |
| | | dataKey: "checkUploadEnum", |
| | | data: [], |
| | | }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "checkOrderId", |
| | | title: "主é®", |
| | | type: "int", |
| | | width: 150, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "checkOrderNo", |
| | | title: "æ£éªåå·", |
| | | type: "string", |
| | | width: 180, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "orderType", |
| | | title: "æ£éªåç±»å", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "checkTypeEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "receiveOrderNo", |
| | | title: "鿣åå·", |
| | | type: "string", |
| | | width: 180, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseId", |
| | | title: "ä»åº", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | bind: { key: "warehouses", data: [] }, |
| | | }, |
| | | // {field:'auditStatus',title:'审æ¹ç¶æ',type:'int',width:110,require:true,align:'left'}, |
| | | { |
| | | field: "receiveDetailRowNo", |
| | | title: "鿣æç»è¡", |
| | | type: "int", |
| | | width: 100, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielCode", |
| | | title: "ç©æç¼å·", |
| | | type: "string", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "materielSpec", |
| | | title: "ç©æè§æ ¼", |
| | | type: "select", |
| | | type: "string", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "lotNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "string", |
| | | width: 150, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "checkOrderStatus", |
| | | title: "è´¨æ£åç¶æ", |
| | | type: "string", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | bind: { key: "checkOrderStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "qualifiedQuantity", |
| | | title: "åæ ¼æ°é", |
| | | type: "float", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "returnQuantity", |
| | | title: "éè´§æ°é", |
| | | type: "float", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "receivedQuantity", |
| | | title: "æ£éªæ»æ°", |
| | | type: "float", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "unit", |
| | | title: "åä½", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "result", |
| | | title: "æ£éªå¤æ", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | bind: { key: "inspectAcceptEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "uploadStatus", |
| | | title: "ä¸ä¼ ç¶æ", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | bind: { key: "checkUploadEnum", data: [] }, |
| | | }, |
| | | // {field:'defectedNote',title:'ç¹é说æ',type:'string',width:110,align:'left'}, |
| | | { |
| | | field: "checkUserName", |
| | | title: "æ£éªäºº", |
| | | type: "string", |
| | | width: 110, |
| | | align: "left", |
| | | }, |
| | | // { |
| | | // field: "creater", |
| | | // title: "å建è
", |
| | | // type: "string", |
| | | // width: 110, |
| | | // require: true, |
| | | // align: "left", |
| | | // }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 180, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | // {field:'modifier',title:'ä¿®æ¹äºº',type:'string',width:100,align:'left'}, |
| | | // {field:'modifyDate',title:'ä¿®æ¹æ¥æ',type:'datetime',width:150,align:'left',sort:true} |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "æ£éªç»æ", |
| | | table: "CheckOrderResult", |
| | | columns: [ |
| | | { |
| | | field: "id", |
| | | title: "主é®", |
| | | type: "int", |
| | | width: 110, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "checkOrderId", |
| | | title: "æ£éªå主é®", |
| | | type: "int", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "defectCode", |
| | | title: "缺é·ä»£ç ", |
| | | type: "string", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "result", |
| | | title: "æ£éªç»æ", |
| | | type: "string", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "quantity", |
| | | title: "æ°é", |
| | | type: "float", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "note", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 220, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建è
", |
| | | type: "string", |
| | | width: 110, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 150, |
| | | require: true, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | { |
| | | field: "modifier", |
| | | title: "ä¿®æ¹äºº", |
| | | type: "string", |
| | | width: 100, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "modifyDate", |
| | | title: "ä¿®æ¹æ¥æ", |
| | | type: "datetime", |
| | | width: 150, |
| | | align: "left", |
| | | sort: true, |
| | | }, |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | |
| | | <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/outbound/erpProScrapSheet.js"; |
| | | import { ref, defineComponent } from "vue"; |
| | | export default defineComponent({ |
| | | setup() { |
| | | const table = ref({ |
| | | key: "id", |
| | | footer: "Foots", |
| | | cnName: "æåè¶
ææ¥åºå", |
| | | name: "erpProScrapSheet", |
| | | url: "/erpProScrapSheet/", |
| | | sortName: "id", |
| | | }); |
| | | const editFormFields = ref({ |
| | | warehouseId:"", |
| | | proScrapSheetOrderNo:"" |
| | | }); |
| | | const editFormOptions = ref([ |
| | | [ |
| | | { |
| | | title: "æå±ä»åº", |
| | | required: true, |
| | | field: "warehouseId", |
| | | type: "select", |
| | | dataKey: "warehouses", |
| | | data: [], |
| | | }, |
| | | { |
| | | field: "proScrapSheetOrderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | readonly: "true", |
| | | }, |
| | | ], |
| | | ]); |
| | | const searchFormFields = ref({ |
| | | proScrapSheetOrderNo: "", |
| | | }); |
| | | const searchFormOptions = ref([ |
| | | [ |
| | | { title: "åæ®ç¼å·", field: "proScrapSheetOrderNo", type:"like" }, |
| | | { |
| | | title: "æ¥åºç¶æ", field: "proScrapStatus", type: "select", |
| | | dataKey: "outboundStatusEnum", |
| | | data: [] |
| | | }, |
| | | ], |
| | | ]); |
| | | const columns = ref([ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "warehouseId", |
| | | title: "æå±ä»åº", |
| | | type: "string", |
| | | width: 80, |
| | | align: "left", |
| | | bind: { key: "warehouses", data: [] }, |
| | | }, |
| | | { |
| | | field: "proScrapSheetOrderNo", |
| | | title: "åæ®ç¼å·", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | link: true, |
| | | }, |
| | | { |
| | | field: "proScrapStatus", |
| | | title: "æ¥åºç¶æ", |
| | | type: "string", |
| | | width: 150, |
| | | align: "left", |
| | | bind: { key: "proScrapStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "creater", |
| | | title: "å建人", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "createDate", |
| | | title: "å建æ¶é´", |
| | | type: "datetime", |
| | | width: 160, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | } |
| | | // { |
| | | // field: "OrderStatus", |
| | | // title: "åæ®æ°é", |
| | | // type: "string", |
| | | // width: 90, |
| | | // align: "left", |
| | | // bind: { key: "orderDetailStatusEnum", data: [] } |
| | | // }, |
| | | ]); |
| | | const detail = ref({ |
| | | cnName: "æåæ¥åºåæç»", |
| | | table: "erpProScrapSheetDetail", |
| | | columns: [ |
| | | { |
| | | field: "id", |
| | | title: "Id", |
| | | type: "int", |
| | | width: 90, |
| | | hidden: true, |
| | | readonly: true, |
| | | require: true, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "proScrapSheetId", |
| | | title: "æåæ¥åºå主é®", |
| | | type: "string", |
| | | width: 90, |
| | | align: "left", |
| | | hidden: true, |
| | | }, |
| | | { |
| | | field: "scrapProCode", |
| | | title: "产åç¼ç ", |
| | | type: "string", |
| | | width: 180, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "scrapProVersion", |
| | | title: "æ¥åºçæ¬", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "scrapProLotNo", |
| | | title: "æ¹æ¬¡å·", |
| | | type: "decimal", |
| | | width: 130, |
| | | align: "left", |
| | | edit: { type: "string" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "scrapSETQty", |
| | | title: "æ¥åºSETæ°é", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "scrapPcsQty", |
| | | title: "æ¥åºPCSæ°", |
| | | type: "string", |
| | | width: 120, |
| | | align: "left", |
| | | edit: { type: "number" }, |
| | | required: true, |
| | | }, |
| | | { |
| | | field: "xSetQty", |
| | | title: "XSetæ°", |
| | | type: "int", |
| | | width: 120, |
| | | hidden: true, |
| | | // edit: { type: "number",keep: false }, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "xPcsQty", |
| | | title: "XPcsæ°", |
| | | type: "string", |
| | | width: 120, |
| | | hidden: true, |
| | | // edit: { type: "number",keep: false }, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "overScrapSETQty", |
| | | title: "å·²æ¥åºSETæ°", |
| | | type: "int", |
| | | width: 120, |
| | | hidden: true, |
| | | // edit: { type: "number",keep: false }, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "overScrapPcsQty", |
| | | title: "å·²æ¥åºPCSæ°", |
| | | type: "string", |
| | | width: 120, |
| | | hidden: true, |
| | | // edit: { type: "number",keep: false }, |
| | | align: "left", |
| | | }, |
| | | { |
| | | field: "scrapProDetailStatus", |
| | | title: "订åæç»ç¶æ", |
| | | type: "string", |
| | | width: 130, |
| | | align: "left", |
| | | hidden: true, |
| | | // edit: { type: "number",}, |
| | | bind: { key: "orderDetailStatusEnum", data: [] }, |
| | | }, |
| | | { |
| | | field: "remark", |
| | | title: "夿³¨", |
| | | type: "string", |
| | | width: 120, |
| | | edit: { type: "text",}, |
| | | align: "left", |
| | | }, |
| | | ], |
| | | sortName: "id", |
| | | key: "id", |
| | | }); |
| | | return { |
| | | table, |
| | | extend, |
| | | editFormFields, |
| | | editFormOptions, |
| | | searchFormFields, |
| | | searchFormOptions, |
| | | columns, |
| | | detail, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | |
| | |
| | | List<string> lockLocationCodes = locationCaches_CSJ.Select(x => x.LocationCode).ToList(); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | //è·åææçè´§ä½ |
| | | List<Dt_LocationInfo> locationInfoDepth = Repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | if (locationInfos == null || locationInfos.Count == 0) |
| | | { |
| | | throw new Exception($"æªæ¾å°è¯¥å··éçè´§ä½ä¿¡æ¯,å··éå·:{roadwayNo}"); |
| | |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, undefinedTypeEmptyLocation, palletType); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth)) |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row < locationInfoDepth.Max(x => x.Depth)) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount==2 ? (locationInfo.Row - 2): (locationInfo.Row - 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount == 2 ? (locationInfo.Row + 2) : (locationInfo.Row + 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row % locationInfoDepth.Max(x => x.Depth)==0) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount == 2 ? (locationInfo.Row - 2) : (locationInfo.Row - 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount == 2 ? (locationInfo.Row + 2) : (locationInfo.Row + 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (locationInfoExist.LocationStatus != LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | | return locationInfo; |
| | | } |
| | |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_CSJ(locationInfos, definedTypeEmptyLocation, palletType); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth)) |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row < locationInfoDepth.Max(x => x.Depth)) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount == 2 ? (locationInfo.Row - 2) : (locationInfo.Row - 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount == 2 ? (locationInfo.Row + 2) : (locationInfo.Row + 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row % locationInfoDepth.Max(x => x.Depth) == 0) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount == 2 ? (locationInfo.Row - 2) : (locationInfo.Row - 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (palletTypeInfo.LocaitonCount == 2 ? (locationInfo.Row + 2) : (locationInfo.Row + 1)) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (locationInfoExist.LocationStatus != LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | locationCaches_CSJ.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | | return locationInfo; |
| | | } |
| | |
| | | List<string> lockLocationCodes = locationCaches_GM.Select(x => x.LocationCode).ToList(); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | //è·åææäºæ·±ä½è´§ä½æ°æ® |
| | | List<Dt_LocationInfo> locationInfoDepth = Repository.QueryData(x => x.RoadwayNo == roadwayNo && x.Depth== locationInfos.Max(v=>v.Depth)); |
| | | //è·åææè´§ä½æ°æ® |
| | | List<Dt_LocationInfo> locationInfoDepth = Repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | if (locationInfos == null || locationInfos.Count == 0) |
| | | { |
| | | throw new Exception($"æªæ¾å°è¯¥å··éçè´§ä½ä¿¡æ¯,å··éå·:{roadwayNo}"); |
| | |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, definedTypeEmptyLocation, palletType, palletTypeInfo); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.Depth<locationInfoDepth.Max(x=>x.Depth) && palletTypeInfo.LocaitonCount<2) |
| | | if (locationInfo.Depth<locationInfoDepth.Max(x=>x.Depth)) |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | |
| | | } |
| | | if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row-1) && x.Column== Column && x.Layer==locationInfo.Layer && x.LocationStatus==LocationStatusEnum.InStock.ObjToInt()); |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row-1) && x.Column== Column && x.Layer==locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()); |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist==null) |
| | |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth == null) |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (palletTypeInfoDepth.LocaitonCount==2 && palletTypeInfo.LocaitonCount==1) |
| | | } |
| | | else |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (Column % 2 == 0) |
| | | { |
| | | Column -= 1; |
| | | } |
| | | if (locationInfo.Row % 2 == 0) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (locationInfoExist.LocationStatus!=LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus!= EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_GM(locationInfos, undefinedTypeEmptyLocation, palletType, palletTypeInfo); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth) && palletTypeInfo.LocaitonCount < 2) |
| | | if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth)) |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | |
| | | } |
| | | if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()); |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer && x.LocationStatus == LocationStatusEnum.InStock.ObjToInt()); |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth == null) |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (palletTypeInfoDepth.LocaitonCount == 2) |
| | | } |
| | | else |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (Column % 2 == 0) |
| | | { |
| | | Column -= 1; |
| | | } |
| | | if (locationInfo.Row % 2 == 0) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (locationInfoExist.LocationStatus != LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | List<string> lockLocationCodes = locationCaches_ZH.Select(x => x.LocationCode).ToList(); |
| | | |
| | | List<Dt_LocationInfo> locationInfos = Repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | //è·åææè´§ä½æ°æ® |
| | | List<Dt_LocationInfo> locationInfoDepth = Repository.QueryData(x => x.RoadwayNo == roadwayNo); |
| | | if (locationInfos == null || locationInfos.Count == 0) |
| | | { |
| | | throw new Exception($"æªæ¾å°è¯¥å··éçè´§ä½ä¿¡æ¯,å··éå·:{roadwayNo}"); |
| | |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_ZH(locationInfos, undefinedTypeEmptyLocation, palletType); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth)) |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row % 2 == 0) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (locationInfoExist.LocationStatus != LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | locationCaches_ZH.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | | return locationInfo; |
| | | } |
| | |
| | | Dt_LocationInfo? locationInfo = GetUsableLocation_ZH(locationInfos, definedTypeEmptyLocation, palletType); |
| | | if (locationInfo != null) |
| | | { |
| | | if (locationInfo.Depth < locationInfoDepth.Max(x => x.Depth)) |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row - locationInfo.Depth == locationInfo.Depth) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | } |
| | | else |
| | | { |
| | | Dt_LocationInfo? locationInfoExist = null; |
| | | int Column = locationInfo.Column; |
| | | if (locationInfo.Row % 2 == 0) |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row - 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | else |
| | | { |
| | | locationInfoExist = locationInfoDepth.FirstOrDefault(x => x.Row == (locationInfo.Row + 1) && x.Column == Column && x.Layer == locationInfo.Layer); |
| | | } |
| | | //è·åæ·±ä½è´§ä½ç±»å |
| | | if (locationInfoExist == null) |
| | | { |
| | | continue; |
| | | } |
| | | Dt_PalletTypeInfo palletTypeInfoDepth = _basicRepository.PalletTypeInfoRepository.QueryFirst(x => x.WarehouseId == locationInfoExist.WarehouseId && x.PalletType == locationInfoExist.LocationType); |
| | | if (palletTypeInfoDepth != null && palletTypeInfoDepth.LocaitonCount != palletTypeInfo.LocaitonCount) |
| | | { |
| | | continue; |
| | | } |
| | | if (locationInfoExist.LocationStatus != LocationStatusEnum.Free.ObjToInt() || locationInfoExist.EnableStatus != EnableStatusEnum.Normal.ObjToInt()) |
| | | { |
| | | continue; |
| | | } |
| | | } |
| | | locationCaches_ZH.Add(new LocationCache { LocationCode = locationInfo.LocationCode, DateTime = DateTime.Now }); |
| | | return locationInfo; |
| | | } |
| | |
| | | Dt_LocationInfo? nearLocation; |
| | | if (palletTypeInfo.IsOdd) |
| | | { |
| | | nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); |
| | | if (warehouse.WarehouseCode==WarehouseEnum.HA154.ToString()) |
| | | { |
| | | nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column - 1); |
| | | } |
| | | else |
| | | { |
| | | nearLocation = locationInfos.FirstOrDefault(x => x.Row == location.Row && x.Layer == location.Layer && x.Depth == location.Depth && x.Column == location.Column + 1); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IApprovalRepository; |
| | | using WIDESEA_ICheckRepository; |
| | | using WIDESEA_ICheckService; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IStockRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_CheckService |
| | |
| | | private readonly ICheckOrderService _checkOrderService; |
| | | private readonly IPurchaseOrderRepository _purchaseOrderRepository; |
| | | private readonly IPurchaseOrderDetailRepository _purchaseOrderDetailRepository; |
| | | public CheckOrderResultService(ICheckOrderResultRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, ICheckOrderRepository checkOrderRepository, IReceiveOrderRepository receiveOrderRepository, ICheckOrderService checkOrderService, IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderDetailRepository purchaseOrderDetailRepository) : base(BaseDal) |
| | | private readonly IOutboundRepository _outboundRepository; |
| | | private readonly IStockRepository _stockRepository; |
| | | public CheckOrderResultService(ICheckOrderResultRepository BaseDal, IUnitOfWorkManage unitOfWorkManage, ICheckOrderRepository checkOrderRepository, IReceiveOrderRepository receiveOrderRepository, ICheckOrderService checkOrderService, IPurchaseOrderRepository purchaseOrderRepository, IPurchaseOrderDetailRepository purchaseOrderDetailRepository, IOutboundRepository outboundRepository, IStockRepository stockRepository) : base(BaseDal) |
| | | { |
| | | _checkOrderRepository = checkOrderRepository; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _checkOrderService = checkOrderService; |
| | | _purchaseOrderRepository = purchaseOrderRepository; |
| | | _purchaseOrderDetailRepository = purchaseOrderDetailRepository; |
| | | _outboundRepository = outboundRepository; |
| | | _stockRepository = stockRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// æäº¤éæ£ç¡®è®¤ç»æ |
| | | /// </summary> |
| | | /// <param name="checkOrderId"></param> |
| | | /// <param name="checkResult"></param> |
| | | /// <param name="IsAccept"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent CommitInspectResult(int checkOrderId, Dt_CheckOrderResult checkResult, int IsAccept = 0) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | Dt_CheckOrder checkOrder = _checkOrderRepository.QueryFirst(x => x.CheckOrderId == checkOrderId); |
| | | //è·åè´¨æ£å对åºçæ¶è´§å |
| | | if (checkOrder == null) |
| | | { |
| | | return content.Error($"æªæ¾å°è¯¥è´¨æ£å"); |
| | | } |
| | | Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x => x.OrderNo == checkOrder.ReceiveOrderNo).Includes(x => x.Details).First(); |
| | | if (outboundOrder.OrderStatus != OutOrderStatusEnum.åºåºå®æ.ObjToInt()) |
| | | { |
| | | return content.Error($"{outboundOrder.OrderNo}鿣ååºåºæªå®ææ æ³è´¨æ£"); |
| | | } |
| | | if (checkOrder.CheckOrderStatus == CheckOrderStatusEnum.Checked.ObjToInt()) |
| | | { |
| | | return content.Error($"è¯¥åæ®å·²ç»æ£éªå®æ"); |
| | | } |
| | | Dt_CheckOrderResult? checkOrderResult = null; |
| | | //è·ååºå |
| | | Dt_OutStockLockInfo outStockLockInfo = _outboundRepository.OutboundStockLockInfoRepository.QueryFirst(x => x.Id == checkOrder.ReceiveDetailRowNo) ?? throw new Exception("æªæ¾å°éæ£å详æ
"); |
| | | Dt_StockInfo? stockInfo = _stockRepository.StockInfoRepository.Db.Queryable<Dt_StockInfo>() |
| | | .Where(x => x.PalletCode == outStockLockInfo.PalletCode && x.StockStatus == StockStatusEmun.鿣宿.ObjToInt()).Includes(x => x.Details).First() ?? throw new Exception("æªæ¾å°éæ£å对åºåºåæ°æ®"); |
| | | List<Dt_StockInfoDetail> stockInfoDetails = new List<Dt_StockInfoDetail>(); |
| | | List<Dt_StockInfoDetail> DelStockDetails =new List<Dt_StockInfoDetail>(); |
| | | if (checkResult.CheckOrderId != 0) |
| | | { |
| | | if (checkResult.Quantity < 0 || checkResult.Quantity > checkOrder.ReceivedQuantity) |
| | | { |
| | | return content.Error($"æ°éè¶
åº"); |
| | | } |
| | | if (checkResult.Result == InspectResultEnum.Return.ToString())//éè´§ |
| | | { |
| | | checkOrder.DefectedNote = checkResult.Note; |
| | | checkOrder.ReturnQuantity += checkResult.Quantity; |
| | | } |
| | | else if(checkResult.Result == InspectResultEnum.Defect.ToString()) |
| | | { |
| | | checkOrder.DefectedNote = checkResult.Note; |
| | | checkOrder.DefectedQuantity += checkResult.Quantity; |
| | | } |
| | | else if (checkResult.Result == InspectResultEnum.Scrapped.ToString()) |
| | | { |
| | | checkOrder.DefectedNote = checkResult.Note; |
| | | checkOrder.ScrappedQuantity += checkResult.Quantity; |
| | | } |
| | | else |
| | | { |
| | | return content.Error($"æªæ¾å°ç¼ºé·ç±»å"); |
| | | } |
| | | checkOrderResult = new Dt_CheckOrderResult() |
| | | { |
| | | Quantity = checkResult.Quantity, |
| | | CheckOrderId = checkOrderId, |
| | | DefectCode = checkResult.DefectCode, |
| | | Result = checkResult.Result, |
| | | Note = checkResult.Note, |
| | | SampleCount = checkResult.SampleCount, |
| | | }; |
| | | if (Math.Round(checkResult.Quantity,2) == Math.Round(stockInfoDetails.Sum(x=>x.StockQuantity),2)) |
| | | { |
| | | DelStockDetails = stockInfo.Details; |
| | | } |
| | | else |
| | | { |
| | | foreach (var item in stockInfo.Details) |
| | | { |
| | | if (checkResult.Quantity == 0) |
| | | { |
| | | break; |
| | | } |
| | | else if(checkResult.Quantity< item.StockQuantity) |
| | | { |
| | | checkResult.Quantity = 0; |
| | | item.StockQuantity -= checkResult.Quantity; |
| | | stockInfoDetails.Add(item); |
| | | } |
| | | else if (checkResult.Quantity >= item.StockQuantity) |
| | | { |
| | | checkResult.Quantity = (float)Math.Round((checkResult.Quantity-item.StockQuantity), 2); |
| | | DelStockDetails.Add(item); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | if (IsAccept == InspectAcceptEnum.Accept.ObjToInt()) |
| | | { |
| | | checkOrder.Result = InspectAcceptEnum.Accept.ToString(); |
| | | } |
| | | else if (IsAccept == InspectAcceptEnum.UnAccept.ObjToInt()) |
| | | { |
| | | checkOrder.Result = InspectAcceptEnum.UnAccept.ToString(); |
| | | } |
| | | else if (IsAccept == InspectAcceptEnum.DefectAccept.ObjToInt()) |
| | | { |
| | | checkOrder.Result = InspectAcceptEnum.DefectAccept.ToString(); |
| | | } |
| | | else |
| | | { |
| | | return content.Error("æªæ¾å°æ£éªç±»å"); |
| | | } |
| | | checkOrder.CheckOrderStatus = CheckOrderStatusEnum.Checked.ObjToInt(); |
| | | if (checkOrderResult != null) |
| | | { |
| | | checkOrder.QualifiedQuantity = checkOrder.ReceivedQuantity - checkOrderResult.Quantity; |
| | | } |
| | | else |
| | | { |
| | | checkOrder.QualifiedQuantity = checkOrder.ReceivedQuantity; |
| | | } |
| | | checkOrder.CheckUserName = App.User.UserName; |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | if (checkOrderResult != null) |
| | | { |
| | | BaseDal.AddData(checkOrderResult); |
| | | } |
| | | //æ¸
é¤åºåæ°é |
| | | if (stockInfoDetails.Count>0) |
| | | { |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfoDetails); |
| | | } |
| | | if (DelStockDetails.Count>0) |
| | | { |
| | | _stockRepository.StockInfoDetailRepository.DeleteAndMoveIntoHty(DelStockDetails, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | } |
| | | if (DelStockDetails.Count==stockInfo.Details.Count) |
| | | { |
| | | _stockRepository.StockInfoRepository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | } |
| | | //ERP䏿¥ |
| | | WebResponseContent responseContent = _checkOrderService.FeedbackInspectResult(checkOrder, checkOrderResult != null ? new List<Dt_CheckOrderResult> { checkOrderResult } : new List<Dt_CheckOrderResult>()); |
| | | if (!responseContent.Status) |
| | | { |
| | | throw new Exception(responseContent.Message); |
| | | } |
| | | checkOrder.UploadStatus = CheckUploadEnum.UploadOk.ObjToInt(); |
| | | _checkOrderRepository.UpdateData(checkOrder); |
| | | _unitOfWorkManage.CommitTran(); |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return content.Error($"{ex.Message}"); |
| | | } |
| | | return content; |
| | | } |
| | | /// <summary> |
| | | /// è·åæ£éªä¿¡æ¯ |
| | | /// </summary> |
| | | public WebResponseContent GetCheckResultInfo(int checkId) |
| | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 鿣éªå®æ¨éERP |
| | | /// </summary> |
| | | /// <param name="checkOrder"></param> |
| | | /// <param name="checkOrderResults"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent FeedbackInspectResult(Dt_CheckOrder checkOrder, List<Dt_CheckOrderResult> checkOrderResults) |
| | | { |
| | | try |
| | | { |
| | | //å¢å 个ä¸ä¼ ç¶æ è´¨æ£åç»æ |
| | | List<ERPCheckResult> checkResults = new List<ERPCheckResult>(); |
| | | foreach (var item in checkOrderResults) |
| | | { |
| | | ERPCheckResult checkResult = new ERPCheckResult() |
| | | { |
| | | DefectCode = item.DefectCode, |
| | | Note = item.Note, |
| | | Quantity = item.Quantity.ToString(), |
| | | Result = item.Result |
| | | }; |
| | | checkResults.Add(checkResult); |
| | | } |
| | | ERPInspectModel model = new ERPInspectModel() |
| | | { |
| | | Code = checkOrder.CheckOrderNo, |
| | | CompanyId = "HATC", |
| | | Result = checkOrder.Result, |
| | | CreatorCode = checkOrder.CheckUserName, |
| | | DefectedNote = checkOrder.DefectedNote, |
| | | MaterialsCode = checkOrder.MaterielCode, |
| | | PlantsId = "HA02", |
| | | QtyDefected = checkOrder.DefectedQuantity.GetValueOrDefault().ToString(), |
| | | QtyInspected = checkOrder.ReceivedQuantity.ToString(), |
| | | QtyQualified = checkOrder.QualifiedQuantity.GetValueOrDefault().ToString(), |
| | | QtyReturn = checkOrder.ReturnQuantity.GetValueOrDefault().ToString(), |
| | | QtyScrapped = checkOrder.ScrappedQuantity.GetValueOrDefault().ToString(), |
| | | Recheckcode = checkOrder.ReceiveOrderNo, |
| | | ReceiveDate = checkOrder.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | TestDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), |
| | | UniqueTag = checkOrder.CheckOrderId.ToString(), |
| | | Way = 1, |
| | | Details = checkResults |
| | | }; |
| | | |
| | | string response = _invokeERPService.InvokeInspectApi(model); |
| | | ErpRequestContent requestContent = response.DeserializeObject<ErpRequestContent>(); |
| | | if (requestContent.res != 1) |
| | | { |
| | | return WebResponseContent.Instance.Error(requestContent.Data); |
| | | } |
| | | return WebResponseContent.Instance.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return WebResponseContent.Instance.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// è´¨æ£å®ä¸æ¥è³ERP |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | |
| | | <ProjectReference Include="..\WIDESEA_IApprovalRepository\WIDESEA_IApprovalRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ICheckService\WIDESEA_ICheckService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IInboundRepository\WIDESEA_IInboundRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IOutboundRepository\WIDESEA_IOutboundRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ISystemRepository\WIDESEA_ISystemRepository.csproj" /> |
| | | </ItemGroup> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.CommonEnum |
| | | { |
| | | public enum CheckTypeEnum |
| | | { |
| | | /// <summary> |
| | | /// æ¥ææ£éªå |
| | | /// </summary> |
| | | [Description("æ¥ææ£éªå")] |
| | | ReceiveCheck = 0, |
| | | |
| | | /// <summary> |
| | | /// 鿣æ£éªå |
| | | /// </summary> |
| | | [Description("鿣æ£éªå")] |
| | | InspectCheck = 1, |
| | | } |
| | | } |
| | |
| | | [Description("䏿¥å")] |
| | | UnAccept=2, |
| | | } |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public enum InspectAcceptEnum |
| | | { |
| | | /// <summary> |
| | | /// å¾
æ£ç¡®è®¤ |
| | | /// </summary> |
| | | [Description("å¾
æ£ç¡®è®¤")] |
| | | NotCheckAccept = 0, |
| | | /// <summary> |
| | | /// æ¥å |
| | | /// </summary> |
| | | [Description("æ¥å")] |
| | | Accept = 1, |
| | | |
| | | /// <summary> |
| | | /// 䏿¥å |
| | | /// </summary> |
| | | [Description("䏿¥å")] |
| | | UnAccept = 2, |
| | | /// <summary> |
| | | /// ç¹éæ¥å |
| | | /// </summary> |
| | | [Description("ç¹éæ¥å")] |
| | | DefectAccept = 3 |
| | | } |
| | | public enum CheckResultEnum |
| | | { |
| | | /// <summary> |
| | |
| | | //[Description("æ¥åº")] |
| | | //Scrapped |
| | | } |
| | | public enum InspectResultEnum |
| | | { |
| | | /// <summary> |
| | | /// éè´§ |
| | | /// </summary> |
| | | [Description("éè´§")] |
| | | Return, |
| | | |
| | | /// <summary> |
| | | /// ç¹é |
| | | /// </summary> |
| | | [Description("ç¹é")] |
| | | Defect, |
| | | |
| | | /// <summary> |
| | | /// æ¥åº |
| | | /// </summary> |
| | | [Description("æ¥åº")] |
| | | Scrapped |
| | | } |
| | | /// <summary> |
| | | /// æ£éªä¸ä¼ ç¶æ |
| | | /// </summary> |
| | |
| | | /// 客ä¾åæ¶ |
| | | /// </summary> |
| | | [Description("客ä¾åæ¶")] |
| | | CustomerRecovery=135 |
| | | CustomerRecovery=135, |
| | | /// <summary> |
| | | /// 鿣å
¥åºå |
| | | /// </summary> |
| | | [Description("鿣å
¥åºå")] |
| | | Inspect = 140, |
| | | } |
| | | /// <summary> |
| | | /// æåå
¥åºåæ®ç±»å |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_Common.OrderEnum |
| | | { |
| | | public enum ProScrapSheetStatusEnum |
| | | { |
| | | /// <summary> |
| | | /// å¾
æ ¸å |
| | | /// </summary> |
| | | [Description("å¾
æ ¸å")] |
| | | TOChecked, |
| | | /// <summary> |
| | | /// å·²æ ¸å |
| | | /// </summary> |
| | | [Description("å·²æ ¸å")] |
| | | Valid |
| | | ///// <summary> |
| | | ///// ç¹é |
| | | ///// </summary> |
| | | //[Description("ç¹é")] |
| | | //Defect, |
| | | |
| | | ///// <summary> |
| | | ///// æ¥åº |
| | | ///// </summary> |
| | | //[Description("æ¥åº")] |
| | | //Scrapped |
| | | } |
| | | } |
| | |
| | | [Description("å¹³åºå¾
åè´§")] |
| | | å¹³åºå¾
åè´§ = 16, |
| | | |
| | | [Description("鿣宿")] |
| | | 鿣宿 = 18, |
| | | |
| | | [Description("éåº")] |
| | | MESéåº = 21, |
| | | |
| | |
| | | /// æååºåºåå·ç¼ç è§å |
| | | /// </summary> |
| | | [Description("æååºåºåå·ç¼ç è§å")] |
| | | ProOutCOdeRule |
| | | ProOutCOdeRule, |
| | | /// <summary> |
| | | /// æåæ¥åºåå·ç¼ç è§å |
| | | /// </summary> |
| | | [Description("æåæ¥åºåå·ç¼ç è§å")] |
| | | ProScrapSheetRule |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ERPç©æéæ£æ¥å£è°ç¨ |
| | | /// </summary> |
| | | public string InvokeInspectApi(ERPInspectModel eRPInspectModel) |
| | | { |
| | | Dt_ApiInfo apiInfo = _apiInfoRepository.QueryFirst(x => x.ApiCode == APIEnum.InvokeErpApi.ToString()); |
| | | ERPBaseModel<ERPInspectModel> model = new ERPBaseModel<ERPInspectModel>() |
| | | { |
| | | Data = eRPInspectModel, |
| | | Desc = "ç©æåºä»æ£éªå", |
| | | Type = "toTCWMSOUTTest", |
| | | SecurityCode = "TeChuang" |
| | | }; |
| | | string request = JsonConvert.SerializeObject(model, settings); |
| | | |
| | | string response = HttpHelper.Post(apiInfo.ApiAddress, request); |
| | | return response; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ERPç©æå
¥åºåæ¥å£è°ç¨ |
| | | /// </summary> |
| | | /// <param name="inboundModel"></param> |
| | |
| | | /// <param name="checkModel"></param> |
| | | /// <returns></returns> |
| | | string InvokeCheckOrderApi(ERPCheckModel checkModel); |
| | | /// <summary> |
| | | /// ERPç©æéæ£æ¥å£è°ç¨ |
| | | /// </summary> |
| | | string InvokeInspectApi(ERPInspectModel eRPInspectModel); |
| | | |
| | | /// <summary> |
| | | /// ERPç©æå
¥åºåæ¥å£è°ç¨ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace WIDESEA_External.Model |
| | | { |
| | | /// <summary> |
| | | /// è´¨æ£ååä¼ ERP |
| | | /// </summary> |
| | | public class ERPInspectModel |
| | | { |
| | | /// <summary> |
| | | /// æä½ç±»å |
| | | /// </summary> |
| | | public int Way { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 主é®å¼ |
| | | /// </summary> |
| | | public string UniqueTag { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£éªåå· |
| | | /// </summary> |
| | | public string Code { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å
¬å¸ä»£å· |
| | | /// </summary> |
| | | public string CompanyId { get; set; } = "HATC"; |
| | | |
| | | /// <summary> |
| | | /// å·¥åä»£å· |
| | | /// </summary> |
| | | public string PlantsId { get; set; } = "HA02"; |
| | | |
| | | /// <summary> |
| | | /// 鿣åå· |
| | | /// </summary> |
| | | public string Recheckcode { get; set; } |
| | | /// <summary> |
| | | /// ç©æä»£ç |
| | | /// </summary> |
| | | public string MaterialsCode { get; set; } |
| | | /// <summary> |
| | | /// æ¶è´§æ¥æ |
| | | /// </summary> |
| | | public string ReceiveDate { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | public string Note { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ ¼æ°é |
| | | /// </summary> |
| | | public string QtyQualified { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¹éæ°é |
| | | /// </summary> |
| | | public string QtyDefected { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´§æ°é |
| | | /// </summary> |
| | | public string QtyReturn { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºæ°é |
| | | /// </summary> |
| | | public string QtyScrapped { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£éªæ»æ°ï¼éæ£æ°éï¼ |
| | | /// </summary> |
| | | public string QtyInspected { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£éªå¤æç»æ |
| | | /// </summary> |
| | | public string Result { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ç¹é说æ |
| | | /// </summary> |
| | | public string DefectedNote { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åå»ºäººä»£å· |
| | | /// </summary> |
| | | public string CreatorCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£éªæ¥æ |
| | | /// </summary> |
| | | public string TestDate { get; set; } |
| | | |
| | | public List<ERPCheckResult> Details { get; set; } |
| | | } |
| | | } |
| | |
| | | /// <param name="IsAccept">æ¯å¦æ¥å</param> |
| | | /// <returns></returns> |
| | | WebResponseContent CommitCheckResult(int checkOrderId, Dt_CheckOrderResult checkResult, int IsAccept = 0); |
| | | WebResponseContent CommitInspectResult(int checkOrderId, Dt_CheckOrderResult checkResult, int IsAccept = 0); |
| | | /// <summary> |
| | | /// è·åæ£éªä¿¡æ¯ |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | WebResponseContent FeedbackCheckResult(int id); |
| | | WebResponseContent FeedbackCheckResult(Dt_CheckOrder checkOrder, List<Dt_CheckOrderResult> checkOrderResults); |
| | | WebResponseContent FeedbackInspectResult(Dt_CheckOrder checkOrder, List<Dt_CheckOrderResult> checkOrderResults); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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_IOutboundRepository |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public interface IErpProScrapSheetDetailRepository : IRepository<Dt_ErpProScrapSheetDetail> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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_IOutboundRepository |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public interface IErpProScrapSheetRepository : IRepository<Dt_ErpProScrapSheet> |
| | | { |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | | public interface IErpProScrapSheetDetailService : IService<Dt_ErpProScrapSheetDetail> |
| | | { |
| | | IErpProScrapSheetDetailRepository Repository { get; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.LocationEnum; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_IOutboundService |
| | | { |
| | | public interface IErpProScrapSheetService : IService<Dt_ErpProScrapSheet> |
| | | { |
| | | IErpProScrapSheetRepository Repository { get; } |
| | | } |
| | | } |
| | |
| | | /// <summary> |
| | | /// æ¥è¯¢ERPè®¢åæ£é¤åºåæ°é |
| | | /// </summary> |
| | | Task <WebResponseContent> OutProErpSync(string outProOrderNo); |
| | | WebResponseContent OutProErpSync(string outProOrderNo); |
| | | /// <summary> |
| | | /// åºåºåæ«ç 忥ERP |
| | | /// </summary> |
| | |
| | | if (materielInfo.IsCheck == WhetherEnum.True) |
| | | { |
| | | Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail); |
| | | checkOrder.OrderType = CheckTypeEnum.ReceiveCheck.ObjToInt(); |
| | | checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo; |
| | | checkOrder.QualifiedQuantity = receiveOrderDetail.ReceivedQuantity; |
| | | checkOrder.ReceiveDetailRowNo = receiveOrderDetail.RowNo; |
| | |
| | | if (materielInfo.IsCheck == WhetherEnum.True) |
| | | { |
| | | Dt_CheckOrder checkOrder = _mapper.Map<Dt_CheckOrder>(receiveOrderDetail); |
| | | checkOrder.OrderType = CheckTypeEnum.ReceiveCheck.ObjToInt(); |
| | | checkOrder.ReceiveOrderNo = receiveOrder.ReceiveOrderNo; |
| | | checkOrder.Result = CheckAcceptEnum.NotCheckAccept.ToString(); |
| | | checkOrder.QualifiedQuantity = 0; |
| | |
| | | public string CheckOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶è´§åå· |
| | | /// æ¶è´§åå·/鿣åºåºåå· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¶è´§åå·")] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¶è´§åå·/鿣åºåºåå·")] |
| | | public string ReceiveOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | public int AuditStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¶è´§åæç»è¡å· |
| | | /// æ¶è´§åæç»è¡å·/鿣åºåºè¯¦æ
è¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¶è´§åæç»è¡å·")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¶è´§åæç»è¡å·/鿣åºåºè¯¦æ
è¡å·")] |
| | | public int ReceiveDetailRowNo { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | [SugarColumn(IsNullable = false, Length = 20, ColumnDescription = "åä½")] |
| | | public string Unit { get; set; } |
| | | /// <summary> |
| | | /// æ£éªåç±»å |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "æ£éªåç±»å")] |
| | | public int OrderType { get; set; } |
| | | /// <summary> |
| | | /// è´¨æ£ç»æ |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_CheckOrderResult.CheckOrderId), nameof(CheckOrderId))] |
| | |
| | | public string Result { get; set; } |
| | | |
| | | /// <summary> |
| | | /// éè´§æ°é |
| | | /// æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ°é")] |
| | | public float Quantity { get; set; } |
| | | /// <summary> |
| | | /// æ½æ ·æ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ°é")] |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ½æ ·æ°é")] |
| | | public float SampleCount { get; set; } |
| | | /// <summary> |
| | | /// 夿³¨ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.CodeConfigEnum; |
| | | using WIDESEA_Core.DB.Models; |
| | | |
| | | namespace WIDESEA_Model.Models |
| | | { |
| | | /// <summary> |
| | | /// æåæ¥åºå |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_ErpProScrapSheet), "æåæ¥åºå")] |
| | | public class Dt_ErpProScrapSheet : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä»åºä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "ä»åºä¸»é®")] |
| | | public int WarehouseId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åæ®ç¼å· |
| | | /// </summary> |
| | | [CodeRule(RuleCodeEnum.ProScrapSheetRule)] |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "åæ®ç¼å·")] |
| | | public string ProScrapSheetOrderNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºç¶æ<br/> |
| | | /// å¾
æ ¸å<br/> |
| | | /// å·²æ ¸å<br/> |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¥åºç¶æ")] |
| | | public string ProScrapStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 200, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | | /// åºåºåæç» |
| | | /// </summary> |
| | | [Navigate(NavigateType.OneToMany, nameof(Dt_ErpProScrapSheetDetail.ProScrapSheetId), nameof(Id))] |
| | | public List<Dt_ErpProScrapSheetDetail> Details { 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 |
| | | { |
| | | /// <summary> |
| | | /// æåæ¥åºåæç» |
| | | /// </summary> |
| | | [SugarTable(nameof(Dt_ErpProScrapSheetDetail), "æåæ¥åºåæç»")] |
| | | public class Dt_ErpProScrapSheetDetail : BaseEntity |
| | | { |
| | | /// <summary> |
| | | /// ä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主é®")] |
| | | public int Id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æåæ¥åºåä¸»é® |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æåæ¥åºå主é®")] |
| | | public int ProScrapSheetId { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 产åç¼ç |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "产åç¼ç ")] |
| | | public string ScrapProCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºçæ¬ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "çæ¬")] |
| | | public string ScrapProVersion { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºæ¹æ¬¡å· |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¹æ¬¡å·")] |
| | | public string ScrapProLotNo { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºSETæ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¥åºSETæ°é")] |
| | | public int ScrapSETQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºPCSæ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "æ¥åºPCSæ°")] |
| | | public int ScrapPcsQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·²æ¥åºSETæ°é |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "已䏿¥åºSETæ°é")] |
| | | public int OverScrapSETQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å·²æ¥åºPCSæ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, ColumnDescription = "已䏿¥åºPCSæ°")] |
| | | public int OverScrapPcsQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// XSetæ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "XSetæ°")] |
| | | public int XSetQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// XPcsæ° |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, Length = 50, ColumnDescription = "XPCSæ°")] |
| | | public int XPcsQty { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ¥åºæç»ç¶æ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = false, Length = 50, ColumnDescription = "æ¥åºæç»ç¶æ")] |
| | | public int ScrapProDetailStatus { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 夿³¨ |
| | | /// </summary> |
| | | [SugarColumn(IsNullable = true, ColumnDescription = "夿³¨")] |
| | | public string Remark { get; set; } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundRepository |
| | | { |
| | | public class ErpProScrapSheetDetailRepository : RepositoryBase<Dt_ErpProScrapSheetDetail>, IErpProScrapSheetDetailRepository |
| | | { |
| | | public ErpProScrapSheetDetailRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundRepository |
| | | { |
| | | public class ErpProScrapSheetRepository : RepositoryBase<Dt_ErpProScrapSheet>, IErpProScrapSheetRepository |
| | | { |
| | | public ErpProScrapSheetRepository(IUnitOfWorkManage unitOfWorkManage) : base(unitOfWorkManage) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public partial class ErpProScrapSheetDetailService : ServiceBase<Dt_ErpProScrapSheetDetail, IErpProScrapSheetDetailRepository>, IErpProScrapSheetDetailService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | public IErpProScrapSheetDetailRepository Repository => BaseDal; |
| | | |
| | | public ErpProScrapSheetDetailService(IErpProScrapSheetDetailRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using WIDESEA_Common.CommonEnum; |
| | | using WIDESEA_Common.OrderEnum; |
| | | using WIDESEA_Common.StockEnum; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_Core.BaseRepository; |
| | | using WIDESEA_Core.BaseServices; |
| | | using WIDESEA_Core.Helper; |
| | | using WIDESEA_IOutboundRepository; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_OutboundService |
| | | { |
| | | public partial class ErpProScrapSheetService : ServiceBase<Dt_ErpProScrapSheet, IErpProScrapSheetRepository>, IErpProScrapSheetService |
| | | { |
| | | private readonly IUnitOfWorkManage _unitOfWorkManage; |
| | | public IErpProScrapSheetRepository Repository => BaseDal; |
| | | |
| | | public ErpProScrapSheetService(IErpProScrapSheetRepository BaseDal, IUnitOfWorkManage unitOfWorkManage) : base(BaseDal) |
| | | { |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | | } |
| | | public override WebResponseContent AddData(SaveModel saveModel) |
| | | { |
| | | if (saveModel.MainData.ContainsKey(nameof(Dt_ErpProScrapSheet.ProScrapStatus).FirstLetterToLower())) |
| | | { |
| | | saveModel.MainData[nameof(Dt_ErpProScrapSheet.ProScrapStatus).FirstLetterToLower()] = ProScrapSheetStatusEnum.TOChecked.ObjToInt(); |
| | | } |
| | | else |
| | | { |
| | | saveModel.MainData.Add(nameof(Dt_ErpProScrapSheet.ProScrapStatus).FirstLetterToLower(), ProScrapSheetStatusEnum.TOChecked.ObjToInt()); |
| | | } |
| | | foreach (var item in saveModel.DetailData) |
| | | { |
| | | if (!item.ContainsKey(nameof(Dt_ErpProScrapSheetDetail.OverScrapSETQty).FirstLetterToLower())) |
| | | { |
| | | item.Add(nameof(Dt_ErpProScrapSheetDetail.OverScrapSETQty).FirstLetterToLower(), 0); |
| | | } |
| | | if (!item.ContainsKey(nameof(Dt_ErpProScrapSheetDetail.OverScrapPcsQty).FirstLetterToLower())) |
| | | { |
| | | item.Add(nameof(Dt_ErpProScrapSheetDetail.OverScrapPcsQty).FirstLetterToLower(), 0); |
| | | } |
| | | if (!item.ContainsKey(nameof(Dt_ErpProScrapSheetDetail.XSetQty).FirstLetterToLower())) |
| | | { |
| | | item.Add(nameof(Dt_ErpProScrapSheetDetail.XSetQty).FirstLetterToLower(), 0); |
| | | } |
| | | if (!item.ContainsKey(nameof(Dt_ErpProScrapSheetDetail.XPcsQty).FirstLetterToLower())) |
| | | { |
| | | item.Add(nameof(Dt_ErpProScrapSheetDetail.XPcsQty).FirstLetterToLower(), 0); |
| | | } |
| | | if (!item.ContainsKey(nameof(Dt_ErpProScrapSheetDetail.ScrapProDetailStatus).FirstLetterToLower())) |
| | | { |
| | | item.Add(nameof(Dt_ErpProScrapSheetDetail.ScrapProDetailStatus).FirstLetterToLower(), OutOrderStatusEnum.åºåºä¸.ObjToInt()); |
| | | } |
| | | } |
| | | return base.AddData(saveModel); |
| | | } |
| | | } |
| | | } |
| | |
| | | DelOutOrder(oldOutboundOrder); |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°è¯¥ä»åºä¿¡æ¯"); |
| | | } |
| | | |
| | | if (materielInfo.WarehouseId!= materielInfo.WarehouseId) |
| | | { |
| | | DelOutOrder(oldOutboundOrder); |
| | | return WebResponseContent.Instance.Error($"ç©æ{materielInfo}ä¸å±äº{warehouse.WarehouseName}"); |
| | | } |
| | | if (model.Way == 1) |
| | | { |
| | | if (oldOutboundOrder != null) |
| | |
| | | keyValuePairs.Add(item.SaleOrder, responseContent.Data[0].Endcustomer); |
| | | } |
| | | } |
| | | proOutOrderDetail.QtyPcs += proOutOrderDetail.SpareQty; |
| | | proOutOrderDetails.Add(proOutOrderDetail); |
| | | } |
| | | Dt_ProOutOrder proOutOrder= new Dt_ProOutOrder() |
| | |
| | | /// <summary> |
| | | /// æ¥è¯¢ERPè®¢åæ£é¤åºåæ°é |
| | | /// </summary> |
| | | public async Task<WebResponseContent> OutProErpSync(string outProOrderNo) |
| | | public WebResponseContent OutProErpSync(string outProOrderNo) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | |
| | | Dt_ProOutOrder proOutOrder = BaseDal.Db.Queryable<Dt_ProOutOrder>().Where(x=>x.ProOutOrderNo== outProOrderNo).Includes(x => x.Details).First(); |
| | | if (proOutOrder==null) |
| | | { |
| | | return await Task.FromResult(content.Error($"æªæ¾å°æååºåºè®¢å{outProOrderNo}")); |
| | | return content.Error($"æªæ¾å°æååºåºè®¢å{outProOrderNo}"); |
| | | } |
| | | if (proOutOrder.ProOrderStatus>=OutOrderStatusEnum.åºåºå®æ.ObjToInt()) |
| | | { |
| | | return await Task.FromResult(content.Error($"åºåºè®¢å已宿æå
³é")); |
| | | return content.Error($"åºåºè®¢å已宿æå
³é"); |
| | | } |
| | | //è°ç¨erpåºåºè®¢ååºåæ¥è¯¢æ¥å£ |
| | | string response = _invokeERPService.InvokeOutProErpSync(outProOrderNo); |
| | | ErpOutProSyncResponseContent erpOutProSyncResponse= response.DeserializeObject<ErpOutProSyncResponseContent>(); |
| | | if (erpOutProSyncResponse.Code!=200) |
| | | { |
| | | return await Task.FromResult(content.Error($"ERPåºåºè®¢åæ¥è¯¢æ¥å£è°ç¨å¤±è´¥,é误信æ¯:{erpOutProSyncResponse.Msg}")); |
| | | return content.Error($"ERPåºåºè®¢åæ¥è¯¢æ¥å£è°ç¨å¤±è´¥,é误信æ¯:{erpOutProSyncResponse.Msg}"); |
| | | } |
| | | List<OutProStock> outProStocks = erpOutProSyncResponse.Data; |
| | | if (outProStocks.Count<=0 || outProStocks==null) |
| | | { |
| | | return await Task.FromResult(content.Error($"æååºåºè®¢å{outProOrderNo}ERPå½åæªæåºåºåºåä¿¡æ¯")); |
| | | return content.Error($"æååºåºè®¢å{outProOrderNo}ERPå½åæªæåºåºåºåä¿¡æ¯"); |
| | | } |
| | | // éªè¯ææåºåºåå·æ¯å¦ä¸è´ |
| | | OutProStock? outExist = outProStocks.FirstOrDefault(x => x.ShippingNumber != outProOrderNo); |
| | | if (outExist != null) |
| | | { |
| | | return content.Error($"ERPè¿åäºåºåºè®¢å{outExist.ShippingNumber}åºåä¿¡æ¯"); |
| | | } |
| | | //è·åå¹³åºåºåº |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA101.ToString()); |
| | | if (warehouse==null) |
| | | { |
| | | return await Task.FromResult(content.Error("æªæ¾å°åºåºä¿¡æ¯")); |
| | | return content.Error("æªæ¾å°åºåºä¿¡æ¯"); |
| | | } |
| | | var productCodes = outProStocks.Select(x => x.Partnum).Distinct().ToList(); |
| | | //è·åææå¹³åºåºå |
| | | List<Dt_ProStockInfo> proStockInfos = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo>().Where(x => x.WarehouseId == warehouse.WarehouseId).Includes(x => x.proStockInfoDetails).ToList(); |
| | | List<Dt_ProStockInfoDetail> proStockInfoDetails= new List<Dt_ProStockInfoDetail>(); |
| | | foreach (var item in proStockInfos) |
| | | { |
| | | proStockInfoDetails.AddRange(item.proStockInfoDetails); |
| | | } |
| | | proStockInfoDetails = proStockInfoDetails.OrderBy(x => x.DateCode).ThenBy(x => x.CreateDate).ToList() ; |
| | | List<Dt_ProStockInfoDetail> proStockInfoDetails = _stockRepository.ProStockInfoRepository.Db.Queryable<Dt_ProStockInfo, Dt_ProStockInfoDetail>((master, detail) => master.Id == detail.ProStockId) |
| | | .Where((master, detail) => master.WarehouseId == warehouse.WarehouseId && productCodes.Contains(detail.ProductCode)) |
| | | .Select((master, detail) => detail) |
| | | .ToList(); |
| | | proStockInfoDetails = proStockInfoDetails.OrderBy(x => x.DateCode).ThenBy(x => x.CreateDate).ToList(); |
| | | |
| | | List<Dt_ProStockInfo> delProStockInfos = new List<Dt_ProStockInfo>(); |
| | | List<Dt_ProStockInfoDetail> delStockInfoDetails = new List<Dt_ProStockInfoDetail>(); |
| | | foreach (var item in outProStocks) |
| | | { |
| | | //æ¥è¯¢åºåè®°å½ |
| | | if (item.ShippingNumber != outProOrderNo) |
| | | { |
| | | return await Task.FromResult(content.Error($"ERPè¿åäºåºåºè®¢å{item.ShippingNumber}åºåä¿¡æ¯")); |
| | | } |
| | | |
| | | //è·ååºå |
| | | List<Dt_ProStockInfoDetail> outStocks = proStockInfoDetails.Where(x=>x.ProductCode==item.Partnum).ToList(); |
| | | if (outStocks.Count==0 || outStocks==null) |
| | | { |
| | | return await Task.FromResult(content.Error($"{item.Partnum}产ååå·åºåä¸åå¨")); |
| | | return content.Error($"{item.Partnum}产ååå·åºåä¸åå¨"); |
| | | } |
| | | foreach (var itemOut in outStocks) |
| | | { |
| | |
| | | { |
| | | break; |
| | | } |
| | | Dt_ProOutOrderDetail? proOutOrderDetail = proOutOrder.Details.FirstOrDefault(x => x.SaleOrder == item.SoNumber && x.PCode == item.Partnum) ?? throw new Exception($"åºåºå{proOutOrder.ProOutOrderNo}æªæ¾å°éå®è®¢å{item.SoNumber}æç»,è¯·æ£æ¥"); |
| | | if (item.Quantity >= itemOut.StockPcsQty) |
| | | { |
| | | Dt_ProOutOrderDetail? proOutOrderDetail = proOutOrder.Details.FirstOrDefault(x => x.SaleOrder == item.SoNumber && x.PCode == item.Partnum); |
| | | if (proOutOrderDetail == null) |
| | | { |
| | | return await Task.FromResult(content.Error($"åºåºå{proOutOrder.ProOutOrderNo}æªæ¾å°éå®è®¢å{item.SoNumber}æç»,è¯·æ£æ¥")); |
| | | } |
| | | //æ´æ°åºåºæç»åæ°é |
| | | proOutOrderDetail.OverQtyPcs += itemOut.StockPcsQty; |
| | | item.Quantity -= (int)itemOut.StockPcsQty; |
| | |
| | | proStockInfoDetails.Remove(itemOut); |
| | | if (proOutOrderDetail.OverQtyPcs > proOutOrderDetail.QtyPcs) |
| | | { |
| | | return await Task.FromResult(content.Error($"åºåºå{proOutOrder.ProOutOrderNo}éå®è®¢å{item.SoNumber}æ°é溢åº{proOutOrderDetail.OverQtyPcs - proOutOrderDetail.QtyPcs}")); |
| | | return content.Error($"åºåºå{proOutOrder.ProOutOrderNo}éå®è®¢å{item.SoNumber}æ°é溢åº{proOutOrderDetail.OverQtyPcs - proOutOrderDetail.QtyPcs}"); |
| | | } |
| | | if (proOutOrderDetail.ProOrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | |
| | | } |
| | | else if (item.Quantity < itemOut.StockPcsQty) |
| | | { |
| | | Dt_ProOutOrderDetail? proOutOrderDetail = proOutOrder.Details.FirstOrDefault(x => x.SaleOrder == item.SoNumber && x.PCode == item.Partnum); |
| | | if (proOutOrderDetail == null) |
| | | { |
| | | return await Task.FromResult(content.Error($"åºåºå{proOutOrder.ProOutOrderNo}æªæ¾å°éå®è®¢å{item.SoNumber}æç»,è¯·æ£æ¥")); |
| | | } |
| | | |
| | | //æ´æ°åºåºæç»åæ°é |
| | | proOutOrderDetail.OverQtyPcs += item.Quantity; |
| | | item.Quantity -= item.Quantity; |
| | |
| | | itemOut.StockPcsQty -= item.Quantity; |
| | | if (proOutOrderDetail.OverQtyPcs > proOutOrderDetail.QtyPcs) |
| | | { |
| | | return await Task.FromResult(content.Error($"åºåºå{proOutOrder.ProOutOrderNo}éå®è®¢å{item.SoNumber}æ°é溢åº{proOutOrderDetail.OverQtyPcs - proOutOrderDetail.QtyPcs}")); |
| | | return content.Error($"åºåºå{proOutOrder.ProOutOrderNo}éå®è®¢å{item.SoNumber}æ°é溢åº{proOutOrderDetail.OverQtyPcs - proOutOrderDetail.QtyPcs}"); |
| | | } |
| | | if (proOutOrderDetail.ProOrderDetailStatus == OrderDetailStatusEnum.New.ObjToInt()) |
| | | { |
| | |
| | | else |
| | | { |
| | | Dt_ProOutOrderDetail? proOutOrderDetail = proOutOrder.Details.FirstOrDefault(x => x.ProOrderDetailStatus <= OrderDetailStatusEnum.Over.ObjToInt()); |
| | | return await Task.FromResult(content.Error($"{proOutOrderDetail?.SaleOrder}éå®è®¢åæ°ééåº{proOutOrderDetail?.QtyPcs},å¯åº{proOutOrderDetail?.OverQtyPcs}")); |
| | | return content.Error($"{proOutOrderDetail?.SaleOrder}éå®è®¢åæ°ééåº{proOutOrderDetail?.QtyPcs},å¯åº{proOutOrderDetail?.OverQtyPcs}"); |
| | | } |
| | | //æ´æ°æ°æ® |
| | | _unitOfWorkManage.BeginTran(); |
| | |
| | | { |
| | | _stockRepository.ProStockInfoDetailRepository.DeleteAndMoveIntoHty(delStockInfoDetails, OperateTypeEnum.èªå¨å é¤); |
| | | } |
| | | await _stockRepository.ProStockInfoDetailRepository.UpdateDataAsync(proStockInfoDetails); |
| | | await BaseDal.UpdateDataAsync(proOutOrder); |
| | | await _outboundRepository.ProOutOrderDetailRepository.UpdateDataAsync(proOutOrder.Details); |
| | | _stockRepository.ProStockInfoDetailRepository.UpdateData(proStockInfoDetails); |
| | | BaseDal.UpdateData(proOutOrder); |
| | | _outboundRepository.ProOutOrderDetailRepository.UpdateData(proOutOrder.Details); |
| | | _unitOfWorkManage.CommitTran(); |
| | | return await Task.FromResult(content.OK()); |
| | | return content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | _unitOfWorkManage.RollbackTran(); |
| | | return await Task.FromResult(content.Error(ex.Message)); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "proScrapStatusEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(ProScrapSheetStatusEnum); |
| | | List<int> enums = Enum.GetValues(typeof(ProScrapSheetStatusEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(ProScrapSheetStatusEnum).GetField(((ProScrapSheetStatusEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "checkTypeEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | |
| | | { |
| | | Type type = typeof(CheckTypeEnum); |
| | | List<int> enums = Enum.GetValues(typeof(CheckTypeEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(CheckTypeEnum).GetField(((CheckTypeEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "inspectAcceptEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | { |
| | | Type type = typeof(InspectAcceptEnum); |
| | | List<int> enums = Enum.GetValues(typeof(InspectAcceptEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(InspectAcceptEnum).GetField(((InspectAcceptEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | case "inspectResultEnum": |
| | | { |
| | | List<object> data = new List<object>(); |
| | | { |
| | | Type type = typeof(InspectResultEnum); |
| | | List<int> enums = Enum.GetValues(typeof(InspectResultEnum)).Cast<int>().ToList(); |
| | | int index = 0; |
| | | foreach (var item in enums) |
| | | { |
| | | FieldInfo? fieldInfo = typeof(InspectResultEnum).GetField(((InspectResultEnum)item).ToString()); |
| | | DescriptionAttribute? description = fieldInfo.GetCustomAttribute<DescriptionAttribute>(); |
| | | if (description != null) |
| | | { |
| | | data.Add(new { key = item.ToString(), value = description.Description }); |
| | | } |
| | | else |
| | | { |
| | | data.Add(new { key = item.ToString(), value = item.ToString() }); |
| | | } |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | result = new VueDictionaryDTO { DicNo = key, Config = "", Data = data }; |
| | | } |
| | | break; |
| | | } |
| | | return result; |
| | | } |
| | |
| | | MesResponseContent responseContent = new MesResponseContent(); |
| | | try |
| | | { |
| | | Dt_Task exsit = Repository.QueryFirst(x => x.TargetAddress == model.TargetAddressCode); |
| | | if (exsit != null) |
| | | { |
| | | return responseContent.Error($"ç®æ å°åéå¤"); |
| | | } |
| | | |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString()); |
| | | //è·ååºåè®°å½ |
| | |
| | | MesResponseContent responseContent = new MesResponseContent(); |
| | | try |
| | | { |
| | | Dt_Task exsit = Repository.QueryFirst(x => x.TargetAddress == model.TargetAddressCode); |
| | | if (exsit != null) |
| | | { |
| | | return responseContent.Error($"ç®æ å°åéå¤"); |
| | | } |
| | | |
| | | |
| | | Dt_Warehouse warehouse = _basicRepository.WarehouseRepository.QueryFirst(x => x.WarehouseCode == WarehouseEnum.HA154.ToString()); |
| | | //è·ååºåè®°å½ |
| | |
| | | using WIDESEA_External.Model; |
| | | using WIDESEA_IBasicRepository; |
| | | using WIDESEA_IBasicService; |
| | | using WIDESEA_ICheckRepository; |
| | | using WIDESEA_IInboundRepository; |
| | | using WIDESEA_IInboundService; |
| | | using WIDESEA_IOutboundRepository; |
| | |
| | | private readonly IOutboundRepository _outboundRepository; |
| | | private readonly IProInStatisticsRepository _proInStatisticsRepository; |
| | | private readonly IProInStatisticsService _proInStatisticsService; |
| | | private readonly ICheckOrderRepository _checkOrderRepository; |
| | | public ITaskRepository Repository => BaseDal; |
| | | |
| | | private Dictionary<string, OrderByType> _taskOrderBy = new() |
| | |
| | | |
| | | public List<int> TaskOutboundTypes => typeof(TaskTypeEnum).GetEnumIndexList(); |
| | | |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IInboundRepository inboundRepository, IInboundOrderService inboundOrderService, IPalletTypeInfoRepository palletTypeInfoRepository, IOutProStockInfoRepository outProStockInfoRepository, IOutboundRepository outboundRepository, IProInStatisticsRepository proInStatisticsRepository, IProInStatisticsService proInStatisticsService) : base(BaseDal) |
| | | public TaskService(ITaskRepository BaseDal, IMapper mapper, IUnitOfWorkManage unitOfWorkManage, IStockRepository stockRepository, IBasicService basicService, IRecordService recordService, IOutboundService outboundService, IStockService stockService, IBasicRepository basicRepository, IApiInfoRepository apiInfoRepository, IInvokeERPService invokeERPService, IInboundRepository inboundRepository, IInboundOrderService inboundOrderService, IPalletTypeInfoRepository palletTypeInfoRepository, IOutProStockInfoRepository outProStockInfoRepository, IOutboundRepository outboundRepository, IProInStatisticsRepository proInStatisticsRepository, IProInStatisticsService proInStatisticsService, ICheckOrderRepository checkOrderRepository) : base(BaseDal) |
| | | { |
| | | _mapper = mapper; |
| | | _unitOfWorkManage = unitOfWorkManage; |
| | |
| | | _outboundRepository = outboundRepository; |
| | | _proInStatisticsRepository = proInStatisticsRepository; |
| | | _proInStatisticsService = proInStatisticsService; |
| | | _checkOrderRepository = checkOrderRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | List<Dt_OutboundOrderDetail> outboundOrderDetails = new List<Dt_OutboundOrderDetail>(); |
| | | List<Dt_MesOutboundOrder> mesOutboundOrders = new List<Dt_MesOutboundOrder>(); |
| | | List<Dt_MesPPOutboundOrder> mesPPOutboundOrders = new List<Dt_MesPPOutboundOrder>(); |
| | | if ((outStockLockInfos == null || outStockLockInfos.Count == 0) &&(warehouse.WarehouseCode != WarehouseEnum.HA64.ToString()|| warehouse.WarehouseCode != WarehouseEnum.HA154.ToString()) && (task.TaskType != TaskTypeEnum.OutEmpty.ObjToInt())) |
| | | Dt_CheckOrder? checkOrder = null; |
| | | Dt_OutboundOrder? outboundOrder = null; |
| | | if ((outStockLockInfos == null || outStockLockInfos.Count == 0) && warehouse.WarehouseCode != WarehouseEnum.HA64.ToString() && warehouse.WarehouseCode != WarehouseEnum.HA154.ToString() && (task.TaskType != TaskTypeEnum.OutEmpty.ObjToInt())) |
| | | { |
| | | return WebResponseContent.Instance.Error($"æªæ¾å°åºåºè¯¦æ
ä¿¡æ¯"); |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | //è·ååºåºåæç» |
| | | Dt_OutboundOrderDetail outboundOrderDetail = _outboundService.OutboundOrderDetailService.Repository.QueryFirst(x => x.Id == item.OrderDetailId); |
| | | if (outboundOrderDetail != null) |
| | | { |
| | |
| | | outboundOrderDetail.OrderDetailStatus = OrderDetailStatusEnum.Over.ObjToInt(); |
| | | } |
| | | outboundOrderDetails.Add(outboundOrderDetail); |
| | | //è·ååºåºå |
| | | outboundOrder = _outboundRepository.OutboundOrderRepository.Db.Queryable<Dt_OutboundOrder>().Where(x => x.Id == outboundOrderDetail.OrderId).Includes(x => x.Details).First() ?? throw new Exception("æªæ¾å°åºåºå"); |
| | | if (task.TaskType == TaskTypeEnum.OutQuality.ObjToInt()) |
| | | { |
| | | Dt_MaterielInfo materielInfo = _basicRepository.MaterielInfoRepository.QueryFirst(x=>x.MaterielCode== outboundOrderDetail.MaterielCode); |
| | | |
| | | checkOrder = new Dt_CheckOrder |
| | | { |
| | | ReceivedQuantity = item.OriginalQuantity, |
| | | OrderType = CheckTypeEnum.InspectCheck.ObjToInt(), |
| | | ReceiveOrderNo = outboundOrder.OrderNo, |
| | | LotNo= item.BatchNo, |
| | | Result = CheckAcceptEnum.NotCheckAccept.ToString(), |
| | | QualifiedQuantity = 0, |
| | | ReceiveDetailRowNo = item.Id, |
| | | WarehouseId = outboundOrder.WarehouseId, |
| | | ScrappedQuantity = 0, |
| | | MaterielCode=materielInfo.MaterielCode, |
| | | MaterielSpec = materielInfo.MaterielSpec, |
| | | Unit = materielInfo.MaterielUnit, |
| | | ReturnQuantity = 0, |
| | | DefectedQuantity = 0 |
| | | }; |
| | | } |
| | | } |
| | | |
| | | } |
| | | item.Status = OutLockStockStatusEnum.åºåºå®æ.ObjToInt(); |
| | | } |
| | |
| | | FeedBackWCSTaskCompleted(taskNum); |
| | | _unitOfWorkManage.BeginTran(); |
| | | |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt()) |
| | | if (task.TaskType == TaskTypeEnum.Outbound.ObjToInt() || task.TaskType == TaskTypeEnum.OutQuality.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandPickOutbound.ObjToInt() || task.TaskType == TaskTypeEnum.MesHandOutbound.ObjToInt()) |
| | | { |
| | | //å¤çåºåºè¯¦æ
|
| | | //å¤çåºåºè¯¦æ
以ååºåç¶æ |
| | | if (outboundOrderDetails.Count > 0) |
| | | { |
| | | _outboundService.OutboundOrderDetailService.Repository.UpdateData(outboundOrderDetails); |
| | | //æ´æ°åºåºåç¶æ |
| | | if (task.TaskType == TaskTypeEnum.OutQuality.ObjToInt() || task.TaskType == TaskTypeEnum.OutAllocate.ObjToInt()) |
| | | { |
| | | int detailCount = outboundOrderDetails.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count; |
| | | if ((outboundOrder.Details.Where(x => x.OrderDetailStatus == OrderDetailStatusEnum.Over.ObjToInt()).ToList().Count + detailCount) == outboundOrder.Details.Count) |
| | | { |
| | | outboundOrder.OrderStatus = OutOrderStatusEnum.åºåºå®æ.ObjToInt(); |
| | | _outboundRepository.OutboundOrderRepository.UpdateData(outboundOrder); |
| | | } |
| | | } |
| | | } |
| | | stockInfo.LocationCode = ""; |
| | | stockInfo.StockStatus = StockStatusEmun.åºåºå®æ.ObjToInt(); |
| | |
| | | { |
| | | stockInfo.StockLength = 0; |
| | | } |
| | | if (checkOrder!=null) |
| | | { |
| | | stockInfo.StockStatus = StockStatusEmun.鿣宿.ObjToInt(); |
| | | stockInfo.Details.ForEach(x => |
| | | { |
| | | x.Status = StockStatusEmun.鿣宿.ObjToInt(); |
| | | }); |
| | | _checkOrderRepository.AddData(checkOrder); |
| | | } |
| | | _stockRepository.StockInfoRepository.UpdateData(stockInfo); |
| | | _stockRepository.StockInfoDetailRepository.UpdateData(stockInfo.Details); |
| | | } |
| | | else if (task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt()) |
| | | else if (task.TaskType == TaskTypeEnum.OutEmpty.ObjToInt())//è¾
æç©ºç®±åºåºå®æ |
| | | { |
| | | _basicService.LocationInfoService.UpdateLocationStatus(locationInfo, stockInfo.PalletType, LocationStatusEnum.Free, stockInfo.WarehouseId); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | | } |
| | | else if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt()) |
| | | else if (task.TaskType == TaskTypeEnum.MesOutbound.ObjToInt())//æ¿æMesåºåºå®æé»è¾ |
| | | { |
| | | _outboundService.MesOutboundOrderService.Repository.UpdateData(mesOutboundOrders); |
| | | _stockService.StockInfoService.Repository.DeleteAndMoveIntoHty(stockInfo, App.User.UserId == 0 ? OperateTypeEnum.èªå¨å®æ : OperateTypeEnum.äººå·¥å®æ); |
| | |
| | | { |
| | | x.StockStatus = StockStatusEmun.åºåºéå®.ObjToInt(); |
| | | }); |
| | | outboundOrderDetails.ForEach(x => |
| | | { |
| | | x.OrderDetailStatus = OrderDetailStatusEnum.Outbound.ObjToInt(); |
| | | }); |
| | | Dt_OutboundOrder outboundOrder = _outboundRepository.OutboundOrderRepository.QueryFirst(x => x.Id == outboundOrderDetails.FirstOrDefault().OrderId); |
| | | if (outboundOrder.OrderStatus != OutOrderStatusEnum.åºåºä¸.ObjToInt()) |
| | | { |
| | | _outboundRepository.OutboundOrderRepository.UpdateData(outboundOrder); |
| | | } |
| | | WebResponseContent content = _outboundService.OutboundOrderDetailService.LockOutboundStockDataUpdate(stockInfos, outboundOrderDetails, outStockLockInfos, locationInfos, tasks: tasks); |
| | | |
| | | if (!content.Status) |
| | |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\WIDESEA_External\WIDESEA_External.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IBasicService\WIDESEA_IBasicService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_ICheckRepository\WIDESEA_ICheckRepository.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IInboundService\WIDESEA_IInboundService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IOutboundService\WIDESEA_IOutboundService.csproj" /> |
| | | <ProjectReference Include="..\WIDESEA_IRecordService\WIDESEA_IRecordService.csproj" /> |
| | |
| | | return Service.CommitCheckResult(checkOrderId, checkResult, isAccept); |
| | | } |
| | | /// <summary> |
| | | /// æäº¤éæ£ç»æ |
| | | /// </summary> |
| | | /// <param name="checkOrderId"></param> |
| | | /// <param name="checkResult"></param> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("CommitInspectResult")] |
| | | public WebResponseContent CommitInspectResult(int checkOrderId, [FromBody] Dt_CheckOrderResult checkResult, int isAccept = 0) |
| | | { |
| | | return Service.CommitInspectResult(checkOrderId, checkResult, isAccept); |
| | | } |
| | | /// <summary> |
| | | /// è·åæ£éªä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="checkId"></param> |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("InvokeCheckOrderApi"), AllowAnonymous] |
| | | public string InvokeCheckOrderApi(ERPCheckModel checkModel) |
| | | public string InvokeCheckOrderApi([FromBody] ERPCheckModel checkModel) |
| | | { |
| | | return _invokeERPService.InvokeCheckOrderApi(checkModel); |
| | | } |
| | | /// <summary> |
| | | /// æ¨éERPç©æéæ£ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost, Route("InvokeInspectApi"), AllowAnonymous] |
| | | public string InvokeInspectApi([FromBody] ERPInspectModel eRPInspectModel) |
| | | { |
| | | return _invokeERPService.InvokeInspectApi(eRPInspectModel); |
| | | } |
| | | /// <summary> |
| | | /// æ¨éERPå
¥åº |
| | | /// </summary> |
| | | /// <returns></returns> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_Core; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// æåæ¥åºå |
| | | /// </summary> |
| | | [Route("api/ErpProScrapSheet")] |
| | | [ApiController] |
| | | public class ErpProScrapSheetController : ApiBaseController<IErpProScrapSheetService, Dt_ErpProScrapSheet> |
| | | { |
| | | public ErpProScrapSheetController(IErpProScrapSheetService service) : base(service) |
| | | { |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using WIDESEA_Core.BaseController; |
| | | using WIDESEA_IOutboundService; |
| | | using WIDESEA_Model.Models; |
| | | |
| | | namespace WIDESEA_WMSServer.Controllers.Outbound |
| | | { |
| | | /// <summary> |
| | | /// æåæ¥åºåæç» |
| | | /// </summary> |
| | | [Route("api/ErpProScrapSheetDetail")] |
| | | [ApiController] |
| | | public class ErpProScrapSheetDetailController : ApiBaseController<IErpProScrapSheetDetailService, Dt_ErpProScrapSheetDetail> |
| | | { |
| | | public ErpProScrapSheetDetailController(IErpProScrapSheetDetailService service) : base(service) |
| | | { |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | /// æ¥è¯¢ERPè®¢åæ£é¤åºåæ°é |
| | | /// </summary> |
| | | [HttpPost, HttpGet, Route("OutProErpSync")] |
| | | public async Task<WebResponseContent> OutProErpSync(string outProOrderNo) |
| | | public WebResponseContent OutProErpSync(string outProOrderNo) |
| | | { |
| | | return await Service.OutProErpSync(outProOrderNo); |
| | | return Service.OutProErpSync(outProOrderNo); |
| | | } |
| | | /// <summary> |
| | | /// åºåºåæ«ç 忥ERP |
| | |
| | | "Microsoft.AspNetCore": "Warning" |
| | | } |
| | | }, |
| | | "dics": "inOrderType,outOrderType,inboundState,createType,enableEnum,enableStatusEnum,locationStatusEnum,locationTypeEnum,taskTypeEnum,taskStatusEnum,outboundStatusEnum,orderDetailStatusEnum,stockStatusEmun,stockChangeType,outStockStatus,receiveOrderTypeEnum,authorityScope,authorityScopes,locationChangeType,warehouses,suppliers,taskType,receiveStatus,purchaseType,purchaseOrderStatus,printStatus,returnStatus,returnType,outLockStockStatusEnum,checkOrderStatusEnum,checkUploadEnum,checkAcceptEnum,proStockAttributeEnum,materielSourceTypeEnum,materielTypeEnum,customerOutRuleEnum", |
| | | "dics": "inOrderType,outOrderType,inboundState,createType,enableEnum,enableStatusEnum,locationStatusEnum,locationTypeEnum,taskTypeEnum,taskStatusEnum,outboundStatusEnum,orderDetailStatusEnum,stockStatusEmun,stockChangeType,outStockStatus,receiveOrderTypeEnum,authorityScope,authorityScopes,locationChangeType,warehouses,suppliers,taskType,receiveStatus,purchaseType,purchaseOrderStatus,printStatus,returnStatus,returnType,outLockStockStatusEnum,checkOrderStatusEnum,checkUploadEnum,checkAcceptEnum,proStockAttributeEnum,materielSourceTypeEnum,materielTypeEnum,customerOutRuleEnum,proScrapStatusEnum,checkTypeEnum,inspectAcceptEnum,inspectResultEnum", |
| | | "AllowedHosts": "*", |
| | | "ConnectionStringsEncryption": false, |
| | | "MainDB": "DB_WIDESEA", //å½å项ç®ç主åºï¼æå¯¹åºçè¿æ¥å符串çEnabledå¿
须为true |