New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.course.CoursePackageClient; |
| | | import com.dsh.course.feignClient.course.model.QueryCoursePackageLists; |
| | | import com.dsh.guns.core.support.HttpKit; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICoursePackageService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 11:51 |
| | | */ |
| | | @Service |
| | | public class CoursePackageService implements ICoursePackageService { |
| | | |
| | | @Resource |
| | | private CoursePackageClient coursePackageClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取列表数据 |
| | | * @param provinceCode |
| | | * @param cityCode |
| | | * @param coursePackageTypeId |
| | | * @param name |
| | | * @param status |
| | | * @param state |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Page<Map<String, Object>> queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, Integer storeId, String name, Integer status, Integer state) { |
| | | QueryCoursePackageLists queryCoursePackageLists = new QueryCoursePackageLists(); |
| | | queryCoursePackageLists.setProvinceCode(provinceCode); |
| | | queryCoursePackageLists.setCityCode(cityCode); |
| | | queryCoursePackageLists.setCoursePackageTypeId(coursePackageTypeId); |
| | | queryCoursePackageLists.setStoreId(storeId); |
| | | queryCoursePackageLists.setName(name); |
| | | queryCoursePackageLists.setState(state); |
| | | queryCoursePackageLists.setStatus(status); |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | queryCoursePackageLists.setLimit(Integer.valueOf(request.getParameter("limit"))); |
| | | queryCoursePackageLists.setOffset(Integer.valueOf(request.getParameter("offset"))); |
| | | queryCoursePackageLists.setSort(request.getParameter("sort")); |
| | | queryCoursePackageLists.setOrder(request.getParameter("order")); |
| | | Page<Map<String, Object>> mapPage = coursePackageClient.queryCoursePackageLists(queryCoursePackageLists); |
| | | List<Map<String, Object>> records = mapPage.getRecords(); |
| | | for (Map<String, Object> record : records) { |
| | | TStore store = storeService.getById(Integer.valueOf(record.get("storeId").toString())); |
| | | record.put("store", store.getName()); |
| | | } |
| | | return mapPage; |
| | | } |
| | | } |