Эх сурвалжийг харах

Merge remote-tracking branch 'origin/master'

SheepHy 3 долоо хоног өмнө
parent
commit
468664dd82

+ 182 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppInstructorController.java

@@ -0,0 +1,182 @@
+package org.jeecg.modules.system.app.controller;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.system.query.QueryRuleEnum;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.system.app.entity.AppInstructor;
+import org.jeecg.modules.system.app.service.IAppInstructorService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Operation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+ /**
+ * @Description: 教练表
+ * @Author: jeecg-boot
+ * @Date:   2025-07-04
+ * @Version: V1.0
+ */
+@Tag(name="教练表")
+@RestController
+@RequestMapping("/org/jeecg/modules/app/appInstructor")
+@Slf4j
+public class AppInstructorController extends JeecgController<AppInstructor, IAppInstructorService> {
+	@Autowired
+	private IAppInstructorService appInstructorService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param appInstructor
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "教练表-分页列表查询")
+	@Operation(summary="教练表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<AppInstructor>> queryPageList(AppInstructor appInstructor,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+
+
+        QueryWrapper<AppInstructor> queryWrapper = QueryGenerator.initQueryWrapper(appInstructor, req.getParameterMap());
+		Page<AppInstructor> page = new Page<AppInstructor>(pageNo, pageSize);
+		IPage<AppInstructor> pageList = appInstructorService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param appInstructor
+	 * @return
+	 */
+	@AutoLog(value = "教练表-添加")
+	@Operation(summary="教练表-添加")
+	@RequiresPermissions("org.jeecg.modules.app:nm_instructor:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody AppInstructor appInstructor) {
+		appInstructorService.save(appInstructor);
+
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param appInstructor
+	 * @return
+	 */
+	@AutoLog(value = "教练表-编辑")
+	@Operation(summary="教练表-编辑")
+	@RequiresPermissions("org.jeecg.modules.app:nm_instructor:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody AppInstructor appInstructor) {
+		appInstructorService.updateById(appInstructor);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "教练表-通过id删除")
+	@Operation(summary="教练表-通过id删除")
+	@RequiresPermissions("org.jeecg.modules.app:nm_instructor:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		appInstructorService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "教练表-批量删除")
+	@Operation(summary="教练表-批量删除")
+	@RequiresPermissions("org.jeecg.modules.app:nm_instructor:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.appInstructorService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "教练表-通过id查询")
+	@Operation(summary="教练表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<AppInstructor> queryById(@RequestParam(name="id",required=true) String id) {
+		AppInstructor appInstructor = appInstructorService.getById(id);
+		if(appInstructor==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(appInstructor);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param appInstructor
+    */
+    @RequiresPermissions("org.jeecg.modules.app:nm_instructor:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, AppInstructor appInstructor) {
+        return super.exportXls(request, appInstructor, AppInstructor.class, "教练表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    @RequiresPermissions("org.jeecg.modules.app:nm_instructor:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, AppInstructor.class);
+    }
+
+}

+ 8 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppCourese.java

@@ -57,6 +57,14 @@ public class AppCourese implements Serializable {
 	@Excel(name = "费用类型;0 精品 1免费 仅课程", width = 15)
     @Schema(description = "费用类型;0 精品 1免费 仅课程")
     private Integer priceType;
+    /**原价*/
+    @Excel(name = "原价", width = 15)
+    @Schema(description = "原价")
+    private BigDecimal originalPrice;
+    /**售价*/
+    @Excel(name = "售价", width = 15)
+    @Schema(description = "售价")
+    private BigDecimal sellingPrice;
 	/**上课场地*/
 	@Excel(name = "上课场地", width = 15)
     @Schema(description = "上课场地")

+ 0 - 8
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppCoursesPriceRules.java

@@ -53,14 +53,6 @@ public class AppCoursesPriceRules implements Serializable {
 	@Excel(name = "名称", width = 15)
     @Schema(description = "名称")
     private String name;
-	/**原价*/
-	@Excel(name = "原价", width = 15)
-    @Schema(description = "原价")
-    private BigDecimal originalPrice;
-	/**售价*/
-	@Excel(name = "售价", width = 15)
-    @Schema(description = "售价")
-    private BigDecimal sellingPrice;
 	/**开始时间*/
 	@Excel(name = "开始时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")

+ 105 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/entity/AppInstructor.java

@@ -0,0 +1,105 @@
+package org.jeecg.modules.system.app.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import org.jeecg.common.constant.ProvinceCityArea;
+import org.jeecg.common.util.SpringContextUtils;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 教练表
+ * @Author: jeecg-boot
+ * @Date:   2025-07-04
+ * @Version: V1.0
+ */
+@Data
+@TableName("nm_instructor")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@Schema(description="教练表")
+public class AppInstructor implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**id*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @Schema(description = "id")
+    private String id;
+	/**用户id*/
+	@Excel(name = "用户id", width = 15)
+    @Schema(description = "用户id")
+    private String userId;
+	/**好评率*/
+	@Excel(name = "好评率", width = 15)
+    @Schema(description = "好评率")
+    private BigDecimal goodRate;
+	/**部门编号*/
+	@Excel(name = "部门编号", width = 15)
+    @Schema(description = "部门编号")
+    private String orgCode;
+	/**授课人数*/
+	@Excel(name = "授课人数", width = 15)
+    @Schema(description = "授课人数")
+    private Integer classesNumber;
+	/**培训项目*/
+	@Excel(name = "培训项目", width = 15)
+    @Schema(description = "培训项目")
+    private String trainingPrograms;
+	/**教学理念*/
+	@Excel(name = "教学理念", width = 15)
+    @Schema(description = "教学理念")
+    private String teachingPhilosophy;
+	/**擅长说明*/
+	@Excel(name = "擅长说明", width = 15)
+    @Schema(description = "擅长说明")
+    private String excelMsg;
+	/**无犯罪证明*/
+	@Excel(name = "无犯罪证明", width = 15)
+    @Schema(description = "无犯罪证明")
+    private String certificateInnocence;
+	/**健康证*/
+	@Excel(name = "健康证", width = 15)
+    @Schema(description = "健康证")
+    private String healthy;
+	/**荣誉证书多个逗号分隔*/
+	@Excel(name = "荣誉证书多个逗号分隔", width = 15)
+    @Schema(description = "荣誉证书多个逗号分隔")
+    private String honor;
+	/**系统状态;状态(0-正常,1-冻结)*/
+	@Excel(name = "系统状态;状态(0-正常,1-冻结)", width = 15)
+    @Schema(description = "系统状态;状态(0-正常,1-冻结)")
+    private Integer status;
+	/**删除标志;删除状态(0-正常,1-已删除)*/
+	@Excel(name = "删除标志;删除状态(0-正常,1-已删除)", width = 15)
+    @Schema(description = "删除标志;删除状态(0-正常,1-已删除)")
+    @TableLogic
+    private Integer delFlag;
+	/**创建人;创建人*/
+    @Schema(description = "创建人;创建人")
+    private String createBy;
+	/**创建时间;创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "创建时间;创建时间")
+    private Date createTime;
+	/**更新人;更新人*/
+    @Schema(description = "更新人;更新人")
+    private String updateBy;
+	/**更新时间;更新时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "更新时间;更新时间")
+    private Date updateTime;
+}

+ 17 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/AppInstructorMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.system.app.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.system.app.entity.AppInstructor;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 教练表
+ * @Author: jeecg-boot
+ * @Date:   2025-07-04
+ * @Version: V1.0
+ */
+public interface AppInstructorMapper extends BaseMapper<AppInstructor> {
+
+}

+ 5 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/mapper/xml/AppInstructorMapper.xml

@@ -0,0 +1,5 @@
+<?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="org.jeecg.modules.system.app.mapper.AppInstructorMapper">
+
+</mapper>

+ 14 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppInstructorService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.system.app.service;
+
+import org.jeecg.modules.system.app.entity.AppInstructor;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 教练表
+ * @Author: jeecg-boot
+ * @Date:   2025-07-04
+ * @Version: V1.0
+ */
+public interface IAppInstructorService extends IService<AppInstructor> {
+
+}

+ 19 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppInstructorServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.system.app.service.impl;
+
+import org.jeecg.modules.system.app.entity.AppInstructor;
+import org.jeecg.modules.system.app.mapper.AppInstructorMapper;
+import org.jeecg.modules.system.app.service.IAppInstructorService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 教练表
+ * @Author: jeecg-boot
+ * @Date:   2025-07-04
+ * @Version: V1.0
+ */
+@Service
+public class AppInstructorServiceImpl extends ServiceImpl<AppInstructorMapper, AppInstructor> implements IAppInstructorService {
+
+}

+ 23 - 0
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/utils/GoodRateUtil.java

@@ -0,0 +1,23 @@
+package org.jeecg.modules.system.app.utils;
+
+/**
+ * @author DM
+ * @date 2025/7/3 20:39
+ * @description
+ */
+public class GoodRateUtil {
+    /**
+     *
+     * @param rate
+     * @return
+     */
+//    public static String getRate(double oleRate, double) {
+//        if (rate < 0) {
+//            return "0.0";
+//        }
+//        if (rate > 100) {
+//            return "100.0";
+//        }
+//        return String.format("%.1f", rate);
+//    }
+}