|
|
|
@ -1085,17 +1085,17 @@ public class StoreEmployeeService {
|
|
|
|
|
QueryWrapper<PrivilageCpUserStoreDO> cpUserRelationQwByStore = new QueryWrapper<>();
|
|
|
|
|
cpUserRelationQwByStore.eq("store_id",poiStore.getId()).last("limit 1");
|
|
|
|
|
privilageCpUserStoreDO = privilageCpUserStoreDOMapper.selectOne(cpUserRelationQwByStore);
|
|
|
|
|
if (privilageCpUserStoreDO != null){
|
|
|
|
|
throw new KiisooException(Constants.MSG_DOMAIN_ENTITY_HAS, Constants.CODE_DOMAIN_ENTITY_HAS);
|
|
|
|
|
}
|
|
|
|
|
// if (privilageCpUserStoreDO != null){
|
|
|
|
|
// throw new KiisooException(Constants.MSG_DOMAIN_ENTITY_HAS, Constants.CODE_DOMAIN_ENTITY_HAS);
|
|
|
|
|
// }
|
|
|
|
|
if (privilageCpUserDO != null){
|
|
|
|
|
//查询关系是否存在
|
|
|
|
|
QueryWrapper<PrivilageCpUserStoreDO> cpUserRelationQwByCpUser = new QueryWrapper<>();
|
|
|
|
|
cpUserRelationQwByCpUser.eq("cp_user_id",privilageCpUserDO.getId()).last("limit 1");
|
|
|
|
|
privilageCpUserStoreDO = privilageCpUserStoreDOMapper.selectOne(cpUserRelationQwByCpUser);
|
|
|
|
|
if (privilageCpUserStoreDO != null){
|
|
|
|
|
throw new KiisooException(Constants.MSG_DOMAIN_ENTITY_HAS, Constants.CODE_DOMAIN_ENTITY_HAS);
|
|
|
|
|
}
|
|
|
|
|
// if (privilageCpUserStoreDO != null){
|
|
|
|
|
// throw new KiisooException(Constants.MSG_DOMAIN_ENTITY_HAS, Constants.CODE_DOMAIN_ENTITY_HAS);
|
|
|
|
|
// }
|
|
|
|
|
privilageCpUserDO.setStatus(1);
|
|
|
|
|
privilageCpUserDO.setName(name);
|
|
|
|
|
privilageCpUserDO.setAlias(alias);
|
|
|
|
@ -1113,6 +1113,8 @@ public class StoreEmployeeService {
|
|
|
|
|
privilageCpUserDO.setPosition("店长");
|
|
|
|
|
privilageCpUserDOMapper.insert(privilageCpUserDO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(null == privilageCpUserStoreDO){
|
|
|
|
|
privilageCpUserStoreDO = new PrivilageCpUserStoreDO();
|
|
|
|
|
privilageCpUserStoreDO.setStoreId(poiStore.getId());
|
|
|
|
|
privilageCpUserStoreDO.setCpUserId(privilageCpUserDO.getId());
|
|
|
|
@ -1120,6 +1122,7 @@ public class StoreEmployeeService {
|
|
|
|
|
if (insert == 0){
|
|
|
|
|
throw new KiisooException(Constants.MSG_INSERT_ERROR, Constants.CODE_INSERT_ERROR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SaveAccountInput saveAccountInput = new SaveAccountInput();
|
|
|
|
|
saveAccountInput.setAccount(cpUserId);
|
|
|
|
@ -1274,11 +1277,11 @@ public class StoreEmployeeService {
|
|
|
|
|
public boolean addStoreStaff(PoiStoreStaffVO poiStoreStaffVO) throws KiisooException {
|
|
|
|
|
|
|
|
|
|
//查看店铺
|
|
|
|
|
if (poiStoreStaffVO.getStoreCode() != null) {
|
|
|
|
|
if (poiStoreStaffVO.getStoreCode() == null) {
|
|
|
|
|
throw new KiisooException(Constants.MSG_STORE_NO, Constants.CODE_STORE_NO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (poiStoreStaffVO.getStaffCode() != null) {
|
|
|
|
|
if (poiStoreStaffVO.getStaffCode() == null) {
|
|
|
|
|
throw new KiisooException(Constants.MSG_STAFF_NO, Constants.CODE_STORE_NO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|