调整校区/品牌查询

This commit is contained in:
DB 2023-11-23 17:39:00 +08:00
parent 8465ceb4d0
commit 5f2973e4a2
9 changed files with 155 additions and 32 deletions

View File

@ -89,7 +89,7 @@ public class MiniLoginStrategy implements LoginStrategy {
private void changeJamboxUser(MiniUserLoginInfo loginInfo, Map<String, Object> credentials, SourceType sourceType) {
//获取品牌表
Row brand = DbChain.table("cp_sys_brand")
.select("csb.id", "csb.is_open_mall")
.select("csb.id", "csb.is_open_sharing")
.from("cp_sys_brand").as("csb")
.leftJoin("cp_j_brand_extend").as("cjbe").on("cjbe.brand_id = csb.id")
.and("cjbe.brand_cloud_id = ?", credentials.get("brandId"))

View File

@ -2,13 +2,9 @@ package com.cpop.oam.business.controller.callback;
import com.cpop.common.utils.JsonUtils;
import com.cpop.common.utils.StringUtils;
import com.cpop.core.service.RedisService;
import com.cpop.core.utils.SpringUtils;
import com.cpop.oam.business.service.OamWxCpService;
import com.cpop.oam.framework.config.wxCp.WxCpConfiguration;
import com.cpop.oam.framework.constant.WxCpConstant;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.message.WxCpXmlMessage;
import me.chanjar.weixin.cp.bean.message.WxCpXmlOutMessage;

View File

@ -145,14 +145,10 @@ public class FinanceReimburseServiceImpl extends ServiceImpl<FinanceReimburseMap
**/
@Override
public ReimbursePersonStatisticVo getPersonStatistic() {
//获取用户信息
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
//读取员工信息
RedisService redisService = SpringUtils.getBean(RedisService.class);
JSONObject cacheObject = redisService.getCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername());
OamStaffLoginInfo loginInfo = cacheObject.getJSONObject("user").toJavaObject(OamStaffLoginInfo.class);
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
List<FinanceReimburse> list = this.list(QueryWrapper.create()
.where(FINANCE_REIMBURSE.STAFF_ID.eq(loginInfo.getId()))
.where(FINANCE_REIMBURSE.STAFF_ID.eq(loginUserInfo.getString("id")))
.and(FINANCE_REIMBURSE.STATUS.ne(4)));
//统计
ReimbursePersonStatisticVo vo = new ReimbursePersonStatisticVo();

View File

@ -73,8 +73,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
public Page<TaskPageVo> getTaskPage(TaskPageBo bo) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.mapper.paginateAs(pageDomain.getPageNum(),pageDomain.getPageSize(),
QueryWrapper.create()
.where(TASK.TASK_STATUS.eq(1))
QueryWrapper.create().where(TASK.TASK_STATUS.eq(1))
.and(TASK.TASK_TYPE.eq(bo.getTaskType()))
.and(TASK.TASK_RATING.eq(bo.getTaskRating()))
.orderBy(TASK.EXPECTED_COMPLETION_DATE.asc()),
@ -415,18 +414,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
public TaskMonthStatisticsVo getTaskMonthStatistics(TaskMonthStatisticsBo bo) {
//员工组绩点信息
List<TaskStaffGroup> taskStaffGroups = null;
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
//读取员工信息
RedisService redisService = SpringUtils.getBean(RedisService.class);
JSONObject cacheObject = redisService.getCacheObject(UserType.OAM_USER.getKey() + loginUser.getUsername());
OamStaffLoginInfo loginInfo = cacheObject.getJSONObject("user").toJavaObject(OamStaffLoginInfo.class);
JSONObject loginUserInfo = SecurityUtils.getInstance().getLoginUserInfo();
QueryWrapper queryWrapper = QueryWrapper.create();
if (Constants.SUPER_ADMIN.equals(loginUser.getUsername())) {
if (Constants.SUPER_ADMIN.equals(loginUserInfo.getString("userName"))) {
//TODO超级管理员暂时获取所有任务
} else {
//查询个人涉及到的任务
TaskStaffGroupService taskStaffGroupService = SpringUtils.getBean(TaskStaffGroupService.class);
taskStaffGroups = taskStaffGroupService.list(QueryWrapper.create().where(TASK_STAFF_GROUP.STAFF_ID.eq(loginInfo.getId())));
taskStaffGroups = taskStaffGroupService.list(QueryWrapper.create().where(TASK_STAFF_GROUP.STAFF_ID.eq(loginUserInfo.getString("id"))));
if (!taskStaffGroups.isEmpty()) {
queryWrapper.and(TASK.ID.in(taskStaffGroups.stream().map(TaskStaffGroup::getTaskId).collect(Collectors.toSet())));
}

View File

@ -0,0 +1,23 @@
/*
* @Author: DB
* @Date: 2023-11-23 15:22:53
* @Description: 请填写简介
*/
package com.cpop.system.business.bo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
@Data
@Accessors(chain = true)
@ApiModel(value = "校区分页对象")
public class StorePageBo implements Serializable {
/**
* 校区名
*/
@ApiModelProperty("校区名")
private String name;
}

View File

@ -1,22 +1,16 @@
package com.cpop.system.business.controller;
import com.cpop.core.base.R;
import com.cpop.system.business.bo.StorePageBo;
import com.cpop.system.business.vo.StorePageVo;
import com.mybatisflex.core.paginate.Page;
import org.springframework.web.bind.annotation.DeleteMapping;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import com.cpop.system.business.entity.Store;
import com.cpop.system.business.service.StoreService;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.io.Serializable;
import java.util.List;
/**
* 系统-店铺/校区表 控制层
@ -29,7 +23,21 @@ import java.util.List;
@RequestMapping("/store")
public class StoreController {
@Autowired
private StoreService storeService;
@Autowired
private StoreService storeService;
/**
* @Description: 查询校区分页列表
* @param bo
* @return R<PageVo<CampusPageListVo>>
* @Author Administrator
* @Date: 2023/6/7 0007 10:18
*/
@ApiOperation("查询校区分页列表")
@GetMapping("/getStorePage")
public R<Page<StorePageVo>> getStorePage(StorePageBo bo) {
Page<StorePageVo> pageVo = storeService.getStorePage(bo);
return R.ok(pageVo);
}
}

View File

@ -1,5 +1,8 @@
package com.cpop.system.business.service;
import com.cpop.system.business.bo.StorePageBo;
import com.cpop.system.business.vo.StorePageVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
import com.cpop.system.business.entity.Store;
@ -11,4 +14,11 @@ import com.cpop.system.business.entity.Store;
*/
public interface StoreService extends IService<Store> {
/**
* @Author: DB
* @description: 获取校区分页列表
* @Date: 2023-11-23 15:40:30
* @return {*}
*/
Page<StorePageVo> getStorePage(StorePageBo bo);
}

View File

@ -1,10 +1,26 @@
/*
* @Author: DB
*
* @Date: 2023-10-26 18:22:22
*
* @Description: 请填写简介
*/
package com.cpop.system.business.service.impl;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.cpop.core.base.entity.PageDomain;
import com.cpop.core.utils.sql.SqlUtils;
import com.cpop.system.business.bo.StorePageBo;
import com.cpop.system.business.entity.Store;
import com.cpop.system.business.mapper.StoreMapper;
import com.cpop.system.business.service.StoreService;
import com.cpop.system.business.vo.StorePageVo;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.mybatisflex.core.query.QueryWrapper;
import static com.cpop.system.business.entity.table.BrandTableDef.BRAND;
import static com.cpop.system.business.entity.table.StoreTableDef.STORE;
/**
* 系统-店铺/校区表 服务层实现
@ -15,4 +31,18 @@ import org.springframework.stereotype.Service;
@Service("storeService")
public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements StoreService {
/**
* @Author: DB
* @description: 获取校区分页列表
* @Date: 2023-11-23 15:35:05
* @return {*}
*/
@Override
public Page<StorePageVo> getStorePage(StorePageBo bo) {
PageDomain pageDomain = SqlUtils.getInstance().getPageDomain();
return this.getMapper().paginateAs(Page.of(pageDomain.getPageNum(), pageDomain.getPageSize()),
QueryWrapper.create().select(STORE.ALL_COLUMNS).select(BRAND.BRAND_NAME).from(STORE).leftJoin(BRAND)
.on(BRAND.ID.eq(STORE.BRAND_ID)),
StorePageVo.class);
}
}

View File

@ -0,0 +1,64 @@
package com.cpop.system.business.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import com.cpop.core.base.enums.SourceType;
/*
* @Author: DB
*
* @Date: 2023-11-23 15:05:53
*
* @Description: 店铺分页返回对象
*/
@Data
@Accessors(chain = true)
@ApiModel(value = "校区/店铺分页返回对象")
public class StorePageVo implements Serializable {
/**
* 店铺/校区id
*/
@ApiModelProperty("主键")
private String id;
/**
* 云校区id
*/
@ApiModelProperty("云校区id")
private String campusCloudId;
/**
* 品牌id
*/
@ApiModelProperty("品牌id")
private String brandId;
/**
* 品牌名
*/
@ApiModelProperty("品牌名")
private String brandName;
/**
* 店铺/校区名
*/
@ApiModelProperty("店铺/校区名")
private String storeName;
/**
* 地址
*/
@ApiModelProperty("地址")
private String address;
/**
* 数据来源
*/
@ApiModelProperty("数据来源")
private SourceType sourceType;
}