|  |  |  | 
|---|
|  |  |  | orderDetl.sync(mat); | 
|---|
|  |  |  | orderDetl.setBatch(matParam.getBatch()); | 
|---|
|  |  |  | orderDetl.setAnfme(matParam.getAnfme()); | 
|---|
|  |  |  | orderDetl.setUnit(matParam.getUnit()); | 
|---|
|  |  |  | orderDetl.setThreeCode(matParam.getWarehouse());//仓库号 | 
|---|
|  |  |  | orderDetl.setSupp(matParam.getOrigin());//来源单号 | 
|---|
|  |  |  | orderDetl.setSuppCode(matParam.getOriginNo());//来源序号 | 
|---|
|  |  |  | orderDetl.setOrderId(order.getId()); | 
|---|
|  |  |  | orderDetl.setOrderNo(order.getOrderNo()); | 
|---|
|  |  |  | orderDetl.setCreateBy(9527L); | 
|---|
|  |  |  | 
|---|
|  |  |  | mat.setMatnr(matParam.getMatnr());//物料号 | 
|---|
|  |  |  | mat.setHostId(hostId);//仓库ID | 
|---|
|  |  |  | mat.setTagId(tag.getId());//分类ID | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getShopCategory())) { | 
|---|
|  |  |  | Tag shopTag = tagService.getOne(new LambdaQueryWrapper<Tag>() | 
|---|
|  |  |  | .eq(Tag::getName, matParam.getShopCategory()) | 
|---|
|  |  |  | .eq(Tag::getHostId, hostId)); | 
|---|
|  |  |  | if (shopTag == null) { | 
|---|
|  |  |  | //商品分类为空,创建商品分类 | 
|---|
|  |  |  | shopTag = new Tag(); | 
|---|
|  |  |  | shopTag.setName(matParam.getShopCategory()); | 
|---|
|  |  |  | shopTag.setParentId(tag.getId()); | 
|---|
|  |  |  | shopTag.setStatus(1); | 
|---|
|  |  |  | shopTag.setHostId(hostId); | 
|---|
|  |  |  | shopTag.setCreateTime(new Date()); | 
|---|
|  |  |  | shopTag.setUpdateTime(new Date()); | 
|---|
|  |  |  | tagService.save(shopTag); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | mat.setTagId(shopTag.getId());//分类ID | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getMaktx())) { | 
|---|
|  |  |  | mat.setMaktx(matParam.getMaktx()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | mat.setUnits(matParam.getUnits()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getLength())) { | 
|---|
|  |  |  | mat.setLength(Double.parseDouble(matParam.getLength())); | 
|---|
|  |  |  | mat.setLength(matParam.getLength()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getWidth())) { | 
|---|
|  |  |  | mat.setWidth(matParam.getWidth()); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getHeight())) { | 
|---|
|  |  |  | mat.setHeight(matParam.getHeight()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getAccountingClass())) { | 
|---|
|  |  |  | mat.setAccountingClass(matParam.getAccountingClass()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getBatch())) { | 
|---|
|  |  |  | mat.setBatch(matParam.getBatch()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (!Cools.isEmpty(matParam.getInventoryAccount())) { | 
|---|
|  |  |  | mat.setInventoryAccount(matParam.getInventoryAccount()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (matService.save(mat)) { | 
|---|
|  |  |  | count++; | 
|---|