Browse Source

Merge remote-tracking branch 'origin/dev' into dev

fanxp 1 year ago
parent
commit
0c54e3d8fb

+ 104 - 0
src/main/java/com/xjrsoft/module/dataexpert/controller/DataExpertSourceController.java

@@ -0,0 +1,104 @@
+package com.xjrsoft.module.dataexpert.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.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.dataexpert.dto.AddDataExpertSourceDto;
+import com.xjrsoft.module.dataexpert.dto.DataExpertSourcePageDto;
+import com.xjrsoft.module.dataexpert.dto.UpdateDataExpertSourceDto;
+import com.xjrsoft.module.dataexpert.entity.DataExpertSource;
+import com.xjrsoft.module.dataexpert.service.IDataExpertSourceService;
+import com.xjrsoft.module.dataexpert.vo.DataExpertSourcePageVo;
+import com.xjrsoft.module.dataexpert.vo.DataExpertSourceVo;
+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 javax.validation.Valid;
+import java.util.Date;
+import java.util.List;
+
+/**
+* @title: 数据导出-数据源设置
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@RestController
+@RequestMapping("/dataexpert" + "/dataExpertSource")
+@Api(value = "/dataexpert"  + "/dataExpertSource",tags = "数据导出-数据源设置代码")
+@AllArgsConstructor
+public class DataExpertSourceController {
+
+
+    private final IDataExpertSourceService dataExpertSourceService;
+
+    @GetMapping(value = "/page")
+    @ApiOperation(value="数据导出-数据源设置列表(分页)")
+    @SaCheckPermission("dataexpertsource:detail")
+    public RT<PageOutput<DataExpertSourcePageVo>> page(@Valid DataExpertSourcePageDto dto){
+
+        LambdaQueryWrapper<DataExpertSource> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper
+                    .orderByDesc(DataExpertSource::getId)
+                .select(DataExpertSource.class,x -> VoToColumnUtil.fieldsToColumns(DataExpertSourcePageVo.class).contains(x.getProperty()));
+        IPage<DataExpertSource> page = dataExpertSourceService.page(ConventPage.getPage(dto), queryWrapper);
+        PageOutput<DataExpertSourcePageVo> pageOutput = ConventPage.getPageOutput(page, DataExpertSourcePageVo.class);
+        return RT.ok(pageOutput);
+    }
+
+    @GetMapping(value = "/info")
+    @ApiOperation(value="根据id查询数据导出-数据源设置信息")
+    @SaCheckPermission("dataexpertsource:detail")
+    public RT<DataExpertSourceVo> info(@RequestParam Long id){
+        DataExpertSource dataExpertSource = dataExpertSourceService.getByIdDeep(id);
+        if (dataExpertSource == null) {
+           return RT.error("找不到此数据!");
+        }
+        return RT.ok(BeanUtil.toBean(dataExpertSource, DataExpertSourceVo.class));
+    }
+
+
+    @PostMapping
+    @ApiOperation(value = "新增数据导出-数据源设置")
+    @SaCheckPermission("dataexpertsource:add")
+    public RT<Boolean> add(@Valid @RequestBody AddDataExpertSourceDto dto){
+        DataExpertSource dataExpertSource = BeanUtil.toBean(dto, DataExpertSource.class);
+        dataExpertSource.setCreateDate(new Date());
+        boolean isSuccess = dataExpertSourceService.add(dataExpertSource);
+        return RT.ok(isSuccess);
+    }
+
+    @PutMapping
+    @ApiOperation(value = "修改数据导出-数据源设置")
+    @SaCheckPermission("dataexpertsource:edit")
+    public RT<Boolean> update(@Valid @RequestBody UpdateDataExpertSourceDto dto){
+
+        DataExpertSource dataExpertSource = BeanUtil.toBean(dto, DataExpertSource.class);
+        dataExpertSource.setModifyDate(new Date());
+        return RT.ok(dataExpertSourceService.update(dataExpertSource));
+
+    }
+
+    @DeleteMapping
+    @ApiOperation(value = "删除数据导出-数据源设置")
+    @SaCheckPermission("dataexpertsource:delete")
+    public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
+        return RT.ok(dataExpertSourceService.delete(ids));
+
+    }
+
+}

+ 45 - 0
src/main/java/com/xjrsoft/module/dataexpert/dto/AddDataExpertSourceDto.java

@@ -0,0 +1,45 @@
+package com.xjrsoft.module.dataexpert.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+
+/**
+* @title: 数据导出-数据源设置
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Data
+public class AddDataExpertSourceDto implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 数据源名称
+    */
+    @ApiModelProperty("数据源名称")
+    private String name;
+    /**
+    * 数据源类型
+    */
+    @ApiModelProperty("数据源类型")
+    private String sourceType;
+    /**
+    * magicapi地址
+    */
+    @ApiModelProperty("magicapi地址")
+    private String apiUrl;
+
+    @ApiModelProperty("字段配置")
+    private String fieldJson;
+
+}

+ 19 - 0
src/main/java/com/xjrsoft/module/dataexpert/dto/DataExpertSourcePageDto.java

@@ -0,0 +1,19 @@
+package com.xjrsoft.module.dataexpert.dto;
+
+import com.xjrsoft.common.page.PageInput;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+
+/**
+* @title: 数据导出-数据源设置分页查询入参
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Data
+@EqualsAndHashCode(callSuper = false)
+public class DataExpertSourcePageDto extends PageInput {
+
+
+}

+ 24 - 0
src/main/java/com/xjrsoft/module/dataexpert/dto/UpdateDataExpertSourceDto.java

@@ -0,0 +1,24 @@
+package com.xjrsoft.module.dataexpert.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+
+/**
+* @title: 数据导出-数据源设置
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Data
+public class UpdateDataExpertSourceDto extends AddDataExpertSourceDto {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+}

+ 96 - 0
src/main/java/com/xjrsoft/module/dataexpert/entity/DataExpertSource.java

@@ -0,0 +1,96 @@
+package com.xjrsoft.module.dataexpert.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+* @title: 数据导出-数据源设置
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Data
+@TableName("data_expert_source")
+@ApiModel(value = "data_expert_source", description = "数据导出-数据源设置")
+public class DataExpertSource 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;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 数据源名称
+    */
+    @ApiModelProperty("数据源名称")
+    private String name;
+    /**
+    * 数据源类型
+    */
+    @ApiModelProperty("数据源类型")
+    private String sourceType;
+    /**
+    * magicapi地址
+    */
+    @ApiModelProperty("magicapi地址")
+    private String apiUrl;
+
+    @ApiModelProperty("字段配置")
+    private String fieldJson;
+
+}

+ 16 - 0
src/main/java/com/xjrsoft/module/dataexpert/mapper/DataExpertSourceMapper.java

@@ -0,0 +1,16 @@
+package com.xjrsoft.module.dataexpert.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.xjrsoft.module.dataexpert.entity.DataExpertSource;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @title: 数据导出-数据源设置
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Mapper
+public interface DataExpertSourceMapper extends MPJBaseMapper<DataExpertSource> {
+
+}

+ 39 - 0
src/main/java/com/xjrsoft/module/dataexpert/service/IDataExpertSourceService.java

@@ -0,0 +1,39 @@
+package com.xjrsoft.module.dataexpert.service;
+
+import com.github.yulichang.base.MPJBaseService;
+import com.xjrsoft.module.dataexpert.entity.DataExpertSource;
+
+import java.util.List;
+
+/**
+* @title: 数据导出-数据源设置
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+
+public interface IDataExpertSourceService extends MPJBaseService<DataExpertSource> {
+    /**
+    * 新增
+    *
+    * @param dataExpertSource
+    * @return
+    */
+    Boolean add(DataExpertSource dataExpertSource);
+
+    /**
+    * 更新
+    *
+    * @param dataExpertSource
+    * @return
+    */
+    Boolean update(DataExpertSource dataExpertSource);
+
+    /**
+    * 删除
+    *
+    * @param ids
+    * @return
+    */
+    Boolean delete(List<Long> ids);
+}

+ 45 - 0
src/main/java/com/xjrsoft/module/dataexpert/service/impl/DataExpertSourceServiceImpl.java

@@ -0,0 +1,45 @@
+package com.xjrsoft.module.dataexpert.service.impl;
+
+import com.github.yulichang.base.MPJBaseServiceImpl;
+import com.xjrsoft.module.dataexpert.entity.DataExpertSource;
+import com.xjrsoft.module.dataexpert.mapper.DataExpertSourceMapper;
+import com.xjrsoft.module.dataexpert.service.IDataExpertSourceService;
+import lombok.AllArgsConstructor;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+* @title: 数据导出-数据源设置
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Service
+@AllArgsConstructor
+public class DataExpertSourceServiceImpl extends MPJBaseServiceImpl<DataExpertSourceMapper, DataExpertSource> implements IDataExpertSourceService {
+    private final DataExpertSourceMapper dataExpertSourceDataExpertSourceMapper;
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean add(DataExpertSource dataExpertSource) {
+        dataExpertSourceDataExpertSourceMapper.insert(dataExpertSource);
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean update(DataExpertSource dataExpertSource) {
+        dataExpertSourceDataExpertSourceMapper.updateById(dataExpertSource);
+        return true;
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Boolean delete(List<Long> ids) {
+        dataExpertSourceDataExpertSourceMapper.deleteBatchIds(ids);
+        return true;
+    }
+}

+ 75 - 0
src/main/java/com/xjrsoft/module/dataexpert/vo/DataExpertSourcePageVo.java

@@ -0,0 +1,75 @@
+package com.xjrsoft.module.dataexpert.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+* @title: 数据导出-数据源设置分页列表出参
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Data
+public class DataExpertSourcePageVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private String id;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long createUserId;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Date createDate;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long modifyUserId;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Date modifyDate;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer deleteMark;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer enabledMark;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 数据源名称
+    */
+    @ApiModelProperty("数据源名称")
+    private String name;
+    /**
+    * 数据源类型
+    */
+    @ApiModelProperty("数据源类型")
+    private String sourceType;
+    /**
+    * magicapi地址
+    */
+    @ApiModelProperty("magicapi地址")
+    private String apiUrl;
+
+    @ApiModelProperty("字段配置")
+    private String fieldJson;
+}

+ 44 - 0
src/main/java/com/xjrsoft/module/dataexpert/vo/DataExpertSourceVo.java

@@ -0,0 +1,44 @@
+package com.xjrsoft.module.dataexpert.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+* @title: 数据导出-数据源设置表单出参
+* @Author dzx
+* @Date: 2024-04-19
+* @Version 1.0
+*/
+@Data
+public class DataExpertSourceVo {
+
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Long id;
+    /**
+    * 
+    */
+    @ApiModelProperty("")
+    private Integer sortCode;
+    /**
+    * 数据源名称
+    */
+    @ApiModelProperty("数据源名称")
+    private String name;
+    /**
+    * 数据源类型
+    */
+    @ApiModelProperty("数据源类型")
+    private String sourceType;
+    /**
+    * magicapi地址
+    */
+    @ApiModelProperty("magicapi地址")
+    private String apiUrl;
+
+    @ApiModelProperty("字段配置")
+    private String fieldJson;
+
+}

+ 1 - 1
src/main/java/com/xjrsoft/module/liteflow/node/StudentDropOutNode.java

@@ -34,7 +34,7 @@ public class StudentDropOutNode extends NodeComponent {
             //查询出数据
             StudentDropOut studentDropOut = studentDropOutMapper.selectById(formId);
             //跟新学籍信息
-            BaseStudentSchoolRoll schoolRoll = studentSchoolRollService.getById(
+            BaseStudentSchoolRoll schoolRoll = studentSchoolRollService.getOne(
                 new QueryWrapper<BaseStudentSchoolRoll>().lambda()
                 .eq(BaseStudentSchoolRoll::getClassId, studentDropOut.getClassId())
                 .eq(BaseStudentSchoolRoll::getUserId, studentDropOut.getStudentUserId())

+ 0 - 5
src/main/java/com/xjrsoft/module/student/entity/StudentDropOut.java

@@ -69,11 +69,6 @@ public class StudentDropOut implements Serializable {
     @ApiModelProperty("有效标志")
     @TableField(fill = FieldFill.INSERT)
     private Integer enabledMark;
-    /**
-    * 序号
-    */
-    @ApiModelProperty("序号")
-    private Integer sortCode;
 
     @ApiModelProperty("学生id")
     private Long studentUserId;

+ 1 - 1
src/main/java/com/xjrsoft/module/student/service/impl/BaseStudentSchoolRollServiceImpl.java

@@ -193,6 +193,6 @@ public class BaseStudentSchoolRollServiceImpl extends MPJBaseServiceImpl<BaseStu
 
     @Override
     public Boolean updateStudentClass(Long classId, Long userId) {
-        return null;
+        return baseStudentSchoolRollMapper.updateStudentClass(classId, userId);
     }
 }

+ 15 - 17
src/main/java/com/xjrsoft/module/system/controller/SystemMenuCommonlyUsedController.java

@@ -1,42 +1,37 @@
 package com.xjrsoft.module.system.controller;
 
+import cn.dev33.satoken.annotation.SaCheckPermission;
 import cn.dev33.satoken.stp.StpUtil;
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.yulichang.toolkit.MPJWrappers;
 import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import com.xjrsoft.common.constant.GlobalConstant;
-import com.baomidou.mybatisplus.core.toolkit.StringPool;
+import com.xjrsoft.common.model.result.RT;
 import com.xjrsoft.common.page.ConventPage;
 import com.xjrsoft.common.page.PageOutput;
-import com.xjrsoft.common.model.result.RT;
-import com.xjrsoft.common.utils.TreeUtil;
 import com.xjrsoft.common.utils.VoToColumnUtil;
 import com.xjrsoft.module.system.dto.AddSystemMenuCommonlyUsedDto;
-import com.xjrsoft.module.system.dto.UpdateSystemMenuCommonlyUsedDto;
-import cn.dev33.satoken.annotation.SaCheckPermission;
-
 import com.xjrsoft.module.system.dto.SystemMenuCommonlyUsedPageDto;
-import com.xjrsoft.module.system.entity.Menu;
+import com.xjrsoft.module.system.dto.UpdateSystemMenuCommonlyUsedDto;
 import com.xjrsoft.module.system.entity.SystemMenuCommonlyUsed;
 import com.xjrsoft.module.system.service.ISystemMenuCommonlyUsedService;
-import com.xjrsoft.module.system.vo.MenuTreeVo;
 import com.xjrsoft.module.system.vo.SystemMenuCommonlyUsedPageVo;
-
 import com.xjrsoft.module.system.vo.SystemMenuCommonlyUsedVo;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
-import org.springframework.web.bind.annotation.*;
+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 javax.validation.Valid;
-import javax.validation.constraints.NotNull;
 import java.util.List;
-import java.util.stream.Collectors;
 
 /**
 * @title: 常用功能设置
@@ -116,9 +111,12 @@ public class SystemMenuCommonlyUsedController {
     @ApiOperation(value = "新增常用功能设置")
     @SaCheckPermission("systemmenucommonlyused:add")
     public RT<Boolean> add(@Valid @RequestBody AddSystemMenuCommonlyUsedDto dto){
+        if(dto.getMenuId() == null){
+            return RT.error("菜单id缺失");
+        }
         SystemMenuCommonlyUsed systemMenuCommonlyUsed = BeanUtil.toBean(dto, SystemMenuCommonlyUsed.class);
         boolean isSuccess = systemMenuCommonlyUsedService.save(systemMenuCommonlyUsed);
-    return RT.ok(isSuccess);
+        return RT.ok(isSuccess);
     }
 
     @PutMapping

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

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