进口仓单推送-Log修改

This commit is contained in:
zhaoqing
2026-05-28 15:43:00 +08:00
parent 54d943ea10
commit b98dcee352
6 changed files with 78 additions and 7 deletions
@@ -45,4 +45,12 @@ public interface OmsServiceFeign {
@ApiOperation("查询企业国别列表-新增物料时显示下拉框数据")
@GetMapping("/erpCountryApi/countryList")
public AjaxResult getCountryList(ErpCountryDTO erpCountryDTO);
@ApiOperation("保存gwlog")
@PostMapping("/gwLogApi/saveGwLog")
AjaxResult insertGwLog(@RequestBody GwLogDTO gwLogDTO);
@ApiOperation("修改gwlog")
@PostMapping("/gwLogApi/updateGwLog")
AjaxResult updateGwLog(@RequestBody GwLogDTO gwLogDTO);
}
@@ -51,6 +51,4 @@ public class GwLogDTO {
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("删除标记:1-正常,0-删除")
private Integer delFlag;
}
@@ -68,6 +68,16 @@ public class RemoteOmsFeignFallbackFactory implements FallbackFactory<OmsService
public AjaxResult getCountryList(ErpCountryDTO erpCountryDTO) {
return null;
}
@Override
public AjaxResult insertGwLog(GwLogDTO gwLogDTO) {
return null;
}
@Override
public AjaxResult updateGwLog(GwLogDTO gwLogDTO) {
return null;
}
};
}
}
@@ -7,6 +7,8 @@ import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class GwLogDTO {
@@ -42,4 +44,29 @@ public class GwLogDTO {
@ApiModelProperty(value = "每页数量")
private Integer pageSize = 10;
@ApiModelProperty("日志id")
private Long logId;
@ApiModelProperty("请求报文")
private String requestBody;
@ApiModelProperty("响应报文")
private String responseBody;
@ApiModelProperty("错误信息")
private String errorMsg;
@ApiModelProperty("推送时间")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sendTime;
@ApiModelProperty("组织名称")
private String organizationName;
@ApiModelProperty("创建人")
private Long createBy;
@ApiModelProperty("创建时间")
private Date createTime;
}
@@ -50,15 +50,15 @@ public class GwLogApi extends BaseController {
}
@ApiOperation("查询GW日志")
@ApiOperation("保存GW日志")
@PostMapping("/saveGwLog")
public AjaxResult saveGwLog(GwLogDTO gwLogDTO){
public AjaxResult saveGwLog(@RequestBody GwLogDTO gwLogDTO){
return gwLogApplicationService.insertGwLog(gwLogDTO);
}
@ApiOperation("查询GW日志")
@ApiOperation("更新GW日志")
@PostMapping("/updateGwLog")
public AjaxResult updateGwLog(GwLogDTO gwLogDTO){
public AjaxResult updateGwLog(@RequestBody GwLogDTO gwLogDTO){
return gwLogApplicationService.updateGwLog(gwLogDTO);
}
@@ -2681,8 +2681,18 @@ public class StockShelfOrderApplicationService {
gwLogDTO.setOrganizationName(organizationName);
gwLogDTO.setCreateBy(pushBy);
gwLogDTO.setCreateTime(new Date());
gwLogDTO.setDelFlag(1);
//gwLogMapper.insert(gwLogDTO);
Long gwLogId = null;
try {
AjaxResult insertResult = omsServiceFeign.insertGwLog(gwLogDTO);
if(insertResult !=null && "200".equals(String.valueOf(insertResult.get("code")))){
Map<?,?>data = (Map<?,?>)insertResult.get("data");
gwLogId = ((Number)data.get("id")).longValue();
}
}catch(Exception e){
log.error("保存Gwlog失败:{}",e.getMessage());
}
updatePushStatus(id, 2, new Date(), pushBy,pushByName);
@@ -2710,13 +2720,31 @@ public class StockShelfOrderApplicationService {
failCount++;
failMsg.append("id:").append(id).append("失败;");
}
if (gwLogId != null){
gwLogDTO.setLogId(gwLogId);
try{
AjaxResult updateResult = omsServiceFeign.updateGwLog(gwLogDTO);
}catch (Exception e){
log.error("更新GwLog失败:{}",e.getMessage());
}
}
// gwLogMapper.updateById(gwLog);
response.close();
} catch (IOException e) {
gwLogDTO.setStatus(3);
gwLogDTO.setErrorMsg(e.getMessage());
gwLogDTO.setResponseBody("请求异常:" + e.getMessage());
// gwLogMapper.updateById(gwLog);
if (gwLogId != null){
gwLogDTO.setLogId(gwLogId);
try{
AjaxResult updateResult = omsServiceFeign.updateGwLog(gwLogDTO);
}catch (Exception ex){
log.error("更新GwLog失败:{}",ex.getMessage());
}
}
updatePushStatus(id, 4, new Date(), pushBy,pushByName);
failCount++;
failMsg.append("id:").append(id).append("异常:").append(e.getMessage()).append(";");