diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java index 70dd16a19..48fa38331 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/WmsServiceFeign.java @@ -106,5 +106,6 @@ public interface WmsServiceFeign { public AjaxResult updateMaterialPushStatus(@RequestParam("materialBaseInfoId") Long materialBaseInfoId, @RequestParam("pushStatus") Integer pushStatus, @RequestParam(value = "pushTime",required = false) String pushTime, - @RequestParam(value = "pushBy",required = false) Long pushBy); + @RequestParam(value = "pushBy",required = false) Long pushBy, + @RequestParam(value = "pushByName",required = false) String pushByName); } \ No newline at end of file diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java index cd085eca7..5b0cb292e 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteWmsFallbackFactory.java @@ -82,7 +82,7 @@ public class RemoteWmsFallbackFactory implements FallbackFactory updateMaterialPushStatus(Long materialBaseInfoId, Integer pushStatus, String pushTime, Long pushBy) { + public AjaxResult updateMaterialPushStatus(Long materialBaseInfoId, Integer pushStatus, String pushTime, Long pushBy, String pushByName) { return AjaxResult.error(cause.getMessage()); } }; diff --git a/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java index e1b766c18..e5b650fd5 100644 --- a/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java +++ b/mhd_oms/src/main/java/com/mhd/oms/application/service/materialInfo/MaterialInfoApplicationService.java @@ -69,6 +69,7 @@ public class MaterialInfoApplicationService { 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; @@ -110,7 +111,7 @@ public class MaterialInfoApplicationService { gwLog.setDelFlag(1); gwLogMapper.insert(gwLog); - updatePushStatus(dto.getMaterialBaseInfoId(), 2, new Date(), pushBy); + updatePushStatus(dto.getMaterialBaseInfoId(), 2, new Date(), pushBy,pushByName); CloseableHttpClient httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost(PUSH_API_URL); @@ -126,12 +127,12 @@ public class MaterialInfoApplicationService { if (response.getStatusLine().getStatusCode() == 200) { gwLog.setStatus(2); - updatePushStatus(dto.getMaterialBaseInfoId(), 3, new Date(), pushBy); + updatePushStatus(dto.getMaterialBaseInfoId(), 3, new Date(), pushBy, pushByName); successCount++; } else { gwLog.setStatus(3); gwLog.setErrorMsg(responseString); - updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy); + updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy, pushByName); failCount++; failMsg.append("materialCode:").append(dto.getMaterialCode()).append("失败;"); } @@ -141,7 +142,7 @@ public class MaterialInfoApplicationService { gwLog.setStatus(3); gwLog.setErrorMsg(e.getMessage()); gwLogMapper.updateById(gwLog); - updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy); + updatePushStatus(dto.getMaterialBaseInfoId(), 4, new Date(), pushBy, pushByName); failCount++; failMsg.append("materialCode:").append(dto.getMaterialCode()).append("异常:").append(e.getMessage()).append(";"); log.error("物料推送异常: id={}, error={}", dto.getMaterialBaseInfoId(), e.getMessage()); @@ -161,10 +162,10 @@ public class MaterialInfoApplicationService { return AjaxResult.success(resultMsg); } - private void updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTime, Long pushBy) { + private void updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTime, Long pushBy, String pushByName) { try { String pushTimeStr = pushTime != null ? DateUtil.format(pushTime, "yyyy-MM-dd HH:mm:ss") : null; - wmsServiceFeign.updateMaterialPushStatus(materialBaseInfoId, pushStatus, pushTimeStr, pushBy); + wmsServiceFeign.updateMaterialPushStatus(materialBaseInfoId, pushStatus, pushTimeStr, pushBy, pushByName); log.info("更新返回结果: materialBaseInfoId={}", materialBaseInfoId); } catch (Exception e) { log.info("更新推送状态失败: materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage()); diff --git a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java index 77f93cd84..53f5a8de6 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java +++ b/mhd_wms/src/main/java/com/mhd/wms/application/service/materialBaseInfo/MaterialBaseInfoApplicationService.java @@ -1153,12 +1153,13 @@ public class MaterialBaseInfoApplicationService { return orgCandidates; } - public int updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTimeDate, Long pushBy) { + public int updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTimeDate, Long pushBy, String pushByName) { MaterialBaseInfo materialBaseInfo = new MaterialBaseInfo(); materialBaseInfo.setMaterialBaseInfoId(materialBaseInfoId); materialBaseInfo.setPushStatus(pushStatus); materialBaseInfo.setPushTime(pushTimeDate); materialBaseInfo.setPushBy(pushBy); + materialBaseInfo.setPushByName(pushByName); return materialBaseInfoMapper.updateById(materialBaseInfo); } diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java index 0acb506a9..9e470bc5b 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/entity/MaterialBaseInfo.java @@ -220,6 +220,9 @@ public class MaterialBaseInfo extends BaseVOEntity { @ApiModelProperty(name = "推送人") private Long pushBy; + @ApiModelProperty(name = "推送人名称") + private String pushByName; + @ApiModelProperty("毛重(kg)") @Excel(name = "毛重(kg)") private BigDecimal grossWeight; diff --git a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java index bc6c3adbd..448ea452e 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/domain/materialBaseInfo/repository/po/MaterialBaseInfoPO.java @@ -272,4 +272,7 @@ public class MaterialBaseInfoPO extends BaseVOEntity { @ApiModelProperty("推送人") private Long pushBy; + @ApiModelProperty(name = "推送人名称") + private String pushByName; + } \ No newline at end of file diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java index b5505a50a..8a6fa978d 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/dto/materialBaseInfo/MaterialBaseInfoDTO.java @@ -293,4 +293,7 @@ public class MaterialBaseInfoDTO extends BaseVOEntity { @ApiModelProperty("更新时间止") private String updateTimeEnd; + + @ApiModelProperty(name = "推送人名称") + private String pushByName; } diff --git a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java index 9e9778acf..3cac82a3f 100644 --- a/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java +++ b/mhd_wms/src/main/java/com/mhd/wms/interfaces/facadeApi/materialBaseInfo/MaterialBaseInfoApi.java @@ -118,12 +118,13 @@ public class MaterialBaseInfoApi extends BaseController { public AjaxResult updateMaterialPushStatus(@RequestParam("materialBaseInfoId") Long materialBaseInfoId, @RequestParam("pushStatus") Integer pushStatus, @RequestParam(value = "pushTime",required = false) String pushTime, - @RequestParam(value = "pushBy",required = false) Long pushBy){ + @RequestParam(value = "pushBy",required = false) Long pushBy, + @RequestParam(value = "pushByName",required = false) String pushByName){ Date pushTimeDate = null; if (StringUtils.isNotBlank(pushTime)) { pushTimeDate = DateUtil.parse(pushTime); } - return toAjax(materialBaseInfoApplicationService.updatePushStatus(materialBaseInfoId, pushStatus, pushTimeDate, pushBy)); + return toAjax(materialBaseInfoApplicationService.updatePushStatus(materialBaseInfoId, pushStatus, pushTimeDate, pushBy, pushByName)); } @ApiOperation("查询物料基础信息列表")