关务相关修改;omsbug修改;
This commit is contained in:
+9
@@ -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<Reservati
|
||||
* @return int
|
||||
*/
|
||||
public int batchAddPickingQuantityByUniqueIds(ReservationOutMaterialDetailDO outMaterialDetailDO);
|
||||
|
||||
public Long getKcId(@Param("lotNo") String lotNo);
|
||||
|
||||
public String getInOrderNumber(@Param("id") Long id);
|
||||
public String getWarehouse(@Param("id") Long id);
|
||||
public String getOpWhLoc(@Param("id") Long id);
|
||||
|
||||
public String getInLotNo(@Param("inOrderNumber") String inOrderNumber, @Param("baseId") Long baseId);
|
||||
}
|
||||
+13
-3
@@ -409,8 +409,18 @@ public class ReservationStockInOrder 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;
|
||||
|
||||
}
|
||||
+2
@@ -33,6 +33,8 @@ public interface ReservationStockInOrderMapper extends BaseMapper<ReservationSto
|
||||
|
||||
public MaterialGoodsRulePO getGoodsInfoByMaterialBaseInfoIds(@Param("id") Long id);
|
||||
|
||||
public String getUserNcCode(@Param("id") Long id);
|
||||
|
||||
|
||||
List<ReservationStockInOrderPO> queryNoticePrint(ReservationStockInOrderDO stockInOrderDO);
|
||||
List<ReservationInMaterialDetailPO> queryNoticePrintDetail(ReservationStockInOrderDO stockInOrderDO);}
|
||||
+13
-3
@@ -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;
|
||||
|
||||
}
|
||||
+13
-3
@@ -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;
|
||||
}
|
||||
+13
-3
@@ -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;
|
||||
}
|
||||
+3
@@ -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<GwInDetail> orderList;
|
||||
|
||||
}
|
||||
+193
-28
@@ -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<List<Map<String, Object>>>(){});
|
||||
}
|
||||
|
||||
|
||||
if (shipperList != null && !shipperList.isEmpty()) {
|
||||
String normalizedShipperName = shipperName != null ? shipperName.trim() : "";
|
||||
String normalizedShipperCode = shipperCode != null ? shipperCode.trim() : "";
|
||||
|
||||
|
||||
for (Map<String, Object> 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<Long> 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<ReservationInMaterialDetail> reservationInMaterialDetails = reservationInMaterialDetailMapper.selectList(new LambdaQueryWrapper<ReservationInMaterialDetail>().eq(ReservationInMaterialDetail::getInOrderNumber, reservationStockInOrder.getInOrderNumber()));
|
||||
Integer lineNum = 1;
|
||||
List<GwInDetail> 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);
|
||||
}
|
||||
}
|
||||
+13
-3
@@ -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;
|
||||
|
||||
}
|
||||
+13
-3
@@ -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;
|
||||
}
|
||||
+13
-3
@@ -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;
|
||||
}
|
||||
+13
-3
@@ -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;
|
||||
}
|
||||
+3
@@ -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<GwOutDetail> orderList;
|
||||
|
||||
}
|
||||
+192
-2
@@ -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<Long> 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<ReservationOutMaterialDetail> reservationOutMaterialDetails = reservationOutMaterialDetailMapper.selectList(new LambdaQueryWrapper<ReservationOutMaterialDetail>().eq(ReservationOutMaterialDetail::getOutOrderNumber, reservationStockOutOrder.getOutOrderNumber()));
|
||||
Integer lineNum = 1;
|
||||
List<GwOutDetail> 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);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -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("供应链订单号")
|
||||
|
||||
+3
-3
@@ -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("供应链订单号")
|
||||
|
||||
+3
-3
@@ -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("供应链订单号")
|
||||
|
||||
+3
-3
@@ -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("供应链订单号")
|
||||
|
||||
+2
@@ -150,4 +150,6 @@ public class InAndOutListVo extends BaseVOEntity {
|
||||
private String businessOrderNo;
|
||||
@ApiModelProperty("入或出 in/out")
|
||||
private String inOrOut;
|
||||
@ApiModelProperty("是否需要运输(默认:否)")
|
||||
private Integer needTransport;
|
||||
}
|
||||
+2
-2
@@ -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("完成时间")
|
||||
|
||||
+2
-2
@@ -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("完成时间")
|
||||
|
||||
+2
-2
@@ -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("完成时间")
|
||||
|
||||
Reference in New Issue
Block a user