|
|
@ -25,11 +25,511 @@ |
|
|
|
*********************************************************/ |
|
|
|
package com.yxt.wms.apiadmin.inventroy; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.yxt.common.core.result.ResultBean; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinitial.ReturnExcelInfo; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinitial.WmsInitial; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinitial.WmsInitialExcelInfo; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinitial.WmsInitialService; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinitialdetail.WmsInitialDetail; |
|
|
|
import com.yxt.wms.biz.inventory.wmsinitialdetail.WmsInitialDetailService; |
|
|
|
import com.yxt.wms.feign.base.basegoodspu.BaseGoodsSpuFeign; |
|
|
|
import com.yxt.wms.feign.base.basegoodssku.BaseGoodsSkuDetailsVo; |
|
|
|
import com.yxt.wms.feign.base.basegoodssku.BaseGoodsSkuFeign; |
|
|
|
import com.yxt.wms.feign.portal.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.wms.feign.portal.sysorganization.SysOrganizationVo; |
|
|
|
import com.yxt.wms.feign.portal.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.wms.feign.portal.sysuser.SysUserFeign; |
|
|
|
import com.yxt.wms.feign.portal.sysuser.SysUserVo; |
|
|
|
import com.yxt.wms.utils.Rule; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
|
|
|
import org.apache.poi.ss.usermodel.Cell; |
|
|
|
import org.apache.poi.ss.usermodel.Row; |
|
|
|
import org.apache.poi.ss.usermodel.Sheet; |
|
|
|
import org.apache.poi.ss.usermodel.Workbook; |
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.util.*; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
@Api(tags = "期初上架") |
|
|
|
@RestController |
|
|
|
@RequestMapping("v1/wmsinitial") |
|
|
|
public class WmsInitialRest { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BaseGoodsSpuFeign baseGoodsSpuFeign; |
|
|
|
@Autowired |
|
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
@Autowired |
|
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
@Autowired |
|
|
|
private WmsInitialService wmsInitialService; |
|
|
|
@Autowired |
|
|
|
private WmsInitialDetailService wmsInitialDetailService; |
|
|
|
@Resource |
|
|
|
private BaseGoodsSkuFeign baseGoodsSkuFeign; |
|
|
|
|
|
|
|
@PostMapping("/getExcelInfo") |
|
|
|
@ResponseBody |
|
|
|
@ApiOperation(value = "导入") |
|
|
|
public ResultBean getExcelInfo(@RequestParam(value = "fileName") String fileName, @RequestParam(value = "file") MultipartFile file, @RequestParam("userSid") String userSid, @RequestParam("orgPath") String orgPath) throws IOException, ParseException { |
|
|
|
String deptName = ""; |
|
|
|
String deptSid = ""; |
|
|
|
String useOrgSid = ""; |
|
|
|
WmsInitial wmsInitial = new WmsInitial(); |
|
|
|
List<String> split = Arrays.asList(orgPath.split("/")); |
|
|
|
if (split.size() > 1) { |
|
|
|
//获取本级sid获取本级部门信息
|
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(split.size() - 2)).getData(); |
|
|
|
SysOrganizationVo sysOrganization1 = sysOrganizationFeign.fetchBySid(split.get(split.size() - 1)).getData(); |
|
|
|
deptName = sysOrganization.getName() + "/" + sysOrganization1.getName(); |
|
|
|
deptName = sysOrganization1.getName(); |
|
|
|
deptSid = sysOrganization1.getSid(); |
|
|
|
} else { |
|
|
|
SysOrganizationVo sysOrganization = sysOrganizationFeign.fetchBySid(split.get(0)).getData(); |
|
|
|
deptName = sysOrganization.getName(); |
|
|
|
deptName = sysOrganization.getName(); |
|
|
|
deptSid = sysOrganization.getSid(); |
|
|
|
} |
|
|
|
wmsInitial.setDeptSid(deptSid); |
|
|
|
wmsInitial.setDeptName(deptName); |
|
|
|
useOrgSid = sysStaffOrgFeign.getOrgSidByPath(orgPath).getData(); |
|
|
|
//创建组织使用组织
|
|
|
|
ResultBean<SysOrganizationVo> organizationResultBean = sysOrganizationFeign.fetchBySid(useOrgSid); |
|
|
|
if (organizationResultBean.getData() != null) { |
|
|
|
wmsInitial.setUseOrgSid(useOrgSid); |
|
|
|
wmsInitial.setUseOrgName(organizationResultBean.getData().getName()); |
|
|
|
} |
|
|
|
SysUserVo userVo = sysUserFeign.fetchBySid(userSid).getData(); |
|
|
|
wmsInitial.setCreateBySid(userSid); |
|
|
|
wmsInitial.setCreateByName(userVo.getName()); |
|
|
|
wmsInitialService.save(wmsInitial); |
|
|
|
if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { |
|
|
|
return ResultBean.fireFail().setMsg("上传文件不正确"); |
|
|
|
} |
|
|
|
int[] resultCell = new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}; |
|
|
|
List<WmsInitialExcelInfo> resultList = new ArrayList<>(); |
|
|
|
boolean isExcel2003 = true; |
|
|
|
if (fileName.matches("^.+\\.(?i)(xlsx)$")) { |
|
|
|
isExcel2003 = false; |
|
|
|
} |
|
|
|
InputStream is = file.getInputStream(); |
|
|
|
Workbook wb = null; |
|
|
|
if (isExcel2003) { |
|
|
|
wb = new HSSFWorkbook(is); |
|
|
|
} else { |
|
|
|
wb = new XSSFWorkbook(is); |
|
|
|
} |
|
|
|
Sheet sheet = wb.getSheetAt(0); |
|
|
|
ReturnExcelInfo importReturn = getSheetVal(sheet, resultCell, deptSid); |
|
|
|
if (StringUtils.isNotBlank(importReturn.getCheckInfo())) { |
|
|
|
return ResultBean.fireFail().setMsg(importReturn.getCheckInfo()); |
|
|
|
} |
|
|
|
resultList = importReturn.getInfos(); |
|
|
|
System.out.println("结果是--->" + resultList); |
|
|
|
try { |
|
|
|
for (WmsInitialExcelInfo wmsInitialExcelInfo : resultList) { |
|
|
|
if ("是".equals(wmsInitialExcelInfo.getIsYwym())) { |
|
|
|
Integer num = Integer.parseInt(wmsInitialExcelInfo.getNum()); |
|
|
|
for (int i = 0; i < num; i++) { |
|
|
|
WmsInitialDetail wmsInitialDetail = new WmsInitialDetail(); |
|
|
|
BeanUtil.copyProperties(wmsInitialExcelInfo,wmsInitialDetail); |
|
|
|
wmsInitialDetail.setBillSid(wmsInitial.getSid()); |
|
|
|
wmsInitialDetail.setNum(new BigDecimal("1")); |
|
|
|
wmsInitialDetail.setIsYwym(1); |
|
|
|
wmsInitialDetailService.save(wmsInitialDetail); |
|
|
|
} |
|
|
|
}else { |
|
|
|
WmsInitialDetail wmsInitialDetail = new WmsInitialDetail(); |
|
|
|
BeanUtil.copyProperties(wmsInitialExcelInfo,wmsInitialDetail); |
|
|
|
wmsInitialDetail.setBillSid(wmsInitial.getSid()); |
|
|
|
wmsInitialDetail.setIsYwym(0); |
|
|
|
wmsInitialDetailService.save(wmsInitialDetail); |
|
|
|
} |
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg("数据导入成功"); |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
return ResultBean.fireFail().setMsg("数据导入失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private ReturnExcelInfo getSheetVal(Sheet sheet, int[] resultCell, String deptSid) { |
|
|
|
ReturnExcelInfo importReturn = new ReturnExcelInfo(); |
|
|
|
List<WmsInitialExcelInfo> importVoList = new ArrayList<>(); |
|
|
|
Set<String> checkWord = new HashSet<>(); |
|
|
|
for (int r = 1; r <= sheet.getLastRowNum(); r++) { |
|
|
|
Row row = sheet.getRow(r); |
|
|
|
if (row == null) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
WmsInitialExcelInfo importVo = new WmsInitialExcelInfo(); |
|
|
|
int physicalNumberOfCells = row.getPhysicalNumberOfCells(); |
|
|
|
if (physicalNumberOfCells < 10) { |
|
|
|
physicalNumberOfCells = 10; |
|
|
|
} |
|
|
|
for (int i = 0; i < physicalNumberOfCells; i++) { |
|
|
|
String trim = new String(); |
|
|
|
try { |
|
|
|
trim = getCellVal(row.getCell(i)).toString().trim(); |
|
|
|
if (StringUtils.isBlank(trim)) { |
|
|
|
NullPointerException nullPointerException = new NullPointerException(); |
|
|
|
} |
|
|
|
String temp = getCellVal(row.getCell(i)).toString().trim(); |
|
|
|
for (int j = 0; j < resultCell.length; j++) { |
|
|
|
if (i == resultCell[j]) { |
|
|
|
switch (i) { |
|
|
|
case 0: |
|
|
|
importVo.setGoodsSpuName(temp); |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
importVo.setGoodsSkuCode(temp); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
importVo.setGoodsSkuOwnSpec(temp); |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
importVo.setUnit(temp); |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
importVo.setNum(temp); |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
importVo.setBrandName(temp); |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
importVo.setManufacturerName(temp); |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
importVo.setSupplierName(temp); |
|
|
|
break; |
|
|
|
case 8: |
|
|
|
importVo.setSaleGuidePrice(temp); |
|
|
|
break; |
|
|
|
case 9: |
|
|
|
importVo.setInCost(temp); |
|
|
|
break; |
|
|
|
case 10: |
|
|
|
importVo.setTaxRate(temp); |
|
|
|
break; |
|
|
|
case 11: |
|
|
|
importVo.setFirstInDate(temp); |
|
|
|
break; |
|
|
|
case 12: |
|
|
|
importVo.setGoodsTypeName(temp); |
|
|
|
break; |
|
|
|
case 13: |
|
|
|
importVo.setIsYwym(temp); |
|
|
|
break; |
|
|
|
case 14: |
|
|
|
importVo.setGoodsSpuSid(temp); |
|
|
|
break; |
|
|
|
case 15: |
|
|
|
importVo.setGoodsSkuSid(temp); |
|
|
|
break; |
|
|
|
case 16: |
|
|
|
importVo.setBrandSid(temp); |
|
|
|
break; |
|
|
|
case 17: |
|
|
|
importVo.setManufacturerSid(temp); |
|
|
|
break; |
|
|
|
case 18: |
|
|
|
importVo.setGoodsTypeSid(temp); |
|
|
|
break; |
|
|
|
case 19: |
|
|
|
importVo.setGoodsTypeCode(temp); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} else { |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
if (StringUtils.isBlank(trim)) { |
|
|
|
String word = new String(); |
|
|
|
switch (i) { |
|
|
|
case 0: |
|
|
|
word = "商品spu名称"; |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
word = "图号"; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
word = "规格型号"; |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
word = "单位"; |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
word = "数量"; |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
word = "品牌"; |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
word = "厂家"; |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
word = "供应商"; |
|
|
|
break; |
|
|
|
case 8: |
|
|
|
word = "销售指导价"; |
|
|
|
break; |
|
|
|
case 9: |
|
|
|
word = "入库单价"; |
|
|
|
break; |
|
|
|
case 10: |
|
|
|
word = "税率"; |
|
|
|
break; |
|
|
|
case 11: |
|
|
|
word = "首次入库日期"; |
|
|
|
break; |
|
|
|
case 12: |
|
|
|
word = "商品类别"; |
|
|
|
break; |
|
|
|
case 13: |
|
|
|
word = "是否为一物一码"; |
|
|
|
break; |
|
|
|
case 14: |
|
|
|
word = "商品spuSid"; |
|
|
|
break; |
|
|
|
case 15: |
|
|
|
word = "商品skuSid"; |
|
|
|
break; |
|
|
|
case 16: |
|
|
|
word = "品牌sid"; |
|
|
|
break; |
|
|
|
case 17: |
|
|
|
word = "厂家sid"; |
|
|
|
break; |
|
|
|
case 18: |
|
|
|
word = "商品类别sid"; |
|
|
|
break; |
|
|
|
case 19: |
|
|
|
word = "商品类别编码"; |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
importVoList.add(importVo); |
|
|
|
} |
|
|
|
if (!importVoList.isEmpty()) { |
|
|
|
for (WmsInitialExcelInfo excelInfo : importVoList) { |
|
|
|
Integer i = baseGoodsSpuFeign.selByCodeAndDept(excelInfo.getGoodsSkuCode(), deptSid).getData(); |
|
|
|
if (i == 0) { |
|
|
|
checkWord.add("图号" + excelInfo.getGoodsSkuCode() + "不存在"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getGoodsSpuName())) { |
|
|
|
checkWord.add("商品名称不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getGoodsSkuOwnSpec())) { |
|
|
|
checkWord.add("规格型号不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getUnit())) { |
|
|
|
checkWord.add("单位不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getNum())) { |
|
|
|
checkWord.add("数量不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getNum())) { |
|
|
|
String num = excelInfo.getNum(); |
|
|
|
Pattern pattern = Pattern.compile("^(\\-|\\+)?\\d+(\\.\\d+)?$"); |
|
|
|
boolean matches = pattern.matcher(num).matches(); |
|
|
|
if (!matches) { |
|
|
|
checkWord.add("数量必须为数字"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getBrandName())) { |
|
|
|
checkWord.add("品牌不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getManufacturerName())) { |
|
|
|
checkWord.add("厂家不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getSupplierName())) { |
|
|
|
checkWord.add("供应商不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getSaleGuidePrice())) { |
|
|
|
checkWord.add("销售指导价不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getSaleGuidePrice())) { |
|
|
|
String saleGuidePrice = excelInfo.getSaleGuidePrice(); |
|
|
|
Pattern pattern = Pattern.compile("^(\\-|\\+)?\\d+(\\.\\d+)?$"); |
|
|
|
boolean matches = pattern.matcher(saleGuidePrice).matches(); |
|
|
|
if (!matches) { |
|
|
|
checkWord.add("销售指导价必须为数字"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getInCost())) { |
|
|
|
checkWord.add("入库单价不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getInCost())) { |
|
|
|
String inCost = excelInfo.getInCost(); |
|
|
|
Pattern pattern = Pattern.compile("^(\\-|\\+)?\\d+(\\.\\d+)?$"); |
|
|
|
boolean matches = pattern.matcher(inCost).matches(); |
|
|
|
if (!matches) { |
|
|
|
checkWord.add("入库单价必须为数字"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getTaxRate())) { |
|
|
|
checkWord.add("税率不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(excelInfo.getFirstInDate())) { |
|
|
|
String firstInDate = excelInfo.getFirstInDate(); |
|
|
|
String[] split = firstInDate.split("-"); |
|
|
|
if (split.length != 2) { |
|
|
|
checkWord.add("图号" + excelInfo.getGoodsSkuCode() + "导入的首次入库日期填写不正确,格式yyyy-MM"); |
|
|
|
break; |
|
|
|
} else if (!isFourDigitNumber(split[0]) || !isTwoDigitNumber(split[1])) { |
|
|
|
checkWord.add("图号" + excelInfo.getGoodsSkuCode() + "导入的首次入库日期填写不正确,格式yyyy-MM"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getGoodsTypeName())) { |
|
|
|
checkWord.add("商品类别不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(excelInfo.getIsYwym())) { |
|
|
|
checkWord.add("是否为一物一码不能为空"); |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
StringBuffer sbcheck1 = new StringBuffer(); |
|
|
|
if (!checkWord.isEmpty()) { |
|
|
|
for (String s : checkWord) { |
|
|
|
if (StringUtils.isBlank(s)) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
sbcheck1.append(s).append(";"); |
|
|
|
} |
|
|
|
} |
|
|
|
if (sbcheck1.length() > 0) { |
|
|
|
sbcheck1.delete(sbcheck1.length() - 1, sbcheck1.length()); |
|
|
|
importReturn.setCheckInfo(sbcheck1.toString()); |
|
|
|
importReturn.setInfos(new ArrayList<>()); |
|
|
|
return importReturn; |
|
|
|
} |
|
|
|
importReturn.setInfos(importVoList); |
|
|
|
return importReturn; |
|
|
|
} |
|
|
|
|
|
|
|
public Object getCellVal(Cell cell) { |
|
|
|
Object obj = null; |
|
|
|
if (cell != null) { |
|
|
|
switch (cell.getCellTypeEnum()) { |
|
|
|
case BOOLEAN: |
|
|
|
obj = cell.getBooleanCellValue(); |
|
|
|
break; |
|
|
|
case ERROR: |
|
|
|
obj = cell.getErrorCellValue(); |
|
|
|
break; |
|
|
|
case NUMERIC: |
|
|
|
obj = cell.getNumericCellValue(); |
|
|
|
break; |
|
|
|
case STRING: |
|
|
|
obj = cell.getStringCellValue(); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return obj; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isFourDigitNumber(String input) { |
|
|
|
// 判断输入是否为数字
|
|
|
|
try { |
|
|
|
int number = Integer.parseInt(input); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
// 判断输入是否为四位数
|
|
|
|
if (input.length() != 4) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isTwoDigitNumber(String input) { |
|
|
|
// 判断输入是否为数字
|
|
|
|
try { |
|
|
|
int number = Integer.parseInt(input); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
// 判断输入是否为二位数
|
|
|
|
if (input.length() != 2) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isNumber(String input) { |
|
|
|
// 判断输入是否为数字
|
|
|
|
try { |
|
|
|
double v = Double.parseDouble(input); |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取商品唯一的goodsID |
|
|
|
* |
|
|
|
* @param goodsSkuSid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private String getGoodsId(String goodsSkuSid) { |
|
|
|
String goodsId = ""; |
|
|
|
ResultBean<BaseGoodsSkuDetailsVo> resultBean = baseGoodsSkuFeign.getDetails(goodsSkuSid); |
|
|
|
if (resultBean.getSuccess()) { |
|
|
|
BaseGoodsSkuDetailsVo baseGoodsSkuDetailsVo = resultBean.getData(); |
|
|
|
goodsId = baseGoodsSkuDetailsVo.getGoodsCode(); |
|
|
|
String date = DateUtil.format(DateUtil.date(), "yyyyMM"); |
|
|
|
goodsId = goodsId + date; |
|
|
|
String i = wmsInitialDetailService.selectNum(goodsId); |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(i)) { |
|
|
|
goodsId = Rule.getBillNo(goodsId, Integer.valueOf(i).intValue()); |
|
|
|
} else { |
|
|
|
goodsId = Rule.getBillNo(goodsId, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
return goodsId; |
|
|
|
} |
|
|
|
} |
|
|
|