店铺对应的推广用户

master
wangweijia 6 years ago
parent d43ff7bbc7
commit 8db2f43fd1

@ -96,6 +96,5 @@ public class PoiStore {
/**
*
*/
@TableField(exist = false)
private String abbreviation;
}

@ -0,0 +1,27 @@
package com.kiisoo.ic.synchronous.controller;
import com.kiisoo.ic.synchronous.service.PromotionCodeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* 广
*/
@Controller
@RequestMapping("/promotion")
@Slf4j
public class PromotionCodeController {
@Autowired
private com.kiisoo.ic.synchronous.service.PromotionCodeService PromotionCodeService;
//参数类型0为门店账号1为内部员工导购2为其他
public void getShopPromotion(){
PromotionCodeService.getPromotion(0);
}
public void getStaffPromotion(){}
}

@ -0,0 +1,68 @@
package com.kiisoo.ic.synchronous.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.kiisoo.ic.store.constant.Constants;
import com.kiisoo.ic.store.entity.PoiStore;
import com.kiisoo.ic.store.entity.PoiStoreStaff;
import com.kiisoo.ic.store.entity.StoreUserDTO;
import com.kiisoo.ic.store.mapper.PoiStoreDOMapper;
import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
import com.kiisoo.ic.store.mapper.PrivilageCpUserStoreDOMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service
public class PromotionCodeService {
@Autowired
private PoiStoreDOMapper poiStoreDOMapper;
@Autowired
private PrivilageCpUserStoreDOMapper privilageCpUserStoreDOMapper;
@Autowired
private PoiStoreStaffDOMapper poiStoreStaffDOMapper;
public void getPromotion(int i) {
//找到所有店铺
List<PoiStore> shops = poiStoreDOMapper.selectList(null);
shops.forEach(item ->{
List<Long> shopIds = new ArrayList<>();
shopIds.add(item.getId());
//找到是否有推广码
List<StoreUserDTO> cpUserStoreDO = privilageCpUserStoreDOMapper.selectCpUserByShops(shopIds);
if(cpUserStoreDO.size() == 0){
//没有推广码则查询
//增加推广码
}
});
}
/**
*
*/
public void getStaffPromotion() {
List<PoiStoreStaff> sellers = poiStoreStaffDOMapper.selectList(null);
sellers.forEach(item ->{
PoiStoreStaff poiStoreStaff = new PoiStoreStaff();
poiStoreStaff.setUserId(item.getUserId());
poiStoreStaff.setStatus(Constants.STATUS_USEFUL);
List<PoiStoreStaff> poiStoreStaffs = poiStoreStaffDOMapper.selectList(new QueryWrapper<>(poiStoreStaff));
if(poiStoreStaffs.size() == 0){
//没有推广码则查询
//
}
});
}
}

@ -36,7 +36,6 @@ public class PrivilageUserDO implements Serializable {
private String name;
/**别名*/
@TableField(exist = false)
private String abbreviation;
/**

@ -53,7 +53,7 @@ public class OrganizationInitCustomer {
maxRow = 0;
dataType = "customer";
sheetNum = "客户";
regionLevel = 3;
regionLevel = 1;
}
@Autowired

@ -56,7 +56,7 @@ public class OrganizationInitRegion {
maxRow = 0;
dataType = "region";
sheetNum = 0;
regionLevel = 1;
regionLevel = 3;
}
@Autowired

Loading…
Cancel
Save