Merge remote-tracking branch 'origin/devlop' into devlop
| | |
| | | [ |
| | | { locale: "en", name: "English" }, |
| | | { locale: "zh", name: "简体中文" }, |
| | | // { locale: "zh", name: "简体中文" }, |
| | | // { locale: "zh", name: "简体中文" }, |
| | | // { locale: "zh", name: "简体中文" }, |
| | | ], |
| | | { |
| | | // msg in console |
| | |
| | | order: 'Orders', |
| | | |
| | | }, |
| | | request: { |
| | | error: { |
| | | stock: "Insufficient inventory to deliver !!" |
| | | } |
| | | |
| | | } |
| | | |
| | | }; |
| | | |
| | | export default customEnglishMessages; |
| | |
| | | createWave: "生成波次", |
| | | recover: "继续收货", |
| | | }, |
| | | request: { |
| | | error: { |
| | | stock: "库存不足,无法提交!!" |
| | | } |
| | | |
| | | } |
| | | }; |
| | | |
| | | export default customChineseMessages; |
| | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const [disabled, setDisabled] = useState(false) |
| | | |
| | | const [createDialog, setCreateDialog] = useState(false); |
| | | |
| | | const tableRef = useRef(); |
| | | |
| | | useEffect(() => { |
| | |
| | | import DictionarySelect from "../../components/DictionarySelect"; |
| | | import ImportButton from "../../components/ImportButton"; |
| | | import DetailsIcon from '@mui/icons-material/Details'; |
| | | import CancelIcon from '@mui/icons-material/Cancel'; |
| | | import CancelOutlinedIcon from '@mui/icons-material/CancelOutlined'; |
| | | import OutOrderCreate from "./OutOrderCreate"; |
| | | import AddIcon from '@mui/icons-material/Add'; |
| | | import OutOrderModal from "./OutOrderModal"; |
| | |
| | | return ( |
| | | <Button onClick={createByOrder} label={'toolbar.asnCreate'}> <AddIcon /> </Button> |
| | | ) |
| | | |
| | | } |
| | | |
| | | const CancelButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | |
| | | const cancelOrder = async () => { |
| | | const { data: { code, data, msg } } = await request.get(`/outStock/cancel/${record?.id}`); |
| | | if (code === 200) { |
| | |
| | | } |
| | | |
| | | return ( |
| | | <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelIcon />} onConfirm={cancelOrder} /> |
| | | record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.cancel"} startIcon={<CancelOutlinedIcon /> } onConfirm={cancelOrder} /> : <></> |
| | | ) |
| | | } |
| | |
| | | "orders": formData, |
| | | "items": tabelData, |
| | | } |
| | | |
| | | const res = await request.post(`/outStock/items/save`, parmas); |
| | | if (res?.data?.code === 200) { |
| | | setOpen(false); |
| | |
| | | </DialogContent> |
| | | <DialogActions> |
| | | <Toolbar sx={{ width: '100%', justifyContent: 'end' }} > |
| | | <GenerateTaskButton record={record?.id} dataSource={data} /> |
| | | <GenerateTaskButton record={record?.id} dataSource={data} setOpen={setOpen}/> |
| | | </Toolbar> |
| | | </DialogActions> |
| | | </Dialog> |
| | |
| | | |
| | | export default ItemToTaskModal; |
| | | |
| | | const GenerateTaskButton = (record, dataSource) => { |
| | | const GenerateTaskButton = (record) => { |
| | | const refresh = useRefresh(); |
| | | const notify = useNotify(); |
| | | const redirect = useRedirect(); |
| | | const translate = useTranslate(); |
| | | const { locs, setLocs } = useState([]); |
| | | const generateTask = async () => { |
| | | const params = {wave: record, waveItem: dataSource} |
| | | console.log('---------->'); |
| | | console.log(record); |
| | | record?.dataSource.map(item => { |
| | | const loc = JSON.parse(item.stockLocs); |
| | | if (loc != undefined && loc.length > 0) { |
| | | setLocs(...loc) |
| | | } |
| | | }) |
| | | if (locs == undefined || locs.length < 1) { |
| | | notify(translate('request.error.stock')) |
| | | } else { |
| | | const res = await request.post(`/wave/public/task`, { wave: record?.record, waveItem: record?.dataSource }); |
| | | if (res?.data?.code === 200) { |
| | | record.setOpen(false) |
| | | notify(res.data.msg); |
| | | redirect("/task") |
| | | } else { |
| | |
| | | } |
| | | refresh(); |
| | | } |
| | | } |
| | | return (<Button variant="contained" label={"ra.action.save"} onClick={generateTask}></Button>) |
| | | } |
| | | |
| | |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const redirect = useRedirect(); |
| | | |
| | | const pubClick = async (event) => { |
| | | setSelectIds(record); |
| | | setDetailDialog(true); |
| | | } |
| | | return ( |
| | | <ConfirmButton label={"toolbar.createTask"} startIcon={<PublicIcon />} onConfirm={pubClick} /> |
| | | record?.exceStatus == 0 ? <ConfirmButton label={"toolbar.createTask"} startIcon={<PublicIcon /> } onConfirm={pubClick} size='small' /> : <></> |
| | | ); |
| | | } |
| | |
| | | title={"menu.task"} |
| | | empty={false} |
| | | filters={filters} |
| | | sort={{ field: "sort", order: "desc" }} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | |
| | | 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.manager.entity.TaskItem; |
| | | import com.vincent.rsf.server.manager.entity.Wave; |
| | | import com.vincent.rsf.server.manager.entity.WaveItem; |
| | | import com.vincent.rsf.server.manager.service.TaskItemService; |
| | | import com.vincent.rsf.server.manager.service.WaveService; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | |
| | | @Autowired |
| | | private WaveService waveService; |
| | | @Autowired |
| | | private TaskItemService taskItemService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:wave:list')") |
| | | @PostMapping("/wave/page") |
| | |
| | | @OperationLog("Delete 波次单据") |
| | | @PostMapping("/wave/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (Objects.isNull(ids)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | List<TaskItem> taskItems = taskItemService.list(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getSourceId, ids)); |
| | | if (taskItems.isEmpty()) { |
| | | throw new CoolException("有未完成任务,不可执行删除操作!!"); |
| | | } |
| | | if (!waveService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("Delete Fail"); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | |
| | | import com.vincent.rsf.server.system.service.DictDataService; |
| | | import lombok.experimental.Accessors; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | import com.vincent.rsf.server.system.service.UserService; |
| | | import com.vincent.rsf.server.system.entity.User; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Objects; |
| | | |
| | | @Data |
| | |
| | | |
| | | @ApiModelProperty("源编码") |
| | | private Long source; |
| | | |
| | | @ApiModelProperty("源单号") |
| | | private String sourceCode; |
| | | |
| | | @ApiModelProperty("源主单ID") |
| | | private Long sourceId; |
| | | |
| | | @ApiModelProperty("单据ID") |
| | | private Long orderId; |
| | |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 执行数量 |
| | | */ |
| | | @ApiModelProperty("库存数量") |
| | | private Double workQty; |
| | | |
| | | /** |
| | | * 完成数量 |
| | | */ |
| | | @ApiModelProperty("完成数量") |
| | | private Double qty; |
| | | |
| | | /** |
| | | * 库存批次 |
| | | */ |
| | | @ApiModelProperty(value= "库存批次") |
| | |
| | | } |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 保存出库主单及明细 |
| | | * @param |
| | | * @return |
| | | * @author Ryan |
| | | * @description 保存出库主单及明细 |
| | | * @time 2025/4/29 13:47 |
| | | */ |
| | | @Override |
| | |
| | | if (Objects.isNull(ruleCode) || StringUtils.isBlank(ruleCode)) { |
| | | throw new CoolException("编码规则错误:请检查「SYS_OUT_STOCK_CODE」是否设置正确!!"); |
| | | } |
| | | |
| | | orders.setCode(ruleCode) |
| | | .setType(OrderType.ORDER_OUT.type) |
| | | .setExceStatus(AsnExceStatus.OUT_STOCK_STATUS_TASK_INIT.val) |
| | | .setUpdateBy(loginUserId) |
| | | .setCreateBy(loginUserId); |
| | | if (!this.save(orders)) { |
| | |
| | | |
| | | |
| | | /** |
| | | * @author Ryan |
| | | * @description 修改主单及明细 |
| | | * @param |
| | | * @return |
| | | * @author Ryan |
| | | * @description 修改主单及明细 |
| | | * @time 2025/4/29 13:47 |
| | | */ |
| | | @Override |
| | |
| | | if (Objects.isNull(waves)) { |
| | | throw new CoolException("波次数据不存在!!"); |
| | | } |
| | | // List<Long> list = itemParams.stream().map(WaveItem::getWaveId).collect(Collectors.toList()); |
| | | List<WaveItem> waveItems = waveItemService.list(new LambdaQueryWrapper<WaveItem>().eq(WaveItem::getWaveId, waves.getId())); |
| | | if (waveItems.isEmpty()) { |
| | | throw new CoolException("波次明细不存在!!"); |
| | |
| | | // 3. 修改主单、波次执行数量 |
| | | // 4. 判断全仓出库或拣料出库 |
| | | List<Long> orderIds = waveItems.stream().map(WaveItem::getOrderId).collect(Collectors.toList()); |
| | | // List<AsnOrder> orders = asnOrderService.list(new LambdaQueryWrapper<AsnOrder>().in(AsnOrder::getId, orderIds)); |
| | | /**修改出库单状态*/ |
| | | if (!asnOrderService.update(new LambdaUpdateWrapper<AsnOrder>() |
| | | .set(AsnOrder::getExceStatus, AsnExceStatus.OUT_STOCK_STATUS_TASK_WORKING.val) |
| | | .in(AsnOrder::getId, orderIds))) { |
| | | throw new CoolException("出库单据状态修改失败!!"); |
| | | } |
| | | // /**修改波次单据执行状态*/ |
| | | // if (!this.update(new LambdaUpdateWrapper<Wave>().set(Wave::getExceStatus, WaveExceStatus.WAVE_EXCE_STATUS_TASK).eq(Wave::getId, waves.getId()))) { |
| | | // throw new CoolException("波次状态修改失败!!"); |
| | | // } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("库位不存在!!"); |
| | | } |
| | | |
| | | List<TaskItem> items = taskItemService.list(new LambdaQueryWrapper<TaskItem>().in(TaskItem::getSourceId, wave.getId())); |
| | | if (items.isEmpty()) { |
| | | throw new CoolException("波次任务已生成,不能重复生成!!"); |
| | | } |
| | | |
| | | task.setTaskCode(ruleCode) |
| | | .setTaskType(TaskType.TASK_TYPE_OUT.type) |
| | | .setTaskStatus(TaskStsType.GENERATE_OUT.id) |
| | |
| | | TaskItem taskItem = new TaskItem(); |
| | | BeanUtils.copyProperties(item, taskItem); |
| | | taskItem.setTaskId(task.getId()) |
| | | .setAnfme(waveItem.getAnfme()) |
| | | .setId(null) |
| | | .setSourceCode(wave.getCode()) |
| | | .setSourceId(wave.getId()) |
| | | .setSource(item.getWaveItemId()); |
| | | taskItems.add(taskItem); |
| | | } |