| | |
| | | VITE_BASE_IP=127.0.0.1 |
| | | VITE_BASE_IP=192.168.4.50 |
| | | # VITE_BASE_IP=47.76.147.249 |
| | | VITE_BASE_PORT=8080 |
| | |
| | | inputPlaceholder: 'Use commas to separate', |
| | | resend: 'RESEND', |
| | | selected: 'selected', |
| | | batch: 'batch' |
| | | batch: 'batch', |
| | | batchSafe: 'Bulk Safe', |
| | | batchDef: 'Bulk Def', |
| | | }, |
| | | msg: { |
| | | confirm: { |
| | |
| | | rcptQty: "rcptQty", |
| | | dlyQty: "dlyQty", |
| | | disQty: "disQty", |
| | | anfme: 'anfme', |
| | | safeQty: "safeQty", |
| | | picPath: "picPath", |
| | | trackCode: "trackCode", |
| | |
| | | stockError: '没有库存', |
| | | resend: '重发', |
| | | selected: '项选中', |
| | | batch: '批量编辑' |
| | | batch: '批量编辑', |
| | | batchSafe: '批量合格', |
| | | batchDef: '批量不合格', |
| | | }, |
| | | msg: { |
| | | confirm: { |
| | |
| | | matnrCode: "物料编号", |
| | | maktx: "物料名称", |
| | | label: "标签", |
| | | splrName: "供应商名称", |
| | | splrBatch: "供应商批次", |
| | | splrName: "供应商", |
| | | splrBatch: "批次", |
| | | stockBatch: "库存批次", |
| | | isptResult: '质检结论', |
| | | isptStatus: '质检状态', |
| | | rcptQty: "收货数量", |
| | | rcptQty: "可检数量", |
| | | dlyQty: "送货数量", |
| | | disQty: "不合数量", |
| | | safeQty: "合格数量", |
| | | anfme: '数量', |
| | | picPath: "图片路径", |
| | | trackCode: "条形码", |
| | | }, |
| | |
| | | import { styled } from '@mui/material/styles'; |
| | | import AsnOrderItemCreate from "./AsnOrderItemCreate"; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import DialogCloseButton from "../../components/DialogCloseButton"; |
| | | |
| | | import request from '@/utils/request'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_PAGE_SIZE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | import AsnOrderItemEdit from "./AsnOrderItemEdit"; |
| | |
| | | backgroundColor: 'background.paper', |
| | | zIndex: 1000 |
| | | }}> |
| | | 执行质检 |
| | | <Box sx={{ position: 'absolute', top: 8, right: 8, zIndex: 1001 }}> |
| | | <DialogCloseButton onClose={handleClose} /> |
| | | </Box> |
| | | </DialogTitle> |
| | | <DialogContent sx={{ mt: 2 }}> |
| | | {/* <Box component="form" onSubmit={handleSubmit} sx={{ display: 'flex', flexDirection: 'column', gap: 3 }}> |
| | | <Grid container spacing={2}> |
| | | <Grid item md={4}> |
| | | <TextField |
| | | label={translate('table.field.asnOrder.code')} |
| | | name="code" |
| | | value={formData.code} |
| | | onChange={handleChange} |
| | | size="small" |
| | | /> |
| | | </Grid> |
| | | </Grid> |
| | | </Box> */} |
| | | <Box sx={{ mt: 2 }}> |
| | | {/* <Stack direction="row" spacing={2}> |
| | | <Button variant="contained" onClick={handleSearch}>搜索</Button> |
| | | </Stack> */} |
| | | |
| | | <Stack direction="row" spacing={2}> |
| | | <Button variant="contained" onClick={batchQualified}>批量合格</Button> |
| | | <Button variant="contained" color="error" onClick={batchUnQualified}>批量不合格</Button> |
| | | <Button variant="contained" onClick={batchQualified}>{translate('common.action.batchSafe')} </Button> |
| | | <Button variant="contained" color="error" onClick={batchUnQualified}>{translate('common.action.batchDef')} </Button> |
| | | </Stack> |
| | | </Box> |
| | | <Box sx={{ mt: 2, height: 400, width: '100%' }}> |
| | |
| | | </Box> |
| | | </DialogContent> |
| | | <DialogActions sx={{ position: 'sticky', bottom: 0, backgroundColor: 'background.paper', zIndex: 1000 }}> |
| | | <Box sx={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}> |
| | | <Box sx={{ width: '100%', display: 'flex', justifyContent: 'end' }}> |
| | | <Button onClick={handleSubmit} variant="contained" startIcon={<SaveIcon />}> |
| | | {translate('toolbar.confirm')} |
| | | </Button> |
| | |
| | | |
| | | }; |
| | | |
| | | |
| | | |
| | | const [columns, setColumns] = useState([ |
| | | // { field: 'id', headerName: 'ID', width: 100 }, |
| | | { field: 'maktx', headerName: translate('table.field.qlyIsptItem.maktx'), width: 300 }, |
| | | { field: 'matnrCode', headerName: translate('table.field.qlyIsptItem.matnrCode') }, |
| | | { field: 'maktx', headerName: translate('table.field.qlyIsptItem.maktx'), width: 300 }, |
| | | { field: 'splrName', headerName: translate('table.field.qlyIsptItem.splrName') }, |
| | | { field: 'splrBatch', headerName: translate('table.field.qlyIsptItem.splrBatch') }, |
| | | { field: 'stockBatch', headerName: translate('table.field.qlyIsptItem.stockBatch') }, |
| | | { field: 'dlyQty', headerName: translate('table.field.qlyIsptItem.dlyQty') }, |
| | | // { field: 'stockBatch', headerName: translate('table.field.qlyIsptItem.stockBatch') }, |
| | | // { field: 'dlyQty', headerName: translate('table.field.qlyIsptItem.dlyQty') }, |
| | | { field: 'rcptQty', headerName: translate('table.field.qlyIsptItem.rcptQty') }, |
| | | { |
| | | field: 'safeQty', headerName: translate('table.field.qlyIsptItem.safeQty'), editable: true, type: 'number', |
| | |
| | | field: 'isptResult', headerName: translate('table.field.qlyIsptItem.isptResult'), width: 150, type: 'singleSelect', |
| | | editable: true, valueOptions: [{ value: '1', label: '合格' }, { value: '2', label: '不合格' }, { value: '3', label: '待定' }, { value: '4', label: '部分合格' }], |
| | | }, |
| | | |
| | | |
| | | ]) |
| | | |
| | | const processRowUpdate = (newRow, oldRow) => { |
| | |
| | | </Stack> |
| | | <Stack direction='row' gap={2}> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.safeQty" |
| | | source="safeQty" |
| | | readOnly |
| | | /> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.dlyQty" |
| | | source="dlyQty" |
| | | readOnly |
| | | |
| | | /> |
| | | <NumberInput |
| | | label="table.field.qlyInspect.rcptQty" |
| | | source="rcptQty" |
| | | readOnly |
| | |
| | | <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="safeQty" label="table.field.qlyInspect.safeQty" /> |
| | | <NumberField source="dlyQty" label="table.field.qlyInspect.dlyQty" /> |
| | | <NumberField source="rcptQty" label="table.field.qlyInspect.rcptQty" /> |
| | | <NumberField source="isptQty" label="table.field.qlyInspect.isptQty" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime /> |
| | |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | |
| | | return ( |
| | | <Button onClick={requestClose} label={"toolbar.close"}> |
| | |
| | | AutocompleteInput, |
| | | DeleteButton, |
| | | useGetOne, |
| | | useRefresh, |
| | | useGetRecordId, |
| | | } from 'react-admin'; |
| | | import { Box, Typography, Card, Stack } from '@mui/material'; |
| | | import { Box, Typography, Card, Stack, LinearProgress } from '@mui/material'; |
| | | import { styled } from '@mui/material/styles'; |
| | | import QlyIsptItemCreate from "./QlyIsptItemCreate"; |
| | | import EmptyData from "../../components/EmptyData"; |
| | | import MyCreateButton from "../../components/MyCreateButton"; |
| | | import MyExportButton from '../../components/MyExportButton'; |
| | | import PageDrawer from "../../components/PageDrawer"; |
| | | import request from '@/utils/request'; |
| | | import { PAGE_DRAWER_WIDTH, OPERATE_MODE, DEFAULT_ITEM_PAGE_SIZE } from '@/config/setting'; |
| | | |
| | | const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({ |
| | |
| | | const [drawerVal, setDrawerVal] = useState(false); |
| | | const isptId = useGetRecordId(); |
| | | const { data: dicts, isPending, error } = useGetOne('qlyInspect', { id: isptId }); |
| | | if (dicts == null) {return} |
| | | if (dicts == null) { return } |
| | | |
| | | return ( |
| | | <Box display="flex"> |
| | | <List |
| | | resource="qlyIsptItem" |
| | | filter={{ispectId: isptId}} |
| | | resource="qlyIsptItem" |
| | | filter={{ ispectId: isptId }} |
| | | sx={{ |
| | | flexGrow: 1, |
| | | transition: (theme) => |
| | |
| | | )} |
| | | perPage={DEFAULT_ITEM_PAGE_SIZE} |
| | | > |
| | | <StyledDatagrid |
| | | preferenceKey='qlyIsptItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'label', 'stockBatch','picPath', 'ispectId']} |
| | | > |
| | | <NumberField source="id" /> |
| | | <NumberField source="ispectId" label="table.field.qlyIsptItem.ispectId" /> |
| | | <TextField source="matnrCode" label="table.field.qlyIsptItem.matnrCode" /> |
| | | <TextField source="maktx" label="table.field.qlyIsptItem.maktx" /> |
| | | <TextField source="label" label="table.field.qlyIsptItem.label" /> |
| | | <TextField source="splrBatch" label="table.field.qlyIsptItem.splrBatch" /> |
| | | <TextField source="stockBatch" label="table.field.qlyIsptItem.stockBatch" /> |
| | | <NumberField source="rcptQty" label="table.field.qlyIsptItem.rcptQty" /> |
| | | <NumberField source="dlyQty" label="table.field.qlyIsptItem.dlyQty" /> |
| | | <NumberField source="disQty" label="table.field.qlyIsptItem.disQty" /> |
| | | <NumberField source="safeQty" label="table.field.qlyIsptItem.safeQty" /> |
| | | <TextField source="splrName" label="table.field.qlyIsptItem.splrName" /> |
| | | <NumberField source="isptResult$" label="table.field.qlyIsptItem.isptResult" /> |
| | | <TextField source="picPath" label="table.field.qlyIsptItem.picPath" /> |
| | | <TextField source="updateBy$" label="common.field.updateBy" /> |
| | | <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} /> |
| | | <TextField source="memo" label="common.field.memo" sortable={false} /> |
| | | </StyledDatagrid> |
| | | <DynamicFields /> |
| | | </List> |
| | | <QlyIsptItemCreate |
| | | open={createDialog} |
| | |
| | | } |
| | | |
| | | export default QlyIsptItemList; |
| | | |
| | | |
| | | |
| | | const DynamicFields = (props) => { |
| | | const translate = useTranslate(); |
| | | const notify = useNotify(); |
| | | const [columns, setColumns] = useState([]); |
| | | const { isLoading } = useListContext(); |
| | | const refresh = useRefresh(); |
| | | useEffect(() => { |
| | | getDynamicFields(); |
| | | }, []); |
| | | |
| | | const getDynamicFields = async () => { |
| | | const { data: { code, data, msg }, } = await request.get("/fields/enable/list"); |
| | | if (code == 200) { |
| | | const arr = [ |
| | | <NumberField source="id" />, |
| | | <NumberField source="ispectId" label="table.field.qlyIsptItem.ispectId" />, |
| | | <TextField source="matnrCode" label="table.field.qlyIsptItem.matnrCode" />, |
| | | <TextField source="maktx" label="table.field.qlyIsptItem.maktx" />, |
| | | <TextField source="label" label="table.field.qlyIsptItem.label" />, |
| | | <TextField source="splrBatch" label="table.field.qlyIsptItem.splrBatch" />, |
| | | <TextField source="stockBatch" label="table.field.qlyIsptItem.stockBatch" />, |
| | | <NumberField source="rcptQty" label="table.field.qlyIsptItem.rcptQty" />, |
| | | <NumberField source="dlyQty" label="table.field.qlyIsptItem.dlyQty" />, |
| | | <NumberField source="anfme" label="table.field.qlyIsptItem.anfme" />, |
| | | <TextField source="splrName" label="table.field.qlyIsptItem.splrName" />, |
| | | <NumberField source="isptResult$" label="table.field.qlyIsptItem.isptResult" />, |
| | | ] |
| | | const fields = data.map(el => <TextField key={el.fields} source={`extendFields.[${el.fields}]`} label={el.fieldsAlise} />) |
| | | const lastArr = [ |
| | | <DateField source="updateTime" label="common.field.updateTime" showTime />, |
| | | <ReferenceField source="updateBy" label="common.field.updateBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField>, |
| | | <ReferenceField source="createBy" label="common.field.createBy" reference="user" link={false} sortable={false}> |
| | | <TextField source="nickname" /> |
| | | </ReferenceField>, |
| | | <DateField source="createTime" label="common.field.createTime" showTime />, |
| | | <TextField source="memo" label="common.field.memo" sortable={false} />, |
| | | ] |
| | | setColumns([...arr, ...fields, ...lastArr]); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <Box sx={{ position: 'relative', minHeight: "60vh", }}> |
| | | {isLoading && ( |
| | | <LinearProgress |
| | | sx={{ |
| | | height: "2px", |
| | | position: 'absolute', |
| | | top: 0, |
| | | left: 0, |
| | | right: 0, |
| | | }} |
| | | /> |
| | | )} |
| | | {columns.length > 0 && |
| | | <StyledDatagrid |
| | | preferenceKey='qlyIsptItem' |
| | | bulkActionButtons={() => <BulkDeleteButton mutationMode={OPERATE_MODE} />} |
| | | rowClick={false} |
| | | omit={['id', 'createTime', 'createBy', 'memo', 'dlyQty', 'label', 'stockBatch', 'picPath', 'ispectId', 'statusBool']} |
| | | |
| | | > |
| | | {columns.map((column) => column)} |
| | | </StyledDatagrid>} |
| | | </Box> |
| | | ) |
| | | } |
| | |
| | | |
| | | @ApiOperation("快速质检信息") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | @PostMapping("/inspect/query") |
| | | // @PostMapping("/inspect/query") |
| | | public R checkObjs(@RequestBody CheckObjParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | |
| | | .setId(isptItem.getId()) |
| | | .setMatnrCode(isptItem.getMatnrCode()) |
| | | .setMaktx(isptItem.getMaktx()) |
| | | .setDisQty(isptItem.getDisQty()) |
| | | // .setDisQty(isptItem.getDisQty()) |
| | | .setDlyQty(isptItem.getDlyQty()) |
| | | .setRcptQty(isptItem.getRcptQty()) |
| | | .setIsptResult(isptItem.getIsptResult()) |
| | | .setSplrBatch(isptItem.getSplrBatch()) |
| | | .setSplrName(isptItem.getSplrName()) |
| | | .setPicPath(isptItem.getPicPath()) |
| | | .setMemo(isptItem.getMemo()) |
| | | .setSafeQty(isptItem.getSafeQty()); |
| | | .setMemo(isptItem.getMemo()); |
| | | // .setSafeQty(isptItem.getSafeQty()); |
| | | dtos.add(objDto); |
| | | }); |
| | | return R.ok(dtos); |
| | |
| | | generator.frontendPrefixPath = "rsf-admin/"; |
| | | |
| | | generator.sqlOsType = SqlOsType.MYSQL; |
| | | generator.url = "127.0.0.1:3306/rsf"; |
| | | generator.url = "192.168.4.56:3306/rsf"; |
| | | generator.username = "root"; |
| | | generator.password = "34821015"; |
| | | // generator.url="47.97.1.152:51433;databasename=jkasrs"; |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table = "man_device_bind"; |
| | | generator.tableDesc = "立体库站点绑定"; |
| | | generator.table = "man_qly_inspect_result"; |
| | | generator.tableDesc = "质检结果"; |
| | | generator.packagePath = "com.vincent.rsf.server.manager"; |
| | | |
| | | generator.build(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/qlyInspect/reports") |
| | | @ApiOperation("获取已上报单据明细") |
| | | @ApiOperation("获取可质检单据明细") |
| | | @PreAuthorize("hasAuthority('manager:qlyInspect:list')") |
| | | public R listByAsnCode(@RequestBody Map<String, Object> map) { |
| | | if (Objects.isNull(map)) { |
| | |
| | | if (Objects.isNull(ids) || ids.length < 1) { |
| | | return R.error("能数不能为空!!"); |
| | | } |
| | | List<QlyInspect> qlyInspects = qlyInspectService.list(new LambdaQueryWrapper<QlyInspect>().in(QlyInspect::getId, ids)); |
| | | List<QlyInspect> qlyInspects = qlyInspectService.list(new LambdaQueryWrapper<QlyInspect>() |
| | | .in(QlyInspect::getId, ids) |
| | | .gt(QlyInspect::getIsptQty, 0) |
| | | ); |
| | | if (!qlyInspects.isEmpty()) { |
| | | return R.error("有明细列表存在!!"); |
| | | return R.error("有明细单据已在质检中!!"); |
| | | } |
| | | if (!qlyInspectService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.common.utils.FieldsUtils; |
| | | 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.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyIsptItem; |
| | | import com.vincent.rsf.server.manager.service.QlyIsptItemService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<QlyIsptItem, BaseParam> pageParam = new PageParam<>(baseParam, QlyIsptItem.class); |
| | | return R.ok().add(qlyIsptItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | |
| | | /**拼接扩展字段*/ |
| | | PageParam<QlyIsptItem, BaseParam> page = qlyIsptItemService.page(pageParam, pageParam.buildWrapper(true)); |
| | | List<QlyIsptItem> records = page.getRecords(); |
| | | for (QlyIsptItem record : records) { |
| | | if (!Objects.isNull(record.getFieldsIndex())) { |
| | | Map<String, String> fields = FieldsUtils.getFields(record.getFieldsIndex()); |
| | | record.setExtendFields(fields); |
| | | } |
| | | } |
| | | page.setRecords(records); |
| | | |
| | | return R.ok(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:qlyIsptItem:list')") |
| | |
| | | // if (tasks.isEmpty()) { |
| | | // throw new CoolException("任务已处执行状态不可一键完成!!"); |
| | | // } |
| | | taskService.completeTask(tasks); |
| | | return R.ok(); |
| | | // taskService.completeTask(tasks); |
| | | for (Task task : tasks) { |
| | | task.setTaskStatus(task.getTaskType() < (short)100 ? TaskStsType.COMPLETE_IN.id : TaskStsType.COMPLETE_OUT.id); |
| | | } |
| | | if (!taskService.updateBatchById(tasks)){ |
| | | return R.error("完成任务失败"); |
| | | } |
| | | |
| | | return R.ok("完成任务成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | |
| | | import com.vincent.rsf.server.system.constant.DictTypeCode; |
| | | import com.vincent.rsf.server.system.entity.DictData; |
| | | import com.vincent.rsf.server.system.service.DictDataService; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | |
| | | @ApiModelProperty(value= "收货数量") |
| | | private Double rcptQty; |
| | | |
| | | @ApiModelProperty("质检数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 送货数量 |
| | | */ |
| | | @ApiModelProperty(value= "送货数量") |
| | | private Double dlyQty; |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | private String fieldsIndex; |
| | | |
| | | @ApiModelProperty("扩展字段") |
| | | @TableField(exist = false) |
| | | private Map<String, String> extendFields; |
| | | |
| | | /** |
| | | * 不合数量 |
| | | */ |
| | | @ApiModelProperty(value= "不合数量") |
| | | @TableField(exist = false) |
| | | private Double disQty; |
| | | |
| | | /** |
| | | * 合格数量 |
| | | */ |
| | | @ApiModelProperty(value= "合格数量") |
| | | @TableField(exist = false) |
| | | private Double safeQty; |
| | | |
| | | /** |
| | |
| | | this.stockBatch = stockBatch; |
| | | this.rcptQty = rcptQty; |
| | | this.dlyQty = dlyQty; |
| | | this.disQty = disQty; |
| | | this.safeQty = safeQty; |
| | | // this.disQty = disQty; |
| | | // this.safeQty = safeQty; |
| | | this.picPath = picPath; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.IsptOrderParam; |
| | | import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptResult; |
| | | import com.vincent.rsf.server.manager.enums.QlyIsptStatus; |
| | | import com.vincent.rsf.server.manager.mapper.QlyInspectMapper; |
| | | import com.vincent.rsf.server.manager.service.*; |
| | |
| | | |
| | | @Autowired |
| | | private QlyIsptItemService qlyIsptItemService; |
| | | |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | |
| | | @Autowired |
| | | private WarehouseAreasItemService warehouseAreasItemService; |
| | |
| | | String code = params.get("asnCode"); |
| | | List<WarehouseAreasItem> warehouseAreasItems = warehouseAreasItemService |
| | | .list(new QueryWrapper<WarehouseAreasItem>() |
| | | .select("asn_id as id, SUM(anfme) anfme, SUM(qty) qty, area_id, area_name, asn_code, asn_id") |
| | | .select("asn_id as id, SUM(anfme) anfme, SUM(qty) qty, area_id, area_name, asn_code, asn_id, splr_id, splr_batch") |
| | | .eq(StringUtils.isNotBlank(code), "asn_code", code) |
| | | .lambda() |
| | | .isNull(WarehouseAreasItem::getIsptResult) |
| | | .lt(WarehouseAreasItem::getWorkQty, 1) |
| | | .lt(WarehouseAreasItem::getQty, 1) |
| | | .groupBy(WarehouseAreasItem::getAsnCode)); |
| | | return warehouseAreasItems; |
| | | } |
| | |
| | | if (Objects.isNull(param.getIds()) || param.getIds().isEmpty()) { |
| | | throw new CoolException("单据ID不能为空!!"); |
| | | } |
| | | List<AsnOrder> asnOrders = asnOrderService.list(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, param.getIds()).eq(AsnOrder::getNtyStatus, 0)); |
| | | List<AsnOrder> asnOrders = asnOrderService.list(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, param.getIds())); |
| | | if (asnOrders.isEmpty()) { |
| | | throw new CoolException("单据不存在!!"); |
| | | } |
| | | List<AsnOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getAsnId, param.getIds())); |
| | | if (orderItems.isEmpty()) { |
| | | throw new CoolException("单据明细不存在!!"); |
| | | } |
| | | Map<Long, List<AsnOrderItem>> listMap = orderItems.stream().collect(Collectors.groupingBy(AsnOrderItem::getAsnId)); |
| | | // List<AsnOrderItem> orderItems = asnOrderItemService.list(new LambdaQueryWrapper<AsnOrderItem>().in(AsnOrderItem::getAsnId, param.getIds())); |
| | | // if (orderItems.isEmpty()) { |
| | | // throw new CoolException("单据明细不存在!!"); |
| | | // } |
| | | |
| | | List<WarehouseAreasItem> orderItems = warehouseAreasItemService.list(new LambdaQueryWrapper<WarehouseAreasItem>() |
| | | .in(WarehouseAreasItem::getAsnId, param.getIds())); |
| | | Map<Long, List<WarehouseAreasItem>> listMap = orderItems.stream().collect(Collectors.groupingBy(WarehouseAreasItem::getAsnId)); |
| | | for (AsnOrder asnOrder : asnOrders) { |
| | | QlyInspect inspect = new QlyInspect(); |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_INSPECT_CODE, null); |
| | |
| | | .setAsnId(asnOrder.getId()) |
| | | .setAsnCode(asnOrder.getCode()); |
| | | /**获取单据明细*/ |
| | | List<AsnOrderItem> asnOrderItems = listMap.get(asnOrder.getId()); |
| | | List<WarehouseAreasItem> asnOrderItems = listMap.get(asnOrder.getId()); |
| | | if (Objects.isNull(asnOrderItems) || asnOrderItems.isEmpty()) { |
| | | continue; |
| | | } |
| | | double rcptQty = asnOrderItems.stream().mapToDouble(AsnOrderItem::getQty).sum(); |
| | | double anfme = asnOrderItems.stream().mapToDouble(AsnOrderItem::getAnfme).sum(); |
| | | inspect.setRcptQty(rcptQty).setDlyQty(anfme); |
| | | double anfme = asnOrderItems.stream().mapToDouble(WarehouseAreasItem::getAnfme).sum(); |
| | | inspect.setRcptQty(anfme); |
| | | if (!this.save(inspect)) { |
| | | throw new CoolException("单据" + asnOrder.getCode() + "保存失败!!"); |
| | | } |
| | | List<QlyIsptItem> items = new ArrayList<>(); |
| | | for (AsnOrderItem orderItem : asnOrderItems) { |
| | | for (WarehouseAreasItem orderItem : asnOrderItems) { |
| | | QlyIsptItem isptItem = new QlyIsptItem(); |
| | | BeanUtils.copyProperties(orderItem, isptItem); |
| | | isptItem.setAsnItemId(orderItem.getId()) |
| | | .setIspectId(inspect.getId()) |
| | | .setRcptQty(orderItem.getQty()) |
| | | .setRcptQty(orderItem.getAnfme()) |
| | | .setAnfme(0.0) |
| | | .setFieldsIndex(orderItem.getFieldsIndex()) |
| | | .setSplrBatch(orderItem.getSplrBatch()) |
| | | .setSplrName(orderItem.getSplrId$()) |
| | | .setCreateBy(loginUserId) |
| | | .setDlyQty(orderItem.getAnfme()); |
| | | items.add(isptItem); |
| | |
| | | throw new CoolException("明细保存失败!!"); |
| | | } |
| | | } |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().in(AsnOrder::getId, param.getIds()).set(AsnOrder::getNtyStatus, 1))) { |
| | | throw new CoolException("报检状态修改失败!!"); |
| | | } |
| | | // if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>().in(AsnOrder::getId, param.getIds()))) { |
| | | // throw new CoolException("报检状态修改失败!!"); |
| | | // } |
| | | return R.ok("保存成功!!"); |
| | | } |
| | | |
| | |
| | | import com.vincent.rsf.server.manager.controller.params.QlyInspectAndItem; |
| | | import com.vincent.rsf.server.manager.entity.AsnOrderItem; |
| | | import com.vincent.rsf.server.manager.entity.QlyInspect; |
| | | import com.vincent.rsf.server.manager.entity.QlyInspectResult; |
| | | 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.AsnOrderItemService; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectResultService; |
| | | import com.vincent.rsf.server.manager.service.QlyInspectService; |
| | | import com.vincent.rsf.server.manager.service.QlyIsptItemService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | @Autowired |
| | | private AsnOrderItemService asnOrderItemService; |
| | | |
| | | @Autowired |
| | | private QlyInspectResultService qlyInspectResultService; |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 批量修改 |
| | | * @param |
| | | * @return |
| | | * @author Ryan |
| | | * @description 批量修改 |
| | | * @time 2025/4/1 09:40 |
| | | */ |
| | | @Override |
| | |
| | | if (Objects.isNull(params.getIsptItem()) || params.getIsptItem().isEmpty()) { |
| | | throw new CoolException("ID不能为空!!"); |
| | | } |
| | | List<QlyIsptItem> isptItem = params.getIsptItem(); |
| | | List<QlyIsptItem> isptItem = params.getIsptItem(); |
| | | List<Long> list = isptItem.stream().map(QlyIsptItem::getId).collect(Collectors.toList()); |
| | | |
| | | List<QlyIsptItem> isptItems = this.list(new LambdaQueryWrapper<QlyIsptItem>().in(QlyIsptItem::getId, list)); |
| | | if (isptItems.isEmpty()) { |
| | | throw new CoolException("数据错误:明细不存在!!"); |
| | | } |
| | | |
| | | for (QlyIsptItem item : isptItems) { |
| | | List<QlyInspectResult> results = qlyInspectResultService.list(new LambdaQueryWrapper<QlyInspectResult>() |
| | | .eq(QlyInspectResult::getIsptId, item.getIspectId()) |
| | | .eq(QlyInspectResult::getIsptItemId, item.getId())); |
| | | if (!results.isEmpty()) { |
| | | //不为空做更新操作 |
| | | |
| | | |
| | | } else { |
| | | //为空做新增操作 |
| | | QlyInspectResult result = new QlyInspectResult(); |
| | | result.setIsptId(item.getIspectId()) |
| | | .setAnfme(item.getSafeQty()) |
| | | .setIsptItemId(item.getId()); |
| | | if (item.getDisQty().compareTo(0.00) < 1) { |
| | | continue; |
| | | } |
| | | result.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_DEFECT.val); |
| | | result.setAnfme(item.getDisQty()); |
| | | |
| | | if (!qlyInspectResultService.save(result)) { |
| | | throw new CoolException("质检结论保存失败!!"); |
| | | } |
| | | |
| | | if (item.getSafeQty().compareTo(0.00) < 1) { |
| | | continue; |
| | | } |
| | | result.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) |
| | | .setAnfme(item.getSafeQty()); |
| | | |
| | | if (!qlyInspectResultService.save(result)) { |
| | | throw new CoolException("质检结论保存失败!!"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | 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 (Short.parseShort(params.getType()) == QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) { |
| | | //TODO 先捡后收为送货数量,先收后捡为收货数量 |
| | | item.setSafeQty(item.getDlyQty()); |
| | | item.setDisQty(0.0); |
| | | // item.setSafeQty(item.getDlyQty()); |
| | | // item.setDisQty(0.0); |
| | | } else { |
| | | item.setSafeQty(0.0); |
| | | item.setDisQty(item.getDlyQty()); |
| | | // item.setSafeQty(0.0); |
| | | // item.setDisQty(item.getDlyQty()); |
| | | } |
| | | if (!this.update(new LambdaUpdateWrapper<QlyIsptItem>() |
| | | .set(QlyIsptItem::getSafeQty, item.getSafeQty()) |
| | | // .set(QlyIsptItem::getSafeQty, item.getSafeQty()) |
| | | .set(QlyIsptItem::getIsptResult, Short.parseShort(params.getType())) |
| | | .set(QlyIsptItem::getDisQty, item.getDisQty()) |
| | | // .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("数据错误:明细不存在!!"); |
| | | } |
| | | |
| | | Map<Long, List<QlyIsptItem>> listMap = isptItems.stream().collect(Collectors.groupingBy(QlyIsptItem::getIspectId)); |
| | | for (Long key : listMap.keySet()) { |
| | | QlyInspect inspect = qlyInspectService.getById(key); |
| | | List<QlyIsptItem> items = listMap.get(key); |
| | | items.forEach(qlyIsptItem -> { |
| | | AsnOrderItem orderItem = asnOrderItemService.getById(qlyIsptItem.getAsnItemId()); |
| | | if (qlyIsptItem.getSafeQty().compareTo(orderItem.getAnfme()) >= 0.00) { |
| | | orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) |
| | | .setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | } else if (qlyIsptItem.getSafeQty().compareTo(0.00) > 0.00 && qlyIsptItem.getSafeQty().compareTo(orderItem.getAnfme()) < 0.00) { |
| | | orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | if (Double.compare(qlyIsptItem.getSafeQty() + qlyIsptItem.getDisQty(), orderItem.getAnfme()) >= 0.00 ) { |
| | | orderItem.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | } else { |
| | | orderItem.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_ING.val); |
| | | } |
| | | } else { |
| | | orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_DEFECT.val) |
| | | .setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | } |
| | | // if (qlyIsptItem.getSafeQty().compareTo(orderItem.getAnfme()) >= 0.00) { |
| | | // orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val) |
| | | // .setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | // } else if (qlyIsptItem.getSafeQty().compareTo(0.00) > 0.00 && qlyIsptItem.getSafeQty().compareTo(orderItem.getAnfme()) < 0.00) { |
| | | // orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | // if (Double.compare(qlyIsptItem.getSafeQty() + qlyIsptItem.getDisQty(), orderItem.getAnfme()) >= 0.00 ) { |
| | | // orderItem.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | // } else { |
| | | // orderItem.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_ING.val); |
| | | // } |
| | | // } else { |
| | | // orderItem.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_DEFECT.val) |
| | | // .setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | // } |
| | | |
| | | if (!asnOrderItemService.updateById(orderItem)) { |
| | | throw new CoolException("收货单明细修改失败!!"); |
| | | } |
| | | }); |
| | | Double safeQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).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(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | } |
| | | if (Double.compare(safeQty, inspect.getDlyQty()) == 0) { |
| | | // inspect.setIsptStatus(QlyIsptStatus.QLY_ISPT_STAS_DONE.val); |
| | | inspect.setIsptResult(QlyIsptResult.QLY_ISPT_RESULT_EXCELLENT.val); |
| | | } |
| | | // Double safeQty = items.stream().mapToDouble(QlyIsptItem::getSafeQty).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(QlyIsptResult.QLY_ISPT_RESULT_SECTION.val); |
| | | // } |
| | | // 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("质检数量修改失败!!"); |
| | | } |
| | |
| | | driver-class-name: com.mysql.jdbc.Driver |
| | | # 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 |
| | | url: jdbc:mysql://192.168.4.56:3306/rsf?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai |
| | | # username: rsf |
| | | password: 34821015 |
| | | type: com.alibaba.druid.pool.DruidDataSource |