|
|
|
|
@ -1,10 +1,9 @@ |
|
|
|
|
package org.springblade.modules.weixin.controller; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.common.enums.OrderStatusEnum; |
|
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
|
@ -13,8 +12,6 @@ import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.modules.desk.entity.Order; |
|
|
|
|
import org.springblade.modules.desk.vo.OrderExcelVO; |
|
|
|
|
import org.springblade.modules.weixin.entity.WeChatUser; |
|
|
|
|
import org.springblade.modules.weixin.excel.WeChatUserExcel; |
|
|
|
|
import org.springblade.modules.weixin.service.IWeChatUserService; |
|
|
|
|
@ -61,6 +58,9 @@ public class WeChatUserController { |
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
|
public R save(@RequestBody WeChatUser weChatUser) { |
|
|
|
|
if (StringUtils.isBlank(weChatUser.getOpenId())) { |
|
|
|
|
throw new ServiceException("缺少必要参数:openId"); |
|
|
|
|
} |
|
|
|
|
long count = weChatUserService.count(Wrappers.<WeChatUser>lambdaQuery().eq(WeChatUser::getOpenId, weChatUser.getOpenId())); |
|
|
|
|
if (count == 0L) { |
|
|
|
|
weChatUserService.save(weChatUser); |
|
|
|
|
|