Procházet zdrojové kódy

fix:投诉管理初始化

wrj před 9 měsíci
rodič
revize
96397486f8

+ 1 - 1
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/BusinessDevelopmentController.java

@@ -97,7 +97,7 @@ public class BusinessDevelopmentController extends BaseController {
      * @param idList 主键结合
      * @return 删除结果
      */
-    @GetMapping("delete")
+    @PostMapping("delete")
     @ApiOperation("删除数据")
     public R delete(@RequestParam("idList") List<Long> idList) {
         return R.ok(this.businessDevelopmentService.removeByIds(idList));

+ 97 - 0
nightFragrance-admin/src/main/java/com/ylx/web/controller/massage/ComplaintController.java

@@ -0,0 +1,97 @@
+package com.ylx.web.controller.massage;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
+import com.ylx.common.core.domain.R;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ylx.common.core.controller.BaseController;
+import com.ylx.massage.domain.Complaint;
+import com.ylx.massage.service.ComplaintService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * 投诉(Complaint)表控制层
+ *
+ * @author makejava
+ * @since 2024-07-30 11:06:59
+ */
+@RestController
+@RequestMapping("complaint")
+@Api(tags = {"投诉(Complaint)表控制层"})
+
+public class ComplaintController extends BaseController {
+    /**
+     * 服务对象
+     */
+    @Resource
+    private ComplaintService complaintService;
+
+    /**
+     * 分页查询所有数据
+     *
+     * @param page      分页对象
+     * @param complaint 查询实体
+     * @return 所有数据
+     */
+    @GetMapping("selectAll")
+    @ApiOperation("分页查询所有数据")
+    public R selectAll(Page<Complaint> page, Complaint complaint) {
+        return R.ok(this.complaintService.page(page, new QueryWrapper<>(complaint)));
+    }
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id 主键
+     * @return 单条数据
+     */
+    @GetMapping("{id}")
+    @ApiOperation("通过主键查询单条数据")
+    public R selectOne(@PathVariable Serializable id) {
+        return R.ok(this.complaintService.getById(id));
+    }
+
+    /**
+     * 新增数据
+     *
+     * @param complaint 实体对象
+     * @return 新增结果
+     */
+    @PostMapping("add")
+    @ApiOperation("新增数据")
+    public R insert(@RequestBody Complaint complaint) {
+        return R.ok(this.complaintService.save(complaint));
+    }
+
+    /**
+     * 修改数据
+     *
+     * @param complaint 实体对象
+     * @return 修改结果
+     */
+    @PostMapping("update")
+    @ApiOperation("修改数据")
+    public R update(@RequestBody Complaint complaint) {
+        return R.ok(this.complaintService.updateById(complaint));
+    }
+
+    /**
+     * 删除数据
+     *
+     * @param idList 主键结合
+     * @return 删除结果
+     */
+    @PostMapping("delete")
+    @ApiOperation("删除数据")
+    public R delete(@RequestParam("idList") List<Long> idList) {
+        return R.ok(this.complaintService.removeByIds(idList));
+    }
+}
+

+ 159 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/domain/Complaint.java

@@ -0,0 +1,159 @@
+package com.ylx.massage.domain;
+
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 投诉(Complaint)表实体类
+ *
+ * @author makejava
+ * @since 2024-07-30 11:06:59
+ */
+@SuppressWarnings("serial")
+public class Complaint extends Model<Complaint> {
+    //id
+    private String id;
+    //投诉类型
+    private String complaintType;
+    //问题描述
+    private String description;
+    //投诉技师
+    private String name;
+    //图片
+    private String photograph;
+    //部门名称
+    private String deptName;
+    //部门Id
+    private String deptId;
+    //手机
+    private String phone;
+    //openId
+    private String openId;
+    //备注
+    private String remark;
+    //系统创建时间
+    private Date createTime;
+    //系统修改时间
+    private Date updateTime;
+    //是否删除0否1是
+    private Integer isDelete;
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getComplaintType() {
+        return complaintType;
+    }
+
+    public void setComplaintType(String complaintType) {
+        this.complaintType = complaintType;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getPhotograph() {
+        return photograph;
+    }
+
+    public void setPhotograph(String photograph) {
+        this.photograph = photograph;
+    }
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getDeptId() {
+        return deptId;
+    }
+
+    public void setDeptId(String deptId) {
+        this.deptId = deptId;
+    }
+
+    public String getPhone() {
+        return phone;
+    }
+
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public Integer getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    /**
+     * 获取主键值
+     *
+     * @return 主键值
+     */
+    @Override
+    public Serializable pkVal() {
+        return this.id;
+    }
+}
+

+ 35 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/mapper/ComplaintMapper.java

@@ -0,0 +1,35 @@
+package com.ylx.massage.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+import com.ylx.massage.domain.Complaint;
+
+/**
+ * 投诉(Complaint)表数据库访问层
+ *
+ * @author makejava
+ * @since 2024-07-30 11:06:59
+ */
+public interface ComplaintMapper extends BaseMapper<Complaint> {
+
+    /**
+     * 批量新增数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<Complaint> 实例对象列表
+     * @return 影响行数
+     */
+    int insertBatch(@Param("entities") List<Complaint> entities);
+
+    /**
+     * 批量新增或按主键更新数据(MyBatis原生foreach方法)
+     *
+     * @param entities List<Complaint> 实例对象列表
+     * @return 影响行数
+     * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参
+     */
+    int insertOrUpdateBatch(@Param("entities") List<Complaint> entities);
+
+}
+

+ 15 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/ComplaintService.java

@@ -0,0 +1,15 @@
+package com.ylx.massage.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ylx.massage.domain.Complaint;
+
+/**
+ * 投诉(Complaint)表服务接口
+ *
+ * @author makejava
+ * @since 2024-07-30 11:06:59
+ */
+public interface ComplaintService extends IService<Complaint> {
+
+}
+

+ 19 - 0
nightFragrance-massage/src/main/java/com/ylx/massage/service/impl/ComplaintServiceImpl.java

@@ -0,0 +1,19 @@
+package com.ylx.massage.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ylx.massage.mapper.ComplaintMapper;
+import com.ylx.massage.domain.Complaint;
+import com.ylx.massage.service.ComplaintService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 投诉(Complaint)表服务实现类
+ *
+ * @author makejava
+ * @since 2024-07-30 11:06:59
+ */
+@Service("complaintService")
+public class ComplaintServiceImpl extends ServiceImpl<ComplaintMapper, Complaint> implements ComplaintService {
+
+}
+

+ 46 - 0
nightFragrance-massage/src/main/resources/mapper/massage/ComplaintMapper.xml

@@ -0,0 +1,46 @@
+<?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.ylx.massage.mapper.ComplaintMapper">
+
+    <resultMap type="com.ylx.massage.domain.Complaint" id="ComplaintMap">
+        <result property="id" column="id" jdbcType="VARCHAR"/>
+        <result property="complaintType" column="complaint_type" jdbcType="VARCHAR"/>
+        <result property="description" column="description" jdbcType="VARCHAR"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="photograph" column="photograph" jdbcType="VARCHAR"/>
+        <result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
+        <result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
+        <result property="phone" column="phone" jdbcType="VARCHAR"/>
+        <result property="openId" column="open_id" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!-- 批量插入 -->
+    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into
+        ry-vue.complaint(complaint_typedescriptionnamephotographdept_namedept_idphoneopen_idremarkcreate_timeupdate_timeis_delete)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.complaintType}#{entity.description}#{entity.name}#{entity.photograph}#{entity.deptName}#{entity.deptId}#{entity.phone}#{entity.openId}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
+        </foreach>
+    </insert>
+    <!-- 批量插入或按主键更新 -->
+    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
+        insert into
+        ry-vue.complaint(complaint_typedescriptionnamephotographdept_namedept_idphoneopen_idremarkcreate_timeupdate_timeis_delete)
+        values
+        <foreach collection="entities" item="entity" separator=",">
+            (#{entity.complaintType}#{entity.description}#{entity.name}#{entity.photograph}#{entity.deptName}#{entity.deptId}#{entity.phone}#{entity.openId}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
+        </foreach>
+        on duplicate key update
+        complaint_type = values(complaint_type) description = values(description) name = values(name) photograph =
+        values(photograph) dept_name = values(dept_name) dept_id = values(dept_id) phone = values(phone) open_id =
+        values(open_id) remark = values(remark) create_time = values(create_time) update_time = values(update_time)
+        is_delete = values(is_delete)
+    </insert>
+
+</mapper>
+