运维工具-入驻咨询数据清除工具
This commit is contained in:
parent
df0a1d8c70
commit
825e27218a
|
|
@ -0,0 +1,64 @@
|
|||
package com.nu.modules.cleanadvisory.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.cleanadvisory.service.ICleanAdvisoryService;
|
||||
import com.nu.modules.cleanadvisory.entity.CleanAdvisory;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description: 清除员工入驻咨询数据
|
||||
* @Author: caolei
|
||||
* @Date: 2025-09-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="清除员工入驻咨询数据")
|
||||
@RestController
|
||||
@RequestMapping("/internaltool/cleanEmpAdvisory")
|
||||
@Slf4j
|
||||
public class CleanAdvisoryController extends JeecgController<CleanAdvisory, ICleanAdvisoryService> {
|
||||
@Autowired
|
||||
private ICleanAdvisoryService service;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param CleanAdvisory
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="员工入驻咨询-分页列表查询", notes="员工入驻咨询-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<CleanAdvisory>> queryPageList(CleanAdvisory CleanAdvisory,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Page<CleanAdvisory> page = new Page<CleanAdvisory>(pageNo, pageSize);
|
||||
IPage<CleanAdvisory> pageList = service.findPage(page, CleanAdvisory);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@ApiOperation(value="员工入驻咨询-数据清除", notes="员工入驻咨询-数据清除")
|
||||
@RequestMapping(value = "/clean", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> clean(@RequestBody CleanAdvisory cleanAdvisory) {
|
||||
service.clean(cleanAdvisory);
|
||||
return Result.OK("清除成功!");
|
||||
}
|
||||
|
||||
@ApiOperation(value="员工入驻咨询-数据删除", notes="员工入驻咨询-数据删除")
|
||||
@RequestMapping(value = "/delete", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> delete(@RequestBody CleanAdvisory cleanAdvisory) {
|
||||
service.delete(cleanAdvisory);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.nu.modules.cleanadvisory.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 入驻咨询数据
|
||||
* @Author: caolei
|
||||
* @Date: 2025-09-05
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_advisory_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_advisory_info", description="入驻咨询数据")
|
||||
public class CleanAdvisory implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
@TableField(exist = false)
|
||||
private String applyId;
|
||||
private String openId;
|
||||
private String name;
|
||||
private String tel;
|
||||
private String advisoryType; //咨询类型
|
||||
@TableField(exist = false)
|
||||
private String comName; //企业名称
|
||||
private String izYg;
|
||||
private String izJs;
|
||||
private String izJg;
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nu.modules.cleanadvisory.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.cleanadvisory.entity.CleanAdvisory;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface CleanAdvisoryMapper extends BaseMapper<CleanAdvisory> {
|
||||
IPage<CleanAdvisory> findPage(Page<CleanAdvisory> page, @Param("params") CleanAdvisory cleanAdvisory);
|
||||
void deleteOrgApply(CleanAdvisory cleanAdvisory);
|
||||
void deleteEmployeesAdvisory(CleanAdvisory cleanAdvisory);
|
||||
void deleteBizAdvisory(CleanAdvisory cleanAdvisory);
|
||||
}
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
<?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.nu.modules.cleanadvisory.mapper.CleanAdvisoryMapper">
|
||||
<select id="findPage" parameterType="com.nu.modules.cleanadvisory.entity.CleanAdvisory" resultType="com.nu.modules.cleanadvisory.entity.CleanAdvisory">
|
||||
select
|
||||
a.id,
|
||||
b.id as applyId,
|
||||
a.open_id as openId,
|
||||
b.name,
|
||||
a.tel,
|
||||
a.advisory_type as advisoryType,
|
||||
a.iz_yg as izYg,
|
||||
a.iz_js as izJs,
|
||||
a.iz_jg as izJg,
|
||||
a.create_time as createTime,
|
||||
b.create_time as updateTime,
|
||||
'' as comName
|
||||
from nu_biz_advisory_info a inner join nu_employees_advisory_info b on a.open_id = b.open_id
|
||||
<where>
|
||||
a.advisory_type = '1'
|
||||
and a.iz_js = '1'
|
||||
<if test="params.tel != null and params.tel != ''">
|
||||
AND a.tel = #{params.tel}
|
||||
</if>
|
||||
<if test="params.openId != null and params.openId != ''">
|
||||
AND a.open_id = #{params.openId}
|
||||
</if>
|
||||
</where>
|
||||
union
|
||||
select
|
||||
a.id,
|
||||
b.id as applyId,
|
||||
a.open_id as openId,
|
||||
b.name,
|
||||
a.tel,
|
||||
a.advisory_type as advisoryType,
|
||||
a.iz_yg as izYg,
|
||||
a.iz_js as izJs,
|
||||
a.iz_jg as izJg,
|
||||
a.create_time as createTime,
|
||||
b.create_time as updateTime,
|
||||
'' as comName
|
||||
from nu_biz_advisory_info a inner join nu_employees_advisory_info b on a.open_id = b.open_id
|
||||
<where>
|
||||
a.advisory_type = '2'
|
||||
and a.iz_yg = '1'
|
||||
<if test="params.tel != null and params.tel != ''">
|
||||
AND a.tel = #{params.tel}
|
||||
</if>
|
||||
<if test="params.openId != null and params.openId != ''">
|
||||
AND a.open_id = #{params.openId}
|
||||
</if>
|
||||
</where>
|
||||
union
|
||||
select
|
||||
a.id,
|
||||
b.id as applyId,
|
||||
a.open_id as openId,
|
||||
b.name,
|
||||
a.tel,
|
||||
a.advisory_type as advisoryType,
|
||||
a.iz_yg as izYg,
|
||||
a.iz_js as izJs,
|
||||
a.iz_jg as izJg,
|
||||
a.create_time as createTime,
|
||||
b.create_time as updateTime,
|
||||
ifnull(b.com_name,'') as comName
|
||||
from nu_biz_advisory_info a inner join nu_org_apply_info b on a.open_id = b.open_id
|
||||
<where>
|
||||
a.advisory_type = '3'
|
||||
and a.iz_jg = '1'
|
||||
<if test="params.tel != null and params.tel != ''">
|
||||
AND a.tel = #{params.tel}
|
||||
</if>
|
||||
<if test="params.openId != null and params.openId != ''">
|
||||
AND a.open_id = #{params.openId}
|
||||
</if>
|
||||
</where>
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<delete id="deleteOrgApply">
|
||||
delete from nu_org_apply_info where open_id = #{openId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteEmployeesAdvisory">
|
||||
delete from nu_employees_advisory_info where open_id = #{openId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBizAdvisory">
|
||||
delete from nu_biz_advisory_info where open_id = #{openId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package com.nu.modules.cleanadvisory.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.cleanadvisory.entity.CleanAdvisory;
|
||||
|
||||
public interface ICleanAdvisoryService extends IService<CleanAdvisory> {
|
||||
IPage<CleanAdvisory> findPage(Page<CleanAdvisory> page, CleanAdvisory cleanAdvisory);
|
||||
void clean(CleanAdvisory cleanAdvisory);
|
||||
void delete(CleanAdvisory cleanAdvisory);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package com.nu.modules.cleanadvisory.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.cleanadvisory.mapper.CleanAdvisoryMapper;
|
||||
import com.nu.modules.cleanadvisory.service.ICleanAdvisoryService;
|
||||
import com.nu.modules.cleanadvisory.entity.CleanAdvisory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CleanAdvisoryServiceImpl extends ServiceImpl<CleanAdvisoryMapper, CleanAdvisory> implements ICleanAdvisoryService {
|
||||
|
||||
@Override
|
||||
@DS("ope")
|
||||
public IPage<CleanAdvisory> findPage(Page<CleanAdvisory> page, CleanAdvisory cleanAdvisory){
|
||||
return baseMapper.findPage(page,cleanAdvisory);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("ope")
|
||||
public void clean(CleanAdvisory cleanAdvisory){
|
||||
String advisoryType = cleanAdvisory.getAdvisoryType();
|
||||
if(advisoryType.equals("1")){
|
||||
cleanAdvisory.setIzJs("0");
|
||||
cleanAdvisory.setAdvisoryType("0");
|
||||
updateById(cleanAdvisory);
|
||||
//预留删除长者表数据
|
||||
}
|
||||
if(advisoryType.equals("2")){
|
||||
cleanAdvisory.setIzYg("0");
|
||||
cleanAdvisory.setAdvisoryType("0");
|
||||
updateById(cleanAdvisory);
|
||||
baseMapper.deleteEmployeesAdvisory(cleanAdvisory);
|
||||
}
|
||||
if(advisoryType.equals("3")){
|
||||
cleanAdvisory.setIzJg("0");
|
||||
cleanAdvisory.setAdvisoryType("0");
|
||||
updateById(cleanAdvisory);
|
||||
baseMapper.deleteOrgApply(cleanAdvisory);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("ope")
|
||||
public void delete(CleanAdvisory cleanAdvisory){
|
||||
String advisoryType = cleanAdvisory.getAdvisoryType();
|
||||
if(advisoryType.equals("1")){
|
||||
//预留删除长者表数据
|
||||
}
|
||||
if(advisoryType.equals("2")){
|
||||
baseMapper.deleteEmployeesAdvisory(cleanAdvisory);
|
||||
}
|
||||
if(advisoryType.equals("3")){
|
||||
baseMapper.deleteOrgApply(cleanAdvisory);
|
||||
}
|
||||
baseMapper.deleteBizAdvisory(cleanAdvisory);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue