parent
408096ad87
commit
78adfdc0ec
@ -0,0 +1,81 @@
|
||||
package com.ruoyi.web.controller.mall;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.mall.domain.ProductShow;
|
||||
import com.ruoyi.mall.domain.vo.ProductShowVO;
|
||||
import com.ruoyi.mall.service.ProductShowService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品展示申请
|
||||
*/
|
||||
@Api(description ="商品展示申请接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/pms/productShow")
|
||||
public class ProductShowController extends BaseController {
|
||||
@Autowired
|
||||
private ProductShowService service;
|
||||
|
||||
@ApiOperation("查询商品信息列表")
|
||||
@PostMapping("/list")
|
||||
public ResponseEntity<Page<ProductShowVO>> list(@RequestBody ProductShowVO query, Pageable page) {
|
||||
List<ProductShowVO> list = service.selectByEntity(query, page);
|
||||
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public ResponseEntity<ProductShow> getInfo(@PathVariable("id") Long id) {
|
||||
ProductShow productShow= service.selectProductShowDetail(id);
|
||||
return ResponseEntity.ok(productShow);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("新增商品申请(租户)")
|
||||
@PreAuthorize("@ss.hasPermi('pms:publish:list')")
|
||||
@PostMapping
|
||||
public ResponseEntity<Boolean> add(@RequestBody ProductShow productShow) {
|
||||
return ResponseEntity.ok(service.insertProductShow(productShow));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation("修改申请(租户)")
|
||||
@PreAuthorize("@ss.hasPermi('pms:publish:list')")
|
||||
@PutMapping
|
||||
public ResponseEntity<Boolean> edit(@RequestBody ProductShow productShowUpdate) {
|
||||
return ResponseEntity.ok(service.updateProductShow(productShowUpdate));
|
||||
}
|
||||
|
||||
@ApiOperation("取消申请/删除(租户)")
|
||||
@PreAuthorize("@ss.hasPermi('pms:publish:list')")
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseEntity<Boolean> remove(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.deleteProductShow(id));
|
||||
}
|
||||
|
||||
//拒绝商品展示
|
||||
@ApiOperation("拒绝商品展示(管理员)")
|
||||
@PreAuthorize("@ss.hasPermi('pms:review:list')")
|
||||
@PutMapping("/refuse/{id}")
|
||||
public ResponseEntity<Boolean> refuse(@PathVariable Long id) {
|
||||
return ResponseEntity.ok(service.refuseProductShow(id));
|
||||
}
|
||||
|
||||
//审核通过
|
||||
@ApiOperation("审核通过(管理员)")
|
||||
@PreAuthorize("@ss.hasPermi('pms:review:list')")
|
||||
@PutMapping("/pass")
|
||||
public ResponseEntity<Boolean> pass(@RequestBody ProductShow productShowUpdate) {
|
||||
return ResponseEntity.ok(service.passProductShow(productShowUpdate));
|
||||
}
|
||||
}
|
||||
@ -1,108 +0,0 @@
|
||||
package com.ruoyi.web.controller.school.course;
|
||||
|
||||
import com.ruoyi.core.api.APIResponse;
|
||||
import com.ruoyi.school.course.domain.ScCourseCla;
|
||||
import com.ruoyi.school.course.domain.req.cla.ReqAddScCourseCla;
|
||||
import com.ruoyi.school.course.domain.req.cla.ReqSearchScCourseCla;
|
||||
import com.ruoyi.school.course.domain.req.time.ReqSearchClaTime;
|
||||
import com.ruoyi.school.course.domain.resp.cla.RespClaAllDetailInfo;
|
||||
import com.ruoyi.school.course.service.impl.BusinessScCourseClaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 课程班级信息 Controller
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-03-17 01:11:06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/sc/course/cla")
|
||||
public class ScCourseClaController {
|
||||
@Autowired
|
||||
private BusinessScCourseClaService scCourseClaService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param reqSearchScCourseCla
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/searchList")
|
||||
public APIResponse searchList(ReqSearchScCourseCla reqSearchScCourseCla) {
|
||||
return scCourseClaService.searchList(reqSearchScCourseCla);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询已经预约签到的会员
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/searchCourseClaStudent")
|
||||
public APIResponse searchCourseClaStudent(ReqSearchClaTime reqSearchClaTime) {
|
||||
return scCourseClaService.searchCourseClaStudent(reqSearchClaTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*
|
||||
* @param claId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/info/detailById/{claId}")
|
||||
public APIResponse detailById(@PathVariable("claId") Long claId) {
|
||||
return scCourseClaService.detailById(claId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* 包含内容较多
|
||||
*
|
||||
* @param claId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/info/allDetailInfoById/{claId}")
|
||||
public APIResponse allDetailInfoById(@PathVariable("claId") Long claId) {
|
||||
RespClaAllDetailInfo allDetailInfo = scCourseClaService.allDetailInfoById(claId);
|
||||
return APIResponse.toAPIResponse(allDetailInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param scCourseCla
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/add/addScCourseCla")
|
||||
public APIResponse addScCourseCla(@RequestBody ReqAddScCourseCla scCourseCla) {
|
||||
return scCourseClaService.addScCourseCla(scCourseCla);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param scCourseCla
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/update/updateScCourseCla")
|
||||
public APIResponse updateScCourseCla(@RequestBody ScCourseCla scCourseCla) {
|
||||
return scCourseClaService.updateScCourseCla(scCourseCla);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param claIds
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/delete/deleteById/{claIds}")
|
||||
public APIResponse deleteById(@PathVariable("claIds") Long[] claIds) {
|
||||
return scCourseClaService.deleteById(claIds);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
package com.ruoyi.framework.config;
|
||||
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
|
||||
//@Component
|
||||
//@RequiredArgsConstructor
|
||||
public class TenantInterceptor implements HandlerInterceptor {
|
||||
|
||||
// private final TenantDataSourceService tenantDataSourceService;
|
||||
//
|
||||
// @Override
|
||||
// public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
// // 从请求头、JWT、Session 等获取租户ID
|
||||
// String tenantId = request.getHeader("X-Tenant-Id");
|
||||
// if (tenantId == null || tenantId.isEmpty()) {
|
||||
// throw new RuntimeException("缺少租户标识");
|
||||
// }
|
||||
//
|
||||
// TenantContext.setTenantId(tenantId);
|
||||
// // 通知 dynamic-datasource 切换数据源
|
||||
// tenantDataSourceService.switchToTenant(tenantId);
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
|
||||
// // 清理资源
|
||||
// tenantDataSourceService.clearDataSource();
|
||||
// TenantContext.clear();
|
||||
// }
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.mall.domain.vo;
|
||||
|
||||
import com.ruoyi.mall.domain.ProductShow;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductShowVO extends ProductShow {
|
||||
private String productName;
|
||||
private String productCategoryName;
|
||||
private String tenantName;
|
||||
private String storeName;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.mall.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.mall.domain.ProductShow;
|
||||
import com.ruoyi.mall.domain.vo.ProductShowVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品展示申请Mapper接口
|
||||
*/
|
||||
public interface ProductShowMapper extends BaseMapper<ProductShow> {
|
||||
|
||||
List<ProductShowVO> selectProductShowList(ProductShowVO productShowVO);
|
||||
|
||||
int onSaleProductShow();
|
||||
|
||||
int expireProductShow();
|
||||
}
|
||||
@ -0,0 +1,145 @@
|
||||
package com.ruoyi.mall.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.ruoyi.common.core.domain.model.LoginUser;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.mall.domain.ProductCategory;
|
||||
import com.ruoyi.mall.domain.ProductShow;
|
||||
import com.ruoyi.mall.domain.vo.ProductShowVO;
|
||||
import com.ruoyi.mall.mapper.ProductCategoryMapper;
|
||||
import com.ruoyi.mall.mapper.ProductShowMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品信息Service业务层处理
|
||||
*
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ProductShowService extends ServiceImpl<ProductShowMapper, ProductShow> implements IService<ProductShow> {
|
||||
|
||||
@Autowired
|
||||
private ProductCategoryMapper productCategoryMapper; // 注入权限验证服务
|
||||
|
||||
|
||||
public List<ProductShowVO> selectByEntity(ProductShowVO productShow, Pageable page) {
|
||||
if (page != null) {
|
||||
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||
//审核页list
|
||||
if(loginUser.getPermissions().contains("pms:review:list")){
|
||||
return baseMapper.selectProductShowList(productShow);
|
||||
}
|
||||
//申请页list
|
||||
productShow.setTenantId(loginUser.getNowTenantId());
|
||||
productShow.setStoreId(loginUser.getDeptId());
|
||||
return baseMapper.selectProductShowList(productShow);
|
||||
}
|
||||
|
||||
//申请商品展示
|
||||
public Boolean insertProductShow(ProductShow productShow) {
|
||||
LoginUser loginUser= SecurityUtils.getLoginUser();
|
||||
productShow.setTenantId(loginUser.getNowTenantId());
|
||||
productShow.setStoreId(loginUser.getDeptId());
|
||||
productShow.setApplyStatus("0");
|
||||
productShow.setApplyTime(LocalDateTime.now());
|
||||
return this.save(productShow);
|
||||
}
|
||||
//获取商品展示详情
|
||||
public ProductShow selectProductShowDetail(Long id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
//修改申请(租户)
|
||||
public Boolean updateProductShow(ProductShow productShowUpdate) {
|
||||
ProductShow dbProductShow =this.getById(productShowUpdate.getId());
|
||||
if ("1,3".contains(dbProductShow.getApplyStatus())){
|
||||
throw new RuntimeException("审核通过或正在展示期的商品不允许修改");
|
||||
}
|
||||
if (dbProductShow.getApplyStatus().equals("4")){
|
||||
throw new RuntimeException("本次申请展示期已结束,如需继续展示请重新提交申请");
|
||||
}
|
||||
ProductShow productShow = new ProductShow();
|
||||
productShow.setId(productShowUpdate.getId());
|
||||
productShow.setProductId(productShowUpdate.getProductId());
|
||||
productShow.setShowStartTime(productShowUpdate.getShowStartTime());
|
||||
productShow.setShowEndTime(productShowUpdate.getShowEndTime());
|
||||
productShow.setApplyStatus("0");
|
||||
return this.updateById(productShow);
|
||||
}
|
||||
|
||||
//取消申请
|
||||
public Boolean deleteProductShow(Long id) {
|
||||
return this.removeById(id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//拒绝商品展示
|
||||
public Boolean refuseProductShow(Long id) {
|
||||
ProductShow dbProductShow =this.getById(id);
|
||||
if (!dbProductShow.getApplyStatus().equals("0")){
|
||||
throw new RuntimeException("当前状态不允许此项操作");
|
||||
}
|
||||
ProductShow productShow = new ProductShow();
|
||||
productShow.setId(id);
|
||||
productShow.setApplyStatus("2");
|
||||
return this.updateById(productShow);
|
||||
}
|
||||
//审核通过
|
||||
public Boolean passProductShow(ProductShow productShowUpdate) {
|
||||
ProductShow dbProductShow =this.getById(productShowUpdate.getId());
|
||||
if (ObjectUtil.isEmpty(dbProductShow)){
|
||||
throw new RuntimeException("租户已取消申请");
|
||||
}
|
||||
if (!dbProductShow.getApplyStatus().equals("0")){
|
||||
throw new RuntimeException("当前状态不允许此项操作");
|
||||
}
|
||||
if (dbProductShow.getShowStartTime().isBefore(LocalDateTime.now().toLocalDate())){
|
||||
throw new RuntimeException("展示开始日期已过,请联系租户修改展示时间后,重新提交申请");
|
||||
}
|
||||
if (ObjectUtil.hasNull(productShowUpdate.getSort(),productShowUpdate.getShowCategory())){
|
||||
throw new RuntimeException("请将上架商品所属分类及排序补充完整");
|
||||
}
|
||||
ProductCategory category=productCategoryMapper.selectById(productShowUpdate.getShowCategory());
|
||||
if (ObjectUtil.isNull(category)){
|
||||
throw new RuntimeException("上架商品所属分类不存在");
|
||||
}
|
||||
ProductShow productShow = new ProductShow();
|
||||
productShow.setId(productShowUpdate.getId());
|
||||
productShow.setReviewTime(productShowUpdate.getReviewTime());
|
||||
productShow.setApplyStatus("1");
|
||||
productShow.setSort(productShowUpdate.getSort());
|
||||
productShow.setShowCategory(productShowUpdate.getShowCategory());
|
||||
productShow.setReviewTime(LocalDateTime.now());
|
||||
return this.updateById(productShow);
|
||||
}
|
||||
|
||||
//上架商品展示 (定时器触发事件)
|
||||
@Transactional
|
||||
public int onSaleProductShow() {
|
||||
int updatedRows=baseMapper.onSaleProductShow();
|
||||
System.out.println("今天开始的展示任务已启动,影响记录数:" + updatedRows);
|
||||
return updatedRows;
|
||||
}
|
||||
//商品展示到期 (定时器触发事件)
|
||||
@Transactional
|
||||
public int expireProductShow() {
|
||||
int updatedRows=baseMapper.onSaleProductShow();
|
||||
System.out.println("昨天结束的展示任务已停止,影响记录数:" + updatedRows);
|
||||
return updatedRows;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,66 +0,0 @@
|
||||
package com.ruoyi.school.course.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.SqlParser;
|
||||
import com.ruoyi.common.page.RespPage;
|
||||
import com.ruoyi.school.course.domain.ScCourseCla;
|
||||
import com.ruoyi.school.course.domain.req.cla.ReqClaCount;
|
||||
import com.ruoyi.school.course.domain.req.cla.ReqCourseClaSelect;
|
||||
import com.ruoyi.school.course.domain.req.cla.ReqSearchScCourseCla;
|
||||
import com.ruoyi.school.course.domain.resp.cla.RespCourseClaInfo;
|
||||
import com.ruoyi.school.course.domain.resp.cla.RespCourseClaSelectInfo;
|
||||
import com.ruoyi.school.student.domain.resp.RespCourseClaStudent;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 课程班级信息 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-03-17 01:11:06
|
||||
*/
|
||||
public interface ScCourseClaMapper extends com.baomidou.mybatisplus.core.mapper.BaseMapper<ScCourseCla> {
|
||||
|
||||
/**
|
||||
* 班级列表
|
||||
*
|
||||
* @param reqSearchScCourseCla
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
List<RespCourseClaInfo> selectClaList(@Param("reqSearchScCourseCla") ReqSearchScCourseCla reqSearchScCourseCla, @Param("page") RespPage page);
|
||||
|
||||
/**
|
||||
* 班级select
|
||||
* @param courseClaSelect
|
||||
* @return
|
||||
*/
|
||||
List<RespCourseClaSelectInfo> selectForSelect(ReqCourseClaSelect courseClaSelect);
|
||||
|
||||
/**
|
||||
* 班级数量
|
||||
* @param reqClaCount
|
||||
* @return
|
||||
*/
|
||||
Integer selectClaCount(ReqClaCount reqClaCount);
|
||||
|
||||
/**
|
||||
* 班级数量
|
||||
* @param tenantId
|
||||
* @return
|
||||
*/
|
||||
@SqlParser(filter = true)
|
||||
Integer selectTenantClaCount(String tenantId);
|
||||
|
||||
/**
|
||||
* 班级在读会员数量
|
||||
* @param claId
|
||||
* @return
|
||||
*/
|
||||
Integer selectStudentCnt(Long claId);
|
||||
|
||||
|
||||
List <RespCourseClaStudent> selectStudenForClaTime(@Param("courseTimeId") String courseTimeId);
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
package com.ruoyi.school.course.service;
|
||||
|
||||
import com.ruoyi.school.course.domain.ScCourseCla;
|
||||
import com.ruoyi.core.api.APIBaseResponse;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 课程班级信息 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-03-17 01:11:06
|
||||
*/
|
||||
public interface IScCourseClaService extends IService<ScCourseCla> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否允许变更 班级所属课程
|
||||
* @param claId
|
||||
* @return
|
||||
*/
|
||||
APIBaseResponse canChangeCourse(Long claId);
|
||||
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
package com.ruoyi.school.course.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.core.api.APIBaseResponse;
|
||||
import com.ruoyi.school.course.domain.ScCourseCla;
|
||||
import com.ruoyi.school.course.mapper.ScCourseClaMapper;
|
||||
import com.ruoyi.school.course.service.IScClaTimeService;
|
||||
import com.ruoyi.school.course.service.IScCourseClaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 课程班级信息 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-03-17 01:11:06
|
||||
*/
|
||||
@Service
|
||||
public class ScCourseClaServiceImpl extends ServiceImpl<ScCourseClaMapper, ScCourseCla> implements IScCourseClaService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IScClaTimeService claTimeService;
|
||||
//todo 当前是否有人预约
|
||||
|
||||
@Override
|
||||
public APIBaseResponse canChangeCourse(Long claId) {
|
||||
// QueryWrapper<ScStudentCourse> qw = new QueryWrapper<>();
|
||||
// qw.eq("cla_id", claId);
|
||||
// int count = studentCourseService.count(qw);
|
||||
// if (count != 0) {
|
||||
// return APIBaseResponse.fail("当前班级有报读会员,无法变更所属课程.");
|
||||
// }
|
||||
//
|
||||
// QueryWrapper<ScClaTime> qwClaTime = new QueryWrapper<>();
|
||||
// qwClaTime.eq("cla_id", claId);
|
||||
// qwClaTime.eq("status", ClaTimeStatusEnums.HAD_CLASS.getStatus());
|
||||
// int hadClaTimeCount = claTimeService.count(qwClaTime);
|
||||
// if (hadClaTimeCount != 0) {
|
||||
// return APIBaseResponse.fail("当前班级已有上课记录,无法变更所属课程.");
|
||||
// }
|
||||
return APIBaseResponse.success();
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,11 @@
|
||||
package com.ruoyi.school.member.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.ruoyi.core.api.APIResponse;
|
||||
import com.ruoyi.school.course.domain.req.course.ReqBusinessOrderCourseDetail;
|
||||
import com.ruoyi.school.member.domain.ScMemberCardTypes;
|
||||
|
||||
|
||||
public interface ScMemberCardTypesService extends IService<ScMemberCardTypes> {
|
||||
|
||||
|
||||
APIResponse orderCardTypeDetail(ReqBusinessOrderCourseDetail orderCourseDetail);
|
||||
void memberTypeDetail(ScMemberCardTypes l);
|
||||
}
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.mall.mapper.ProductShowMapper">
|
||||
|
||||
<select id="selectProductShowList" resultType="com.ruoyi.mall.domain.vo.ProductShowVO">
|
||||
|
||||
SELECT
|
||||
a.*,
|
||||
p.name AS product_name,
|
||||
s.store_name,
|
||||
t.tenant_name,
|
||||
c.type_name AS product_category_name
|
||||
FROM mall_product_show a
|
||||
LEFT JOIN mall_product p ON a.product_id = p.id
|
||||
LEFT JOIN yj_store s ON a.store_id = s.dept_id
|
||||
LEFT JOIN sys_tenant t ON a.tenant_id = t.tenant_id
|
||||
LEFT JOIN mall_product_category c ON a.show_category = c.id
|
||||
WHERE 1=1
|
||||
<if test="tenantId != null and tenantId != ''">
|
||||
and a.tenant_id = #{tenantId}
|
||||
</if>
|
||||
<if test="storeId != null ">
|
||||
and a.store_id =#{storeId}
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
and p.name like concat('%',#{productName},'%')
|
||||
</if>
|
||||
<if test="productName != null and productName != ''">
|
||||
and p.name like concat('%',#{productName},'%')
|
||||
</if>
|
||||
<if test="storeName != null and storeName != ''">
|
||||
and s.store_name like concat('%',#{storeName},'%')
|
||||
</if>
|
||||
<if test="showFlag != null AND showFlag !=''">
|
||||
and a.show_flag =#{showFlag}
|
||||
</if>
|
||||
<if test="applyStatus != null AND applyStatus !=''">
|
||||
and a.apply_status =#{applyStatus}
|
||||
</if>
|
||||
ORDER BY a.apply_time DESC,a.sort ASC
|
||||
</select>
|
||||
|
||||
<update id="onSaleProductShow" parameterType="int">
|
||||
UPDATE mall_product_show
|
||||
SET show_flag = '1', apply_status = '3'
|
||||
WHERE show_start_time = CURDATE();
|
||||
</update>
|
||||
<update id="expireProductShow" parameterType="int">
|
||||
UPDATE mall_product_show
|
||||
SET show_flag = '0', apply_status = '4'
|
||||
WHERE show_end_time = DATE_SUB(CURDATE(), INTERVAL 1 DAY);
|
||||
</update>
|
||||
</mapper>
|
||||
@ -1,109 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.school.course.mapper.ScCourseClaMapper">
|
||||
|
||||
<select id="selectClaList" resultType="com.ruoyi.school.course.domain.resp.cla.RespCourseClaInfo">
|
||||
select
|
||||
a.cla_id,a.cla_name,
|
||||
a.capacity,a.recruit_status,a.open_date,
|
||||
b.course_id,b.course_name,
|
||||
a.staff_id,a.teacher_name,
|
||||
sd.dept_name,
|
||||
(select group_concat(fcn_dict_name_list(r.week_day,'week_day'),' ',substr(r.start_time,1,5),'~',substr(r.end_time,1,5),' (',r.begin_date,'~',r.end_date,')' SEPARATOR ';')
|
||||
from sc_cla_time_rule r
|
||||
where r.cla_id=a.cla_id
|
||||
and r.rule_type='1'
|
||||
and r.repeat_type in ('1','3')
|
||||
and (date_format(now(),'%Y-%m-%d') between r.begin_date and r.end_date or date_format(now(),'%Y-%m-%d') <![CDATA[ < ]]> r.begin_date)) as week_day
|
||||
from sc_course_cla a
|
||||
left join sc_course b on a.course_id=b.course_id
|
||||
left join sys_dept sd on a.depart_id=sd.dept_id
|
||||
where a.delete_flag='0' and a.tenant_id=#{reqSearchScCourseCla.tenantId}
|
||||
<if test="reqSearchScCourseCla.courseId != null">
|
||||
and a.course_id=#{reqSearchScCourseCla.courseId}
|
||||
</if>
|
||||
<if test="reqSearchScCourseCla.staffId != null">
|
||||
and a.staff_id=#{reqSearchScCourseCla.staffId}
|
||||
</if>
|
||||
<if test="reqSearchScCourseCla.claName != null and reqSearchScCourseCla.claName != ''">
|
||||
and a.cla_name like concat('%',#{reqSearchScCourseCla.claName},'%')
|
||||
</if>
|
||||
<if test="reqSearchScCourseCla.departId != null">
|
||||
and a.depart_id=#{reqSearchScCourseCla.departId}
|
||||
</if>
|
||||
and a.delete_flag='0'
|
||||
order by a.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectForSelect" resultType="com.ruoyi.school.course.domain.resp.cla.RespCourseClaSelectInfo">
|
||||
select a.cla_id,a.cla_name,b.course_id,b.course_name,c.nick_name as staff_name,
|
||||
dept.dept_id,
|
||||
dept.dept_name
|
||||
from sc_course_cla a
|
||||
left join sc_course b on a.course_id=b.course_id
|
||||
left join sys_user c on a.staff_id=c.user_id
|
||||
left join sys_dept dept on a.depart_id=dept.dept_id
|
||||
where a.delete_flag='0'
|
||||
<if test="search != null and search != ''">
|
||||
and (a.cla_name like concat('%',#{search},'%')
|
||||
or b.course_name like concat('%',#{search},'%')
|
||||
or c.nick_name like concat('%',#{search},'%')
|
||||
)
|
||||
</if>
|
||||
order by a.create_time desc limit 0,#{maxRecord}
|
||||
</select>
|
||||
<select id="selectClaCount" resultType="java.lang.Integer">
|
||||
select count(1) from sc_course_cla cc
|
||||
where cc.delete_flag='0'
|
||||
<if test="teacherId != null">
|
||||
and cc.staff_id=#{teacherId}
|
||||
</if>
|
||||
<if test="deptId != null">
|
||||
and cc.depart_id=#{deptId}
|
||||
</if>
|
||||
<if test="deptId == null and userId != null and userId != ''">
|
||||
and exists(select 1 from sys_user_dept ud
|
||||
where ud.user_id=#{userId}
|
||||
and (ud.dept_id=cc.depart_id or ud.dept_id=-1))
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectTenantClaCount" resultType="java.lang.Integer">
|
||||
select count(1) from sc_course_cla where tenant_id=#{tenantId} and delete_flag='0'
|
||||
</select>
|
||||
<select id="selectStudentCnt" resultType="java.lang.Integer">
|
||||
|
||||
select count(1) from sc_student_course sc where sc.cla_id=#{claId} and sc.status='1'
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectStudenForClaTime" resultType="RespCourseClaStudent">
|
||||
SELECT
|
||||
b.student_id,b.student_name,b.sex,b.phone,
|
||||
a.course_time_id,
|
||||
a.id as book_id,
|
||||
a.card_no,
|
||||
(select type.card_name from sc_member_card_types type where card.card_type_id=type.card_type_id) as card_type_name,
|
||||
a.charge_type,
|
||||
a.deduct_cnt,
|
||||
a.deduct_fee,
|
||||
card.remaining_count,
|
||||
card.remaining_total_fee,
|
||||
card.expiry_date,
|
||||
a.book_status,
|
||||
a.create_time,
|
||||
a.check_in,
|
||||
a.check_in_time,
|
||||
c.count_before,
|
||||
c.count_after,
|
||||
c.fee_before,
|
||||
c.fee_after
|
||||
from sc_student b ,
|
||||
sc_member_cards card,
|
||||
sc_book_course a
|
||||
LEFT JOIN sc_cla_time_attend c on a.id=c.book_id
|
||||
WHERE
|
||||
a.card_no=card.card_no
|
||||
and a.student_id=b.student_id
|
||||
and a.course_time_id=#{courseTimeId}
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in new issue