Merge remote-tracking branch 'origin/master-hlq20260506ganggoubao' into develop
This commit is contained in:
commit
802936cbf0
|
|
@ -2,30 +2,32 @@ package com.nflg.wms.admin.service;
|
|||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.wms.admin.pojo.dto.PdfPageDTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17DTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17Item1DTO;
|
||||
import com.nflg.wms.admin.util.PdfGeneratorUtil;
|
||||
import com.nflg.wms.admin.util.QRCodeUtil;
|
||||
import com.nflg.wms.admin.util.ThymeleafUtil;
|
||||
import com.nflg.wms.common.constant.Constant;
|
||||
import com.nflg.wms.common.constant.STATE;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.PageData;
|
||||
import com.nflg.wms.common.pojo.dto.*;
|
||||
import com.nflg.wms.common.pojo.dto.BomMaterialDTO;
|
||||
import com.nflg.wms.common.pojo.dto.PackageMaterialDTO;
|
||||
import com.nflg.wms.common.pojo.dto.PackageMaterialExcelExportDTO;
|
||||
import com.nflg.wms.common.pojo.dto.PackageMaterialExcelImportDTO;
|
||||
import com.nflg.wms.common.pojo.qo.*;
|
||||
import com.nflg.wms.common.pojo.vo.PackageVO;
|
||||
import com.nflg.wms.common.util.DateTimeUtil;
|
||||
import com.nflg.wms.common.util.EecExcelUtil;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.*;
|
||||
import com.nflg.wms.repository.entity.WmsInTaskItem;
|
||||
import com.nflg.wms.repository.entity.WmsMaterial;
|
||||
import com.nflg.wms.repository.entity.WmsModel;
|
||||
import com.nflg.wms.repository.entity.WmsStructuralPackage;
|
||||
import com.nflg.wms.repository.service.*;
|
||||
import com.nflg.wms.starter.service.BomMaterialService;
|
||||
import com.nflg.wms.starter.service.FileUploadService;
|
||||
|
|
@ -184,8 +186,8 @@ public class StructuralPackageControllerService {
|
|||
.addSheet(new ListSheet<>(List.of(new PackageMaterialExcelExportDTO()
|
||||
.setNo("(必填)零件编码")
|
||||
.setName("(必填)零件名称")
|
||||
.setStation("(必填)工位序号")
|
||||
.setTray("(必填)托盘序号")
|
||||
// .setStation("(必填)工位序号")
|
||||
// .setTray("(必填)托盘序号")
|
||||
.setWeight(BigDecimal.ZERO)
|
||||
.setNum(BigDecimal.ZERO)
|
||||
.setVersion("(必填)图纸版本"))))
|
||||
|
|
@ -200,8 +202,8 @@ public class StructuralPackageControllerService {
|
|||
datas.add(new PackageMaterialExcelExportDTO()
|
||||
.setNo("(必填)零件编码")
|
||||
.setName("(必填)零件名称")
|
||||
.setStation("(必填)工位序号")
|
||||
.setTray("(必填)托盘序号")
|
||||
// .setStation("(必填)工位序号")
|
||||
// .setTray("(必填)托盘序号")
|
||||
.setWeight(BigDecimal.ZERO)
|
||||
.setNum(BigDecimal.ZERO)
|
||||
.setVersion("(必填)图纸版本"));
|
||||
|
|
@ -250,16 +252,16 @@ public class StructuralPackageControllerService {
|
|||
} else {
|
||||
materialDTO.setName(dto.getName());
|
||||
}
|
||||
if (StrUtil.isBlank(dto.getStation())) {
|
||||
/*if (StrUtil.isBlank(dto.getStation())) {
|
||||
sb.append("工位序号不能为空;");
|
||||
} else {
|
||||
} else {*/
|
||||
materialDTO.setStation(dto.getStation());
|
||||
}
|
||||
/*}
|
||||
if (StrUtil.isBlank(dto.getTray())) {
|
||||
sb.append("托盘序号不能为空;");
|
||||
} else {
|
||||
} else {*/
|
||||
materialDTO.setTray(dto.getTray());
|
||||
}
|
||||
// }
|
||||
if (StrUtil.isBlank(dto.getNum())) {
|
||||
sb.append("数量不能为空;");
|
||||
} else if (!NumberUtils.isCreatable(dto.getNum())) {
|
||||
|
|
@ -353,8 +355,12 @@ public class StructuralPackageControllerService {
|
|||
&& packageService.lambdaQuery().eq(WmsStructuralPackage::getNo, packageInfo.getNo()).exists())
|
||||
.throwMessage("修改日志不能为空");
|
||||
break;
|
||||
case 6:
|
||||
BigDecimal trayNum = row.getDecimal(1);
|
||||
packageInfo.setTrayNum(trayNum);
|
||||
break;
|
||||
default:
|
||||
if (row.getRowNum() > 7) {
|
||||
if (row.getRowNum() > 8) {
|
||||
String mno = StrUtil.trim(row.getString(0));
|
||||
if (StrUtil.isBlank(mno)) {
|
||||
// sb.append(StrUtil.format("第{}行零件编码不能为空;", row.getRowNum()));
|
||||
|
|
@ -370,15 +376,14 @@ public class StructuralPackageControllerService {
|
|||
dto.setName(material1.getDescribe());
|
||||
dto.setDrawingNo(material1.getDrawingNo());
|
||||
dto.setImage(material1.getImage());
|
||||
String v = row.getString(6);
|
||||
String v = row.getString(5);
|
||||
if (StrUtil.isNotBlank(v)) {
|
||||
dto.setVersion(v);
|
||||
} else {
|
||||
dto.setVersion(material1.getVersion());
|
||||
}
|
||||
dto.setStation(row.getString(2));
|
||||
dto.setTray(row.getString(3));
|
||||
String num = row.getString(4);
|
||||
String num = row.getString(3);
|
||||
if (StrUtil.isBlank(num)) {
|
||||
sb.append(StrUtil.format("第{}行数量不能为空;", row.getRowNum()));
|
||||
} else if (!NumberUtils.isCreatable(num)) {
|
||||
|
|
@ -386,13 +391,13 @@ public class StructuralPackageControllerService {
|
|||
} else {
|
||||
dto.setNum(new BigDecimal(num));
|
||||
}
|
||||
num = row.getString(5);
|
||||
if (StrUtil.isBlank(num)) {
|
||||
String singleWeight = row.getString(4);
|
||||
if (StrUtil.isBlank(singleWeight)) {
|
||||
sb.append(StrUtil.format("第{}行重量不能为空;", row.getRowNum()));
|
||||
} else if (!NumberUtils.isCreatable(num)) {
|
||||
} else if (!NumberUtils.isCreatable(singleWeight)) {
|
||||
sb.append(StrUtil.format("第{}行重量无效;", row.getRowNum()));
|
||||
} else {
|
||||
dto.setWeight(new BigDecimal(num));
|
||||
dto.setWeight(new BigDecimal(singleWeight));
|
||||
}
|
||||
dto.setCreateBy(UserUtil.getUserName());
|
||||
dto.setCreateTime(DateTimeUtil.format(LocalDate.now(), "yyyy-MM-dd"));
|
||||
|
|
|
|||
|
|
@ -49,8 +49,7 @@ public class NoUtil {
|
|||
return new StructuralPackageMaterialQRCodeContentDTO()
|
||||
.setUniqNo(c1s.size() == 1 ? qrCode : CollectionUtil.get(c1s, 0))
|
||||
.setMaterialNo(c1s.size() == 1 ? CollectionUtil.get(c1s, 0) : CollectionUtil.get(c1s, 1))
|
||||
.setTrayNo(CollectionUtil.get(contents, 1))
|
||||
.setNum(new BigDecimal(CollectionUtil.get(contents, 2)))
|
||||
.setNum(new BigDecimal(CollectionUtil.get(contents, 1)))
|
||||
.setContent(qrCode);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue