From 7d410c1f0d4e36f8281ce2277f355c9abf1c231b Mon Sep 17 00:00:00 2001
From: zs <zhousong@weben-smart.com>
Date: 周五, 16 5月 2025 16:19:36 +0800
Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
---
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderExportModel.cs | 6
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/Config.ts | 5
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs | 42
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrderRecord/ICallMaterialOrderRecordRepository.cs | 35
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/CallMaterialOrder.ts | 4
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRecordRepository.cs | 105 +
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrder/ICallMaterialOrderRepository.cs | 40
Weben_CMS专用代码生成器/queryExtensions/CmsQueryExtensions/Utils/HttpApiRequest.cs | 63 +
HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs | 25
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMS.Plugin.PipeLineLems.csproj | 15
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/CMS.Plugin.PipeLineLems.Application.csproj | 9
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CallMaterialByDataIdentifierInput.cs | 29
HIAWms/hiawms_web/.vscode/settings.json | 1
Weben_CMS专用代码生成器/queryExtensions/CmsQueryExtensions/Entitys/CmsApiResponse.cs | 54 +
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordExportModel.cs | 6
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateDto.cs | 5
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordDto.cs | 5
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderRecordController.cs | 66
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderRecordAppService.cs | 45
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateDto.cs | 5
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/GetCallMaterialOrderInput.cs | 16
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderUpdateDto.cs | 5
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs | 13
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx | 52
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrder导出模板.xlsx | 0
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordDrawer.tsx | 13
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrder.ts | 4
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/Service/CallMaterialOrder.ts | 4
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/MyCallMaterialOutput.cs | 73 +
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderAppService.cs | 72
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrderRecord导出模板.xlsx | 0
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRepository.cs | 146 +
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs | 23
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordUpdateDto.cs | 5
CommonDLL/CmsQueryExtensions.dll | 0
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrderQueryDrawer.tsx | 693 +++++++-----
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderAppService.cs | 658 ++++++-----
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateOrUpdateDtoBase.cs | 5
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/Dialog/CallMaterialOrderRecordQueryDrawer/CallMaterialOrderRecordQueryDrawer.tsx | 6
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderRecordAppService.cs | 647 ++++++-----
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateOrUpdateDtoBase.cs | 18
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderDto.cs | 5
PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/GetCallMaterialOrderRecordInput.cs | 16
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/Dialog/CallMaterialOrderQueryDrawer/CallMaterialOrderQueryDrawer.tsx | 6
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderController.cs | 77
PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordQueryDrawer.tsx | 110 +
PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs | 8
47 files changed, 2,130 insertions(+), 1,110 deletions(-)
diff --git a/CommonDLL/CmsQueryExtensions.dll b/CommonDLL/CmsQueryExtensions.dll
index 6fc8269..de1c59c 100644
--- a/CommonDLL/CmsQueryExtensions.dll
+++ b/CommonDLL/CmsQueryExtensions.dll
Binary files differ
diff --git a/HIAWms/hiawms_web/.vscode/settings.json b/HIAWms/hiawms_web/.vscode/settings.json
new file mode 100644
index 0000000..9e26dfe
--- /dev/null
+++ b/HIAWms/hiawms_web/.vscode/settings.json
@@ -0,0 +1 @@
+{}
\ No newline at end of file
diff --git a/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs b/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs
index ad56343..50523df 100644
--- a/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs
+++ b/HIAWms/server/src/CMS.Plugin.HIAWms/Controller/LMesOperateController.cs
@@ -1,6 +1,7 @@
锘縰sing CMS.Extensions.Abp.AspNetCore.Mvc.Filters;
using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto;
using CMS.Plugin.HIAWms.Application.Contracts.Services;
+using CmsQueryExtensions.Entitys;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
@@ -32,9 +33,29 @@
/// <returns></returns>
[HttpPost]
[Route("LMesCallMaterial")]
- public async Task<List<CallMaterialOutput>> LMesCallMaterialAsync(List<LMesCallMaterialInput> input)
+ public async Task<CmsApiResponse<List<CallMaterialOutput>>> LMesCallMaterialAsync(List<LMesCallMaterialInput> input)
{
- return await _mesOperateAppService.LMesCallMaterialAsync(input);
+ try
+ {
+ var list = await _mesOperateAppService.LMesCallMaterialAsync(input);
+ return new CmsApiResponse<List<CallMaterialOutput>>()
+ {
+ Data = list,
+ Code = 200,
+ Message = "LMes鍙枡鎴愬姛"
+ };
+ }
+ catch (Exception ex)
+ {
+ //throw; //涓嶈鎶涘嚭寮傚父锛屽惁鍒欏鏂逛細鎺ユ敹澶辫触鍛�
+ return new CmsApiResponse<List<CallMaterialOutput>>()
+ {
+ Data = null,
+ Code = 500,
+ Message = ex.Message
+ };
+ }
+
}
}
}
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrder.ts b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrder.ts
index 980399f..6d31ed6 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrder.ts
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrder.ts
@@ -160,7 +160,9 @@
`鏄惁瑕佸彨鏂�${names.length ? names.join(',') : ''}`
).then(async () => {
const ids = selection.value.map((item: { id: string }) => item.id)
- await callMaterialOrder.callMaterialByDataIdentifier(ids[0])
+ await callMaterialOrder.callMaterialByDataIdentifier({
+ id:ids[0]
+ })
ElMessage.success('鍙枡鎴愬姛')
tableRef.value.getList()
})
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrderQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrderQueryDrawer.tsx
index 1b66ffb..a43d578 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrderQueryDrawer.tsx
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Controllers/CallMaterialOrderQueryDrawer.tsx
@@ -1,293 +1,400 @@
-import {
- ref,
- onMounted,
- reactive,
- computed,
- Ref,
- watch,
- SetupContext,
- h,
-} from 'vue'
-import { injectModel } from '@/libs/Provider/Provider'
-import { CallMaterialOrderDrawer } from '../Models/CallMaterialOrderDrawer'
-import { ElMessage } from 'element-plus'
-import isEqual from 'lodash/isEqual'
-import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
-import { cloneDeep } from 'lodash'
-
-export const useCallMaterialOrderQueryDrawer = (props: any, ctx?: any) => {
- const callMaterialOrderDrawer = injectModel<CallMaterialOrderDrawer>('CallMaterialOrderDrawer')
- /**
- * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁
- */
- const initiateData: Ref<Record<string, any>> = ref({})
- const formData = ref<Record<string, any>>({})
- // ref
- const formRef = ref()
-
- const disabled = ref(false)
-
- const current = computed(() => {
- return props.row || null
- })
-
- const inputNumber = (attrs) => {
- return (
- <el-input-number
- min="1"
- step="1"
- precision="0"
- {...attrs}
- ></el-input-number>
- )
- }
-
- const datePickerRange = (attrs) => {
- return (
- <el-date-picker
- type="daterange"
- value-format="YYYY-MM-DD HH:mm:ss"
- start-placeholder="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡"
- {...attrs}
- ></el-date-picker>
- )
- }
-
- const dateTimePickerRange = (attrs) => {
- return (
- <el-date-picker
- type="datetimerange"
- value-format="YYYY-MM-DD HH:mm:ss"
- start-placeholder="寮�濮嬫棩鏈�"
- end-placeholder="缁撴潫鏃ユ湡"
- {...attrs}
- ></el-date-picker>
- )
- }
-
- const visible = computed({
- get() {
- return props.modelValue
- },
- set(val) {
- ctx.emit('update:modelValue', val)
- },
- })
- /**
- * 楂樼骇鏌ヨ鐨刦orm瀛楁
- */
- const formItems = reactive([
- {
- label: '鍘熸枡鏍囪瘑',
- prop: 'dataIdentifier',
- el: 'input',
- //disabled: disabled,
- placeholder: '璇疯緭鍏ュ師鏂欐爣璇�',
- },
- {
- label: '鍘熸枡鍨嬪彿',
- prop: 'materialMode',
- el: 'input',
- //disabled: disabled,
- placeholder: '璇疯緭鍏ュ師鏂欏瀷鍙�',
- },
- {
- label: '鍙枡鐘舵��',
- prop: 'callMaterialStatus',
- el: 'select',
- clearable:true,
- option: [],
- //disabled: disabled,
- placeholder: '璇疯緭鍏ュ彨鏂欑姸鎬�',
- },
- {
- label: '鍙枡鏁伴噺',
- prop: 'quantity',
- el: (props: any, { attrs }: SetupContext) => {
- return h(inputNumber, {
- ...props,
- clearable: true,
- ...attrs,
- })
- },
- width: '100%',
- step: 1,
- precision: 0,
- //disabled: disabled,
- placeholder: '璇疯緭鍏ュ彨鏂欐暟閲�',
- },
- {
- label: 'WMS杩斿洖缁撴灉',
- prop: 'wmsRetResult',
- el: 'input',
- //disabled: disabled,
- placeholder: '璇疯緭鍏MS杩斿洖缁撴灉',
- },
- {
- label: 'WMS浠诲姟鍙�',
- prop: 'wmsTaskNo',
- el: 'input',
- //disabled: disabled,
- placeholder: '璇疯緭鍏MS浠诲姟鍙�',
- },
- {
- label: '鍒涘缓鏃堕棿',
- prop: 'creationTime',
- el: (props: any, { attrs }: SetupContext) => {
- return h(dateTimePickerRange, {
- ...props,
- clearable: true,
- ...attrs,
- })
- },
- width: '100%',
- //disabled: disabled,
- placeholder: '璇疯緭鍏ュ垱寤烘椂闂�',
- },
- {
- label: '淇敼鏃堕棿',
- prop: 'lastModificationTime',
- el: (props: any, { attrs }: SetupContext) => {
- return h(dateTimePickerRange, {
- ...props,
- clearable: true,
- ...attrs,
- })
- },
- width: '100%',
- //disabled: disabled,
- placeholder: '璇疯緭鍏ヤ慨鏀规椂闂�',
- },
- {
- label: '鍒涘缓浜�',
- prop: 'creatorName',
- el: 'input',
- //disabled: disabled,
- placeholder: '璇疯緭鍏ュ垱寤轰汉',
- },
- {
- label: '淇敼浜�',
- prop: 'lastModifierName',
- el: 'input',
- //disabled: disabled,
- placeholder: '璇疯緭鍏ヤ慨鏀逛汉',
- },
- {
- label: '澶囨敞',
- prop: 'remark',
- el: 'input',
- //disabled: disabled,
- placeholder: '璇疯緭鍏ュ娉�',
- },
- ])
- /**
- * 鏍¢獙鏄惁鏈夋暟鎹彉鍖�
- */
- const checkIsEqualObject = () => {
- const data = {
- formData: formData.value,
- }
- const check = isEqual(initiateData.value, data)
- return check
- }
- const commonGetFormData=()=>{
- const data = {
- dataIdentifier: formData.value.dataIdentifier || '',
-materialMode: formData.value.materialMode || '',
-callMaterialStatus: formData.value.callMaterialStatus || '',
-quantity: formData.value.quantity || '',
-wmsRetResult: formData.value.wmsRetResult || '',
-wmsTaskNo: formData.value.wmsTaskNo || '',
-creationTime: formData.value.creationTime || '',
-lastModificationTime: formData.value.lastModificationTime || '',
-creatorName: formData.value.creatorName || '',
-lastModifierName: formData.value.lastModifierName || '',
-remark: formData.value.remark || '',
- }
- return data;
- }
- const onClose = (done: () => void) => {
- if (visible.value) {
- visible.value = false
- const data =commonGetFormData();
- ctx.emit('close', data)
- }
- }
- /**
- * 纭鏌ヨ
- */
- const onConfirmQuery = async () => {
- const data =commonGetFormData();
- ctx.emit('confirmQuery', data)
- }
- /**
- * 閲嶇疆鏌ヨ
- */
- const onReset = async () => {
- formData.value = {}
- formData.value.dataIdentifier = ''
-formData.value.materialMode = ''
-formData.value.callMaterialStatus = ''
-formData.value.quantity = ''
-formData.value.wmsRetResult = ''
-formData.value.wmsTaskNo = ''
-formData.value.deletionTime = ''
-formData.value.operationRemark = ''
-formData.value.deleteRemark = ''
-formData.value.remark = ''
-formData.value.extraField1 = ''
-formData.value.extraField2 = ''
-formData.value.extraField3 = ''
- //鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢
- ctx.emit('restQuery');
- }
-
- const updateCheckData = () => {
- initiateData.value = {
- formData: {
- ...formData.value,
- },
- }
- }
- const updateFormItemOptions = (propName: string, enumData: any[]) => {
- const item = formItems.find((item) => item.prop === propName)
- if (item && enumData) {
- item.options = enumData.map((item) => ({
- label: item.description,
- value: item.value,
- }))
- }
- }
- /**
- * 閫氱敤鏌ヨ鏋氫妇
- */
- const commonQueryEnumForFrom = async () => {
- const callMaterialStatusEnumEnum = await callMaterialOrderDrawer.getWmsEnumData({
- EnumName: 'CallMaterialStatusEnum',
-})
-updateFormItemOptions('callMaterialStatus', callMaterialStatusEnumEnum)
-
- }
- commonQueryEnumForFrom()
- /**
- * 寮圭獥鎵撳紑鑾峰彇璇︽儏
- */
- const onOpen = async () => {
- disabled.value = false
- updateCheckData()
- }
-
- watch(() => current.value, onOpen)
-
- return {
- formItems,
- formData,
- visible,
- formRef,
- onOpen,
- onClose,
- onConfirmQuery,
- onReset,
- }
-}
+import {
+ ref,
+ onMounted,
+ reactive,
+ computed,
+ Ref,
+ watch,
+ SetupContext,
+ h,
+} from 'vue'
+import { injectModel } from '@/libs/Provider/Provider'
+import { CallMaterialOrderDrawer } from '../Models/CallMaterialOrderDrawer'
+import { ElMessage } from 'element-plus'
+import isEqual from 'lodash/isEqual'
+import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
+import { cloneDeep } from 'lodash'
+// 寮曞叆鍏叡閫夐」閰嶇疆
+import {
+ FILTER_MODE_OPTIONS_STRING,
+ FILTER_MODE_OPTIONS_NUM,
+ FILTER_MODE_OPTIONS_BOOL,
+} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'
+import { BOOLEAN_OPTIONS } from '@/utils/commonOptionConstants'
+
+export const useCallMaterialOrderQueryDrawer = (props: any, ctx?: any) => {
+ const callMaterialOrderDrawer = injectModel<CallMaterialOrderDrawer>(
+ 'CallMaterialOrderDrawer'
+ )
+ /**
+ * 鐢ㄦ潵瀵规瘮鐨勫垵濮嬪寲鏁版嵁
+ */
+ const initiateData: Ref<Record<string, any>> = ref({})
+ const formData = ref<Record<string, any>>({})
+ // ref
+ const formRef = ref()
+
+ const disabled = ref(false)
+
+ const current = computed(() => {
+ return props.row || null
+ })
+
+ const inputNumber = (attrs) => {
+ return (
+ <el-input-number
+ min="1"
+ step="1"
+ precision="0"
+ {...attrs}
+ ></el-input-number>
+ )
+ }
+
+ const datePickerRange = (attrs) => {
+ return (
+ <el-date-picker
+ type="daterange"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ {...attrs}
+ ></el-date-picker>
+ )
+ }
+
+ const dateTimePickerRange = (attrs) => {
+ return (
+ <el-date-picker
+ type="datetimerange"
+ value-format="YYYY-MM-DD HH:mm:ss"
+ start-placeholder="寮�濮嬫棩鏈�"
+ end-placeholder="缁撴潫鏃ユ湡"
+ {...attrs}
+ ></el-date-picker>
+ )
+ }
+
+ const visible = computed({
+ get() {
+ return props.modelValue
+ },
+ set(val) {
+ ctx.emit('update:modelValue', val)
+ },
+ })
+ /**
+ * 楂樼骇鏌ヨ鐨刦orm瀛楁
+ */
+ const formItems = reactive([
+ {
+ label: '鍘熸枡鏍囪瘑',
+ prop: 'dataIdentifier',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ師鏂欐爣璇�',
+ highSelectAttrs: {
+ prop: 'dataIdentifier_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ {
+ label: '鍘熸枡鍨嬪彿',
+ prop: 'materialMode',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ師鏂欏瀷鍙�',
+ highSelectAttrs: {
+ prop: 'materialMode_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ {
+ label: '鍘熸枡鎵规',
+ prop: 'materialBatch',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ師鏂欐壒娆�',
+ highSelectAttrs: {
+ prop: 'materialBatch_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ {
+ label: '鍙枡鐘舵��',
+ prop: 'callMaterialStatus',
+ el: 'select',
+ clearable: true,
+ option: [],
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ彨鏂欑姸鎬�',
+ highSelectAttrs: {
+ prop: 'callMaterialStatus_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_BOOL,
+ },
+ },
+ {
+ label: '鍙枡鏁伴噺',
+ prop: 'quantity',
+ el: (props: any, { attrs }: SetupContext) => {
+ return h(inputNumber, {
+ ...props,
+ clearable: true,
+ ...attrs,
+ })
+ },
+ width: '100%',
+ step: 1,
+ precision: 0,
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ彨鏂欐暟閲�',
+ highSelectAttrs: {
+ prop: 'quantity_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_NUM,
+ },
+ },
+ {
+ label: 'WMS杩斿洖缁撴灉',
+ prop: 'wmsRetResult',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏MS杩斿洖缁撴灉',
+ highSelectAttrs: {
+ prop: 'wmsRetResult_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ {
+ label: 'WMS浠诲姟鍙�',
+ prop: 'wmsTaskNo',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏MS浠诲姟鍙�',
+ highSelectAttrs: {
+ prop: 'wmsTaskNo_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ {
+ label: '鍒涘缓鏃堕棿',
+ prop: 'creationTime',
+ el: (props: any, { attrs }: SetupContext) => {
+ return h(dateTimePickerRange, {
+ ...props,
+ clearable: true,
+ ...attrs,
+ })
+ },
+ width: '100%',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ垱寤烘椂闂�',
+ isDateControl: true, // 鏄惧紡鏍囪涓烘棩鏈熸帶浠�
+ },
+ {
+ label: '淇敼鏃堕棿',
+ prop: 'lastModificationTime',
+ el: (props: any, { attrs }: SetupContext) => {
+ return h(dateTimePickerRange, {
+ ...props,
+ clearable: true,
+ ...attrs,
+ })
+ },
+ width: '100%',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ヤ慨鏀规椂闂�',
+ isDateControl: true, // 鏄惧紡鏍囪涓烘棩鏈熸帶浠�
+ },
+ {
+ label: '鍒涘缓浜�',
+ prop: 'creatorName',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ垱寤轰汉',
+ highSelectAttrs: {
+ prop: 'creatorName_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ {
+ label: '淇敼浜�',
+ prop: 'lastModifierName',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ヤ慨鏀逛汉',
+ highSelectAttrs: {
+ prop: 'lastModifierName_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ {
+ label: '澶囨敞',
+ prop: 'remark',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ娉�',
+ highSelectAttrs: {
+ prop: 'remark_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options: FILTER_MODE_OPTIONS_STRING,
+ },
+ },
+ ])
+ /**
+ * 鏍¢獙鏄惁鏈夋暟鎹彉鍖�
+ */
+ const checkIsEqualObject = () => {
+ const data = {
+ formData: formData.value,
+ }
+ const check = isEqual(initiateData.value, data)
+ return check
+ }
+ const commonGetFormData = () => {
+ const data = {
+ dataIdentifier: formData.value.dataIdentifier || '',
+ dataIdentifier_FilterMode: formData.value.dataIdentifier_FilterMode || '',
+ materialMode: formData.value.materialMode || '',
+ materialMode_FilterMode: formData.value.materialMode_FilterMode || '',
+ materialBatch: formData.value.materialBatch || '',
+ materialBatch_FilterMode: formData.value.materialBatch_FilterMode || '',
+ callMaterialStatus: formData.value.callMaterialStatus || '',
+ callMaterialStatus_FilterMode:
+ formData.value.callMaterialStatus_FilterMode || '',
+ quantity: formData.value.quantity || '',
+ quantity_FilterMode: formData.value.quantity_FilterMode || '',
+ wmsRetResult: formData.value.wmsRetResult || '',
+ wmsRetResult_FilterMode: formData.value.wmsRetResult_FilterMode || '',
+ wmsTaskNo: formData.value.wmsTaskNo || '',
+ wmsTaskNo_FilterMode: formData.value.wmsTaskNo_FilterMode || '',
+ creationTime: formData.value.creationTime || '',
+ lastModificationTime: formData.value.lastModificationTime || '',
+ creatorName: formData.value.creatorName || '',
+ creatorName_FilterMode: formData.value.creatorName_FilterMode || '',
+ lastModifierName: formData.value.lastModifierName || '',
+ lastModifierName_FilterMode:
+ formData.value.lastModifierName_FilterMode || '',
+ remark: formData.value.remark || '',
+ remark_FilterMode: formData.value.remark_FilterMode || '',
+ }
+ return data
+ }
+ const onClose = (done: () => void) => {
+ if (visible.value) {
+ visible.value = false
+ const data = commonGetFormData()
+ ctx.emit('close', data)
+ }
+ }
+ /**
+ * 纭鏌ヨ
+ */
+ const onConfirmQuery = async () => {
+ const data = commonGetFormData()
+ ctx.emit('confirmQuery', data)
+ }
+ /**
+ * 閲嶇疆鍏叡select鏌ヨ
+ */
+ const onResetForHighSelect = async () => {
+ formData.value.dataIdentifier_FilterMode = 1
+ formData.value.materialMode_FilterMode = 1
+ formData.value.materialBatch_FilterMode = 1
+ formData.value.callMaterialStatus_FilterMode = 2
+ formData.value.quantity_FilterMode = 2
+ formData.value.wmsRetResult_FilterMode = 1
+ formData.value.wmsTaskNo_FilterMode = 1
+ formData.value.creatorName_FilterMode = 1
+ formData.value.lastModifierName_FilterMode = 1
+ formData.value.remark_FilterMode = 1
+ }
+ /**
+ * 閲嶇疆鏌ヨ
+ */
+ const onReset = async () => {
+ formData.value = {}
+ onResetForHighSelect() //閲嶇疆鍏叡select鏌ヨ
+ formData.value.dataIdentifier = ''
+ formData.value.materialMode = ''
+ formData.value.materialBatch = ''
+ formData.value.callMaterialStatus = ''
+ formData.value.quantity = ''
+ formData.value.wmsRetResult = ''
+ formData.value.wmsTaskNo = ''
+ formData.value.creationTime = ''
+ formData.value.lastModificationTime = ''
+ formData.value.creatorName = ''
+ formData.value.lastModifierName = ''
+ formData.value.remark = ''
+ //鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢
+ ctx.emit('restQuery')
+ }
+
+ const updateCheckData = () => {
+ initiateData.value = {
+ formData: {
+ ...formData.value,
+ },
+ }
+ }
+ const updateFormItemOptions = (propName: string, enumData: any[]) => {
+ const item = formItems.find((item) => item.prop === propName)
+ if (item && enumData) {
+ item.options = enumData.map((item) => ({
+ label: item.description,
+ value: item.value,
+ }))
+ }
+ }
+ /**
+ * 閫氱敤鏌ヨ鏋氫妇
+ */
+ const commonQueryEnumForFrom = async () => {
+ const callMaterialStatusEnumEnum =
+ await callMaterialOrderDrawer.getWmsEnumData({
+ EnumName: 'CallMaterialStatusEnum',
+ })
+ updateFormItemOptions('callMaterialStatus', callMaterialStatusEnumEnum)
+ }
+ commonQueryEnumForFrom()
+ onResetForHighSelect() //閲嶇疆鍏叡select鏌ヨ
+ /**
+ * 寮圭獥鎵撳紑鑾峰彇璇︽儏
+ */
+ const onOpen = async () => {
+ disabled.value = false
+ updateCheckData()
+ }
+
+ watch(() => current.value, onOpen)
+
+ return {
+ formItems,
+ formData,
+ visible,
+ formRef,
+ onOpen,
+ onClose,
+ onConfirmQuery,
+ onReset,
+ }
+}
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/CallMaterialOrder.ts b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/CallMaterialOrder.ts
index 2506a38..84fbfe6 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/CallMaterialOrder.ts
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/CallMaterialOrder.ts
@@ -22,8 +22,8 @@
return deleteCallMaterialOrders(ids)
}
- async callMaterialByDataIdentifier(ids: string) {
- return callMaterialByDataIdentifier(ids)
+ async callMaterialByDataIdentifier(data: any) {
+ return callMaterialByDataIdentifier(data)
}
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/Service/CallMaterialOrder.ts b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/Service/CallMaterialOrder.ts
index 1047452..109405b 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/Service/CallMaterialOrder.ts
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Models/Service/CallMaterialOrder.ts
@@ -25,8 +25,8 @@
* callMaterialByDataIdentifier
* @returns
*/
-export const callMaterialByDataIdentifier = (id: string) => {
- return request.put(`/api/v1/PipeLineLems/callMaterialOrder/callMaterialByDataIdentifier/${id}`)
+export const callMaterialByDataIdentifier = (data: any) => {
+ return request.post('/api/v1/PipeLineLems/WorkPlanPublic/callMaterial', data)
}
/**
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/Dialog/CallMaterialOrderQueryDrawer/CallMaterialOrderQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/Dialog/CallMaterialOrderQueryDrawer/CallMaterialOrderQueryDrawer.tsx
index c1c94f6..2698811 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/Dialog/CallMaterialOrderQueryDrawer/CallMaterialOrderQueryDrawer.tsx
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/Dialog/CallMaterialOrderQueryDrawer/CallMaterialOrderQueryDrawer.tsx
@@ -5,7 +5,7 @@
import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer'
import styles from './CallMaterialOrderQueryDrawer.module.scss'
import { useCallMaterialOrderQueryDrawer } from '../../../../Controllers/CallMaterialOrderQueryDrawer.tsx'
-import DyForm from '@/components/DyForm/DyForm'
+import DyFormForHighQuery from '@/components/DyFormForHighQuery/DyFormForHighQuery'
// @ts-ignore
export default defineComponent<{
@@ -59,12 +59,12 @@
before-close={onClose}
onClose={onClose}
>
- <DyForm
+ <DyFormForHighQuery
ref={formRef}
formData={formData.value}
labelWidth="106px"
formItemProps={formItems}
- ></DyForm>
+ ></DyFormForHighQuery>
</BaseQueryDrawer>
)
},
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordDrawer.tsx
index 2cde788..b7c43cb 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordDrawer.tsx
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordDrawer.tsx
@@ -14,6 +14,10 @@
import isEqual from 'lodash/isEqual'
import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
import { cloneDeep } from 'lodash'
+// 寮曞叆鍏叡閫夐」閰嶇疆
+import {
+ BOOLEAN_OPTIONS_AddEdit
+} from '@/utils/commonOptionConstants';
export const useCallMaterialOrderRecordDrawer = (props: any, ctx?: any) => {
const callMaterialOrderRecordDrawer = injectModel<CallMaterialOrderRecordDrawer>('callMaterialOrderRecordDrawer')
@@ -90,6 +94,13 @@
el: 'input',
//disabled: disabled,
placeholder: '璇疯緭鍏ュ師鏂欏瀷鍙�',
+ },
+ {
+ label: '鍘熸枡鎵规',
+ prop: 'materialBatch',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ師鏂欐壒娆�',
},
{
label: '鍙枡鐘舵��',
@@ -176,6 +187,7 @@
const data = {
dataIdentifier: formData.value.dataIdentifier,
materialMode: formData.value.materialMode,
+materialBatch: formData.value.materialBatch,
callMaterialStatus: formData.value.callMaterialStatus,
quantity: formData.value.quantity,
wmsRetResult: formData.value.wmsRetResult,
@@ -229,6 +241,7 @@
formData.value = {
dataIdentifier: res.dataIdentifier,
materialMode: res.materialMode,
+materialBatch: res.materialBatch,
callMaterialStatus: res.callMaterialStatus,
quantity: res.quantity,
wmsRetResult: res.wmsRetResult,
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordQueryDrawer.tsx
index 286fb38..9363d9b 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordQueryDrawer.tsx
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Controllers/CallMaterialOrderRecordQueryDrawer.tsx
@@ -14,6 +14,15 @@
import isEqual from 'lodash/isEqual'
import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox'
import { cloneDeep } from 'lodash'
+// 寮曞叆鍏叡閫夐」閰嶇疆
+import {
+ FILTER_MODE_OPTIONS_STRING,
+ FILTER_MODE_OPTIONS_NUM,
+ FILTER_MODE_OPTIONS_BOOL
+} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions';
+import {
+ BOOLEAN_OPTIONS
+} from '@/utils/commonOptionConstants';
export const useCallMaterialOrderRecordQueryDrawer = (props: any, ctx?: any) => {
const callMaterialOrderRecordDrawer = injectModel<CallMaterialOrderRecordDrawer>('CallMaterialOrderRecordDrawer')
@@ -84,6 +93,12 @@
el: 'input',
//disabled: disabled,
placeholder: '璇疯緭鍏ュ師鏂欐爣璇�',
+ highSelectAttrs:{
+ prop: 'dataIdentifier_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_STRING
+ }
},
{
label: '鍘熸枡鍨嬪彿',
@@ -91,6 +106,25 @@
el: 'input',
//disabled: disabled,
placeholder: '璇疯緭鍏ュ師鏂欏瀷鍙�',
+ highSelectAttrs:{
+ prop: 'materialMode_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_STRING
+ }
+ },
+ {
+ label: '鍘熸枡鎵规',
+ prop: 'materialBatch',
+ el: 'input',
+ //disabled: disabled,
+ placeholder: '璇疯緭鍏ュ師鏂欐壒娆�',
+ highSelectAttrs:{
+ prop: 'materialBatch_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_STRING
+ }
},
{
label: '鍙枡鐘舵��',
@@ -100,6 +134,12 @@
option: [],
//disabled: disabled,
placeholder: '璇疯緭鍏ュ彨鏂欑姸鎬�',
+ highSelectAttrs:{
+ prop: 'callMaterialStatus_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_BOOL
+ }
},
{
label: '鍙枡鏁伴噺',
@@ -116,6 +156,12 @@
precision: 0,
//disabled: disabled,
placeholder: '璇疯緭鍏ュ彨鏂欐暟閲�',
+ highSelectAttrs:{
+ prop: 'quantity_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_NUM
+ }
},
{
label: 'WMS杩斿洖缁撴灉',
@@ -123,6 +169,12 @@
el: 'input',
//disabled: disabled,
placeholder: '璇疯緭鍏MS杩斿洖缁撴灉',
+ highSelectAttrs:{
+ prop: 'wmsRetResult_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_STRING
+ }
},
{
label: 'WMS浠诲姟鍙�',
@@ -130,6 +182,12 @@
el: 'input',
//disabled: disabled,
placeholder: '璇疯緭鍏MS浠诲姟鍙�',
+ highSelectAttrs:{
+ prop: 'wmsTaskNo_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_STRING
+ }
},
{
label: '鍒涘缓鏃堕棿',
@@ -144,6 +202,7 @@
width: '100%',
//disabled: disabled,
placeholder: '璇疯緭鍏ュ垱寤烘椂闂�',
+ isDateControl: true, // 鏄惧紡鏍囪涓烘棩鏈熸帶浠�
},
{
label: '淇敼鏃堕棿',
@@ -158,6 +217,7 @@
width: '100%',
//disabled: disabled,
placeholder: '璇疯緭鍏ヤ慨鏀规椂闂�',
+ isDateControl: true, // 鏄惧紡鏍囪涓烘棩鏈熸帶浠�
},
{
label: '鍒涘缓浜�',
@@ -165,6 +225,12 @@
el: 'input',
//disabled: disabled,
placeholder: '璇疯緭鍏ュ垱寤轰汉',
+ highSelectAttrs:{
+ prop: 'creatorName_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_STRING
+ }
},
{
label: '澶囨敞',
@@ -172,6 +238,12 @@
el: 'input',
//disabled: disabled,
placeholder: '璇疯緭鍏ュ娉�',
+ highSelectAttrs:{
+ prop: 'remark_FilterMode',
+ el: 'select',
+ placeholder: '璇烽�夋嫨',
+ options:FILTER_MODE_OPTIONS_STRING
+ }
},
])
/**
@@ -187,15 +259,25 @@
const commonGetFormData=()=>{
const data = {
dataIdentifier: formData.value.dataIdentifier || '',
+dataIdentifier_FilterMode: formData.value.dataIdentifier_FilterMode || '',
materialMode: formData.value.materialMode || '',
+materialMode_FilterMode: formData.value.materialMode_FilterMode || '',
+materialBatch: formData.value.materialBatch || '',
+materialBatch_FilterMode: formData.value.materialBatch_FilterMode || '',
callMaterialStatus: formData.value.callMaterialStatus || '',
+callMaterialStatus_FilterMode: formData.value.callMaterialStatus_FilterMode || '',
quantity: formData.value.quantity || '',
+quantity_FilterMode: formData.value.quantity_FilterMode || '',
wmsRetResult: formData.value.wmsRetResult || '',
+wmsRetResult_FilterMode: formData.value.wmsRetResult_FilterMode || '',
wmsTaskNo: formData.value.wmsTaskNo || '',
+wmsTaskNo_FilterMode: formData.value.wmsTaskNo_FilterMode || '',
creationTime: formData.value.creationTime || '',
lastModificationTime: formData.value.lastModificationTime || '',
creatorName: formData.value.creatorName || '',
-remark: formData.value.remark || '',
+creatorName_FilterMode: formData.value.creatorName_FilterMode || '',
+remark: formData.value.remark || '',
+remark_FilterMode: formData.value.remark_FilterMode || '',
}
return data;
}
@@ -213,22 +295,37 @@
const data =commonGetFormData();
ctx.emit('confirmQuery', data)
}
+ /**
+ * 閲嶇疆鍏叡select鏌ヨ
+ */
+ const onResetForHighSelect = async () => {
+ formData.value.dataIdentifier_FilterMode = 1
+formData.value.materialMode_FilterMode = 1
+formData.value.materialBatch_FilterMode = 1
+formData.value.callMaterialStatus_FilterMode = 2
+formData.value.quantity_FilterMode = 2
+formData.value.wmsRetResult_FilterMode = 1
+formData.value.wmsTaskNo_FilterMode = 1
+formData.value.creatorName_FilterMode = 1
+formData.value.remark_FilterMode = 1
+ }
/**
* 閲嶇疆鏌ヨ
*/
const onReset = async () => {
formData.value = {}
+ onResetForHighSelect();//閲嶇疆鍏叡select鏌ヨ
formData.value.dataIdentifier = ''
formData.value.materialMode = ''
+formData.value.materialBatch = ''
formData.value.callMaterialStatus = ''
formData.value.quantity = ''
formData.value.wmsRetResult = ''
formData.value.wmsTaskNo = ''
-formData.value.deletionTime = ''
-formData.value.remark = ''
-formData.value.extraField1 = ''
-formData.value.extraField2 = ''
-formData.value.extraField3 = ''
+formData.value.creationTime = ''
+formData.value.lastModificationTime = ''
+formData.value.creatorName = ''
+formData.value.remark = ''
//鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢
ctx.emit('restQuery');
}
@@ -260,6 +357,7 @@
}
commonQueryEnumForFrom()
+ onResetForHighSelect();//閲嶇疆鍏叡select鏌ヨ
/**
* 寮圭獥鎵撳紑鑾峰彇璇︽儏
*/
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx
index ed77a29..0957ae4 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx
@@ -23,6 +23,10 @@
ElFormItem,
} from 'element-plus'
import { injectModel } from '@/libs/Provider/Provider'
+// 寮曞叆鍏叡閫夐」閰嶇疆
+import {
+ FILTER_MODE_OPTIONS_STRING
+} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions';
interface RenderTableType {
url?: string
@@ -68,13 +72,14 @@
// 鏂板鐨勬煡璇㈡潯浠�
const queryForm = ref({
searchVal: '',
- str_searchFormInputAttrs:[]
+ str_searchFormInputAttrs:[],
+ searchVal_FilterMode:''
})
//瀹氫箟鏁翠綋妯$硦鏌ヨ鐨勫垪鏁扮粍(娉ㄦ剰锛氬繀椤诲ぇ灏忓啓璺熷悗绔殑瀹炰綋绫诲睘鎬у悕涓�鑷达紝鍚﹀垯浼氬鑷村尮閰嶄笉瀵圭殑闂)
const _searchFormInputAttrs = ref([
- 'DataIdentifier','MaterialMode','WmsRetResult','WmsTaskNo','CreatorName','Remark'
+ 'DataIdentifier','MaterialMode','MaterialBatch','WmsRetResult','WmsTaskNo','CreatorName','Remark'
]);
- const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ュ師鏂欐爣璇�/鍘熸枡鍨嬪彿/WMS杩斿洖缁撴灉/WMS浠诲姟鍙�/鍒涘缓浜�/澶囨敞');
+ const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ュ師鏂欐爣璇�/鍘熸枡鍨嬪彿/鍘熸枡鎵规/WMS杩斿洖缁撴灉/WMS浠诲姟鍙�/鍒涘缓浜�/澶囨敞');
// 鍔ㄦ�佹灇涓鹃�夐」
@@ -98,16 +103,20 @@
}
}
- // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹�
- onMounted(() => {
- fetchEnumData()
- })
+ // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹�
+ const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' });
+ // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹�
+ onMounted(() => {
+ fetchEnumData()
+ queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || '';
+ _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode;
+ _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value;
+ })
- // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹�
- const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[] });
// 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級
const handleQueryForMain = async () => {
_curHighQueryData.value.searchVal = queryForm.value.searchVal;
+ _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode;
_curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value;
tableRef.value.getList(_curHighQueryData.value)
}
@@ -120,6 +129,7 @@
// 鏂扮増鐨勬煡璇㈤噸缃�
const resetQuery = () => {
queryForm.value.searchVal = ''
+ queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || '';
queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value;
}
//鏂扮増鐨勫鍑烘柟娉�
@@ -137,6 +147,7 @@
const commonSaveCurHighQueryData=(filteredData={})=>{
_curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData };
_curHighQueryData.value.searchVal = queryForm.value.searchVal
+ _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode
_curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value;
}
//鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊�
@@ -150,6 +161,7 @@
)
//缁勫悎妯$硦鏌ヨ
filteredData.searchVal = queryForm.value.searchVal
+ filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode
filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value;
return filteredData;
}
@@ -271,7 +283,7 @@
<div class={styles.headerContent}>
<div class={styles.header}>
- {/* <IconButton
+ <IconButton
v-permission="callMaterialOrderRecord-add"
icon="add-p"
onClick={onAddCallMaterialOrderRecord}
@@ -281,8 +293,7 @@
</IconButton>
<el-divider direction="vertical" />
- <el-divider direction="vertical" /> */}
- {/* <el-upload
+ <el-upload
v-permission="callMaterialOrderRecord-import"
name="file"
accept=".xlsx,.xls,.csv"
@@ -294,7 +305,7 @@
action="/api/v1/PipeLineLems/callMaterialOrderRecord/import"
>
<IconButton icon="in">瀵煎叆</IconButton>
- </el-upload> */}
+ </el-upload>
<IconButton
v-permission="callMaterialOrderRecord-output"
@@ -320,6 +331,21 @@
/>
</el-tooltip>
</ElFormItem>
+ <ElFormItem label="" style="width:100px;">
+ <ElSelect
+ v-model={queryForm.value.searchVal_FilterMode}
+ placeholder="璇烽�夋嫨"
+ class={styles.formItem}
+ >
+ {FILTER_MODE_OPTIONS_STRING.map((option) => (
+ <ElOption
+ key={option.value}
+ label={option.label}
+ value={option.value}
+ />
+ ))}
+ </ElSelect>
+ </ElFormItem>
<IconButton type="primary" icon="search" onClick={handleQueryForMain}>
鏌ヨ
</IconButton>
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/Config.ts
index c21e13b..3807f1e 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/Config.ts
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/Config.ts
@@ -15,6 +15,11 @@
width:160,
},
{
+ field: 'materialBatch',
+ title: '鍘熸枡鎵规',
+ width:160,
+},
+{
field: 'callMaterialStatusDesc',
title: '鍙枡鐘舵��',
width:160,
diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/Dialog/CallMaterialOrderRecordQueryDrawer/CallMaterialOrderRecordQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/Dialog/CallMaterialOrderRecordQueryDrawer/CallMaterialOrderRecordQueryDrawer.tsx
index 2de58dd..ca66698 100644
--- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/Dialog/CallMaterialOrderRecordQueryDrawer/CallMaterialOrderRecordQueryDrawer.tsx
+++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/Dialog/CallMaterialOrderRecordQueryDrawer/CallMaterialOrderRecordQueryDrawer.tsx
@@ -5,7 +5,7 @@
import BaseQueryDrawer from '@/components/BaseQueryDrawer/BaseQueryDrawer'
import styles from './CallMaterialOrderRecordQueryDrawer.module.scss'
import { useCallMaterialOrderRecordQueryDrawer } from '../../../../Controllers/CallMaterialOrderRecordQueryDrawer.tsx'
-import DyForm from '@/components/DyForm/DyForm'
+import DyFormForHighQuery from '@/components/DyFormForHighQuery/DyFormForHighQuery'
// @ts-ignore
export default defineComponent<{
@@ -59,12 +59,12 @@
before-close={onClose}
onClose={onClose}
>
- <DyForm
+ <DyFormForHighQuery
ref={formRef}
formData={formData.value}
labelWidth="106px"
formItemProps={formItems}
- ></DyForm>
+ ></DyFormForHighQuery>
</BaseQueryDrawer>
)
},
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateDto.cs
index 5454ecf..4aacfeb 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateDto.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateDto.cs
@@ -14,4 +14,9 @@
/// 鏄惁绂佺敤
/// </summary>
public bool? IsDisabled { get; set; } = false;
+
+ /// <summary>
+ /// 鍒涘缓浜�
+ /// </summary>
+ public string CreatorName { get; set; }
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateOrUpdateDtoBase.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateOrUpdateDtoBase.cs
index 50e4529..ec2a2f6 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateOrUpdateDtoBase.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderCreateOrUpdateDtoBase.cs
@@ -20,6 +20,11 @@
public string? MaterialMode { get; set; }
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ public string? MaterialBatch { get; set; }
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
public CallMaterialStatusEnum CallMaterialStatus { get; set; }
@@ -29,15 +34,10 @@
/// </summary>
public int Quantity { get; set; }
- /// <summary>
- /// 鍒涘缓浜�
- /// </summary>
- public string CreatorName { get; set; }
-
- /// <summary>
- /// WMS杩斿洖缁撴灉
- /// </summary>
- public string? WmsRetResult { get; set; }
+ /// <summary>
+ /// WMS杩斿洖缁撴灉
+ /// </summary>
+ public string? WmsRetResult { get; set; }
/// <summary>
/// WMS浠诲姟鍙�
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderDto.cs
index bd55469..e475e0d 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderDto.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderDto.cs
@@ -23,6 +23,11 @@
public string? MaterialMode { get; set; }
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ public string? MaterialBatch { get; set; }
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
public CallMaterialStatusEnum CallMaterialStatus { get; set; }
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderExportModel.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderExportModel.cs
index 7b35d52..23dc2c9 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderExportModel.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderExportModel.cs
@@ -23,6 +23,12 @@
public string MaterialMode { get; set; }
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ [ExcelColumn(Name = "鍘熸枡鎵规", Width = 25)]
+ public string MaterialBatch { get; set; }
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
[ExcelColumn(Name = "鍙枡鐘舵��", Width = 25)]
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderUpdateDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderUpdateDto.cs
index 4af7767..e218d67 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderUpdateDto.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/CallMaterialOrderUpdateDto.cs
@@ -10,4 +10,9 @@
/// 骞跺彂鎴�
/// </summary>
public string ConcurrencyStamp { get; set; }
+
+ /// <summary>
+ /// 淇敼浜�
+ /// </summary>
+ public string LastModifierName { get; set; }
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/GetCallMaterialOrderInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/GetCallMaterialOrderInput.cs
index c1faf46..4ef7313 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/GetCallMaterialOrderInput.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/GetCallMaterialOrderInput.cs
@@ -65,6 +65,16 @@
public SearchFilterModeEnum MaterialMode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ;
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ public string MaterialBatch { get; set; }
+
+ /// <summary>
+ /// 鍘熸枡鎵规-鏌ヨ鍏崇郴杩愮畻绗�
+ /// </summary>
+ public SearchFilterModeEnum MaterialBatch_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ;
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
public CallMaterialStatusEnum? CallMaterialStatus { get; set; }
@@ -109,7 +119,7 @@
/// </summary>
//琛ㄧず鏄� 楂樼骇鏌ヨ鑼冨洿鏌ヨ鐗规��
[HighSearchRangeAttribute]
- public List<string> CreationTime { get; set; }
+ public string CreationTime { get; set; }
/// <summary>
@@ -127,7 +137,7 @@
/// </summary>
//琛ㄧず鏄� 楂樼骇鏌ヨ鑼冨洿鏌ヨ鐗规��
[HighSearchRangeAttribute]
- public List<string> LastModificationTime { get; set; }
+ public string LastModificationTime { get; set; }
/// <summary>
@@ -165,7 +175,7 @@
/// </summary>
//琛ㄧず鏄� 楂樼骇鏌ヨ鑼冨洿鏌ヨ鐗规��
[HighSearchRangeAttribute]
- public List<string> DeletionTime { get; set; }
+ public string DeletionTime { get; set; }
/// <summary>
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/MyCallMaterialOutput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/MyCallMaterialOutput.cs
new file mode 100644
index 0000000..68ace54
--- /dev/null
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrder/MyCallMaterialOutput.cs
@@ -0,0 +1,73 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Domain.Entities;
+
+namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder
+{
+ /// <summary>
+ /// 鍙枡杩斿洖
+ /// </summary>
+ public class MyCallMaterialOutput : ExtensibleEntityDto<Guid>, IHasConcurrencyStamp
+ {
+ public string MaterialNo { get; set; }
+ /// <summary>
+ /// 缂栧彿
+ /// </summary>
+ public virtual string MaterialId { get; set; }
+
+ /// <summary>
+ /// 鍚嶇О
+ /// </summary>
+ public virtual string MaterialName { get; set; }
+
+ /// <summary>
+ /// 瀹瑰櫒缂栧彿
+ /// </summary>
+ public string ContainerNo { get; set; }
+
+ /// <summary>
+ /// 鐗╂枡鎵规
+ /// </summary>
+ public string MaterialBatch { get; set; }
+
+ /// <summary>
+ /// 鍨嬪彿
+ /// </summary>
+ public string MaterialModel { get; set; }
+
+ /// <summary>
+ /// 搴撲綅缂栧彿
+ /// </summary>
+ public string PlaceNo { get; set; }
+
+ /// <summary>
+ /// 鍏ュ簱鏃堕棿
+ /// </summary>
+ public DateTime? InStockTime { get; set; }
+
+ /// <summary>
+ /// 浠诲姟鍙�
+ /// </summary>
+ public string TaskNo { get; set; }
+
+ /// <summary>
+ /// 鏉ユ簮鍗曟嵁鍙�
+ /// </summary>
+ public string? SourceOrderNo { get; set; }
+
+ /// <summary>
+ /// PLC浠诲姟鍙�
+ /// </summary>
+ public int PlcTaskId { get; set; }
+ public string ConcurrencyStamp
+ {
+ get
+ ;
+ set;
+ }
+ }
+}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateDto.cs
index 56600dc..691c650 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateDto.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateDto.cs
@@ -14,4 +14,9 @@
/// 鏄惁绂佺敤
/// </summary>
public bool? IsDisabled { get; set; } = false;
+
+ /// <summary>
+ /// 鍒涘缓浜�
+ /// </summary>
+ public string CreatorName { get; set; }
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateOrUpdateDtoBase.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateOrUpdateDtoBase.cs
index 387dc5e..43ee670 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateOrUpdateDtoBase.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordCreateOrUpdateDtoBase.cs
@@ -20,6 +20,11 @@
public string? MaterialMode { get; set; }
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ public string? MaterialBatch { get; set; }
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
public CallMaterialStatusEnum CallMaterialStatus { get; set; }
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordDto.cs
index 964f500..2ca1318 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordDto.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordDto.cs
@@ -23,6 +23,11 @@
public string? MaterialMode { get; set; }
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ public string? MaterialBatch { get; set; }
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
public CallMaterialStatusEnum CallMaterialStatus { get; set; }
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordExportModel.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordExportModel.cs
index 9fa756c..2339791 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordExportModel.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordExportModel.cs
@@ -23,6 +23,12 @@
public string MaterialMode { get; set; }
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ [ExcelColumn(Name = "鍘熸枡鎵规", Width = 25)]
+ public string MaterialBatch { get; set; }
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
[ExcelColumn(Name = "鍙枡鐘舵��", Width = 25)]
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordUpdateDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordUpdateDto.cs
index 625da3a..91e3a60 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordUpdateDto.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/CallMaterialOrderRecordUpdateDto.cs
@@ -10,4 +10,9 @@
/// 骞跺彂鎴�
/// </summary>
public string ConcurrencyStamp { get; set; }
+
+ /// <summary>
+ /// 淇敼浜�
+ /// </summary>
+ public string LastModifierName { get; set; }
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/GetCallMaterialOrderRecordInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/GetCallMaterialOrderRecordInput.cs
index 4fceba9..752d440 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/GetCallMaterialOrderRecordInput.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/CallMaterialOrderRecord/GetCallMaterialOrderRecordInput.cs
@@ -65,6 +65,16 @@
public SearchFilterModeEnum MaterialMode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ;
/// <summary>
+ /// 鍘熸枡鎵规
+ /// </summary>
+ public string MaterialBatch { get; set; }
+
+ /// <summary>
+ /// 鍘熸枡鎵规-鏌ヨ鍏崇郴杩愮畻绗�
+ /// </summary>
+ public SearchFilterModeEnum MaterialBatch_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ;
+
+ /// <summary>
/// 鍙枡鐘舵��
/// </summary>
public CallMaterialStatusEnum? CallMaterialStatus { get; set; }
@@ -109,7 +119,7 @@
/// </summary>
//琛ㄧず鏄� 楂樼骇鏌ヨ鑼冨洿鏌ヨ鐗规��
[HighSearchRangeAttribute]
- public List<string> CreationTime { get; set; }
+ public string CreationTime { get; set; }
/// <summary>
@@ -127,7 +137,7 @@
/// </summary>
//琛ㄧず鏄� 楂樼骇鏌ヨ鑼冨洿鏌ヨ鐗规��
[HighSearchRangeAttribute]
- public List<string> LastModificationTime { get; set; }
+ public string LastModificationTime { get; set; }
/// <summary>
@@ -165,7 +175,7 @@
/// </summary>
//琛ㄧず鏄� 楂樼骇鏌ヨ鑼冨洿鏌ヨ鐗规��
[HighSearchRangeAttribute]
- public List<string> DeletionTime { get; set; }
+ public string DeletionTime { get; set; }
/// <summary>
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CallMaterialByDataIdentifierInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CallMaterialByDataIdentifierInput.cs
new file mode 100644
index 0000000..e403ec4
--- /dev/null
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/CallMaterialByDataIdentifierInput.cs
@@ -0,0 +1,29 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan
+{
+ /// <summary>
+ /// 鍙枡杈撳叆鍙傛暟妯″瀷
+ /// </summary>
+ [Serializable]
+ public class CallMaterialByDataIdentifierInput
+ {
+
+ /// <summary>
+ /// 鍘熸枡鏍囪瘑
+ /// </summary>
+ public string DataIdentifier { get; set; }
+
+
+ /// <summary>
+ /// ID
+ /// </summary>
+ public Guid Id { get; set; }
+
+
+ }
+}
\ No newline at end of file
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderAppService.cs
index c1be461..d2778f6 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderAppService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderAppService.cs
@@ -1,66 +1,78 @@
-using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
-using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
-using System.Linq.Expressions;
-using Volo.Abp;
-using Volo.Abp.Application.Services;
-
-namespace CMS.Plugin.PipeLineLems.Application.Contracts.Services;
-
+using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
+using Volo.Abp.Application.Services;
+using CmsQueryExtensions.Entitys;
+using System.Linq.Expressions;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
+
+namespace CMS.Plugin.PipeLineLems.Application.Contracts.Services;
+
/// <summary>
/// 鍙枡鍗曡〃搴旂敤鏈嶅姟鎺ュ彛
/// </summary>
-public interface ICallMaterialOrderAppService : ICrudAppService<CallMaterialOrderDto, Guid, GetCallMaterialOrderInput, CallMaterialOrderCreateDto, CallMaterialOrderUpdateDto>
-{
+public interface ICallMaterialOrderAppService : ICrudAppService<CallMaterialOrderDto, Guid, GetCallMaterialOrderInput, CallMaterialOrderCreateDto, CallMaterialOrderUpdateDto>
+{
/// <summary>
/// 鍏嬮殕鍙枡鍗曡〃
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- Task<List<CallMaterialOrderDto>> CloneAsync(IEnumerable<Guid> ids);
-
+ Task<List<CallMaterialOrderDto>> CloneAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser);
+
/// <summary>
/// 鍒犻櫎鍙枡鍗曡〃
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- Task DeleteManyAsync(IEnumerable<Guid> ids);
-
- Task<CallMaterialOrder> FindByWmsTaskNoAsync(string wmsTaskNo);
-
-
- Task CallMaterialByDataIdentifier(Guid id);
-
+ Task DeleteManyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser);
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡鍗曡〃
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task DeletePermanentlyAsync(Guid id, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default);
+
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡鍗曡〃锛堢洿鎺ュ垹闄わ紝涓嶈蒋鍒犻櫎锛�
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default);
+
/// <summary>
/// 璋冩暣鎺掑簭鍙枡鍗曡〃
/// </summary>
/// <param name="id"></param>
/// <param name="sort"></param>
/// <returns></returns>
- Task AdjustSortAsync(Guid id, int sort);
-
+ Task AdjustSortAsync(Guid id, int sort);
+
/// <summary>
/// 瀵煎叆鍙枡鍗曡〃
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- Task ImportAsync(CallMaterialOrdersImportModel input);
-
+ Task ImportAsync(CallMaterialOrdersImportModel input, MyCurrentUser myCurrentUser);
+
/// <summary>
/// 瀵煎嚭鍙枡鍗曡〃
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetCallMaterialOrderInput input);
-
+ Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetCallMaterialOrderInput input);
+
/// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍙枡鍗曡〃鍒楄〃
/// </summary>
/// <param name="whereConditions"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
- Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default);
-
-
+ Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default);
+
+
/// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡鍗曡〃
/// </summary>
@@ -69,5 +81,5 @@
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default);
-}
+ Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default);
+}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderRecordAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderRecordAppService.cs
index 0dc6429..52fe8b8 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderRecordAppService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/ICallMaterialOrderRecordAppService.cs
@@ -1,5 +1,8 @@
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrderRecord;
using Volo.Abp.Application.Services;
+using CmsQueryExtensions.Entitys;
+using System.Linq.Expressions;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
namespace CMS.Plugin.PipeLineLems.Application.Contracts.Services;
@@ -13,14 +16,31 @@
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- Task<List<CallMaterialOrderRecordDto>> CloneAsync(IEnumerable<Guid> ids);
+ Task<List<CallMaterialOrderRecordDto>> CloneAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser);
/// <summary>
/// 鍒犻櫎鍙枡璁板綍琛�
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- Task DeleteManyAsync(IEnumerable<Guid> ids);
+ Task DeleteManyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser);
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task DeletePermanentlyAsync(Guid id, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default);
+
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡璁板綍琛紙鐩存帴鍒犻櫎锛屼笉杞垹闄わ級
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default);
/// <summary>
/// 璋冩暣鎺掑簭鍙枡璁板綍琛�
@@ -35,7 +55,7 @@
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- Task ImportAsync(CallMaterialOrderRecordsImportModel input);
+ Task ImportAsync(CallMaterialOrderRecordsImportModel input, MyCurrentUser myCurrentUser);
/// <summary>
/// 瀵煎嚭鍙枡璁板綍琛�
@@ -43,4 +63,23 @@
/// <param name="input"></param>
/// <returns></returns>
Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetCallMaterialOrderRecordInput input);
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍙枡璁板綍琛ㄥ垪琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task<List<CallMaterialOrderRecord>> GetListByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, CancellationToken cancellationToken = default);
+
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="isMultipleThrowException">鏄惁鏌ヨ鍑哄鏉″氨鎶ラ敊</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ /// <exception cref="UserFriendlyException"></exception>
+ Task<CallMaterialOrderRecord> GetSingleByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default);
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/CMS.Plugin.PipeLineLems.Application.csproj b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/CMS.Plugin.PipeLineLems.Application.csproj
index a8c00a1..1c2b41d 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/CMS.Plugin.PipeLineLems.Application.csproj
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/CMS.Plugin.PipeLineLems.Application.csproj
@@ -19,6 +19,15 @@
</ItemGroup>
<ItemGroup>
+ <Reference Include="CMS.Plugin.HIAWms.Abstractions">
+ <HintPath>..\..\..\..\..\..\Program Files\CMS Editor\plugins\cms.plugin.hiawms\net6.0\CMS.Plugin.HIAWms.Abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="CMS.Plugin.HIAWms.Application">
+ <HintPath>..\..\..\..\..\..\Program Files\CMS Editor\plugins\cms.plugin.hiawms\net6.0\CMS.Plugin.HIAWms.Application.dll</HintPath>
+ </Reference>
+ <Reference Include="CMS.Plugin.HIAWms.Application.Contracts">
+ <HintPath>..\..\..\..\..\..\Program Files\CMS Editor\plugins\cms.plugin.hiawms\net6.0\CMS.Plugin.HIAWms.Application.Contracts.dll</HintPath>
+ </Reference>
<Reference Include="CmsQueryExtensions">
<HintPath>..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath>
</Reference>
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderAppService.cs
index 440d4f5..bf336a6 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderAppService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderAppService.cs
@@ -1,140 +1,129 @@
-using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
-using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
-using CMS.Plugin.PipeLineLems.Domain.Shared;
-using CmsQueryExtensions;
-using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
-using CmsQueryExtensions.Extension;
-using System.Linq.Expressions;
-using Volo.Abp;
-using Volo.Abp.Application.Dtos;
-using Volo.Abp.Data;
-using Volo.Abp.ObjectExtending;
-using Volo.Abp.ObjectMapping;
-
-namespace CMS.Plugin.PipeLineLems.Application.Implements;
-
+using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
+using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
+using CMS.Plugin.PipeLineLems.Domain.Shared;
+using CmsQueryExtensions;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder;
+using CmsQueryExtensions.Extension;
+using System.Linq.Expressions;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Data;
+using Volo.Abp.ObjectExtending;
+using Volo.Abp.ObjectMapping;
+using CmsQueryExtensions.Entitys;
+
+namespace CMS.Plugin.PipeLineLems.Application.Implements;
+
/// <summary>
/// 鍙枡鍗曡〃搴旂敤鏈嶅姟
/// </summary>
-public class CallMaterialOrderAppService : CMSPluginAppService, ICallMaterialOrderAppService
-{
- private readonly ICallMaterialOrderRepository _callMaterialOrderRepository;
- private readonly SharedService _sharedService;
- private readonly IServiceProvider _serviceProvider;
+public class CallMaterialOrderAppService : CMSPluginAppService, ICallMaterialOrderAppService
+{
+ private readonly ICallMaterialOrderRepository _callMaterialOrderRepository;
+
/// <summary>
/// Initializes a new instance of the <see cref="CallMaterialOrderAppService"/> class.
/// </summary>
/// <param name="CallMaterialOrderRepository">The task job repository.</param>
- public CallMaterialOrderAppService(ICallMaterialOrderRepository callMaterialOrderRepository, SharedService sharedService, IServiceProvider serviceProvider)
- {
- _callMaterialOrderRepository = callMaterialOrderRepository;
- _sharedService = sharedService;
- _serviceProvider = serviceProvider;
- }
-
+ public CallMaterialOrderAppService(ICallMaterialOrderRepository callMaterialOrderRepository)
+ {
+ _callMaterialOrderRepository = callMaterialOrderRepository;
+ }
+
/// <summary>
/// 鑾峰彇鎸囧畾鍙枡鍗曡〃
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
- public virtual async Task<CallMaterialOrderDto> GetAsync(Guid id)
- {
- return ObjectMapper.Map<CallMaterialOrder, CallMaterialOrderDto>(await _callMaterialOrderRepository.GetAsync(id));
- }
-
- public virtual async Task CallMaterialByDataIdentifier(Guid id)
- {
- await _sharedService.CallMaterialByDataIdentifier(id, _serviceProvider);
- }
-
- public virtual async Task<CallMaterialOrder> FindByWmsTaskNoAsync(string wmsTaskNo)
- {
- return await _callMaterialOrderRepository.FindByWmsTaskNoAsync(wmsTaskNo);
- }
-
+ public virtual async Task<CallMaterialOrderDto> GetAsync(Guid id)
+ {
+ return ObjectMapper.Map<CallMaterialOrder, CallMaterialOrderDto>(await _callMaterialOrderRepository.GetAsync(id));
+ }
+
/// <summary>
/// 鍒嗛〉鑾峰彇鍙枡鍗曡〃
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- public virtual async Task<PagedResultDto<CallMaterialOrderDto>> GetListAsync(GetCallMaterialOrderInput input)
- {
- Check.NotNull(input, nameof(input));
-
- if (input.Sorting.IsNullOrWhiteSpace())
- {
- input.Sorting = nameof(CallMaterialOrder.Sort);
- }
-
+ public virtual async Task<PagedResultDto<CallMaterialOrderDto>> GetListAsync(GetCallMaterialOrderInput input)
+ {
+ Check.NotNull(input, nameof(input));
+
+ if (input.Sorting.IsNullOrWhiteSpace())
+ {
+ input.Sorting = nameof(CallMaterialOrder.Sort);
+ }
+
#region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
-
+
//鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
- var whereConditions = DynamicGetQueryParams(input);
-
- #endregion
-
- var count = await _callMaterialOrderRepository.GetCountAsync(whereConditions);
- var list = await _callMaterialOrderRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount);
-
- return new PagedResultDto<CallMaterialOrderDto>(count, ObjectMapper.Map<List<CallMaterialOrder>, List<CallMaterialOrderDto>>(list));
- }
-
+ var whereConditions = DynamicGetQueryParams(input);
+
+ #endregion
+
+ var count = await _callMaterialOrderRepository.GetCountAsync(whereConditions);
+ var list = await _callMaterialOrderRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount);
+
+ return new PagedResultDto<CallMaterialOrderDto>(count, ObjectMapper.Map<List<CallMaterialOrder>, List<CallMaterialOrderDto>>(list));
+ }
+
/// <summary>
/// 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
/// </summary>
/// <param name="input">杈撳叆鍙傛暟</param>
/// <returns></returns>
- private FunReturnResultModel<Expression<Func<CallMaterialOrder, bool>>> DynamicGetQueryParams(GetCallMaterialOrderInput input)
- {
+ private FunReturnResultModel<Expression<Func<CallMaterialOrder, bool>>> DynamicGetQueryParams(GetCallMaterialOrderInput input)
+ {
//鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
- var whereConditions = WhereConditionsExtensions.GetWhereConditions<CallMaterialOrder, GetCallMaterialOrderInput>(input);
- if (!whereConditions.IsSuccess)
- {
- throw new Exception("鍔ㄦ�佹瀯閫犳煡璇㈡潯浠跺け璐�:" + whereConditions.ErrMsg);
- }
-
+ var whereConditions = WhereConditionsExtensions.GetWhereConditions<CallMaterialOrder, GetCallMaterialOrderInput>(input);
+ if (!whereConditions.IsSuccess)
+ {
+ throw new Exception("鍔ㄦ�佹瀯閫犳煡璇㈡潯浠跺け璐�:" + whereConditions.ErrMsg);
+ }
+
//涔熷彲鍐嶆鑷畾涔夋瀯寤烘煡璇㈡潯浠�
- Expression<Func<CallMaterialOrder, bool>> extendExpression = a => a.IsDeleted == false;
+ Expression<Func<CallMaterialOrder, bool>> extendExpression = a => a.IsDeleted == false;
// 浣跨敤 System.Linq.PredicateBuilder 鐨� And
- var pres = (System.Linq.Expressions.Expression<Func<CallMaterialOrder, bool>>)(whereConditions.data);
- whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression);
-
- return whereConditions;
- }
-
+ var pres = (System.Linq.Expressions.Expression<Func<CallMaterialOrder, bool>>)(whereConditions.data);
+ whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression);
+
+ return whereConditions;
+ }
+
/// <summary>
/// 鏂板缓鍙枡鍗曡〃
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public virtual async Task<CallMaterialOrderDto> CreateAsync(CallMaterialOrderCreateDto input)
- {
- await CheckCreateOrUpdateDtoAsync(input);
-
- var exist = await _callMaterialOrderRepository.NameExistAsync(input.DataIdentifier);
- if (exist)
- {
- throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
- }
-
- var maxSort = await _callMaterialOrderRepository.GetMaxSortAsync();
- var sort = input.Sort ?? maxSort;
-
- var insertObj = ObjectMapper.Map<CallMaterialOrderCreateDto, CallMaterialOrder>(input);
- insertObj.Sort = sort;
- input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None);
-
- await _callMaterialOrderRepository.InsertAsync(insertObj);
-
+ public virtual async Task<CallMaterialOrderDto> CreateAsync(CallMaterialOrderCreateDto input)
+ {
+ await CheckCreateOrUpdateDtoAsync(input);
+
+ var exist = await _callMaterialOrderRepository.NameExistAsync(input.DataIdentifier);
+ if (exist)
+ {
+ throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
+ }
+
+ var maxSort = await _callMaterialOrderRepository.GetMaxSortAsync();
+ var sort = input.Sort ?? maxSort;
+
+ var insertObj = ObjectMapper.Map<CallMaterialOrderCreateDto, CallMaterialOrder>(input);
+ insertObj.Sort = sort;
+ input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None);
+
+ insertObj.CreatorName = input.CreatorName;//鍒涘缓浜�
+ await _callMaterialOrderRepository.InsertAsync(insertObj);
+
//if (input.Sort.HasValue && insertObj.Sort != maxSort)
//{
// await AdjustSortAsync(insertObj.Id, insertObj.Sort);
//}
-
- return ObjectMapper.Map<CallMaterialOrder, CallMaterialOrderDto>(insertObj);
- }
-
+
+ return ObjectMapper.Map<CallMaterialOrder, CallMaterialOrderDto>(insertObj);
+ }
+
/// <summary>
/// 鏇存柊鍙枡鍗曡〃
/// </summary>
@@ -142,302 +131,331 @@
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public virtual async Task<CallMaterialOrderDto> UpdateAsync(Guid id, CallMaterialOrderUpdateDto input)
- {
- await CheckCreateOrUpdateDtoAsync(input);
-
- var updateObj = await _callMaterialOrderRepository.GetAsync(id);
- var exist = await _callMaterialOrderRepository.NameExistAsync(input.DataIdentifier, updateObj.Id);
- if (exist)
- {
- throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
- }
-
- updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp);
- input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None);
-
- updateObj.DataIdentifier = input.DataIdentifier;
+ public virtual async Task<CallMaterialOrderDto> UpdateAsync(Guid id, CallMaterialOrderUpdateDto input)
+ {
+ await CheckCreateOrUpdateDtoAsync(input);
+
+ var updateObj = await _callMaterialOrderRepository.GetAsync(id);
+ var exist = await _callMaterialOrderRepository.NameExistAsync(input.DataIdentifier, updateObj.Id);
+ if (exist)
+ {
+ throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
+ }
+
+ updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp);
+ input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None);
+
+ updateObj.DataIdentifier = input.DataIdentifier;
updateObj.MaterialMode = input.MaterialMode;
+ updateObj.MaterialBatch = input.MaterialBatch;
updateObj.CallMaterialStatus = input.CallMaterialStatus;
updateObj.Quantity = input.Quantity;
updateObj.WmsRetResult = input.WmsRetResult;
updateObj.WmsTaskNo = input.WmsTaskNo;
updateObj.Remark = input.Remark;
-
-
- await _callMaterialOrderRepository.UpdateAsync(updateObj);
-
- return ObjectMapper.Map<CallMaterialOrder, CallMaterialOrderDto>(updateObj);
- }
-
+
+
+ updateObj.LastModifierName = input.LastModifierName;//淇敼浜�
+
+ await _callMaterialOrderRepository.UpdateAsync(updateObj);
+
+ return ObjectMapper.Map<CallMaterialOrder, CallMaterialOrderDto>(updateObj);
+ }
+
/// <summary>
/// 鍏嬮殕鍙枡鍗曡〃
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- public async Task<List<CallMaterialOrderDto>> CloneAsync(IEnumerable<Guid> ids)
- {
+ public async Task<List<CallMaterialOrderDto>> CloneAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser)
+ {
//var callMaterialOrders = new List<CallMaterialOrder>();
//if (ids != null)
//{
- // var sort = await callMaterialOrderRepository.GetMaxSortAsync();
+ // var sort = await _callMaterialOrderRepository.GetMaxSortAsync();
// foreach (var id in ids)
// {
- // var CallMaterialOrder = await callMaterialOrderRepository.FindAsync(id);
+ // var CallMaterialOrder = await _callMaterialOrderRepository.FindAsync(id);
// if (CallMaterialOrder != null)
// {
// var name = CallMaterialOrder.Name + CallMaterialOrderConsts.CloneTag;
// var notExist = false;
// while (!notExist)
// {
- // var exist = await callMaterialOrderRepository.NameExistAsync(name);
+ // var exist = await _callMaterialOrderRepository.NameExistAsync(name);
// if (exist || callMaterialOrders.Any(x => x.Name == name))
// {
// name += CallMaterialOrderConsts.CloneTag;
// continue;
// }
-
+
// notExist = true;
// }
-
- // //CallMaterialOrder = await callMaterialOrderRepository.InsertAsync(CallMaterialOrder.Clone(GuidGenerator.Create(), name, sort++));
+
+ // //CallMaterialOrder = await _callMaterialOrderRepository.InsertAsync(CallMaterialOrder.Clone(GuidGenerator.Create(), name, sort++));
// callMaterialOrders.Add(CallMaterialOrder);
// }
// }
//}
-
+
//return ObjectMapper.Map<List<CallMaterialOrder>, List<CallMaterialOrderDto>>(callMaterialOrders);
- return new List<CallMaterialOrderDto>();
- }
-
+ return new List<CallMaterialOrderDto>();
+ }
+
/// <summary>
/// 鍒犻櫎鍗曚釜鍙枡鍗曡〃
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
- public virtual Task DeleteAsync(Guid id)
- {
- return _callMaterialOrderRepository.DeleteAsync(id);
- }
-
+ public virtual Task DeleteAsync(Guid id)
+ {
+ return _callMaterialOrderRepository.DeleteAsync(id);
+ }
+
/// <summary>
/// 鍒犻櫎澶氫釜鍙枡鍗曡〃
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- public async Task DeleteManyAsync(IEnumerable<Guid> ids)
- {
- foreach (var id in ids)
- {
- await DeleteAsync(id);
- }
- }
-
+ public async Task DeleteManyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser)
+ {
+ foreach (var id in ids)
+ {
+ await DeleteAsync(id);
+ }
+ }
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡鍗曡〃
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task DeletePermanentlyAsync(Guid id, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default)
+ {
+ _callMaterialOrderRepository.DeletePermanentlyAsync(id);
+ }
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡鍗曡〃锛堢洿鎺ュ垹闄わ紝涓嶈蒋鍒犻櫎锛�
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default)
+ {
+ _callMaterialOrderRepository.BatchDeletePermanentlyAsync(ids);
+ }
+
/// <summary>
/// 璋冩暣鎺掑簭鍙枡鍗曡〃
/// </summary>
/// <param name="id"></param>
/// <param name="sort"></param>
/// <returns></returns>
- public virtual async Task AdjustSortAsync(Guid id, int sort)
- {
- var list = await _callMaterialOrderRepository.GetListAsync(null, nameof(CallMaterialOrder.Sort));
- if (list != null && list.Any())
- {
- var initSort = 1;
- list.ForEach(x => x.AdjustSort(initSort++));
- var entity = list.FirstOrDefault(x => x.Id == id);
- if (entity != null)
- {
- if (sort == 1)
- {
- list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
- }
- else if (entity.Sort > sort)
- {
- list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
- list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
- }
- else if (entity.Sort < sort)
- {
- list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
- list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
- }
-
- entity.AdjustSort(sort);
- }
- }
-
- await _callMaterialOrderRepository.UpdateManyAsync(list);
- }
-
+ public virtual async Task AdjustSortAsync(Guid id, int sort)
+ {
+ var list = await _callMaterialOrderRepository.GetListAsync(null, nameof(CallMaterialOrder.Sort));
+ if (list != null && list.Any())
+ {
+ var initSort = 1;
+ list.ForEach(x => x.AdjustSort(initSort++));
+ var entity = list.FirstOrDefault(x => x.Id == id);
+ if (entity != null)
+ {
+ if (sort == 1)
+ {
+ list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
+ }
+ else if (entity.Sort > sort)
+ {
+ list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
+ list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
+ }
+ else if (entity.Sort < sort)
+ {
+ list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
+ list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
+ }
+
+ entity.AdjustSort(sort);
+ }
+ }
+
+ await _callMaterialOrderRepository.UpdateManyAsync(list);
+ }
+
/// <summary>
/// 瀵煎叆鍙枡鍗曡〃
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public async Task ImportAsync(CallMaterialOrdersImportModel input)
- {
- Check.NotNull(input, nameof(input));
-
- var callMaterialOrderCreateDtos = new List<(int RowIndex, CallMaterialOrderCreateDto Item)>();
- var callMaterialOrderUpdateDtos = new List<(int RowIndex, Guid Id, CallMaterialOrderUpdateDto Item)>();
- var importItems = input.CallMaterialOrders;
-
- if (importItems != null && importItems.Any())
- {
+ public async Task ImportAsync(CallMaterialOrdersImportModel input, MyCurrentUser myCurrentUser)
+ {
+ Check.NotNull(input, nameof(input));
+
+ var callMaterialOrderCreateDtos = new List<(int RowIndex, CallMaterialOrderCreateDto Item)>();
+ var callMaterialOrderUpdateDtos = new List<(int RowIndex, Guid Id, CallMaterialOrderUpdateDto Item)>();
+ var importItems = input.CallMaterialOrders;
+
+ if (importItems != null && importItems.Any())
+ {
#region 瀵煎叆鏍¢獙
-
+
// 鍒ゆ柇鍚嶇О鏄惁閲嶅锛屽苟杈撳嚭绗嚑琛岄噸澶�
- var duplicateCallMaterialOrders = importItems.GroupBy(x => x.DataIdentifier).Where(x => x.Count() > 1).ToList();
- if (duplicateCallMaterialOrders?.Any() == true)
- {
- var duplicateCallMaterialOrderMsgs = duplicateCallMaterialOrders.Select(x => $"绗� {string.Join(",", x.Select(x => x.RowIndex))} 琛岋細{x.Key} 鍚嶇О閲嶅");
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝 {string.Join(",", duplicateCallMaterialOrderMsgs)}锛岀粓姝㈠鍏�";
- throw new UserFriendlyException(errorMsg);
- }
-
- #endregion
-
- foreach (var impItem in importItems)
- {
- if (impItem.DataIdentifier.IsNullOrWhiteSpace())
- {
- continue;
- }
-
- if (impItem.DataIdentifier.IsNullOrWhiteSpace())
- {
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊impItem.RowIndex}琛岋細CallMaterialOrder鍚嶇О涓嶈兘涓虹┖";
- throw new UserFriendlyException(errorMsg);
- }
-
- var oldCallMaterialOrder = await _callMaterialOrderRepository.FindByNameAsync(impItem.DataIdentifier);
- if (oldCallMaterialOrder != null)
- {
- var callMaterialOrderUpdateDto = new CallMaterialOrderUpdateDto
- {
+ var duplicateCallMaterialOrders = importItems.GroupBy(x => x.DataIdentifier).Where(x => x.Count() > 1).ToList();
+ if (duplicateCallMaterialOrders?.Any() == true)
+ {
+ var duplicateCallMaterialOrderMsgs = duplicateCallMaterialOrders.Select(x => $"绗� {string.Join(",", x.Select(x => x.RowIndex))} 琛岋細{x.Key} 鍚嶇О閲嶅");
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝 {string.Join(",", duplicateCallMaterialOrderMsgs)}锛岀粓姝㈠鍏�";
+ throw new UserFriendlyException(errorMsg);
+ }
+
+ #endregion
+
+ foreach (var impItem in importItems)
+ {
+ if (impItem.DataIdentifier.IsNullOrWhiteSpace())
+ {
+ continue;
+ }
+
+ if (impItem.DataIdentifier.IsNullOrWhiteSpace())
+ {
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊impItem.RowIndex}琛岋細CallMaterialOrder鍚嶇О涓嶈兘涓虹┖";
+ throw new UserFriendlyException(errorMsg);
+ }
+
+ var oldCallMaterialOrder = await _callMaterialOrderRepository.FindByNameAsync(impItem.DataIdentifier);
+ if (oldCallMaterialOrder != null)
+ {
+ var callMaterialOrderUpdateDto = new CallMaterialOrderUpdateDto
+ {
DataIdentifier = impItem.DataIdentifier,
- MaterialMode = impItem.MaterialMode,
- CallMaterialStatus = impItem.CallMaterialStatus,
- Quantity = impItem.Quantity,
- WmsRetResult = impItem.WmsRetResult,
- WmsTaskNo = impItem.WmsTaskNo,
- Remark = impItem.Remark,
-
- };
-
- callMaterialOrderUpdateDtos.Add((impItem.RowIndex, oldCallMaterialOrder.Id, callMaterialOrderUpdateDto));
- }
- else
- {
- var callMaterialOrderCreateDto = new CallMaterialOrderCreateDto
- {
+MaterialMode = impItem.MaterialMode,
+MaterialBatch = impItem.MaterialBatch,
+CallMaterialStatus = impItem.CallMaterialStatus,
+Quantity = impItem.Quantity,
+WmsRetResult = impItem.WmsRetResult,
+WmsTaskNo = impItem.WmsTaskNo,
+Remark = impItem.Remark,
+
+ };
+
+ callMaterialOrderUpdateDtos.Add((impItem.RowIndex, oldCallMaterialOrder.Id, callMaterialOrderUpdateDto));
+ }
+ else
+ {
+ var callMaterialOrderCreateDto = new CallMaterialOrderCreateDto
+ {
DataIdentifier = impItem.DataIdentifier,
- MaterialMode = impItem.MaterialMode,
- CallMaterialStatus = impItem.CallMaterialStatus,
- Quantity = impItem.Quantity,
- WmsRetResult = impItem.WmsRetResult,
- WmsTaskNo = impItem.WmsTaskNo,
- Remark = impItem.Remark,
-
- };
-
- callMaterialOrderCreateDtos.Add((impItem.RowIndex, callMaterialOrderCreateDto));
- }
- }
- }
-
+MaterialMode = impItem.MaterialMode,
+MaterialBatch = impItem.MaterialBatch,
+CallMaterialStatus = impItem.CallMaterialStatus,
+Quantity = impItem.Quantity,
+WmsRetResult = impItem.WmsRetResult,
+WmsTaskNo = impItem.WmsTaskNo,
+Remark = impItem.Remark,
+
+ };
+
+ callMaterialOrderCreateDtos.Add((impItem.RowIndex, callMaterialOrderCreateDto));
+ }
+ }
+ }
+
// 鏂板
- foreach (var callMaterialOrderDto in callMaterialOrderCreateDtos)
- {
- try
- {
- await CreateAsync(callMaterialOrderDto.Item);
- }
- catch (Exception e)
- {
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
- throw new UserFriendlyException(errorMsg);
- }
- }
-
+ foreach (var callMaterialOrderDto in callMaterialOrderCreateDtos)
+ {
+ try
+ {
+ callMaterialOrderDto.Item.CreatorName = myCurrentUser.UserAccount;//鍒涘缓浜�
+ await CreateAsync(callMaterialOrderDto.Item);
+ }
+ catch (Exception e)
+ {
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
+ throw new UserFriendlyException(errorMsg);
+ }
+ }
+
// 鏇存柊
- foreach (var callMaterialOrderDto in callMaterialOrderUpdateDtos)
- {
- try
- {
- await UpdateAsync(callMaterialOrderDto.Id, callMaterialOrderDto.Item);
- }
- catch (Exception e)
- {
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
- throw new UserFriendlyException(errorMsg);
- }
- }
- }
-
+ foreach (var callMaterialOrderDto in callMaterialOrderUpdateDtos)
+ {
+ try
+ {
+ callMaterialOrderDto.Item.LastModifierName = myCurrentUser.UserAccount;//淇敼浜�
+ await UpdateAsync(callMaterialOrderDto.Id, callMaterialOrderDto.Item);
+ }
+ catch (Exception e)
+ {
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
+ throw new UserFriendlyException(errorMsg);
+ }
+ }
+ }
+
/// <summary>
/// 瀵煎嚭鍙枡鍗曡〃
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetCallMaterialOrderInput input)
- {
- Check.NotNull(input, nameof(input));
-
- if (input.Sorting.IsNullOrWhiteSpace())
- {
- input.Sorting = nameof(CallMaterialOrder.Sort);
- }
-
+ public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetCallMaterialOrderInput input)
+ {
+ Check.NotNull(input, nameof(input));
+
+ if (input.Sorting.IsNullOrWhiteSpace())
+ {
+ input.Sorting = nameof(CallMaterialOrder.Sort);
+ }
+
#region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
-
+
//鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
- var whereConditions = DynamicGetQueryParams(input);
-
- #endregion
-
-
- var list = await _callMaterialOrderRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true);
- var result = ObjectMapper.Map<List<CallMaterialOrder>, List<CallMaterialOrderDto>>(list);
-
- var sheets = new Dictionary<string, object>
- {
- ["閰嶇疆"] = ExportHelper.ConvertListToExportData(result),
- };
-
- var fileName = "鍙枡鍗�";
- return (sheets, fileName);
- }
-
+ var whereConditions = DynamicGetQueryParams(input);
+
+ #endregion
+
+
+ var list = await _callMaterialOrderRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true);
+ var result = ObjectMapper.Map<List<CallMaterialOrder>, List<CallMaterialOrderDto>>(list);
+
+ var sheets = new Dictionary<string, object>
+ {
+ ["閰嶇疆"] = ExportHelper.ConvertListToExportData(result),
+ };
+
+ var fileName = "鍙枡鍗�";
+ return (sheets, fileName);
+ }
+
/// <summary>
/// 鏍¢獙鍙枡鍗曡〃锛屽綋鏂板缓鎴栨洿鏂版椂
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- protected Task CheckCreateOrUpdateDtoAsync(CallMaterialOrderCreateOrUpdateDtoBase input)
- {
- Check.NotNull(input, nameof(input));
- Check.NotNullOrWhiteSpace(input.DataIdentifier, "鍘熸枡鏍囪瘑", 256);
+ protected Task CheckCreateOrUpdateDtoAsync(CallMaterialOrderCreateOrUpdateDtoBase input)
+ {
+ Check.NotNull(input, nameof(input));
+ Check.NotNullOrWhiteSpace(input.DataIdentifier, "鍘熸枡鏍囪瘑", 256);
Check.NotNull(input.CallMaterialStatus, "鍙枡鐘舵��");
Check.NotNull(input.Quantity, "鍙枡鏁伴噺");
-
- return Task.CompletedTask;
- }
-
- /// <summary>
+
+ return Task.CompletedTask;
+ }
+
+ /// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍙枡鍗曡〃鍒楄〃
/// </summary>
/// <param name="whereConditions"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
- public async Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default)
- {
- return await _callMaterialOrderRepository.GetListByFilterAsync(whereConditions);
- }
-
+ public async Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default)
+ {
+ return await _callMaterialOrderRepository.GetListByFilterAsync(whereConditions);
+ }
+
/// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡鍗曡〃
/// </summary>
@@ -446,8 +464,8 @@
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public async Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default)
- {
- return await _callMaterialOrderRepository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException);
- }
-}
+ public async Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default)
+ {
+ return await _callMaterialOrderRepository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException);
+ }
+}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderRecordAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderRecordAppService.cs
index 1919b86..064692b 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderRecordAppService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/CallMaterialOrderRecordAppService.cs
@@ -1,127 +1,129 @@
-using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrderRecord;
-using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
-using CMS.Plugin.PipeLineLems.Domain.Shared;
-using CmsQueryExtensions;
-using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
-using CmsQueryExtensions.Extension;
-using System.Linq.Expressions;
-using Volo.Abp;
-using Volo.Abp.Application.Dtos;
-using Volo.Abp.Data;
-using Volo.Abp.ObjectExtending;
-using Volo.Abp.ObjectMapping;
-
-namespace CMS.Plugin.PipeLineLems.Application.Implements;
-
+using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrderRecord;
+using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
+using CMS.Plugin.PipeLineLems.Domain.Shared;
+using CmsQueryExtensions;
+using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord;
+using CmsQueryExtensions.Extension;
+using System.Linq.Expressions;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Data;
+using Volo.Abp.ObjectExtending;
+using Volo.Abp.ObjectMapping;
+using CmsQueryExtensions.Entitys;
+
+namespace CMS.Plugin.PipeLineLems.Application.Implements;
+
/// <summary>
/// 鍙枡璁板綍琛ㄥ簲鐢ㄦ湇鍔�
/// </summary>
-public class CallMaterialOrderRecordAppService : CMSPluginAppService, ICallMaterialOrderRecordAppService
-{
- private readonly ICallMaterialOrderRecordRepository callMaterialOrderRecordRepository;
-
+public class CallMaterialOrderRecordAppService : CMSPluginAppService, ICallMaterialOrderRecordAppService
+{
+ private readonly ICallMaterialOrderRecordRepository _callMaterialOrderRecordRepository;
+
/// <summary>
/// Initializes a new instance of the <see cref="CallMaterialOrderRecordAppService"/> class.
/// </summary>
/// <param name="CallMaterialOrderRecordRepository">The task job repository.</param>
- public CallMaterialOrderRecordAppService(ICallMaterialOrderRecordRepository _CallMaterialOrderRecordRepository)
- {
- callMaterialOrderRecordRepository = _CallMaterialOrderRecordRepository;
- }
-
+ public CallMaterialOrderRecordAppService(ICallMaterialOrderRecordRepository callMaterialOrderRecordRepository)
+ {
+ _callMaterialOrderRecordRepository = callMaterialOrderRecordRepository;
+ }
+
/// <summary>
/// 鑾峰彇鎸囧畾鍙枡璁板綍琛�
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
- public virtual async Task<CallMaterialOrderRecordDto> GetAsync(Guid id)
- {
- return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(await callMaterialOrderRecordRepository.GetAsync(id));
- }
-
+ public virtual async Task<CallMaterialOrderRecordDto> GetAsync(Guid id)
+ {
+ return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(await _callMaterialOrderRecordRepository.GetAsync(id));
+ }
+
/// <summary>
/// 鍒嗛〉鑾峰彇鍙枡璁板綍琛�
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- public virtual async Task<PagedResultDto<CallMaterialOrderRecordDto>> GetListAsync(GetCallMaterialOrderRecordInput input)
- {
- Check.NotNull(input, nameof(input));
-
- if (input.Sorting.IsNullOrWhiteSpace())
- {
- input.Sorting = nameof(CallMaterialOrderRecord.Sort);
- }
-
+ public virtual async Task<PagedResultDto<CallMaterialOrderRecordDto>> GetListAsync(GetCallMaterialOrderRecordInput input)
+ {
+ Check.NotNull(input, nameof(input));
+
+ if (input.Sorting.IsNullOrWhiteSpace())
+ {
+ input.Sorting = nameof(CallMaterialOrderRecord.Sort);
+ }
+
#region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
-
+
//鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
- var whereConditions = DynamicGetQueryParams(input);
-
- #endregion
-
- var count = await callMaterialOrderRecordRepository.GetCountAsync(whereConditions);
- var list = await callMaterialOrderRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount);
-
- return new PagedResultDto<CallMaterialOrderRecordDto>(count, ObjectMapper.Map<List<CallMaterialOrderRecord>, List<CallMaterialOrderRecordDto>>(list));
- }
-
+ var whereConditions = DynamicGetQueryParams(input);
+
+ #endregion
+
+ var count = await _callMaterialOrderRecordRepository.GetCountAsync(whereConditions);
+ var list = await _callMaterialOrderRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount);
+
+ return new PagedResultDto<CallMaterialOrderRecordDto>(count, ObjectMapper.Map<List<CallMaterialOrderRecord>, List<CallMaterialOrderRecordDto>>(list));
+ }
+
/// <summary>
/// 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
/// </summary>
/// <param name="input">杈撳叆鍙傛暟</param>
/// <returns></returns>
- private FunReturnResultModel<Expression<Func<CallMaterialOrderRecord, bool>>> DynamicGetQueryParams(GetCallMaterialOrderRecordInput input)
- {
+ private FunReturnResultModel<Expression<Func<CallMaterialOrderRecord, bool>>> DynamicGetQueryParams(GetCallMaterialOrderRecordInput input)
+ {
//鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
- var whereConditions = WhereConditionsExtensions.GetWhereConditions<CallMaterialOrderRecord, GetCallMaterialOrderRecordInput>(input);
- if (!whereConditions.IsSuccess)
- {
- throw new Exception("鍔ㄦ�佹瀯閫犳煡璇㈡潯浠跺け璐�:" + whereConditions.ErrMsg);
- }
-
+ var whereConditions = WhereConditionsExtensions.GetWhereConditions<CallMaterialOrderRecord, GetCallMaterialOrderRecordInput>(input);
+ if (!whereConditions.IsSuccess)
+ {
+ throw new Exception("鍔ㄦ�佹瀯閫犳煡璇㈡潯浠跺け璐�:" + whereConditions.ErrMsg);
+ }
+
//涔熷彲鍐嶆鑷畾涔夋瀯寤烘煡璇㈡潯浠�
- Expression<Func<CallMaterialOrderRecord, bool>> extendExpression = a => a.IsDeleted == false;
+ Expression<Func<CallMaterialOrderRecord, bool>> extendExpression = a => a.IsDeleted == false;
// 浣跨敤 System.Linq.PredicateBuilder 鐨� And
- var pres = (System.Linq.Expressions.Expression<Func<CallMaterialOrderRecord, bool>>)(whereConditions.data);
- whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression);
-
- return whereConditions;
- }
-
+ var pres = (System.Linq.Expressions.Expression<Func<CallMaterialOrderRecord, bool>>)(whereConditions.data);
+ whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression);
+
+ return whereConditions;
+ }
+
/// <summary>
/// 鏂板缓鍙枡璁板綍琛�
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public virtual async Task<CallMaterialOrderRecordDto> CreateAsync(CallMaterialOrderRecordCreateDto input)
- {
- await CheckCreateOrUpdateDtoAsync(input);
-
- var exist = await callMaterialOrderRecordRepository.NameExistAsync(input.DataIdentifier);
- if (exist)
- {
- throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
- }
-
- var maxSort = await callMaterialOrderRecordRepository.GetMaxSortAsync();
- var sort = input.Sort ?? maxSort;
-
- var insertObj = ObjectMapper.Map<CallMaterialOrderRecordCreateDto, CallMaterialOrderRecord>(input);
- insertObj.Sort = sort;
- input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None);
-
- await callMaterialOrderRecordRepository.InsertAsync(insertObj);
-
+ public virtual async Task<CallMaterialOrderRecordDto> CreateAsync(CallMaterialOrderRecordCreateDto input)
+ {
+ await CheckCreateOrUpdateDtoAsync(input);
+
+ var exist = await _callMaterialOrderRecordRepository.NameExistAsync(input.DataIdentifier);
+ if (exist)
+ {
+ throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
+ }
+
+ var maxSort = await _callMaterialOrderRecordRepository.GetMaxSortAsync();
+ var sort = input.Sort ?? maxSort;
+
+ var insertObj = ObjectMapper.Map<CallMaterialOrderRecordCreateDto, CallMaterialOrderRecord>(input);
+ insertObj.Sort = sort;
+ input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None);
+
+ insertObj.CreatorName = input.CreatorName;//鍒涘缓浜�
+ await _callMaterialOrderRecordRepository.InsertAsync(insertObj);
+
//if (input.Sort.HasValue && insertObj.Sort != maxSort)
//{
// await AdjustSortAsync(insertObj.Id, insertObj.Sort);
//}
-
- return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(insertObj);
- }
-
+
+ return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(insertObj);
+ }
+
/// <summary>
/// 鏇存柊鍙枡璁板綍琛�
/// </summary>
@@ -129,288 +131,341 @@
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public virtual async Task<CallMaterialOrderRecordDto> UpdateAsync(Guid id, CallMaterialOrderRecordUpdateDto input)
- {
- await CheckCreateOrUpdateDtoAsync(input);
-
- var updateObj = await callMaterialOrderRecordRepository.GetAsync(id);
- var exist = await callMaterialOrderRecordRepository.NameExistAsync(input.DataIdentifier, updateObj.Id);
- if (exist)
- {
- throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
- }
-
- updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp);
- input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None);
-
- updateObj.DataIdentifier = input.DataIdentifier;
+ public virtual async Task<CallMaterialOrderRecordDto> UpdateAsync(Guid id, CallMaterialOrderRecordUpdateDto input)
+ {
+ await CheckCreateOrUpdateDtoAsync(input);
+
+ var updateObj = await _callMaterialOrderRecordRepository.GetAsync(id);
+ var exist = await _callMaterialOrderRecordRepository.NameExistAsync(input.DataIdentifier, updateObj.Id);
+ if (exist)
+ {
+ throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]);
+ }
+
+ updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp);
+ input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None);
+
+ updateObj.DataIdentifier = input.DataIdentifier;
updateObj.MaterialMode = input.MaterialMode;
+ updateObj.MaterialBatch = input.MaterialBatch;
updateObj.CallMaterialStatus = input.CallMaterialStatus;
updateObj.Quantity = input.Quantity;
updateObj.WmsRetResult = input.WmsRetResult;
updateObj.WmsTaskNo = input.WmsTaskNo;
updateObj.Remark = input.Remark;
-
-
- await callMaterialOrderRecordRepository.UpdateAsync(updateObj);
-
- return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(updateObj);
- }
-
+
+
+
+
+ await _callMaterialOrderRecordRepository.UpdateAsync(updateObj);
+
+ return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(updateObj);
+ }
+
/// <summary>
/// 鍏嬮殕鍙枡璁板綍琛�
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- public async Task<List<CallMaterialOrderRecordDto>> CloneAsync(IEnumerable<Guid> ids)
- {
+ public async Task<List<CallMaterialOrderRecordDto>> CloneAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser)
+ {
//var callMaterialOrderRecords = new List<CallMaterialOrderRecord>();
//if (ids != null)
//{
- // var sort = await callMaterialOrderRecordRepository.GetMaxSortAsync();
+ // var sort = await _callMaterialOrderRecordRepository.GetMaxSortAsync();
// foreach (var id in ids)
// {
- // var CallMaterialOrderRecord = await callMaterialOrderRecordRepository.FindAsync(id);
+ // var CallMaterialOrderRecord = await _callMaterialOrderRecordRepository.FindAsync(id);
// if (CallMaterialOrderRecord != null)
// {
// var name = CallMaterialOrderRecord.Name + CallMaterialOrderRecordConsts.CloneTag;
// var notExist = false;
// while (!notExist)
// {
- // var exist = await callMaterialOrderRecordRepository.NameExistAsync(name);
+ // var exist = await _callMaterialOrderRecordRepository.NameExistAsync(name);
// if (exist || callMaterialOrderRecords.Any(x => x.Name == name))
// {
// name += CallMaterialOrderRecordConsts.CloneTag;
// continue;
// }
-
+
// notExist = true;
// }
-
- // //CallMaterialOrderRecord = await callMaterialOrderRecordRepository.InsertAsync(CallMaterialOrderRecord.Clone(GuidGenerator.Create(), name, sort++));
+
+ // //CallMaterialOrderRecord = await _callMaterialOrderRecordRepository.InsertAsync(CallMaterialOrderRecord.Clone(GuidGenerator.Create(), name, sort++));
// callMaterialOrderRecords.Add(CallMaterialOrderRecord);
// }
// }
//}
-
+
//return ObjectMapper.Map<List<CallMaterialOrderRecord>, List<CallMaterialOrderRecordDto>>(callMaterialOrderRecords);
- return new List<CallMaterialOrderRecordDto>();
- }
-
+ return new List<CallMaterialOrderRecordDto>();
+ }
+
/// <summary>
/// 鍒犻櫎鍗曚釜鍙枡璁板綍琛�
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
- public virtual Task DeleteAsync(Guid id)
- {
- return callMaterialOrderRecordRepository.DeleteAsync(id);
- }
-
+ public virtual Task DeleteAsync(Guid id)
+ {
+ return _callMaterialOrderRecordRepository.DeleteAsync(id);
+ }
+
/// <summary>
/// 鍒犻櫎澶氫釜鍙枡璁板綍琛�
/// </summary>
/// <param name="ids"></param>
/// <returns></returns>
- public async Task DeleteManyAsync(IEnumerable<Guid> ids)
- {
- foreach (var id in ids)
- {
- await DeleteAsync(id);
- }
- }
-
+ public async Task DeleteManyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser)
+ {
+ foreach (var id in ids)
+ {
+ await DeleteAsync(id);
+ }
+ }
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task DeletePermanentlyAsync(Guid id, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default)
+ {
+ _callMaterialOrderRecordRepository.DeletePermanentlyAsync(id);
+ }
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡璁板綍琛紙鐩存帴鍒犻櫎锛屼笉杞垹闄わ級
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default)
+ {
+ _callMaterialOrderRecordRepository.BatchDeletePermanentlyAsync(ids);
+ }
+
/// <summary>
/// 璋冩暣鎺掑簭鍙枡璁板綍琛�
/// </summary>
/// <param name="id"></param>
/// <param name="sort"></param>
/// <returns></returns>
- public virtual async Task AdjustSortAsync(Guid id, int sort)
- {
- var list = await callMaterialOrderRecordRepository.GetListAsync(null, nameof(CallMaterialOrderRecord.Sort));
- if (list != null && list.Any())
- {
- var initSort = 1;
- list.ForEach(x => x.AdjustSort(initSort++));
- var entity = list.FirstOrDefault(x => x.Id == id);
- if (entity != null)
- {
- if (sort == 1)
- {
- list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
- }
- else if (entity.Sort > sort)
- {
- list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
- list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
- }
- else if (entity.Sort < sort)
- {
- list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
- list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
- }
-
- entity.AdjustSort(sort);
- }
- }
-
- await callMaterialOrderRecordRepository.UpdateManyAsync(list);
- }
-
+ public virtual async Task AdjustSortAsync(Guid id, int sort)
+ {
+ var list = await _callMaterialOrderRecordRepository.GetListAsync(null, nameof(CallMaterialOrderRecord.Sort));
+ if (list != null && list.Any())
+ {
+ var initSort = 1;
+ list.ForEach(x => x.AdjustSort(initSort++));
+ var entity = list.FirstOrDefault(x => x.Id == id);
+ if (entity != null)
+ {
+ if (sort == 1)
+ {
+ list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
+ }
+ else if (entity.Sort > sort)
+ {
+ list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
+ list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
+ }
+ else if (entity.Sort < sort)
+ {
+ list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1));
+ list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1));
+ }
+
+ entity.AdjustSort(sort);
+ }
+ }
+
+ await _callMaterialOrderRecordRepository.UpdateManyAsync(list);
+ }
+
/// <summary>
/// 瀵煎叆鍙枡璁板綍琛�
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public async Task ImportAsync(CallMaterialOrderRecordsImportModel input)
- {
- Check.NotNull(input, nameof(input));
-
- var callMaterialOrderRecordCreateDtos = new List<(int RowIndex, CallMaterialOrderRecordCreateDto Item)>();
- var callMaterialOrderRecordUpdateDtos = new List<(int RowIndex, Guid Id, CallMaterialOrderRecordUpdateDto Item)>();
- var importItems = input.CallMaterialOrderRecords;
-
- if (importItems != null && importItems.Any())
- {
+ public async Task ImportAsync(CallMaterialOrderRecordsImportModel input, MyCurrentUser myCurrentUser)
+ {
+ Check.NotNull(input, nameof(input));
+
+ var callMaterialOrderRecordCreateDtos = new List<(int RowIndex, CallMaterialOrderRecordCreateDto Item)>();
+ var callMaterialOrderRecordUpdateDtos = new List<(int RowIndex, Guid Id, CallMaterialOrderRecordUpdateDto Item)>();
+ var importItems = input.CallMaterialOrderRecords;
+
+ if (importItems != null && importItems.Any())
+ {
#region 瀵煎叆鏍¢獙
-
+
// 鍒ゆ柇鍚嶇О鏄惁閲嶅锛屽苟杈撳嚭绗嚑琛岄噸澶�
- var duplicateCallMaterialOrderRecords = importItems.GroupBy(x => x.DataIdentifier).Where(x => x.Count() > 1).ToList();
- if (duplicateCallMaterialOrderRecords?.Any() == true)
- {
- var duplicateCallMaterialOrderRecordMsgs = duplicateCallMaterialOrderRecords.Select(x => $"绗� {string.Join(",", x.Select(x => x.RowIndex))} 琛岋細{x.Key} 鍚嶇О閲嶅");
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝 {string.Join(",", duplicateCallMaterialOrderRecordMsgs)}锛岀粓姝㈠鍏�";
- throw new UserFriendlyException(errorMsg);
- }
-
- #endregion
-
- foreach (var impItem in importItems)
- {
- if (impItem.DataIdentifier.IsNullOrWhiteSpace())
- {
- continue;
- }
-
- if (impItem.DataIdentifier.IsNullOrWhiteSpace())
- {
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊impItem.RowIndex}琛岋細CallMaterialOrderRecord鍚嶇О涓嶈兘涓虹┖";
- throw new UserFriendlyException(errorMsg);
- }
-
- var oldCallMaterialOrderRecord = await callMaterialOrderRecordRepository.FindByNameAsync(impItem.DataIdentifier);
- if (oldCallMaterialOrderRecord != null)
- {
- var callMaterialOrderRecordUpdateDto = new CallMaterialOrderRecordUpdateDto
- {
+ var duplicateCallMaterialOrderRecords = importItems.GroupBy(x => x.DataIdentifier).Where(x => x.Count() > 1).ToList();
+ if (duplicateCallMaterialOrderRecords?.Any() == true)
+ {
+ var duplicateCallMaterialOrderRecordMsgs = duplicateCallMaterialOrderRecords.Select(x => $"绗� {string.Join(",", x.Select(x => x.RowIndex))} 琛岋細{x.Key} 鍚嶇О閲嶅");
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝 {string.Join(",", duplicateCallMaterialOrderRecordMsgs)}锛岀粓姝㈠鍏�";
+ throw new UserFriendlyException(errorMsg);
+ }
+
+ #endregion
+
+ foreach (var impItem in importItems)
+ {
+ if (impItem.DataIdentifier.IsNullOrWhiteSpace())
+ {
+ continue;
+ }
+
+ if (impItem.DataIdentifier.IsNullOrWhiteSpace())
+ {
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊impItem.RowIndex}琛岋細CallMaterialOrderRecord鍚嶇О涓嶈兘涓虹┖";
+ throw new UserFriendlyException(errorMsg);
+ }
+
+ var oldCallMaterialOrderRecord = await _callMaterialOrderRecordRepository.FindByNameAsync(impItem.DataIdentifier);
+ if (oldCallMaterialOrderRecord != null)
+ {
+ var callMaterialOrderRecordUpdateDto = new CallMaterialOrderRecordUpdateDto
+ {
DataIdentifier = impItem.DataIdentifier,
-MaterialMode = impItem.MaterialMode,
-CallMaterialStatus = impItem.CallMaterialStatus,
-Quantity = impItem.Quantity,
-WmsRetResult = impItem.WmsRetResult,
-WmsTaskNo = impItem.WmsTaskNo,
-Remark = impItem.Remark,
-
- };
-
- callMaterialOrderRecordUpdateDtos.Add((impItem.RowIndex, oldCallMaterialOrderRecord.Id, callMaterialOrderRecordUpdateDto));
- }
- else
- {
- var callMaterialOrderRecordCreateDto = new CallMaterialOrderRecordCreateDto
- {
+ MaterialMode = impItem.MaterialMode,
+ MaterialBatch = impItem.MaterialBatch,
+ CallMaterialStatus = impItem.CallMaterialStatus,
+ Quantity = impItem.Quantity,
+ WmsRetResult = impItem.WmsRetResult,
+ WmsTaskNo = impItem.WmsTaskNo,
+ Remark = impItem.Remark,
+
+ };
+
+ callMaterialOrderRecordUpdateDtos.Add((impItem.RowIndex, oldCallMaterialOrderRecord.Id, callMaterialOrderRecordUpdateDto));
+ }
+ else
+ {
+ var callMaterialOrderRecordCreateDto = new CallMaterialOrderRecordCreateDto
+ {
DataIdentifier = impItem.DataIdentifier,
-MaterialMode = impItem.MaterialMode,
-CallMaterialStatus = impItem.CallMaterialStatus,
-Quantity = impItem.Quantity,
-WmsRetResult = impItem.WmsRetResult,
-WmsTaskNo = impItem.WmsTaskNo,
-Remark = impItem.Remark,
-
- };
-
- callMaterialOrderRecordCreateDtos.Add((impItem.RowIndex, callMaterialOrderRecordCreateDto));
- }
- }
- }
-
+ MaterialMode = impItem.MaterialMode,
+ MaterialBatch = impItem.MaterialBatch,
+ CallMaterialStatus = impItem.CallMaterialStatus,
+ Quantity = impItem.Quantity,
+ WmsRetResult = impItem.WmsRetResult,
+ WmsTaskNo = impItem.WmsTaskNo,
+ Remark = impItem.Remark,
+
+ };
+
+ callMaterialOrderRecordCreateDtos.Add((impItem.RowIndex, callMaterialOrderRecordCreateDto));
+ }
+ }
+ }
+
// 鏂板
- foreach (var callMaterialOrderRecordDto in callMaterialOrderRecordCreateDtos)
- {
- try
- {
- await CreateAsync(callMaterialOrderRecordDto.Item);
- }
- catch (Exception e)
- {
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderRecordDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
- throw new UserFriendlyException(errorMsg);
- }
- }
-
+ foreach (var callMaterialOrderRecordDto in callMaterialOrderRecordCreateDtos)
+ {
+ try
+ {
+ callMaterialOrderRecordDto.Item.CreatorName = myCurrentUser.UserAccount;//鍒涘缓浜�
+ await CreateAsync(callMaterialOrderRecordDto.Item);
+ }
+ catch (Exception e)
+ {
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderRecordDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
+ throw new UserFriendlyException(errorMsg);
+ }
+ }
+
// 鏇存柊
- foreach (var callMaterialOrderRecordDto in callMaterialOrderRecordUpdateDtos)
- {
- try
- {
- await UpdateAsync(callMaterialOrderRecordDto.Id, callMaterialOrderRecordDto.Item);
- }
- catch (Exception e)
- {
- var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderRecordDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
- throw new UserFriendlyException(errorMsg);
- }
- }
- }
-
+ foreach (var callMaterialOrderRecordDto in callMaterialOrderRecordUpdateDtos)
+ {
+ try
+ {
+ callMaterialOrderRecordDto.Item.LastModifierName = myCurrentUser.UserAccount;//淇敼浜�
+ await UpdateAsync(callMaterialOrderRecordDto.Id, callMaterialOrderRecordDto.Item);
+ }
+ catch (Exception e)
+ {
+ var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊callMaterialOrderRecordDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�";
+ throw new UserFriendlyException(errorMsg);
+ }
+ }
+ }
+
/// <summary>
/// 瀵煎嚭鍙枡璁板綍琛�
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetCallMaterialOrderRecordInput input)
- {
- Check.NotNull(input, nameof(input));
-
- if (input.Sorting.IsNullOrWhiteSpace())
- {
- input.Sorting = nameof(CallMaterialOrderRecord.Sort);
- }
-
+ public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetCallMaterialOrderRecordInput input)
+ {
+ Check.NotNull(input, nameof(input));
+
+ if (input.Sorting.IsNullOrWhiteSpace())
+ {
+ input.Sorting = nameof(CallMaterialOrderRecord.Sort);
+ }
+
#region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
-
+
//鍔ㄦ�佹瀯閫犳煡璇㈡潯浠�
- var whereConditions = DynamicGetQueryParams(input);
-
- #endregion
-
-
- var list = await callMaterialOrderRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true);
- var result = ObjectMapper.Map<List<CallMaterialOrderRecord>, List<CallMaterialOrderRecordDto>>(list);
-
- var sheets = new Dictionary<string, object>
- {
- ["閰嶇疆"] = ExportHelper.ConvertListToExportData(result),
- };
-
- var fileName = "鍙枡璁板綍";
- return (sheets, fileName);
- }
-
+ var whereConditions = DynamicGetQueryParams(input);
+
+ #endregion
+
+
+ var list = await _callMaterialOrderRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true);
+ var result = ObjectMapper.Map<List<CallMaterialOrderRecord>, List<CallMaterialOrderRecordDto>>(list);
+
+ var sheets = new Dictionary<string, object>
+ {
+ ["閰嶇疆"] = ExportHelper.ConvertListToExportData(result),
+ };
+
+ var fileName = "鍙枡璁板綍";
+ return (sheets, fileName);
+ }
+
/// <summary>
/// 鏍¢獙鍙枡璁板綍琛紝褰撴柊寤烘垨鏇存柊鏃�
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
- protected Task CheckCreateOrUpdateDtoAsync(CallMaterialOrderRecordCreateOrUpdateDtoBase input)
- {
- Check.NotNull(input, nameof(input));
- Check.NotNullOrWhiteSpace(input.DataIdentifier, "鍘熸枡鏍囪瘑", 256);
+ protected Task CheckCreateOrUpdateDtoAsync(CallMaterialOrderRecordCreateOrUpdateDtoBase input)
+ {
+ Check.NotNull(input, nameof(input));
+ Check.NotNullOrWhiteSpace(input.DataIdentifier, "鍘熸枡鏍囪瘑", 256);
Check.NotNull(input.CallMaterialStatus, "鍙枡鐘舵��");
Check.NotNull(input.Quantity, "鍙枡鏁伴噺");
-
- return Task.CompletedTask;
- }
-}
+
+ return Task.CompletedTask;
+ }
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍙枡璁板綍琛ㄥ垪琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public async Task<List<CallMaterialOrderRecord>> GetListByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, CancellationToken cancellationToken = default)
+ {
+ return await _callMaterialOrderRecordRepository.GetListByFilterAsync(whereConditions);
+ }
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="isMultipleThrowException">鏄惁鏌ヨ鍑哄鏉″氨鎶ラ敊</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ /// <exception cref="UserFriendlyException"></exception>
+ public async Task<CallMaterialOrderRecord> GetSingleByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default)
+ {
+ return await _callMaterialOrderRecordRepository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException);
+ }
+}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
index ee97a01..58720e2 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs
@@ -25,6 +25,12 @@
using CMS.Plugin.TraceManagement.Abstractions;
using CMS.Plugin.ProductManagement.Abstractions.Models;
using CMS.Plugin.MaterialManagement.Abstractions;
+using CMS.Plugin.HIAWms.Application.Contracts.Services;
+using CMS.Plugin.HIAWms.Application.Contracts.Dtos.CommonDto;
+using System.Collections.Generic;
+using CMS.Plugin.HIAWms.Abstractions;
+using Newtonsoft.Json;
+using CmsQueryExtensions;
namespace CMS.Plugin.PipeLineLems.Application.Implements;
@@ -437,9 +443,9 @@
/// <param name="_serviceProvider">鏈嶅姟鎻愪緵鑰�</param>
/// <returns>鎿嶄綔缁撴灉</returns>
/// <exception cref="UserFriendlyException">褰撴暟鎹笉瀛樺湪鎴栫姸鎬佷笉鍏佽鍙枡鏃舵姏鍑�</exception>
- public async Task<MesOrderResponse> CallMaterialByDataIdentifier(Guid id, IServiceProvider _serviceProvider)
+ public async Task<MesOrderResponse> CallMaterial(CallMaterialByDataIdentifierInput input, IServiceProvider _serviceProvider, MyCurrentUser myCurrentUser)
{
- if (string.IsNullOrEmpty(id.ToString()))
+ if (string.IsNullOrEmpty(input.Id.ToString()))
{
throw new UserFriendlyException("鍘熸枡鏍囪瘑涓嶈兘涓虹┖");
}
@@ -451,7 +457,7 @@
// 鏌ユ壘鏁版嵁
- var callMaterialOrder = await callMaterialOrderRepository.GetAsync(id);
+ var callMaterialOrder = await callMaterialOrderRepository.GetAsync(input.Id);
if (callMaterialOrder == null)
{
throw new UserFriendlyException($"鎵句笉鍒板彨鏂欒褰�");
@@ -460,10 +466,38 @@
// 楠岃瘉鐘舵��
if (callMaterialOrder.CallMaterialStatus != Domain.Shared.Enums.CallMaterialStatusEnum.鏈墽琛�)
{
- throw new UserFriendlyException($"鍘熸枡鏍囪瘑涓� '{callMaterialOrder.DataIdentifier}' 鐨勫彨鏂欒褰曠姸鎬佷负 '{callMaterialOrder.CallMaterialStatus}'锛屼笉鍏佽鍙枡");
+ //throw new UserFriendlyException($"鍘熸枡鏍囪瘑涓� '{callMaterialOrder.DataIdentifier}' 鐨勫彨鏂欒褰曠姸鎬佷负 '{callMaterialOrder.CallMaterialStatus}'锛屼笉鍏佽鍙枡");
}
//TODO:杩欓噷璋冪敤wms鐨勫彨鏂欐帴鍙�
+ try
+ {
+ List<LMesCallMaterialInput> param = new List<LMesCallMaterialInput>() {
+ new LMesCallMaterialInput(){
+ DataIdentifier=callMaterialOrder.DataIdentifier,
+ MaterialMode="Q235B-桅89脳4",
+ }
+ };
+ string baseUrl = @"http://127.0.0.1:18000/api/v1/HIAWms/";
+ string url = baseUrl + "lMesOperate/LMesCallMaterial";
+ string json = JsonConvert.SerializeObject(param);
+ var result = HttpApiRequest.HttpPost(url, json);
+ var res = JsonConvert.DeserializeObject<CmsApiResponse<List<MyCallMaterialOutput>>>(result);
+ if (res.Code == 200)
+ {
+ var retData = res.Data;
+ callMaterialOrder.MaterialBatch = retData[0].MaterialBatch;
+ }
+ else {
+ throw new UserFriendlyException(res.Message);
+ }
+ }
+ catch (Exception)
+ {
+
+ throw;
+ }
+
// 鏇存柊鏁版嵁
callMaterialOrder.MaterialBatch = GenerateRandomBatch();//wms杩斿洖鐨勫師鏂欐壒娆�
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrder/ICallMaterialOrderRepository.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrder/ICallMaterialOrderRepository.cs
index 4cc38c4..13bdc95 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrder/ICallMaterialOrderRepository.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrder/ICallMaterialOrderRepository.cs
@@ -15,10 +15,8 @@
/// <param name="name"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
- Task<CallMaterialOrder> FindByNameAsync(string name, CancellationToken cancellationToken = default);
-
- Task<CallMaterialOrder> FindByWmsTaskNoAsync(string wmsTaskNo, CancellationToken cancellationToken = default);
-
+ Task<CallMaterialOrder> FindByNameAsync(string name, CancellationToken cancellationToken = default);
+
/// <summary>
/// 楠岃瘉鍚嶇О鏄惁瀛樺湪鍙枡鍗曡〃
/// </summary>
@@ -31,11 +29,8 @@
/// 鑾峰彇鏈�澶ф帓搴忓彨鏂欏崟琛�
/// </summary>
/// <returns></returns>
- Task<int> GetMaxSortAsync();
-
-
-
-
+ Task<int> GetMaxSortAsync();
+
/// <summary>
/// 鑾峰彇鍒嗛〉鍒楄〃鍙枡鍗曡〃
/// </summary>
@@ -54,16 +49,33 @@
/// <param name="whereConditions"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
- Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<CallMaterialOrder, bool>>> whereConditions, CancellationToken cancellationToken = default);
-
+ Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<CallMaterialOrder, bool>>> whereConditions, CancellationToken cancellationToken = default);
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡鍗曡〃
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task DeletePermanentlyAsync(Guid id, CancellationToken cancellationToken = default);
+
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡鍗曡〃锛堢洿鎺ュ垹闄わ紝涓嶈蒋鍒犻櫎锛�
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, CancellationToken cancellationToken = default);
+
/// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍙枡鍗曡〃鍒楄〃
/// </summary>
/// <param name="whereConditions"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
- Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default);
-
+ Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default);
+
/// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡鍗曡〃
/// </summary>
@@ -72,5 +84,5 @@
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default);
+ Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default);
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrderRecord/ICallMaterialOrderRecordRepository.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrderRecord/ICallMaterialOrderRecordRepository.cs
index 1ac2ea7..1c1417d 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrderRecord/ICallMaterialOrderRecordRepository.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/CallMaterialOrderRecord/ICallMaterialOrderRecordRepository.cs
@@ -50,4 +50,39 @@
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<long> GetCountAsync(FunReturnResultModel<Expression<Func<CallMaterialOrderRecord, bool>>> whereConditions, CancellationToken cancellationToken = default);
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task DeletePermanentlyAsync(Guid id, CancellationToken cancellationToken = default);
+
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡璁板綍琛紙鐩存帴鍒犻櫎锛屼笉杞垹闄わ級
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, CancellationToken cancellationToken = default);
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍙枡璁板綍琛ㄥ垪琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ Task<List<CallMaterialOrderRecord>> GetListByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, CancellationToken cancellationToken = default);
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="isMultipleThrowException">鏄惁鏌ヨ鍑哄鏉″氨鎶ラ敊</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ /// <exception cref="UserFriendlyException"></exception>
+ Task<CallMaterialOrderRecord> GetSingleByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default);
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRecordRepository.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRecordRepository.cs
index f9842e2..5a1e841 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRecordRepository.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRecordRepository.cs
@@ -4,6 +4,7 @@
using Microsoft.EntityFrameworkCore;
using System.Linq.Dynamic.Core;
using System.Linq.Expressions;
+using Volo.Abp;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
@@ -110,4 +111,108 @@
return (await GetQueryableAsync())
.Where(x => !x.IsDeleted).IncludeDetails();
}
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task DeletePermanentlyAsync(Guid id, CancellationToken cancellationToken = default)
+ {
+ var entity = await (await GetDbSetAsync())
+ .FirstOrDefaultAsync(x => x.Id == id && !x.IsDeleted, GetCancellationToken(cancellationToken));
+
+ if (entity == null)
+ {
+ throw new Volo.Abp.Domain.Entities.EntityNotFoundException(typeof(CallMaterialOrderRecord), id);
+ }
+
+ // 2. 鑾峰彇 DbContext 骞舵墽琛屽垹闄�
+ var dbContext = await GetDbContextAsync();
+
+ // 鐩存帴鎵ц SQL 鍒犻櫎
+ var sql = $"DELETE FROM scms_callmaterialorderrecords WHERE Id ='{entity.Id.ToString()}'";
+ await dbContext.Database.ExecuteSqlRawAsync(sql, cancellationToken);
+ }
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡璁板綍琛紙鐩存帴鍒犻櫎锛屼笉杞垹闄わ級
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, CancellationToken cancellationToken = default)
+ {
+ // 1. 鏌ヨ绗﹀悎鏉′欢鐨勫疄浣擄紙鏈蒋鍒犻櫎鐨勮褰曪級
+ var entities = await (await GetDbSetAsync())
+ .Where(x => ids.Contains(x.Id) && !x.IsDeleted)
+ .ToListAsync(GetCancellationToken(cancellationToken));
+
+ if (!entities.Any())
+ {
+ // 濡傛灉娌℃湁闇�瑕佸垹闄ょ殑璁板綍锛岀洿鎺ヨ繑鍥烇紙閬垮厤涓嶅繀瑕佺殑鏁版嵁搴撴搷浣滐級
+ return;
+ }
+
+ // 2. 鑾峰彇 DbContext 骞舵墽琛屾壒閲忓垹闄�
+ var dbContext = await GetDbContextAsync();
+
+ var idsToDelete = entities.Select(e => e.Id).ToList();
+
+ // 鐩存帴鎵ц SQL 鍒犻櫎
+ var sql = $"DELETE FROM scms_callmaterialorderrecords WHERE Id IN ({string.Join(",", idsToDelete.Select(id => $"'{id}'"))})";
+ await dbContext.Database.ExecuteSqlRawAsync(sql, cancellationToken);
+ }
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍙枡璁板綍琛ㄥ垪琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public async Task<List<CallMaterialOrderRecord>> GetListByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, CancellationToken cancellationToken = default)
+ {
+ return await (await GetDbSetAsync())
+ .IncludeDetails()
+ .WhereIf(whereConditions != null, whereConditions)
+ .Where(x => !x.IsDeleted)
+ .OrderByDescending(x => x.CreationTime)
+ .ToListAsync(GetCancellationToken(cancellationToken));
+ }
+
+ /// <summary>
+ /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡璁板綍琛�
+ /// </summary>
+ /// <param name="whereConditions"></param>
+ /// <param name="isMultipleThrowException">鏄惁鏌ヨ鍑哄鏉″氨鎶ラ敊</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ /// <exception cref="UserFriendlyException"></exception>
+ public async Task<CallMaterialOrderRecord> GetSingleByFilterAsync(Expression<Func<CallMaterialOrderRecord, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default)
+ {
+ if (is鈥婱ultipleThrowException)
+ {
+ var entitys = await (await GetDbSetAsync())
+ .IncludeDetails()
+ .WhereIf(whereConditions != null, whereConditions)
+ .Where(x => !x.IsDeleted)
+ .OrderByDescending(x => x.CreationTime)
+ .ToListAsync(GetCancellationToken(cancellationToken));
+ if (entitys?.Count > 1)
+ {
+ throw new UserFriendlyException("鏌ヨ鍒板鏉¤褰�");
+ }
+ return entitys?.FirstOrDefault();
+ }
+ else
+ {
+ return await (await GetDbSetAsync())
+ .IncludeDetails()
+ .WhereIf(whereConditions != null, whereConditions)
+ .Where(x => !x.IsDeleted)
+ .OrderByDescending(x => x.CreationTime)
+ .FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
+ }
+ }
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRepository.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRepository.cs
index da7e88a..3091f2b 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRepository.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Repositories/EfCoreCallMaterialOrderRepository.cs
@@ -3,8 +3,8 @@
using CmsQueryExtensions.Extension;
using Microsoft.EntityFrameworkCore;
using System.Linq.Dynamic.Core;
-using System.Linq.Expressions;
-using Volo.Abp;
+using System.Linq.Expressions;
+using Volo.Abp;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
@@ -38,17 +38,8 @@
.Where(x => !x.IsDeleted)
.OrderByDescending(x=>x.CreationTime)
.FirstOrDefaultAsync(t => t.DataIdentifier == name, GetCancellationToken(cancellationToken));
- }
-
- public virtual async Task<CallMaterialOrder> FindByWmsTaskNoAsync(string wmsTaskNo, CancellationToken cancellationToken = default)
- {
- return await (await GetDbSetAsync())
- .IncludeDetails()
- .Where(x => !x.IsDeleted)
- .OrderByDescending(x => x.CreationTime)
- .FirstOrDefaultAsync(t => t.WmsTaskNo == wmsTaskNo, GetCancellationToken(cancellationToken));
- }
-
+ }
+
/// <summary>
/// 楠岃瘉鍚嶇О鏄惁瀛樺湪鍙枡鍗曡〃
/// </summary>
@@ -119,24 +110,77 @@
{
return (await GetQueryableAsync())
.Where(x => !x.IsDeleted).IncludeDetails();
- }
-
+ }
+
+ /// <summary>
+ /// 鐗╃悊鍒犻櫎鍙枡鍗曡〃
+ /// </summary>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task DeletePermanentlyAsync(Guid id, CancellationToken cancellationToken = default)
+ {
+ var entity = await (await GetDbSetAsync())
+ .FirstOrDefaultAsync(x => x.Id == id && !x.IsDeleted, GetCancellationToken(cancellationToken));
+
+ if (entity == null)
+ {
+ throw new Volo.Abp.Domain.Entities.EntityNotFoundException(typeof(CallMaterialOrder), id);
+ }
+
+ // 2. 鑾峰彇 DbContext 骞舵墽琛屽垹闄�
+ var dbContext = await GetDbContextAsync();
+
+ // 鐩存帴鎵ц SQL 鍒犻櫎
+ var sql = $"DELETE FROM scms_callmaterialorders WHERE Id ='{entity.Id.ToString()}'";
+ await dbContext.Database.ExecuteSqlRawAsync(sql, cancellationToken);
+ }
+
+ /// <summary>
+ /// 鎵归噺鐗╃悊鍒犻櫎鍙枡鍗曡〃锛堢洿鎺ュ垹闄わ紝涓嶈蒋鍒犻櫎锛�
+ /// </summary>
+ /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param>
+ /// <param name="cancellationToken"></param>
+ /// <returns></returns>
+ public virtual async Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, CancellationToken cancellationToken = default)
+ {
+ // 1. 鏌ヨ绗﹀悎鏉′欢鐨勫疄浣擄紙鏈蒋鍒犻櫎鐨勮褰曪級
+ var entities = await (await GetDbSetAsync())
+ .Where(x => ids.Contains(x.Id) && !x.IsDeleted)
+ .ToListAsync(GetCancellationToken(cancellationToken));
+
+ if (!entities.Any())
+ {
+ // 濡傛灉娌℃湁闇�瑕佸垹闄ょ殑璁板綍锛岀洿鎺ヨ繑鍥烇紙閬垮厤涓嶅繀瑕佺殑鏁版嵁搴撴搷浣滐級
+ return;
+ }
+
+ // 2. 鑾峰彇 DbContext 骞舵墽琛屾壒閲忓垹闄�
+ var dbContext = await GetDbContextAsync();
+
+ var idsToDelete = entities.Select(e => e.Id).ToList();
+
+ // 鐩存帴鎵ц SQL 鍒犻櫎
+ var sql = $"DELETE FROM scms_callmaterialorders WHERE Id IN ({string.Join(",", idsToDelete.Select(id => $"'{id}'"))})";
+ await dbContext.Database.ExecuteSqlRawAsync(sql, cancellationToken);
+ }
+
/// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍙枡鍗曡〃鍒楄〃
/// </summary>
/// <param name="whereConditions"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
- public async Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default)
- {
- return await (await GetDbSetAsync())
- .IncludeDetails()
- .WhereIf(whereConditions != null, whereConditions)
- .Where(x => !x.IsDeleted)
- .OrderByDescending(x => x.CreationTime)
- .ToListAsync(GetCancellationToken(cancellationToken));
- }
-
+ public async Task<List<CallMaterialOrder>> GetListByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, CancellationToken cancellationToken = default)
+ {
+ return await (await GetDbSetAsync())
+ .IncludeDetails()
+ .WhereIf(whereConditions != null, whereConditions)
+ .Where(x => !x.IsDeleted)
+ .OrderByDescending(x => x.CreationTime)
+ .ToListAsync(GetCancellationToken(cancellationToken));
+ }
+
/// <summary>
/// 鏍规嵁鏉′欢鑾峰彇鍗曚釜鍙枡鍗曡〃
/// </summary>
@@ -145,30 +189,30 @@
/// <param name="cancellationToken"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
- public async Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default)
- {
- if (is鈥婱ultipleThrowException)
- {
- var entitys = await (await GetDbSetAsync())
- .IncludeDetails()
- .WhereIf(whereConditions != null, whereConditions)
- .Where(x => !x.IsDeleted)
- .OrderByDescending(x => x.CreationTime)
- .ToListAsync(GetCancellationToken(cancellationToken));
- if (entitys?.Count > 1)
- {
- throw new UserFriendlyException("鏌ヨ鍒板鏉¤褰�");
- }
- return entitys?.FirstOrDefault();
- }
- else
- {
- return await (await GetDbSetAsync())
- .IncludeDetails()
- .WhereIf(whereConditions != null, whereConditions)
- .Where(x => !x.IsDeleted)
- .OrderByDescending(x => x.CreationTime)
- .FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
- }
- }
+ public async Task<CallMaterialOrder> GetSingleByFilterAsync(Expression<Func<CallMaterialOrder, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default)
+ {
+ if (is鈥婱ultipleThrowException)
+ {
+ var entitys = await (await GetDbSetAsync())
+ .IncludeDetails()
+ .WhereIf(whereConditions != null, whereConditions)
+ .Where(x => !x.IsDeleted)
+ .OrderByDescending(x => x.CreationTime)
+ .ToListAsync(GetCancellationToken(cancellationToken));
+ if (entitys?.Count > 1)
+ {
+ throw new UserFriendlyException("鏌ヨ鍒板鏉¤褰�");
+ }
+ return entitys?.FirstOrDefault();
+ }
+ else
+ {
+ return await (await GetDbSetAsync())
+ .IncludeDetails()
+ .WhereIf(whereConditions != null, whereConditions)
+ .Where(x => !x.IsDeleted)
+ .OrderByDescending(x => x.CreationTime)
+ .FirstOrDefaultAsync(GetCancellationToken(cancellationToken));
+ }
+ }
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMS.Plugin.PipeLineLems.csproj b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMS.Plugin.PipeLineLems.csproj
index 099e1a1..4108cc0 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMS.Plugin.PipeLineLems.csproj
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMS.Plugin.PipeLineLems.csproj
@@ -56,6 +56,21 @@
</ItemGroup>
<ItemGroup>
+ <Reference Include="CMS.Plugin.HIAWms.Abstractions">
+ <HintPath>..\..\..\..\..\..\Program Files\CMS Editor\plugins\cms.plugin.hiawms\net6.0\CMS.Plugin.HIAWms.Abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="CMS.Plugin.HIAWms.Application">
+ <HintPath>..\..\..\..\..\..\Program Files\CMS Editor\plugins\cms.plugin.hiawms\net6.0\CMS.Plugin.HIAWms.Application.dll</HintPath>
+ </Reference>
+ <Reference Include="CMS.Plugin.HIAWms.Application.Contracts">
+ <HintPath>..\..\..\..\HIAWms\server\src\CMS.Plugin.HIAWms.Application.Contracts\bin\Debug\net6.0\CMS.Plugin.HIAWms.Application.Contracts.dll</HintPath>
+ </Reference>
+ <Reference Include="CMS.Plugin.HIAWms.Domain">
+ <HintPath>..\..\..\..\..\..\Program Files\CMS Editor\plugins\cms.plugin.hiawms\net6.0\CMS.Plugin.HIAWms.Domain.dll</HintPath>
+ </Reference>
+ <Reference Include="CMS.Plugin.HIAWms.EntityFrameworkCore">
+ <HintPath>..\..\..\..\..\..\Program Files\CMS Editor\plugins\cms.plugin.hiawms\net6.0\CMS.Plugin.HIAWms.EntityFrameworkCore.dll</HintPath>
+ </Reference>
<Reference Include="CmsQueryExtensions">
<HintPath>..\..\..\..\CommonDLL\CmsQueryExtensions.dll</HintPath>
</Reference>
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs
index 87ffc61..73807a4 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs
@@ -24,6 +24,12 @@
using Volo.Abp.Modularity.PlugIns;
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
using CMS.Plugin.PipeLineLems.Application.Implements;
+using CMS.Plugin.HIAWms.Application.Contracts.Services;
+using CMS.Plugin.HIAWms.Application.Implements;
+using CMS.Plugin.HIAWms.Domain.WmsTask;
+using CMS.Plugin.HIAWms.EntityFrameworkCore.Repositories;
+using CMS.Plugin.HIAWms.Domain.WmsMaterials;
+using CMS.Plugin.HIAWms.Abstractions;
namespace CMS.Plugin.PipeLineLems;
@@ -51,6 +57,13 @@
context.Services.AddSingleton<IProjectService, PipeLineLemsProjectService>();
context.Services.AddScoped<IMesAppService, MesAppService>();
context.Services.AddScoped<IWorkPlanAppService, WorkPlanAppService>();
+ //context.Services.AddScoped<ILMesOperateAppService, LMesOperateAppService>();
+ //context.Services.AddScoped<IWmsTaskRepository, EfCoreWmsTaskRepository>();
+ //context.Services.AddScoped<IWmsMaterialRepository, EfCoreWmsMaterialRepository>();
+ //context.Services.AddScoped<IWmsInOutStockOrderAppService, WmsInOutStockOrderAppService>();
+ //context.Services.AddScoped<IWmsOutStockAppService, WmsOutStockAppService>();
+
+
context.Services.AddScoped<IEFDataProvider>(p =>
{
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderController.cs
index 68c31db..35ecda2 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderController.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderController.cs
@@ -1,5 +1,6 @@
using Ao.Lang;
using CMS.Extensions.Abp.AspNetCore.Mvc.Filters;
+using CMS.Framework.AspNetCore.Users;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrder;
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
using Microsoft.AspNetCore.Authorization;
@@ -9,6 +10,7 @@
using System.Reflection;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
+using CmsQueryExtensions.Entitys;
namespace CMS.Plugin.PipeLineLems.Controller
{
@@ -24,39 +26,34 @@
public class CallMaterialOrderController : ControllerBase
{
private readonly ICallMaterialOrderAppService _callMaterialOrderAppService;
+ private readonly ICurrentUser _currentUser;
/// <summary>
/// Initializes a new instance of the <see cref="CallMaterialOrderController"/> class.
/// </summary>
/// <param name="callMaterialOrderAppService">The callMaterialOrder application service.</param>
- public CallMaterialOrderController(ICallMaterialOrderAppService callMaterialOrderAppService)
+ public CallMaterialOrderController(ICallMaterialOrderAppService callMaterialOrderAppService, ICurrentUser currentUser)
{
_callMaterialOrderAppService = callMaterialOrderAppService;
+ _currentUser = currentUser;
}
/// <summary>
/// 鑾峰彇鍙枡鍗曡〃
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
+ /// <param name="id">涓婚敭ID</param>
/// <returns></returns>
[HttpGet]
[Route("{id}")]
public virtual Task<CallMaterialOrderDto> GetAsync(Guid id)
{
return _callMaterialOrderAppService.GetAsync(id);
- }
-
- [HttpPut]
- [Route("CallMaterialByDataIdentifier/{id}")]
- public virtual Task CallMaterialByDataIdentifier(Guid id)
- {
- return _callMaterialOrderAppService.CallMaterialByDataIdentifier(id);
- }
-
+ }
+
/// <summary>
/// 鍒嗛〉鑾峰彇鍙枡鍗曡〃鐨勫垪琛�.
/// </summary>
- /// <param name="input">杈撳叆.</param>
+ /// <param name="input">鏌ヨ鍙傛暟</param>
/// <returns></returns>
[HttpGet]
[Route("Page")]
@@ -68,71 +65,90 @@
/// <summary>
/// 鍒涘缓鍙枡鍗曡〃
/// </summary>
- /// <param name="input">杈撳叆.</param>
+ /// <param name="input">鍒涘缓鍙傛暟</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpPost]
public virtual Task<CallMaterialOrderDto> CreateAsync(CallMaterialOrderCreateDto input)
{
+ input.CreatorName = _currentUser.UserAccount;//鍒涘缓浜�
return _callMaterialOrderAppService.CreateAsync(input);
}
/// <summary>
/// 鏇存柊鍙枡鍗曡〃
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
- /// <param name="input">杈撳叆.</param>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="input">鏇存柊鍙傛暟</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpPut]
[Route("{id}")]
public virtual Task<CallMaterialOrderDto> UpdateAsync(Guid id, CallMaterialOrderUpdateDto input)
{
+ input.LastModifierName = _currentUser.UserAccount;//淇敼浜�
return _callMaterialOrderAppService.UpdateAsync(id, input);
}
/// <summary>
/// 鍏嬮殕鍙枡鍗曡〃
/// </summary>
- /// <param name="ids">Id闆嗗悎.</param>
+ /// <param name="ids">Id闆嗗悎</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpPost]
[Route("Clone")]
public virtual Task<List<CallMaterialOrderDto>> CloneAsync([FromBody] IEnumerable<Guid> ids)
{
- return _callMaterialOrderAppService.CloneAsync(ids);
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
+ return _callMaterialOrderAppService.CloneAsync(ids, myCurrentUser);
}
/// <summary>
/// 鍒犻櫎鍙枡鍗曡〃
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
+ /// <param name="id">涓婚敭ID</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpDelete]
[Route("{id}")]
public virtual Task DeleteAsync(Guid id)
{
- return _callMaterialOrderAppService.DeleteAsync(id);
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
+ //return _wmsMaterialAppService.DeleteAsync(id,myCurrentUser);//閫昏緫鍒犻櫎
+ return _callMaterialOrderAppService.DeletePermanentlyAsync(id, myCurrentUser);//鐗╃悊鍒犻櫎
}
/// <summary>
/// 鎵归噺鍒犻櫎鍙枡鍗曡〃
/// </summary>
- /// <param name="ids">The ids.</param>
+ /// <param name="ids">涓婚敭ID闆嗗悎</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpDelete]
public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids)
{
- return _callMaterialOrderAppService.DeleteManyAsync(ids);
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
+ // return _wmsMaterialAppService.DeleteManyAsync(ids,myCurrentUser);//閫昏緫鍒犻櫎
+ return _callMaterialOrderAppService.BatchDeletePermanentlyAsync(ids, myCurrentUser);//鐗╃悊鍒犻櫎
}
/// <summary>
/// 璋冩暣鎺掑簭鍙枡鍗曡〃
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
+ /// <param name="id">涓婚敭ID</param>
/// <returns></returns>
[HttpPut]
[Route("{id}/AdjustSort/{sort}")]
@@ -162,10 +178,15 @@
throw new UserFriendlyException("璇锋鏌ュ鍏ョ殑琛ㄦ牸");
}
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
await _callMaterialOrderAppService.ImportAsync(new CallMaterialOrdersImportModel
{
CallMaterialOrders = callMaterialOrderRows,
- });
+ },myCurrentUser);
return Ok();
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderRecordController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderRecordController.cs
index 123e408..0ed699d 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderRecordController.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/CallMaterialOrderRecordController.cs
@@ -1,5 +1,6 @@
using Ao.Lang;
using CMS.Extensions.Abp.AspNetCore.Mvc.Filters;
+using CMS.Framework.AspNetCore.Users;
using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.CallMaterialOrderRecord;
using CMS.Plugin.PipeLineLems.Application.Contracts.Services;
using Microsoft.AspNetCore.Authorization;
@@ -9,6 +10,7 @@
using System.Reflection;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
+using CmsQueryExtensions.Entitys;
namespace CMS.Plugin.PipeLineLems.Controller
{
@@ -24,20 +26,22 @@
public class CallMaterialOrderRecordController : ControllerBase
{
private readonly ICallMaterialOrderRecordAppService _callMaterialOrderRecordAppService;
+ private readonly ICurrentUser _currentUser;
/// <summary>
/// Initializes a new instance of the <see cref="CallMaterialOrderRecordController"/> class.
/// </summary>
/// <param name="callMaterialOrderRecordAppService">The callMaterialOrderRecord application service.</param>
- public CallMaterialOrderRecordController(ICallMaterialOrderRecordAppService callMaterialOrderRecordAppService)
+ public CallMaterialOrderRecordController(ICallMaterialOrderRecordAppService callMaterialOrderRecordAppService, ICurrentUser currentUser)
{
_callMaterialOrderRecordAppService = callMaterialOrderRecordAppService;
+ _currentUser = currentUser;
}
/// <summary>
/// 鑾峰彇鍙枡璁板綍琛�
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
+ /// <param name="id">涓婚敭ID</param>
/// <returns></returns>
[HttpGet]
[Route("{id}")]
@@ -49,7 +53,7 @@
/// <summary>
/// 鍒嗛〉鑾峰彇鍙枡璁板綍琛ㄧ殑鍒楄〃.
/// </summary>
- /// <param name="input">杈撳叆.</param>
+ /// <param name="input">鏌ヨ鍙傛暟</param>
/// <returns></returns>
[HttpGet]
[Route("Page")]
@@ -61,71 +65,90 @@
/// <summary>
/// 鍒涘缓鍙枡璁板綍琛�
/// </summary>
- /// <param name="input">杈撳叆.</param>
+ /// <param name="input">鍒涘缓鍙傛暟</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpPost]
public virtual Task<CallMaterialOrderRecordDto> CreateAsync(CallMaterialOrderRecordCreateDto input)
{
+ input.CreatorName = _currentUser.UserAccount;//鍒涘缓浜�
return _callMaterialOrderRecordAppService.CreateAsync(input);
}
/// <summary>
/// 鏇存柊鍙枡璁板綍琛�
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
- /// <param name="input">杈撳叆.</param>
+ /// <param name="id">涓婚敭ID</param>
+ /// <param name="input">鏇存柊鍙傛暟</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpPut]
[Route("{id}")]
public virtual Task<CallMaterialOrderRecordDto> UpdateAsync(Guid id, CallMaterialOrderRecordUpdateDto input)
{
+ input.LastModifierName = _currentUser.UserAccount;//淇敼浜�
return _callMaterialOrderRecordAppService.UpdateAsync(id, input);
}
/// <summary>
/// 鍏嬮殕鍙枡璁板綍琛�
/// </summary>
- /// <param name="ids">Id闆嗗悎.</param>
+ /// <param name="ids">Id闆嗗悎</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpPost]
[Route("Clone")]
public virtual Task<List<CallMaterialOrderRecordDto>> CloneAsync([FromBody] IEnumerable<Guid> ids)
{
- return _callMaterialOrderRecordAppService.CloneAsync(ids);
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
+ return _callMaterialOrderRecordAppService.CloneAsync(ids, myCurrentUser);
}
/// <summary>
/// 鍒犻櫎鍙枡璁板綍琛�
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
+ /// <param name="id">涓婚敭ID</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpDelete]
[Route("{id}")]
public virtual Task DeleteAsync(Guid id)
{
- return _callMaterialOrderRecordAppService.DeleteAsync(id);
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
+ //return _wmsMaterialAppService.DeleteAsync(id,myCurrentUser);//閫昏緫鍒犻櫎
+ return _callMaterialOrderRecordAppService.DeletePermanentlyAsync(id, myCurrentUser);//鐗╃悊鍒犻櫎
}
/// <summary>
/// 鎵归噺鍒犻櫎鍙枡璁板綍琛�
/// </summary>
- /// <param name="ids">The ids.</param>
+ /// <param name="ids">涓婚敭ID闆嗗悎</param>
/// <returns></returns>
- [Authorize]
+ [Authorize]
[HttpDelete]
public virtual Task DeleteAsync([FromBody] IEnumerable<Guid> ids)
{
- return _callMaterialOrderRecordAppService.DeleteManyAsync(ids);
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
+ // return _wmsMaterialAppService.DeleteManyAsync(ids,myCurrentUser);//閫昏緫鍒犻櫎
+ return _callMaterialOrderRecordAppService.BatchDeletePermanentlyAsync(ids, myCurrentUser);//鐗╃悊鍒犻櫎
}
/// <summary>
/// 璋冩暣鎺掑簭鍙枡璁板綍琛�
/// </summary>
- /// <param name="id">鏍囪瘑绗�.</param>
+ /// <param name="id">涓婚敭ID</param>
/// <returns></returns>
[HttpPut]
[Route("{id}/AdjustSort/{sort}")]
@@ -155,10 +178,15 @@
throw new UserFriendlyException("璇锋鏌ュ鍏ョ殑琛ㄦ牸");
}
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
await _callMaterialOrderRecordAppService.ImportAsync(new CallMaterialOrderRecordsImportModel
{
CallMaterialOrderRecords = callMaterialOrderRecordRows,
- });
+ },myCurrentUser);
return Ok();
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs
index b027c3f..0ad0a16 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs
@@ -47,7 +47,7 @@
[HttpPost]
public virtual async Task<MesOrderResponse> GetWorkPlanAsync([FromBody] List<WorkPlanInput> input)
{
- return await _mesAppService.CreateAsync(input,"","");
+ return await _mesAppService.CreateAsync(input, "", "");
}
/// <summary>
@@ -67,5 +67,26 @@
};
return await sharedService.CommonPick(_serviceProvider, input, myCurrentUser);
}
+
+
+ /// <summary>
+ /// 鍙枡
+ /// </summary>
+ /// <param name="input">鏍囪瘑绗�.</param>
+ /// <returns></returns>
+ [Authorize]
+ [HttpPost]
+ [Route("CallMaterial")]
+ public virtual async Task<MesOrderResponse> CallMaterial([FromBody] CallMaterialByDataIdentifierInput input)
+ {
+ MyCurrentUser myCurrentUser = new MyCurrentUser()
+ {
+ UserAccount = _currentUser.UserAccount,
+ UserId = _currentUser.UserId
+ };
+ return await sharedService.CallMaterial(input, _serviceProvider, myCurrentUser);
+ }
+
+
}
}
diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
index 81e821c..3d83626 100644
--- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
+++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs
@@ -326,7 +326,7 @@
try
{
//鏍规嵁wms浠诲姟鍙峰鎵� 鍙枡宸ュ崟
- callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo);
+ callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo);
if (callMaterialOrder == null) return;//缁撴潫
@@ -446,7 +446,7 @@
try
{
//鏍规嵁wms浠诲姟鍙峰鎵� 鍙枡宸ュ崟
- callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo);
+ callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo);
if (callMaterialOrder == null) return;//缁撴潫
@@ -599,7 +599,7 @@
try
{
//鏍规嵁wms浠诲姟鍙峰鎵� 鍙枡宸ュ崟
- callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo);
+ callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo);
if (callMaterialOrder == null) return;//缁撴潫
@@ -718,7 +718,7 @@
try
{
//鏍规嵁wms浠诲姟鍙峰鎵� 鍙枡宸ュ崟
- callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo);
+ callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo);
if (callMaterialOrder == null) return;//缁撴潫
diff --git "a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrderRecord\345\257\274\345\207\272\346\250\241\346\235\277.xlsx" "b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrderRecord\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
index 53546f3..0f1b3bc 100644
--- "a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrderRecord\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
+++ "b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrderRecord\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
Binary files differ
diff --git "a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrder\345\257\274\345\207\272\346\250\241\346\235\277.xlsx" "b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrder\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
index caccfc1..4722dc7 100644
--- "a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrder\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
+++ "b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/CallMaterialOrder\345\257\274\345\207\272\346\250\241\346\235\277.xlsx"
Binary files differ
diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/queryExtensions/CmsQueryExtensions/Entitys/CmsApiResponse.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/queryExtensions/CmsQueryExtensions/Entitys/CmsApiResponse.cs"
new file mode 100644
index 0000000..7108486
--- /dev/null
+++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/queryExtensions/CmsQueryExtensions/Entitys/CmsApiResponse.cs"
@@ -0,0 +1,54 @@
+锘縰sing System;
+namespace CmsQueryExtensions.Entitys;
+/// <summary>
+/// CMS鐨凙PI 鍝嶅簲瀹炰綋绫�
+/// </summary>
+public class CmsApiResponse<T>
+{
+ /// <summary>
+ /// 閿欒淇℃伅锛堝 "璇ュ瀷鍙风墿鏂欎俊鎭笉瀛樺湪"锛�
+ /// </summary>
+ public string Message { get; set; }
+
+ /// <summary>
+ /// 杩斿洖鐨勬暟鎹紙鍙兘涓� null锛�
+ /// </summary>
+ public T Data { get; set; }
+
+ /// <summary>
+ /// 鑷畾涔夌姸鎬佺爜锛堝 200 琛ㄧず鎴愬姛锛屼絾涓氬姟閫昏緫鍙兘杩斿洖閿欒锛�
+ /// </summary>
+ public int Code { get; set; } = 200;
+}
+
+///// <summary>
+///// 閿欒璇︽儏瀹炰綋绫�
+///// </summary>
+//public class ResponseError
+//{
+// /// <summary>
+// /// 閿欒浠g爜锛堝彲鑳戒负 null锛�
+// /// </summary>
+// public string Code { get; set; }
+
+// /// <summary>
+// /// 閿欒娑堟伅锛堝 "璇ュ瀷鍙风墿鏂欎俊鎭笉瀛樺湪"锛�
+// /// </summary>
+// public string Message { get; set; }
+
+// /// <summary>
+// /// 閿欒璇︽儏锛堝彲鑳戒负绌猴級
+// /// </summary>
+// public string Details { get; set; }
+
+// /// <summary>
+// /// 棰濆鏁版嵁锛堝彲鑳戒负 null锛�
+// /// </summary>
+// public object Data { get; set; }
+
+// /// <summary>
+// /// 楠岃瘉閿欒锛堝彲鑳戒负 null锛�
+// /// </summary>
+// public object ValidationErrors { get; set; }
+//}
+
diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/queryExtensions/CmsQueryExtensions/Utils/HttpApiRequest.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/queryExtensions/CmsQueryExtensions/Utils/HttpApiRequest.cs"
new file mode 100644
index 0000000..63bf4e5
--- /dev/null
+++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/queryExtensions/CmsQueryExtensions/Utils/HttpApiRequest.cs"
@@ -0,0 +1,63 @@
+锘�// 楹荤渷鐞嗗伐瀛﹂櫌璁稿彲璇�
+//
+// 鐗堟潈鎵�鏈� (c) 2021-2023 zuohuaijun锛屽ぇ鍚嶇鎶�锛堝ぉ娲ワ級鏈夐檺鍏徃 鑱旂郴鐢佃瘽/寰俊锛�18020030720 QQ锛�515096995
+//
+// 鐗规鍏嶈垂鎺堜簣鑾峰緱鏈蒋浠剁殑浠讳綍浜轰互澶勭悊鏈蒋浠剁殑鏉冨埄锛屼絾椤婚伒瀹堜互涓嬫潯浠讹細鍦ㄦ墍鏈夊壇鏈垨閲嶈閮ㄥ垎鐨勮蒋浠朵腑蹇呴』鍖呮嫭涓婅堪鐗堟潈澹版槑鍜屾湰璁稿彲澹版槑銆�
+//
+// 杞欢鎸夆�滃師鏍封�濇彁渚涳紝涓嶆彁渚涗换浣曞舰寮忕殑鏄庣ず鎴栨殫绀虹殑淇濊瘉锛屽寘鎷絾涓嶉檺浜庡閫傞攢鎬с�侀�傜敤鎬у拰闈炰镜鏉冪殑淇濊瘉銆�
+// 鍦ㄤ换浣曟儏鍐典笅锛屼綔鑰呮垨鐗堟潈鎸佹湁浜哄潎涓嶅浠讳綍绱㈣禂銆佹崯瀹虫垨鍏朵粬璐d换璐熻矗锛屾棤璁烘槸鍥犲悎鍚屻�佷镜鏉冩垨鍏朵粬鏂瑰紡寮曡捣鐨勶紝涓庤蒋浠舵垨鍏朵娇鐢ㄦ垨鍏朵粬浜ゆ槗鏈夊叧銆�
+
+using Newtonsoft.Json;
+using System.Net;
+using System.Text;
+
+namespace CmsQueryExtensions;
+public class HttpApiRequest
+{
+ public static string HttpGet(string url)
+ {
+ string result = "";
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
+ req.Method = "GET";
+ req.ContentType = "application/json";
+ HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
+ Stream stream = resp.GetResponseStream();
+ //鑾峰彇鍝嶅簲鍐呭
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ result = reader.ReadToEnd();
+ }
+ return result;
+ }
+ public static string HttpPost(string url, string jsondata)
+ {
+ string result = "";
+ HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
+ // HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
+
+ req.Method = "POST";
+ req.ContentType = "application/json";
+
+ if (!string.IsNullOrWhiteSpace(jsondata))
+ {
+ byte[] data = Encoding.UTF8.GetBytes(jsondata);
+ req.ContentLength = data.Length;
+
+ using (Stream reqStream = req.GetRequestStream())
+ {
+ reqStream.Write(data, 0, data.Length);
+ reqStream.Close();
+ }
+ }
+
+ HttpWebResponse resp = (HttpWebResponse)req.GetResponse();
+ Stream stream = resp.GetResponseStream();
+ //鑾峰彇鍝嶅簲鍐呭
+ using (StreamReader reader = new StreamReader(stream, Encoding.UTF8))
+ {
+ result = reader.ReadToEnd();
+ }
+ return result;
+ }
+}
+
--
Gitblit v1.9.3