| | |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | | import com.zy.api.service.KopenApiService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | */ |
| | | @ApiOperation("上架派工单") |
| | | @PostMapping("/sendInDispatch") |
| | | public R receiveOrders(@RequestBody PubOrderParams params) { |
| | | public XSR receiveOrders(@RequestBody PubOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getType())) { |
| | | return R.error("单据类型不能为空!"); |
| | | return XSR.error("单据类型不能为空!"); |
| | | } |
| | | return kopenApiService.receiveOrders(params); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("零件信息数据更新") |
| | | @PostMapping("/sendPartsMaster") |
| | | public R basMatUpdate(@RequestBody List<SyncMatParmas> params) { |
| | | public XSR basMatUpdate(@RequestBody List<SyncMatParmas> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | return kopenApiService.basMatupdate(params); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("上架派工单反馈") |
| | | @PostMapping("/getInDispatchResult") |
| | | public R getInDispatchResult(@RequestBody ReportOrderParam params) { |
| | | public XSR getInDispatchResult(@RequestBody ReportOrderParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id()) && Objects.isNull(params.getInv_no()) && Objects.isNull(params.getDispatch_no())) { |
| | | return R.error("取消条件不能为空!!"); |
| | | return XSR.error("取消条件不能为空!!"); |
| | | } |
| | | return kopenApiService.getInDispatchResult(params); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("备货指示派工单下发") |
| | | @PostMapping("/sendOutDispatch") |
| | | public R sendStockPrepareDispatch(@RequestBody PubOrderParams params) { |
| | | public XSR sendStockPrepareDispatch(@RequestBody PubOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return R.error("上报订单列表不能为空!!"); |
| | | return XSR.error("上报订单列表不能为空!!"); |
| | | } |
| | | return kopenApiService.sendOutDispatch(params); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation("备货单下发") |
| | | @PostMapping("/getOutDetails") |
| | | public R getOutDetails(@RequestBody StockUpOrderParams params) { |
| | | public XSR getOutDetails(@RequestBody StockUpOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return R.error("上报订单列表不能为空!!"); |
| | | return XSR.error("上报订单列表不能为空!!"); |
| | | } |
| | | return kopenApiService.getOutDetails(params); |
| | | } |
| New file |
| | |
| | | package com.zy.api.entity.dto; |
| | | |
| | | import java.sql.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | @Data |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "BaseResponse", description = "基础响应") |
| | | public class XSR<T> { |
| | | private static final String SUCCESS_CODE = "200"; |
| | | private static final String FAIL_CODE = "500"; |
| | | |
| | | private String code; |
| | | |
| | | private String message; |
| | | |
| | | private Boolean success; |
| | | |
| | | private String returnMessage; |
| | | |
| | | private T data; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date timestamp; |
| | | |
| | | public XSR() { |
| | | this.timestamp = new Date(System.currentTimeMillis()); |
| | | } |
| | | |
| | | public static <T> XSR<T> ok() { |
| | | return new XSR<T>() |
| | | .setCode(SUCCESS_CODE) |
| | | .setSuccess(true) |
| | | .setMessage("操作成功") |
| | | .setReturnMessage("操作成功"); |
| | | } |
| | | |
| | | public static <T> XSR<T> ok(T data) { |
| | | return new XSR<T>() |
| | | .setCode(SUCCESS_CODE) |
| | | .setSuccess(true) |
| | | .setMessage("操作成功") |
| | | .setReturnMessage("操作成功") |
| | | .setData(data); |
| | | } |
| | | |
| | | public static <T> XSR<T> ok(T data, String message) { |
| | | return new XSR<T>() |
| | | .setCode(SUCCESS_CODE) |
| | | .setSuccess(true) |
| | | .setMessage(message) |
| | | .setReturnMessage(message) |
| | | .setData(data); |
| | | } |
| | | |
| | | public static <T> XSR<T> error(String message) { |
| | | return new XSR<T>() |
| | | .setCode(FAIL_CODE) |
| | | .setSuccess(false) |
| | | .setMessage(message) |
| | | .setReturnMessage(message); |
| | | } |
| | | |
| | | public static <T> XSR<T> error(String code, String message) { |
| | | return new XSR<T>() |
| | | .setCode(code) |
| | | .setSuccess(false) |
| | | .setMessage(message) |
| | | .setReturnMessage(message); |
| | | } |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.core.common.R; |
| | | import com.zy.api.entity.PubOrderParams; |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | | |
| | | public interface KopenApiService { |
| | | |
| | |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R receiveOrders(PubOrderParams params); |
| | | XSR receiveOrders(PubOrderParams params); |
| | | |
| | | /** |
| | | * 基础零件变更 |
| | |
| | | * @param matnrs |
| | | * @return com.core.common.R |
| | | */ |
| | | R basMatupdate(List<SyncMatParmas> matnrs); |
| | | XSR basMatupdate(List<SyncMatParmas> matnrs); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param params |
| | | * @return |
| | | */ |
| | | R getInDispatchResult(ReportOrderParam params); |
| | | XSR getInDispatchResult(ReportOrderParam params); |
| | | |
| | | /** |
| | | * 备货指示派工单下发 |
| | | * @param params |
| | | * @return |
| | | */ |
| | | R sendOutDispatch(PubOrderParams params); |
| | | XSR sendOutDispatch(PubOrderParams params); |
| | | |
| | | /** |
| | | * 备货单下发 |
| | |
| | | * @param params |
| | | * @return com.core.common.R |
| | | */ |
| | | R getOutDetails(StockUpOrderParams params); |
| | | XSR getOutDetails(StockUpOrderParams params); |
| | | } |
| | |
| | | import com.zy.api.entity.ReportOrderParam; |
| | | import com.zy.api.entity.StockUpOrderParams; |
| | | import com.zy.api.entity.SyncMatParmas; |
| | | import com.zy.api.entity.dto.XSR; |
| | | import com.zy.api.enums.MatLocType; |
| | | import com.zy.api.enums.OrderType; |
| | | import com.zy.api.enums.OrderWkType; |
| | |
| | | * @date 2025/11/24 14:49 |
| | | */ |
| | | @Override |
| | | public R receiveOrders(PubOrderParams params) { |
| | | public XSR receiveOrders(PubOrderParams params) { |
| | | if (params.getType().equals(OrderWkType.getTypeVal(params.getType()))) { |
| | | return R.error("当前类型不是上架派工单!!"); |
| | | return XSR.error("当前类型不是上架派工单!!"); |
| | | } |
| | | addOrUpdateOrders(params, "add"); |
| | | return R.ok("单据下发成功!!"); |
| | | return XSR.ok("单据下发成功!!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R getInDispatchResult(ReportOrderParam params) { |
| | | public XSR getInDispatchResult(ReportOrderParam params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | String response = null; |
| | | try { |
| | |
| | | .build() |
| | | .doPost(); |
| | | if (Objects.isNull(response) || response.trim().isEmpty()) { |
| | | return R.error("外网接口无响应!!"); |
| | | return XSR.error("外网接口无响应!!"); |
| | | } |
| | | JSONObject jsonObject = JSONObject.parseObject(response); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if (!Objects.isNull(code) && code.equals(1)) { |
| | | return R.ok("入库单上报完成!!"); |
| | | return XSR.ok("入库单上报完成!!"); |
| | | } else { |
| | | String msg = jsonObject.getString("message"); |
| | | return R.error(Objects.isNull(msg) ? "上报失败!!" : msg); |
| | | return XSR.error(Objects.isNull(msg) ? "上报失败!!" : msg); |
| | | } |
| | | } catch (Exception e) { |
| | | return R.error(e.getMessage()); |
| | | return XSR.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R sendOutDispatch(PubOrderParams params) { |
| | | public XSR sendOutDispatch(PubOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | // 校验参数 |
| | | if (Objects.isNull(params.getDispatch_no())) { |
| | | return R.error("派工单编号不能为空!!"); |
| | | return XSR.error("派工单编号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id())) { |
| | | return R.error("流水号不能为空!!"); |
| | | return XSR.error("流水号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getCompany_id())) { |
| | | return R.error("公司ID不能为空!!"); |
| | | return XSR.error("公司ID不能为空!!"); |
| | | } |
| | | |
| | | addOrUpdateOrders(params, "add"); |
| | | |
| | | return R.ok("备货指示派工单下发成功!!"); |
| | | return XSR.ok("备货指示派工单下发成功!!"); |
| | | } |
| | | |
| | | // /** |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public synchronized R basMatupdate(List<SyncMatParmas> params) { |
| | | public synchronized XSR basMatupdate(List<SyncMatParmas> params) { |
| | | if (Objects.isNull(params) || params.isEmpty()) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | params.forEach(mats -> { |
| | | if (Objects.isNull(mats)) { |
| | |
| | | } |
| | | }); |
| | | |
| | | return R.ok("保存成功!!"); |
| | | return XSR.ok("保存成功!!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @date 2025/11/24 15:40 |
| | | */ |
| | | @Override |
| | | public R getOutDetails(StockUpOrderParams params) { |
| | | public XSR getOutDetails(StockUpOrderParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | return XSR.error("参数不能为空!!"); |
| | | } |
| | | // 校验参数 |
| | | if (Objects.isNull(params.getDispatch_no())) { |
| | | return R.error("派工单编号不能为空!!"); |
| | | return XSR.error("派工单编号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getKopen_id())) { |
| | | return R.error("流水号不能为空!!"); |
| | | return XSR.error("流水号不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getCompany_id())) { |
| | | return R.error("公司ID不能为空!!"); |
| | | return XSR.error("公司ID不能为空!!"); |
| | | } |
| | | if (Objects.isNull(params.getDetails()) || params.getDetails().isEmpty()) { |
| | | return R.error("订单明细不能为空!!"); |
| | | return XSR.error("订单明细不能为空!!"); |
| | | } |
| | | |
| | | List<OrderItemsParam> items = new ArrayList<>(); |
| | |
| | | addOrUpdateOrders(pubOrderParams, "add"); |
| | | }); |
| | | |
| | | return R.ok("备货单下发成功!!"); |
| | | return XSR.ok("备货单下发成功!!"); |
| | | } |
| | | |
| | | } |
| | |
| | | // {field: 'id', align: 'center',title: 'ID'} |
| | | // ,{field: 'uuid', align: 'center',title: '编号'} |
| | | ,{field: 'maktx', align: 'center',title: '商品名称(品名)', width: 200} |
| | | ,{field: 'specs', align: 'center',title: '规格'} |
| | | ,{field: 'specs', align: 'center',title: '尺寸'} |
| | | ,{field: 'weight', align: 'center',title: '重量'} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码'} |
| | | ,{field: 'model', align: 'center',title: '代码', hide: true} |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'upQty', align: 'center',title: '组托上限'} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: false} |
| | | ,{field: 'unit', align: 'center',title: '单位', hide: true} |
| | | ,{field: 'price', align: 'center',title: '单价', hide: true} |
| | | ,{field: 'sku', align: 'center',title: 'sku', hide: true} |
| | | ,{field: 'units', align: 'center',title: '单位量', hide: true} |
| | |
| | | ,{field: 'manuDate', align: 'center',title: '生产日期', hide: true} |
| | | ,{field: 'itemNum', align: 'center',title: '品项数', hide: true} |
| | | ,{field: 'safeQty', align: 'center',title: '安全库存量', hide: true} |
| | | ,{field: 'weight', align: 'center',title: '单箱净重', hide: true} |
| | | ,{field: 'length', align: 'center',title: '单箱毛重', hide: true} |
| | | ,{field: 'volume', align: 'center',title: '单箱体积', hide: true} |
| | | ,{field: 'threeCode', align: 'center',title: '箱子尺寸', hide: true} |
| | | ,{field: 'supp', align: 'center',title: '供应商', hide: true} |
| | | ,{field: 'suppCode', align: 'center',title: '供应商编码', hide: true} |
| | | ,{field: 'beBatch$', align: 'center',title: '是否批次', hide: true} |
| | | ,{field: 'deadTime', align: 'center',title: '保质期', hide: true} |
| | | ,{field: 'deadWarn', align: 'center',title: '预警天数', hide: true} |
| | |
| | | function getCol() { |
| | | var cols = [ |
| | | {type: 'checkbox'} |
| | | , {field: 'tagId$', align: 'center', title: '归类', templet: '#tagTpl'} |
| | | , {field: 'locType$', align: 'center', title: '库位类型'} |
| | | , {field: 'tagId$', align: 'center', title: '归类', templet: '#tagTpl', width: 90} |
| | | , {field: 'locType$', align: 'center', title: '库位类型', width: 90} |
| | | // ,{field: 'store_max', align: 'center',title: '库存上限'} |
| | | // ,{field: 'store_min', align: 'center',title: '库存下限'} |
| | | // ,{field: 'store_max_date', align: 'center',title: '库龄上限(天)'} |
| | |
| | | <div class="layui-fluid"> |
| | | <!-- 左 --> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-md3"> |
| | | <div class="layui-col-md2"> |
| | | <div class="layui-card"> |
| | | <div class="layui-card-body" style="padding: 10px;"> |
| | | <!-- 树工具栏 --> |
| | | <div class="layui-form toolbar" id="organizationTreeBar"> |
| | | <div class="layui-inline" style="max-width: 200px;"> |
| | | <div class="layui-inline" style="max-width: 150px;"> |
| | | <input id="condition" onkeyup="findData(this)" type="text" class="layui-input" placeholder="请输入关键字" autocomplete="off"> |
| | | </div> |
| | | <div class="layui-inline"> |