充值配置修改完成
This commit is contained in:
parent
e675e8e795
commit
a402fea185
@ -38,6 +38,6 @@ public interface UserTypeService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/common/insertUserBalance")
|
@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);
|
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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class UserTypeFallbackFactory implements FallbackFactory<UserTypeService>
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R insertUserBalance(BigDecimal money,Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark) {
|
public R insertUserBalance(BigDecimal money,Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark,Long moneyOrderId) {
|
||||||
return R.fail("添加用户金额信息失败:" + cause.getMessage());
|
return R.fail("添加用户金额信息失败:" + cause.getMessage());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -287,8 +287,25 @@ public class AlipayPaymentController {
|
|||||||
//充电中
|
//充电中
|
||||||
postRefreshBalance(money, serialMumber);
|
postRefreshBalance(money, serialMumber);
|
||||||
}
|
}
|
||||||
//增加用户余额
|
if(UserTypeUtil.USER_TYPE.equals(xhpcRechargeOrder.getSource())){
|
||||||
userTypeService.insertUserBalance(money,userId,source,tenantId,UserTypeUtil.RECHARGE_ZHB,UserTypeUtil.INSERT_BALANCE,null);
|
//增加用户余额
|
||||||
|
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
||||||
|
xhpcAppUser.setAppUserId(xhpcRechargeOrder.getUserId());
|
||||||
|
xhpcAppUser.setBalance(money);
|
||||||
|
xhpcUserAccountStatementMapper.updateAppUserBalance(xhpcAppUser);
|
||||||
|
XhpcUserAccountStatement xhpcUserAccountStatement = new XhpcUserAccountStatement();
|
||||||
|
xhpcUserAccountStatement.setType(StatusConstants.FLOWING_WATER_RECHARGE_TYPE);
|
||||||
|
xhpcUserAccountStatement.setRechargeOrderId(xhpcRechargeOrder.getRechargeOrderId());
|
||||||
|
xhpcUserAccountStatement.setUserId(xhpcRechargeOrder.getUserId());
|
||||||
|
xhpcUserAccountStatement.setAmount(xhpcRechargeOrder.getAmount());
|
||||||
|
xhpcUserAccountStatement.setRemainingSum(xhpcAppUser.getBalance());
|
||||||
|
xhpcUserAccountStatement.setCreateTime(new Date());
|
||||||
|
xhpcUserAccountStatement.setRemark("支付宝充值订单!");
|
||||||
|
xhpcUserAccountStatementMapper.insert(xhpcUserAccountStatement);
|
||||||
|
}else{
|
||||||
|
//增加用户余额
|
||||||
|
userTypeService.insertUserBalance(money,userId,source,tenantId,UserTypeUtil.RECHARGE_ZHB,UserTypeUtil.INSERT_BALANCE,null,xhpcRechargeOrder.getRechargeOrderId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -390,8 +390,25 @@ public class WxPaymentController {
|
|||||||
//充电中
|
//充电中
|
||||||
postRefreshBalance(money, serialMumber);
|
postRefreshBalance(money, serialMumber);
|
||||||
}
|
}
|
||||||
//增加用户余额
|
if(UserTypeUtil.USER_TYPE.equals(xhpcRechargeOrder.getSource())){
|
||||||
userTypeService.insertUserBalance(money,userId,source,tenantId, UserTypeUtil.RECHARGE_WX,UserTypeUtil.INSERT_BALANCE,null);
|
//增加用户余额
|
||||||
|
XhpcAppUser xhpcAppUser = new XhpcAppUser();
|
||||||
|
xhpcAppUser.setAppUserId(xhpcRechargeOrder.getUserId());
|
||||||
|
xhpcAppUser.setBalance(money);
|
||||||
|
xhpcUserAccountStatementMapper.updateAppUserBalance(xhpcAppUser);
|
||||||
|
XhpcUserAccountStatement xhpcUserAccountStatement = new XhpcUserAccountStatement();
|
||||||
|
xhpcUserAccountStatement.setType(StatusConstants.FLOWING_WATER_RECHARGE_TYPE);
|
||||||
|
xhpcUserAccountStatement.setRechargeOrderId(xhpcRechargeOrder.getRechargeOrderId());
|
||||||
|
xhpcUserAccountStatement.setUserId(xhpcRechargeOrder.getUserId());
|
||||||
|
xhpcUserAccountStatement.setAmount(xhpcRechargeOrder.getAmount());
|
||||||
|
xhpcUserAccountStatement.setRemainingSum(xhpcAppUser.getBalance());
|
||||||
|
xhpcUserAccountStatement.setCreateTime(new Date());
|
||||||
|
xhpcUserAccountStatement.setRemark("微信充值订单!");
|
||||||
|
xhpcUserAccountStatementMapper.insert(xhpcUserAccountStatement);
|
||||||
|
}else{
|
||||||
|
//增加用户余额
|
||||||
|
userTypeService.insertUserBalance(money,userId,source,tenantId, UserTypeUtil.RECHARGE_WX,UserTypeUtil.INSERT_BALANCE,null,xhpcRechargeOrder.getRechargeOrderId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class XhpcCommonController extends BaseController {
|
|||||||
* @param phone
|
* @param phone
|
||||||
* @param userId
|
* @param userId
|
||||||
* @param userType
|
* @param userType
|
||||||
* @param SerialNumber 桩号
|
* @param serialNumber 桩号
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/getUser")
|
@GetMapping(value = "/getUser")
|
||||||
@ -63,9 +63,9 @@ public class XhpcCommonController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/insertUserBalance")
|
@GetMapping(value = "/insertUserBalance")
|
||||||
public AjaxResult insertUserBalance(BigDecimal money, Long userId, Integer userType, String tenantId, Integer type, Integer status,String remark) {
|
public AjaxResult insertUserBalance(BigDecimal money, Long userId, Integer userType, String tenantId, Integer type, Integer status,String remark,Long moneyOrderId) {
|
||||||
|
|
||||||
return xhpcCommonService.insertUserBalance(money,userId,userType,tenantId,type,status,remark);
|
return xhpcCommonService.insertUserBalance(money,userId,userType,tenantId,type,status,remark,moneyOrderId);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,4 +74,9 @@ public class XhpcCommunityPersonnel extends BaseEntity {
|
|||||||
* 充值渠道(1微信 2支付宝 3平台)
|
* 充值渠道(1微信 2支付宝 3平台)
|
||||||
*/
|
*/
|
||||||
private Integer rechargeType;
|
private Integer rechargeType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充值订单id、退款订单id
|
||||||
|
*/
|
||||||
|
private Long moneyOrderId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,4 +73,8 @@ public class XhpcCustomersPersonnel extends BaseEntity {
|
|||||||
* 充值渠道(1微信 2支付宝 3平台)
|
* 充值渠道(1微信 2支付宝 3平台)
|
||||||
*/
|
*/
|
||||||
private Integer rechargeType;
|
private Integer rechargeType;
|
||||||
|
/**
|
||||||
|
* 充值订单id、退款订单id
|
||||||
|
*/
|
||||||
|
private Long moneyOrderId;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,7 +106,7 @@ public interface IXhpcAppUserUserService {
|
|||||||
public R<?> updateIsRefund(Long userId, Integer userType,Integer isRefund);
|
public R<?> updateIsRefund(Long userId, Integer userType,Integer isRefund);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置小程序用户自动退款功能
|
* 设置小程序用户电池保护
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public R<?> batteryProtect(HttpServletRequest request, Integer soc,Integer socProtect,Integer userType);
|
public R<?> batteryProtect(HttpServletRequest request, Integer soc,Integer socProtect,Integer userType);
|
||||||
|
|||||||
@ -27,5 +27,5 @@ public interface IXhpcCommonService {
|
|||||||
* @param remark 备注
|
* @param remark 备注
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult insertUserBalance(BigDecimal money, Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark);
|
AjaxResult insertUserBalance(BigDecimal money, Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark,Long moneyOrderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,13 +44,9 @@ public class XhpcCommonServiceImpl implements IXhpcCommonService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult insertUserBalance(BigDecimal money, Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark) {
|
public AjaxResult insertUserBalance(BigDecimal money, Long userId, Integer userType, String tenantId, Integer type,Integer status,String remark,Long moneyOrderId) {
|
||||||
if(UserTypeUtil.USER_TYPE.equals(userType)){
|
if(UserTypeUtil.USER_TYPE.equals(userType)){
|
||||||
Map<String, Object> appUser = xhpcCommonMapper.getAppUser(null, userId, tenantId);
|
//C端用户暂不考虑
|
||||||
//增加用户余额
|
|
||||||
if(appUser!=null){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}else if(UserTypeUtil.COMMUNIT_TYPE.equals(userType)){
|
}else if(UserTypeUtil.COMMUNIT_TYPE.equals(userType)){
|
||||||
Map<String, Object> communityUser = xhpcCommonMapper.getCommunityUser(null, userId, null, tenantId);
|
Map<String, Object> communityUser = xhpcCommonMapper.getCommunityUser(null, userId, null, tenantId);
|
||||||
@ -62,6 +58,7 @@ public class XhpcCommonServiceImpl implements IXhpcCommonService {
|
|||||||
xhpcCommunityPersonnel.setRemark(remark);
|
xhpcCommunityPersonnel.setRemark(remark);
|
||||||
xhpcCommunityPersonnel.setRechargeType(type);
|
xhpcCommunityPersonnel.setRechargeType(type);
|
||||||
xhpcCommunityPersonnel.setTenantId(tenantId);
|
xhpcCommunityPersonnel.setTenantId(tenantId);
|
||||||
|
xhpcCommunityPersonnel.setMoneyOrderId(moneyOrderId);
|
||||||
return xhpcCommunityService.addRecharge(xhpcCommunityPersonnel);
|
return xhpcCommunityService.addRecharge(xhpcCommunityPersonnel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,6 +72,7 @@ public class XhpcCommonServiceImpl implements IXhpcCommonService {
|
|||||||
xhpcCustomersPersonnel.setRemark(remark);
|
xhpcCustomersPersonnel.setRemark(remark);
|
||||||
xhpcCustomersPersonnel.setRechargeType(type);
|
xhpcCustomersPersonnel.setRechargeType(type);
|
||||||
xhpcCustomersPersonnel.setTenantId(tenantId);
|
xhpcCustomersPersonnel.setTenantId(tenantId);
|
||||||
|
xhpcCustomersPersonnel.setMoneyOrderId(moneyOrderId);
|
||||||
return xhpcCustomersService.addRecharge(xhpcCustomersPersonnel);
|
return xhpcCustomersService.addRecharge(xhpcCustomersPersonnel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,8 +202,14 @@ public class XhpcCommunityServiceImpl implements IXhpcCommunityService {
|
|||||||
xhpcCommunityPersonnel1.setSurplusMoney(remainingSum);
|
xhpcCommunityPersonnel1.setSurplusMoney(remainingSum);
|
||||||
xhpcCommunityPersonnel1.setRechargeMoney(rechargeMoney1.add(rechargeMoney));
|
xhpcCommunityPersonnel1.setRechargeMoney(rechargeMoney1.add(rechargeMoney));
|
||||||
xhpcCommunityMapper.updateCommunityPersonnel(xhpcCommunityPersonnel1);
|
xhpcCommunityMapper.updateCommunityPersonnel(xhpcCommunityPersonnel1);
|
||||||
//增加充值记录
|
|
||||||
Long rechargeOrderId = mechanismService.addRechargeOrder(communityPersonnelId, UserTypeUtil.COMMUNIT_TYPE, rechargeMoney, remainingSum, xhpcCommunityPersonnel1.getRechargeType());
|
Long rechargeOrderId=null;
|
||||||
|
if(UserTypeUtil.RECHARGE_PT.equals(xhpcCommunityPersonnel.getRechargeType())){
|
||||||
|
//增加充值记录
|
||||||
|
rechargeOrderId = mechanismService.addRechargeOrder(communityPersonnelId, UserTypeUtil.COMMUNIT_TYPE, rechargeMoney, remainingSum, xhpcCommunityPersonnel1.getRechargeType());
|
||||||
|
}else{
|
||||||
|
rechargeOrderId=xhpcCommunityPersonnel.getMoneyOrderId();
|
||||||
|
}
|
||||||
//增加用户流水
|
//增加用户流水
|
||||||
mechanismService.insertUserAccount(communityPersonnelId,rechargeMoney,remainingSum,null,rechargeOrderId,null,UserTypeUtil.INSERT_BALANCE,xhpcCommunityPersonnel1.getTenantId(),UserTypeUtil.COMMUNIT_TYPE);
|
mechanismService.insertUserAccount(communityPersonnelId,rechargeMoney,remainingSum,null,rechargeOrderId,null,UserTypeUtil.INSERT_BALANCE,xhpcCommunityPersonnel1.getTenantId(),UserTypeUtil.COMMUNIT_TYPE);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
|||||||
@ -123,7 +123,7 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
|||||||
xhpcCustomersMapper.updateCustomers(xhpcCustomers);
|
xhpcCustomersMapper.updateCustomers(xhpcCustomers);
|
||||||
mechanismService.updateMechanism(xhpcCustomers.getCustomersId(),1);
|
mechanismService.updateMechanism(xhpcCustomers.getCustomersId(),1);
|
||||||
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
|
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
|
||||||
mechanismService.addMechanism(Arrays.asList(chargingStationIds.split(",")),xhpcCustomers.getCustomersId(),0);
|
mechanismService.addMechanism(Arrays.asList(chargingStationIds.split(",")),xhpcCustomers.getCustomersId(),1);
|
||||||
}
|
}
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
@ -212,8 +212,13 @@ public class XhpcCustomersServiceImpl implements IXhpcCustomersService {
|
|||||||
xhpcCustomersPersonnel1.setSurplusMoney(remainingSum);
|
xhpcCustomersPersonnel1.setSurplusMoney(remainingSum);
|
||||||
xhpcCustomersPersonnel1.setRechargeMoney(rechargeMoney1.add(rechargeMoney));
|
xhpcCustomersPersonnel1.setRechargeMoney(rechargeMoney1.add(rechargeMoney));
|
||||||
xhpcCustomersMapper.updateCustomersPersonnel(xhpcCustomersPersonnel1);
|
xhpcCustomersMapper.updateCustomersPersonnel(xhpcCustomersPersonnel1);
|
||||||
//增加充值记录
|
Long rechargeOrderId=null;
|
||||||
Long rechargeOrderId =mechanismService.addRechargeOrder(customersPersonnelId, UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,remainingSum,xhpcCustomersPersonnel1.getRechargeType());
|
if(UserTypeUtil.RECHARGE_PT.equals(xhpcCustomersPersonnel.getRechargeType())){
|
||||||
|
//增加充值记录
|
||||||
|
rechargeOrderId =mechanismService.addRechargeOrder(customersPersonnelId, UserTypeUtil.CUSTOMERS_TYPE,rechargeMoney,remainingSum,xhpcCustomersPersonnel1.getRechargeType());
|
||||||
|
}else{
|
||||||
|
rechargeOrderId= xhpcCustomersPersonnel.getMoneyOrderId();
|
||||||
|
}
|
||||||
//增加用户流水
|
//增加用户流水
|
||||||
mechanismService.insertUserAccount(customersPersonnelId,rechargeMoney,remainingSum,null,rechargeOrderId,null,UserTypeUtil.INSERT_BALANCE,xhpcCustomersPersonnel1.getTenantId(),UserTypeUtil.CUSTOMERS_TYPE);
|
mechanismService.insertUserAccount(customersPersonnelId,rechargeMoney,remainingSum,null,rechargeOrderId,null,UserTypeUtil.INSERT_BALANCE,xhpcCustomersPersonnel1.getTenantId(),UserTypeUtil.CUSTOMERS_TYPE);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
alipay_login as alipayLogin,
|
alipay_login as alipayLogin,
|
||||||
del_flag delFlag,
|
del_flag delFlag,
|
||||||
concat(0) as userType,
|
concat(0) as userType,
|
||||||
|
concat("C") as userTypeName,
|
||||||
tenant_id tenantId,
|
tenant_id tenantId,
|
||||||
create_time as createTime
|
create_time as createTime
|
||||||
from xhpc_app_user
|
from xhpc_app_user
|
||||||
@ -55,6 +56,7 @@
|
|||||||
tenant_id tenantId,
|
tenant_id tenantId,
|
||||||
del_flag delFlag,
|
del_flag delFlag,
|
||||||
concat(2) as userType,
|
concat(2) as userType,
|
||||||
|
concat("ST") as userTypeName,
|
||||||
<if test="serialNumber !=null and serialNumber !=''">
|
<if test="serialNumber !=null and serialNumber !=''">
|
||||||
(select count(charging_station_id) from xhpc_mechanism where community_id=mechanism_id and source=0 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number,
|
(select count(charging_station_id) from xhpc_mechanism where community_id=mechanism_id and source=0 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number,
|
||||||
</if>
|
</if>
|
||||||
@ -90,6 +92,7 @@
|
|||||||
del_flag delFlag,
|
del_flag delFlag,
|
||||||
tenant_id tenantId,
|
tenant_id tenantId,
|
||||||
concat(3) as userType,
|
concat(3) as userType,
|
||||||
|
concat("BE") as userTypeName,
|
||||||
<if test="serialNumber !=null and serialNumber !=''">
|
<if test="serialNumber !=null and serialNumber !=''">
|
||||||
(select count(charging_station_id) from xhpc_mechanism where customers_id=mechanism_id and source=1 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number,
|
(select count(charging_station_id) from xhpc_mechanism where customers_id=mechanism_id and source=1 and charging_station_id in (select charging_station_id from xhpc_terminal where 1=1 and del_flag=0 and serial_number=#{serialNumber})) as number,
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user