门店号管理bug

master
LegnaYet 6 years ago
parent 11db4ef4ba
commit 99a924b5ad

@ -59,6 +59,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/store/emp/download/store/code", "anon");
filterChainDefinitionMap.put("/qy/customer/handle", "anon");
filterChainDefinitionMap.put("/store/emp/download/store/seller/code", "anon");
filterChainDefinitionMap.put("/user/img/download", "anon");
filterChainDefinitionMap.put("/department/sync", "anon");
filterChainDefinitionMap.put("/store/promotion/data/**", "anon");
// 配置退出 过滤器,其中的具体的退出代码Shiro已经替我们实现了

@ -9,7 +9,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import java.util.Map;
@ -44,6 +49,35 @@ public class EmployeeController extends BaseController {
return fail();
}
}
/**
*
* @return
* @throws Exception
*/
@RequestMapping(value = "img/download",method = RequestMethod.POST)
public void listUser(@RequestParam("url")String url,HttpServletResponse response){
BufferedInputStream in = null;
try {
in = new BufferedInputStream(employeeService.getInputStream(url));
//输入到response
ServletOutputStream outputStream = response.getOutputStream();
byte[] bufferNew = new byte[1024];
int lenNew;
while ((lenNew = in.read(bufferNew)) > 0) {
outputStream.write(bufferNew, 0, lenNew);
}
outputStream.flush();
}catch (Exception e){
log.error("添加用户失败",e);
}finally {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
/**
*
* @param response

@ -18,6 +18,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
import static com.kiisoo.ic.config.WxCpConfiguration.APPLICATIONID;
/**
* @Description: 广
* @Auther: yinliujing
@ -26,7 +28,7 @@ import java.util.Map;
*/
@Service
public class QrCodeService {
WxCpService mainService = WxCpConfiguration.getCpService(1000037);
WxCpService mainService = WxCpConfiguration.getCpService(APPLICATIONID);
@Autowired
private PoiStoreStaffDOMapper poiStoreStaffDOMapper;

@ -1,9 +1,11 @@
package com.kiisoo.ic.store.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
/**
@ -94,5 +96,6 @@ public class PoiStore {
/**
*
*/
@TableField(exist = false)
private String abbreviation;
}

@ -41,4 +41,6 @@ public interface PoiStoreStaffDOMapper extends BaseMapper<PoiStoreStaff> {
* id
*/
List<StafferInfoVO> selectInfoById(@Param("userId") Long userId);
Long selectStaffIdByUserId(@Param("userId") Long userId);
}

@ -19,4 +19,6 @@ public interface PrivilageCpUserStoreDOMapper extends BaseMapper<PrivilageCpUser
List<StoreUserDTO> selectCpUserByShops (@Param("shopIds") List<Long> shops);
Long selectOneByCpUserId(String cpuserId);
String selectCpUserIdByStoreId(Long storeId);
}

@ -15,7 +15,7 @@ import com.kiisoo.ic.store.entity.PoiStoreStaff;
import com.kiisoo.ic.store.entity.PoiStoreStaffVO;
import com.kiisoo.ic.store.mapper.PoiStoreDOMapper;
import com.kiisoo.ic.store.mapper.PoiStoreStaffDOMapper;
import com.kiisoo.ic.system.bean.AccountBean;
import com.kiisoo.ic.store.mapper.PrivilageCpUserStoreDOMapper;
import com.kiisoo.ic.system.bean.ImportAccountErrorBean;
import com.kiisoo.ic.system.bean.PrivilageUserBean;
import com.kiisoo.ic.system.entity.PrivilageAccountDO;
@ -37,15 +37,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import javax.management.relation.Role;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import static com.kiisoo.ic.store.constant.Constants.TYPE_MANAGER;
@ -68,6 +65,8 @@ public class PoiStoreStaffService {
@Autowired
private PoiStoreDOMapper poiStoreDOMapper;
@Autowired
private PrivilageCpUserStoreDOMapper privilageCpUserStoreDOMapper;
@Autowired
private PrivilageAccountService privilageAccountService;
@Autowired
private PrivilageUserService privilageUserService;
@ -258,14 +257,18 @@ public class PoiStoreStaffService {
qrCodeDO.setType(1);
qrCodeDO.setScene(2);
//查询店铺店长编码
String staffCode = poiStoreStaffDOMapper.selectShopManagerByShop(poiStoreStaffVO.getStoreId());
String cpUserId = privilageCpUserStoreDOMapper.selectCpUserIdByStoreId(poiStoreStaffVO.getStoreId());
PoiStore poiStore = poiStoreDOMapper.selectById(poiStoreStaffVO.getStoreId());
String[] data = new String[1];
//选择店铺对应店长的编码
//data[0] = (staffCode);
data[0] = ("JiangDeXiang");
data[0] = (cpUserId);
// data[0] = ("JiangDeXiang");
qrCodeDO.setUser(data);
//店铺编码-导购编码
qrCodeDO.setState(poiStoreStaffVO.getStoreCode() + "-" + poiStoreStaffVO.getStaffCode());
qrCodeDO.setState(poiStore.getCode() + "-" + poiStoreStaffVO.getStaffCode());
return qrCodeService.getQrCode(qrCodeDO);
}

@ -1,6 +1,7 @@
package com.kiisoo.ic.system.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@ -35,6 +36,7 @@ public class PrivilageUserDO implements Serializable {
private String name;
/**别名*/
@TableField(exist = false)
private String abbreviation;
/**

@ -26,6 +26,7 @@ import com.kiisoo.ic.system.mapper.PrivilageUserDOMapper;
import com.kiisoo.ic.system.service.PrivilageAccountService;
import com.kiisoo.ic.system.service.PrivilageUserRoleService;
import com.kiisoo.ic.system.service.PrivilageUserService;
import com.kiisoo.ic.webappmy.vo.StafferInfoVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
@ -177,14 +178,21 @@ public class PrivilageAccountServiceImpl extends ServiceImpl<PrivilageAccountDOM
@Transactional(rollbackFor = Exception.class)
@Override
public boolean removeAccout(Long accountId, Long userId) {
//删除账号
privilageAccountDOMapper.deleteById(accountId);
//删除用户
privilageUserService.removeUser(userId);
//删除用户角色关系
privilageUserRoleService.removeUserRoleRelation(userId);
//删除用户店铺和域关系
privilageDomainService.removeUserEntity(userId);
try {
//删除账号
privilageAccountDOMapper.deleteById(accountId);
//删除用户
privilageUserService.removeUser(userId);
//删除用户角色关系
privilageUserRoleService.removeUserRoleRelation(userId);
//删除用户店铺和域关系
privilageDomainService.removeUserEntity(userId);
Long staffId = poiStoreStaffDOMapper.selectStaffIdByUserId(userId);
//删除该用户店长,导购
poiStoreStaffDOMapper.deleteById(staffId);
}catch (Exception e){
e.printStackTrace();
}
return true;
}

@ -9,6 +9,10 @@ import lombok.Data;
@Data
public class StafferInfoVO {
/**
* id
*/
private Long id;
/**
*
*/

@ -20,6 +20,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.kiisoo.ic.config.WxCpConfiguration.APPLICATIONID;
import static com.kiisoo.ic.department.constant.Constants.MAIN_DEPARTMENT_ID;
/**
@ -31,7 +32,7 @@ import static com.kiisoo.ic.department.constant.Constants.MAIN_DEPARTMENT_ID;
@Service
public class QWMailListManageService {
private final Integer applicationid = 1;
private final Integer applicationid = APPLICATIONID;
private WxCpService wxCpService;

@ -26,4 +26,12 @@
limit 1
</select>
<select id="selectCpUserIdByStoreId" resultType="java.lang.String">
select pcu.cp_user_id
from privilage_cp_user_store pcus ,privilage_cp_user pcu
where pcus.cp_user_id = pcu.id and pcu.status in (1,4)
and pcus.store_id = #{storeId}
limit 1
</select>
</mapper>

@ -32,8 +32,13 @@
</select>
<select id="selectInfoById" resultType="com.kiisoo.ic.webappmy.vo.StafferInfoVO">
select t2.staff_code as stafferNo,t1.`name`,t3.`name` as shopName,t3.id as storeId
select t2.id,t2.staff_code as stafferNo,t1.`name`,t3.`name` as shopName,t3.id as storeId
from privilage_user t1, poi_store_staff t2, poi_store t3
where t1.id = t2.user_id and t2.`status` = 1 and t2.store_code = t3.`code`
</select>
<select id="selectStaffIdByUserId" resultType="java.lang.Long">
select id from poi_store_staff where user_id = #{userId}
limit 1
</select>
</mapper>

Loading…
Cancel
Save