| | |
| | | matnrId: "物料标识", |
| | | maktx: "物料名称", |
| | | matnrCode: "物料编码", |
| | | anfme: "数量", |
| | | anfme: "计划收货数量", |
| | | stockUnit: "库存单位", |
| | | purQty: "计划收货数量", |
| | | purQty: "采购数量", |
| | | purUnit: "采购单位", |
| | | qty: "已完成数量", |
| | | splrBatch: "供应商批次", |
| | |
| | | matnrId: "物料标识", |
| | | matnrCode: "物料编码", |
| | | maktx: "物料", |
| | | anfme: "数量", |
| | | anfme: "计划数量", |
| | | purQty: "采购数量", |
| | | purUnit: "采购单位", |
| | | qty: "已完成数量", |
| | |
| | | mode="onTouched" |
| | | defaultValues={{}} |
| | | > |
| | | <Grid container width={{ xs: '100%', xl: '80%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid container width={{ xs: '100%', xl: '100%' }} rowSpacing={3} columnSpacing={3}> |
| | | <Grid item xs={24} md={12}> |
| | | <Typography variant="h6" gutterBottom> |
| | | {translate('common.edit.title.main')} |
| | |
| | | optionValue="value" |
| | | parse={v => v} |
| | | /> |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <TextInput |
| | | label="table.field.asnOrder.logisNo" |
| | | source="logisNo" |
| | |
| | | <TextInput source="splrCode" label="table.field.asnOrderItem.splrCode" />, |
| | | <TextInput source="splrName" label="table.field.asnOrderItem.splrName" />, |
| | | <TextInput source="qrcode" label="table.field.asnOrderItem.qrcode" />, |
| | | <TextInput source="barcode" label="table.field.asnOrderItem.barcode" />, |
| | | <TextInput source="trackCode" label="table.field.asnOrderItem.barcode" />, |
| | | <TextInput source="packName" label="table.field.asnOrderItem.packName" />, |
| | | |
| | | <TextInput label="common.field.memo" source="memo" />, |
| | |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <Button onClick={creatCode} label={"toolbar.creatcode"}> |
| | | {/* <Button onClick={creatCode} label={"toolbar.creatcode"}> |
| | | <QrCodeIcon /> |
| | | </Button> |
| | | </Button> */} |
| | | <FilterButton /> |
| | | <MyCreateButton onClick={() => { setCreateDialog(true) }} /> |
| | | <SelectColumnsButton preferenceKey='asnOrderItem' /> |
| | |
| | | <TextField source="splrCode" label="table.field.asnOrderItem.splrCode" /> |
| | | <TextField source="splrName" label="table.field.asnOrderItem.splrName" /> |
| | | <TextField source="qrcode" label="table.field.asnOrderItem.qrcode" /> |
| | | <TextField source="barcode" label="table.field.asnOrderItem.barcode" /> |
| | | <TextField source="trackCode" label="table.field.asnOrderItem.barcode" /> |
| | | <TextField source="packName" label="table.field.asnOrderItem.packName" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | |
| | | }, |
| | | { |
| | | field: 'anfme', |
| | | headerName: translate('table.field.asnOrderItem.purQty'), |
| | | headerName: translate('table.field.asnOrderItem.anfme'), |
| | | type: 'number', |
| | | minWidth: 100, |
| | | flex: 1, |
| | |
| | | |
| | | const QlyInspectList = () => { |
| | | const translate = useTranslate(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | |
| | | <StyledDatagrid |
| | | preferenceKey='qlyInspect' |
| | | bulkActionButtons={<BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick='edit' |
| | | rowClick={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'asnId', 'statusBool']} |
| | | > |
| | |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | <WrapperField cellClassName="opt" label="common.field.opt"> |
| | | {/* <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> */} |
| | | <EditButton /> |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | <CloseButton /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <QlyInspectCreate |
| | | {/* <QlyInspectCreate |
| | | open={createDialog} |
| | | setOpen={setCreateDialog} |
| | | /> |
| | | /> */} |
| | | <QlyInspectOpCreate |
| | | open={opCreateDialog} |
| | | setOpen={setOpCreateDialog} |
| | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | const [opCreateDialog, setOpCreateDialog] = useState(false); |
| | | |
| | | return ( |
| | | <> |
| | |
| | | |
| | | |
| | | return ( |
| | | <Button onClick={requestComplete} label={"toolbar.complete"}> |
| | | <Button onClick={requestComplete} label={"toolbar.complete"} mutationMode={OPERATE_MODE}> |
| | | <TaskIcon /> |
| | | </Button> |
| | | ) |
| | |
| | | @ApiModelProperty("图片路径") |
| | | private String picPath; |
| | | @ApiModelProperty("质检结果") |
| | | private String isptResult; |
| | | private Short isptResult; |
| | | @ApiModelProperty("备注") |
| | | private String memo; |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptStatus; |
| | | import com.vincent.rsf.server.manager.mapper.*; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.system.constant.CodeRes; |
| | |
| | | if (Objects.isNull(params.getIsptCode())) { |
| | | throw new CoolException("质检单不能为空"); |
| | | } |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>().eq(QlyInspect::getCode, params.getIsptCode())); |
| | | List<Short> asList = Arrays.asList(QlyIsptStatus.QLY_ISPT_STAS_DONE.val, QlyIsptStatus.QLY_ISPT_STAS_CLOSE.val); |
| | | QlyInspect inspect = qlyInspectMapper.selectOne(new LambdaQueryWrapper<QlyInspect>() |
| | | .notIn(QlyInspect::getIsptStatus, asList) |
| | | .eq(QlyInspect::getCode, params.getIsptCode())); |
| | | if (Objects.isNull(inspect)) { |
| | | throw new CoolException("质检单据不存在!!"); |
| | | } |
| | |
| | | private String asnCode; |
| | | |
| | | @ApiModelProperty("质检状态") |
| | | private String isptStatus; |
| | | private Short isptStatus; |
| | | |
| | | @ApiModelProperty("质检结果") |
| | | private Short isptResult; |
| | |
| | | private String picPath; |
| | | |
| | | @ApiModelProperty("质检结论") |
| | | private String isptResult; |
| | | private Short isptResult; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 冻结 |
New file |
| | |
| | | package com.vincent.rsf.server.manager.enums; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @version 1.0 |
| | | * @title QlyIsptResult |
| | | * @description |
| | | * @create 2025/4/14 09:42 |
| | | */ |
| | | public enum QlyIsptResult { |
| | | //质检结果 |
| | | QLY_ISPT_RESULT_EXCELLENT("1", "合格"), |
| | | QLY_ISPT_RESULT_DEFECT("2", "不合格"), |
| | | QLY_ISPT_RESULT_PENDING("3", "待定"), |
| | | QLY_ISPT_RESULT_SECTION("4", "部分合格"), |
| | | QLY_ISPT_RESULT_HOLD("0", "其它") |
| | | ; |
| | | |
| | | QlyIsptResult(String val, String desc) { |
| | | this.val = Short.parseShort(val); |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public Short val; |
| | | public String desc; |
| | | } |
| | |
| | | ; |
| | | |
| | | QlyIsptStatus(String val, String desc) { |
| | | this.val = val; |
| | | this.val = Short.parseShort(val); |
| | | this.desc = desc; |
| | | } |
| | | |
| | | public String val; |
| | | public Short val; |
| | | public String desc; |
| | | } |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.IsptItemsParams; |
| | | import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyInspect; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptResult; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptStatus; |
| | | import com.vincent.rsf.server.manager.mapper.QlyIsptItemMapper; |
| | | import com.vincent.rsf.server.manager.entity.QlyIsptItem; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectService; |
| | |
| | | } |
| | | List<QlyIsptItem> isptItem = params.getIsptItem(); |
| | | List<Long> list = isptItem.stream().map(QlyIsptItem::getId).collect(Collectors.toList()); |
| | | if (params.getType().equals("2") || params.getType().equals("1")) { |
| | | if (Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val || Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_DEFECT.val) { |
| | | //1:合格, 2:不合格, 0: 其它(默认) |
| | | isptItem.forEach(item -> { |
| | | if (params.getType().equals("1")) { |
| | | if (Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) { |
| | | //TODO 先捡后收为送货数量,先收后捡为收货数量 |
| | | item.setSafeQty(item.getDlyQty()); |
| | | item.setDisQty(0.0); |
| | |
| | | } |
| | | if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>() |
| | | .set(QlyIsptItem::getSafeQty, item.getSafeQty()) |
| | | .set(QlyIsptItem::getIsptResult, params.getType()) |
| | | .set(QlyIsptItem::getIsptResult, Short.parseShort(params.getType())) |
| | | .set(QlyIsptItem::getDisQty, item.getDisQty()) |
| | | .in(QlyIsptItem::getId, item.getId()))) { |
| | | throw new CoolException("修改失败!!"); |
| | |
| | | throw new CoolException("明细修改失败"); |
| | | } |
| | | } |
| | | |
| | | List<QlyIsptItem> isptItems = this.list(new LambdaQueryWrapper<QlyIsptItem>().in(QlyIsptItem::getId, list)); |
| | | if (isptItems.isEmpty()) { |
| | | throw new CoolException("数据错误:明细不存在!!"); |
| | |
| | | QlyInspect inspect = qlyInspectService.getById(key); |
| | | List<QlyIsptItem> items = listMap.get(key); |
| | | Double safeQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).sum(); |
| | | Double dlyQty = items.stream().mapToDouble(QlyIsptItem::getDlyQty).sum(); |
| | | Double disQty = items.stream().mapToDouble(QlyIsptItem::getDisQty).sum(); |
| | | Double qlyQty = safeQty + disQty; |
| | | //安全数量,质检数量 |
| | | inspect.setSafeQty(safeQty) |
| | | .setIsptQty(qlyQty); |
| | | if (Double.compare(disQty, 0) > 0) { |
| | | inspect.setIsptResult(Short.parseShort("4")); |
| | | inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | } |
| | | if (Double.compare(safeQty, dlyQty) == 0) { |
| | | inspect.setIsptStatus("1"); |
| | | inspect.setIsptResult(Short.parseShort("1")); |
| | | if (Double.compare(safeQty, inspect.getDlyQty()) == 0) { |
| | | inspect.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val); |
| | | } |
| | | if (!qlyInspectService.updateById(inspect)) { |
| | | throw new CoolException("质检数量修改失败!!"); |