| | |
| | | import { |
| | | CreateBase, |
| | | useTranslate, |
| | | SearchInput, |
| | | TextInput, |
| | | NumberInput, |
| | | BooleanInput, |
| | |
| | | import request from '@/utils/request'; |
| | | import { Add, Edit, Delete } from '@mui/icons-material'; |
| | | import _ from 'lodash'; |
| | | import { DataGrid } from '@mui/x-data-grid'; |
| | | import StatusSelectInput from "../../components/StatusSelectInput"; |
| | | import TreeSelectInput from "@/page/components/TreeSelectInput"; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | |
| | | }, |
| | | })); |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn /> |
| | | ] |
| | | |
| | | const MatnrModal = ({ open, setOpen }) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [options, setOptions] = useState({ |
| | | condition: null |
| | | }); |
| | | |
| | | const [formData, setFormData] = useState({ |
| | | areaMatId: null, |
| | |
| | | groupId: formData.groupId, |
| | | matnrId: formData.matnrId, |
| | | } |
| | | const res = await request.post(`/locAreaMatRela/matnr/bind`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | handleClose() |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | // const res = await request.post(`/locAreaMatRela/matnr/bind`, parmas); |
| | | // if (res?.data?.code === 200) { |
| | | // handleClose() |
| | | // } else { |
| | | // notify(res.data.msg); |
| | | // } |
| | | } |
| | | |
| | | const [groupId, setGroupId] = useState(); |
| | |
| | | setGroupId(e.target.value) |
| | | } |
| | | |
| | | |
| | | |
| | | return ( |
| | | <Dialog open={open} maxWidth="xl" fullWidth> |
| | | <Dialog open={open} maxWidth="1" fullWidth> |
| | | <Form onSubmit={handleSubmit}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | <DialogTitle>{translate('toolbar.bindmatnr')}</DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, height: 700 }}> |
| | | <Box sx={{ display: 'flex', flexDirection: 'column', gap: 3, height: 900 }}> |
| | | <Grid container spacing={2}> |
| | | <Grid item xs={4}> |
| | | <Grid item xs={3}> |
| | | <ReferenceInput |
| | | source="areaMatId" |
| | | reference="locAreaMat" |
| | |
| | | /> |
| | | </ReferenceInput> |
| | | </Grid> |
| | | <Grid item xs={4}> |
| | | <Grid item xs={3}> |
| | | <TreeSelectInput |
| | | label="table.field.locAreaMatRela.groupId" |
| | | resource={'matnrGroup'} |
| | |
| | | onChange={(e) => handleChange(e.target.value, 'groupId')} |
| | | /> |
| | | </Grid> |
| | | |
| | | </Grid> |
| | | <Grid item xs={4}> |
| | | <List |
| | | resource="matnr" |
| | | filter={{ groupId: formData.groupId }} |
| | | queryOptions={{}} |
| | | // filters={filters} |
| | | empty={false} |
| | | queryOptions={{options}} |
| | | actions={<></>} |
| | | > |
| | | <StyledDatagrid |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='asnOrderItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => { |
| | | setSelect(record) |
| | | setEditDialog(true) |
| | |
| | | <FilterButton /> |
| | | {/* <MyCreateButton onClick={() => { setCreateDialog(true) }} /> */} |
| | | <SelectColumnsButton preferenceKey='waitPakinItem' /> |
| | | <MyExportButton /> |
| | | {/* <MyExportButton /> */} |
| | | </TopToolbar> |
| | | )} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={false} |
| | | rowClick={(id, resource, record) => false} |
| | | omit={['id', 'pakinId', 'createTime', 'createBy', 'memo']} |
| | | > |
| | |
| | | } |
| | | return mobileService.defectProducts(trackCode); |
| | | } |
| | | |
| | | @ApiOperation("获取组拖入库信息") |
| | | @PostMapping("/pakin/info/{barcode}") |
| | | @PreAuthorize("hasAuthority('manager:waitPakin:list')") |
| | | public R getPakinInStock(@PathVariable String barcode) { |
| | | if (Objects.isNull(barcode)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.getPakinInStock(barcode); |
| | | } |
| | | |
| | | @ApiOperation("获取上架站点信息") |
| | | @GetMapping("/inStock/sites") |
| | | @PreAuthorize("hasAuthority('manager:deviceSite:list')") |
| | | public R getTarSite() { |
| | | return mobileService.getDeviceSites(); |
| | | } |
| | | |
| | | @ApiOperation("获取推荐库位列表信息") |
| | | @GetMapping("/locs/list") |
| | | @PreAuthorize("hasAuthority('manager:deviceSite:list')") |
| | | public R getLocs() { |
| | | return mobileService.getRecommondLocs(); |
| | | } |
| | | |
| | | @ApiOperation("生成任务列表") |
| | | @PostMapping("/pakin/task") |
| | | @PreAuthorize("hasAuthority('manager:deviceSite:list')") |
| | | public R pakinToTask(@RequestBody Map<String, Object> map) { |
| | | if (Objects.isNull(map)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.generateTask(map, getLoginUserId()); |
| | | } |
| | | } |
| | | |
| | |
| | | R getItemByContainer(Map<String, Object> params); |
| | | |
| | | R defectProducts(String trackCode); |
| | | |
| | | R getPakinInStock(String barcode); |
| | | |
| | | R getDeviceSites(); |
| | | |
| | | R getRecommondLocs(); |
| | | |
| | | R generateTask(Map<String, Object> map, Long loginUserId); |
| | | } |
| | |
| | | import com.vincent.rsf.server.common.utils.CommonUtil; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | import com.vincent.rsf.server.common.utils.JwtUtil; |
| | | import com.vincent.rsf.server.manager.controller.params.GenerateTaskParams; |
| | | import com.vincent.rsf.server.manager.controller.params.IsptItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.WaitPakinParam; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | |
| | | private LocAreaRelaMapper locAreaRelaMapper; |
| | | @Autowired |
| | | private LocAreaMapper locAreaMapper; |
| | | @Autowired |
| | | private DeviceSiteMapper deviceSiteMapper; |
| | | |
| | | /** |
| | | * @author Ryan |
| | |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 获取入库组拖信息 |
| | | * @param barcode |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getPakinInStock(String barcode) { |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, barcode)); |
| | | if (Objects.isNull(waitPakin)) { |
| | | throw new CoolException("组拖单据不存在!!"); |
| | | } |
| | | List<WaitPakinItem> pakinItems = waitPakinItemService.list(new LambdaQueryWrapper<WaitPakinItem>().eq(WaitPakinItem::getPakinId, waitPakin.getId())); |
| | | if (pakinItems.isEmpty()) { |
| | | return R.ok(new ArrayList<>()); |
| | | } |
| | | return R.ok(pakinItems); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 获取库口站点信息 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getDeviceSites() { |
| | | return R.ok(deviceSiteMapper.selectList(new LambdaQueryWrapper<DeviceSite>().eq(DeviceSite::getStatus, 1).groupBy(DeviceSite::getSite))); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 获取推荐库位 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getRecommondLocs() { |
| | | return R.ok(locService.list(new LambdaQueryWrapper<Loc>().last("limit 10"))); |
| | | } |
| | | |
| | | /** |
| | | * @param map |
| | | * @param loginUserId |
| | | * @return |
| | | * @author Ryan |
| | | * @description 生成任务列表 |
| | | */ |
| | | @Override |
| | | public R generateTask(Map<String, Object> map, Long loginUserId) { |
| | | String barcode = map.get("barcode").toString(); |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, barcode)); |
| | | if (waitPakins.isEmpty()) { |
| | | throw new CoolException("单据不存在 !!"); |
| | | } |
| | | GenerateTaskParams taskParams = new GenerateTaskParams(); |
| | | taskParams.setWaitPakins(waitPakins) |
| | | .setSiteId(Long.parseLong(map.get("site").toString())) |
| | | .setLocCode(map.get("locCode").toString()); |
| | | return R.ok(taskService.generateTasks(taskParams, loginUserId)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取ReceiptDetlsDtos |
| | | */ |
| | | private R getAsnOrderItem(List<AsnOrderItem> items) { |
| | |
| | | |
| | | @ApiModelProperty("站点ID") |
| | | public Long siteId; |
| | | |
| | | @ApiModelProperty("库位编码") |
| | | public String locCode; |
| | | } |
| | |
| | | .setBarcode(pakin.getBarcode()) |
| | | .setTargSite(deviceSite.getDeviceCode()) |
| | | .setCreateBy(loginUserId) |
| | | .setUpdateBy(loginUserId) |
| | | .setTargSite(LocManageUtil.getTargetSite()); |
| | | .setUpdateBy(loginUserId); |
| | | |
| | | if (!Objects.isNull(waitPakin.getSiteId()) && waitPakin.getSiteId() > 0) { |
| | | DeviceSite site = deviceSiteService.getById(waitPakin.getSiteId()); |
| | | task.setTargSite(site.getSite() + ""); |
| | | } else { |
| | | task.setTargSite(LocManageUtil.getTargetSite()); |
| | | } |
| | | if (!Objects.isNull(waitPakin.getLocCode()) && StringUtils.isNotBlank(waitPakin.getLocCode())) { |
| | | List<Loc> locs = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, waitPakin.getLocCode())); |
| | | // if (!locs.isEmpty()) { |
| | | // throw new CoolException("库位错误:相同库位应只一条") |
| | | // } |
| | | Loc loc = locs.stream().findFirst().get(); |
| | | task.setTargSite(loc.getCode()); |
| | | } else { |
| | | task.setTargSite(LocManageUtil.getTargetSite()); |
| | | } |
| | | |
| | | if (!this.save(task)) { |
| | | throw new CoolException("任务保存失败!!"); |
| | | } |
| | |
| | | BeanUtils.copyProperties(item, taskItem); |
| | | AsnOrder order = asnOrderService.getOne(new LambdaQueryWrapper<AsnOrder>().eq(AsnOrder::getId, item.getAsnId())); |
| | | if (Objects.isNull(order)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | throw new CoolException("数据错误: 单据不存在!!"); |
| | | } |
| | | taskItem.setTaskId(task.getId()) |
| | | .setOrderType(OrderType.ORDER_RECEIPT.type) |
| | |
| | | matching-strategy: ANT_PATH_MATCHER |
| | | datasource: |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | # url: jdbc:mysql://192.168.0.116:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # url: jdbc:mysql://47.76.147.249:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | url: jdbc:mysql://127.0.0.1:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: rsf |