diff --git a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java index 630c3b445..66f3310ec 100644 --- a/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java +++ b/coolstore-partner-service/src/main/java/com/cool/store/service/impl/BuildInformationServiceImpl.java @@ -27,12 +27,12 @@ import java.util.*; import java.util.stream.Collectors; /** -* @author EDY -* @description 针对表【xfsg_build_information(建店资料表)】的数据库操作Service实现 -* @createDate 2024-10-09 14:05:52 -*/ + * @author EDY + * @description 针对表【xfsg_build_information(建店资料表)】的数据库操作Service实现 + * @createDate 2024-10-09 14:05:52 + */ @Service -public class BuildInformationServiceImpl implements BuildInformationService{ +public class BuildInformationServiceImpl implements BuildInformationService { @Resource private BuildInformationDAO buildInformationDAO; @@ -56,6 +56,7 @@ public class BuildInformationServiceImpl implements BuildInformationService{ private OrderSysInfoDAO orderSysInfoDAO; @Resource private WarehouseInfoMapper warehouseInfoMapper; + @Override public BuildInformationResponse getBuildInformation(Long shopId) { BuildInformationResponse response = new BuildInformationResponse(); @@ -78,7 +79,7 @@ public class BuildInformationServiceImpl implements BuildInformationService{ extracted(response, informationDO); } OrderSysInfoDO orderSysInfoDO = orderSysInfoDAO.selectByShopId(shopId); - if (Objects.nonNull(orderSysInfoDO)){ + if (Objects.nonNull(orderSysInfoDO)) { response.setAddresseeName(orderSysInfoDO.getAddresseeName()); response.setAddresseeMobile(orderSysInfoDO.getAddresseeMobile()); response.setXgjVicePresident(orderSysInfoDO.getXgjVicePresident()); @@ -95,7 +96,9 @@ public class BuildInformationServiceImpl implements BuildInformationService{ response.setReceivingMsBankBranch(orderSysInfoDO.getReceivingMsBankBranch()); response.setBankUnionPayAccount(orderSysInfoDO.getBankUnionPayAccount()); WarehouseInfoDO warehouseInfoDO = warehouseInfoMapper.getByCode(orderSysInfoDO.getDeclareGoodsLogisticsWarehouse()); - response.setDeclareGoodsLogisticsWarehouseName(warehouseInfoDO.getWarehouseName()); + if (Objects.nonNull(warehouseInfoDO)) { + response.setDeclareGoodsLogisticsWarehouseName(warehouseInfoDO.getWarehouseName()); + } } return response; @@ -145,19 +148,19 @@ public class BuildInformationServiceImpl implements BuildInformationService{ ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(request.getShopId()); LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId()); HashMap map = new HashMap<>(); - map.put("partnerUsername",lineInfoDO.getUsername()); - map.put("partnerMobile",lineInfoDO.getMobile()); - map.put("storeName",shopInfoDO.getShopName()); + map.put("partnerUsername", lineInfoDO.getUsername()); + map.put("partnerMobile", lineInfoDO.getMobile()); + map.put("storeName", shopInfoDO.getShopName()); List logisticsList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.LOGISTICS, shopInfoDO.getRegionId()); List logistics = new ArrayList<>(); - if (Objects.nonNull(logisticsList)){ + if (Objects.nonNull(logisticsList)) { logistics.addAll(logisticsList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList())); } commonService.sendQWMessage(logistics, MessageEnum.MESSAGE_52, map); return buildInformationDAO.insertSelective(buildInformationDO); - }else { + } else { buildInformationDO.setUpdateTime(new Date()); return buildInformationDAO.updateByShopIdSelective(buildInformationDO); }