| | |
| | | orderPrint: 'Orders Print', |
| | | quality: "quality", |
| | | complete: "complete", |
| | | verifyComfirm: 'Verify Comfirm', |
| | | close: "close", |
| | | asnCreate: "Create By Order", |
| | | poCreate: "Create By PO", |
| | |
| | | warehouse: '仓库', |
| | | warehouseAreas: '库区', |
| | | loc: '库位', |
| | | locType: '库位类型', |
| | | locArea: '逻辑分区', |
| | | locAreaMat: '逻辑分区', |
| | | locType: '库位类型(废)', |
| | | locArea: '逻辑分区(废)', |
| | | locAreaMat: '逻辑分区(废)', |
| | | locAreaMatRela: '库区物料关系', |
| | | container: '容器管理', |
| | | contract: '合同信息', |
| | | container: '容器管理(废)', |
| | | contract: '合同信息(废)', |
| | | qlyInspect: '质检信息', |
| | | qlyIsptItem: '质检信息明细', |
| | | dictType: '数据字典', |
| | |
| | | }, |
| | | deviceSite: { |
| | | type: "入出库类型", |
| | | site: "作业站点", |
| | | site: "入库口", |
| | | name: "名称", |
| | | target: "目标站点", |
| | | label: "站点标签", |
| | | device: "立库类型", |
| | | deviceCode: "设备编号", |
| | | deviceCode: "接驳位", |
| | | deviceSite: "设备站点", |
| | | flagInit: "是否初始化", |
| | | wcsCode: "wcs编号", |
| | |
| | | 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', |
| | |
| | | <PrintButton /> |
| | | </WrapperField> |
| | | setColumns([...arr, ...fields, opt]); |
| | | //filters添加过滤字段 |
| | | data.map(el => { |
| | | var i =0; |
| | | filters.map((item) =>{ |
| | | if(item.key === el.fields){ |
| | | i = 1; |
| | | } |
| | | }) |
| | | i===0 && filters.push(<TextInput key={el.fields} source={el.fields} label={el.fieldsAlise} />) |
| | | }) |
| | | } else { |
| | | notify(msg); |
| | | } |
| | |
| | | import { usePapaParse } from './usePapaParse'; |
| | | import MatnrList from '../basicInfo/matnr/MatnrList'; |
| | | import request from '@/utils/request' |
| | | |
| | | import ImportExportOutlinedIcon from '@mui/icons-material/ImportExportOutlined'; |
| | | const ImportModal = ({ open, onClose, importTemp, useCodeImport, onceBatch = 10, value, parmas = {}}) => { |
| | | const refresh = useRefresh(); |
| | | const translate = useTranslate(); |
| | |
| | | <Toolbar |
| | | sx={{ |
| | | width: '100%', |
| | | justifyContent: 'end' |
| | | }} |
| | | > |
| | | {importer.state === 'idle' ? ( |
| | |
| | | <Button |
| | | label="common.action.import.title" |
| | | variant="contained" |
| | | startIcon={<ImportExportOutlinedIcon />} |
| | | size='medium' |
| | | onClick={startImport} |
| | | disabled={!file} |
| | | /> |
| | |
| | | marginRight: drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.waitPakinItemLog"} |
| | | empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={false} |
| | | filters={filters} |
| | | filter={{ logId: recordId }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='waitPakinItemLog' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | bulkActionButtons={false} |
| | | rowClick={ false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'pakinId', 'pakinItemId', 'asnId' ,'asnItemId', 'createBy$', 'fieldsIndex']} |
| | | > |
| | |
| | | <DateField source="createTime" label="common.field.createTime" showTime /> |
| | | <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' }} /> */} |
| | | <DeleteButton sx={{ padding: '1px', fontSize: '.75rem' }} mutationMode={OPERATE_MODE} /> |
| | | </WrapperField> |
| | | </StyledDatagrid> |
| | | </List> |
| | | <PageDrawer |
| | |
| | | <InspectionsButton /> |
| | | <MyExportButton /> |
| | | {/* <BtnBulkExport></BtnBulkExport> */} |
| | | <BulkDeleteButton mutationMode={OPERATE_MODE} |
| | | /> |
| | | </>} |
| | | rowClick={false} |
| | | expandSingle={true} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'poId', 'rleStatus$']} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'logisNo', 'poId', 'rleStatus$']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <TextField source="code" label="table.field.asnOrder.code" /> |
| | |
| | | <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="logisNo" label="table.field.asnOrder.logisNo" /> |
| | | {/* <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" /> |
| | |
| | | ), |
| | | headerClassName: "custom", |
| | | }, |
| | | // { |
| | | // field: 'packName', |
| | | // headerName: translate('table.field.asnOrderItem.packName'), |
| | | // minWidth: 100, |
| | | // flex: 1, |
| | | // editable: true, |
| | | // }, |
| | | |
| | | { |
| | | field: 'platItemId', |
| | | headerName: translate('table.field.asnOrderItem.platItemId') + "*", |
| | |
| | | editable: true, |
| | | headerClassName: "custom", |
| | | }, |
| | | { |
| | | field: 'splrBatch', |
| | | headerName: translate('table.field.asnOrderItem.splrBatch'), |
| | | minWidth: 100, |
| | | flex: 1, |
| | | editable: true, |
| | | headerClassName: "custom", |
| | | |
| | | }, |
| | | |
| | | // { |
| | | // field: 'poCode', |
| | |
| | | const handleSubmit = async () => { |
| | | setFinally() |
| | | setDisabled(true) |
| | | setOpen(false) |
| | | const parmas = { |
| | | "purchaseId": record, |
| | | "items": tabelData, |
| | | } |
| | | console.log('--------->'); |
| | | console.log(parmas); |
| | | // const res = await request.post(`/asnOrder/purchases/save`, parmas); |
| | | // if (res?.data?.code === 200) { |
| | | // setOpen(false); |
| | | // refresh(); |
| | | // resetData() |
| | | // } else { |
| | | // notify(res.data.msg); |
| | | // } |
| | | const res = await request.post(`/asnOrder/purchases/save`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | notify(res.data.msg); |
| | | } else { |
| | | notify(res.data.msg); |
| | | } |
| | | setOpen(false); |
| | | refresh(); |
| | | resetData() |
| | | setDisabled(false) |
| | | }; |
| | | |
| | |
| | | </Box> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'space-between' }} > |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > |
| | | <Button disabled={disabled} onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | |
| | | headerClassName: "custom", |
| | | }, |
| | | { |
| | | field: 'qty', |
| | | headerName: translate('table.field.asnOrderItem.qty') + "*", |
| | | type: 'number', |
| | | minWidth: 100, |
| | | flex: 1, |
| | | valueFormatter: (val) => val < 0 ? 0 : val, |
| | | }, |
| | | { |
| | | field: 'unit', |
| | | headerName: translate('table.field.asnOrderItem.stockUnit'), |
| | | minWidth: 100, |
| | |
| | | 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} />) : (<></>) |
| | | ) |
| | | } |
| | | |
| | |
| | | import com.vincent.rsf.server.api.service.WcsService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @Autowired |
| | | private WcsService wcsService; |
| | | |
| | | // @ApiOperation(value = "wcs生成入库任务接口") |
| | | @ApiOperation(value = "wcs生成入库任务接口") |
| | | @PostMapping("/create/in/task") |
| | | public R createInTask(@RequestBody TaskInParam param) { |
| | | if (Cools.isEmpty(param.getIoType())) { |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation(value = "agv取货完成接口") |
| | | @PostMapping("/agv/pickUp/complete") |
| | | public R AgvTaskPickUpComplete(@RequestBody TaskInParam param) { |
| | | if (Cools.isEmpty(param.getIoType())) { |
| | | return R.error("入出库类型不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getSourceStaNo())) { |
| | | return R.error("源站编号不能为空"); |
| | | } |
| | | if (Cools.isEmpty(param.getBarcode())) { |
| | | return R.error("条码不能为空"); |
| | | } |
| | | if (param.getIoType().equals(TaskType.TASK_TYPE_AGV_IN.type)) { |
| | | return R.error("入库类型有误"); |
| | | } |
| | | wcsService.agvTaskPickUpComplete(param); |
| | | |
| | | return R.ok(); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | public interface WcsService { |
| | | InTaskMsgDto createInTask(TaskInParam param, Long loginUserId); |
| | | |
| | | void agvTaskPickUpComplete(TaskInParam param); |
| | | } |
| | |
| | | import com.vincent.rsf.server.api.entity.dto.InTaskMsgDto; |
| | | import com.vincent.rsf.server.api.entity.dto.LocTypeDto; |
| | | import com.vincent.rsf.server.api.controller.params.TaskInParam; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.enums.TaskStsType; |
| | | import com.vincent.rsf.server.manager.enums.TaskType; |
| | | import com.vincent.rsf.server.manager.enums.*; |
| | | import com.vincent.rsf.server.api.service.WcsService; |
| | | import com.vincent.rsf.server.api.utils.LocUtils; |
| | | import com.vincent.rsf.server.api.utils.SlaveProperties; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.PakinIOStatus; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | | import com.vincent.rsf.server.manager.service.impl.LocServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | |
| | | private TaskItemService taskItemService; |
| | | @Autowired |
| | | private WaitPakinItemService waitPakinItemService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void agvTaskPickUpComplete(TaskInParam param) { |
| | | Task task = taskService.getOne(new LambdaQueryWrapper<Task>() |
| | | .eq(Task::getBarcode, param.getBarcode()) |
| | | ); |
| | | if (null == task) { |
| | | throw new CoolException("未找到任务信息"); |
| | | } |
| | | // if (!task.getTaskStatus().equals(TaskStsType.WCS_CONVEYOR_START.id)){ |
| | | // throw new CoolException("任务状态有误"); |
| | | // } |
| | | BasStation basStation = basStationService.getOne(new LambdaQueryWrapper<BasStation>() |
| | | .eq(BasStation::getStationName, param.getSourceStaNo()) |
| | | ); |
| | | if (null == basStation) { |
| | | throw new CoolException("未找到站点信息"); |
| | | } |
| | | task.setTaskStatus(TaskStsType.WCS_EXECUTE_OUT_TOTE_LOAD.id); |
| | | taskService.updateById(task); |
| | | |
| | | basStation.setUseStatus(StaUseStatusType.TYPE_O.type); |
| | | basStation.setBarcode(null); |
| | | basStationService.updateById(basStation); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | return locNo; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 验证设备站点 |
| | | */ |
| | |
| | | package com.vincent.rsf.server.common.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.vincent.rsf.common.utils.Utils; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.server.system.entity.Fields; |
| | | import com.vincent.rsf.server.system.service.FieldsService; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private Map<String, Object> map; |
| | | |
| | | @TableField(exist = false) |
| | | private Map<String, Object> fields = new HashMap<>(); |
| | | |
| | | public void syncMap(Map<String, Object> map) { |
| | | if (null == map) { |
| | |
| | | this.setCondition(String.valueOf(map.get("condition"))); |
| | | map.remove("condition"); |
| | | } |
| | | |
| | | FieldsService fieldsService = SpringUtils.getBean(FieldsService.class); |
| | | List<Fields> fields = fieldsService.list(new LambdaQueryWrapper<Fields>().eq(Fields::getFlagEnable, 1).eq(Fields::getStatus, 1)); |
| | | if (!fields.isEmpty()) { |
| | | for (Fields fields1 : fields) { |
| | | if (null !=map.get(fields1.getFields())){ |
| | | this.fields.put(fields1.getFields(), map.get(fields1.getFields())); |
| | | map.entrySet().removeIf(next -> next.getKey().equals(fields1.getFields()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | this.setMap(map); |
| | | } |
| | | |
| | |
| | | import com.vincent.rsf.common.utils.Utils; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.DateUtils; |
| | | import lombok.Getter; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Modifier; |
| | |
| | | private static final long serialVersionUID = 1L; |
| | | public static final String ORDER_DESC_VALUE = "desc"; |
| | | |
| | | @Getter |
| | | private final U where; |
| | | |
| | | /** |
| | |
| | | package com.vincent.rsf.server.common.utils; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.TableInfo; |
| | | import com.baomidou.mybatisplus.core.metadata.TableInfoHelper; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.SpringUtils; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.system.entity.Fields; |
| | | import com.vincent.rsf.server.system.entity.FieldsItem; |
| | | import com.vincent.rsf.server.system.service.FieldsItemService; |
| | |
| | | saveFields(params, params.get("index").toString()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public static <T> QueryWrapper<T> setFieldsFilters(QueryWrapper<T> queryWrapper, PageParam<T, BaseParam> pageParam, Class<T> entityClass) { |
| | | // 动态获取表名 |
| | | TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass); |
| | | String tableName = tableInfo.getTableName(); |
| | | |
| | | FieldsService fieldsService = SpringUtils.getBean(FieldsService.class); |
| | | Map<String, Object> map = pageParam.getWhere().getFields(); |
| | | |
| | | for (String key : map.keySet()) { |
| | | Object val = map.get(key); |
| | | Fields fields = fieldsService.getOne(new LambdaQueryWrapper<Fields>().eq(Fields::getFields, key)); |
| | | if (!Cools.isEmpty(fields)) { |
| | | String applySql = String.format( |
| | | "EXISTS (SELECT 1 FROM sys_fields_item fie " + |
| | | "WHERE %s.fields_index IS NOT NULL " + |
| | | "AND fie.uuid = %s.fields_index " + |
| | | "AND fie.fields_id = '%s' " + |
| | | "AND fie.value = '%s')", |
| | | tableName, tableName, fields.getId(), val |
| | | ); |
| | | queryWrapper.apply(applySql); |
| | | } |
| | | } |
| | | return queryWrapper; |
| | | } |
| | | } |
| | |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.manager.entity.Purchase; |
| | | import com.vincent.rsf.server.manager.entity.PurchaseItem; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.enums.OrderWorkType; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.enums.AsnExceStatus; |
| | | import com.vincent.rsf.server.manager.enums.POExceStatus; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.AsnOrderService; |
| | | import com.vincent.rsf.server.manager.service.impl.PurchaseItemServiceImpl; |
| | | import com.vincent.rsf.server.manager.service.impl.PurchaseServiceImpl; |
| | | import com.vincent.rsf.server.system.constant.SerialRuleCode; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @Api(tags = "ASN入库通知单") |
| | |
| | | private AsnOrderService asnOrderService; |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | @Autowired |
| | | private PurchaseServiceImpl purchaseService; |
| | | @Autowired |
| | | private PurchaseItemServiceImpl purchaseItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | | @PostMapping("/asnOrder/page") |
| | |
| | | @PostMapping("/asnOrder/remove/{ids}") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!asnOrderService.remove(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, Arrays.asList(ids)).eq(AsnOrder::getExceStatus, AsnExceStatus.ASN_EXCE_STATUS_UN_EXCE.val))) { |
| | | return R.error("任务中单据不可删除!!"); |
| | | if (Objects.isNull(ids) || ids.length == 0) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | for (Long id : ids) { |
| | | List<AsnOrderItem> list = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().eq(AsnOrderItem::getAsnId, id)); |
| | | if (!list.isEmpty()) { |
| | | if (!asnOrderItemService.remove(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getAsnId, ids))) { |
| | | throw new CoolException("Details Delete Fail"); |
| | | } |
| | | } |
| | | } |
| | | return R.ok("删除成功!!").add(ids); |
| | | return asnOrderService.removeOrders(Arrays.asList(ids)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:list')") |
| | |
| | | @ApiOperation("根据PO单新建收货单") |
| | | @PreAuthorize("hasAuthority('manager:asnOrder:save')") |
| | | public R orderCreateByPo(@RequestBody Map<String, Object> params) { |
| | | if (Objects.isNull(params.get("ids"))) { |
| | | return R.error("参数不能为空!!"); |
| | | if (Objects.isNull(params.get("purchaseId"))) { |
| | | return R.error("PO主单ID不能为空!!"); |
| | | } |
| | | String json = params.get("ids").toString(); |
| | | List<Long> ids = JSONArray.parseArray(params.get("ids").toString(), Long.class); |
| | | if (ids.isEmpty()) { |
| | | return R.error("参数不能为空"); |
| | | if (Objects.isNull(params.get("items"))) { |
| | | return R.error("明细单据不能为空!!"); |
| | | } |
| | | return asnOrderService.createByPo(ids); |
| | | // List<Long> ids = JSONArray.parseArray(params.get("ids").toString(), Long.class); |
| | | // if (ids.isEmpty()) { |
| | | // return R.error("参数不能为空"); |
| | | // } |
| | | |
| | | return asnOrderService.createByPo(params); |
| | | } |
| | | |
| | | |
| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Purchase, BaseParam> pageParam = new PageParam<>(baseParam, Purchase.class); |
| | | QueryWrapper<Purchase> wrapper = pageParam.buildWrapper(true); |
| | | wrapper.apply("anfme > qty"); |
| | | wrapper.ne("exce_status", POExceStatus.PO_EXCE_STATUS_ALL_DONE.val); |
| | | return R.ok().add(purchaseService.page(pageParam, wrapper)); |
| | | } |
| | |
| | | } |
| | | |
| | | @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 closeOrder(Long id); |
| | | |
| | | R createByPo(List<Long> ids); |
| | | R createByPo(Map<String, Object> params); |
| | | |
| | | R removeOrders(List<Long> list); |
| | | } |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | .setMemo(template.getMemo()) |
| | | .setArrTime(date) |
| | | .setUpdateBy(loginUserId) |
| | | .setLogisNo(template.getLogicNo()) |
| | | .setCreateBy(loginUserId) |
| | | .setType(OrderType.getTypeVal(template.getType())) |
| | | .setWkType(OrderWorkType.getWorkType(template.getWkType())); |
| | |
| | | package com.vincent.rsf.server.manager.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.vincent.rsf.framework.common.R; |
| | |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | public R createByPo(List<Long> ids) { |
| | | //获取未生成ASN单据 |
| | | List<Purchase> purchases = purchaseService.list(new LambdaQueryWrapper<Purchase>().in(Purchase::getId, ids)); |
| | | //生成ASN单据 |
| | | purchases.forEach(purchase -> { |
| | | if (!Objects.isNull(purchase.getStartTime())) { |
| | | //判断起始时间是否大于当前时间 |
| | | if (DateUtils.compareDate(new Date(), purchase.getStartTime())) { |
| | | return; |
| | | } |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R createByPo(Map<String, Object> params) { |
| | | Long purchaseId = Long.parseLong(params.get("purchaseId").toString()); |
| | | List<PurchaseItem> itemList = JSONArray.parseArray(JSONObject.toJSONString(params.get("items")), PurchaseItem.class); |
| | | if (itemList.isEmpty()) { |
| | | throw new CoolException("PO单明细不能为空!!"); |
| | | } |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getId, purchaseId)); |
| | | if (Objects.isNull(purchase)) { |
| | | throw new CoolException("PO单据不存在!!"); |
| | | } |
| | | AsnOrder order = new AsnOrder(); |
| | | //根据编码规则生成ASN单号 |
| | | String code = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_ASN_ORDER, purchase); |
| | | order.setCode(code) |
| | | .setArrTime(purchase.getPreArr()) |
| | | .setType(purchase.getType()) |
| | | .setWkType(purchase.getWkType()) |
| | | .setPoId(purchase.getId()) |
| | | .setPoCode(purchase.getCode()); |
| | | if (!this.save(order)) { |
| | | throw new CoolException("ASN单据保存失败!!"); |
| | | } |
| | | List<AsnOrderItem> orderItems = new ArrayList<>(); |
| | | for (PurchaseItem item : itemList) { |
| | | AsnOrderItem orderItem = new AsnOrderItem(); |
| | | Matnr matnr = matnrService.getOne(new LambdaQueryWrapper<Matnr>().eq(Matnr::getCode, item.getMatnrCode())); |
| | | if (Objects.isNull(matnr)) { |
| | | throw new CoolException("数据错误:当前物料不存在!!"); |
| | | } |
| | | List<PurchaseItem> items = purchaseItemService.list(new LambdaQueryWrapper<PurchaseItem>().eq(PurchaseItem::getPurchaseId, purchase.getId())); |
| | | if (items.isEmpty()) { |
| | | throw new CoolException("子列表数据为空,请查询PO单是否正确录入!!"); |
| | | String trackCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_LABEL_CODE, item); |
| | | if (StringUtils.isBlank(trackCode)) { |
| | | throw new CoolException("单据跟踪码生成失败:请检查「sys_asn_mantr_label」是否配置完成!!"); |
| | | } |
| | | AsnOrder order = new AsnOrder(); |
| | | //根据编码规则生成ASN单号 |
| | | String code = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_ASN_ORDER, purchase); |
| | | order.setAnfme(purchase.getAnfme()) |
| | | .setCode(code) |
| | | .setArrTime(purchase.getPreArr()) |
| | | .setQty(purchase.getQty()) |
| | | .setPoId(purchase.getId()) |
| | | .setPoCode(purchase.getCode()); |
| | | if (!this.save(order)) { |
| | | throw new CoolException("ASN单据保存失败!!"); |
| | | |
| | | PurchaseItem service = purchaseItemService.getById(item.getId()); |
| | | Double qty = service.getQty() + item.getAnfme(); |
| | | if (qty.compareTo(service.getAnfme()) > 0) { |
| | | throw new CoolException("新建单据数量不能大于计划数量!!"); |
| | | } |
| | | List<AsnOrderItem> orderItems = new ArrayList<>(); |
| | | items.forEach(item -> { |
| | | AsnOrderItem orderItem = new AsnOrderItem(); |
| | | Matnr matnr = matnrService.getOne(new LambdaQueryWrapper<Matnr>().eq(Matnr::getCode, item.getMatnrCode())); |
| | | if (Objects.isNull(matnr)) { |
| | | throw new CoolException("数据错误:当前物料不存在!!"); |
| | | orderItem.setAnfme(item.getAnfme()) |
| | | .setAsnId(order.getId()) |
| | | .setSplrName(item.getSplrName()) |
| | | .setAsnCode(code) |
| | | .setSplrBatch(item.getSplrBatch()) |
| | | .setSplrCode(item.getSplrCode()) |
| | | .setPoDetlId(item.getId()) |
| | | .setPlatItemId(item.getPlatItemId()) |
| | | .setTrackCode(trackCode) |
| | | .setPoCode(purchase.getCode()) |
| | | .setPurQty(item.getAnfme()) |
| | | .setStockUnit(item.getUnit()) |
| | | .setPurUnit(item.getUnit()) |
| | | .setMatnrCode(matnr.getCode()) |
| | | .setMaktx(matnr.getName()) |
| | | .setMatnrId(matnr.getId()); |
| | | orderItems.add(orderItem); |
| | | |
| | | 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(); |
| | | |
| | | if (!asnOrderItemService.saveBatch(orderItems)) { |
| | | throw new CoolException(("Asn单据明细保存失败!!")); |
| | | } |
| | | //任务执行完成,修改已完成数量和PO单执行状态 |
| | | purchase.setQty(sum + purchase.getQty()) |
| | | .setExceStatus(POExceStatus.PO_EXCE_STATUS_EXCE_ING.val); |
| | | |
| | | if (!purchaseService.saveOrUpdate(purchase)) { |
| | | throw new CoolException("PO单执行完成后,保存失败!!"); |
| | | } |
| | | order.setAnfme(sum); |
| | | if (!this.updateById(order)) { |
| | | throw new CoolException("单据更新失败!!"); |
| | | } |
| | | |
| | | return R.ok("操作成功!!"); |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @date 2025/5/14 |
| | | * @description: 移除收货单 |
| | | * @version 1.0 |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R removeOrders(List<Long> ids) { |
| | | for (Long id : ids) { |
| | | List<AsnOrderItem> list = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .eq(AsnOrderItem::getAsnId, id)); |
| | | if (list.isEmpty()) { |
| | | continue; |
| | | } |
| | | |
| | | list.forEach(item -> { |
| | | PurchaseItem purchaseItem = purchaseItemService.getById(item.getPoDetlId()); |
| | | if (!Objects.isNull(purchaseItem)) { |
| | | purchaseItem.setQty(purchaseItem.getQty() - item.getAnfme()); |
| | | if (!purchaseItemService.updateById(purchaseItem)) { |
| | | throw new CoolException("PO单明细更新失败!!"); |
| | | } |
| | | } |
| | | String trackCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_LABEL_CODE, item); |
| | | if (StringUtils.isBlank(trackCode)) { |
| | | throw new CoolException("单据跟踪码生成失败:请检查「sys_asn_mantr_label」是否配置完成!!"); |
| | | } |
| | | // String barcode = code + matnr.getCode(); |
| | | orderItem.setAnfme(item.getAnfme()) |
| | | .setAsnId(order.getId()) |
| | | .setQty(item.getAnfme()) |
| | | .setSplrName(item.getSplrName()) |
| | | .setAsnCode(code) |
| | | .setSplrBatch(item.getSplrBatch()) |
| | | .setSplrCode(item.getSplrCode()) |
| | | .setPoDetlId(item.getId()) |
| | | .setPlatItemId(item.getPlatItemId()) |
| | | .setTrackCode(trackCode) |
| | | .setPoCode(purchase.getCode()) |
| | | .setPurQty(item.getAnfme()) |
| | | .setPurUnit(item.getUnit()) |
| | | .setMatnrCode(matnr.getCode()) |
| | | .setMaktx(matnr.getName()) |
| | | .setMatnrId(matnr.getId()); |
| | | orderItems.add(orderItem); |
| | | }); |
| | | if (!asnOrderItemService.saveBatch(orderItems)) { |
| | | throw new CoolException(("Asn单据明细保存失败!!")); |
| | | |
| | | double sum = list.stream().mapToDouble(AsnOrderItem::getAnfme).sum(); |
| | | |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>() |
| | | .eq(Purchase::getCode, list.stream().findFirst().get().getPoCode())); |
| | | if (!Objects.isNull(purchase)) { |
| | | purchase.setQty(purchase.getQty() - sum) |
| | | .setExceStatus(POExceStatus.PO_EXCE_STATUS_EXCE_ING.val); |
| | | |
| | | if (!purchaseService.updateById(purchase)) { |
| | | throw new CoolException("PO单据更新失败!!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //任务执行完成,修改已完成数量和PO单执行状态 |
| | | purchase.setQty(purchase.getAnfme()) |
| | | .setExceStatus(POExceStatus.PO_EXCE_STATUS_EXCE_ING.val); |
| | | |
| | | if (!purchaseService.saveOrUpdate(purchase)) { |
| | | throw new CoolException("PO单执行完成后,保存失败!!"); |
| | | } |
| | | }); |
| | | if (!this.remove(new LambdaQueryWrapper<AsnOrder>() |
| | | .in(AsnOrder::getId, ids) |
| | | .eq(AsnOrder::getExceStatus, AsnExceStatus.ASN_EXCE_STATUS_UN_EXCE.val))) { |
| | | throw new CoolException("任务中单据不可删除!!"); |
| | | } |
| | | |
| | | |
| | | return null; |
| | | if (!asnOrderItemService.remove(new LambdaQueryWrapper<AsnOrderItem>() |
| | | .in(AsnOrderItem::getAsnId, ids))) { |
| | | // throw new CoolException("Details Delete Fail"); |
| | | } |
| | | |
| | | return R.ok("操作成功!!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | } |
| | | FieldsUtils.setFieldsFilters(queryWrapper,pageParam,Matnr.class); |
| | | /**拼接扩展字段*/ |
| | | PageParam<Matnr, BaseParam> page = this.page(pageParam, queryWrapper); |
| | | List<Matnr> records = page.getRecords(); |
| | |
| | | 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"; |
| | | |
| | | } |
| | |
| | | |
| | | public class BaseController { |
| | | |
| | | |
| | | |
| | | public User getLoginUser() { |
| | | try { |
| | | Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); |
| | |
| | | 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> |