| | |
| | | import zy.cloud.wms.manager.entity.Cstmr; |
| | | import zy.cloud.wms.manager.entity.CustOrder; |
| | | import zy.cloud.wms.manager.entity.Mat; |
| | | import zy.cloud.wms.manager.entity.Tag; |
| | | import zy.cloud.wms.manager.mapper.TagMapper; |
| | | import zy.cloud.wms.manager.service.*; |
| | | import zy.cloud.wms.manager.utils.HttpHandler; |
| | | import zy.cloud.wms.manager.utils.NodeUtils; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | |
| | | .build() |
| | | .doPost(); |
| | | if (!Cools.isEmpty(response)) { |
| | | log.info(response); |
| | | Date now = new Date(); |
| | | Result result = JSON.parseObject(response, Result.class); |
| | | if (result.getCode() != 1) { |
| | | return; |
| | | } |
| | | List<GetBasisResult> list = JSON.parseArray(result.getData(), GetBasisResult.class); |
| | | Tag first = null; |
| | | for (GetBasisResult data : list) { |
| | | Mat mat = matService.selectByMatnr(data.getUserCode()); |
| | | String modifyDate = data.getModifyDate(); |
| | | Date updateTime = null; |
| | | if (!Cools.isEmpty(modifyDate)) { |
| | | updateTime = DateUtils.convert(data.getModifyDate()); |
| | | } |
| | | |
| | | // 分类 |
| | | Tag second = tagService.selectOne(new EntityWrapper<Tag>().eq("name", data.getYjfl()).eq("level", 2)); |
| | | if (second == null) { |
| | | if (first == null) { |
| | | first = tagService.selectOne(new EntityWrapper<Tag>().eq("level", 1)); |
| | | if (first == null) { |
| | | throw new CoolException("全部分类出错"); |
| | | } |
| | | } |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(first.getId()); |
| | | second = new Tag( |
| | | null, // 编号 |
| | | data.getYjfl(), // 名称 |
| | | first.getId(), // 父级 |
| | | first.getName(), // 父级名称 |
| | | nodeUtils.path.toString(), // 关联路径 |
| | | nodeUtils.pathName.toString(), // 关联路径名 |
| | | 0, // 类型 |
| | | null, // 负责人 |
| | | null, // 图片 |
| | | null, // 简要描述 |
| | | null, // 数量 |
| | | 2, // 等级 |
| | | null, // 排序 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | null, // 添加人员 |
| | | now, // 修改时间 |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(second) == 0) { |
| | | throw new CoolException("插入分类失败"); |
| | | } |
| | | } |
| | | |
| | | Tag third = tagService.selectOne(new EntityWrapper<Tag>().eq("level", 3).eq("name", data.getEjfl()).eq("parent_name", data.getYjfl())); |
| | | if (third == null) { |
| | | NodeUtils nodeUtils = new NodeUtils(); |
| | | nodeUtils.executePath(second.getId()); |
| | | third = new Tag( |
| | | null, // 编号 |
| | | data.getEjfl(), // 名称 |
| | | second.getId(), // 父级 |
| | | second.getName(), // 父级名称 |
| | | nodeUtils.path.toString(), // 关联路径 |
| | | nodeUtils.pathName.toString(), // 关联路径名 |
| | | 0, // 类型 |
| | | null, // 负责人 |
| | | null, // 图片 |
| | | null, // 简要描述 |
| | | null, // 数量 |
| | | 3, // 等级 |
| | | null, // 排序 |
| | | 1, // 状态 |
| | | now, // 添加时间 |
| | | null, // 添加人员 |
| | | now, // 修改时间 |
| | | null, // 修改人员 |
| | | null // 备注 |
| | | ); |
| | | if (tagMapper.insert(third) == 0) { |
| | | throw new CoolException("插入分类失败"); |
| | | } |
| | | } |
| | | |
| | | if (null == mat) { |
| | | mat = new Mat( |
| | | String.valueOf(data.getRec()), // 编号 |
| | | null, // 所属区域 |
| | | third.getId(), // 所属归类 |
| | | data.getUserCode(), // 商品编号 |
| | | data.getFullName(), // 商品名称 |
| | | null, // 名称 |
| | | data.getStandard(), // 规格 |
| | | null, // 型号 |
| | | null, // 批号 |
| | | data.getUnit3(), // 单位 |
| | | data.getBarcode(), // 条码 |
| | | null, // 单据类型 |
| | | null, // 单据编号 |
| | | null, // 客户名称 |
| | | null, // 品项数 |
| | | null, // 库存余量 |
| | | null, // 重量 |
| | | 1, // |
| | | null, // 添加人员 |
| | | now, // 添加时间 |
| | | null, // 修改人员 |
| | | updateTime, // 修改时间 |
| | | null // 备注 |
| | | ); |
| | | matService.insert(mat); |
| | | } else { |
| | | mat.setUuid(String.valueOf(data.getRec())); |
| | | mat.setMatnr(data.getUserCode()); |
| | | mat.setMaktx(data.getFullName()); |
| | | mat.setSpecs(data.getStandard()); |
| | | mat.setUpdateTime(updateTime); |
| | | mat.setBarcode(data.getBarcode()); |
| | | mat.setUnit(data.getUnit3()); |
| | | matService.updateById(mat); |
| | | } |
| | | log.info("====>> 更新物料:{}", data.getUserCode()); |
| | | } |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | |
| | | <div class="layui-col-sm6" style="padding-bottom: 0;"> |
| | | <div class="layui-row layui-col-space15"> |
| | | <div class="layui-col-xs6 layui-col-sm3"> |
| | | <a class="console-app-group" lay-href="mat/mat.html?resourceId=20414" lay-text="产品资料管理"> |
| | | <a class="console-app-group" lay-href="mat/mat.html?resourceId=20414" lay-text="商品资料管理"> |
| | | <i class="console-app-icon layui-icon layui-icon-cart" style="color: #ff9c6e;"></i> |
| | | <div class="console-app-name">商品</div> |
| | | </a> |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <title></title> |
| | | <meta name="renderer" content="webkit"> |
| | | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> |
| | | <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/cool.css" media="all"> |
| | | <link rel="stylesheet" href="../../static/css/common.css" media="all"> |
| | | <style> |
| | | html { |
| | | height: 100%; |
| | | padding: 10px; |
| | | background-color: #f1f1f1; |
| | | } |
| | | body { |
| | | background-color: #fff; |
| | | border-radius: 5px; |
| | | box-shadow: 0 0 3px rgba(0,0,0,.3); |
| | | } |
| | | |
| | | .function-area { |
| | | padding: 20px 50px; |
| | | } |
| | | .function-btn { |
| | | font-size: 16px; |
| | | padding: 1px 1px 1px 1px; |
| | | width: 100px; |
| | | height: 50px; |
| | | border-color: #2b425b; |
| | | border-radius: 4px; |
| | | border-width: 2px; |
| | | background: none; |
| | | border-style: solid; |
| | | transition: 0.4s; |
| | | cursor: pointer; |
| | | letter-spacing: 3px; |
| | | } |
| | | .function-btn:hover { |
| | | background-color: #2b425b; |
| | | color: #fff; |
| | | } |
| | | |
| | | .layui-layer-page .layui-layer-content { |
| | | position: relative; |
| | | overflow: visible !important; |
| | | } |
| | | |
| | | #mat-query { |
| | | display: none; |
| | | } |
| | | |
| | | #staNoSpan { |
| | | text-align: center; |
| | | display: inline-block; |
| | | width: 100px; |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-form-select { |
| | | display: inline-block; |
| | | width: 150px; |
| | | height: 30px; |
| | | } |
| | | .layui-btn-container .layui-form-select.layui-form-selected { |
| | | display: inline-block; |
| | | width: 150px; |
| | | } |
| | | .layui-btn-container .layui-select-title input { |
| | | font-size: 13px; |
| | | } |
| | | .layui-btn-container .layui-anim.layui-anim-upbit dd { |
| | | font-size: 13px; |
| | | } |
| | | |
| | | #btn-comb { |
| | | margin-left: 60px; |
| | | display: none; |
| | | } |
| | | </style> |
| | | </head> |
| | | <body> |
| | | <!-- 功能区 --> |
| | | <div class="function-area"> |
| | | <button id="mat-query" class="function-btn" onclick="getMat()">新增</button> |
| | | </div> |
| | | |
| | | <hr> |
| | | |
| | | <!-- 表格 --> |
| | | <div style="padding-bottom: 5px; margin-bottom: 45px"> |
| | | |
| | | <!-- 头部 --> |
| | | <script type="text/html" id="toolbar"> |
| | | <div class="layui-form"> |
| | | <div class="layui-btn-container"> |
| | | <!-- 1.选择入库口 --> |
| | | <span id="staNoSpan">入库口:</span> |
| | | <select id="putSiteSelect" lay-verify="required"> |
| | | <option value="">请选择站点</option> |
| | | </select> |
| | | <!-- 2.启动出库 --> |
| | | <button class="layui-btn layui-btn-normal layui-btn-lg" id="btn-comb" lay-event="comb" style="">启动入库</button> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <!-- 行 --> |
| | | <script type="text/html" id="operate"> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="remove">移除</a> |
| | | </script> |
| | | |
| | | <table class="layui-table" id="chooseData" lay-filter="chooseData"></table> |
| | | </div> |
| | | |
| | | <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script> |
| | | <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script> |
| | | <script type="text/javascript" src="../../static/js/handlebars/handlebars-v4.5.3.js"></script> |
| | | <script type="text/javascript" src="../../static/js/pakStore/pakStore.js" charset="utf-8"></script> |
| | | |
| | | <script type="text/template" id="putSiteSelectTemplate"> |
| | | {{#each data}} |
| | | <option value="{{this}}">{{this}}</option> |
| | | {{/each}} |
| | | </script> |
| | | </body> |
| | | </html> |
| | | |