Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop
| | |
| | | |
| | | const filters = [ |
| | | <SearchInput source="condition" alwaysOn />, |
| | | |
| | | <TextInput source="code" label="table.field.asnOrder.code" />, |
| | | <TextInput source="poCode" label="table.field.asnOrder.poCode" />, |
| | | <NumberInput source="poId" label="table.field.asnOrder.poId" />, |
| | |
| | | import React, { useState, useRef, useEffect, useMemo, useCallback } from "react"; |
| | | import { useNavigate } from 'react-router-dom'; |
| | | import request from '@/utils/request'; |
| | | |
| | | import { |
| | | List, |
| | | DatagridConfigurable, |
| | |
| | | useRecordContext, |
| | | useTranslate, |
| | | useNotify, |
| | | useRefresh, |
| | | useListContext, |
| | | FunctionField, |
| | | TextField, |
| | |
| | | marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0, |
| | | }} |
| | | title={"menu.task"} |
| | | // empty={<EmptyData onClick={() => { setCreateDialog(true) }} />} |
| | | empty={<EmptyData onClick={() => { }} />} |
| | | filters={filters} |
| | | sort={{ field: "create_time", order: "desc" }} |
| | | sort={{ field: "sort", order: "desc" }} |
| | | actions={( |
| | | <TopToolbar> |
| | | <FilterButton /> |
| | |
| | | */ |
| | | const CancelButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const clickCancel = () => { |
| | | cancleTask([record]) |
| | | cancleTask(record) |
| | | }; |
| | | //取消任务 |
| | | const cancleTask = async (row) => {} |
| | | const cancleTask = async (row) => { |
| | | console.log(row); |
| | | const { data: { code, data, msg } } = await request.post(`/task/remove/` + row.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | return ( |
| | | <Button |
| | | onClick={clickCancel} |
| | |
| | | */ |
| | | const SetTopButton = () => { |
| | | const record = useRecordContext(); |
| | | const notify = useNotify(); |
| | | const refresh = useRefresh(); |
| | | const clickTop = () => { |
| | | topTask([record]) |
| | | topTask(record) |
| | | }; |
| | | //置顶任务 |
| | | const topTask = async (row) => { } |
| | | const topTask = async (row) => { |
| | | const { data: { code, data, msg } } = await request.post(`/task/top/` + row.id); |
| | | if (code === 200) { |
| | | notify(msg); |
| | | refresh(); |
| | | } else { |
| | | notify(msg); |
| | | } |
| | | } |
| | | return ( |
| | | <Button |
| | | onClick={clickTop} |
| | |
| | | cancleTask([record]) |
| | | }; |
| | | //取消任务 |
| | | const cancleTask = async (row) => {} |
| | | const cancleTask = async (row) => { } |
| | | return ( |
| | | <Button |
| | | onClick={clickCancel} |
| | |
| | | <SwapVertIcon /> |
| | | </Button> |
| | | ) |
| | | |
| | | } |
| | |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return mobileService.publicToStock(params); |
| | | return mobileService.publicToStock(params, getLoginUserId()); |
| | | } |
| | | |
| | | @ApiOperation("获取任务信息") |
| | |
| | | |
| | | R operateToStock(OpStockParams params); |
| | | |
| | | R publicToStock(PublicToStockParams params); |
| | | R publicToStock(PublicToStockParams params, Long loginUserId); |
| | | |
| | | R taskToStock(String code); |
| | | |
| | |
| | | import com.vincent.rsf.server.system.mapper.TenantMapper; |
| | | import com.vincent.rsf.server.system.mapper.UserMapper; |
| | | import com.vincent.rsf.server.system.service.FieldsItemService; |
| | | import com.vincent.rsf.server.system.service.FieldsService; |
| | | import com.vincent.rsf.server.system.service.UserLoginService; |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | |
| | | /** |
| | | * 人工上架入库 |
| | | * |
| | | * @param params |
| | | * @param loginUserId |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R publicToStock(PublicToStockParams params) { |
| | | public R publicToStock(PublicToStockParams params, Long loginUserId) { |
| | | if (Objects.isNull(params.getLocCode()) || StringUtils.isBlank(params.getLocCode())) { |
| | | throw new CoolException("库位不能为空!!"); |
| | | } |
| | |
| | | stock.setAsnId(OrderId).setAsnCode(order.getCode()); |
| | | if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); |
| | | stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | if (!Objects.isNull(purchase)) { |
| | | stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | } |
| | | } |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | |
| | | if (!stockService.save(stock)) { |
| | | throw new CoolException("库存保存失败!!"); |
| | | } |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getBarcode, params.getLocCode())); |
| | | Loc loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getCode, params.getLocCode())); |
| | | if (Objects.isNull(loc)) { |
| | | throw new CoolException("库位不存在!!"); |
| | | } |
| | |
| | | stockItem.setAsnItemId(orderItem.getId()) |
| | | .setBarcode(orderItem.getBarcode()) |
| | | .setLocId(loc.getId()) |
| | | .setUpdateBy(loginUserId) |
| | | .setId(null) |
| | | .setStockId(stock.getId()); |
| | | stockItems.add(stockItem); |
| | |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<StockItem> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(StockItem::getMatnrk, condition); |
| | | wrapper.like(StockItem::getMaktx, condition); |
| | | } |
| | | stockItemService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getMatnrk())) |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getMaktx())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | |
| | | ExcelUtil.build(ExcelUtil.create(taskService.list(), Task.class), response); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | | @ApiOperation("完成任务") |
| | | @GetMapping("/task/complete/{id}") |
| | | @PostMapping("/task/complete/{id}") |
| | | public R completeTask(@PathVariable String id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | // return taskService.completeTask(id); |
| | | return null; |
| | | List<Long> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id); |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs)); |
| | | if (tasks.isEmpty()) { |
| | | throw new CoolException("任务已处执行状态不可一键完成!!"); |
| | | } |
| | | try { |
| | | taskService.completeTask(tasks); |
| | | } catch (Exception ex) { |
| | | return R.error("任务异常,无法完成!!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:task:update')") |
| | | @ApiOperation("任务出库置顶") |
| | | @PostMapping("/task/top/{id}") |
| | | public R setTop(@PathVariable String id) { |
| | | if (Objects.isNull(id)) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | List<Long> longs = Arrays.asList(TaskStsType.GENERATE_IN.id, TaskStsType.GENERATE_OUT.id); |
| | | List<Task> tasks = taskService.list(new LambdaQueryWrapper<Task>().eq(Task::getId, id).in(Task::getTaskStatus, longs)); |
| | | if (tasks.isEmpty()) { |
| | | throw new CoolException("任务已处执行状态不可一键置顶!!"); |
| | | } |
| | | try { |
| | | if (!taskService.update(new LambdaUpdateWrapper<Task>().set(Task::getSort, 100).eq(Task::getId, id))) { |
| | | throw new CoolException("置顶失败!!"); |
| | | } |
| | | } catch (Exception ex) { |
| | | return R.error("任务异常,无法完成!!"); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | |
| | | * 物料标识 |
| | | */ |
| | | @ApiModelProperty(value= "物料标识") |
| | | private String matnrId; |
| | | private Long matnrId; |
| | | |
| | | /** |
| | | * 物料编码 |
| | |
| | | |
| | | public AsnOrderItem() {} |
| | | |
| | | public AsnOrderItem(Long asnId,String asnCode,Long poDetlId, String matnrCode, String poCode,String matnrId,String matnk,Double anfme,String stockUnit,Double purQty,String purUnit,Double qty,String splrCode,String splrName,String qrcode,String barcode,String packName,Integer status, Integer ntyStatus,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | public AsnOrderItem(Long asnId,String asnCode,Long poDetlId, String matnrCode, String poCode,Long matnrId,String matnk,Double anfme,String stockUnit,Double purQty,String purUnit,Double qty,String splrCode,String splrName,String qrcode,String barcode,String packName,Integer status, Integer ntyStatus,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) { |
| | | this.asnId = asnId; |
| | | this.asnCode = asnCode; |
| | | this.poDetlId = poDetlId; |
| | |
| | | * 物料编码 |
| | | */ |
| | | @ApiModelProperty(value= "物料编码") |
| | | private String code; |
| | | private String matnrCode; |
| | | |
| | | |
| | | @ApiModelProperty(value = "通知单明细标识") |
| | |
| | | * 名称 |
| | | */ |
| | | @ApiModelProperty(value= "名称") |
| | | private String matnrk; |
| | | private String maktx; |
| | | |
| | | /** |
| | | * 数量 |
| | |
| | | this.stockId = stockId; |
| | | this.matnrId = matnrId; |
| | | this.asnItemId = asnItemId; |
| | | this.code = code; |
| | | this.matnrk = matnrk; |
| | | this.matnrCode = code; |
| | | this.maktx = matnrk; |
| | | this.anfme = anfme; |
| | | this.workQty = workQty; |
| | | this.qty = qty; |
| | |
| | | .setPurUnit(item.getUnit()) |
| | | .setMatnrCode(matnr.getCode()) |
| | | .setMaktx(matnr.getName()) |
| | | .setMatnrId(matnr.getId() + ""); |
| | | .setMatnrId(matnr.getId()); |
| | | orderItems.add(orderItem); |
| | | }); |
| | | if (!asnOrderItemService.saveBatch(orderItems)) { |
| | |
| | | Stock stock = new Stock(); |
| | | if (!Objects.isNull(order.getPoCode()) && StringUtils.isNotBlank(order.getPoCode())) { |
| | | Purchase purchase = purchaseService.getOne(new LambdaQueryWrapper<Purchase>().eq(Purchase::getCode, order.getPoCode())); |
| | | stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | if (!Objects.isNull(purchase)) { |
| | | stock.setPlatOrderNo(purchase.getPlatCode()).setPlatToken(purchase.getPlatId()); |
| | | } |
| | | } |
| | | String ruleCode = SerialRuleUtils.generateRuleCode(SerialRuleCode.SYS_STOCK_CODE, null); |
| | | if (StringUtils.isBlank(ruleCode)) { |
| | |
| | | .setUnit(item.getStockUnit()) |
| | | .setFieldsIndex(item.getFieldsIndex()) |
| | | .setUnit(item.getStockUnit()) |
| | | .setMatnrId(StringUtils.isNotBlank(item.getMatnrId()) ? Long.parseLong(item.getMatnrId()) : null) |
| | | .setMatnrId(item.getMatnrId()) |
| | | .setMaktx(item.getMaktx()) |
| | | .setMatnrCode(item.getMatnrCode()); |
| | | for (PakinItem waitPakinItem : waitPakin.getItems()) { |