From 23e57976f3e12767b02f6aa47f86770a76951937 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=8E=E5=85=B4?= <2220574228@qq.com> Date: Wed, 20 May 2026 16:56:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E5=8A=A1=E7=9B=B8=E5=85=B3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9;omsbug=E4=BF=AE=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReservationOutMaterialDetailMapper.java | 9 + .../entity/ReservationStockInOrder.java | 16 +- .../mapper/ReservationStockInOrderMapper.java | 2 + .../po/ReservationStockInOrderPO.java | 16 +- .../todo/ReservationStockInOrderDO.java | 16 +- .../todo/ReservationStockInOrderDTO.java | 16 +- .../repository/vo/GwStockInOrder.java | 3 + ...rvationStockInOrderApplicationService.java | 221 +++++++++++++++--- .../entity/ReservationStockOutOrder.java | 16 +- .../po/ReservationStockOutOrderPO.java | 16 +- .../todo/ReservationStockOutOrderDO.java | 16 +- .../todo/ReservationStockOutOrderDTO.java | 16 +- .../repository/vo/GwStockOutOrder.java | 3 + ...vationStockOutOrderApplicationService.java | 194 ++++++++++++++- .../entity/ReserveStockInOrder.java | 6 +- .../repository/po/ReserveStockInOrderPO.java | 6 +- .../todo/ReserveStockInOrderDO.java | 6 +- .../todo/ReserveStockInOrderDTO.java | 6 +- .../repository/vo/InAndOutListVo.java | 2 + .../entity/ReserveStockOutOrder.java | 4 +- .../repository/po/ReserveStockOutOrderPO.java | 4 +- .../todo/ReserveStockOutOrderDO.java | 4 +- .../ReservationOutMaterialDetailMapper.xml | 19 ++ .../ReservationStockInOrderMapper.xml | 4 +- .../ReserveStockInOrderMapper.xml | 6 +- .../pickingOrder/entity/PickingOrder.java | 16 +- .../repository/po/PickingOrderPO.java | 16 +- .../repository/todo/PickingOrderDO.java | 16 +- .../entity/StockShelfOrder.java | 16 +- .../repository/po/StockShelfOrderPO.java | 16 +- .../repository/todo/StockShelfOrderDO.java | 16 +- .../dto/pickingOrder/PickingOrderDTO.java | 16 +- .../stockShelfOrder/StockShelfOrderDTO.java | 16 +- 33 files changed, 656 insertions(+), 99 deletions(-) diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/mapper/ReservationOutMaterialDetailMapper.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/mapper/ReservationOutMaterialDetailMapper.java index e5b96faa6..33d72e1f0 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/mapper/ReservationOutMaterialDetailMapper.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationOutMaterialDetail/repository/mapper/ReservationOutMaterialDetailMapper.java @@ -5,6 +5,7 @@ import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrder import com.mhd.oms.domain.reservationOutMaterialDetail.entity.ReservationOutMaterialDetail; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.ReservationOutMaterialDetailPO; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.todo.ReservationOutMaterialDetailDO; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -53,4 +54,12 @@ public interface ReservationOutMaterialDetailMapper extends BaseMapper queryNoticePrint(ReservationStockInOrderDO stockInOrderDO); List queryNoticePrintDetail(ReservationStockInOrderDO stockInOrderDO);} \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java index 08667f83d..f34692a71 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/po/ReservationStockInOrderPO.java @@ -432,8 +432,18 @@ public class ReservationStockInOrderPO extends BaseVOEntity { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date storageTime; - @ApiModelProperty("推送关务状态: 1-已推送 0-未推送") - @Excel(name = "推送关务状态: 1-已推送 0-未推送") - private Integer gwPushStatus; + @ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java index a56d88ca0..5af9f6672 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDO.java @@ -431,7 +431,17 @@ public class ReservationStockInOrderDO extends BaseVOEntity { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date storageTime; - @ApiModelProperty("推送关务状态: 1-已推送 0-未推送") - @Excel(name = "推送关务状态: 1-已推送 0-未推送") - private Integer gwPushStatus; + @ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java index ab0b45370..ccf463949 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/todo/ReservationStockInOrderDTO.java @@ -429,7 +429,17 @@ public class ReservationStockInOrderDTO extends ReservationStockInOrderBaseDTO { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date storageTime; - @ApiModelProperty("推送关务状态: 1-已推送 0-未推送") - @Excel(name = "推送关务状态: 1-已推送 0-未推送") - private Integer gwPushStatus; + @ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/vo/GwStockInOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/vo/GwStockInOrder.java index aa3778065..ce7a43a58 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/vo/GwStockInOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/repository/vo/GwStockInOrder.java @@ -3,6 +3,7 @@ package com.mhd.oms.domain.reservationStockInOrder.repository.vo; import lombok.Data; import java.util.Date; +import java.util.List; @Data public class GwStockInOrder { @@ -15,4 +16,6 @@ public class GwStockInOrder { //客户代码 private String corp_code; + private List orderList; + } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java index ea1422ddc..22e790b04 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockInOrder/service/ReservationStockInOrderApplicationService.java @@ -4,16 +4,29 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson2.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.mhd.common.core.domain.po.UserPo; import com.mhd.common.core.enums.DictCode; import com.mhd.common.core.exception.ServiceException; import com.mhd.common.core.utils.StringUtils; import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.erpCountry.entity.ErpCountry; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail; +import com.mhd.oms.domain.reservationInMaterialDetail.repository.mapper.ReservationInMaterialDetailMapper; import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReservationInMaterialDetailPO; +import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder; +import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReservationStockInOrderMapper; +import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; import com.mhd.oms.domain.reservationStockInOrder.repository.po.ReservationStockInOrderPO; import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO; import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDTO; +import com.mhd.oms.domain.reservationStockInOrder.repository.vo.GwInDetail; +import com.mhd.oms.domain.reservationStockInOrder.repository.vo.GwStockInOrder; +import com.mhd.oms.interfaces.dto.erpCountry.ErpCountryDTO; import com.mhd.system.api.SystemServiceFeign; import com.mhd.system.api.UserServiceFeign; import com.mhd.system.api.domain.InMaterialDetailTZPD; @@ -24,20 +37,25 @@ import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO; import com.mhd.system.api.domain.cache.SystemServiceCacheUtil; import com.mhd.system.api.model.LoginUser; import lombok.extern.slf4j.Slf4j; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; import org.apache.poi.ss.usermodel.*; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.RequestParam; +import javax.annotation.Resource; +import java.io.IOException; import java.io.InputStream; import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 入库单ApplicationService @@ -54,9 +72,17 @@ public class ReservationStockInOrderApplicationService { private UserServiceFeign userServiceFeign; @Autowired private SystemServiceFeign systemServiceFeign; + @Resource + private GwLogMapper gwLogMapper; + @Autowired + private ReservationStockInOrderMapper reservationStockInOrderMapper; + @Autowired + private ReservationInMaterialDetailMapper reservationInMaterialDetailMapper; // @Autowired // private IMaterialBaseInfoService materialBaseInfoService; - + private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String API_NAME = "save_order_i"; + private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP"; /** * 分页查询入库单列表 @@ -67,7 +93,7 @@ public class ReservationStockInOrderApplicationService { if (loginUser != null && loginUser.getUserPo() != null){ Long userOrganizationId = loginUser.getUserPo().getOrganizationId(); Long frontendOrganizationId = stockInOrderDO.getOrganizationId(); // 前端传递的 organizationId - + // 数据权限:根据 organizationId 来设置查询权限 // 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己 if (userOrganizationId != null && userOrganizationId == 2827L) { @@ -203,7 +229,7 @@ public class ReservationStockInOrderApplicationService { if (inOrderIds == null || inOrderIds.length == 0) { throw new ServiceException("删除的入库单ID不能为空"); } - + // 查询入库单信息,检查状态 for (Long inOrderId : inOrderIds) { ReservationStockInOrderPO stockInOrderPO = stockInOrderDomainService.getInfo(inOrderId); @@ -215,10 +241,10 @@ public class ReservationStockInOrderApplicationService { throw new ServiceException("只有已创建状态的入库单可以删除,入库单号:" + stockInOrderPO.getInOrderNumber() + ",当前状态:" + getStatusName(stockInOrderPO.getStatus())); } } - + return stockInOrderDomainService.delete(inOrderIds); } - + /** * 获取入库状态名称 */ @@ -1539,7 +1565,7 @@ public class ReservationStockInOrderApplicationService { if (StringUtils.isBlank(dateStr)) { return null; } - + // 如果已经是Date.toString()格式(如 "Sun Feb 01 00:00:00 CST 2026"),尝试直接解析 if (dateStr.contains("CST") || dateStr.contains("GMT") || dateStr.contains("UTC")) { try { @@ -1550,7 +1576,7 @@ public class ReservationStockInOrderApplicationService { log.warn("无法解析日期格式: {}", dateStr); } } - + // 尝试多种日期格式 String[] datePatterns = { "yyyy-MM-dd", @@ -1562,7 +1588,7 @@ public class ReservationStockInOrderApplicationService { "yyyy-MM-dd HH:mm", "yyyy/MM/dd HH:mm" }; - + for (String pattern : datePatterns) { try { SimpleDateFormat sdf = new SimpleDateFormat(pattern); @@ -1572,7 +1598,7 @@ public class ReservationStockInOrderApplicationService { // 继续尝试下一个格式 } } - + // 如果所有格式都失败,记录警告 log.warn("无法解析日期字符串: {},尝试使用DateUtils.parseDate", dateStr); try { @@ -1664,9 +1690,9 @@ public class ReservationStockInOrderApplicationService { if (StringUtils.isBlank(shipperName) && StringUtils.isBlank(shipperCode)) { return null; } - + Long shipperId = null; - + // 优先尝试:如果名称是纯数字,可能是误传的ID,直接按ID查询 if (StringUtils.isNotEmpty(shipperName) && shipperName.matches("\\d+")) { try { @@ -1684,7 +1710,7 @@ public class ReservationStockInOrderApplicationService { log.debug("尝试将货主名称作为ID查询失败,货主名称:{},错误:{}", shipperName, e.getMessage()); } } - + // 如果仍未找到,尝试根据名称查询 if (shipperId == null && StringUtils.isNotEmpty(shipperName) && !shipperName.matches("\\d+")) { try { @@ -1702,7 +1728,7 @@ public class ReservationStockInOrderApplicationService { log.debug("根据货主名称查询失败,货主名称:{},错误:{}", shipperName, e.getMessage()); } } - + // 如果仍未找到,尝试从货主列表中根据编号或名称查找 if (shipperId == null && (StringUtils.isNotEmpty(shipperName) || StringUtils.isNotEmpty(shipperCode))) { try { @@ -1728,30 +1754,30 @@ public class ReservationStockInOrderApplicationService { String jsonStr = JSONObject.toJSONString(data); shipperList = JSON.parseObject(jsonStr, new com.alibaba.fastjson.TypeReference>>(){}); } - + if (shipperList != null && !shipperList.isEmpty()) { String normalizedShipperName = shipperName != null ? shipperName.trim() : ""; String normalizedShipperCode = shipperCode != null ? shipperCode.trim() : ""; - + for (Map shipper : shipperList) { Object userId = shipper.get("userId"); Object userName = shipper.get("userName"); Object userCode = shipper.get("userCode"); Object userMemberCode = shipper.get("userMemberCode"); - + if (userName == null) { userName = shipper.get("name"); } if (userName == null) { userName = shipper.get("shipperName"); } - + boolean matched = false; // 优先根据编号匹配 if (StringUtils.isNotEmpty(normalizedShipperCode)) { String normalizedUserCode = userCode != null ? String.valueOf(userCode).trim() : ""; String normalizedUserMemberCode = userMemberCode != null ? String.valueOf(userMemberCode).trim() : ""; - if (normalizedShipperCode.equals(normalizedUserCode) || + if (normalizedShipperCode.equals(normalizedUserCode) || normalizedShipperCode.equals(normalizedUserMemberCode)) { matched = true; } @@ -1759,15 +1785,15 @@ public class ReservationStockInOrderApplicationService { // 如果编号不匹配,再根据名称匹配 if (!matched && StringUtils.isNotEmpty(normalizedShipperName) && userName != null) { String normalizedUserName = String.valueOf(userName).trim(); - if (normalizedShipperName.equals(normalizedUserName) || + if (normalizedShipperName.equals(normalizedUserName) || normalizedUserName.contains(normalizedShipperName)) { matched = true; } } - + if (matched && userId != null) { shipperId = Long.valueOf(String.valueOf(userId)); - log.info("从货主列表中找到货主ID,货主名称:{},货主编号:{},货主ID:{}", + log.info("从货主列表中找到货主ID,货主名称:{},货主编号:{},货主ID:{}", shipperName, shipperCode, shipperId); return shipperId; } @@ -1775,15 +1801,15 @@ public class ReservationStockInOrderApplicationService { } } } catch (Exception e) { - log.debug("从货主列表中查找货主ID失败,货主名称:{},货主编号:{},错误:{}", + log.debug("从货主列表中查找货主ID失败,货主名称:{},货主编号:{},错误:{}", shipperName, shipperCode, e.getMessage()); } } - + if (shipperId == null) { log.warn("未找到货主ID,货主名称:{},货主编号:{}", shipperName, shipperCode); } - + return shipperId; } @@ -1904,4 +1930,143 @@ public class ReservationStockInOrderApplicationService { BeanUtils.copyProperties(stockInOrderDTO, stockInOrderDO); return stockInOrderDomainService.queryNoticePrintDetail(stockInOrderDO); } + + + public AjaxResult batchPush(List idList) { + if (idList == null || idList.isEmpty()) { + return AjaxResult.error("没有数据需要推送"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (Long id : idList) { + GwStockInOrder gwStockInOrder = new GwStockInOrder(); + ReservationStockInOrder reservationStockInOrder = reservationStockInOrderMapper.selectById(id); + Long shipperId = reservationStockInOrder.getShipperId(); + String userNcCode = reservationStockInOrderMapper.getUserNcCode(shipperId); + gwStockInOrder.setBill_no(reservationStockInOrder.getInOrderNumber()); + gwStockInOrder.setBill_date(reservationStockInOrder.getDocumentDate()); + gwStockInOrder.setIe_flag("I"); + gwStockInOrder.setCorp_code(userNcCode); + + + List reservationInMaterialDetails = reservationInMaterialDetailMapper.selectList(new LambdaQueryWrapper().eq(ReservationInMaterialDetail::getInOrderNumber, reservationStockInOrder.getInOrderNumber())); + Integer lineNum = 1; + List orderList = new LinkedList<>(); + for (ReservationInMaterialDetail reservationInMaterialDetail : reservationInMaterialDetails) { + GwInDetail gwInDetail = new GwInDetail(); + Long materialBaseInfoId = reservationInMaterialDetail.getMaterialBaseInfoId(); + gwInDetail.setBill_no(gwStockInOrder.getBill_no()); + gwInDetail.setLine_num(lineNum); + lineNum++; + gwInDetail.setItem_no(materialBaseInfoId.toString()); + gwInDetail.setItem_name(reservationInMaterialDetail.getMaterialName()); + MaterialBaseInfoPO materialBaseInfoPO = reservationStockInOrderMapper.getinfo(materialBaseInfoId); + gwInDetail.setSpec(materialBaseInfoPO.getSpecificationModel()); + gwInDetail.setUnit(materialBaseInfoPO.getDeclarationUnit()); + gwInDetail.setQty(reservationInMaterialDetail.getQuantity()); + gwInDetail.setErp_curr(materialBaseInfoPO.getCurrency()); + gwInDetail.setErp_price(materialBaseInfoPO.getUnitPrice()); + BigDecimal unitPrice = materialBaseInfoPO.getUnitPrice(); + BigDecimal quantity = reservationInMaterialDetail.getQuantity(); + if (unitPrice != null && quantity != null && unitPrice.compareTo(BigDecimal.ZERO) != 0&&quantity.compareTo(BigDecimal.ZERO) != 0) { + BigDecimal Amount = unitPrice.multiply(quantity).setScale(2, BigDecimal.ROUND_HALF_UP); + gwInDetail.setAmount(Amount); + } + orderList.add(gwInDetail); + } + gwStockInOrder.setOrderList(orderList); + + GwLog gwLog = new GwLog(); + gwLog.setType("企业国别"); + gwLog.setBusinessId(id); + gwLog.setRequestBody(com.alibaba.fastjson.JSONObject.toJSONString(gwStockInOrder)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + updatePushStatus(id, 2, new Date(), pushBy,pushByName); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(gwStockInOrder), "UTF-8"); + httpPost.setEntity(postingString); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("apiName", API_NAME); + httpPost.setHeader("verify", VERIFY); + + try { + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if (response.getStatusLine().getStatusCode() == 200) { + gwLog.setStatus(2); + updatePushStatus(id, 3, new Date(), pushBy,pushByName); + successCount++; + } else { + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + updatePushStatus(id, 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpCountryCode:").append(id).append("失败;"); + } + gwLogMapper.updateById(gwLog); + response.close(); + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + updatePushStatus(id, 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpCountryCode:").append(id).append("异常:").append(e.getMessage()).append(";"); + log.error("企业国别推送异常: id={}, error={}", id, e.getMessage()); + } finally { + try { + httpClient.close(); + } catch (Exception e) { + log.error("关闭httpClient异常: {}", e.getMessage()); + } + } + } + + String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条"; + if (failCount > 0) { + resultMsg += "[" + failMsg.toString() + "]"; + } + return AjaxResult.success(resultMsg); + } + + private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) { + ReservationStockInOrder entity = new ReservationStockInOrder(); + entity.setInOrderId(id); + entity.setPushStatus(pushStatus); + if (pushTime != null) { + entity.setPushTime(pushTime); + } + if (pushBy != null) { + entity.setPushBy(pushBy); + } + if (pushByName != null) { + entity.setPushByName(pushByName); + } + reservationStockInOrderMapper.updateById(entity); + } } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/entity/ReservationStockOutOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/entity/ReservationStockOutOrder.java index 15c6deeb7..0f77c6e7b 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/entity/ReservationStockOutOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/entity/ReservationStockOutOrder.java @@ -444,8 +444,18 @@ public class ReservationStockOutOrder extends BaseVOEntity { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; - @ApiModelProperty("推送关务状态: 1-已推送 0-未推送") - @Excel(name = "推送关务状态: 1-已推送 0-未推送") - private Integer gwPushStatus; + @ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java index c7fb389b9..f811ec524 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/po/ReservationStockOutOrderPO.java @@ -455,7 +455,17 @@ public class ReservationStockOutOrderPO extends BaseVOEntity { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; - @ApiModelProperty("推送关务状态: 1-已推送 0-未推送") - @Excel(name = "推送关务状态: 1-已推送 0-未推送") - private Integer gwPushStatus; + @ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java index c32a6bbad..4f4aab15f 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDO.java @@ -491,7 +491,17 @@ public class ReservationStockOutOrderDO extends BaseVOEntity { @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; - @ApiModelProperty("推送关务状态: 1-已推送 0-未推送") - @Excel(name = "推送关务状态: 1-已推送 0-未推送") - private Integer gwPushStatus; + @ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java index 25319a14a..6ee5a323d 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/todo/ReservationStockOutOrderDTO.java @@ -480,7 +480,17 @@ public class ReservationStockOutOrderDTO extends ReservationStockOutOrderBaseDTO @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date outboundTime; - @ApiModelProperty("推送关务状态: 1-已推送 0-未推送") - @Excel(name = "推送关务状态: 1-已推送 0-未推送") - private Integer gwPushStatus; + @ApiModelProperty("推送状态:1-未推送,2-推送中,3-推送成功,4-推送失败") + private Integer pushStatus; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty("推送时间") + private Date pushTime; + + @ApiModelProperty("推送人") + private Long pushBy; + + @ApiModelProperty("推送人姓名") + private String pushByName; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/vo/GwStockOutOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/vo/GwStockOutOrder.java index bff4dadc7..9341c2f8b 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/vo/GwStockOutOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/repository/vo/GwStockOutOrder.java @@ -3,6 +3,7 @@ package com.mhd.oms.domain.reservationStockOutOrder.repository.vo; import lombok.Data; import java.util.Date; +import java.util.List; @Data public class GwStockOutOrder { @@ -15,4 +16,6 @@ public class GwStockOutOrder { //客户代码 private String corp_code; + private List orderList; + } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java index f613a0017..6941fed64 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reservationStockOutOrder/service/ReservationStockOutOrderApplicationService.java @@ -16,30 +16,51 @@ import com.mhd.common.core.utils.bean.BeanUtils; import com.mhd.common.core.utils.uuid.IdGenerator; import com.mhd.common.core.web.domain.AjaxResult; import com.mhd.common.security.utils.SecurityUtils; +import com.mhd.oms.domain.gwLog.entity.GwLog; +import com.mhd.oms.domain.gwLog.repository.mapper.GwLogMapper; +import com.mhd.oms.domain.reservationInMaterialDetail.entity.ReservationInMaterialDetail; import com.mhd.oms.domain.reservationInMaterialDetail.repository.facade.IReservationInMaterialDetailService; +import com.mhd.oms.domain.reservationInMaterialDetail.repository.mapper.ReservationInMaterialDetailMapper; import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO; import com.mhd.oms.domain.reservationOutMaterialDetail.entity.ReservationOutMaterialDetail; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.facade.IReservationOutMaterialDetailService; +import com.mhd.oms.domain.reservationOutMaterialDetail.repository.mapper.ReservationOutMaterialDetailMapper; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.ReservationOutMaterialDetailPO; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.todo.ReservationOutMaterialDetailDO; import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.OutMaterialCheckPO; import com.mhd.oms.domain.reservationOutMaterialDetail.service.ReservationOutMaterialDetailDomainService; +import com.mhd.oms.domain.reservationStockInOrder.entity.ReservationStockInOrder; import com.mhd.oms.domain.reservationStockInOrder.repository.facade.IReservationStockInOrderService; +import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReservationStockInOrderMapper; +import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO; import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReservationStockInOrderDO; +//import com.mhd.oms.domain.reservationStockInOrder.repository.vo.GwOutDetail; +import com.mhd.oms.domain.reservationStockInOrder.repository.vo.GwStockInOrder; import com.mhd.oms.domain.reservationStockOutOrder.entity.ReservationStockOutOrder; import com.mhd.oms.domain.reservationStockOutOrder.repository.facade.IReservationStockOutOrderService; +import com.mhd.oms.domain.reservationStockOutOrder.repository.mapper.ReservationStockOutOrderMapper; import com.mhd.oms.domain.reservationStockOutOrder.repository.po.ReservationStockOutOrderPO; import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ReservationStockOutOrderDO; import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ReservationStockOutOrderDTO; +import com.mhd.oms.domain.reservationStockOutOrder.repository.vo.GwOutDetail; +import com.mhd.oms.domain.reservationStockOutOrder.repository.vo.GwStockOutOrder; import com.mhd.system.api.SystemServiceFeign; import com.mhd.system.api.UserServiceFeign; import com.mhd.system.api.domain.*; import com.mhd.system.api.model.LoginUser; import lombok.extern.slf4j.Slf4j; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.util.EntityUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; +import java.io.IOException; import java.lang.reflect.Field; import java.math.BigDecimal; import java.text.SimpleDateFormat; @@ -78,6 +99,18 @@ public class ReservationStockOutOrderApplicationService { private IReservationOutMaterialDetailService outMaterialDetailService; // @Autowired // private IPickingMaterialDetailService pickingMaterialDetailService; + @Resource + private GwLogMapper gwLogMapper; + @Autowired + private ReservationStockOutOrderMapper reservationStockOutOrderMapper; + @Autowired + private ReservationOutMaterialDetailMapper reservationOutMaterialDetailMapper; + + @Autowired + private ReservationStockInOrderMapper reservationStockInOrderMapper; + private static final String PUSH_API_URL = "http://10.33.0.100/nagu-erp-api/transfer/pushData"; + private static final String API_NAME = "save_order_i"; + private static final String VERIFY = "tjPZMT9fwhZRnv+eTXKF75QXmXzCn7phPagmoUQsvsh2ZTWDjuRxHAgcP0GZENHP"; /** @@ -782,7 +815,7 @@ public class ReservationStockOutOrderApplicationService { * @description 审核入库单 * @author ZhouGY * @date 2024/5/21 13:53 - * @param stockInOrderDO + * @param * @return Boolean */ public Boolean auditState(ReservationStockOutOrderDO stockOutOrderDO){ @@ -793,7 +826,7 @@ public class ReservationStockOutOrderApplicationService { * @description 下发入库单 * @author ZhouGY * @date 2024/5/21 13:53 - * @param stockInOrderDO + * @param * @return Boolean */ public Boolean issueOrder(ReservationStockOutOrderDO stockOutOrderDO){ @@ -1032,4 +1065,161 @@ public class ReservationStockOutOrderApplicationService { BeanUtils.copyProperties(stockOutOrderDTO, stockOutOrderDO); return stockOutOrderDomainService.queryOutStockNoticePrintDetail(stockOutOrderDO); } + + public AjaxResult batchPush(List idList) { + if (idList == null || idList.isEmpty()) { + return AjaxResult.error("没有数据需要推送"); + } + + LoginUser loginUser = SecurityUtils.getLoginUser(); + Long pushBy = loginUser != null ? loginUser.getUserid() : null; + String pushByName = loginUser != null ? loginUser.getUsername() : null; + Long organizationId = loginUser != null ? loginUser.getUserPo().getOrganizationId() : null; + Long topOrganizationId = loginUser != null ? loginUser.getUserPo().getTopOrganizationId() : null; + String organizationName = loginUser != null ? loginUser.getUserPo().getOrganizationName() : null; + + int successCount = 0; + int failCount = 0; + StringBuilder failMsg = new StringBuilder(); + + for (Long id : idList) { + GwStockOutOrder gwStockOutOrder = new GwStockOutOrder(); + ReservationStockOutOrder reservationStockOutOrder = reservationStockOutOrderMapper.selectById(id); + Long shipperId = reservationStockOutOrder.getShipperId(); + String userNcCode = reservationStockInOrderMapper.getUserNcCode(shipperId); + gwStockOutOrder.setBill_no(reservationStockOutOrder.getOutOrderNumber()); + gwStockOutOrder.setBill_date(reservationStockOutOrder.getDocumentDate()); + gwStockOutOrder.setIe_flag("E"); + gwStockOutOrder.setCorp_code(userNcCode); + + + List reservationOutMaterialDetails = reservationOutMaterialDetailMapper.selectList(new LambdaQueryWrapper().eq(ReservationOutMaterialDetail::getOutOrderNumber, reservationStockOutOrder.getOutOrderNumber())); + Integer lineNum = 1; + List orderList = new LinkedList<>(); + for (ReservationOutMaterialDetail reservationOutMaterialDetail : reservationOutMaterialDetails) { + GwOutDetail gwOutDetail = new GwOutDetail(); + Long materialBaseInfoId = reservationOutMaterialDetail.getMaterialBaseInfoId(); + gwOutDetail.setBill_no(gwStockOutOrder.getBill_no()); + gwOutDetail.setLine_num(lineNum); + lineNum++; + gwOutDetail.setItem_no(materialBaseInfoId.toString()); + gwOutDetail.setItem_name(reservationOutMaterialDetail.getMaterialName()); + MaterialBaseInfoPO materialBaseInfoPO = reservationStockInOrderMapper.getinfo(materialBaseInfoId); + gwOutDetail.setSpec(materialBaseInfoPO.getSpecificationModel()); + gwOutDetail.setUnit(materialBaseInfoPO.getDeclarationUnit()); + gwOutDetail.setQty(reservationOutMaterialDetail.getQuantity()); + gwOutDetail.setErp_curr(materialBaseInfoPO.getCurrency()); + gwOutDetail.setErp_price(materialBaseInfoPO.getUnitPrice()); + BigDecimal unitPrice = materialBaseInfoPO.getUnitPrice(); + BigDecimal quantity = reservationOutMaterialDetail.getQuantity(); + if (unitPrice != null && quantity != null && unitPrice.compareTo(BigDecimal.ZERO) != 0&&quantity.compareTo(BigDecimal.ZERO) != 0) { + BigDecimal Amount = unitPrice.multiply(quantity).setScale(2, BigDecimal.ROUND_HALF_UP); + gwOutDetail.setAmount(Amount); + } + orderList.add(gwOutDetail); + + Long kcId = reservationOutMaterialDetailMapper.getKcId(reservationOutMaterialDetail.getLotNo()); + String inOrderNumber = reservationOutMaterialDetailMapper.getInOrderNumber(kcId); + String inLotNo = reservationOutMaterialDetailMapper.getInLotNo(inOrderNumber,materialBaseInfoId); + String warehouse = reservationOutMaterialDetailMapper.getWarehouse(kcId); + String opWhLoc = reservationOutMaterialDetailMapper.getOpWhLoc(kcId); + Integer result = null; + if (inLotNo != null && inLotNo.contains("-")) { + // 截取最后一个 "-" 后面的内容(兼容多 "-" 场景) + String numStr = inLotNo.substring(inLotNo.lastIndexOf("-") + 1); + // 转成 Integer + result = Integer.valueOf(numStr); + } + gwOutDetail.setOrder_i_no(inOrderNumber); + gwOutDetail.setBill_i(inLotNo); + gwOutDetail.setOrder_i_row(result); + gwOutDetail.setBill_i_row(result); + gwOutDetail.setWarehouse(warehouse); + gwOutDetail.setOp_wh_loc(opWhLoc); + } + gwStockOutOrder.setOrderList(orderList); + + GwLog gwLog = new GwLog(); + gwLog.setType("企业国别"); + gwLog.setBusinessId(id); + gwLog.setRequestBody(com.alibaba.fastjson.JSONObject.toJSONString(gwStockOutOrder)); + gwLog.setResponseBody(""); + gwLog.setStatus(1); + gwLog.setSendTime(new Date()); + gwLog.setOrganizationId(organizationId); + gwLog.setTopOrganizationId(topOrganizationId); + gwLog.setOrganizationName(organizationName); + gwLog.setCreateBy(pushBy); + gwLog.setCreateTime(new Date()); + gwLog.setDelFlag(1); + gwLogMapper.insert(gwLog); + + updatePushStatus(id, 2, new Date(), pushBy,pushByName); + + CloseableHttpClient httpClient = HttpClients.createDefault(); + HttpPost httpPost = new HttpPost(PUSH_API_URL); + StringEntity postingString = new StringEntity(com.alibaba.fastjson.JSONObject.toJSONString(gwStockOutOrder), "UTF-8"); + httpPost.setEntity(postingString); + httpPost.setHeader("Content-type", "application/json"); + httpPost.setHeader("apiName", API_NAME); + httpPost.setHeader("verify", VERIFY); + + try { + CloseableHttpResponse response = httpClient.execute(httpPost); + String responseString = EntityUtils.toString(response.getEntity()); + gwLog.setResponseBody(responseString); + + if (response.getStatusLine().getStatusCode() == 200) { + gwLog.setStatus(2); + updatePushStatus(id, 3, new Date(), pushBy,pushByName); + successCount++; + } else { + gwLog.setStatus(3); + gwLog.setErrorMsg(responseString); + updatePushStatus(id, 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpCountryCode:").append(id).append("失败;"); + } + gwLogMapper.updateById(gwLog); + response.close(); + } catch (IOException e) { + gwLog.setStatus(3); + gwLog.setErrorMsg(e.getMessage()); + gwLog.setResponseBody("请求异常:" + e.getMessage()); + gwLogMapper.updateById(gwLog); + updatePushStatus(id, 4, new Date(), pushBy,pushByName); + failCount++; + failMsg.append("erpCountryCode:").append(id).append("异常:").append(e.getMessage()).append(";"); + log.error("企业国别推送异常: id={}, error={}", id, e.getMessage()); + } finally { + try { + httpClient.close(); + } catch (Exception e) { + log.error("关闭httpClient异常: {}", e.getMessage()); + } + } + } + + String resultMsg = "推送完成: 成功" + successCount + "条, 失败" + failCount + "条"; + if (failCount > 0) { + resultMsg += "[" + failMsg.toString() + "]"; + } + return AjaxResult.success(resultMsg); + } + + private void updatePushStatus(Long id, Integer pushStatus, Date pushTime, Long pushBy,String pushByName) { + ReservationStockOutOrder entity = new ReservationStockOutOrder(); + entity.setOutOrderId(id); + entity.setPushStatus(pushStatus); + if (pushTime != null) { + entity.setPushTime(pushTime); + } + if (pushBy != null) { + entity.setPushBy(pushBy); + } + if (pushByName != null) { + entity.setPushByName(pushByName); + } + reservationStockOutOrderMapper.updateById(entity); + } } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/entity/ReserveStockInOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/entity/ReserveStockInOrder.java index 9730920d7..7d02bbc4e 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/entity/ReserveStockInOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/entity/ReserveStockInOrder.java @@ -120,9 +120,9 @@ public class ReserveStockInOrder extends BaseVOEntity { private String supplierName; @ApiModelProperty("预计到货时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd") private Date expectTime; @ApiModelProperty("供应链订单号") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/po/ReserveStockInOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/po/ReserveStockInOrderPO.java index c8db2d5f3..c742e4208 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/po/ReserveStockInOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/po/ReserveStockInOrderPO.java @@ -122,9 +122,9 @@ public class ReserveStockInOrderPO extends BaseVOEntity { private String supplierName; @ApiModelProperty("预计到货时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd") private Date expectTime; @ApiModelProperty("供应链订单号") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDO.java index 9696400df..658573e06 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDO.java @@ -119,9 +119,9 @@ public class ReserveStockInOrderDO extends BaseVOEntity { private String supplierName; @ApiModelProperty("预计到货时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd") private Date expectTime; @ApiModelProperty("供应链订单号") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDTO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDTO.java index e00e2d35a..1de6c28b2 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDTO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/todo/ReserveStockInOrderDTO.java @@ -117,9 +117,9 @@ public class ReserveStockInOrderDTO extends ReserveStockInOrderBaseDTO { private String supplierName; @ApiModelProperty("预计到货时间") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd") private Date expectTime; @ApiModelProperty("供应链订单号") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/InAndOutListVo.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/InAndOutListVo.java index 89473df7c..4d677eb4a 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/InAndOutListVo.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockInOrder/repository/vo/InAndOutListVo.java @@ -150,4 +150,6 @@ public class InAndOutListVo extends BaseVOEntity { private String businessOrderNo; @ApiModelProperty("入或出 in/out") private String inOrOut; + @ApiModelProperty("是否需要运输(默认:否)") + private Integer needTransport; } \ No newline at end of file diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java index df038d1d2..a4f468e7f 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/entity/ReserveStockOutOrder.java @@ -334,8 +334,8 @@ public class ReserveStockOutOrder extends BaseVOEntity { private String containerNoName; @ApiModelProperty("出仓日期") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") @Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd") private Date outboundDate; @ApiModelProperty("完成时间") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java index ff1b7b4ce..d408ae853 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/po/ReserveStockOutOrderPO.java @@ -336,8 +336,8 @@ public class ReserveStockOutOrderPO extends BaseVOEntity { private String containerNoName; @ApiModelProperty("出仓日期") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") @Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd") private Date outboundDate; @ApiModelProperty("完成时间") diff --git a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java index 764b2a85d..65cfb51d8 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java +++ b/mhd_oms/src/main/java/com/mhd/oms/domain/reserveStockOutOrder/repository/todo/ReserveStockOutOrderDO.java @@ -359,8 +359,8 @@ public class ReserveStockOutOrderDO extends BaseVOEntity { private String containerNoName; @ApiModelProperty("出仓日期") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") @Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd") private Date outboundDate; @ApiModelProperty("完成时间") diff --git a/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml b/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml index 99b3b9a1d..00153637b 100644 --- a/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationOutMaterialDetail/ReservationOutMaterialDetailMapper.xml @@ -405,4 +405,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item.uniqueId} + + + + + + + \ No newline at end of file diff --git a/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml b/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml index 5887e0b67..e95b956e9 100644 --- a/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml +++ b/mhd_oms/src/main/resources/mapper/reservationStockInOrder/ReservationStockInOrderMapper.xml @@ -467,7 +467,9 @@ select * from "NGWL_TEST_WMS".MATERIAL_GOODS_RULE where MATERIAL_BASE_INFO_ID = #{id} - +