dzx 4 ماه پیش
والد
کامیت
587c8f3869

+ 116 - 0
src/main/java/com/xjrsoft/module/xycxedu/controller/ExamPlanController.java

@@ -0,0 +1,116 @@
+package com.xjrsoft.module.xycxedu.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import cn.hutool.core.bean.BeanUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.xjrsoft.common.model.result.RT;
+import com.xjrsoft.common.page.ConventPage;
+import com.xjrsoft.common.page.PageOutput;
+import com.xjrsoft.common.utils.VoToColumnUtil;
+import com.xjrsoft.module.xycxedu.dto.AddExamPlanDto;
+import com.xjrsoft.module.xycxedu.dto.ExamPlanPageDto;
+import com.xjrsoft.module.xycxedu.dto.UpdateExamPlanDto;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import com.xjrsoft.module.xycxedu.entity.XycxeduExamList;
+import com.xjrsoft.module.xycxedu.service.IExamPlanService;
+import com.xjrsoft.module.xycxedu.service.IXycxeduExamListService;
+import com.xjrsoft.module.xycxedu.vo.ExamPlanPageVo;
+import com.xjrsoft.module.xycxedu.vo.ExamPlanVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+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.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/xycxedu" + "/examPlan")
+@Api(value = "/xycxedu"  + "/examPlan",tags = "考试计划维护代码")
+@AllArgsConstructor
+public class ExamPlanController {
+
+
+    private final IExamPlanService examPlanService;
+    private final IXycxeduExamListService examListService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="考试计划维护列表(分页)")
+    @SaCheckPermission("examplan:detail")
+    public RT<PageOutput<ExamPlanPageVo>> page(@Valid ExamPlanPageDto dto){
+
+        LambdaQueryWrapper<ExamPlan> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.orderByDesc(ExamPlan::getId)
+                .eq(ExamPlan::getSemesterId, dto.getSemesterId())
+                .like(ExamPlan::getName, dto.getName())
+                .select(ExamPlan.class,x -> VoToColumnUtil.fieldsToColumns(ExamPlanPageVo.class).contains(x.getProperty()));
+        IPage<ExamPlan> page = examPlanService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<ExamPlanPageVo> pageOutput = ConventPage.getPageOutput(page, ExamPlanPageVo.class);
+        for (ExamPlanPageVo record : pageOutput.getList()) {
+            String[] split = record.getMilexamids().split(",");
+            List<Long> milexamids = Arrays.asList(split).stream()
+                    .map(Long::parseLong)
+                    .collect(Collectors.toList());
+            examListService.list(new QueryWrapper<XycxeduExamList>().lambda().in(XycxeduExamList::getMilexamid, milexamids));
+        }
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询考试计划维护信息")
+    @SaCheckPermission("examplan:detail")
+    public RT<ExamPlanVo> info(@RequestParam Long id){
+        ExamPlan examPlan = examPlanService.getById(id);
+        if (examPlan == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(examPlan, ExamPlanVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增考试计划维护")
+    @SaCheckPermission("examplan:add")
+    public RT<Boolean> add(@Valid @RequestBody AddExamPlanDto dto){
+        ExamPlan examPlan = BeanUtil.toBean(dto, ExamPlan.class);
+        boolean isSuccess = examPlanService.save(examPlan);
+        return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改考试计划维护")
+    @SaCheckPermission("examplan:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateExamPlanDto dto){
+
+        ExamPlan examPlan = BeanUtil.toBean(dto, ExamPlan.class);
+        return RT.ok(examPlanService.updateById(examPlan));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除考试计划维护")
+    @SaCheckPermission("examplan:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(examPlanService.removeBatchByIds(ids));
+
+    }
+}

+ 43 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/AddExamPlanDto.java

@@ -0,0 +1,43 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class AddExamPlanDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+}

+ 31 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/ExamPlanPageDto.java

@@ -0,0 +1,31 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+
+/**
+* @title: 考试计划维护分页查询入参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class ExamPlanPageDto extends PageInput {
+
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+
+    @ApiModelProperty("计划名称")
+    private String name;
+
+}

+ 32 - 0
src/main/java/com/xjrsoft/module/xycxedu/dto/UpdateExamPlanDto.java

@@ -0,0 +1,32 @@
+package com.xjrsoft.module.xycxedu.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import java.util.List;
+import java.util.Date;
+
+
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class UpdateExamPlanDto extends AddExamPlanDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 93 - 0
src/main/java/com/xjrsoft/module/xycxedu/entity/ExamPlan.java

@@ -0,0 +1,93 @@
+package com.xjrsoft.module.xycxedu.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.github.yulichang.annotation.EntityMapping;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.io.Serializable;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+@TableName("exam_plan")
+@ApiModel(value = "exam_plan", description = "考试计划维护")
+public class ExamPlan implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    @TableId
+    private Long id;
+    /**
+    * 创建人
+    */
+    @ApiModelProperty("创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ApiModelProperty("创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ApiModelProperty("修改人")
+    @TableField(fill = FieldFill.UPDATE)
+    private Long modifyUserId;
+    /**
+    * 修改日期
+    */
+    @ApiModelProperty("修改日期")
+    @TableField(fill = FieldFill.UPDATE)
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ApiModelProperty("删除标记")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
+    private Integer deleteMark;
+    /**
+    * 有效标记
+    */
+    @ApiModelProperty("有效标记")
+    @TableField(fill = FieldFill.INSERT)
+    private Integer enabledMark;
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/xycxedu/mapper/ExamPlanMapper.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.xycxedu.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Mapper
+public interface ExamPlanMapper extends MPJBaseMapper<ExamPlan> {
+
+}

+ 17 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/IExamPlanService.java

@@ -0,0 +1,17 @@
+package com.xjrsoft.module.xycxedu.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import lombok.Data;
+import java.util.List;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+
+public interface IExamPlanService extends MPJBaseService<ExamPlan> {
+}

+ 25 - 0
src/main/java/com/xjrsoft/module/xycxedu/service/impl/ExamPlanServiceImpl.java

@@ -0,0 +1,25 @@
+package com.xjrsoft.module.xycxedu.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.xycxedu.entity.ExamPlan;
+import com.xjrsoft.module.xycxedu.mapper.ExamPlanMapper;
+import com.xjrsoft.module.xycxedu.service.IExamPlanService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Collectors;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+
+/**
+* @title: 考试计划维护
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class ExamPlanServiceImpl extends MPJBaseServiceImpl<ExamPlanMapper, ExamPlan> implements IExamPlanService {
+}

+ 100 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanPageVo.java

@@ -0,0 +1,100 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.write.style.ContentStyle;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import com.xjrsoft.common.annotation.Trans;
+import com.xjrsoft.common.enums.TransType;
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+* @title: 考试计划维护分页列表出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class ExamPlanPageVo {
+
+    /**
+    * 
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("")
+    @ApiModelProperty("")
+    private String id;
+    /**
+    * 创建人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建人")
+    @ApiModelProperty("创建人")
+    private Long createUserId;
+    /**
+    * 创建时间
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("创建时间")
+    @ApiModelProperty("创建时间")
+    private Date createDate;
+    /**
+    * 修改人
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改人")
+    @ApiModelProperty("修改人")
+    private Long modifyUserId;
+    /**
+    * 修改日期
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("修改日期")
+    @ApiModelProperty("修改日期")
+    private Date modifyDate;
+    /**
+    * 删除标记
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("删除标记")
+    @ApiModelProperty("删除标记")
+    private Integer deleteMark;
+    /**
+    * 有效标记
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("有效标记")
+    @ApiModelProperty("有效标记")
+    private Integer enabledMark;
+    /**
+    * 学期id
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("学期id")
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("考试计划名称")
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ContentStyle(dataFormat = 49)
+    @ExcelProperty("晓羊策学考试计划id")
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+    @ApiModelProperty("晓羊策学考试计划名称")
+    private String milexamnames;
+
+}

+ 44 - 0
src/main/java/com/xjrsoft/module/xycxedu/vo/ExamPlanVo.java

@@ -0,0 +1,44 @@
+package com.xjrsoft.module.xycxedu.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.time.LocalTime;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Date;
+
+/**
+* @title: 考试计划维护表单出参
+* @Author dzx
+* @Date: 2024-07-18
+* @Version 1.0
+*/
+@Data
+public class ExamPlanVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 学期id
+    */
+    @ApiModelProperty("学期id")
+    private Long semesterId;
+    /**
+    * 考试计划名称
+    */
+    @ApiModelProperty("考试计划名称")
+    private String name;
+    /**
+    * 晓羊策学考试计划id
+    */
+    @ApiModelProperty("晓羊策学考试计划id")
+    private String milexamids;
+
+
+
+}

+ 0 - 8
src/test/java/com/xjrsoft/module/xycxedu/util/ApiUtilTest.java

@@ -1,10 +1,6 @@
 package com.xjrsoft.module.xycxedu.util;
 
 import cn.hutool.http.HttpUtil;
-import org.jsoup.Jsoup;
-import org.jsoup.nodes.Document;
-import org.jsoup.nodes.Element;
-import org.jsoup.select.Elements;
 import org.junit.jupiter.api.Test;
 
 import java.io.IOException;
@@ -25,10 +21,6 @@ class ApiUtilTest {
     void test() throws IOException {
         String url = host + "/exam/list?schoolid=" + schoolid + "&accessid=" + accessid + "&sign=" + sign;
         String s = HttpUtil.get(url);
-        Document doc = Jsoup.connect(url).get();
-        Elements titles = doc.select("pre");
-        Element firstTitle = titles.first();
-        System.out.println(firstTitle.toString());
     }
 
     @Test

+ 25 - 0
src/test/java/com/xjrsoft/xjrsoftboot/FreeMarkerGeneratorTest.java

@@ -3430,4 +3430,29 @@ public class FreeMarkerGeneratorTest {
 
         apiGeneratorService.generateCodes(params);
     }
+
+    @Test
+    public void gcExamPlan() throws IOException {
+        List<TableConfig> tableConfigs = new ArrayList<>();
+        TableConfig mainTable = new TableConfig();
+        mainTable.setTableName("exam_plan");//init_sql中的表名
+        mainTable.setIsMain(true);//是否是主表,一般默认为true
+        mainTable.setPkField(GlobalConstant.DEFAULT_PK);//设置主键
+        mainTable.setPkType(GlobalConstant.DEFAULT_PK_TYPE);//设置主键类型
+        tableConfigs.add(mainTable);
+
+        ApiGenerateCodesDto params = new ApiGenerateCodesDto();
+        params.setAuthor("dzx");//作者名称
+        params.setPackageName("xycxedu");//包名
+        params.setTableConfigs(tableConfigs);
+        params.setPage(true);//是否生成分页接口
+        params.setImport(true);//是否生成导入接口
+        params.setExport(false);//是否生成导出接口
+        params.setOutMainDir(true);//是否生成在主目录,前期测试可设置成false
+        params.setDs(ds);
+
+        IApiGeneratorService apiGeneratorService = new ApiGeneratorServiceImpl();
+
+        apiGeneratorService.generateCodes(params);
+    }
 }