| | |
| | | |
| | | private String pro_komcode; |
| | | |
| | | |
| | | private String pro_id; |
| | | } |
| | | |
| | |
| | | @ApiModelProperty("上报订单列表") |
| | | List<ReportOrderParams> details; |
| | | |
| | | @ApiModelProperty("订单明细") |
| | | private List<OrderItemsParam> partList; |
| | | } |
| | |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.*; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.Mat; |
| | | import com.zy.asrs.entity.MatPrint; |
| | | import com.zy.asrs.entity.OrderDetl; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.BatchMatsUpdateParam; |
| | | import com.zy.asrs.entity.param.EmptyPlateOutParam; |
| | | import com.zy.asrs.entity.result.KeyValueVo; |
| | | import com.zy.asrs.service.MatService; |
| | | import com.zy.asrs.service.TaskDetlService; |
| | | import com.zy.asrs.service.TaskService; |
| | | import com.zy.asrs.service.impl.TaskDetlServiceImpl; |
| | | import com.zy.asrs.service.impl.WaitPakinServiceImpl; |
| | | import com.zy.asrs.service.impl.WrkDetlServiceImpl; |
| | | import com.zy.asrs.utils.MatExcelListener; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | private MatService matService; |
| | | @Autowired |
| | | private SnowflakeIdWorker snowflakeIdWorker; |
| | | @Autowired |
| | | private WaitPakinServiceImpl waitPakinService; |
| | | @Autowired |
| | | private WrkDetlServiceImpl wrkDetlService; |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | | |
| | | @RequestMapping(value = "/mat/auto/matnr/auth") |
| | | public R autoMatnr() { |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("mat/batch/auth") |
| | | @ManagerAuth |
| | | @PostMapping("mat/batch/auth") |
| | | public R batchUpdate(@RequestBody BatchMatsUpdateParam params) { |
| | | |
| | | return matService.batchInfo(params); |
| | | return matService.batchInfo(params); |
| | | } |
| | | |
| | | @RequestMapping(value = "/mat/delete/auth") |
| | | @ManagerAuth |
| | | @RequestMapping(value = "/mat/delete/auth") |
| | | public R delete(@RequestParam String param) { |
| | | List<Mat> list = JSONArray.parseArray(param, Mat.class); |
| | | if (Cools.isEmpty(list)) { |
| | | return R.error(); |
| | | } |
| | | for (Mat entity : list) { |
| | | int pakinCount = waitPakinService.selectCount(new EntityWrapper<WaitPakin>() |
| | | .eq("supp_code", entity.getSuppCode()) |
| | | .eq("matnr", entity.getMatnr())); |
| | | |
| | | int wrkCount = wrkDetlService.selectCount(new EntityWrapper<WrkDetl>() |
| | | .eq("supp_code", entity.getSuppCode()) |
| | | .eq("matnr", entity.getMatnr())); |
| | | |
| | | int taskCount = taskDetlService.selectCount(new EntityWrapper<TaskDetl>() |
| | | .eq("supp_code", entity.getSuppCode()) |
| | | .eq("matnr", entity.getMatnr())); |
| | | |
| | | if (pakinCount > 0 || wrkCount > 0 || taskCount > 0) { |
| | | throw new CoolException(entity.getMatnr() + "在作业清单中,无法执行删除操作!!"); |
| | | } |
| | | if (!matService.delete(new EntityWrapper<>(entity))) { |
| | | throw new CoolException("删除失败,请联系管理员"); |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value= "所属归类") |
| | | @TableField("tag_id") |
| | | // @ExcelProperty(value = "商品类型") |
| | | private Long tagId; |
| | | |
| | | /** |
| | |
| | | * 别名 |
| | | */ |
| | | @ApiModelProperty(value= "别名") |
| | | @ExcelProperty(value = "别名") |
| | | // @ExcelProperty(value = "别名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 规格 |
| | | */ |
| | | @ApiModelProperty(value= "规格") |
| | | @ExcelProperty(value = "规格") |
| | | @ExcelProperty(value = "尺寸") |
| | | private String specs; |
| | | |
| | | /** |
| | | * 型号 |
| | | */ |
| | | @ApiModelProperty(value= "型号") |
| | | @ExcelProperty(value = "型号") |
| | | // @ExcelProperty(value = "型号") |
| | | private String model; |
| | | |
| | | /** |
| | | * 颜色 |
| | | */ |
| | | @ApiModelProperty(value= "颜色") |
| | | @ExcelProperty(value = "颜色") |
| | | // @ExcelProperty(value = "颜色") |
| | | private String color; |
| | | |
| | | /** |
| | | * 品牌 |
| | | */ |
| | | @ApiModelProperty(value= "品牌") |
| | | @ExcelProperty(value = "品牌") |
| | | // @ExcelProperty(value = "品牌") |
| | | private String brand; |
| | | |
| | | /** |
| | |
| | | * 单价 |
| | | */ |
| | | @ApiModelProperty(value= "单价") |
| | | @ExcelProperty(value = "单价") |
| | | // @ExcelProperty(value = "单价") |
| | | private Double price; |
| | | |
| | | /** |
| | | * sku |
| | | */ |
| | | @ApiModelProperty(value= "sku") |
| | | @ExcelProperty(value = "sku") |
| | | // @ExcelProperty(value = "sku") |
| | | private String sku; |
| | | |
| | | /** |
| | | * 单位量 |
| | | */ |
| | | @ApiModelProperty(value= "单位量") |
| | | @ExcelProperty(value = "单位量") |
| | | // @ExcelProperty(value = "单位量") |
| | | private Double units; |
| | | |
| | | /** |
| | | * 条码 |
| | | */ |
| | | @ApiModelProperty(value= "条码") |
| | | @ExcelProperty(value = "条码") |
| | | // @ExcelProperty(value = "条码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 产地 |
| | | */ |
| | | @ApiModelProperty(value= "产地") |
| | | @ExcelProperty(value = "产地") |
| | | // @ExcelProperty(value = "产地") |
| | | private String origin; |
| | | |
| | | /** |
| | | * 厂家 |
| | | */ |
| | | @ApiModelProperty(value= "厂家") |
| | | @ExcelProperty(value = "厂家") |
| | | @ExcelProperty(value = "公司") |
| | | private String manu; |
| | | |
| | | /** |
| | |
| | | * 品项数/最大组托数量 |
| | | */ |
| | | @ApiModelProperty(value= "品项数") |
| | | @ExcelProperty(value = "品项数") |
| | | // @ExcelProperty(value = "品项数") |
| | | @TableField("item_num") |
| | | private String itemNum; |
| | | |
| | |
| | | * 安全库存量 |
| | | */ |
| | | @ApiModelProperty(value= "安全库存量") |
| | | @ExcelProperty(value = "安全库存量") |
| | | // @ExcelProperty(value = "安全库存量") |
| | | @TableField("safe_qty") |
| | | private Double safeQty; |
| | | |
| | |
| | | * 体积 |
| | | */ |
| | | @ApiModelProperty(value= "体积") |
| | | @ExcelProperty(value = "体积") |
| | | // @ExcelProperty(value = "体积") |
| | | private Double volume; |
| | | |
| | | /** |
| | | * 三方编码 |
| | | */ |
| | | @ApiModelProperty(value= "三方编码") |
| | | @ExcelProperty(value = "三方编码") |
| | | @ExcelProperty(value = "BS Code") |
| | | @TableField("three_code") |
| | | private String threeCode; |
| | | |
| | |
| | | * 供应商 |
| | | */ |
| | | @ApiModelProperty(value= "供应商") |
| | | @ExcelProperty(value = "供应商") |
| | | // @ExcelProperty(value = "供应商") |
| | | private String supp; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "保质期") |
| | | @TableField("dead_time") |
| | | @ExcelProperty(value = "保质期") |
| | | // @ExcelProperty(value = "保质期") |
| | | private String deadTime; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiModelProperty(value= "预警天数") |
| | | @TableField("dead_warn") |
| | | @ExcelProperty(value = "预警天数") |
| | | // @ExcelProperty(value = "预警天数") |
| | | private Integer deadWarn; |
| | | |
| | | /** |
| | |
| | | |
| | | @ApiModelProperty("库位类型") |
| | | @TableField("loc_type") |
| | | @ExcelProperty(value = "库位类型") |
| | | // @ExcelProperty(value = "库位类型") |
| | | private Long locType; |
| | | |
| | | /** |
| | |
| | | ReportOrderParam orderParam = new ReportOrderParam(); |
| | | orderParam.setCompany_id(order.getCstmrName()) |
| | | .setWms_id(order.getId() + "") |
| | | // .setOrder_no(order.getOrderNo()) |
| | | .setDispatch_no(order.getOrderNo()) |
| | | .setType(order.getDocType() + "") |
| | | .setInv_no(order.getNumber()) |
| | |
| | | ReportOrderParam orderParam = new ReportOrderParam(); |
| | | orderParam.setCompany_id(order.getCstmrName()) |
| | | .setWms_id(order.getId() + "") |
| | | .setOrder_no(order.getOrderNo()) |
| | | .setDispatch_no(order.getOrderNo()) |
| | | .setType(order.getDocType() + "") |
| | | .setInv_no(order.getNumber()) |
| | | .setPm_tktid(order.getItemName()) |
| | | .setUpdate_time(Utils.dateToStr(new Date(), "yyyy-MM-dd HH:mm:ss")) |
| | | //目标库区 |
| | | .setTarget_location("") |
| | | .setTarget_location("1"); |
| | | |
| | | List<ReportOrderParams> reportOrderParams = new ArrayList<>(); |
| | | List<OrderItemsParam> reportOrderParams = new ArrayList<>(); |
| | | orderDetls.forEach(detl -> { |
| | | Mat material = matService.selectByMatnr(detl.getMatnr()); |
| | | if (Objects.isNull(material)) { |
| | | throw new CoolException("物料不存在"); |
| | | } |
| | | ReportOrderParams itemParam = new ReportOrderParams(); |
| | | OrderItemsParam itemParam = new OrderItemsParam(); |
| | | // BS Code |
| | | itemParam.setTotal_serial(detl.getThreeCode()) |
| | | itemParam |
| | | // 上报时,默认产品类型是null |
| | | .setPro_type(material.getProType()) |
| | | // 上报时,默认产品编码 |
| | | .setPro_komcode(detl.getMatnr()) |
| | | // 上报时,默认产品id是供应商编码 |
| | | .setPro_id(detl.getSuppCode()) |
| | | // 上报时,默认来源位置是null |
| | | // // 上报时,默认来源位置是null |
| | | .setLocation_no(null) |
| | | // 上报时,默认目标位置是null |
| | | .setLocation_type(null) |
| | | // 上报时,默认上报时间是更新时间 |
| | | .setSj_date(order.getUpdateTime$()) |
| | | // 上报时,默认上报人是更新人 |
| | | .setSj_emp(order.getUpdateBy$()) |
| | | // 上报时,默认上报数量是订单数量 |
| | | .setPick_qty(detl.getQty().intValue()) |
| | | // 上报时,默认损坏数量是0 |
| | | .setDamage_qty(0) |
| | | // 上报时,默认差异数量是0 |
| | | .setDiff_qty(0); |
| | | |
| | | .setPick_qty(detl.getQty().intValue()); |
| | | reportOrderParams.add(itemParam); |
| | | }); |
| | | |
| | | orderParam.setDetails(reportOrderParams); |
| | | orderParam.setPartList(reportOrderParams); |
| | | |
| | | XSR response = null; |
| | | boolean success = false; |
| | |
| | | JSON.toJSONString(orderParams), JSON.toJSONString(response)); |
| | | throw new CoolException("上报KOPEN系统失败"); |
| | | } |
| | | // if (true) { |
| | | // success = true; |
| | | // // 修改订单状态 4.完成 ===>> 6.已上报 |
| | | // if (!orderService.updateSettle(order.getId(), settle, null)) { |
| | | // throw new CoolException("服务器内部错误,请联系管理员"); |
| | | // } |
| | | // } else { |
| | | // log.error("请求接口失败!!!url:{};request:{};response:{}", |
| | | // MesConstant.URL + MesConstant.OUT_DISPATCH_RESULT, |
| | | // JSON.toJSONString(orderParam), JSON.toJSONString(response)); |
| | | // throw new CoolException("上报KOPEN系统失败"); |
| | | // } |
| | | } catch (Exception e) { |
| | | log.error("fail", e); |
| | | return FAIL.setMsg(e.getMessage()); |
| | |
| | | Long tagId; |
| | | // 分类 |
| | | // 一级分类 |
| | | if (!Cools.isEmpty(excel.getPriClass()) && !Cools.isEmpty(excel.getSecClass())) { |
| | | if (!Cools.isEmpty(excel.getPriClass())) { |
| | | Tag priTag = tagService.selectByName(excel.getPriClass(), 2); |
| | | if (priTag == null) { |
| | | Tag top = tagService.getTop(); |
| | |
| | | throw new CoolException("保存一级分类失败"); |
| | | } |
| | | } |
| | | // 二级分类 |
| | | Tag secTag = tagService.selectByName(excel.getSecClass(), 3); |
| | | if (secTag == null) { |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(priTag.getId()); |
| | | secTag = new Tag( |
| | | null, // 编号 |
| | | excel.getSecClass(), // 名称 |
| | | priTag.getId(), // 父级 |
| | | priTag.getName(), // 父级名称 |
| | | nodeUtils.path.toString(), // 关联路径 |
| | | nodeUtils.pathName.toString(), // 关联路径名 |
| | | 0, // 类型 |
| | | null, // 负责人 |
| | | null, // 图片 |
| | | null, // 简要描述 |
| | | null, // 数量 |
| | | 3, // 等级 |
| | | null, // 排序 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | null, // 添加人员 |
| | | now, // 修改时间 |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(secTag) == 0) { |
| | | throw new CoolException("保存二级分类失败"); |
| | | } |
| | | } |
| | | tagId = secTag.getId(); |
| | | } else { |
| | | // // 二级分类 |
| | | // Tag secTag = tagService.selectByName(excel.getSecClass(), 3); |
| | | // if (secTag == null) { |
| | | // NodeUtils nodeUtils = new NodeUtils(); |
| | | // nodeUtils.executePath(priTag.getId()); |
| | | // secTag = new Tag( |
| | | // null, // 编号 |
| | | // excel.getSecClass(), // 名称 |
| | | // priTag.getId(), // 父级 |
| | | // priTag.getName(), // 父级名称 |
| | | // nodeUtils.path.toString(), // 关联路径 |
| | | // nodeUtils.pathName.toString(), // 关联路径名 |
| | | // 0, // 类型 |
| | | // null, // 负责人 |
| | | // null, // 图片 |
| | | // null, // 简要描述 |
| | | // null, // 数量 |
| | | // 3, // 等级 |
| | | // null, // 排序 |
| | | // 1, // 状态 |
| | | // now, // 添加时间 |
| | | // null, // 添加人员 |
| | | // now, // 修改时间 |
| | | // null, // 修改人员 |
| | | // null // 备注 |
| | | // ); |
| | | // if (tagMapper.insert(secTag) == 0) { |
| | | // throw new CoolException("保存二级分类失败"); |
| | | // } |
| | | // } |
| | | tagId = priTag.getId(); |
| | | } |
| | | |
| | | else { |
| | | tagId = tagService.getTop().getId(); |
| | | } |
| | | // 商品 |
| | |
| | | @ExcelIgnoreUnannotated |
| | | public class MatExcel extends Mat { |
| | | |
| | | @ExcelProperty(index = 0, value = "一级分类") |
| | | @ExcelProperty(index = 0, value = "商品分类") |
| | | private String priClass; |
| | | |
| | | @ExcelProperty(index = 1, value = "二级分类") |
| | | private String secClass; |
| | | // @ExcelProperty(index = 1, value = "二级分类") |
| | | // private String secClass; |
| | | |
| | | } |
| | |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | username: sa |
| | | password: sa@123 |
| | | url: jdbc:sqlserver://172.24.103.147:1433;databasename=jsxsasrs |
| | | url: jdbc:sqlserver://47.97.1.152:1433;databasename=jsxsasrs |
| | | mvc: |
| | | static-path-pattern: /** |
| | | redis: |
| | |
| | | ,{field: 'color', align: 'center',title: '颜色', hide: true} |
| | | ,{field: 'brand', align: 'center',title: '品牌', hide: true} |
| | | ,{field: 'upQty', align: 'center',title: '组托上限'} |
| | | ,{field: 'manu', 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: 'barcode', align: 'center',title: '条码', hide: true} |
| | | ,{field: 'origin', align: 'center',title: '产地', hide: true} |
| | | ,{field: 'manu', 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} |
| | |
| | | // 回显表单数据 |
| | | form.val('detail', mData); |
| | | // 新增自动生成商品编号 |
| | | if (!mData) { |
| | | http.get(baseUrl + "/mat/auto/matnr/auth", null, function (res) { |
| | | $('#matnr').val(res.data); |
| | | }) |
| | | } |
| | | // if (!mData) { |
| | | // http.get(baseUrl + "/mat/auto/matnr/auth", null, function (res) { |
| | | // $('#matnr').val(res.data); |
| | | // }) |
| | | // } |
| | | // 表单提交事件 |
| | | form.on('submit(editSubmit)', function (data) { |
| | | data.field.tagId = insXmSel.getValue('valueStr'); |
| | |
| | | <div class="layui-row"> |
| | | <div class="layui-col-md6"> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">分类</label> |
| | | <label class="layui-form-label">零件类型</label> |
| | | <div class="layui-input-block"> |
| | | <div id="tagSel" class="ew-xmselect-tree"></div> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">配置</label> |
| | | <label class="layui-form-label">尺寸</label> |
| | | <div class="layui-input-block"> |
| | | <input name="specs" placeholder="请输入配置" class="layui-input"> |
| | | <input name="specs" placeholder="请输入尺寸" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱净重</label> |
| | | <div class="layui-input-block"> |
| | | <input name="weight" placeholder="请输入单箱净重格" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱体积</label> |
| | | <div class="layui-input-block"> |
| | | <input name="volume" placeholder="请输入单箱体积" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">尺寸</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="volume" placeholder="请输尺寸" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | <div class="layui-col-md6"> |
| | | <div class="layui-form-item"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">规格</label> |
| | | <label class="layui-form-label layui-form-required">供应商</label> |
| | | <div class="layui-input-block"> |
| | | <input name="specs" placeholder="请输入代码" class="layui-input"> |
| | | <input name="suppCode" placeholder="请输入供应商编码" class="layui-input" lay-verify="required"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">备注</label> |
| | | <label class="layui-form-label">公司信息</label> |
| | | <div class="layui-input-block"> |
| | | <input name="memo" placeholder="请输入备注" class="layui-input"> |
| | | <input name="manu" placeholder="请输入公司信息" class="layui-input" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱毛重</label> |
| | | <label class="layui-form-label">重量</label> |
| | | <div class="layui-input-block"> |
| | | <input name="manLength" placeholder="请输入单箱毛重" class="layui-input"> |
| | | <input name="weight" placeholder="请输入重量" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-form-item"> |
| | | <label class="layui-form-label">单箱体积</label> |
| | | <div class="layui-input-block"> |
| | | <input name="threeCode" placeholder="请输入箱子尺寸" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-form-item">--> |
| | | <!-- <label class="layui-form-label">单箱体积</label>--> |
| | | <!-- <div class="layui-input-block">--> |
| | | <!-- <input name="threeCode" placeholder="请输入箱子尺寸" class="layui-input">--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | </div> |
| | | </div> |
| | | <hr class="layui-bg-gray"> |