Parcourir la source

招商模块提交

小么熊🐻 il y a 1 an
Parent
commit
7da822aff2

+ 0 - 5
nbjk-admin/src/main/java/com/miaxis/app/controller/feed/FeedBackController.java

@@ -1,20 +1,15 @@
 package com.miaxis.app.controller.feed;
 
-import com.miaxis.common.annotation.Log;
 import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.domain.Response;
 import com.miaxis.common.core.page.ResponsePageInfo;
-import com.miaxis.common.enums.BusinessTypeEnum;
-import com.miaxis.common.utils.poi.ExcelUtil;
 import com.miaxis.feed.domain.FeedBack;
 import com.miaxis.feed.service.IFeedBackService;
 import io.swagger.annotations.*;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.Arrays;
 import java.util.List;
 
 /**

+ 110 - 0
nbjk-admin/src/main/java/com/miaxis/open/controller/AentInfoController.java

@@ -0,0 +1,110 @@
+package com.miaxis.open.controller;
+
+import com.miaxis.aent.domain.AentInfo;
+import com.miaxis.aent.service.IAentInfoService;
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【招商】Controller
+ *
+ * @author miaxis
+ * @date 2023-10-26
+ */
+@RestController
+@RequestMapping(Constants.OPEN_PREFIX+"/aent/info")
+@Api(tags={"【app-招商】"})
+public class AentInfoController extends BaseController{
+    @Autowired
+    private IAentInfoService aentInfoService;
+
+    /**
+     * 查询招商列表
+     */
+    @PreAuthorize("@ss.hasPermi('aent:info:list')")
+    @GetMapping("/list")
+    @ApiOperation("查询招商列表")
+        @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<AentInfo> list(@ModelAttribute AentInfo aentInfo){
+        startPage();
+        List<AentInfo> list = aentInfoService.selectAentInfoList(aentInfo);
+        return toResponsePageInfo(list);
+    }
+    
+    /**
+     * 导出招商列表
+     */
+    @PreAuthorize("@ss.hasPermi('aent:info:export')")
+    @Log(title = "招商", businessType = BusinessTypeEnum.EXPORT)
+    @GetMapping("/export")
+    @ApiOperation("导出招商列表Excel")
+    public Response<String> export(@ModelAttribute AentInfo aentInfo){
+        List<AentInfo> list = aentInfoService.selectAentInfoList(aentInfo);
+        ExcelUtil<AentInfo> util = new ExcelUtil<AentInfo>(AentInfo.class);
+        return util.exportExcel(list, "info");
+    }
+
+    /**
+     * 获取招商详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('aent:info:query')")
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取招商详细信息")
+    public Response<AentInfo> getInfo(
+            @ApiParam(name = "id", value = "招商参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(aentInfoService.getById(id));
+    }
+
+    /**
+     * 新增招商
+     */
+    @PreAuthorize("@ss.hasPermi('aent:info:add')")
+    @Log(title = "招商", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增招商")
+    public Response<Integer> add(@RequestBody AentInfo aentInfo){
+        return toResponse(aentInfoService.save(aentInfo) ? 1 : 0);
+    }
+
+    /**
+     * 修改招商
+     */
+    @PreAuthorize("@ss.hasPermi('aent:info:edit')")
+    @Log(title = "招商", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改招商")
+    public Response<Integer> edit(@RequestBody AentInfo aentInfo){
+        return toResponse(aentInfoService.updateById(aentInfo) ? 1 : 0);
+    }
+
+    /**
+     * 删除招商
+     */
+    @PreAuthorize("@ss.hasPermi('aent:info:remove')")
+    @Log(title = "招商", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除招商")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "招商ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(aentInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+}

+ 97 - 0
nbjk-admin/src/main/java/com/miaxis/open/controller/OpenFileInfoController.java

@@ -0,0 +1,97 @@
+package com.miaxis.open.controller;
+
+import com.miaxis.common.annotation.Log;
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.exception.CustomException;
+import com.miaxis.file.domain.FileInfo;
+import com.miaxis.file.service.IFileInfoService;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【上传文件】Controller
+ *
+ * @author miaxis
+ * @date 2023-05-08
+ */
+@RestController
+@RequestMapping(Constants.OPEN_PREFIX+"/file/info")
+@Api(tags={"【app-开放上传文件】"})
+public class OpenFileInfoController extends BaseController{
+    @Autowired
+    private IFileInfoService fileInfoService;
+
+    /**
+     * 查询上传文件列表
+     */
+    @GetMapping("/list")
+    @ApiOperation("查询上传文件列表")
+        @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<FileInfo> list(@ModelAttribute FileInfo fileInfo){
+        startPage();
+        List<FileInfo> list = fileInfoService.selectFileInfoList(fileInfo);
+        return toResponsePageInfo(list);
+    }
+
+
+
+    /**
+     * 删除上传文件
+     */
+    @Log(title = "上传文件", businessType = BusinessTypeEnum.DELETE)
+	@DeleteMapping("/{ids}")
+    @ApiOperation("删除上传文件")
+    public  Response<Integer> remove(
+            @ApiParam(name = "ids", value = "上传文件ids参数", required = true)
+            @PathVariable Long[] ids
+    ){
+        return toResponse(fileInfoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+
+    /**
+     * 文件上传
+     */
+    @PutMapping("/fileUp")
+    @ApiOperation("文件上传")
+    public Response fileUp(List<MultipartFile> coverFiles,
+                                @RequestParam("businessType") String businessType
+                            ) throws IOException {
+        if (coverFiles==null || coverFiles.size()==0){
+            throw new CustomException("文件未上传");
+        }
+        return fileInfoService.fileUp(businessType,coverFiles);
+    }
+
+
+    /**
+     * 上传图片
+     * @param uploadImage
+     * @return
+     * @throws IOException
+     */
+    @PostMapping("/uploadImage")
+    @ResponseBody
+    @ApiOperation("公众号开放上传文件接口")
+    public Response uploadImageFile(@RequestParam("img") MultipartFile uploadImage,@RequestParam("type")String type) throws IOException {
+        List<MultipartFile> files = new ArrayList<MultipartFile>();
+        files.add(uploadImage);
+        return fileInfoService.fileUp(type,files);
+    }
+
+
+
+}

+ 160 - 0
nbjk-service/src/main/java/com/miaxis/aent/domain/AentInfo.java

@@ -0,0 +1,160 @@
+package com.miaxis.aent.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import lombok.Data;
+/**
+ * 招商对象 aent_info
+ *
+ * @author miaxis
+ * @date 2023-10-26
+ */
+@Data
+@TableName("aent_info")
+@ApiModel(value = "AentInfo", description = "招商对象 aent_info")
+public class AentInfo extends BaseBusinessEntity{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
+    /** 姓名 */
+    @Excel(name = "姓名")
+    @TableField("name")
+    @ApiModelProperty(value = "姓名")
+    private String name;
+
+    /** 性别 1男 2女 */
+    @Excel(name = "性别 1男 2女")
+    @TableField("sex")
+    @ApiModelProperty(value = "性别 1男 2女")
+    private Long sex;
+
+    /** 职业 1:教练 2:驾校 3:自媒体  4:相关从业者 */
+    @Excel(name = "职业 1:教练 2:驾校 3:自媒体  4:相关从业者")
+    @TableField("career")
+    @ApiModelProperty(value = "职业 1:教练 2:驾校 3:自媒体  4:相关从业者")
+    private Long career;
+
+    /** 证件的文件ID */
+    @Excel(name = "证件的文件ID")
+    @TableField("document")
+    @ApiModelProperty(value = "证件的文件ID")
+    private Long document;
+
+    /** 手机号 */
+    @Excel(name = "手机号")
+    @TableField("phone")
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    /** 微信号 */
+    @Excel(name = "微信号")
+    @TableField("wechar")
+    @ApiModelProperty(value = "微信号")
+    private String wechar;
+
+    /** 1:软件代理  2:书籍代理  3:软件+书籍 */
+    @Excel(name = "1:软件代理  2:书籍代理  3:软件+书籍")
+    @TableField("project")
+    @ApiModelProperty(value = "1:软件代理  2:书籍代理  3:软件+书籍")
+    private Long project;
+
+    /** 加盟原因 */
+    @Excel(name = "加盟原因")
+    @TableField("reason")
+    @ApiModelProperty(value = "加盟原因")
+    private String reason;
+
+    public void setId(Long id){
+        this.id = id;
+    }
+
+    public Long getId(){
+        return id;
+    }
+    public void setName(String name){
+        this.name = name;
+    }
+
+    public String getName(){
+        return name;
+    }
+    public void setSex(Long sex){
+        this.sex = sex;
+    }
+
+    public Long getSex(){
+        return sex;
+    }
+    public void setCareer(Long career){
+        this.career = career;
+    }
+
+    public Long getCareer(){
+        return career;
+    }
+    public void setDocument(Long document){
+        this.document = document;
+    }
+
+    public Long getDocument(){
+        return document;
+    }
+    public void setPhone(String phone){
+        this.phone = phone;
+    }
+
+    public String getPhone(){
+        return phone;
+    }
+    public void setWechar(String wechar){
+        this.wechar = wechar;
+    }
+
+    public String getWechar(){
+        return wechar;
+    }
+    public void setProject(Long project){
+        this.project = project;
+    }
+
+    public Long getProject(){
+        return project;
+    }
+    public void setReason(String reason){
+        this.reason = reason;
+    }
+
+    public String getReason(){
+        return reason;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("sex", getSex())
+            .append("career", getCareer())
+            .append("document", getDocument())
+            .append("phone", getPhone())
+            .append("wechar", getWechar())
+            .append("project", getProject())
+            .append("reason", getReason())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 22 - 0
nbjk-service/src/main/java/com/miaxis/aent/mapper/AentInfoMapper.java

@@ -0,0 +1,22 @@
+package com.miaxis.aent.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.aent.domain.AentInfo;
+
+/**
+ * 招商Mapper接口
+ *
+ * @author miaxis
+ * @date 2023-10-26
+ */
+public interface AentInfoMapper extends BaseMapper<AentInfo> {
+    /**
+     * 查询招商列表
+     *
+     * @param aentInfo 招商
+     * @return 招商集合
+     */
+    public List<AentInfo> selectAentInfoList(AentInfo aentInfo);
+
+}

+ 21 - 0
nbjk-service/src/main/java/com/miaxis/aent/service/IAentInfoService.java

@@ -0,0 +1,21 @@
+package com.miaxis.aent.service;
+
+import java.util.List;
+import com.miaxis.aent.domain.AentInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 招商Service接口
+ *
+ * @author miaxis
+ * @date 2023-10-26
+ */
+public interface IAentInfoService extends IService<AentInfo>{
+    /**
+     * 查询招商列表
+     *
+     * @param aentInfo 招商
+     * @return 招商集合
+     */
+    public List<AentInfo> selectAentInfoList(AentInfo aentInfo);
+}

+ 36 - 0
nbjk-service/src/main/java/com/miaxis/aent/service/impl/AentInfoServiceImpl.java

@@ -0,0 +1,36 @@
+package com.miaxis.aent.service.impl;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.miaxis.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.apache.commons.lang3.StringUtils;
+import com.miaxis.aent.mapper.AentInfoMapper;
+import com.miaxis.aent.domain.AentInfo;
+import com.miaxis.aent.service.IAentInfoService;
+
+/**
+ * 招商Service业务层处理
+ *
+ * @author miaxis
+ * @date 2023-10-26
+ */
+@Service
+public class AentInfoServiceImpl extends ServiceImpl<AentInfoMapper, AentInfo> implements IAentInfoService {
+    @Autowired
+    private AentInfoMapper aentInfoMapper;
+
+    /**
+     * 查询招商列表
+     *
+     * @param aentInfo 招商
+     * @return 招商
+     */
+    @Override
+    public List<AentInfo> selectAentInfoList(AentInfo aentInfo){
+        return aentInfoMapper.selectAentInfoList(aentInfo);
+    }
+}

+ 39 - 0
nbjk-service/src/main/resources/mapper/aent/AentInfoMapper.xml

@@ -0,0 +1,39 @@
+<?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.miaxis.aent.mapper.AentInfoMapper">
+
+    <resultMap type="AentInfo" id="AentInfoResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="sex"    column="sex"    />
+        <result property="career"    column="career"    />
+        <result property="document"    column="document"    />
+        <result property="phone"    column="phone"    />
+        <result property="wechar"    column="wechar"    />
+        <result property="project"    column="project"    />
+        <result property="reason"    column="reason"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectAentInfoVo">
+        select * from aent_info
+    </sql>
+
+    <select id="selectAentInfoList" parameterType="AentInfo" resultMap="AentInfoResult">
+        <include refid="selectAentInfoVo"/>
+        <where>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="sex != null "> and sex = #{sex}</if>
+            <if test="career != null "> and career = #{career}</if>
+            <if test="document != null "> and document = #{document}</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+            <if test="wechar != null  and wechar != ''"> and wechar = #{wechar}</if>
+            <if test="project != null "> and project = #{project}</if>
+            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
+        </where>
+    </select>
+
+</mapper>