31 changed files with 760 additions and 152 deletions
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.portal.api.templatestaffconfig; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:34 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "模板 员工关联表", description = "模板 员工关联表") |
||||
|
@TableName("template_staff_config") |
||||
|
public class TemplateStaffConfig extends BaseEntity { |
||||
|
//模板sid
|
||||
|
private String templateSid; |
||||
|
//员工sid
|
||||
|
private String staffSid; |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.portal.api.templatestaffconfig; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "模板 员工关联表 视图数据详情", description = "模板 员工关联表 视图数据详情") |
||||
|
public class TemplateStaffConfigDetailsVo implements Vo { |
||||
|
private String id; |
||||
|
//模板sid
|
||||
|
private String templateSid; |
||||
|
//员工sid
|
||||
|
private String staffSid; |
||||
|
private String sid; |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.portal.api.templatestaffconfig; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "模板 员工关联表 数据传输对象", description = "模板 员工关联表 数据传输对象") |
||||
|
public class TemplateStaffConfigDto implements Dto { |
||||
|
private String id; |
||||
|
//模板sid
|
||||
|
private String templateSid; |
||||
|
//员工sid
|
||||
|
private String staffSid; |
||||
|
private String sid; |
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.yxt.supervise.portal.api.templatestaffconfig; |
||||
|
|
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:35 |
||||
|
*/ |
||||
|
@Api(tags = "模板 员工关联表") |
||||
|
@FeignClient( |
||||
|
contextId = "yxt-supervise-TemplateStaffConfig", |
||||
|
name = "yxt-supervise", |
||||
|
path = "v1/templatestaffconfig", |
||||
|
fallback = TemplateStaffConfigFeignFallback.class) |
||||
|
public interface TemplateStaffConfigFeign { |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package com.yxt.supervise.portal.api.templatestaffconfig; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:35 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class TemplateStaffConfigFeignFallback implements TemplateStaffConfigFeign{ |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.portal.api.templatestaffconfig; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "模板 员工关联表 查询条件", description = "模板 员工关联表 查询条件") |
||||
|
public class TemplateStaffConfigQuery implements Vo { |
||||
|
private String id; |
||||
|
//模板sid
|
||||
|
private String templateSid; |
||||
|
//员工sid
|
||||
|
private String staffSid; |
||||
|
private String sid; |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.portal.api.templatestaffconfig; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "模板 员工关联表 视图数据对象", description = "模板 员工关联表 视图数据对象") |
||||
|
public class TemplateStaffConfigVo implements Vo { |
||||
|
private String id; |
||||
|
//模板sid
|
||||
|
private String templateSid; |
||||
|
//员工sid
|
||||
|
private String staffSid; |
||||
|
private String sid; |
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
package com.yxt.supervise.portal.api.wechattemplate; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 11:34 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "微信消息模版", description = "微信消息模版") |
||||
|
@TableName("wechat_template") |
||||
|
public class WechatTemplate extends BaseEntity { |
||||
|
//id
|
||||
|
//private String id;
|
||||
|
//模版id
|
||||
|
@ApiModelProperty("模版id") |
||||
|
private String templateId; |
||||
|
//标题
|
||||
|
@ApiModelProperty("标题") |
||||
|
private String title; |
||||
|
//格式
|
||||
|
@ApiModelProperty("格式") |
||||
|
private String json; |
||||
|
//行业
|
||||
|
@ApiModelProperty("行业") |
||||
|
private String trade; |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.yxt.supervise.portal.api.wechattemplate; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 11:34 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "微信消息模版 视图数据详情", description = "微信消息模版 视图数据详情") |
||||
|
public class WechatTemplateDetailVo implements Vo { |
||||
|
private String id; |
||||
|
@ApiModelProperty("模版id") |
||||
|
private String templateId; |
||||
|
//标题
|
||||
|
@ApiModelProperty("标题") |
||||
|
private String title; |
||||
|
//格式
|
||||
|
@ApiModelProperty("格式") |
||||
|
private String json; |
||||
|
//行业
|
||||
|
@ApiModelProperty("行业") |
||||
|
private String trade; |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.yxt.supervise.portal.api.wechattemplate; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfig; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 11:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "微信消息模版 数据传输对象", description = "微信消息模版 数据传输对象") |
||||
|
public class WechatTemplateDto implements Dto { |
||||
|
private String id; |
||||
|
private String sid; // sid
|
||||
|
@ApiModelProperty("模版id") |
||||
|
private String templateId; |
||||
|
//标题
|
||||
|
@ApiModelProperty("标题") |
||||
|
private String title; |
||||
|
//格式
|
||||
|
@ApiModelProperty("格式") |
||||
|
private String json; |
||||
|
//行业
|
||||
|
@ApiModelProperty("行业") |
||||
|
private String trade; |
||||
|
private List<TemplateStaffConfig> templateStaffConfigs; |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.supervise.portal.api.wechattemplate; |
||||
|
|
||||
|
|
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 11:35 |
||||
|
*/ |
||||
|
@Api(tags = "微信模版消息") |
||||
|
@FeignClient( |
||||
|
contextId = "com.supervise-WechatTemplate", |
||||
|
name = "com.supervise", |
||||
|
path = "v1/wechattemplate", |
||||
|
fallback = WechatTemplateFeignFallback.class) |
||||
|
public interface WechatTemplateFeign { |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package com.yxt.supervise.portal.api.wechattemplate; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 11:35 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class WechatTemplateFeignFallback implements WechatTemplateFeign{ |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.yxt.supervise.portal.api.wechattemplate; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 11:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "微信消息模版 查询条件", description = "微信消息模版 查询条件") |
||||
|
public class WechatTemplateQuery implements Query { |
||||
|
private String id; |
||||
|
@ApiModelProperty("模版id") |
||||
|
private String templateId; |
||||
|
//标题
|
||||
|
@ApiModelProperty("标题") |
||||
|
private String title; |
||||
|
//格式
|
||||
|
@ApiModelProperty("格式") |
||||
|
private String json; |
||||
|
//行业
|
||||
|
@ApiModelProperty("行业") |
||||
|
private String trade; |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.yxt.supervise.portal.api.wechattemplate; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 11:35 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "微信消息模版 视图数据对象", description = "微信消息模版 视图数据对象") |
||||
|
public class WechatTemplateVo implements Vo { |
||||
|
private String id; |
||||
|
@ApiModelProperty("模版id") |
||||
|
private String templateId; |
||||
|
//标题
|
||||
|
@ApiModelProperty("标题") |
||||
|
private String title; |
||||
|
//格式
|
||||
|
@ApiModelProperty("格式") |
||||
|
private String json; |
||||
|
//行业
|
||||
|
@ApiModelProperty("行业") |
||||
|
private String trade; |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.yxt.supervise.portal.biz.templatestaffconfig; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfig; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplate; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:45 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface TemplateStaffConfigMapper extends BaseMapper<TemplateStaffConfig> { |
||||
|
IPage<WechatTemplateVo> selectPageVo(IPage<WechatTemplate> page, @Param(Constants.WRAPPER) Wrapper<WechatTemplate> qw); |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
<?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.yxt.supervise.portal.biz.templatestaffconfig.TemplateStaffConfigMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfigVo"> |
||||
|
SELECT * FROM wechat_template <where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectListAllVo" resultType="com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfigVo"> |
||||
|
SELECT * FROM wechat_template <where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,16 @@ |
|||||
|
package com.yxt.supervise.portal.biz.templatestaffconfig; |
||||
|
|
||||
|
import com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfigFeign; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:45 |
||||
|
*/ |
||||
|
@Api(tags = "消息 员工关联表") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/templatestaffconfig") |
||||
|
public class TemplateStaffConfigRest implements TemplateStaffConfigFeign { |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
package com.yxt.supervise.portal.biz.templatestaffconfig; |
||||
|
|
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfig; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 14:45 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class TemplateStaffConfigService extends MybatisBaseService<TemplateStaffConfigMapper, TemplateStaffConfig> { |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.yxt.supervise.portal.biz.wechattemplate; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplate; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 10:34 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface WechatTemplateMapper extends BaseMapper<WechatTemplate> { |
||||
|
IPage<WechatTemplateVo> selectPageVo(IPage<WechatTemplate> page, @Param(Constants.WRAPPER) Wrapper<WechatTemplate> qw); |
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
<?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.yxt.supervise.portal.biz.wechattemplate.WechatTemplateMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo"> |
||||
|
SELECT * FROM wechat_template <where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectListAllVo" resultType="com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo"> |
||||
|
SELECT * FROM wechat_template <where> ${ew.sqlSegment} </where> |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,54 @@ |
|||||
|
package com.yxt.supervise.portal.biz.wechattemplate; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateDto; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateFeign; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateQuery; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 10:35 |
||||
|
*/ |
||||
|
@Api(tags = "微信消息模版") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/wechattemplate") |
||||
|
public class WechatTemplateRest implements WechatTemplateFeign { |
||||
|
@Autowired |
||||
|
WechatTemplateService wechatTemplateService; |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<WechatTemplateVo>> listPage(@RequestBody PagerQuery<WechatTemplateQuery> pq){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<WechatTemplateVo> pv = wechatTemplateService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
@ApiOperation("新增") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean save(@RequestBody WechatTemplateDto dto){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
wechatTemplateService.save(dto); |
||||
|
return rb.success().setMsg(rb.getMsg()); |
||||
|
} |
||||
|
@ApiOperation("修改") |
||||
|
@PostMapping("/update") |
||||
|
public ResultBean update(@RequestBody WechatTemplateDto dto){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
wechatTemplateService.update(dto); |
||||
|
return rb.success().setMsg(rb.getMsg()); |
||||
|
} |
||||
|
@ApiOperation("删除") |
||||
|
@DeleteMapping("/delete/{sid}") |
||||
|
@ResponseBody |
||||
|
public ResultBean delete(@PathVariable String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
wechatTemplateService.deleteById(sid); |
||||
|
return rb.success().setMsg(rb.getMsg()); |
||||
|
} |
||||
|
} |
@ -0,0 +1,88 @@ |
|||||
|
package com.yxt.supervise.portal.biz.wechattemplate; |
||||
|
|
||||
|
import cn.hutool.core.bean.BeanUtil; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.yxt.common.base.service.MybatisBaseService; |
||||
|
import com.yxt.common.base.utils.PagerUtil; |
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import com.yxt.supervise.portal.api.templatestaffconfig.TemplateStaffConfig; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplate; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateDto; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateQuery; |
||||
|
import com.yxt.supervise.portal.api.wechattemplate.WechatTemplateVo; |
||||
|
import com.yxt.supervise.portal.biz.templatestaffconfig.TemplateStaffConfigService; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/10 10:36 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class WechatTemplateService extends MybatisBaseService<WechatTemplateMapper, WechatTemplate> { |
||||
|
|
||||
|
@Autowired |
||||
|
private TemplateStaffConfigService templateStaffConfigService; |
||||
|
|
||||
|
|
||||
|
public PagerVo<WechatTemplateVo> listPageVo(PagerQuery<WechatTemplateQuery> pq) { |
||||
|
WechatTemplateQuery query = pq.getParams(); |
||||
|
QueryWrapper<WechatTemplate> qw = new QueryWrapper<>(); |
||||
|
IPage<WechatTemplate> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<WechatTemplateVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<WechatTemplateVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
public ResultBean save(WechatTemplateDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
|
||||
|
WechatTemplate entity=new WechatTemplate(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.insert(entity); |
||||
|
List<TemplateStaffConfig> entitys=new ArrayList<>(); |
||||
|
if(dto.getTemplateStaffConfigs().size()>0){ |
||||
|
for(TemplateStaffConfig templateStaffConfig:dto.getTemplateStaffConfigs()){ |
||||
|
BeanUtil.copyProperties(dto, templateStaffConfig, "id", "sid"); |
||||
|
templateStaffConfig.setTemplateSid(entity.getSid()); |
||||
|
entitys.add(templateStaffConfig); |
||||
|
} |
||||
|
|
||||
|
templateStaffConfigService.saveBatch(entitys); |
||||
|
} |
||||
|
return rb.success().setMsg("添加模板信息成功"); |
||||
|
} |
||||
|
public ResultBean update(WechatTemplateDto dto) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
String dtoSid = dto.getSid(); |
||||
|
if (StringUtils.isBlank(dtoSid)) { |
||||
|
return rb.success().setMsg("添加模板信息成功"); |
||||
|
} |
||||
|
WechatTemplate entity = fetchBySid(dtoSid); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.updateById(entity); |
||||
|
List<TemplateStaffConfig> entitys=new ArrayList<>(); |
||||
|
if(dto.getTemplateStaffConfigs().size()>0){ |
||||
|
templateStaffConfigService.deleteBySid(entity.getSid()); |
||||
|
for(TemplateStaffConfig templateStaffConfig:dto.getTemplateStaffConfigs()){ |
||||
|
BeanUtil.copyProperties(dto, templateStaffConfig, "id", "sid"); |
||||
|
templateStaffConfig.setTemplateSid(entity.getSid()); |
||||
|
entitys.add(templateStaffConfig); |
||||
|
} |
||||
|
templateStaffConfigService.saveBatch(entitys); |
||||
|
} |
||||
|
return rb.success().setMsg("添加模板信息成功"); |
||||
|
} |
||||
|
public ResultBean deleteById(String sid) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
int i=baseMapper.deleteById(sid); |
||||
|
templateStaffConfigService.deleteBySid(sid); |
||||
|
return rb.success().setMsg("添加模板信息成功"); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue