diff --git a/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java b/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java index cfca47b8..2759e309 100644 --- a/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java +++ b/xhpc-modules/xhpc-card/src/main/java/com/xhpc/card/service/impl/XhpcCardServiceImpl.java @@ -365,6 +365,12 @@ public class XhpcCardServiceImpl implements IXhpcCardService { if (bindCardInfo.getCardType() != 1) { R.fail("该卡不是联网卡"); } + if (bindCardInfo.getUserType() !=null || "".equals(bindCardInfo.getUserType())) { + R.fail("请选择绑定的用户类型"); + } + if (bindCardInfo.getUserAccount() !=null || "".equals(bindCardInfo.getUserAccount())) { + R.fail("请选择绑定的用户"); + } //build an association XhpcIcCardInfo xhpcIcCardInfo = new XhpcIcCardInfo(); SysUser sysUser = tokenService.getLoginUser().getSysUser(); diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java index 298cf914..18541b7b 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java @@ -42,4 +42,12 @@ public interface UserTypeService { @GetMapping("/common/insertUserBalance") R insertUserBalance(@RequestParam(value = "money")BigDecimal money, @RequestParam(value = "userId")Long userId, @RequestParam(value = "userType")Integer userType, @RequestParam(value = "tenantId")String tenantId, @RequestParam(value = "type")Integer type, @RequestParam(value = "status")Integer status, @RequestParam(value = "remark")String remark,@RequestParam(value = "moneyOrderId")Long moneyOrderId); + + /** + * 获取该机构的折扣比例 + */ + @GetMapping("/common/getMechanismDiscount") + R getMechanismDiscount(@RequestParam(value = "userId")Long userId, @RequestParam(value = "userType")Integer userType, @RequestParam(value = "tenantId")String tenantId); + + } diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java index 0e956717..e97b938c 100644 --- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java +++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/factory/UserTypeFallbackFactory.java @@ -30,6 +30,11 @@ public class UserTypeFallbackFactory implements FallbackFactory public R insertUserBalance(BigDecimal money,Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark,Long moneyOrderId) { return R.fail("添加用户金额信息失败:" + cause.getMessage()); } + + @Override + public R getMechanismDiscount(Long userId, Integer userType, String tenantId) { + return R.fail("机构信息获取失败:" + cause.getMessage()); + } }; } } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java index 486a2492..15012c71 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcHistoryOrderServiceImpl.java @@ -363,7 +363,7 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis try { Map byId = xhpcHistoryOrderMapper.getById(historyOrderId); if (byId != null) { - byId.putAll(getRateTime(byId.get("serialNumber").toString(), byId.get("actPrice").toString())); + byId.putAll(getRateTime(byId.get("serialNumber").toString(), byId.get("totalPrice").toString())); } return AjaxResult.success(byId); } catch (Exception e) { @@ -775,7 +775,7 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis /** * 历史信息费率时段 */ - private Map getRateTime(String serialNumber, String actPrice) { + private Map getRateTime(String serialNumber, String totalPrice) { BigDecimal powerPriceTotal = new BigDecimal(0); BigDecimal servicePriceTotal = new BigDecimal(0); @@ -790,32 +790,32 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis //1时间没有跨天 long betweenDay = DateUtil.between(startTime2, updateTime2, DateUnit.DAY); if (betweenDay == 0) { - return getBigDecimal(actPrice, powerPriceTotal, servicePriceTotal, chargeOrder, rateModelId, startTime2, updateTime2, chargingDegree, list); + return getBigDecimal(totalPrice, powerPriceTotal, servicePriceTotal, chargeOrder, rateModelId, startTime2, updateTime2, chargingDegree, list); } else { //跨天 Date updateTime = DateUtil.endOfDay(startTime2); - Map map1 = getBigDecimal(actPrice, powerPriceTotal, servicePriceTotal, chargeOrder, rateModelId, startTime2, updateTime, chargingDegree, list); + Map map1 = getBigDecimal(totalPrice, powerPriceTotal, servicePriceTotal, chargeOrder, rateModelId, startTime2, updateTime, chargingDegree, list); //获取 BigDecimal powerPriceTotal1 = new BigDecimal(map1.get("powerPriceTotal").toString()); BigDecimal servicePriceTotal1 = new BigDecimal(map1.get("servicePriceTotal").toString()); //明天 DateTime tomorrow = DateUtil.offsetDay(startTime2, 1); Date startTime3 = DateUtil.beginOfDay(tomorrow); - Map map2 = getBigDecimal(actPrice, powerPriceTotal1, servicePriceTotal1, chargeOrder, rateModelId, startTime3, updateTime2, chargingDegree, list); + Map map2 = getBigDecimal(totalPrice, powerPriceTotal1, servicePriceTotal1, chargeOrder, rateModelId, startTime3, updateTime2, chargingDegree, list); return map2; } } - private Map getBigDecimal(String actPrice, BigDecimal powerPriceTotal, BigDecimal servicePriceTotal, XhpcChargeOrder chargeOrder, Long rateModelId, Date startTime2, Date updateTime2, BigDecimal chargingDegree, List> list) { + private Map getBigDecimal(String totalPrice, BigDecimal powerPriceTotal, BigDecimal servicePriceTotal, XhpcChargeOrder chargeOrder, Long rateModelId, Date startTime2, Date updateTime2, BigDecimal chargingDegree, List> list) { Map map = new HashMap<>(); if(chargingDegree.compareTo(new BigDecimal(0))==0){ Map map1 = new HashMap<>(); map1.put("time", 0); - map1.put("powerPrice", actPrice); + map1.put("powerPrice", totalPrice); map1.put("servicePrice", 0); map1.put("chargingDegree", chargeOrder.getChargingDegree()); - map1.put("actPrice", actPrice); + map1.put("actPrice", totalPrice); list.add(map1); map.put("list", list);//数据列表 return map; @@ -827,10 +827,10 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis if(decimal.compareTo(new BigDecimal(0))==0){ Map map1 = new HashMap<>(); map1.put("time", 0); - map1.put("powerPrice", actPrice); + map1.put("powerPrice", totalPrice); map1.put("servicePrice", 0); map1.put("chargingDegree", chargeOrder.getChargingDegree()); - map1.put("actPrice", actPrice); + map1.put("actPrice", totalPrice); list.add(map1); map.put("list", list);//数据列表 return map; @@ -853,7 +853,7 @@ public class XhpcHistoryOrderServiceImpl extends BaseService implements IXhpcHis map1.put("powerPrice", powerFee); map1.put("servicePrice", servicePrice); map1.put("chargingDegree", chargeOrder.getChargingDegree()); - map1.put("actPrice", actPrice); + map1.put("actPrice", totalPrice); list.add(map1); } else { for (int i = 0; i < reatTimeList.size(); i++) { diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java index 5794d421..b27e427b 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcRealTimeOrderServiceImpl.java @@ -443,39 +443,92 @@ public class XhpcRealTimeOrderServiceImpl extends BaseService implements IXhpcRe } } } + // if ( !UserTypeUtil.INTERNET_TYPE.equals(source)) { //用户第几次充电 - int count = xhpcChargeOrderService.getCount(userId,null,source,xhpcChargeOrder.getTenantId()); - if (count == 0) { - //活动折扣 - Map promotion = xhpcChargeOrderService.getPromotion(); - if (promotion != null && promotion.get("state") != null && promotion.get("discount") != null) { - //state 1.总金额 2.电费 3.服务费 discount 折扣率 - String state = promotion.get("state").toString(); - BigDecimal discount =new BigDecimal(promotion.get("discount").toString()).divide(new BigDecimal(100)); +// int count = xhpcChargeOrderService.getCount(userId,null,source,xhpcChargeOrder.getTenantId()); +// if (count == 0) { +// //活动折扣 +// Map promotion = xhpcChargeOrderService.getPromotion(); +// if (promotion != null && promotion.get("state") != null && promotion.get("discount") != null) { +// //state 1.总金额 2.电费 3.服务费 discount 折扣率 +// String state = promotion.get("state").toString(); +// BigDecimal discount =new BigDecimal(promotion.get("discount").toString()).divide(new BigDecimal(100)); +// +// if(discount.compareTo(new BigDecimal(0))==1){ +// if("1".equals(state) || "2".equals(state) || "3".equals(state)){ +// //折扣的钱 +// promotionDiscount=money.multiply(discount).setScale(2,BigDecimal.ROUND_HALF_UP); +// //剩余的总金额 +// actPrice = money.subtract(promotionDiscount); +// +// BigDecimal decimal1 = surplusPowerPrice.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP); +// BigDecimal decimal2 = surplusServicePrice.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP); +// if("1".equals(state)){ +// //总金额 +// actPrice =actPrice.subtract(decimal1.add(decimal2)); +// //折扣的钱 +// promotionDiscount = decimal1.add(decimal2); +// surplusPowerPrice = surplusPowerPrice.subtract(decimal1); +// surplusServicePrice= surplusServicePrice.subtract(decimal2); +// }else if("2".equals(state)){ +// //电费 +// surplusPowerPrice=surplusPowerPrice.subtract(decimal1); +// }else{ +// //服务费 +// surplusServicePrice =surplusServicePrice.subtract(decimal2); +// } +// } +// } +// } +// } + if(UserTypeUtil.COMMUNIT_TYPE.equals(source) || UserTypeUtil.CUSTOMERS_TYPE.equals(source)){ + //折扣(机构用户),没有活动时计算 + R mechanismDiscount = userTypeService.getMechanismDiscount(userId, source, xhpcChargeOrder.getTenantId()); + if(mechanismDiscount !=null && mechanismDiscount.getData() !=null) { + Map userDiscount = (Map) mechanismDiscount.getData(); + if (userDiscount != null && userDiscount.get("commissionType") != null && userDiscount.get("servicePreferential") != null) { + String commissionType = userDiscount.get("commissionType").toString(); + BigDecimal servicePreferential =new BigDecimal(userDiscount.get("servicePreferential").toString()).divide(new BigDecimal(100),2,BigDecimal.ROUND_HALF_UP); - if(discount.compareTo(new BigDecimal(0))==1){ - if("1".equals(state) || "2".equals(state) || "3".equals(state)){ - //折扣的钱 - promotionDiscount=money.multiply(discount).setScale(2,BigDecimal.ROUND_HALF_UP); - //剩余的总金额 - actPrice = money.subtract(promotionDiscount); - - BigDecimal decimal1 = surplusPowerPrice.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP); - BigDecimal decimal2 = surplusServicePrice.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_UP); - if("1".equals(state)){ - //总金额 - actPrice =actPrice.subtract(decimal1.add(decimal2)); - //折扣的钱 - promotionDiscount = decimal1.add(decimal2); - surplusPowerPrice = surplusPowerPrice.subtract(decimal1); - surplusServicePrice= surplusServicePrice.subtract(decimal2); - }else if("2".equals(state)){ - //电费 - surplusPowerPrice=surplusPowerPrice.subtract(decimal1); - }else{ - //服务费 - surplusServicePrice =surplusServicePrice.subtract(decimal2); + if(servicePreferential.compareTo(new BigDecimal(0))==1){ + if("0".equals(commissionType) || "1".equals(commissionType) || "2".equals(commissionType)){ + BigDecimal decimal1 = surplusPowerPrice.multiply(servicePreferential).setScale(2, BigDecimal.ROUND_HALF_UP); + BigDecimal decimal2 = surplusServicePrice.multiply(servicePreferential).setScale(2, BigDecimal.ROUND_HALF_UP); + if("0".equals(commissionType)){ + //总金额 + actPrice =actPrice.subtract(decimal1.add(decimal2)); + //折扣的钱 + promotionDiscount = decimal1.add(decimal2); + surplusPowerPrice = surplusPowerPrice.subtract(decimal1); + surplusServicePrice= surplusServicePrice.subtract(decimal2); + }else if("1".equals(commissionType)){ + //服务费 + if(surplusServicePrice.compareTo(decimal2) > -1){ + surplusServicePrice =surplusServicePrice.subtract(decimal2); + actPrice =actPrice.subtract(decimal2); + }else{ + promotionDiscount = surplusServicePrice; + actPrice =actPrice.subtract(surplusServicePrice); + surplusServicePrice =new BigDecimal(0); + } + }else{ + //电量抽成 + BigDecimal chargingDegree = xhpcChargeOrder.getChargingDegree(); + //电量的钱 + promotionDiscount = chargingDegree.multiply(new BigDecimal(userDiscount.get("servicePreferential").toString())).setScale(2, BigDecimal.ROUND_HALF_UP); + logger.info("=============电量优惠==="+promotionDiscount); + logger.info("=============服务费==="+surplusServicePrice); + //当电量的折扣大于服务费时,电量==服务费 + if(surplusServicePrice.compareTo(promotionDiscount)>-1){ + surplusServicePrice= surplusServicePrice.subtract(promotionDiscount); + actPrice =actPrice.subtract(promotionDiscount); + }else{ + promotionDiscount = surplusServicePrice; + actPrice =actPrice.subtract(surplusServicePrice); + surplusServicePrice =new BigDecimal(0); + } + } } } } diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml index dc222662..0238f0db 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcHistoryOrderMapper.xml @@ -574,6 +574,9 @@ ho.act_power_price as actPowerPrice, co.charging_time as chargingTime, co.charging_degree as chargingDegree, + ho.total_price as totalPrice, + ho.power_price_total as powerPriceTotal, + ho.promotion_discount as promotionDiscount, DATE_FORMAT(ho.start_time,'%m月%d日') as daysOne, DATE_FORMAT(ho.start_time,'%H:%i:%s') as timeOne, DATE_FORMAT(ho.end_time,'%m月%d日') as daysTwo, diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java index 3280d413..e94f11e6 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/controller/XhpcCommonController.java @@ -68,4 +68,20 @@ public class XhpcCommonController extends BaseController { return xhpcCommonService.insertUserBalance(money,userId,userType,tenantId,type,status,remark,moneyOrderId); } + /** + * 获取该机构的折扣比例 + * @param userId 充值用户 + * @param userType 用户类型 + * @param tenantId 租户id + * @return + */ + @GetMapping(value = "/getMechanismDiscount") + public AjaxResult getMechanismDiscount(Long userId, Integer userType, String tenantId) { + + return xhpcCommonService.getMechanismDiscount(userId,userType,tenantId); + } + + + + } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java index e4da7a1d..2896cc89 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCommunityMapper.java @@ -103,4 +103,10 @@ public interface XhpcCommunityMapper { * 社区人员状态改变 */ void updateCommunityPersonnelStatus(@Param("communityPersonnelId")Long communityPersonnelId,@Param("status")Integer status); + + + /** + * 根据用户id获取社区组 + */ + Map getCommunityPersonnelUserId(@Param("userId")Long userId,@Param("tenantId")String tenantId); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java index 07747202..bcb8b9e2 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/mapper/XhpcCustomersMapper.java @@ -102,4 +102,9 @@ public interface XhpcCustomersMapper { * 社区人员状态改变 */ void updateCustomersPersonnelStatus(@Param("customersPersonnelId")Long customersPersonnelId,@Param("status")Integer status); + + /** + * 根据用户id获取大客户组 + */ + Map getCustomersPersonnelUserId(@Param("userId")Long userId,@Param("tenantId")String tenantId); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java index a93e20b3..e2b13b73 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommonService.java @@ -28,4 +28,14 @@ public interface IXhpcCommonService { * @return */ AjaxResult insertUserBalance(BigDecimal money, Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark,Long moneyOrderId); + + /** + * 获取该机构的折扣比例 + * @param userId 充值用户 + * @param userType 用户类型 + * @param tenantId 租户id + * @return + */ + AjaxResult getMechanismDiscount(Long userId, Integer userType, String tenantId); + } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java index 4fe8ffad..0bc49beb 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCommunityService.java @@ -104,4 +104,8 @@ public interface IXhpcCommunityService { */ AjaxResult addRecharge(XhpcCommunityPersonnel xhpcCommunityPersonnel); + /** + * 根据用户id获取社区组 + */ + Map getCommunityPersonnelUserId(Long userId,String tenantId); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java index 5fc57b6a..f586d397 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/IXhpcCustomersService.java @@ -96,4 +96,9 @@ public interface IXhpcCustomersService { * 社区人员状态改变 */ void updateCustomersPersonnelStatus(XhpcCustomersPersonnel xhpcCustomersPersonnel); + + /** + * 根据用户id获取大客户组 + */ + Map getCustomersPersonnelUserId(Long userId,String tenantId); } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java index 622061a0..5e70ab44 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommonServiceImpl.java @@ -79,4 +79,23 @@ public class XhpcCommonServiceImpl implements IXhpcCommonService { } return AjaxResult.error(); } + + /** + * 获取该机构的折扣比例 + * + * @param userId 充值用户 + * @param userType 用户类型 + * @param tenantId 租户id + * @return + */ + @Override + public AjaxResult getMechanismDiscount(Long userId, Integer userType, String tenantId) { + if(UserTypeUtil.COMMUNIT_TYPE.equals(userType)){ + return AjaxResult.success(xhpcCommunityService.getCommunityPersonnelUserId(userId, tenantId)); + }else if(UserTypeUtil.CUSTOMERS_TYPE.equals(userType)){ + return AjaxResult.success(xhpcCustomersService.getCustomersPersonnelUserId(userId, tenantId)); + }else{ + return AjaxResult.error(); + } + } } diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java index f891e8e8..9e9f98dc 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCommunityServiceImpl.java @@ -307,6 +307,17 @@ public class XhpcCommunityServiceImpl extends BaseService implements IXhpcCommun return AjaxResult.error("充值金额必需大于0"); } + /** + * 根据用户id获取社区组 + * + * @param userId + * @param tenantId + */ + @Override + public Map getCommunityPersonnelUserId(Long userId, String tenantId) { + return xhpcCommunityMapper.getCommunityPersonnelUserId(userId, tenantId); + } + public R judgeXhpcCommunity(XhpcCommunity xhpcCommunity){ if(xhpcCommunity.getName()==null || "".equals(xhpcCommunity.getName())){ diff --git a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java index 4427a006..87abb2ab 100644 --- a/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java +++ b/xhpc-modules/xhpc-user/src/main/java/com/xhpc/user/service/impl/XhpcCustomersServiceImpl.java @@ -289,6 +289,17 @@ public class XhpcCustomersServiceImpl extends BaseService implements IXhpcCustom xhpcCustomersMapper.updateCustomersPersonnelStatus(xhpcCustomersPersonnel.getCustomersPersonnelId(),xhpcCustomersPersonnel.getStatus()); } + /** + * 根据用户id获取大客户组 + * + * @param userId + * @param tenantId + */ + @Override + public Map getCustomersPersonnelUserId(Long userId, String tenantId) { + return xhpcCustomersMapper.getCustomersPersonnelUserId(userId, tenantId); + } + public R judgeXhpcCustomers(XhpcCustomers xhpcCustomers){ if(xhpcCustomers.getName()==null || "".equals(xhpcCustomers.getName())){ diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml index f56616a6..73426a92 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCommunityMapper.xml @@ -455,4 +455,11 @@ update xhpc_community_personnel set status=#{status} where community_personnel_id=#{communityPersonnelId} + diff --git a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml index 6b9abcdd..6f02a563 100644 --- a/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml +++ b/xhpc-modules/xhpc-user/src/main/resources/mapper/XhpcCustomersMapper.xml @@ -451,4 +451,12 @@ update xhpc_customers_personnel set status=#{status} where customers_personnel_id=#{customersPersonnelId} + +