|
|
|
@ -2,15 +2,19 @@ package com.kiisoo.ic.webappmy.controller;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.kiisoo.ic.common.BaseController;
|
|
|
|
|
import com.kiisoo.ic.employee.entity.PrivilageCpUserDO;
|
|
|
|
|
import com.kiisoo.ic.employee.mapper.PrivilageCpUserDOMapper;
|
|
|
|
|
import com.kiisoo.ic.store.constant.Constants;
|
|
|
|
|
import com.kiisoo.ic.store.entity.PoiStoreStaff;
|
|
|
|
|
import com.kiisoo.ic.store.entity.StoreUserDTO;
|
|
|
|
|
import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
|
|
|
|
|
import com.kiisoo.ic.store.mapper.PrivilageCpUserStoreDOMapper;
|
|
|
|
|
import com.kiisoo.ic.store.service.StoreEmployeeService;
|
|
|
|
|
import com.kiisoo.ic.webappmy.service.WebAppService;
|
|
|
|
|
import com.kiisoo.ic.webappmy.vo.StafferInfoVO;
|
|
|
|
|
import com.kiisoo.ic.webappmy.vo.UserParam;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
|
|
import org.apache.shiro.subject.Subject;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -21,6 +25,8 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import static com.kiisoo.ic.store.constant.Constants.BSD_REQ_QRCODE_TYPE_STORE;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 小程序-我的功能请求控制器
|
|
|
|
|
* Created by hc on 2020/4/16
|
|
|
|
@ -36,6 +42,12 @@ public class WebAppMyController extends BaseController {
|
|
|
|
|
@Autowired
|
|
|
|
|
private PrivilageCpUserStoreDOMapper privilageCpUserStoreDOMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private PrivilageCpUserDOMapper privilageCpUserDOMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StoreEmployeeService storeEmployeeService;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private WebAppService webAppService;
|
|
|
|
|
/**
|
|
|
|
@ -66,11 +78,18 @@ public class WebAppMyController extends BaseController {
|
|
|
|
|
List<Long> shopIds = new ArrayList<>();
|
|
|
|
|
shopIds.add(shopId);
|
|
|
|
|
List<StoreUserDTO> cpUserStoreDO = privilageCpUserStoreDOMapper.selectCpUserByShops(shopIds);
|
|
|
|
|
if(cpUserStoreDO.size() > 0){
|
|
|
|
|
if(cpUserStoreDO!=null && cpUserStoreDO.size() > 0){
|
|
|
|
|
img = cpUserStoreDO.get(0).getQrCodeAction();
|
|
|
|
|
if (StringUtils.isBlank(img)){
|
|
|
|
|
img = storeEmployeeService.getQrCodeFromBSD(cpUserStoreDO.get(0).getCpUserId(),BSD_REQ_QRCODE_TYPE_STORE,"0",cpUserStoreDO.get(0).getCode());
|
|
|
|
|
PrivilageCpUserDO update = new PrivilageCpUserDO();
|
|
|
|
|
update.setId(cpUserStoreDO.get(0).getUserId());
|
|
|
|
|
update.setQrCode(img);
|
|
|
|
|
privilageCpUserDOMapper.updateById(update);
|
|
|
|
|
}
|
|
|
|
|
return data(img);
|
|
|
|
|
}else{
|
|
|
|
|
throw new Exception();
|
|
|
|
|
return fail();
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
log.error("获取门店推广码异常",e);
|
|
|
|
@ -92,9 +111,18 @@ public class WebAppMyController extends BaseController {
|
|
|
|
|
List<PoiStoreStaff> poiStoreStaffs = poiStoreStaffDOMapper.selectList(new QueryWrapper<>(poiStoreStaff));
|
|
|
|
|
if(poiStoreStaffs.size() > 0){
|
|
|
|
|
img = poiStoreStaffs.get(0).getEpWechatQrCode();
|
|
|
|
|
if (StringUtils.isBlank(img)){
|
|
|
|
|
Long storeId = poiStoreStaffs.get(0).getStoreId();
|
|
|
|
|
String cpUserId = privilageCpUserStoreDOMapper.selectCpUserIdByStoreId(storeId);
|
|
|
|
|
img = storeEmployeeService.getQrCodeFromBSD(cpUserId,BSD_REQ_QRCODE_TYPE_STORE,"0",poiStoreStaffs.get(0).getStoreCode());
|
|
|
|
|
PoiStoreStaff update = new PoiStoreStaff();
|
|
|
|
|
update.setId(poiStoreStaffs.get(0).getId());
|
|
|
|
|
update.setEpWechatQrCode(img);
|
|
|
|
|
poiStoreStaffDOMapper.updateById(update);
|
|
|
|
|
}
|
|
|
|
|
return data(img);
|
|
|
|
|
}else{
|
|
|
|
|
throw new Exception();
|
|
|
|
|
return fail();
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
log.error("获取用户推广码异常",e);
|
|
|
|
|