增加小程序自动退款开关接口
This commit is contained in:
parent
5c29b15928
commit
b111ca56df
@ -288,6 +288,24 @@ public class XhpcAppUserController extends BaseController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置小程序用户自动退款功能
|
||||
* @param
|
||||
*/
|
||||
@ApiOperation("设置小程序用户自动退款功能")
|
||||
@PostMapping("/updateIsRefund")
|
||||
public R<?> updateIsRefund(@RequestBody Map<String, Object> map) {
|
||||
if(map !=null){
|
||||
Long userId = Long.parseLong(map.get("userId").toString());
|
||||
Integer userType = Integer.parseInt(map.get("userType").toString());
|
||||
Integer isRefund = Integer.parseInt(map.get("isRefund").toString());
|
||||
return iXhpcAppUserUserService.updateIsRefund(userId,userType,isRefund);
|
||||
}
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "修改失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
|
||||
|
||||
@ -72,4 +72,8 @@ public interface XhpcAppUserMapper {
|
||||
* @return 结果
|
||||
*/
|
||||
public XhpcAppUser getAppUserByOpenid(@Param("openid") String openid);
|
||||
|
||||
int updateUserIsRefund(@Param("userId")Long userId, @Param("isRefund")Integer isRefund);
|
||||
|
||||
int updateCommunityIsRefund(@Param("userId")Long userId, @Param("isRefund")Integer isRefund);
|
||||
}
|
||||
|
||||
@ -97,4 +97,10 @@ public interface IXhpcAppUserUserService {
|
||||
* @return
|
||||
*/
|
||||
public R<?> logout(String phone, String code);
|
||||
|
||||
/**
|
||||
* 设置小程序用户自动退款功能
|
||||
* @return
|
||||
*/
|
||||
public R<?> updateIsRefund(Long userId, Integer userType,Integer isRefund);
|
||||
}
|
||||
|
||||
@ -359,4 +359,28 @@ public class XhpcAppUserServiceImpl implements IXhpcAppUserUserService {
|
||||
redisService.deleteObject("pvToken:" + phone);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> updateIsRefund(Long userId, Integer userType, Integer isRefund) {
|
||||
|
||||
if(isRefund>2 || isRefund<0){
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "参数错误");
|
||||
}
|
||||
if(userType==0){
|
||||
int i = xhpcAppUserMapper.updateUserIsRefund(userId, isRefund);
|
||||
if(i>0){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "修改失败");
|
||||
}
|
||||
}else if(userType==2){
|
||||
int i = xhpcAppUserMapper.updateCommunityIsRefund(userId, isRefund);
|
||||
if(i>0){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "修改失败");
|
||||
}
|
||||
}
|
||||
return R.fail(HttpStatus.ERROR_STATUS, "参数错误");
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,4 +221,11 @@
|
||||
from xhpc_app_user
|
||||
WHERE del_flag = 0 and (weixin_open_id = #{openid}or alipay_open_id = #{openid}) LIMIT 1
|
||||
</select>
|
||||
<update id="updateUserIsRefund">
|
||||
update xhpc_app_user set is_refund=#{isRefund} where app_user_id=#{userId}
|
||||
</update>
|
||||
|
||||
<update id="updateCommunityIsRefund">
|
||||
update xhpc_community_personnel set is_refund=#{isRefund} where community_personnel_id=#{userId}
|
||||
</update>
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user