Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo
| | |
| | | using 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; |
| | |
| | | /// <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 |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | `æ¯å¦è¦å«æ${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() |
| | | }) |
| | |
| | | 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 callMaterialOrderDrawer = injectModel<CallMaterialOrderDrawer>( |
| | | 'CallMaterialOrderDrawer' |
| | | ) |
| | | /** |
| | | * ç¨æ¥å¯¹æ¯çåå§åæ°æ® |
| | | */ |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åææ è¯', |
| | | highSelectAttrs: { |
| | | prop: 'dataIdentifier_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_STRING, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'åæåå·', |
| | |
| | | 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: 'å«æç¶æ', |
| | |
| | | option: [], |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å«æç¶æ', |
| | | highSelectAttrs: { |
| | | prop: 'callMaterialStatus_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_BOOL, |
| | | }, |
| | | }, |
| | | { |
| | | label: '嫿æ°é', |
| | |
| | | precision: 0, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å«ææ°é', |
| | | highSelectAttrs: { |
| | | prop: 'quantity_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_NUM, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'WMSè¿åç»æ', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥WMSè¿åç»æ', |
| | | highSelectAttrs: { |
| | | prop: 'wmsRetResult_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_STRING, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'WMSä»»å¡å·', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥WMSä»»å¡å·', |
| | | highSelectAttrs: { |
| | | prop: 'wmsTaskNo_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_STRING, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | |
| | | width: '100%', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å建æ¶é´', |
| | | isDateControl: true, // æ¾å¼æ è®°ä¸ºæ¥ææ§ä»¶ |
| | | }, |
| | | { |
| | | label: 'ä¿®æ¹æ¶é´', |
| | |
| | | width: '100%', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä¿®æ¹æ¶é´', |
| | | isDateControl: true, // æ¾å¼æ è®°ä¸ºæ¥ææ§ä»¶ |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å建人', |
| | | highSelectAttrs: { |
| | | prop: 'creatorName_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_STRING, |
| | | }, |
| | | }, |
| | | { |
| | | label: 'ä¿®æ¹äºº', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä¿®æ¹äºº', |
| | | highSelectAttrs: { |
| | | prop: 'lastModifierName_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_STRING, |
| | | }, |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | highSelectAttrs: { |
| | | prop: 'remark_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options: FILTER_MODE_OPTIONS_STRING, |
| | | }, |
| | | }, |
| | | ]) |
| | | /** |
| | |
| | | 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; |
| | | return data |
| | | } |
| | | const onClose = (done: () => void) => { |
| | | if (visible.value) { |
| | | visible.value = false |
| | | const data =commonGetFormData(); |
| | | const data = commonGetFormData() |
| | | ctx.emit('close', data) |
| | | } |
| | | } |
| | |
| | | * 确认æ¥è¯¢ |
| | | */ |
| | | const onConfirmQuery = async () => { |
| | | const data =commonGetFormData(); |
| | | 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.deletionTime = '' |
| | | formData.value.operationRemark = '' |
| | | formData.value.deleteRemark = '' |
| | | formData.value.creationTime = '' |
| | | formData.value.lastModificationTime = '' |
| | | formData.value.creatorName = '' |
| | | formData.value.lastModifierName = '' |
| | | formData.value.remark = '' |
| | | formData.value.extraField1 = '' |
| | | formData.value.extraField2 = '' |
| | | formData.value.extraField3 = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | ctx.emit('restQuery'); |
| | | ctx.emit('restQuery') |
| | | } |
| | | |
| | | const updateCheckData = () => { |
| | |
| | | * éç¨æ¥è¯¢æä¸¾ |
| | | */ |
| | | const commonQueryEnumForFrom = async () => { |
| | | const callMaterialStatusEnumEnum = await callMaterialOrderDrawer.getWmsEnumData({ |
| | | const callMaterialStatusEnumEnum = |
| | | await callMaterialOrderDrawer.getWmsEnumData({ |
| | | EnumName: 'CallMaterialStatusEnum', |
| | | }) |
| | | updateFormItemOptions('callMaterialStatus', callMaterialStatusEnumEnum) |
| | | |
| | | } |
| | | commonQueryEnumForFrom() |
| | | onResetForHighSelect() //éç½®å
Œ
±selectæ¥è¯¢ |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | |
| | | return deleteCallMaterialOrders(ids) |
| | | } |
| | | |
| | | async callMaterialByDataIdentifier(ids: string) { |
| | | return callMaterialByDataIdentifier(ids) |
| | | async callMaterialByDataIdentifier(data: any) { |
| | | return callMaterialByDataIdentifier(data) |
| | | } |
| | | |
| | | |
| | |
| | | * 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) |
| | | } |
| | | |
| | | /** |
| | |
| | | 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<{ |
| | |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | <DyFormForHighQuery |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | ></DyFormForHighQuery> |
| | | </BaseQueryDrawer> |
| | | ) |
| | | }, |
| | |
| | | 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') |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åæåå·', |
| | | }, |
| | | { |
| | | label: 'åææ¹æ¬¡', |
| | | prop: 'materialBatch', |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åææ¹æ¬¡', |
| | | }, |
| | | { |
| | | label: 'å«æç¶æ', |
| | |
| | | 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, |
| | |
| | | formData.value = { |
| | | dataIdentifier: res.dataIdentifier, |
| | | materialMode: res.materialMode, |
| | | materialBatch: res.materialBatch, |
| | | callMaterialStatus: res.callMaterialStatus, |
| | | quantity: res.quantity, |
| | | wmsRetResult: res.wmsRetResult, |
| | |
| | | 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') |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥åææ è¯', |
| | | highSelectAttrs:{ |
| | | prop: 'dataIdentifier_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options:FILTER_MODE_OPTIONS_STRING |
| | | } |
| | | }, |
| | | { |
| | | label: 'åæåå·', |
| | |
| | | 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: 'å«æç¶æ', |
| | |
| | | option: [], |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å«æç¶æ', |
| | | highSelectAttrs:{ |
| | | prop: 'callMaterialStatus_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options:FILTER_MODE_OPTIONS_BOOL |
| | | } |
| | | }, |
| | | { |
| | | label: '嫿æ°é', |
| | |
| | | precision: 0, |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å«ææ°é', |
| | | highSelectAttrs:{ |
| | | prop: 'quantity_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options:FILTER_MODE_OPTIONS_NUM |
| | | } |
| | | }, |
| | | { |
| | | label: 'WMSè¿åç»æ', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥WMSè¿åç»æ', |
| | | highSelectAttrs:{ |
| | | prop: 'wmsRetResult_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options:FILTER_MODE_OPTIONS_STRING |
| | | } |
| | | }, |
| | | { |
| | | label: 'WMSä»»å¡å·', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥WMSä»»å¡å·', |
| | | highSelectAttrs:{ |
| | | prop: 'wmsTaskNo_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options:FILTER_MODE_OPTIONS_STRING |
| | | } |
| | | }, |
| | | { |
| | | label: 'å建æ¶é´', |
| | |
| | | width: '100%', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å建æ¶é´', |
| | | isDateControl: true, // æ¾å¼æ è®°ä¸ºæ¥ææ§ä»¶ |
| | | }, |
| | | { |
| | | label: 'ä¿®æ¹æ¶é´', |
| | |
| | | width: '100%', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥ä¿®æ¹æ¶é´', |
| | | isDateControl: true, // æ¾å¼æ è®°ä¸ºæ¥ææ§ä»¶ |
| | | }, |
| | | { |
| | | label: 'å建人', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å建人', |
| | | highSelectAttrs:{ |
| | | prop: 'creatorName_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options:FILTER_MODE_OPTIONS_STRING |
| | | } |
| | | }, |
| | | { |
| | | label: '夿³¨', |
| | |
| | | el: 'input', |
| | | //disabled: disabled, |
| | | placeholder: '请è¾å
¥å¤æ³¨', |
| | | highSelectAttrs:{ |
| | | prop: 'remark_FilterMode', |
| | | el: 'select', |
| | | placeholder: 'è¯·éæ©', |
| | | options:FILTER_MODE_OPTIONS_STRING |
| | | } |
| | | }, |
| | | ]) |
| | | /** |
| | |
| | | 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 || '', |
| | | remark: formData.value.remark || '', |
| | | remark_FilterMode: formData.value.remark_FilterMode || '', |
| | | } |
| | | return data; |
| | | } |
| | |
| | | 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.creationTime = '' |
| | | formData.value.lastModificationTime = '' |
| | | formData.value.creatorName = '' |
| | | formData.value.remark = '' |
| | | formData.value.extraField1 = '' |
| | | formData.value.extraField2 = '' |
| | | formData.value.extraField3 = '' |
| | | //åç¶ç»ä»¶åéèªå®ä¹äºä»¶ |
| | | ctx.emit('restQuery'); |
| | | } |
| | |
| | | |
| | | } |
| | | commonQueryEnumForFrom() |
| | | onResetForHighSelect();//éç½®å
Œ
±selectæ¥è¯¢ |
| | | /** |
| | | * å¼¹çªæå¼è·å详æ
|
| | | */ |
| | |
| | | ElFormItem, |
| | | } from 'element-plus' |
| | | import { injectModel } from '@/libs/Provider/Provider' |
| | | // å¼å
¥å
Œ
±é项é
ç½® |
| | | import { |
| | | FILTER_MODE_OPTIONS_STRING |
| | | } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; |
| | | |
| | | interface RenderTableType { |
| | | url?: string |
| | |
| | | // æ°å¢çæ¥è¯¢æ¡ä»¶ |
| | | 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ä»»å¡å·/å建人/夿³¨'); |
| | | |
| | | |
| | | // 卿æä¸¾é项 |
| | |
| | | } |
| | | } |
| | | |
| | | // å®ä¹ååºå¼æ¥è¯¢æ°æ® |
| | | 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) |
| | | } |
| | |
| | | // æ°ççæ¥è¯¢éç½® |
| | | const resetQuery = () => { |
| | | queryForm.value.searchVal = '' |
| | | queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; |
| | | queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; |
| | | } |
| | | //æ°ççå¯¼åºæ¹æ³ |
| | |
| | | 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; |
| | | } |
| | | //è·åé«çº§æ¥è¯¢å¼¹åºæ¡çæ¥è¯¢å¼ |
| | |
| | | ) |
| | | //ç»åæ¨¡ç³æ¥è¯¢ |
| | | filteredData.searchVal = queryForm.value.searchVal |
| | | filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode |
| | | filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value; |
| | | return filteredData; |
| | | } |
| | |
| | | |
| | | <div class={styles.headerContent}> |
| | | <div class={styles.header}> |
| | | {/* <IconButton |
| | | <IconButton |
| | | v-permission="callMaterialOrderRecord-add" |
| | | icon="add-p" |
| | | onClick={onAddCallMaterialOrderRecord} |
| | |
| | | </IconButton> |
| | | <el-divider direction="vertical" /> |
| | | |
| | | <el-divider direction="vertical" /> */} |
| | | {/* <el-upload |
| | | <el-upload |
| | | v-permission="callMaterialOrderRecord-import" |
| | | name="file" |
| | | accept=".xlsx,.xls,.csv" |
| | |
| | | action="/api/v1/PipeLineLems/callMaterialOrderRecord/import" |
| | | > |
| | | <IconButton icon="in">导å
¥</IconButton> |
| | | </el-upload> */} |
| | | </el-upload> |
| | | |
| | | <IconButton |
| | | v-permission="callMaterialOrderRecord-output" |
| | |
| | | /> |
| | | </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> |
| | |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'materialBatch', |
| | | title: 'åææ¹æ¬¡', |
| | | width:160, |
| | | }, |
| | | { |
| | | field: 'callMaterialStatusDesc', |
| | | title: 'å«æç¶æ', |
| | | width:160, |
| | |
| | | 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<{ |
| | |
| | | before-close={onClose} |
| | | onClose={onClose} |
| | | > |
| | | <DyForm |
| | | <DyFormForHighQuery |
| | | ref={formRef} |
| | | formData={formData.value} |
| | | labelWidth="106px" |
| | | formItemProps={formItems} |
| | | ></DyForm> |
| | | ></DyFormForHighQuery> |
| | | </BaseQueryDrawer> |
| | | ) |
| | | }, |
| | |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | public string CreatorName { get; set; } |
| | | } |
| | |
| | | public string? MaterialMode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¹æ¬¡ |
| | | /// </summary> |
| | | public string? MaterialBatch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å«æç¶æ |
| | | /// </summary> |
| | | public CallMaterialStatusEnum CallMaterialStatus { get; set; } |
| | |
| | | /// 嫿æ°é |
| | | /// </summary> |
| | | public int Quantity { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | public string CreatorName { get; set; } |
| | | |
| | | /// <summary> |
| | | /// WMSè¿åç»æ |
| | |
| | | public string? MaterialMode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¹æ¬¡ |
| | | /// </summary> |
| | | public string? MaterialBatch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å«æç¶æ |
| | | /// </summary> |
| | | public CallMaterialStatusEnum CallMaterialStatus { get; set; } |
| | |
| | | public string MaterialMode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¹æ¬¡ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åææ¹æ¬¡", Width = 25)] |
| | | public string MaterialBatch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å«æç¶æ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å«æç¶æ", Width = 25)] |
| | |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹äºº |
| | | /// </summary> |
| | | public string LastModifierName { get; set; } |
| | | } |
| | |
| | | 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; } |
| | |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> CreationTime { get; set; } |
| | | public string CreationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> LastModificationTime { get; set; } |
| | | public string LastModificationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> DeletionTime { get; set; } |
| | | public string DeletionTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// æ¯å¦ç¦ç¨ |
| | | /// </summary> |
| | | public bool? IsDisabled { get; set; } = false; |
| | | |
| | | /// <summary> |
| | | /// å建人 |
| | | /// </summary> |
| | | public string CreatorName { get; set; } |
| | | } |
| | |
| | | public string? MaterialMode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¹æ¬¡ |
| | | /// </summary> |
| | | public string? MaterialBatch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å«æç¶æ |
| | | /// </summary> |
| | | public CallMaterialStatusEnum CallMaterialStatus { get; set; } |
| | |
| | | public string? MaterialMode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¹æ¬¡ |
| | | /// </summary> |
| | | public string? MaterialBatch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å«æç¶æ |
| | | /// </summary> |
| | | public CallMaterialStatusEnum CallMaterialStatus { get; set; } |
| | |
| | | public string MaterialMode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// åææ¹æ¬¡ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "åææ¹æ¬¡", Width = 25)] |
| | | public string MaterialBatch { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å«æç¶æ |
| | | /// </summary> |
| | | [ExcelColumn(Name = "å«æç¶æ", Width = 25)] |
| | |
| | | /// å¹¶åæ³ |
| | | /// </summary> |
| | | public string ConcurrencyStamp { get; set; } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹äºº |
| | | /// </summary> |
| | | public string LastModifierName { get; set; } |
| | | } |
| | |
| | | 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; } |
| | |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> CreationTime { get; set; } |
| | | public string CreationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> LastModificationTime { get; set; } |
| | | public string LastModificationTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | //è¡¨ç¤ºæ¯ é«çº§æ¥è¯¢èå´æ¥è¯¢ç¹æ§ |
| | | [HighSearchRangeAttribute] |
| | | public List<string> DeletionTime { get; set; } |
| | | public string DeletionTime { get; set; } |
| | | |
| | | |
| | | /// <summary> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using 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; } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | 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; |
| | | using CmsQueryExtensions.Entitys; |
| | | using System.Linq.Expressions; |
| | | using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Contracts.Services; |
| | | |
| | |
| | | /// </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 DeleteManyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser); |
| | | |
| | | Task<CallMaterialOrder> FindByWmsTaskNoAsync(string wmsTaskNo); |
| | | /// <summary> |
| | | /// ç©çå é¤å«æå表 |
| | | /// </summary> |
| | | /// <param name="id">主é®ID</param> |
| | | /// <param name="cancellationToken"></param> |
| | | /// <returns></returns> |
| | | Task DeletePermanentlyAsync(Guid id, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default); |
| | | |
| | | |
| | | Task CallMaterialByDataIdentifier(Guid id); |
| | | /// <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="input"></param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(CallMaterialOrdersImportModel input); |
| | | Task ImportAsync(CallMaterialOrdersImportModel input, MyCurrentUser myCurrentUser); |
| | | |
| | | /// <summary> |
| | | /// 导åºå«æå表 |
| | |
| | | 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; |
| | | |
| | |
| | | /// </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> |
| | | /// è°æ´æåºå«æè®°å½è¡¨ |
| | |
| | | /// </summary> |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | Task ImportAsync(CallMaterialOrderRecordsImportModel input); |
| | | Task ImportAsync(CallMaterialOrderRecordsImportModel input, MyCurrentUser myCurrentUser); |
| | | |
| | | /// <summary> |
| | | /// 导åºå«æè®°å½è¡¨ |
| | |
| | | /// <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âMultipleThrowException = false, CancellationToken cancellationToken = default); |
| | | } |
| | |
| | | </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> |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | using CmsQueryExtensions.Entitys; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | |
| | | public class CallMaterialOrderAppService : CMSPluginAppService, ICallMaterialOrderAppService |
| | | { |
| | | private readonly ICallMaterialOrderRepository _callMaterialOrderRepository; |
| | | private readonly SharedService _sharedService; |
| | | private readonly IServiceProvider _serviceProvider; |
| | | |
| | | /// <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) |
| | | public CallMaterialOrderAppService(ICallMaterialOrderRepository callMaterialOrderRepository) |
| | | { |
| | | _callMaterialOrderRepository = callMaterialOrderRepository; |
| | | _sharedService = sharedService; |
| | | _serviceProvider = serviceProvider; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | 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); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | insertObj.Sort = sort; |
| | | input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); |
| | | |
| | | insertObj.CreatorName = input.CreatorName;//å建人 |
| | | await _callMaterialOrderRepository.InsertAsync(insertObj); |
| | | |
| | | //if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | |
| | | |
| | | 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; |
| | | |
| | | |
| | | updateObj.LastModifierName = input.LastModifierName;//ä¿®æ¹äºº |
| | | |
| | | await _callMaterialOrderRepository.UpdateAsync(updateObj); |
| | | |
| | |
| | | /// </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; |
| | |
| | | // 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); |
| | | // } |
| | | // } |
| | |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | 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> |
| | |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(CallMaterialOrdersImportModel input) |
| | | public async Task ImportAsync(CallMaterialOrdersImportModel input, MyCurrentUser myCurrentUser) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | |
| | | { |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | MaterialMode = impItem.MaterialMode, |
| | | MaterialBatch = impItem.MaterialBatch, |
| | | CallMaterialStatus = impItem.CallMaterialStatus, |
| | | Quantity = impItem.Quantity, |
| | | WmsRetResult = impItem.WmsRetResult, |
| | |
| | | { |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | MaterialMode = impItem.MaterialMode, |
| | | MaterialBatch = impItem.MaterialBatch, |
| | | CallMaterialStatus = impItem.CallMaterialStatus, |
| | | Quantity = impItem.Quantity, |
| | | WmsRetResult = impItem.WmsRetResult, |
| | |
| | | { |
| | | try |
| | | { |
| | | callMaterialOrderDto.Item.CreatorName = myCurrentUser.UserAccount;//å建人 |
| | | await CreateAsync(callMaterialOrderDto.Item); |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | try |
| | | { |
| | | callMaterialOrderDto.Item.LastModifierName = myCurrentUser.UserAccount;//ä¿®æ¹äºº |
| | | await UpdateAsync(callMaterialOrderDto.Id, callMaterialOrderDto.Item); |
| | | } |
| | | catch (Exception e) |
| | |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | using CmsQueryExtensions.Entitys; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Application.Implements; |
| | | |
| | |
| | | /// </summary> |
| | | public class CallMaterialOrderRecordAppService : CMSPluginAppService, ICallMaterialOrderRecordAppService |
| | | { |
| | | private readonly ICallMaterialOrderRecordRepository callMaterialOrderRecordRepository; |
| | | 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) |
| | | public CallMaterialOrderRecordAppService(ICallMaterialOrderRecordRepository callMaterialOrderRecordRepository) |
| | | { |
| | | callMaterialOrderRecordRepository = _CallMaterialOrderRecordRepository; |
| | | _callMaterialOrderRecordRepository = callMaterialOrderRecordRepository; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <returns></returns> |
| | | public virtual async Task<CallMaterialOrderRecordDto> GetAsync(Guid id) |
| | | { |
| | | return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(await callMaterialOrderRecordRepository.GetAsync(id)); |
| | | return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(await _callMaterialOrderRecordRepository.GetAsync(id)); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | #endregion |
| | | |
| | | var count = await callMaterialOrderRecordRepository.GetCountAsync(whereConditions); |
| | | var list = await callMaterialOrderRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); |
| | | 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)); |
| | | } |
| | |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var exist = await callMaterialOrderRecordRepository.NameExistAsync(input.DataIdentifier); |
| | | var exist = await _callMaterialOrderRecordRepository.NameExistAsync(input.DataIdentifier); |
| | | if (exist) |
| | | { |
| | | throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.DataIdentifier]); |
| | | } |
| | | |
| | | var maxSort = await callMaterialOrderRecordRepository.GetMaxSortAsync(); |
| | | 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); |
| | | insertObj.CreatorName = input.CreatorName;//å建人 |
| | | await _callMaterialOrderRecordRepository.InsertAsync(insertObj); |
| | | |
| | | //if (input.Sort.HasValue && insertObj.Sort != maxSort) |
| | | //{ |
| | |
| | | { |
| | | await CheckCreateOrUpdateDtoAsync(input); |
| | | |
| | | var updateObj = await callMaterialOrderRecordRepository.GetAsync(id); |
| | | var exist = await callMaterialOrderRecordRepository.NameExistAsync(input.DataIdentifier, updateObj.Id); |
| | | 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.DataIdentifier = input.DataIdentifier; |
| | | updateObj.MaterialMode = input.MaterialMode; |
| | | updateObj.MaterialBatch = input.MaterialBatch; |
| | | updateObj.CallMaterialStatus = input.CallMaterialStatus; |
| | | updateObj.Quantity = input.Quantity; |
| | | updateObj.WmsRetResult = input.WmsRetResult; |
| | |
| | | updateObj.Remark = input.Remark; |
| | | |
| | | |
| | | await callMaterialOrderRecordRepository.UpdateAsync(updateObj); |
| | | |
| | | |
| | | await _callMaterialOrderRecordRepository.UpdateAsync(updateObj); |
| | | |
| | | return ObjectMapper.Map<CallMaterialOrderRecord, CallMaterialOrderRecordDto>(updateObj); |
| | | } |
| | |
| | | /// </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; |
| | |
| | | // 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); |
| | | // } |
| | | // } |
| | |
| | | /// <returns></returns> |
| | | public virtual Task DeleteAsync(Guid id) |
| | | { |
| | | return callMaterialOrderRecordRepository.DeleteAsync(id); |
| | | return _callMaterialOrderRecordRepository.DeleteAsync(id); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="ids"></param> |
| | | /// <returns></returns> |
| | | public async Task DeleteManyAsync(IEnumerable<Guid> ids) |
| | | 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> |
| | |
| | | /// <returns></returns> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await callMaterialOrderRecordRepository.GetListAsync(null, nameof(CallMaterialOrderRecord.Sort)); |
| | | var list = await _callMaterialOrderRecordRepository.GetListAsync(null, nameof(CallMaterialOrderRecord.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | |
| | | } |
| | | } |
| | | |
| | | await callMaterialOrderRecordRepository.UpdateManyAsync(list); |
| | | await _callMaterialOrderRecordRepository.UpdateManyAsync(list); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="input"></param> |
| | | /// <returns></returns> |
| | | /// <exception cref="UserFriendlyException"></exception> |
| | | public async Task ImportAsync(CallMaterialOrderRecordsImportModel input) |
| | | public async Task ImportAsync(CallMaterialOrderRecordsImportModel input, MyCurrentUser myCurrentUser) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | |
| | | throw new UserFriendlyException(errorMsg); |
| | | } |
| | | |
| | | var oldCallMaterialOrderRecord = await callMaterialOrderRecordRepository.FindByNameAsync(impItem.DataIdentifier); |
| | | var oldCallMaterialOrderRecord = await _callMaterialOrderRecordRepository.FindByNameAsync(impItem.DataIdentifier); |
| | | if (oldCallMaterialOrderRecord != null) |
| | | { |
| | | var callMaterialOrderRecordUpdateDto = new CallMaterialOrderRecordUpdateDto |
| | | { |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | MaterialMode = impItem.MaterialMode, |
| | | MaterialBatch = impItem.MaterialBatch, |
| | | CallMaterialStatus = impItem.CallMaterialStatus, |
| | | Quantity = impItem.Quantity, |
| | | WmsRetResult = impItem.WmsRetResult, |
| | |
| | | { |
| | | DataIdentifier = impItem.DataIdentifier, |
| | | MaterialMode = impItem.MaterialMode, |
| | | MaterialBatch = impItem.MaterialBatch, |
| | | CallMaterialStatus = impItem.CallMaterialStatus, |
| | | Quantity = impItem.Quantity, |
| | | WmsRetResult = impItem.WmsRetResult, |
| | |
| | | { |
| | | try |
| | | { |
| | | callMaterialOrderRecordDto.Item.CreatorName = myCurrentUser.UserAccount;//å建人 |
| | | await CreateAsync(callMaterialOrderRecordDto.Item); |
| | | } |
| | | catch (Exception e) |
| | |
| | | { |
| | | try |
| | | { |
| | | callMaterialOrderRecordDto.Item.LastModifierName = myCurrentUser.UserAccount;//ä¿®æ¹äºº |
| | | await UpdateAsync(callMaterialOrderRecordDto.Id, callMaterialOrderRecordDto.Item); |
| | | } |
| | | catch (Exception e) |
| | |
| | | #endregion |
| | | |
| | | |
| | | var list = await callMaterialOrderRecordRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); |
| | | 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> |
| | |
| | | |
| | | 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âMultipleThrowException = false, CancellationToken cancellationToken = default) |
| | | { |
| | | return await _callMaterialOrderRecordRepository.GetSingleByFilterAsync(whereConditions, isâMultipleThrowException); |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | /// <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("åææ è¯ä¸è½ä¸ºç©º"); |
| | | } |
| | |
| | | |
| | | // æ¥æ¾æ°æ® |
| | | |
| | | var callMaterialOrder = await callMaterialOrderRepository.GetAsync(id); |
| | | var callMaterialOrder = await callMaterialOrderRepository.GetAsync(input.Id); |
| | | if (callMaterialOrder == null) |
| | | { |
| | | throw new UserFriendlyException($"æ¾ä¸å°å«æè®°å½"); |
| | |
| | | // éªè¯ç¶æ |
| | | 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è¿åçåææ¹æ¬¡ |
| | |
| | | /// <returns></returns> |
| | | Task<CallMaterialOrder> FindByNameAsync(string name, CancellationToken cancellationToken = default); |
| | | |
| | | Task<CallMaterialOrder> FindByWmsTaskNoAsync(string wmsTaskNo, CancellationToken cancellationToken = default); |
| | | |
| | | /// <summary> |
| | | /// éªè¯åç§°æ¯å¦åå¨å«æå表 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | Task<int> GetMaxSortAsync(); |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// è·åå页åè¡¨å«æå表 |
| | |
| | | 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<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âMultipleThrowException = false, CancellationToken cancellationToken = default); |
| | | } |
| | |
| | | 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; |
| | | |
| | |
| | | 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âMultipleThrowException = false, CancellationToken cancellationToken = default) |
| | | { |
| | | if (isâMultipleThrowException) |
| | | { |
| | | 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)); |
| | | } |
| | | } |
| | | } |
| | |
| | | .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> |
| | |
| | | } |
| | | |
| | | /// <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> |
| | |
| | | </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> |
| | |
| | | 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; |
| | | |
| | |
| | | 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 => |
| | | { |
| | |
| | | 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; |
| | |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using CmsQueryExtensions.Entitys; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Controller |
| | | { |
| | |
| | | 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}")] |
| | |
| | | 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")] |
| | |
| | | /// <summary> |
| | | /// åå»ºå«æå表 |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <param name="input">åå»ºåæ°</param> |
| | | /// <returns></returns> |
| | | [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] |
| | | [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] |
| | | [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] |
| | | [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] |
| | | [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}")] |
| | |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | | UserId = _currentUser.UserId |
| | | }; |
| | | await _callMaterialOrderAppService.ImportAsync(new CallMaterialOrdersImportModel |
| | | { |
| | | CallMaterialOrders = callMaterialOrderRows, |
| | | }); |
| | | },myCurrentUser); |
| | | |
| | | return Ok(); |
| | | } |
| | |
| | | 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; |
| | |
| | | using System.Reflection; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using CmsQueryExtensions.Entitys; |
| | | |
| | | namespace CMS.Plugin.PipeLineLems.Controller |
| | | { |
| | |
| | | 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}")] |
| | |
| | | /// <summary> |
| | | /// å页è·åå«æè®°å½è¡¨çå表. |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <param name="input">æ¥è¯¢åæ°</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | [Route("Page")] |
| | |
| | | /// <summary> |
| | | /// åå»ºå«æè®°å½è¡¨ |
| | | /// </summary> |
| | | /// <param name="input">è¾å
¥.</param> |
| | | /// <param name="input">åå»ºåæ°</param> |
| | | /// <returns></returns> |
| | | [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] |
| | | [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] |
| | | [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] |
| | | [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] |
| | | [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}")] |
| | |
| | | throw new UserFriendlyException("è¯·æ£æ¥å¯¼å
¥çè¡¨æ ¼"); |
| | | } |
| | | |
| | | MyCurrentUser myCurrentUser = new MyCurrentUser() |
| | | { |
| | | UserAccount = _currentUser.UserAccount, |
| | | UserId = _currentUser.UserId |
| | | }; |
| | | await _callMaterialOrderRecordAppService.ImportAsync(new CallMaterialOrderRecordsImportModel |
| | | { |
| | | CallMaterialOrderRecords = callMaterialOrderRecordRows, |
| | | }); |
| | | },myCurrentUser); |
| | | |
| | | return Ok(); |
| | | } |
| | |
| | | }; |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | try |
| | | { |
| | | //æ ¹æ®wmsä»»å¡å·å¯»æ¾ 嫿工å |
| | | callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo); |
| | | callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo); |
| | | if (callMaterialOrder == null) return;//ç»æ |
| | | |
| | | |
| | |
| | | try |
| | | { |
| | | //æ ¹æ®wmsä»»å¡å·å¯»æ¾ 嫿工å |
| | | callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo); |
| | | callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo); |
| | | if (callMaterialOrder == null) return;//ç»æ |
| | | |
| | | |
| | |
| | | try |
| | | { |
| | | //æ ¹æ®wmsä»»å¡å·å¯»æ¾ 嫿工å |
| | | callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo); |
| | | callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo); |
| | | if (callMaterialOrder == null) return;//ç»æ |
| | | |
| | | |
| | |
| | | try |
| | | { |
| | | //æ ¹æ®wmsä»»å¡å·å¯»æ¾ 嫿工å |
| | | callMaterialOrder = await callMaterialOrderAppService.FindByWmsTaskNoAsync(myTaskNo); |
| | | callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo); |
| | | if (callMaterialOrder == null) return;//ç»æ |
| | | |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System; |
| | | namespace CmsQueryExtensions.Entitys; |
| | | /// <summary> |
| | | /// CMSçAPI ååºå®ä½ç±» |
| | | /// </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> |
| | | // /// é误代ç ï¼å¯è½ä¸º 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; } |
| | | //} |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | // 麻ççå·¥å¦é¢è®¸å¯è¯ |
| | | // |
| | | // çæææ (c) 2021-2023 zuohuaijunï¼å¤§åç§æï¼å¤©æ´¥ï¼æéå
¬å¸ èç³»çµè¯/微信ï¼18020030720 QQï¼515096995 |
| | | // |
| | | // ç¹æ¤å
è´¹æäºè·å¾æ¬è½¯ä»¶çä»»ä½äººä»¥å¤çæ¬è½¯ä»¶çæå©ï¼ä½é¡»éµå®ä»¥ä¸æ¡ä»¶ï¼å¨ææå¯æ¬æéè¦é¨åç软件ä¸å¿
é¡»å
æ¬ä¸è¿°çæå£°æåæ¬è®¸å¯å£°æã |
| | | // |
| | | // 软件æâåæ ·âæä¾ï¼ä¸æä¾ä»»ä½å½¢å¼çæç¤ºææç¤ºçä¿è¯ï¼å
æ¬ä½ä¸éäºå¯¹ééæ§ãéç¨æ§åéä¾µæçä¿è¯ã |
| | | // å¨ä»»ä½æ
åµä¸ï¼ä½è
æçæææäººåä¸å¯¹ä»»ä½ç´¢èµãæå®³æå
¶ä»è´£ä»»è´è´£ï¼æ 论æ¯å ååãä¾µææå
¶ä»æ¹å¼å¼èµ·çï¼ä¸è½¯ä»¶æå
¶ä½¿ç¨æå
¶ä»äº¤ææå
³ã |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | |