Merge remote-tracking branch 'NFLG/master'
This commit is contained in:
commit
68eebe9527
|
|
@ -13,6 +13,7 @@ import com.alibaba.excel.metadata.data.ImageData;
|
|||
import com.alibaba.excel.metadata.data.WriteCellData;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.alibaba.excel.write.metadata.fill.FillConfig;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nflg.wms.admin.pojo.dto.*;
|
||||
import com.nflg.wms.admin.repository.PackageMaterialScanRecordRepository;
|
||||
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
||||
|
|
@ -449,6 +450,12 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
.setMaterialDesc(orderVO.getPackageDesc())).toList()
|
||||
);
|
||||
List<WmsStructuralPackageOrderTrayItem> items = structuralPackageOrderTrayItemService.getList(id);
|
||||
List<DeliverStructuralPackageOrderTrayItemVO> itemVOs = structuralPackageOrderTrayItemService.getListVOByOrderId(id);
|
||||
Map<Long, DeliverStructuralPackageOrderTrayItemVO> deliverStructuralPackageOrderTrayItemMap = CollectionUtil.isNotEmpty(itemVOs) ?
|
||||
itemVOs.stream().filter(d -> d.getId() != null).collect(Collectors.toMap(DeliverStructuralPackageOrderTrayItemVO::getId, d -> d))
|
||||
: Maps.newHashMap();
|
||||
|
||||
|
||||
vo.setItems(items.stream().map(item -> {
|
||||
TrayItemVO ivo = Convert.convert(TrayItemVO.class, item);
|
||||
// 获取托盘号:如果物料项有关联的托盘,则使用托盘号;否则为空
|
||||
|
|
@ -472,6 +479,12 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
ivo.setStoreNum(item.getStoreNum());
|
||||
}
|
||||
}
|
||||
|
||||
DeliverStructuralPackageOrderTrayItemVO itemVO = deliverStructuralPackageOrderTrayItemMap.get(item.getId());
|
||||
if (itemVO != null) {
|
||||
ivo.setDrawingNo(itemVO.getDrawingNo());
|
||||
}
|
||||
|
||||
return ivo;
|
||||
}).toList());
|
||||
return ApiResult.success(vo);
|
||||
|
|
@ -557,6 +570,7 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
DeliverStructuralPackageOrderExtendVO trayVO = structuralPackageOrderTrayService.getInfo(firstTray.getId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(trayVO)).throwMessage("数据不存在");
|
||||
|
||||
DeliverStructuralPackageOrderVO orderVO = structuralPackageOrderService.getInfo(id);
|
||||
PackageVO vo = new PackageVO()
|
||||
.setNo(trayVO.getPackageNo())
|
||||
.setExternalOrderNo(trayVO.getExternalOrderNo())
|
||||
|
|
@ -567,7 +581,7 @@ public class StructuralPackageOrderController extends BaseController {
|
|||
.setEco(trayVO.getEco())
|
||||
.setWorkbenchCode(trayVO.getWorkbenchCode())
|
||||
.setCate(trayVO.getPackageCate())
|
||||
.setWeight(trayVO.getWeight())
|
||||
.setWeight(orderVO.getWeight())
|
||||
.setDrawingNo(trayVO.getPackageDrawingNo())
|
||||
.setName(trayVO.getPackageDesc())
|
||||
.setQrCode(QRCodeUtil.generateQRCodeBase64(trayVO.getPackageNo(), 100, 100));
|
||||
|
|
|
|||
|
|
@ -1,22 +1,36 @@
|
|||
package com.nflg.wms.admin.controller;
|
||||
|
||||
import cn.hutool.core.lang.Pair;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A17Item2DTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A18DTO;
|
||||
import com.nflg.wms.admin.pojo.dto.ZWM3A18Item1DTO;
|
||||
import com.nflg.wms.admin.service.BasdeSerialNumberControllerService;
|
||||
import com.nflg.wms.admin.service.SapService;
|
||||
import com.nflg.wms.common.pojo.ApiResult;
|
||||
import com.nflg.wms.common.pojo.dto.LdapDepartmentDTO;
|
||||
import com.nflg.wms.common.pojo.dto.LdapUserDTO;
|
||||
import com.nflg.wms.common.util.UserUtil;
|
||||
import com.nflg.wms.common.util.VUtil;
|
||||
import com.nflg.wms.repository.entity.WmsQcReceiveItem;
|
||||
import com.nflg.wms.repository.entity.WmsSrmQualityInspection;
|
||||
import com.nflg.wms.repository.service.ILanguageService;
|
||||
import com.nflg.wms.repository.service.IWmsQcReceiveItemService;
|
||||
import com.nflg.wms.repository.service.IWmsSrmQualityInspectionService;
|
||||
import com.nflg.wms.starter.BaseController;
|
||||
import com.sap.conn.jco.JCoException;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.metadata.ValidateUnwrappedValue;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 测试
|
||||
|
|
@ -25,37 +39,17 @@ import java.util.List;
|
|||
@RequestMapping("/test")
|
||||
public class TestController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private ILanguageService languageService;
|
||||
|
||||
@Resource
|
||||
private BasdeSerialNumberControllerService basdeSerialNumberControllerService;
|
||||
// @Resource
|
||||
// private LdapService ldapService;
|
||||
|
||||
|
||||
@Resource
|
||||
private SapService sapService;
|
||||
@GetMapping("/add")
|
||||
public void add() throws JCoException {
|
||||
|
||||
// try {
|
||||
sapService.zwm00_MB017("1309976");
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
@Resource
|
||||
private IWmsSrmQualityInspectionService wmsSrmQualityInspectionService;
|
||||
|
||||
|
||||
// Language language = new Language()
|
||||
// .setCode("test1")
|
||||
// .setName("测试1")
|
||||
// .setValue("aaa")
|
||||
// .setIco("")
|
||||
// .setZone("");
|
||||
// languageService.save(language);
|
||||
}
|
||||
@Resource
|
||||
private IWmsQcReceiveItemService wmsQcReceiveItemService;
|
||||
|
||||
/**
|
||||
* 同步AD部门列表
|
||||
|
|
@ -75,13 +69,66 @@ public class TestController extends BaseController {
|
|||
|
||||
@GetMapping("/ad/string")
|
||||
public ApiResult<String> getString() {
|
||||
String ids=basdeSerialNumberControllerService.generateSerialNumber(0);
|
||||
String ids = basdeSerialNumberControllerService.generateSerialNumber(0);
|
||||
return ApiResult.success(ids);
|
||||
}
|
||||
|
||||
@GetMapping("/businessError")
|
||||
public void testThrowBusinessError() throws Exception {
|
||||
int a=0;
|
||||
Integer b =100/a;
|
||||
int a = 0;
|
||||
Integer b = 100 / a;
|
||||
}
|
||||
|
||||
/**
|
||||
* 补偿 zwm3a18
|
||||
*/
|
||||
@GetMapping("compensateZwm3a18")
|
||||
public ApiResult<Void> compensateZwm3a18(@RequestParam String no) {
|
||||
WmsSrmQualityInspection srmQualityInspection = wmsSrmQualityInspectionService.lambdaQuery()
|
||||
.eq(WmsSrmQualityInspection::getInspectionNum, no)
|
||||
.one();
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(srmQualityInspection)).throwMessage("该单号不存在");
|
||||
VUtil.trueThrowBusinessError(Boolean.TRUE.equals(srmQualityInspection.getIsIn())).throwMessage("该单号已入库,无需补偿");
|
||||
|
||||
// 入库单行,物料凭证取自入库单
|
||||
WmsQcReceiveItem wmsQcReceiveItem = wmsQcReceiveItemService.getById(srmQualityInspection.getReceiveId());
|
||||
VUtil.trueThrowBusinessError(Objects.isNull(wmsQcReceiveItem)).throwMessage("未找到对应的入库单行");
|
||||
|
||||
// 组装SAP表头信息(参照 NormalQMController.confirm 中 ZWM3A18DTO 的构建逻辑)
|
||||
ZWM3A18DTO dto = new ZWM3A18DTO()
|
||||
.setEbeln(srmQualityInspection.getPoNum())
|
||||
.setUsnam(UserUtil.getUserName())
|
||||
.setMblnr(wmsQcReceiveItem.getMaterialDoc())
|
||||
.setMjahr(wmsQcReceiveItem.getMaterialDocYear())
|
||||
.setItem1(new ArrayList<>())
|
||||
.setItem2(new ArrayList<>());
|
||||
|
||||
// 组装SAP行项目信息(参照 NormalQMController.set3A18DTOS)
|
||||
dto.getItem1().add(new ZWM3A18Item1DTO()
|
||||
.setErfmg(srmQualityInspection.getInspectionQty())
|
||||
.setErfmg1(srmQualityInspection.getQualifiedQty())
|
||||
.setErfmg2(srmQualityInspection.getUnqualifiedQty())
|
||||
.setEbelp(srmQualityInspection.getPoLineNumber())
|
||||
.setMatnr(srmQualityInspection.getItemCode())
|
||||
.setMeins(srmQualityInspection.getUnit())
|
||||
.setCharg(srmQualityInspection.getMaterialBatch())
|
||||
.setLgort(srmQualityInspection.getReceivedWarehouse())
|
||||
.setSgtxt("")
|
||||
.setWerks(srmQualityInspection.getFactory()));
|
||||
|
||||
if (StrUtil.isNotBlank(srmQualityInspection.getSerialNum())) {
|
||||
String flag = "合格".equals(srmQualityInspection.getInspectionResult()) ? "X" : "";
|
||||
dto.getItem2().add(new ZWM3A17Item2DTO()
|
||||
.setEBELP(srmQualityInspection.getPoLineNumber())
|
||||
.setSERNR(srmQualityInspection.getSerialNum())
|
||||
.setFLAG(flag));
|
||||
}
|
||||
Pair<String, String> zwm3a18 = sapService.zwm3a18(dto);
|
||||
srmQualityInspection.setIsIn(true);
|
||||
srmQualityInspection.setInTime(LocalDateTime.now());
|
||||
srmQualityInspection.setMaterialDoc105(zwm3a18.getKey());
|
||||
srmQualityInspection.setMaterialDocYear105(zwm3a18.getValue());
|
||||
wmsSrmQualityInspectionService.updateById(srmQualityInspection);
|
||||
return ApiResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.admin.util;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -28,7 +29,7 @@ public class HtmlToImageUtil {
|
|||
if (!Files.exists(tempDir)) {
|
||||
Files.createDirectories(tempDir);
|
||||
}
|
||||
long t = System.currentTimeMillis();
|
||||
String t = IdUtil.getSnowflakeNextIdStr();
|
||||
inputHtmlPath = tempDir.resolve("input_" + t + ".html");
|
||||
outputImgPath = tempDir.resolve("output_" + t + ".png");
|
||||
Files.write(inputHtmlPath, htmlContent.getBytes());
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="com.nflg.wms.repository.mapper.AdMapper">
|
||||
|
||||
<select id="getList" resultType="com.nflg.wms.common.pojo.dto.AdDTO">
|
||||
select a.*,ac.map_from,ac.map_to,ac.next_sync_date,ac.enable as enableSync,ac.id as syncId,ac.type
|
||||
select a.*,ac.map_from,ac.map_to,ac.next_sync_date,ac.enable as enableSync,ac.id as syncId,ac.type,ac.interval
|
||||
from ad a
|
||||
inner join ad_sync ac on a.id = ac.ad_id
|
||||
where a.enable
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
</select>
|
||||
|
||||
<select id="getInfo" resultType="com.nflg.wms.common.pojo.dto.AdDTO">
|
||||
select a.*,ac.map_from,ac.map_to,ac.next_sync_date,ac.enable as enableSync,ac.id as syncId,ac.type
|
||||
select a.*,ac.map_from,ac.map_to,ac.next_sync_date,ac.enable as enableSync,ac.id as syncId,ac.type,ac.interval
|
||||
from ad a
|
||||
inner join ad_sync ac on a.id = ac.ad_id
|
||||
where a.enable and a.id = #{id}
|
||||
|
|
|
|||
|
|
@ -23,15 +23,28 @@
|
|||
</select>
|
||||
|
||||
<select id="getListByOrderId" resultType="com.nflg.wms.common.pojo.vo.DeliverStructuralPackageOrderTrayItemVO">
|
||||
SELECT ROW_NUMBER() OVER (ORDER BY oti.id) AS "index",m.image,m.drawing_no,oti.*,ot."no" as "tray_no",ot."state",
|
||||
sp."no" as "package_no",sp."name" as "package_desc"
|
||||
SELECT ROW_NUMBER() OVER (ORDER BY oti.id) AS "index",
|
||||
m.image,
|
||||
m.drawing_no,
|
||||
oti.*,
|
||||
ot."no" as "tray_no",
|
||||
ot."state",
|
||||
sp."no" as "package_no",
|
||||
sp."name" as "package_desc"
|
||||
FROM wms_structural_package_order o
|
||||
INNER JOIN wms_structural_package_order_tray_item oti ON o."id"=oti.order_id
|
||||
LEFT JOIN wms_structural_package_order_tray ot ON oti.tray_id=ot."id"
|
||||
LEFT JOIN wms_structural_package sp ON o.package_id=sp."id"
|
||||
LEFT JOIN wms_material m ON oti.material_no=m."no" and oti."version"=m."version"
|
||||
where o.id=#{orderId}
|
||||
order by oti.id
|
||||
LEFT JOIN wms_material m ON m."id" = (
|
||||
SELECT m2."id"
|
||||
FROM wms_material m2
|
||||
WHERE m2."no" = oti.material_no
|
||||
AND m2."version" = oti."version"
|
||||
ORDER BY m2."id" DESC
|
||||
LIMIT 1
|
||||
)
|
||||
WHERE o.id=#{orderId}
|
||||
ORDER BY oti.id
|
||||
</select>
|
||||
|
||||
<select id="getListVOByIds" resultType="com.nflg.wms.common.pojo.vo.DeliverStructuralPackageOrderTrayItemVO">
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.wms.shipment.util;
|
||||
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -10,6 +11,7 @@ import java.nio.file.Paths;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Slf4j
|
||||
public class HtmlToImageUtil {
|
||||
|
|
@ -28,7 +30,7 @@ public class HtmlToImageUtil {
|
|||
if (!Files.exists(tempDir)) {
|
||||
Files.createDirectories(tempDir);
|
||||
}
|
||||
long t = System.currentTimeMillis();
|
||||
String t = IdUtil.getSnowflakeNextIdStr();
|
||||
inputHtmlPath = tempDir.resolve("input_" + t + ".html");
|
||||
outputImgPath = tempDir.resolve("output_" + t + ".png");
|
||||
Files.write(inputHtmlPath, htmlContent.getBytes());
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ public class RestTemplateConfig {
|
|||
public RestTemplate restTemplate() {
|
||||
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||
factory.setConnectTimeout(3_000);
|
||||
factory.setReadTimeout(10_000);
|
||||
factory.setReadTimeout(60_000);
|
||||
return new RestTemplate(factory);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue