| | |
| | | orderPrint: 'Orders Print', |
| | | quality: "quality", |
| | | complete: "complete", |
| | | verifyComfirm: 'Verify Comfirm', |
| | | close: "close", |
| | | asnCreate: "Create By Order", |
| | | poCreate: "Create By PO", |
| | |
| | | batchWarehouseAreas: "批量库区", |
| | | batchLocType: "批量库位类型", |
| | | batchPrint: "批量打印", |
| | | verifyComfirm: '审核确认', |
| | | quality: "质检", |
| | | complete: "完结", |
| | | close: "关闭", |
| | |
| | | component="div" |
| | | disablePadding |
| | | sx={{ |
| | | '& .MuiTypography-root': { |
| | | visibility: 'hidden' |
| | | }, |
| | | |
| | | '& .MuiMenuItem-root': { |
| | | transition: |
| | | 'padding-left 195ms cubic-bezier(0.4, 0, 0.6, 1) 0ms', |
| | |
| | | <InspectionsButton /> |
| | | <MyExportButton /> |
| | | {/* <BtnBulkExport></BtnBulkExport> */} |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} |
| | | /> |
| | | </>} |
| | | rowClick={false} |
| | | expandSingle={true} |
| | |
| | | <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="arrTime" label="table.field.asnOrder.arrTime" showTime /> |
| | | <TextField source="rleStatus$" label="table.field.asnOrder.rleStatus" sortable={false} /> |
| | | <TextField source="ntyStatus$" label="table.field.asnOrder.ntyStatus" /> |
| | | {/* <TextField source="ntyStatus$" label="table.field.asnOrder.ntyStatus" /> */} |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | |
| | | import PurchasePanel from "./PurchasePanel"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import BillStatusField from '../../components/BillStatusField'; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import MyField from "../../components/MyField"; |
| | |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <BooleanField source="statusBool" label="common.field.status" sortable={false} /> |
| | | <BillStatusField cellClassName="status" source="exceStatus" label="table.field.asnOrder.exceStatus" /> |
| | | {/* <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"> |
| | | <EditButton sx={{ padding: '1px', fontSize: '.75rem' }} /> |
| | |
| | | import AsnSelModal from "./AsnSelModal"; |
| | | import InspectModal from "./InspectModal"; |
| | | import QlyInspectOpCreate from './QlyInspectOpCreate'; |
| | | import ConfirmButton from "../../components/ConfirmButton"; |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | | '& .css-1vooibu-MuiSvgIcon-root': { |
| | | height: '.9em' |
| | |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.qlyInspect.code" /> |
| | | <TextField source="isptStatus$" label="table.field.qlyInspect.isptStatus" /> |
| | | <TextField source="wkType$" label="table.field.qlyInspect.wkType" /> |
| | | <NumberField source="asnId" label="table.field.qlyInspect.asnId" /> |
| | | <NumberField source="asnCode" label="table.field.qlyInspect.asnCode" /> |
| | | <NumberField source="isptQty" label="table.field.qlyInspect.isptQty" /> |
| | | <TextField source="isptStatus$" label="table.field.qlyInspect.isptStatus" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | | <TextField source="createBy$" label="common.field.createBy" /> |
| | |
| | | <EditButton label="toolbar.detail" /> |
| | | <InspectionButton /> |
| | | <CompleteButton /> |
| | | <CloseButton /> |
| | | {/* <CloseButton /> */} |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const requestComplete = async () => { |
| | | const { data: { code, data, msg } } = await request.post(`/qlyInspect/update`, { ...record, isptStatus: '1' }); |
| | | const { data: { code, data, msg } } = await request.post(`/qlyInspect/verify/complate/` + record?.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh() |
| | |
| | | } |
| | | |
| | | return ( |
| | | record.isptStatus != 1 && record.isptStatus != 3 ? (<Button onClick={requestComplete} label={"toolbar.complete"} mutationMode={OPERATE_MODE}> |
| | | <TaskIcon /> |
| | | </Button>) : (<></>) |
| | | record.isptStatus == 2 ? (<ConfirmButton label={"toolbar.verifyComfirm"} color="secondary" startIcon={<TaskIcon />} onConfirm={requestComplete} />) : (<></>) |
| | | ) |
| | | } |
| | | |
| | |
| | | if (Objects.isNull(ids) || ids.length == 0) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | |
| | | return asnOrderService.removeOrders(Arrays.asList(ids)); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | @ApiOperation("审核确认") |
| | | @PostMapping("/qlyInspect/verify/complate/{id}") |
| | | public R verifyComplate(@PathVariable Long id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | return qlyInspectService.verifyComplate(id); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:update')") |
| | | @OperationLog("Update 质检信息") |
| | | @PostMapping("/qlyInspect/update") |
| | | public R update(@RequestBody QlyInspect qlyInspect) { |
| | |
| | | return dictDatas.getLabel(); |
| | | } |
| | | |
| | | public String getExceStatus$() { |
| | | if (Cools.isEmpty(this.exceStatus)){ |
| | | return ""; |
| | | } |
| | | DictDataService dictDataService = SpringUtils.getBean(DictDataService.class); |
| | | DictData dictData = dictDataService.getOne(new LambdaQueryWrapper<DictData>() |
| | | .eq(DictData::getDictTypeCode, DictTypeCode.SYS_PO_EXCE_STATUS) |
| | | .eq(DictData::getValue, this.exceStatus)); |
| | | if (Objects.isNull(dictData)) { |
| | | return null; |
| | | } |
| | | return dictData.getLabel(); |
| | | } |
| | | |
| | | |
| | | public String getWkType$() { |
| | | if (Cools.isEmpty(this.wkType)) { |
| | | return ""; |
| | |
| | | ASN_EXCE_STATUS_TASK_CLOSE("5", "已关闭"), |
| | | |
| | | //PO单执行状态 |
| | | PO_EXCE_STATUS_UN_EXCE("0", "未执行"), |
| | | PO_EXCE_STATUS_EXCE_ING("1", "执行中"), |
| | | PO_EXCE_STATUS_SECTION_DONE("3", "部分完成"), |
| | | PO_EXCE_STATUS_ALL_DONE("3", "已完成"), |
| | | // PO_EXCE_STATUS_UN_EXCE("0", "未执行"), |
| | | // PO_EXCE_STATUS_EXCE_ING("1", "执行中"), |
| | | // PO_EXCE_STATUS_SECTION_DONE("2", "部分完成"), |
| | | // PO_EXCE_STATUS_ALL_DONE("3", "已完成"), |
| | | |
| | | |
| | | OUT_STOCK_STATUS_TASK_INIT("11", "初始化"), |
| | |
| | | package com.vincent.rsf.server.manager.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface QlyIsptItemMapper extends BaseMapper<QlyIsptItem> { |
| | | |
| | | IPage<QlyIsptItem> pageByWrapper(PageParam<QlyIsptItem, BaseParam> pageParam, @Param(Constants.WRAPPER) QueryWrapper<QlyIsptItem> queryWrapper); |
| | | |
| | | List<QlyIsptItem> selectIsptResult(@Param(Constants.WRAPPER) LambdaQueryWrapper<QlyIsptItem> eq); |
| | | } |
| | |
| | | R saveSelected(IsptOrderParam param, Long loginUserId); |
| | | |
| | | boolean qlySave(QlyInspect qlyInspect); |
| | | |
| | | R verifyComplate(Long id); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.params.IsptItemsParams; |
| | | import com.vincent.rsf.server.manager.entity.QlyIsptItem; |
| | | import com.vincent.rsf.server.manager.entity.WarehouseAreasItem; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface QlyIsptItemService extends IService<QlyIsptItem> { |
| | | |
| | |
| | | IPage<QlyIsptItem> pageByWrapper(PageParam<QlyIsptItem, BaseParam> pageParam, QueryWrapper<QlyIsptItem> queryWrapper); |
| | | |
| | | IPage<QlyIsptItem> pageByIsptResult(PageParam<QlyIsptItem, BaseParam> pageParam, QueryWrapper<QlyIsptItem> queryWrapper); |
| | | |
| | | void confirmReceipt(QlyIsptItem item, WarehouseAreasItem orderItem); |
| | | |
| | | List<QlyIsptItem> selectIsptResult(LambdaQueryWrapper<QlyIsptItem> eq); |
| | | } |
| | | |
| | |
| | | .setMatnrId(matnr.getId()); |
| | | orderItems.add(orderItem); |
| | | |
| | | |
| | | // purchaseItemService.update(new LambdaUpdateWrapper<>().set(PurchaseItem::getAnfme, )); |
| | | |
| | | PurchaseItem purchaseItem = purchaseItemService.getOne(new LambdaQueryWrapper<PurchaseItem>().eq(PurchaseItem::getId, item.getId())); |
| | | if (Objects.isNull(purchaseItem)) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | purchaseItem.setQty(purchaseItem.getQty() + item.getAnfme()); |
| | | if (!purchaseItemService.updateById(purchaseItem)) { |
| | | throw new CoolException("PO单明细修改失败!!"); |
| | | } |
| | | } |
| | | |
| | | double sum = orderItems.stream().mapToDouble(AsnOrderItem::getAnfme).sum(); |
| | |
| | | } |
| | | //任务执行完成,修改已完成数量和PO单执行状态 |
| | | purchase.setQty(sum + purchase.getQty()) |
| | | .setAnfme(purchase.getAnfme() - sum) |
| | | .setExceStatus(POExceStatus.PO_EXCE_STATUS_EXCE_ING.val); |
| | | |
| | | if (!purchaseService.saveOrUpdate(purchase)) { |
| | |
| | | list.forEach(item -> { |
| | | PurchaseItem purchaseItem = purchaseItemService.getById(item.getPoDetlId()); |
| | | if (!Objects.isNull(purchaseItem)) { |
| | | purchaseItem.setQty(purchaseItem.getQty() - item.getAnfme()) |
| | | .setAnfme(purchaseItem.getAnfme() + item.getAnfme()); |
| | | purchaseItem.setQty(purchaseItem.getQty() - item.getAnfme()); |
| | | } |
| | | if (!purchaseItemService.updateById(purchaseItem)) { |
| | | throw new CoolException("PO单明细更新失败!!"); |
| | |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>() |
| | | .eq(Purchase::getCode, list.stream().findFirst().get().getPoCode())); |
| | | purchase.setQty(purchase.getQty() - sum) |
| | | .setExceStatus(POExceStatus.PO_EXCE_STATUS_EXCE_ING.val) |
| | | .setAnfme(purchase.getAnfme() + sum); |
| | | .setExceStatus(POExceStatus.PO_EXCE_STATUS_EXCE_ING.val); |
| | | |
| | | if (!purchaseService.updateById(purchase)) { |
| | | throw new CoolException("PO单据更新失败!!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | if (!asnOrderItemService.remove(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .in(AsnOrderItem::getAsnId, ids))) { |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.controller.params.IsptOrderParam; |
| | |
| | | |
| | | return this.save(qlyInspect); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/5/14 |
| | | * @description: 质检审核确认 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R verifyComplate(Long id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | QlyInspect inspect = this.getById(id); |
| | | if (Objects.isNull(inspect)) { |
| | | throw new CoolException("质检单据不存在!!"); |
| | | } |
| | | inspect.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | if (!this.saveOrUpdate(inspect)) { |
| | | throw new CoolException("单据修改失败!!"); |
| | | } |
| | | List<QlyIsptItem> items = qlyIsptItemService.selectIsptResult(new LambdaQueryWrapper<QlyIsptItem>().eq(QlyIsptItem::getIspectId, inspect.getId())); |
| | | if (items.isEmpty()) { |
| | | throw new CoolException("质检单据明细不存在!!"); |
| | | } |
| | | for (QlyIsptItem isptItem : items) { |
| | | if (isptItem.getSafeQty().compareTo(0.0) <= 0 && isptItem.getDisQty().compareTo(0.0) <= 0 ) { |
| | | continue; |
| | | } |
| | | WarehouseAreasItem item = warehouseAreasItemService.getById(isptItem.getRcptId()); |
| | | if (Objects.isNull(item)) { |
| | | throw new CoolException("库存明细不存在!!"); |
| | | } |
| | | qlyIsptItemService.confirmReceipt(isptItem, item); |
| | | } |
| | | |
| | | return R.ok("审核完成!!"); |
| | | } |
| | | } |
| | |
| | | throw new CoolException("单据明细数量修改失败!!"); |
| | | } |
| | | |
| | | WarehouseAreasItem orderItem = warehouseAreasItemService.getById(item.getRcptId()); |
| | | if (Objects.isNull(orderItem)) { |
| | | throw new CoolException("收货单据不存在!!"); |
| | | } |
| | | // WarehouseAreasItem orderItem = warehouseAreasItemService.getById(item.getRcptId()); |
| | | // if (Objects.isNull(orderItem)) { |
| | | // throw new CoolException("收货单据不存在!!"); |
| | | // } |
| | | |
| | | Double disQty = Objects.isNull(item.getDisQty()) ? 0 : item.getDisQty(); |
| | | Double safeQty = Objects.isNull(item.getSafeQty()) ? 0 : item.getSafeQty(); |
| | | |
| | | Double sum = disQty + safeQty; |
| | | orderItem.setIsptQty(sum); |
| | | |
| | | if (sum.compareTo(0.0) > 0) { |
| | | if (!warehouseAreasItemService.updateById(orderItem)) { |
| | | throw new CoolException("收货区库存信息更新失败!!"); |
| | | } |
| | | |
| | | //新建质检单,质检结果不会有质检结果 |
| | | if (Objects.isNull(orderItem.getIsptResult())) { |
| | | operateReceipt(item, orderItem); |
| | | } |
| | | } |
| | | // Double disQty = Objects.isNull(item.getDisQty()) ? 0 : item.getDisQty(); |
| | | // Double safeQty = Objects.isNull(item.getSafeQty()) ? 0 : item.getSafeQty(); |
| | | // |
| | | // Double sum = disQty + safeQty; |
| | | // orderItem.setIsptQty(sum); |
| | | // |
| | | // if (sum.compareTo(0.0) > 0) { |
| | | // if (!warehouseAreasItemService.updateById(orderItem)) { |
| | | // throw new CoolException("收货区库存信息更新失败!!"); |
| | | // } |
| | | // //新建质检单,不会有质检结果 |
| | | // confirmReceipt(item, orderItem); |
| | | // |
| | | //// if (Objects.isNull(orderItem.getIsptResult())) { |
| | | //// operateReceipt(item, orderItem); |
| | | //// } |
| | | // } |
| | | } |
| | | |
| | | Set<Long> isptIds = isptItem.stream().map(QlyIsptItem::getIspectId).collect(Collectors.toSet()); |
| | |
| | | * @description: 质检后修改收货区存信息 |
| | | * @version 1.0 |
| | | */ |
| | | private void operateReceipt(QlyIsptItem item, WarehouseAreasItem orderItem) { |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void confirmReceipt(QlyIsptItem item, WarehouseAreasItem orderItem) { |
| | | Double disQty = Objects.isNull(item.getDisQty()) ? 0 : item.getDisQty(); |
| | | Double safeQty = Objects.isNull(item.getSafeQty()) ? 0 : item.getSafeQty(); |
| | | Double sum = disQty + safeQty; |
| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<QlyIsptItem> selectIsptResult(LambdaQueryWrapper<QlyIsptItem> eq) { |
| | | return this.baseMapper.selectIsptResult(eq); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/5/12 |
| | |
| | | /**组托执行状态*/ |
| | | public final static String SYS_ORDER_IN_STATUS = "sys_order_in_status"; |
| | | |
| | | /**PO单执行状态*/ |
| | | public final static String SYS_PO_EXCE_STATUS = "sys_po_exce_status"; |
| | | |
| | | } |
| | |
| | | update_time, |
| | | memo |
| | | FROM man_qly_ispt_item qii |
| | | LEFT JOIN man_qly_inspect_result qir ON qii.id = qir.ispt_item_id) t ${ew.customSqlSegment} |
| | | LEFT JOIN man_qly_inspect_result qir ON qii.id = qir.ispt_item_id) t |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | <select id="selectIsptResult" resultType="com.vincent.rsf.server.manager.entity.QlyIsptItem"> |
| | | SELECT * |
| | | FROM (SELECT qii.id, |
| | | ispect_id, |
| | | asn_item_id, |
| | | matnr_code, |
| | | maktx, |
| | | qii.rcpt_id, |
| | | splr_name, |
| | | splr_batch, |
| | | rcpt_qty, |
| | | dly_qty, |
| | | track_code, |
| | | pic_path, |
| | | `status`, |
| | | deleted, |
| | | tenant_id, |
| | | create_by, |
| | | COALESCE((SELECT anfme FROM man_qly_inspect_result WHERE qii.id = ispt_item_id AND ispt_result = 1), 0) AS safe_qty, |
| | | COALESCE((SELECT anfme FROM man_qly_inspect_result WHERE qii.id = ispt_item_id AND ispt_result = 2), 0) AS dis_qty, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | memo |
| | | FROM man_qly_ispt_item qii) t |
| | | ${ew.customSqlSegment} |
| | | |
| | | </select> |
| | | </mapper> |