| | |
| | | asnOrderItem: { |
| | | asnId: "主单标识", |
| | | asnCode: "主单编码", |
| | | poDetlId: "PO单标识", |
| | | poDetlCode: "PO单编码", |
| | | poDetlId: "PO单ID", |
| | | poDetlCode: "PO单", |
| | | matnrId: "物料标识", |
| | | maktx: "物料名称", |
| | | matnrCode: "物料编码", |
| | | anfme: "计划收货数量", |
| | | anfme: "计划收货数", |
| | | stockUnit: "库存单位", |
| | | purQty: "采购数量", |
| | | purQty: "采购量", |
| | | purUnit: "采购单位", |
| | | qty: "已完成数量", |
| | | qty: "完成数量", |
| | | splrBatch: "供应商批次", |
| | | splrCode: "供应商编码", |
| | | splrName: "供应商名称", |
| | | qrcode: "二维码", |
| | | barcode: "条形码", |
| | | packName: "包装名称", |
| | | packName: "包装", |
| | | ntyStatus: "报检状态", |
| | | prodTime: "生产日期", |
| | | platItemId: 'PO单号' |
| | | platItemId: '行号' |
| | | }, |
| | | asnOrderLog: { |
| | | code: "编码", |
| | |
| | | |
| | | const MatnrList = () => { |
| | | const translate = useTranslate(); |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const notify = useNotify(); |
| | |
| | | useGetOne, |
| | | DeleteButton, |
| | | EditBase, |
| | | ReferenceField, |
| | | } from 'react-admin'; |
| | | import { useWatch, useFormContext } from "react-hook-form"; |
| | | import { Stack, Grid, Box, Typography, Dialog, DialogActions, DialogContent, DialogTitle } from '@mui/material'; |
| | |
| | | source="qty" |
| | | readOnly |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.splrCode" |
| | | source="splrCode" |
| | | parse={v => v} |
| | | /> |
| | | <ReferenceInput source="splrName" label="table.field.asnOrderItem.splrName" reference="companys" filter={{type: 'supplier'}}> |
| | | <AutocompleteInput optionText="name" label="table.field.asnOrderItem.splrName" /> |
| | | </ReferenceInput> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.splrName" |
| | | source="splrName" |
| | | parse={v => v} |
| | | /> |
| | | <TextInput |
| | | label="table.field.asnOrderItem.qrcode" |
| | | source="qrcode" |
| | |
| | | '& .column-name': { |
| | | }, |
| | | '& .opt': { |
| | | width: 180 |
| | | width: 220 |
| | | }, |
| | | '& .wkType': { |
| | | width: 110 |
| | | }, |
| | | '& .status': { |
| | | width: 90 |
| | |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | | <TextInput source="type" label="table.field.asnOrder.type" />, |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{dictTypeCode: 'sys_business_type'}} label="table.field.asnOrder.wkType"> |
| | | <ReferenceInput source="wkType" reference="dictData" filter={{ dictTypeCode: 'sys_business_type' }} label="table.field.asnOrder.wkType"> |
| | | <AutocompleteInput label="table.field.asnOrder.wkType" optionValue="value" /> |
| | | </ReferenceInput>, |
| | | <NumberInput source="anfme" label="table.field.asnOrder.anfme" />, |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [modalType, setmodalType] = useState(0); |
| | | const [select, setSelect] = useState(0); |
| | | |
| | | const billReload = useRef(); |
| | | const location = useLocation(); |
| | | const redirect = useRedirect(); |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | return ( |
| | | <Box display="flex"> |
| | |
| | | sx={{ width: '100%' }} |
| | | preferenceKey='asnOrder' |
| | | bulkActionButtons={<> <InspectionsButton /><BulkDeleteButton mutationMode={OPERATE_MODE} /></>} |
| | | rowClick='edit' |
| | | rowClick={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']} |
| | | > |
| | |
| | | <TextField source="poCode" label="table.field.asnOrder.poCode" /> |
| | | <NumberField source="poId" label="table.field.asnOrder.poId" /> |
| | | <TextField source="type$" label="table.field.asnOrder.type" /> |
| | | <TextField source="wkType$" label="table.field.asnOrder.wkType" /> |
| | | <TextField cellClassName="wkType" source="wkType$" label="table.field.asnOrder.wkType" /> |
| | | <NumberField source="anfme" label="table.field.asnOrder.anfme" /> |
| | | <NumberField source="qty" label="table.field.asnOrder.qty" /> |
| | | <TextField source="logisNo" label="table.field.asnOrder.logisNo" /> |
| | |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.asnOrder.exceStatus" /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt" width={300} > |
| | | <WrapperField cellClassName="opt" label="common.field.opt" > |
| | | <EditButton label="toolbar.detail"></EditButton> |
| | | <MyButton setCreateDialog={setCreateDialog} setmodalType={setmodalType} /> |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | |
| | | |
| | | const OrderEdit = () => { |
| | | const translate = useTranslate(); |
| | | const business = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_business_type')) || []; |
| | | const dicts = JSON.parse(localStorage.getItem('sys_dicts'))?.filter(dict => (dict.dictTypeCode == 'sys_order_type')) || []; |
| | | |
| | | return ( |
| | | <Box> |
| | |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.stock.type" |
| | | <AutocompleteInput |
| | | choices={dicts} |
| | | optionText="label" |
| | | label="table.field.asnOrder.type" |
| | | source="type" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <TextInput |
| | | label="table.field.stock.wkType" |
| | | <AutocompleteInput |
| | | choices={business} |
| | | optionText="label" |
| | | label="table.field.asnOrder.wkType" |
| | | source="wkType" |
| | | optionValue="value" |
| | | parse={v => v} |
| | | validate={required()} |
| | | /> |
| | | <NumberInput |
| | | label="table.field.stock.anfme" |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='stock' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={(id, resource, record) => false} |
| | | rowClick='edit' |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo']} |
| | | > |
| | |
| | | package com.vincent.rsf.server.common.config; |
| | | |
| | | import com.vincent.rsf.server.common.constant.Constants; |
| | | import com.vincent.rsf.server.common.interceptor.DynamicFieldsInterceptor; |
| | | import com.vincent.rsf.server.common.utils.Http; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | registry.addInterceptor(getAsyncHandlerInterceptor()) |
| | | .addPathPatterns("/**") |
| | | .excludePathPatterns("/swagger-resources/**", "/webjars/**","/erp/**", "/v2/**","/v3/**","/doc.html/**", "/swagger-ui.html/**"); |
| | | |
| | | registry.addInterceptor(dynamicFieldsInterceptor()) |
| | | .addPathPatterns("/**") |
| | | .excludePathPatterns("/swagger-resources/**", |
| | | "/webjars/**", |
| | | "/erp/**", |
| | | "/v2/**", |
| | | "/v3/**", |
| | | "/doc.html/**", |
| | | "/swagger-ui.html/**"); |
| | | } |
| | | |
| | | @Bean |
| | | public DynamicFieldsInterceptor dynamicFieldsInterceptor() { |
| | | return new DynamicFieldsInterceptor(); |
| | | } |
| | | |
| | | @Bean |
New file |
| | |
| | | package com.vincent.rsf.server.common.interceptor; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.servlet.HandlerInterceptor; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title DynamicFieldsInterceptor |
| | | * @description |
| | | * @create 2025/4/16 16:10 |
| | | */ |
| | | @Slf4j |
| | | public class DynamicFieldsInterceptor implements HandlerInterceptor { |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | return HandlerInterceptor.super.preHandle(request, response, handler); |
| | | } |
| | | |
| | | @Override |
| | | public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception { |
| | | HandlerInterceptor.super.postHandle(request, response, handler, modelAndView); |
| | | } |
| | | |
| | | @Override |
| | | public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { |
| | | System.out.println(response.getOutputStream().toString()); |
| | | HandlerInterceptor.super.afterCompletion(request, response, handler, ex); |
| | | } |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.BatchUpdateParam; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrder; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.enums.CompanysType; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:list')") |
| | | @ApiOperation("分页获取列表") |
| | |
| | | public R update(@RequestBody AsnOrderItem asnOrderItem) { |
| | | asnOrderItem.setUpdateBy(getLoginUserId()); |
| | | asnOrderItem.setUpdateTime(new Date()); |
| | | if (!Objects.isNull(asnOrderItem.getSplrName()) && StringUtils.isNotBlank(asnOrderItem.getSplrName())) { |
| | | Companys companys = companysService.getOne(new LambdaQueryWrapper<Companys>() |
| | | .eq(Companys::getType, CompanysType.COMPANYS_TYPE_SUPPLIER.val) |
| | | .eq(Companys::getId, asnOrderItem.getSplrName())); |
| | | if (!Objects.isNull(companys)) { |
| | | asnOrderItem.setSplrCode(companys.getCode()).setSplrName(companys.getName()); |
| | | } |
| | | } |
| | | if (!asnOrderItemService.updateById(asnOrderItem)) { |
| | | return R.error("Update Fail"); |
| | | } |
New file |
| | |
| | | package com.vincent.rsf.server.manager.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title CompanysType |
| | | * @description |
| | | * @create 2025/4/16 14:53 |
| | | */ |
| | | public enum CompanysType { |
| | | //质检状态 |
| | | COMPANYS_TYPE_SHIPPER("shipper", "货主"), |
| | | COMPANYS_TYPE_CUSTOMER("customer", "客户"), |
| | | COMPANYS_TYPE_SUPPLIER("supplier", "供应商"), |
| | | |
| | | ; |
| | | CompanysType(String val, String desc) { |
| | | this.val = val; |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String val; |
| | | |
| | | public String desc; |
| | | } |
| | |
| | | if (!this.updateById(waitPakin1)) { |
| | | throw new CoolException("组拖数量修改失败!!"); |
| | | } |
| | | |
| | | //TODO 组拖完成后,扣减收货区库存 |
| | | |
| | | return pakin; |
| | | } |
| | | |