Commit 7564443a authored by 王晓倩's avatar 王晓倩

投诉处置基础代码

parent f787c3d7
package com.zehong.web.controller.complainDeal;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
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.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TComplainDeal;
import com.zehong.system.service.ITComplainDealService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 投诉处置Controller
*
* @author zehong
* @date 2022-02-15
*/
@RestController
@RequestMapping("/complainDeal")
public class TComplainDealController extends BaseController
{
@Autowired
private ITComplainDealService tComplainDealService;
/**
* 查询投诉处置列表
*/
@PreAuthorize("@ss.hasPermi('complainDeal:complainDeal:list')")
@GetMapping("/list")
public TableDataInfo list(TComplainDeal tComplainDeal)
{
startPage();
List<TComplainDeal> list = tComplainDealService.selectTComplainDealList(tComplainDeal);
return getDataTable(list);
}
/**
* 导出投诉处置列表
*/
@PreAuthorize("@ss.hasPermi('complainDeal:complainDeal:export')")
@Log(title = "投诉处置", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TComplainDeal tComplainDeal)
{
List<TComplainDeal> list = tComplainDealService.selectTComplainDealList(tComplainDeal);
ExcelUtil<TComplainDeal> util = new ExcelUtil<TComplainDeal>(TComplainDeal.class);
return util.exportExcel(list, "投诉处置数据");
}
/**
* 获取投诉处置详细信息
*/
@PreAuthorize("@ss.hasPermi('complainDeal:complainDeal:query')")
@GetMapping(value = "/{complainDealId}")
public AjaxResult getInfo(@PathVariable("complainDealId") Long complainDealId)
{
return AjaxResult.success(tComplainDealService.selectTComplainDealById(complainDealId));
}
/**
* 新增投诉处置
*/
@PreAuthorize("@ss.hasPermi('complainDeal:complainDeal:add')")
@Log(title = "投诉处置", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TComplainDeal tComplainDeal)
{
return toAjax(tComplainDealService.insertTComplainDeal(tComplainDeal));
}
/**
* 修改投诉处置
*/
@PreAuthorize("@ss.hasPermi('complainDeal:complainDeal:edit')")
@Log(title = "投诉处置", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TComplainDeal tComplainDeal)
{
return toAjax(tComplainDealService.updateTComplainDeal(tComplainDeal));
}
/**
* 删除投诉处置
*/
@PreAuthorize("@ss.hasPermi('complainDeal:complainDeal:remove')")
@Log(title = "投诉处置", businessType = BusinessType.DELETE)
@DeleteMapping("/{complainDealIds}")
public AjaxResult remove(@PathVariable Long[] complainDealIds)
{
return toAjax(tComplainDealService.deleteTComplainDealByIds(complainDealIds));
}
}
package com.zehong.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 投诉处置对象 t_complain_deal
*
* @author zehong
* @date 2022-02-15
*/
public class TComplainDeal extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 投诉处置id */
private Long complainDealId;
/** 投诉人姓名 */
@Excel(name = "投诉人姓名")
private String complainName;
/** 投诉人电话 */
@Excel(name = "投诉人电话")
private String complainPhone;
/** 投诉事项 */
@Excel(name = "投诉事项")
private String complainMatter;
/** 转办记录 */
@Excel(name = "转办记录")
private String transferRecord;
/** 办理情况 */
@Excel(name = "办理情况")
private String dealCondition;
/** 指派单位名称 */
@Excel(name = "指派单位名称")
private String complainAssignEnterproseName;
/** 指派单位id */
@Excel(name = "指派单位id")
private Long complainAssignEnterproseId;
/** 指派人 */
@Excel(name = "指派人")
private String complainAssignManId;
/** 指派人id */
@Excel(name = "指派人id")
private Long complainAssignMan;
/** 任务状态:1.派发中 2.反馈 3.归档 */
@Excel(name = "任务状态:1.派发中 2.反馈 3.归档")
private String complainStatus;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setComplainDealId(Long complainDealId)
{
this.complainDealId = complainDealId;
}
public Long getComplainDealId()
{
return complainDealId;
}
public void setComplainName(String complainName)
{
this.complainName = complainName;
}
public String getComplainName()
{
return complainName;
}
public void setComplainPhone(String complainPhone)
{
this.complainPhone = complainPhone;
}
public String getComplainPhone()
{
return complainPhone;
}
public void setComplainMatter(String complainMatter)
{
this.complainMatter = complainMatter;
}
public String getComplainMatter()
{
return complainMatter;
}
public void setTransferRecord(String transferRecord)
{
this.transferRecord = transferRecord;
}
public String getTransferRecord()
{
return transferRecord;
}
public void setDealCondition(String dealCondition)
{
this.dealCondition = dealCondition;
}
public String getDealCondition()
{
return dealCondition;
}
public void setComplainAssignEnterproseName(String complainAssignEnterproseName)
{
this.complainAssignEnterproseName = complainAssignEnterproseName;
}
public String getComplainAssignEnterproseName()
{
return complainAssignEnterproseName;
}
public void setComplainAssignEnterproseId(Long complainAssignEnterproseId)
{
this.complainAssignEnterproseId = complainAssignEnterproseId;
}
public Long getComplainAssignEnterproseId()
{
return complainAssignEnterproseId;
}
public void setComplainAssignManId(String complainAssignManId)
{
this.complainAssignManId = complainAssignManId;
}
public String getComplainAssignManId()
{
return complainAssignManId;
}
public void setComplainAssignMan(Long complainAssignMan)
{
this.complainAssignMan = complainAssignMan;
}
public Long getComplainAssignMan()
{
return complainAssignMan;
}
public void setComplainStatus(String complainStatus)
{
this.complainStatus = complainStatus;
}
public String getComplainStatus()
{
return complainStatus;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("complainDealId", getComplainDealId())
.append("complainName", getComplainName())
.append("complainPhone", getComplainPhone())
.append("complainMatter", getComplainMatter())
.append("transferRecord", getTransferRecord())
.append("dealCondition", getDealCondition())
.append("complainAssignEnterproseName", getComplainAssignEnterproseName())
.append("complainAssignEnterproseId", getComplainAssignEnterproseId())
.append("complainAssignManId", getComplainAssignManId())
.append("complainAssignMan", getComplainAssignMan())
.append("complainStatus", getComplainStatus())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TComplainDeal;
/**
* 投诉处置Mapper接口
*
* @author zehong
* @date 2022-02-15
*/
public interface TComplainDealMapper
{
/**
* 查询投诉处置
*
* @param complainDealId 投诉处置ID
* @return 投诉处置
*/
public TComplainDeal selectTComplainDealById(Long complainDealId);
/**
* 查询投诉处置列表
*
* @param tComplainDeal 投诉处置
* @return 投诉处置集合
*/
public List<TComplainDeal> selectTComplainDealList(TComplainDeal tComplainDeal);
/**
* 新增投诉处置
*
* @param tComplainDeal 投诉处置
* @return 结果
*/
public int insertTComplainDeal(TComplainDeal tComplainDeal);
/**
* 修改投诉处置
*
* @param tComplainDeal 投诉处置
* @return 结果
*/
public int updateTComplainDeal(TComplainDeal tComplainDeal);
/**
* 删除投诉处置
*
* @param complainDealId 投诉处置ID
* @return 结果
*/
public int deleteTComplainDealById(Long complainDealId);
/**
* 批量删除投诉处置
*
* @param complainDealIds 需要删除的数据ID
* @return 结果
*/
public int deleteTComplainDealByIds(Long[] complainDealIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TComplainDeal;
/**
* 投诉处置Service接口
*
* @author zehong
* @date 2022-02-15
*/
public interface ITComplainDealService
{
/**
* 查询投诉处置
*
* @param complainDealId 投诉处置ID
* @return 投诉处置
*/
public TComplainDeal selectTComplainDealById(Long complainDealId);
/**
* 查询投诉处置列表
*
* @param tComplainDeal 投诉处置
* @return 投诉处置集合
*/
public List<TComplainDeal> selectTComplainDealList(TComplainDeal tComplainDeal);
/**
* 新增投诉处置
*
* @param tComplainDeal 投诉处置
* @return 结果
*/
public int insertTComplainDeal(TComplainDeal tComplainDeal);
/**
* 修改投诉处置
*
* @param tComplainDeal 投诉处置
* @return 结果
*/
public int updateTComplainDeal(TComplainDeal tComplainDeal);
/**
* 批量删除投诉处置
*
* @param complainDealIds 需要删除的投诉处置ID
* @return 结果
*/
public int deleteTComplainDealByIds(Long[] complainDealIds);
/**
* 删除投诉处置信息
*
* @param complainDealId 投诉处置ID
* @return 结果
*/
public int deleteTComplainDealById(Long complainDealId);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TComplainDealMapper;
import com.zehong.system.domain.TComplainDeal;
import com.zehong.system.service.ITComplainDealService;
/**
* 投诉处置Service业务层处理
*
* @author zehong
* @date 2022-02-15
*/
@Service
public class TComplainDealServiceImpl implements ITComplainDealService
{
@Autowired
private TComplainDealMapper tComplainDealMapper;
/**
* 查询投诉处置
*
* @param complainDealId 投诉处置ID
* @return 投诉处置
*/
@Override
public TComplainDeal selectTComplainDealById(Long complainDealId)
{
return tComplainDealMapper.selectTComplainDealById(complainDealId);
}
/**
* 查询投诉处置列表
*
* @param tComplainDeal 投诉处置
* @return 投诉处置
*/
@Override
public List<TComplainDeal> selectTComplainDealList(TComplainDeal tComplainDeal)
{
return tComplainDealMapper.selectTComplainDealList(tComplainDeal);
}
/**
* 新增投诉处置
*
* @param tComplainDeal 投诉处置
* @return 结果
*/
@Override
public int insertTComplainDeal(TComplainDeal tComplainDeal)
{
tComplainDeal.setCreateTime(DateUtils.getNowDate());
return tComplainDealMapper.insertTComplainDeal(tComplainDeal);
}
/**
* 修改投诉处置
*
* @param tComplainDeal 投诉处置
* @return 结果
*/
@Override
public int updateTComplainDeal(TComplainDeal tComplainDeal)
{
tComplainDeal.setUpdateTime(DateUtils.getNowDate());
return tComplainDealMapper.updateTComplainDeal(tComplainDeal);
}
/**
* 批量删除投诉处置
*
* @param complainDealIds 需要删除的投诉处置ID
* @return 结果
*/
@Override
public int deleteTComplainDealByIds(Long[] complainDealIds)
{
return tComplainDealMapper.deleteTComplainDealByIds(complainDealIds);
}
/**
* 删除投诉处置信息
*
* @param complainDealId 投诉处置ID
* @return 结果
*/
@Override
public int deleteTComplainDealById(Long complainDealId)
{
return tComplainDealMapper.deleteTComplainDealById(complainDealId);
}
}
<?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.zehong.system.mapper.TComplainDealMapper">
<resultMap type="TComplainDeal" id="TComplainDealResult">
<result property="complainDealId" column="complain_deal_id" />
<result property="complainName" column="complain_name" />
<result property="complainPhone" column="complain_phone" />
<result property="complainMatter" column="complain_matter" />
<result property="transferRecord" column="transfer_record" />
<result property="dealCondition" column="deal_condition" />
<result property="complainAssignEnterproseName" column="complain_assign_enterprose_name" />
<result property="complainAssignEnterproseId" column="complain_assign_enterprose_id" />
<result property="complainAssignManId" column="complain_assign_man_id" />
<result property="complainAssignMan" column="complain_assign_man" />
<result property="complainStatus" column="complain_status" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTComplainDealVo">
select complain_deal_id, complain_name, complain_phone, complain_matter, transfer_record, deal_condition, complain_assign_enterprose_name, complain_assign_enterprose_id, complain_assign_man_id, complain_assign_man, complain_status, create_by, create_time, update_by, update_time, is_del, remarks from t_complain_deal
</sql>
<select id="selectTComplainDealList" parameterType="TComplainDeal" resultMap="TComplainDealResult">
<include refid="selectTComplainDealVo"/>
<where>
<if test="complainName != null and complainName != ''"> and complain_name like concat('%', #{complainName}, '%')</if>
<if test="complainPhone != null and complainPhone != ''"> and complain_phone = #{complainPhone}</if>
<if test="complainMatter != null and complainMatter != ''"> and complain_matter = #{complainMatter}</if>
<if test="transferRecord != null and transferRecord != ''"> and transfer_record = #{transferRecord}</if>
<if test="dealCondition != null and dealCondition != ''"> and deal_condition = #{dealCondition}</if>
<if test="complainAssignEnterproseName != null and complainAssignEnterproseName != ''"> and complain_assign_enterprose_name like concat('%', #{complainAssignEnterproseName}, '%')</if>
<if test="complainAssignEnterproseId != null "> and complain_assign_enterprose_id = #{complainAssignEnterproseId}</if>
<if test="complainAssignManId != null and complainAssignManId != ''"> and complain_assign_man_id = #{complainAssignManId}</if>
<if test="complainAssignMan != null "> and complain_assign_man = #{complainAssignMan}</if>
<if test="complainStatus != null and complainStatus != ''"> and complain_status = #{complainStatus}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTComplainDealById" parameterType="Long" resultMap="TComplainDealResult">
<include refid="selectTComplainDealVo"/>
where complain_deal_id = #{complainDealId}
</select>
<insert id="insertTComplainDeal" parameterType="TComplainDeal" useGeneratedKeys="true" keyProperty="complainDealId">
insert into t_complain_deal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="complainName != null">complain_name,</if>
<if test="complainPhone != null">complain_phone,</if>
<if test="complainMatter != null">complain_matter,</if>
<if test="transferRecord != null">transfer_record,</if>
<if test="dealCondition != null">deal_condition,</if>
<if test="complainAssignEnterproseName != null">complain_assign_enterprose_name,</if>
<if test="complainAssignEnterproseId != null">complain_assign_enterprose_id,</if>
<if test="complainAssignManId != null">complain_assign_man_id,</if>
<if test="complainAssignMan != null">complain_assign_man,</if>
<if test="complainStatus != null">complain_status,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="complainName != null">#{complainName},</if>
<if test="complainPhone != null">#{complainPhone},</if>
<if test="complainMatter != null">#{complainMatter},</if>
<if test="transferRecord != null">#{transferRecord},</if>
<if test="dealCondition != null">#{dealCondition},</if>
<if test="complainAssignEnterproseName != null">#{complainAssignEnterproseName},</if>
<if test="complainAssignEnterproseId != null">#{complainAssignEnterproseId},</if>
<if test="complainAssignManId != null">#{complainAssignManId},</if>
<if test="complainAssignMan != null">#{complainAssignMan},</if>
<if test="complainStatus != null">#{complainStatus},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTComplainDeal" parameterType="TComplainDeal">
update t_complain_deal
<trim prefix="SET" suffixOverrides=",">
<if test="complainName != null">complain_name = #{complainName},</if>
<if test="complainPhone != null">complain_phone = #{complainPhone},</if>
<if test="complainMatter != null">complain_matter = #{complainMatter},</if>
<if test="transferRecord != null">transfer_record = #{transferRecord},</if>
<if test="dealCondition != null">deal_condition = #{dealCondition},</if>
<if test="complainAssignEnterproseName != null">complain_assign_enterprose_name = #{complainAssignEnterproseName},</if>
<if test="complainAssignEnterproseId != null">complain_assign_enterprose_id = #{complainAssignEnterproseId},</if>
<if test="complainAssignManId != null">complain_assign_man_id = #{complainAssignManId},</if>
<if test="complainAssignMan != null">complain_assign_man = #{complainAssignMan},</if>
<if test="complainStatus != null">complain_status = #{complainStatus},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where complain_deal_id = #{complainDealId}
</update>
<delete id="deleteTComplainDealById" parameterType="Long">
delete from t_complain_deal where complain_deal_id = #{complainDealId}
</delete>
<delete id="deleteTComplainDealByIds" parameterType="String">
delete from t_complain_deal where complain_deal_id in
<foreach item="complainDealId" collection="array" open="(" separator="," close=")">
#{complainDealId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询投诉处置列表
export function listComplainDeal(query) {
return request({
url: '/complainDeal/list',
method: 'get',
params: query
})
}
// 查询投诉处置详细
export function getComplainDeal(complainDealId) {
return request({
url: '/complainDeal/' + complainDealId,
method: 'get'
})
}
// 新增投诉处置
export function addComplainDeal(data) {
return request({
url: '/complainDeal',
method: 'post',
data: data
})
}
// 修改投诉处置
export function updateComplainDeal(data) {
return request({
url: '/complainDeal',
method: 'put',
data: data
})
}
// 删除投诉处置
export function delComplainDeal(complainDealId) {
return request({
url: '/complainDeal/' + complainDealId,
method: 'delete'
})
}
// 导出投诉处置
export function exportComplainDeal(query) {
return request({
url: '/complainDeal/complainDeal/export',
method: 'get',
params: query
})
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment