Commit 58f3f484 by 水库浪子

员工活码,对接企业微信端生成有效二维码

1 parent 22b3d120
Showing 56 changed files with 3565 additions and 12 deletions
package com.linkwechat.web.controller.wecom;
import cn.hutool.core.collection.ListUtil;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.WeEmpleCode;
import com.linkwechat.wecom.service.IWeEmpleCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 员工活码Controller
*
* @author ruoyi
* @date 2020-10-04
*/
@RestController
@RequestMapping("/wecom/code")
public class WeEmpleCodeController extends BaseController
{
@Autowired
private IWeEmpleCodeService weEmpleCodeService;
/**
* 查询员工活码列表
*/
@PreAuthorize("@ss.hasPermi('wecom:code:list')")
@GetMapping("/list")
public TableDataInfo list(WeEmpleCode weEmpleCode)
{
startPage();
List<WeEmpleCode> list = weEmpleCodeService.selectWeEmpleCodeList(weEmpleCode);
return getDataTable(list);
}
/**
* 获取员工活码详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:code:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(weEmpleCodeService.selectWeEmpleCodeById(id));
}
/**
* 新增员工活码
*/
@PreAuthorize("@ss.hasPermi('wecom:code:add')")
@Log(title = "员工活码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeEmpleCode weEmpleCode)
{
return toAjax(weEmpleCodeService.insertWeEmpleCode(weEmpleCode));
}
/**
* 修改员工活码
*/
@PreAuthorize("@ss.hasPermi('wecom:code:edit')")
@Log(title = "员工活码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeEmpleCode weEmpleCode)
{
return toAjax(weEmpleCodeService.updateWeEmpleCode(weEmpleCode));
}
/**
* 删除员工活码
*/
@PreAuthorize("@ss.hasPermi('wecom:code:remove')")
@Log(title = "员工活码", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(weEmpleCodeService.batchRemoveWeEmpleCodeIds(ListUtil.toList(ids)));
}
}
package com.linkwechat.web.controller.wecom;
import java.util.List;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.utils.poi.ExcelUtil;
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.linkwechat.wecom.domain.WeGroupCodeActual;
import com.linkwechat.wecom.service.IWeGroupCodeActualService;
/**
* 实际群码Controller
*
* @author ruoyi
* @date 2020-10-07
*/
@RestController
@RequestMapping("/wecom/actual")
public class WeGroupCodeActualController extends BaseController
{
@Autowired
private IWeGroupCodeActualService weGroupCodeActualService;
/**
* 查询实际群码列表
*/
@PreAuthorize("@ss.hasPermi('wecom:actual:list')")
@GetMapping("/list")
public TableDataInfo list(WeGroupCodeActual weGroupCodeActual)
{
startPage();
List<WeGroupCodeActual> list = weGroupCodeActualService.selectWeGroupCodeActualList(weGroupCodeActual);
return getDataTable(list);
}
/**
* 导出实际群码列表
*/
@PreAuthorize("@ss.hasPermi('wecom:actual:export')")
@Log(title = "实际群码", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeGroupCodeActual weGroupCodeActual)
{
List<WeGroupCodeActual> list = weGroupCodeActualService.selectWeGroupCodeActualList(weGroupCodeActual);
ExcelUtil<WeGroupCodeActual> util = new ExcelUtil<WeGroupCodeActual>(WeGroupCodeActual.class);
return util.exportExcel(list, "actual");
}
/**
* 获取实际群码详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:actual:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(weGroupCodeActualService.selectWeGroupCodeActualById(id));
}
/**
* 新增实际群码
*/
@PreAuthorize("@ss.hasPermi('wecom:actual:add')")
@Log(title = "实际群码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeGroupCodeActual weGroupCodeActual)
{
return toAjax(weGroupCodeActualService.insertWeGroupCodeActual(weGroupCodeActual));
}
/**
* 修改实际群码
*/
@PreAuthorize("@ss.hasPermi('wecom:actual:edit')")
@Log(title = "实际群码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeGroupCodeActual weGroupCodeActual)
{
return toAjax(weGroupCodeActualService.updateWeGroupCodeActual(weGroupCodeActual));
}
/**
* 删除实际群码
*/
@PreAuthorize("@ss.hasPermi('wecom:actual:remove')")
@Log(title = "实际群码", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(weGroupCodeActualService.deleteWeGroupCodeActualByIds(ids));
}
}
package com.linkwechat.web.controller.wecom;
import java.util.List;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.utils.poi.ExcelUtil;
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.linkwechat.wecom.domain.WeGroupCode;
import com.linkwechat.wecom.service.IWeGroupCodeService;
/**
* 客户群活码Controller
*
* @author ruoyi
* @date 2020-10-07
*/
@RestController
@RequestMapping("/wecom/groupCode")
public class WeGroupCodeController extends BaseController
{
@Autowired
private IWeGroupCodeService weGroupCodeService;
/**
* 查询客户群活码列表
*/
@PreAuthorize("@ss.hasPermi('wecom:code:list')")
@GetMapping("/list")
public TableDataInfo list(WeGroupCode weGroupCode)
{
startPage();
List<WeGroupCode> list = weGroupCodeService.selectWeGroupCodeList(weGroupCode);
return getDataTable(list);
}
/**
* 导出客户群活码列表
*/
@PreAuthorize("@ss.hasPermi('wecom:code:export')")
@Log(title = "客户群活码", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(WeGroupCode weGroupCode)
{
List<WeGroupCode> list = weGroupCodeService.selectWeGroupCodeList(weGroupCode);
ExcelUtil<WeGroupCode> util = new ExcelUtil<WeGroupCode>(WeGroupCode.class);
return util.exportExcel(list, "code");
}
/**
* 获取客户群活码详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:code:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(weGroupCodeService.selectWeGroupCodeById(id));
}
/**
* 新增客户群活码
*/
@PreAuthorize("@ss.hasPermi('wecom:code:add')")
@Log(title = "客户群活码", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeGroupCode weGroupCode)
{
return toAjax(weGroupCodeService.insertWeGroupCode(weGroupCode));
}
/**
* 修改客户群活码
*/
@PreAuthorize("@ss.hasPermi('wecom:code:edit')")
@Log(title = "客户群活码", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeGroupCode weGroupCode)
{
return toAjax(weGroupCodeService.updateWeGroupCode(weGroupCode));
}
/**
* 删除客户群活码
*/
@PreAuthorize("@ss.hasPermi('wecom:code:remove')")
@Log(title = "客户群活码", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(weGroupCodeService.deleteWeGroupCodeByIds(ids));
}
}
package com.linkwechat.web.controller.wecom;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.core.controller.BaseController;
import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.wecom.domain.WeMsgTlp;
import com.linkwechat.wecom.domain.WeMsgTlpScope;
import com.linkwechat.wecom.service.IWeMsgTlpScopeService;
import com.linkwechat.wecom.service.IWeMsgTlpService;
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 ruoyi
* @date 2020-10-04
*/
@RestController
@RequestMapping("/wecom/tlp")
public class WeMsgTlpController extends BaseController
{
@Autowired
private IWeMsgTlpService weMsgTlpService;
@Autowired
private IWeMsgTlpScopeService iWeMsgTlpScopeService;
/**
* 查询欢迎语模板列表
*/
@PreAuthorize("@ss.hasPermi('wecom:tlp:list')")
@GetMapping("/list")
public TableDataInfo list(WeMsgTlp weMsgTlp)
{
startPage();
List<WeMsgTlp> list = weMsgTlpService.selectWeMsgTlpList(weMsgTlp);
return getDataTable(list);
}
/**
* 获取欢迎语模板详细信息
*/
@PreAuthorize("@ss.hasPermi('wecom:tlp:query')")
@GetMapping(value = "/scop/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(
iWeMsgTlpScopeService.selectWeMsgTlpScopeList(WeMsgTlpScope.builder().msgTlpId(id).build())
);
}
/**
* 新增欢迎语模板
*/
@PreAuthorize("@ss.hasPermi('wecom:tlp:add')")
@Log(title = "欢迎语模板", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody WeMsgTlp weMsgTlp)
{
return toAjax(weMsgTlpService.insertWeMsgTlp(weMsgTlp));
}
/**
* 修改欢迎语模板
*/
@PreAuthorize("@ss.hasPermi('wecom:tlp:edit')")
@Log(title = "欢迎语模板", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody WeMsgTlp weMsgTlp)
{
return toAjax(weMsgTlpService.updateWeMsgTlp(weMsgTlp));
}
/**
* 删除欢迎语模板
*/
@PreAuthorize("@ss.hasPermi('wecom:tlp:remove')")
@Log(title = "欢迎语模板", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(weMsgTlpService.batchRemoveByids(Arrays.asList(ids)));
}
}
...@@ -163,6 +163,11 @@ ...@@ -163,6 +163,11 @@
<artifactId>hutool-all</artifactId> <artifactId>hutool-all</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
</dependency>
</dependencies> </dependencies>
......
...@@ -65,4 +65,34 @@ public class WeConstans { ...@@ -65,4 +65,34 @@ public class WeConstans {
*/ */
public static final Integer WE_ROOT_CATEGORY_ID = 0; public static final Integer WE_ROOT_CATEGORY_ID = 0;
/**
* 单人活码
*/
public static final Integer SINGLE_EMPLE_CODE_TYPE = 1;
/**
* 多人活码
*/
public static final Integer MANY_EMPLE_CODE_TYPE = 2;
/**
* 批量单人活码
*/
public static final Integer BATCH_SINGLE_EMPLE_CODE_TYPE = 3;
/**
* 在小程序中联系场景
*/
public static final Integer SMALL_ROUTINE_EMPLE_CODE_SCENE=1;
/**
* 通过二维码联系场景
*/
public static final Integer QR_CODE_EMPLE_CODE_SCENE=2;
} }
package com.linkwechat.common.enums;
public enum WeConstansExceptionTip {
WE_EXCEPTION_60111(60111,"UserID参数为空,或者不存在通讯录中");
private Integer code;
private String tip;
private WeConstansExceptionTip(Integer code, String tip){
this.code = code;
this.tip = tip;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getTip() {
return tip;
}
public void setTip(String tip) {
this.tip = tip;
}
public static String getExceptionMsg(Integer code){
WeConstansExceptionTip[] values = WeConstansExceptionTip.values();
for(WeConstansExceptionTip value:values){
if(value.getCode().equals(code)){
return value.getTip();
}
}
return null;
}
}
package com.linkwechat.common.enums;
/**
* 企业微信接口错误码提示
*/
public enum WeExceptionTip {
WE_EXCEPTION_TIP_LOSS_1(-1,"系统繁忙","服务器暂不可用,建议稍候重试。建议重试次数不超过3次。"),
WE_EXCEPTION_TIP_40001(40001,"不合法的secret参数","secret在应用详情/通讯录管理助手可查看"),
WE_EXCEPTION_TIP_40003(40003,"无效的UserID","1)有效的UserID需要满足:长度1~64字符,由英文字母、数字、中划线、下划线以及点号构成。2)除了创建用户,其余使用UserID的接口,还要保证UserID必须在通讯录中存在。"),
WE_EXCEPTION_TIP_40004(40004,"不合法的媒体文件类型","不满足系统文件要求【图片(image)、语音(voice)、视频(video),普通文件(file)】。"),
WE_EXCEPTION_TIP_40005(40005,"不合法的type参数","合法的type类型【媒体文件类型,分别有图片(image)、语音(voice)、视频(video),普通文件(file)】"),
WE_EXCEPTION_TIP_40006(40006,"",""),
WE_EXCEPTION_TIP_40007(40007,"",""),
WE_EXCEPTION_TIP_40008(40008,"",""),
WE_EXCEPTION_TIP_40009(40009,"",""),
WE_EXCEPTION_TIP_40011(40011,"",""),
WE_EXCEPTION_TIP_40013(40013,"",""),
WE_EXCEPTION_TIP_40014(40014,"",""),
WE_EXCEPTION_TIP_40016(40016,"",""),
WE_EXCEPTION_TIP_40017(40017,"",""),
WE_EXCEPTION_TIP_40018(40018,"",""),
WE_EXCEPTION_TIP_40019(40019,"","");
// CUSTOMER_SOURCE_WZLY(0,""),
// CUSTOMER_SOURCE_SMEWM(1,),
// CUSTOMER_SOURCE_SSSJH(2,),
// CUSTOMER_SOURCE_MPFX(3,),
// CUSTOMER_SOURCE_QL(4,),
// CUSTOMER_SOURCE_SJTXL(5,),
// CUSTOMER_SOURCE_WXLXR(6,),
// CUSTOMER_SOURCE_TJHYSQ(7,),
// CUSTOMER_SOURCE_DSFRJTJ(8,),
// CUSTOMER_SOURCE_YXSS(9,),
// CUSTOMER_SOURCE_NBCYGX(201,),
// CUSTOMER_SOURCE_GLRYFP(202,)
// ;
//
private Integer code;
private String tipMsg;
private String solveTipMsg;
private WeExceptionTip(Integer code, String tipMsg,String solveTipMsg){
this.code = code;
this.tipMsg = tipMsg;
this.solveTipMsg=solveTipMsg;
}
//
// public Integer getCode() {
// return code;
// }
//
// public OrderType setCode(Integer code) {
// this.code = code;
// return this;
// }
//
// public String getLabel() {
// return label;
// }
//
// public OrderType setLabel(String label) {
// this.label = label;
// return this;
// }
//
// public OrderType getOrderTypeByCode(Integer code){
// OrderType[] orderTypes = OrderType.values();
// for(OrderType orderType:orderTypes){
// if(orderType.getCode().equals(code)){
// return orderType;
// }
// }
// throw new RuntimeException("未知的订单类型");
// }
}
...@@ -9,16 +9,35 @@ public class WeComException extends RuntimeException { ...@@ -9,16 +9,35 @@ public class WeComException extends RuntimeException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
protected final String message; protected String message;
private Integer code;
public WeComException(String message) public WeComException(String message)
{ {
this.message = message; this.message = message;
} }
@Override public WeComException(Integer code,String message)
public String getMessage()
{ {
this.code=code;
this.message = message;
}
@Override
public String getMessage() {
return message; return message;
} }
public void setMessage(String message) {
this.message = message;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
} }
package com.linkwechat.common.utils;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Hashtable;
import javax.imageio.ImageIO;
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.common.BitMatrix;
public class QREncode {
private static final int BLACK = 0xFF000000;
private static final int WHITE = 0xFFFFFFFF;
private QREncode() {}
public static BufferedImage toBufferedImage(BitMatrix matrix) {
int width = matrix.getWidth();
int height = matrix.getHeight();
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
}
}
return image;
}
public static void writeToFile(BitMatrix matrix, String format, File file)
throws IOException {
BufferedImage image = toBufferedImage(matrix);
if (!ImageIO.write(image, format, file)) {
throw new IOException("Could not write an image of format " + format + " to " + file);
}
}
public static void writeToStream(BitMatrix matrix, String format, OutputStream stream)
throws IOException {
BufferedImage image = toBufferedImage(matrix);
if (!ImageIO.write(image, format, stream)) {
throw new IOException("Could not write an image of format " + format);
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void main(String[] args) throws Exception {
String text = "http://open.weixin.qq.com/qr/code/?username=LinkWeChat2021";
int width = 300;
int height = 300;
String format = "png";
Hashtable hints = new Hashtable();
hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
BitMatrix bitMatrix = new MultiFormatWriter().encode(text,
BarcodeFormat.QR_CODE, width, height, hints);
File outputFile = new File("d:"+File.separator+"qr.png");
QREncode.writeToFile(bitMatrix, format, outputFile);
}
}
...@@ -20,6 +20,6 @@ public interface WeAccessTokenClient { ...@@ -20,6 +20,6 @@ public interface WeAccessTokenClient {
* @return * @return
*/ */
@Request(url = "/gettoken") @Request(url = "/gettoken")
WeAccessTokenDtoDto getToken(@Query("corpid")String corpId, @Query("corpsecret") String corpSecret); WeAccessTokenDtoDto getToken(@Query("corpid") String corpId, @Query("corpsecret") String corpSecret);
} }
\ No newline at end of file \ No newline at end of file
...@@ -37,7 +37,7 @@ public interface WeCustomerClient { ...@@ -37,7 +37,7 @@ public interface WeCustomerClient {
* @return * @return
*/ */
@Request(url = "/externalcontact/get") @Request(url = "/externalcontact/get")
WeCustomerDto get(@Query("external_userid")String externalUserid); WeCustomerDto get(@Query("external_userid") String externalUserid);
/** /**
......
...@@ -51,7 +51,7 @@ public interface WeDepartMentClient { ...@@ -51,7 +51,7 @@ public interface WeDepartMentClient {
*/ */
@Request(url = "/department/list", @Request(url = "/department/list",
dataType = "json") dataType = "json")
WeDepartMentDto weDepartMents(@Query("id")Long id); WeDepartMentDto weDepartMents(@Query("id") Long id);
......
package com.linkwechat.wecom.client;
import com.dtflys.forest.annotation.DataObject;
import com.dtflys.forest.annotation.Request;
import com.linkwechat.wecom.domain.dto.WeExternalContactDto;
/**
* @description: 员工对外联系方式
* @author: HaoN
* @create: 2020-10-13 10:39
**/
public interface WeExternalContactClient {
@Request(url="/externalcontact/add_contact_way",
type = "POST"
)
WeExternalContactDto addContactWay(@DataObject WeExternalContactDto.WeContactWay weContactWay);
}
\ No newline at end of file \ No newline at end of file
...@@ -21,7 +21,7 @@ public interface WeMediaClient { ...@@ -21,7 +21,7 @@ public interface WeMediaClient {
* @return * @return
*/ */
@Post(url="/media/upload") @Post(url="/media/upload")
WeMediaDto upload(@DataFile(value = "file") MultipartFile multipartFile,@Query("type") String type); WeMediaDto upload(@DataFile(value = "file") MultipartFile multipartFile, @Query("type") String type);
/** /**
* 上传图片 * 上传图片
......
...@@ -50,5 +50,5 @@ public interface WeUserClient { ...@@ -50,5 +50,5 @@ public interface WeUserClient {
* @return * @return
*/ */
@Request(url = "/user/delete") @Request(url = "/user/delete")
WeResultDto deleteUserByUserId(@Query("userid")String userid); WeResultDto deleteUserByUserId(@Query("userid") String userid);
} }
package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import lombok.Data;
import java.util.List;
/**
* 员工活码对象 we_emple_code
*
* @author ruoyi
* @date 2020-10-04
*/
@Data
public class WeEmpleCode extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id = SnowFlakeUtil.nextId();
/** 活码类型:1:单人;2:多人;3:批量; */
private Integer codeType;
/** 客户添加时无需经过确认自动成为好友:1:是;0:否 */
private Boolean isJoinConfirmFriends;
/** 活动场景 */
private String activityScene;
/** 欢迎语 */
private String welcomeMsg;
/** 素材的id */
private Long mediaId;
/** 0:正常;1:删除; */
private Integer delFlag=new Integer(0);
/** 使用员工 */
private List<WeEmpleCodeUseScop> weEmpleCodeUseScops;
/** 扫码标签 */
private List<WeEmpleCodeTag> weEmpleCodeTags;
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import lombok.Data;
/**
* 员工活码标签对象 we_emple_code_tag
*
* @author ruoyi
* @date 2020-10-04
*/
@Data
public class WeEmpleCodeTag extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id= SnowFlakeUtil.nextId();
/** 标签id */
private Long tagId;
/** 员工活码id */
private Long empleCodeId;
/** 0:正常;2:删除; */
private Integer delFlag=new Integer(0);
/** 标签名 */
private String tagName;
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import lombok.Data;
/**
* 员工活码使用人对象 we_emple_code_use_scop
*
* @author ruoyi
* @date 2020-10-04
*/
@Data
public class WeEmpleCodeUseScop extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id = SnowFlakeUtil.nextId();
/** 员工活码id */
private Long empleCodeId;
/** 活码类型下业务使用人的id */
private Long useUserId;
/** 0:正常;2:删除; */
private Integer delFlag=new Integer(0);
/** 活码使用人员名称 */
private String userUserName;
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 客户群活码对象 we_group_code
*
* @author ruoyi
* @date 2020-10-07
*/
@Data
public class WeGroupCode extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 活动头像 */
private String activityHeadUrl;
/** 活动名称 */
private String activityName;
/** 场景 */
private String activityScene;
/** 引导语 */
private String guide;
/** 进群是否提示:1:是;0:否; */
private Long joinGroupIsTip;
/** 进群提示语 */
private String tipMsg;
/** 客服二维码 */
private String customerServerQrCode;
/** 0:正常;2:删除; */
private Long delFlag;
}
package com.linkwechat.wecom.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linkwechat.common.core.domain.BaseEntity;
/**
* 实际群码对象 we_group_code_actual
*
* @author ruoyi
* @date 2020-10-07
*/
public class WeGroupCodeActual extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 实际群码 */
private String actualGroupQrCode;
/** 群名称 */
private String groupName;
/** 有效期 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date effectTime;
/** 扫码次数限制 */
private Long scanCodeTimesLimit;
/** 群活码id */
private Long groupCodeId;
/** 扫码次数 */
private Long scanCodeTimes;
/** 0:正常使用;2:删除; */
private Long delFlag;
/** 0:使用中 */
private Long status;
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import io.swagger.models.auth.In;
import lombok.Data;
import java.util.List;
/**
* 欢迎语模板对象 we_msg_tlp
*
* @author ruoyi
* @date 2020-10-04
*/
@Data
public class WeMsgTlp extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id= SnowFlakeUtil.nextId();
/** 欢迎语 */
private String welcomeMsg;
/** 素材的id */
private Long mediaId;
/** 0:正常;1:删除; */
private Integer delFlag=new Integer(0);
/** 欢迎语模板类型:1:员工欢迎语;2:部门员工欢迎语;3:客户群欢迎语 */
private Long welcomeMsgTplType;
/** 欢迎语模板使用范围 */
private List<WeMsgTlpScope> weMsgTlpScopes;
}
package com.linkwechat.wecom.domain;
import com.linkwechat.common.annotation.Excel;
import com.linkwechat.common.core.domain.BaseEntity;
import com.linkwechat.common.utils.SnowFlakeUtil;
import lombok.Builder;
import lombok.Data;
/**
* 模板使用人员范围对象 we_msg_tlp_scope
*
* @author ruoyi
* @date 2020-10-04
*/
@Data
@Builder
public class WeMsgTlpScope extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id= SnowFlakeUtil.nextId();
/** 模板id */
@Excel(name = "模板id")
private Long msgTlpId;
/** 使用人id */
@Excel(name = "使用人id")
private Long useUserId;
/** 0:正常;1:删除; */
private Integer delFlag=new Integer(0);
}
package com.linkwechat.wecom.domain.dto;
import lombok.Builder;
import lombok.Data;
/**
* @description: 对外联系相关字段
* @author: HaoN
* @create: 2020-10-13 10:53
**/
@Data
public class WeExternalContactDto extends WeResultDto {
//新增联系方式的配置id
private String qr_code;
//系我二维码链接,仅在scene为2时返回
private String config_id;
@Data
public static class WeContactWay{
// 联系方式类型,1-单人, 2-多人
private Integer type;
//场景,1-在小程序中联系,2-通过二维码联系
private Integer scene;
//外部客户添加时是否无需验证,默认为true
private Boolean skip_verify;
//使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
private String[] user;
//使用该联系方式的部门id列表,只在type为2时有效
private Long[] party;
//企业自定义的state参数,用于区分不同的添加渠道,在调用“获取外部联系人详情”时会返回该参数值,不超过30个字符
private String state;
public WeContactWay() {
}
public WeContactWay(Integer type, Integer scene, Boolean skip_verify) {
this.type = type;
this.scene = scene;
this.skip_verify = skip_verify;
}
}
}
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeEmpleCode;
import org.apache.ibatis.annotations.Param;
/**
* 员工活码Mapper接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface WeEmpleCodeMapper
{
/**
* 查询员工活码
*
* @param id 员工活码ID
* @return 员工活码
*/
public WeEmpleCode selectWeEmpleCodeById(Long id);
/**
* 查询员工活码列表
*
* @param weEmpleCode 员工活码
* @return 员工活码集合
*/
public List<WeEmpleCode> selectWeEmpleCodeList(WeEmpleCode weEmpleCode);
/**
* 新增员工活码
*
* @param weEmpleCode 员工活码
* @return 结果
*/
public int insertWeEmpleCode(WeEmpleCode weEmpleCode);
/**
* 修改员工活码
*
* @param weEmpleCode 员工活码
* @return 结果
*/
public int updateWeEmpleCode(WeEmpleCode weEmpleCode);
/**
* 删除员工活码
*
* @param id 员工活码ID
* @return 结果
*/
public int deleteWeEmpleCodeById(Long id);
/**
* 批量删除员工活码
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeEmpleCodeByIds(Long[] ids);
/**
* 批量逻辑删除员工活码
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int batchRemoveWeEmpleCodeIds(@Param("ids") List<Long> ids);
}
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import org.apache.ibatis.annotations.Param;
/**
* 员工活码标签Mapper接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface WeEmpleCodeTagMapper
{
/**
* 查询员工活码标签
*
* @param id 员工活码标签ID
* @return 员工活码标签
*/
public WeEmpleCodeTag selectWeEmpleCodeTagById(Long id);
/**
* 查询员工活码标签列表
*
* @param empleCodeId 员工活码Id
* @return 员工活码标签集合
*/
public List<WeEmpleCodeTag> selectWeEmpleCodeTagListById(@Param("empleCodeId") Long empleCodeId);
/**
* 新增员工活码标签
*
* @param weEmpleCodeTag 员工活码标签
* @return 结果
*/
public int insertWeEmpleCodeTag(WeEmpleCodeTag weEmpleCodeTag);
/**
* 修改员工活码标签
*
* @param weEmpleCodeTag 员工活码标签
* @return 结果
*/
public int updateWeEmpleCodeTag(WeEmpleCodeTag weEmpleCodeTag);
/**
* 删除员工活码标签
*
* @param id 员工活码标签ID
* @return 结果
*/
public int deleteWeEmpleCodeTagById(Long id);
/**
* 批量删除员工活码标签
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeEmpleCodeTagByIds(Long[] ids);
/**
* 批量保存标签
* @param weEmpleCodeTags
* @return
*/
public int batchInsetWeEmpleCodeTag(@Param("weEmpleCodeTags") List<WeEmpleCodeTag> weEmpleCodeTags);
/**
* 批量逻辑删除
* @param ids
* @return
*/
public int batchRemoveWeEmpleCodeTagIds(@Param("ids") List<Long> ids);
}
package com.linkwechat.wecom.mapper;
import com.linkwechat.wecom.domain.WeEmpleCodeUseScop;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 员工活码使用人Mapper接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface WeEmpleCodeUseScopMapper
{
/**
* 查询员工活码使用人
*
* @param id 员工活码使用人ID
* @return 员工活码使用人
*/
public WeEmpleCodeUseScop selectWeEmpleCodeUseScopById(Long id);
/**
* 查询员工活码使用人列表
*
* @param empleCodeId 员工活码id
* @return 员工活码使用人集合
*/
public List<WeEmpleCodeUseScop> selectWeEmpleCodeUseScopListById(@Param("empleCodeId") Long empleCodeId);
/**
* 新增员工活码使用人
*
* @param weEmpleCodeUseScop 员工活码使用人
* @return 结果
*/
public int insertWeEmpleCodeUseScop(WeEmpleCodeUseScop weEmpleCodeUseScop);
/**
* 修改员工活码使用人
*
* @param weEmpleCodeUseScop 员工活码使用人
* @return 结果
*/
public int updateWeEmpleCodeUseScop(WeEmpleCodeUseScop weEmpleCodeUseScop);
/**
* 删除员工活码使用人
*
* @param id 员工活码使用人ID
* @return 结果
*/
public int deleteWeEmpleCodeUseScopById(Long id);
/**
* 批量删除员工活码使用人
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeEmpleCodeUseScopByIds(Long[] ids);
/**
* 批量保存
* @param weEmpleCodeUseScops
* @return
*/
public int batchInsetWeEmpleCodeUseScop(@Param("weEmpleCodeUseScops") List<WeEmpleCodeUseScop> weEmpleCodeUseScops);
/**
* 批量物理删除
* @param ids
* @return
*/
public int batchRemoveWeEmpleCodeUseScopIds(List<Long> ids);
}
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeGroupCodeActual;
/**
* 实际群码Mapper接口
*
* @author ruoyi
* @date 2020-10-07
*/
public interface WeGroupCodeActualMapper
{
/**
* 查询实际群码
*
* @param id 实际群码ID
* @return 实际群码
*/
public WeGroupCodeActual selectWeGroupCodeActualById(Long id);
/**
* 查询实际群码列表
*
* @param weGroupCodeActual 实际群码
* @return 实际群码集合
*/
public List<WeGroupCodeActual> selectWeGroupCodeActualList(WeGroupCodeActual weGroupCodeActual);
/**
* 新增实际群码
*
* @param weGroupCodeActual 实际群码
* @return 结果
*/
public int insertWeGroupCodeActual(WeGroupCodeActual weGroupCodeActual);
/**
* 修改实际群码
*
* @param weGroupCodeActual 实际群码
* @return 结果
*/
public int updateWeGroupCodeActual(WeGroupCodeActual weGroupCodeActual);
/**
* 删除实际群码
*
* @param id 实际群码ID
* @return 结果
*/
public int deleteWeGroupCodeActualById(Long id);
/**
* 批量删除实际群码
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeGroupCodeActualByIds(Long[] ids);
}
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeGroupCode;
/**
* 客户群活码Mapper接口
*
* @author ruoyi
* @date 2020-10-07
*/
public interface WeGroupCodeMapper
{
/**
* 查询客户群活码
*
* @param id 客户群活码ID
* @return 客户群活码
*/
public WeGroupCode selectWeGroupCodeById(Long id);
/**
* 查询客户群活码列表
*
* @param weGroupCode 客户群活码
* @return 客户群活码集合
*/
public List<WeGroupCode> selectWeGroupCodeList(WeGroupCode weGroupCode);
/**
* 新增客户群活码
*
* @param weGroupCode 客户群活码
* @return 结果
*/
public int insertWeGroupCode(WeGroupCode weGroupCode);
/**
* 修改客户群活码
*
* @param weGroupCode 客户群活码
* @return 结果
*/
public int updateWeGroupCode(WeGroupCode weGroupCode);
/**
* 删除客户群活码
*
* @param id 客户群活码ID
* @return 结果
*/
public int deleteWeGroupCodeById(Long id);
/**
* 批量删除客户群活码
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeGroupCodeByIds(Long[] ids);
}
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeMsgTlp;
import org.apache.ibatis.annotations.Param;
/**
* 欢迎语模板Mapper接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface WeMsgTlpMapper
{
/**
* 查询欢迎语模板
*
* @param id 欢迎语模板ID
* @return 欢迎语模板
*/
public WeMsgTlp selectWeMsgTlpById(Long id);
/**
* 查询欢迎语模板列表
*
* @param weMsgTlp 欢迎语模板
* @return 欢迎语模板集合
*/
public List<WeMsgTlp> selectWeMsgTlpList(WeMsgTlp weMsgTlp);
/**
* 新增欢迎语模板
*
* @param weMsgTlp 欢迎语模板
* @return 结果
*/
public int insertWeMsgTlp(WeMsgTlp weMsgTlp);
/**
* 修改欢迎语模板
*
* @param weMsgTlp 欢迎语模板
* @return 结果
*/
public int updateWeMsgTlp(WeMsgTlp weMsgTlp);
/**
* 删除欢迎语模板
*
* @param id 欢迎语模板ID
* @return 结果
*/
public int deleteWeMsgTlpById(Long id);
/**
* 批量删除欢迎语模板
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeMsgTlpByIds(Long[] ids);
/**
* 通过模板id删除
* @param msgTlpIds
* @return
*/
public int batchRemoveByids(@Param("msgTlpIds") List<Long> msgTlpIds);
}
package com.linkwechat.wecom.mapper;
import java.util.List;
import com.linkwechat.wecom.domain.WeMsgTlpScope;
import org.apache.ibatis.annotations.Param;
/**
* 模板使用人员范围Mapper接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface WeMsgTlpScopeMapper
{
/**
* 查询模板使用人员范围
*
* @param id 模板使用人员范围ID
* @return 模板使用人员范围
*/
public WeMsgTlpScope selectWeMsgTlpScopeById(Long id);
/**
* 查询模板使用人员范围列表
*
* @param weMsgTlpScope 模板使用人员范围
* @return 模板使用人员范围集合
*/
public List<WeMsgTlpScope> selectWeMsgTlpScopeList(WeMsgTlpScope weMsgTlpScope);
/**
* 新增模板使用人员范围
*
* @param weMsgTlpScope 模板使用人员范围
* @return 结果
*/
public int insertWeMsgTlpScope(WeMsgTlpScope weMsgTlpScope);
/**
* 修改模板使用人员范围
*
* @param weMsgTlpScope 模板使用人员范围
* @return 结果
*/
public int updateWeMsgTlpScope(WeMsgTlpScope weMsgTlpScope);
/**
* 删除模板使用人员范围
*
* @param id 模板使用人员范围ID
* @return 结果
*/
public int deleteWeMsgTlpScopeById(Long id);
/**
* 批量删除模板使用人员范围
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteWeMsgTlpScopeByIds(Long[] ids);
/**
* 批量保存模板使用人员范围
* @param weMsgTlpScopes
* @return
*/
public int batchInsetWeMsgTlpScope(@Param("weMsgTlpScopes") List<WeMsgTlpScope> weMsgTlpScopes);
/**
* 模板id,批量删除
* @param msgTlpIds
* @return
*/
public int batchRemoveWeMsgTlpScopesByMsgTlpIds(List<Long> msgTlpIds);
}
package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeEmpleCode;
import java.util.List;
/**
* 员工活码Service接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface IWeEmpleCodeService
{
/**
* 查询员工活码
*
* @param id 员工活码ID
* @return 员工活码
*/
public WeEmpleCode selectWeEmpleCodeById(Long id);
/**
* 查询员工活码列表
*
* @param weEmpleCode 员工活码
* @return 员工活码集合
*/
public List<WeEmpleCode> selectWeEmpleCodeList(WeEmpleCode weEmpleCode);
/**
* 新增员工活码
*
* @param weEmpleCode 员工活码
* @return 结果
*/
public int insertWeEmpleCode(WeEmpleCode weEmpleCode);
/**
* 修改员工活码
*
* @param weEmpleCode 员工活码
* @return 结果
*/
public int updateWeEmpleCode(WeEmpleCode weEmpleCode);
/**
* 批量删除员工活码
*
* @param ids 需要删除的员工活码ID
* @return 结果
*/
public int deleteWeEmpleCodeByIds(Long[] ids);
/**
* 删除员工活码信息
*
* @param id 员工活码ID
* @return 结果
*/
public int deleteWeEmpleCodeById(Long id);
/**
* 批量逻辑删除员工活码
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int batchRemoveWeEmpleCodeIds(List<Long> ids);
}
package com.linkwechat.wecom.service;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 员工活码标签Service接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface IWeEmpleCodeTagService
{
/**
* 查询员工活码标签
*
* @param id 员工活码标签ID
* @return 员工活码标签
*/
public WeEmpleCodeTag selectWeEmpleCodeTagById(Long id);
/**
* 查询员工活码标签列表
*
* @param empleCodeId 员工活码id
* @return 员工活码标签集合
*/
public List<WeEmpleCodeTag> selectWeEmpleCodeTagListById(Long empleCodeId);
/**
* 新增员工活码标签
*
* @param weEmpleCodeTag 员工活码标签
* @return 结果
*/
public int insertWeEmpleCodeTag(WeEmpleCodeTag weEmpleCodeTag);
/**
* 修改员工活码标签
*
* @param weEmpleCodeTag 员工活码标签
* @return 结果
*/
public int updateWeEmpleCodeTag(WeEmpleCodeTag weEmpleCodeTag);
/**
* 批量删除员工活码标签
*
* @param ids 需要删除的员工活码标签ID
* @return 结果
*/
public int deleteWeEmpleCodeTagByIds(Long[] ids);
/**
* 删除员工活码标签信息
*
* @param id 员工活码标签ID
* @return 结果
*/
public int deleteWeEmpleCodeTagById(Long id);
/**
* 批量保存标签
* @param weEmpleCodeTags
* @return
*/
public int batchInsetWeEmpleCodeTag(List<WeEmpleCodeTag> weEmpleCodeTags);
/**
* 批量逻辑删除
* @param ids
* @return
*/
public int batchRemoveWeEmpleCodeTagIds(List<Long> ids);
}
package com.linkwechat.wecom.service;
import java.util.List;
import com.linkwechat.wecom.domain.WeEmpleCodeUseScop;
/**
* 员工活码使用人Service接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface IWeEmpleCodeUseScopService
{
/**
* 查询员工活码使用人
*
* @param id 员工活码使用人ID
* @return 员工活码使用人
*/
public WeEmpleCodeUseScop selectWeEmpleCodeUseScopById(Long id);
/**
* 查询员工活码使用人列表
*
* @param empleCodeId
* @return 员工活码使用人集合
*/
public List<WeEmpleCodeUseScop> selectWeEmpleCodeUseScopListById(Long empleCodeId);
/**
* 新增员工活码使用人
*
* @param weEmpleCodeUseScop 员工活码使用人
* @return 结果
*/
public int insertWeEmpleCodeUseScop(WeEmpleCodeUseScop weEmpleCodeUseScop);
/**
* 修改员工活码使用人
*
* @param weEmpleCodeUseScop 员工活码使用人
* @return 结果
*/
public int updateWeEmpleCodeUseScop(WeEmpleCodeUseScop weEmpleCodeUseScop);
/**
* 批量删除员工活码使用人
*
* @param ids 需要删除的员工活码使用人ID
* @return 结果
*/
public int deleteWeEmpleCodeUseScopByIds(Long[] ids);
/**
* 删除员工活码使用人信息
*
* @param id 员工活码使用人ID
* @return 结果
*/
public int deleteWeEmpleCodeUseScopById(Long id);
/**
* 批量保存
* @param weEmpleCodeUseScops
* @return
*/
public int batchInsetWeEmpleCodeUseScop(List<WeEmpleCodeUseScop> weEmpleCodeUseScops);
/**
* 批量物理删除
* @param ids
* @return
*/
public int batchRemoveWeEmpleCodeUseScopIds(List<Long> ids);
}
package com.linkwechat.wecom.service;
import java.util.List;
import com.linkwechat.wecom.domain.WeGroupCodeActual;
/**
* 实际群码Service接口
*
* @author ruoyi
* @date 2020-10-07
*/
public interface IWeGroupCodeActualService
{
/**
* 查询实际群码
*
* @param id 实际群码ID
* @return 实际群码
*/
public WeGroupCodeActual selectWeGroupCodeActualById(Long id);
/**
* 查询实际群码列表
*
* @param weGroupCodeActual 实际群码
* @return 实际群码集合
*/
public List<WeGroupCodeActual> selectWeGroupCodeActualList(WeGroupCodeActual weGroupCodeActual);
/**
* 新增实际群码
*
* @param weGroupCodeActual 实际群码
* @return 结果
*/
public int insertWeGroupCodeActual(WeGroupCodeActual weGroupCodeActual);
/**
* 修改实际群码
*
* @param weGroupCodeActual 实际群码
* @return 结果
*/
public int updateWeGroupCodeActual(WeGroupCodeActual weGroupCodeActual);
/**
* 批量删除实际群码
*
* @param ids 需要删除的实际群码ID
* @return 结果
*/
public int deleteWeGroupCodeActualByIds(Long[] ids);
/**
* 删除实际群码信息
*
* @param id 实际群码ID
* @return 结果
*/
public int deleteWeGroupCodeActualById(Long id);
}
package com.linkwechat.wecom.service;
import java.util.List;
import com.linkwechat.wecom.domain.WeGroupCode;
/**
* 客户群活码Service接口
*
* @author ruoyi
* @date 2020-10-07
*/
public interface IWeGroupCodeService
{
/**
* 查询客户群活码
*
* @param id 客户群活码ID
* @return 客户群活码
*/
public WeGroupCode selectWeGroupCodeById(Long id);
/**
* 查询客户群活码列表
*
* @param weGroupCode 客户群活码
* @return 客户群活码集合
*/
public List<WeGroupCode> selectWeGroupCodeList(WeGroupCode weGroupCode);
/**
* 新增客户群活码
*
* @param weGroupCode 客户群活码
* @return 结果
*/
public int insertWeGroupCode(WeGroupCode weGroupCode);
/**
* 修改客户群活码
*
* @param weGroupCode 客户群活码
* @return 结果
*/
public int updateWeGroupCode(WeGroupCode weGroupCode);
/**
* 批量删除客户群活码
*
* @param ids 需要删除的客户群活码ID
* @return 结果
*/
public int deleteWeGroupCodeByIds(Long[] ids);
/**
* 删除客户群活码信息
*
* @param id 客户群活码ID
* @return 结果
*/
public int deleteWeGroupCodeById(Long id);
}
package com.linkwechat.wecom.service;
import java.util.List;
import com.linkwechat.wecom.domain.WeMsgTlpScope;
/**
* 模板使用人员范围Service接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface IWeMsgTlpScopeService
{
/**
* 查询模板使用人员范围
*
* @param id 模板使用人员范围ID
* @return 模板使用人员范围
*/
public WeMsgTlpScope selectWeMsgTlpScopeById(Long id);
/**
* 查询模板使用人员范围列表
*
* @param weMsgTlpScope 模板使用人员范围
* @return 模板使用人员范围集合
*/
public List<WeMsgTlpScope> selectWeMsgTlpScopeList(WeMsgTlpScope weMsgTlpScope);
/**
* 新增模板使用人员范围
*
* @param weMsgTlpScope 模板使用人员范围
* @return 结果
*/
public int insertWeMsgTlpScope(WeMsgTlpScope weMsgTlpScope);
/**
* 修改模板使用人员范围
*
* @param weMsgTlpScope 模板使用人员范围
* @return 结果
*/
public int updateWeMsgTlpScope(WeMsgTlpScope weMsgTlpScope);
/**
* 批量删除模板使用人员范围
*
* @param ids 需要删除的模板使用人员范围ID
* @return 结果
*/
public int deleteWeMsgTlpScopeByIds(Long[] ids);
/**
* 删除模板使用人员范围信息
*
* @param id 模板使用人员范围ID
* @return 结果
*/
public int deleteWeMsgTlpScopeById(Long id);
/**
* 批量保存模板使用人员范围
* @param weMsgTlpScopes
* @return
*/
public int batchInsetWeMsgTlpScope(List<WeMsgTlpScope> weMsgTlpScopes);
/**
* 通过使用者id批量删除
* @param useUserIds
* @return
*/
public int batchRemoveWeMsgTlpScopesByMsgTlpIds(List<Long> useUserIds);
}
package com.linkwechat.wecom.service;
import java.util.List;
import com.linkwechat.wecom.domain.WeMsgTlp;
/**
* 欢迎语模板Service接口
*
* @author ruoyi
* @date 2020-10-04
*/
public interface IWeMsgTlpService
{
/**
* 查询欢迎语模板
*
* @param id 欢迎语模板ID
* @return 欢迎语模板
*/
public WeMsgTlp selectWeMsgTlpById(Long id);
/**
* 查询欢迎语模板列表
*
* @param weMsgTlp 欢迎语模板
* @return 欢迎语模板集合
*/
public List<WeMsgTlp> selectWeMsgTlpList(WeMsgTlp weMsgTlp);
/**
* 新增欢迎语模板
*
* @param weMsgTlp 欢迎语模板
* @return 结果
*/
public int insertWeMsgTlp(WeMsgTlp weMsgTlp);
/**
* 修改欢迎语模板
*
* @param weMsgTlp 欢迎语模板
* @return 结果
*/
public int updateWeMsgTlp(WeMsgTlp weMsgTlp);
/**
* 批量删除欢迎语模板
*
* @param ids 需要删除的欢迎语模板ID
* @return 结果
*/
public int deleteWeMsgTlpByIds(Long[] ids);
/**
* 删除欢迎语模板信息
*
* @param id 欢迎语模板ID
* @return 结果
*/
public int deleteWeMsgTlpById(Long id);
/**
* 批量逻辑删除
* @param msgTlpIds
* @return
*/
public int batchRemoveByids(List<Long> msgTlpIds);
}
...@@ -69,7 +69,7 @@ public interface IWeUserService ...@@ -69,7 +69,7 @@ public interface IWeUserService
* @param enable * @param enable
* @return * @return
*/ */
public int startOrStop(Long id,Boolean enable); public int startOrStop(Long id, Boolean enable);
/** /**
......
package com.linkwechat.wecom.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ArrayUtil;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.utils.DateUtils;
import com.linkwechat.wecom.client.WeExternalContactClient;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import com.linkwechat.wecom.domain.WeEmpleCodeUseScop;
import com.linkwechat.wecom.domain.dto.WeExternalContactDto;
import com.linkwechat.wecom.service.IWeEmpleCodeTagService;
import com.linkwechat.wecom.service.IWeEmpleCodeUseScopService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeEmpleCodeMapper;
import com.linkwechat.wecom.domain.WeEmpleCode;
import com.linkwechat.wecom.service.IWeEmpleCodeService;
import org.springframework.transaction.annotation.Transactional;
/**
* 员工活码Service业务层处理
*
* @author ruoyi
* @date 2020-10-04
*/
@Service
public class WeEmpleCodeServiceImpl implements IWeEmpleCodeService
{
@Autowired
private WeEmpleCodeMapper weEmpleCodeMapper;
@Autowired
private IWeEmpleCodeTagService weEmpleCodeTagService;
@Autowired
private IWeEmpleCodeUseScopService iWeEmpleCodeUseScopService;
@Autowired
private WeExternalContactClient weExternalContactClient;
/**
* 查询员工活码
*
* @param id 员工活码ID
* @return 员工活码
*/
@Override
public WeEmpleCode selectWeEmpleCodeById(Long id)
{
WeEmpleCode weEmpleCode = weEmpleCodeMapper.selectWeEmpleCodeById(id);
if(null != weEmpleCode){
weEmpleCode.setWeEmpleCodeTags(
weEmpleCodeTagService.selectWeEmpleCodeTagListById(id)
);
weEmpleCode.setWeEmpleCodeUseScops(
iWeEmpleCodeUseScopService.selectWeEmpleCodeUseScopListById(id)
);
}
return weEmpleCode;
}
/**
* 查询员工活码列表
*
* @param weEmpleCode 员工活码
* @return 员工活码
*/
@Override
public List<WeEmpleCode> selectWeEmpleCodeList(WeEmpleCode weEmpleCode)
{
return weEmpleCodeMapper.selectWeEmpleCodeList(weEmpleCode);
}
/**
* 新增员工活码
*
* @param weEmpleCode 员工活码
* @return 结果
*/
@Override
@Transactional
public int insertWeEmpleCode(WeEmpleCode weEmpleCode)
{
int returnCode = weEmpleCodeMapper.insertWeEmpleCode(weEmpleCode);
if(returnCode>0){
List<WeEmpleCodeUseScop> weEmpleCodeUseScops = weEmpleCode.getWeEmpleCodeUseScops();
if(CollectionUtil.isNotEmpty(weEmpleCodeUseScops)){
weEmpleCodeUseScops.stream().forEach(v->v.setEmpleCodeId(weEmpleCode.getId()));
//批量保存使用员工
iWeEmpleCodeUseScopService.batchInsetWeEmpleCodeUseScop(weEmpleCodeUseScops);
List<WeEmpleCodeTag> weEmpleCodeTags = weEmpleCode.getWeEmpleCodeTags().stream().filter(v->v.getTagId()!=null).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(weEmpleCodeTags)){
//批量保存标签
weEmpleCodeTags.stream().forEach(v->v.setEmpleCodeId(weEmpleCode.getId()));
weEmpleCodeTagService.batchInsetWeEmpleCodeTag(weEmpleCodeTags);
}
if(!weEmpleCode.getCodeType().equals(WeConstans.BATCH_SINGLE_EMPLE_CODE_TYPE)){
WeExternalContactDto.WeContactWay weContactWay = new WeExternalContactDto.WeContactWay(weEmpleCode.getCodeType(),
WeConstans.QR_CODE_EMPLE_CODE_SCENE,weEmpleCode.getIsJoinConfirmFriends());
if(weEmpleCode.getCodeType().equals(WeConstans.SINGLE_EMPLE_CODE_TYPE)){
weContactWay.setUser(
ArrayUtil.toArray(weEmpleCodeUseScops.stream().map(WeEmpleCodeUseScop::getUseUserId)
.map(x -> String.valueOf(x))
.collect(Collectors.toList()), String.class)
);//设置员工id
}else if(weEmpleCode.getCodeType().equals(WeConstans.SINGLE_EMPLE_CODE_TYPE)){
weContactWay.setParty(ArrayUtil.toArray(weEmpleCodeUseScops.stream().map(WeEmpleCodeUseScop::getUseUserId)
.collect(Collectors.toList()), Long.class)); //设置部门id
}
//生成员工活码
WeExternalContactDto weExternalContactDto = weExternalContactClient.addContactWay(
weContactWay
);
System.out.println(weExternalContactDto.toString());
// if(weExternalContactDto.getErrcode().equals(WeConstans.WE_SUCCESS_CODE)){
// //二维码等数据入库
//
// }
}
}
}
return returnCode;
}
/**
* 修改员工活码
*
* @param weEmpleCode 员工活码
* @return 结果
*/
@Override
public int updateWeEmpleCode(WeEmpleCode weEmpleCode)
{
int returnCode = weEmpleCodeMapper.updateWeEmpleCode(weEmpleCode);
if(returnCode>0){
List<WeEmpleCodeTag> weEmpleCodeTags = weEmpleCode.getWeEmpleCodeTags();
if(CollectionUtil.isNotEmpty(weEmpleCodeTags)){
//删除原有的
weEmpleCodeTagService.batchRemoveWeEmpleCodeTagIds(ListUtil.toList(weEmpleCode.getId()));
//保存新的
weEmpleCodeTagService.batchInsetWeEmpleCodeTag(weEmpleCodeTags);
}
List<WeEmpleCodeUseScop> weEmpleCodeUseScops = weEmpleCode.getWeEmpleCodeUseScops();
if(CollectionUtil.isNotEmpty(weEmpleCodeUseScops)){
//删除原有的
iWeEmpleCodeUseScopService.batchRemoveWeEmpleCodeUseScopIds(ListUtil.toList(weEmpleCode.getId()));
//保存新的
iWeEmpleCodeUseScopService.batchInsetWeEmpleCodeUseScop(weEmpleCodeUseScops);
}
}
return returnCode;
}
/**
* 批量删除员工活码
*
* @param ids 需要删除的员工活码ID
* @return 结果
*/
@Override
public int deleteWeEmpleCodeByIds(Long[] ids)
{
return weEmpleCodeMapper.deleteWeEmpleCodeByIds(ids);
}
/**
* 删除员工活码信息
*
* @param id 员工活码ID
* @return 结果
*/
@Override
public int deleteWeEmpleCodeById(Long id)
{
return weEmpleCodeMapper.deleteWeEmpleCodeById(id);
}
/**
* 批量逻辑删除员工活码
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int batchRemoveWeEmpleCodeIds(List<Long> ids) {
return weEmpleCodeMapper.batchRemoveWeEmpleCodeIds(ids);
}
}
package com.linkwechat.wecom.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeEmpleCodeTagMapper;
import com.linkwechat.wecom.domain.WeEmpleCodeTag;
import com.linkwechat.wecom.service.IWeEmpleCodeTagService;
/**
* 员工活码标签Service业务层处理
*
* @author ruoyi
* @date 2020-10-04
*/
@Service
public class WeEmpleCodeTagServiceImpl implements IWeEmpleCodeTagService
{
@Autowired
private WeEmpleCodeTagMapper weEmpleCodeTagMapper;
/**
* 查询员工活码标签
*
* @param id 员工活码标签ID
* @return 员工活码标签
*/
@Override
public WeEmpleCodeTag selectWeEmpleCodeTagById(Long id)
{
return weEmpleCodeTagMapper.selectWeEmpleCodeTagById(id);
}
/**
* 查询员工活码标签列表
*
* @param empleCodeId 员工活码id
* @return 员工活码标签
*/
@Override
public List<WeEmpleCodeTag> selectWeEmpleCodeTagListById(Long empleCodeId)
{
return weEmpleCodeTagMapper.selectWeEmpleCodeTagListById(empleCodeId);
}
/**
* 新增员工活码标签
*
* @param weEmpleCodeTag 员工活码标签
* @return 结果
*/
@Override
public int insertWeEmpleCodeTag(WeEmpleCodeTag weEmpleCodeTag)
{
return weEmpleCodeTagMapper.insertWeEmpleCodeTag(weEmpleCodeTag);
}
/**
* 修改员工活码标签
*
* @param weEmpleCodeTag 员工活码标签
* @return 结果
*/
@Override
public int updateWeEmpleCodeTag(WeEmpleCodeTag weEmpleCodeTag)
{
return weEmpleCodeTagMapper.updateWeEmpleCodeTag(weEmpleCodeTag);
}
/**
* 批量删除员工活码标签
*
* @param ids 需要删除的员工活码标签ID
* @return 结果
*/
@Override
public int deleteWeEmpleCodeTagByIds(Long[] ids)
{
return weEmpleCodeTagMapper.deleteWeEmpleCodeTagByIds(ids);
}
/**
* 删除员工活码标签信息
*
* @param id 员工活码标签ID
* @return 结果
*/
@Override
public int deleteWeEmpleCodeTagById(Long id)
{
return weEmpleCodeTagMapper.deleteWeEmpleCodeTagById(id);
}
/**
* 批量保存标签
* @param weEmpleCodeTags
* @return
*/
@Override
public int batchInsetWeEmpleCodeTag(List<WeEmpleCodeTag> weEmpleCodeTags) {
return weEmpleCodeTagMapper.batchInsetWeEmpleCodeTag(weEmpleCodeTags);
}
/**
* 批量逻辑删除
* @param ids
* @return
*/
@Override
public int batchRemoveWeEmpleCodeTagIds(List<Long> ids) {
return weEmpleCodeTagMapper.batchRemoveWeEmpleCodeTagIds(ids);
}
}
package com.linkwechat.wecom.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeEmpleCodeUseScopMapper;
import com.linkwechat.wecom.domain.WeEmpleCodeUseScop;
import com.linkwechat.wecom.service.IWeEmpleCodeUseScopService;
/**
* 员工活码使用人Service业务层处理
*
* @author ruoyi
* @date 2020-10-04
*/
@Service
public class WeEmpleCodeUseScopServiceImpl implements IWeEmpleCodeUseScopService
{
@Autowired
private WeEmpleCodeUseScopMapper weEmpleCodeUseScopMapper;
/**
* 查询员工活码使用人
*
* @param id 员工活码使用人ID
* @return 员工活码使用人
*/
@Override
public WeEmpleCodeUseScop selectWeEmpleCodeUseScopById(Long id)
{
return weEmpleCodeUseScopMapper.selectWeEmpleCodeUseScopById(id);
}
/**
* 查询员工活码使用人列表
*
* @param empleCodeId
* @return 员工活码使用人
*/
@Override
public List<WeEmpleCodeUseScop> selectWeEmpleCodeUseScopListById( Long empleCodeId)
{
return weEmpleCodeUseScopMapper.selectWeEmpleCodeUseScopListById(empleCodeId);
}
/**
* 新增员工活码使用人
*
* @param weEmpleCodeUseScop 员工活码使用人
* @return 结果
*/
@Override
public int insertWeEmpleCodeUseScop(WeEmpleCodeUseScop weEmpleCodeUseScop)
{
return weEmpleCodeUseScopMapper.insertWeEmpleCodeUseScop(weEmpleCodeUseScop);
}
/**
* 修改员工活码使用人
*
* @param weEmpleCodeUseScop 员工活码使用人
* @return 结果
*/
@Override
public int updateWeEmpleCodeUseScop(WeEmpleCodeUseScop weEmpleCodeUseScop)
{
return weEmpleCodeUseScopMapper.updateWeEmpleCodeUseScop(weEmpleCodeUseScop);
}
/**
* 批量删除员工活码使用人
*
* @param ids 需要删除的员工活码使用人ID
* @return 结果
*/
@Override
public int deleteWeEmpleCodeUseScopByIds(Long[] ids)
{
return weEmpleCodeUseScopMapper.deleteWeEmpleCodeUseScopByIds(ids);
}
/**
* 删除员工活码使用人信息
*
* @param id 员工活码使用人ID
* @return 结果
*/
@Override
public int deleteWeEmpleCodeUseScopById(Long id)
{
return weEmpleCodeUseScopMapper.deleteWeEmpleCodeUseScopById(id);
}
/**
* 批量保存
* @param weEmpleCodeUseScops
* @return
*/
@Override
public int batchInsetWeEmpleCodeUseScop(List<WeEmpleCodeUseScop> weEmpleCodeUseScops) {
return weEmpleCodeUseScopMapper.batchInsetWeEmpleCodeUseScop(weEmpleCodeUseScops);
}
/**
* 批量物理删除
* @param ids
* @return
*/
@Override
public int batchRemoveWeEmpleCodeUseScopIds(List<Long> ids) {
return weEmpleCodeUseScopMapper.batchRemoveWeEmpleCodeUseScopIds(ids);
}
}
package com.linkwechat.wecom.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeGroupCodeActualMapper;
import com.linkwechat.wecom.domain.WeGroupCodeActual;
import com.linkwechat.wecom.service.IWeGroupCodeActualService;
/**
* 实际群码Service业务层处理
*
* @author ruoyi
* @date 2020-10-07
*/
@Service
public class WeGroupCodeActualServiceImpl implements IWeGroupCodeActualService
{
@Autowired
private WeGroupCodeActualMapper weGroupCodeActualMapper;
/**
* 查询实际群码
*
* @param id 实际群码ID
* @return 实际群码
*/
@Override
public WeGroupCodeActual selectWeGroupCodeActualById(Long id)
{
return weGroupCodeActualMapper.selectWeGroupCodeActualById(id);
}
/**
* 查询实际群码列表
*
* @param weGroupCodeActual 实际群码
* @return 实际群码
*/
@Override
public List<WeGroupCodeActual> selectWeGroupCodeActualList(WeGroupCodeActual weGroupCodeActual)
{
return weGroupCodeActualMapper.selectWeGroupCodeActualList(weGroupCodeActual);
}
/**
* 新增实际群码
*
* @param weGroupCodeActual 实际群码
* @return 结果
*/
@Override
public int insertWeGroupCodeActual(WeGroupCodeActual weGroupCodeActual)
{
return weGroupCodeActualMapper.insertWeGroupCodeActual(weGroupCodeActual);
}
/**
* 修改实际群码
*
* @param weGroupCodeActual 实际群码
* @return 结果
*/
@Override
public int updateWeGroupCodeActual(WeGroupCodeActual weGroupCodeActual)
{
return weGroupCodeActualMapper.updateWeGroupCodeActual(weGroupCodeActual);
}
/**
* 批量删除实际群码
*
* @param ids 需要删除的实际群码ID
* @return 结果
*/
@Override
public int deleteWeGroupCodeActualByIds(Long[] ids)
{
return weGroupCodeActualMapper.deleteWeGroupCodeActualByIds(ids);
}
/**
* 删除实际群码信息
*
* @param id 实际群码ID
* @return 结果
*/
@Override
public int deleteWeGroupCodeActualById(Long id)
{
return weGroupCodeActualMapper.deleteWeGroupCodeActualById(id);
}
}
package com.linkwechat.wecom.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeGroupCodeMapper;
import com.linkwechat.wecom.domain.WeGroupCode;
import com.linkwechat.wecom.service.IWeGroupCodeService;
/**
* 客户群活码Service业务层处理
*
* @author ruoyi
* @date 2020-10-07
*/
@Service
public class WeGroupCodeServiceImpl implements IWeGroupCodeService
{
@Autowired
private WeGroupCodeMapper weGroupCodeMapper;
/**
* 查询客户群活码
*
* @param id 客户群活码ID
* @return 客户群活码
*/
@Override
public WeGroupCode selectWeGroupCodeById(Long id)
{
return weGroupCodeMapper.selectWeGroupCodeById(id);
}
/**
* 查询客户群活码列表
*
* @param weGroupCode 客户群活码
* @return 客户群活码
*/
@Override
public List<WeGroupCode> selectWeGroupCodeList(WeGroupCode weGroupCode)
{
return weGroupCodeMapper.selectWeGroupCodeList(weGroupCode);
}
/**
* 新增客户群活码
*
* @param weGroupCode 客户群活码
* @return 结果
*/
@Override
public int insertWeGroupCode(WeGroupCode weGroupCode)
{
return weGroupCodeMapper.insertWeGroupCode(weGroupCode);
}
/**
* 修改客户群活码
*
* @param weGroupCode 客户群活码
* @return 结果
*/
@Override
public int updateWeGroupCode(WeGroupCode weGroupCode)
{
return weGroupCodeMapper.updateWeGroupCode(weGroupCode);
}
/**
* 批量删除客户群活码
*
* @param ids 需要删除的客户群活码ID
* @return 结果
*/
@Override
public int deleteWeGroupCodeByIds(Long[] ids)
{
return weGroupCodeMapper.deleteWeGroupCodeByIds(ids);
}
/**
* 删除客户群活码信息
*
* @param id 客户群活码ID
* @return 结果
*/
@Override
public int deleteWeGroupCodeById(Long id)
{
return weGroupCodeMapper.deleteWeGroupCodeById(id);
}
}
package com.linkwechat.wecom.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeMsgTlpScopeMapper;
import com.linkwechat.wecom.domain.WeMsgTlpScope;
import com.linkwechat.wecom.service.IWeMsgTlpScopeService;
/**
* 模板使用人员范围Service业务层处理
*
* @author ruoyi
* @date 2020-10-04
*/
@Service
public class WeMsgTlpScopeServiceImpl implements IWeMsgTlpScopeService
{
@Autowired
private WeMsgTlpScopeMapper weMsgTlpScopeMapper;
/**
* 查询模板使用人员范围
*
* @param id 模板使用人员范围ID
* @return 模板使用人员范围
*/
@Override
public WeMsgTlpScope selectWeMsgTlpScopeById(Long id)
{
return weMsgTlpScopeMapper.selectWeMsgTlpScopeById(id);
}
/**
* 查询模板使用人员范围列表
*
* @param weMsgTlpScope 模板使用人员范围
* @return 模板使用人员范围
*/
@Override
public List<WeMsgTlpScope> selectWeMsgTlpScopeList(WeMsgTlpScope weMsgTlpScope)
{
return weMsgTlpScopeMapper.selectWeMsgTlpScopeList(weMsgTlpScope);
}
/**
* 新增模板使用人员范围
*
* @param weMsgTlpScope 模板使用人员范围
* @return 结果
*/
@Override
public int insertWeMsgTlpScope(WeMsgTlpScope weMsgTlpScope)
{
return weMsgTlpScopeMapper.insertWeMsgTlpScope(weMsgTlpScope);
}
/**
* 修改模板使用人员范围
*
* @param weMsgTlpScope 模板使用人员范围
* @return 结果
*/
@Override
public int updateWeMsgTlpScope(WeMsgTlpScope weMsgTlpScope)
{
return weMsgTlpScopeMapper.updateWeMsgTlpScope(weMsgTlpScope);
}
/**
* 批量删除模板使用人员范围
*
* @param ids 需要删除的模板使用人员范围ID
* @return 结果
*/
@Override
public int deleteWeMsgTlpScopeByIds(Long[] ids)
{
return weMsgTlpScopeMapper.deleteWeMsgTlpScopeByIds(ids);
}
/**
* 删除模板使用人员范围信息
*
* @param id 模板使用人员范围ID
* @return 结果
*/
@Override
public int deleteWeMsgTlpScopeById(Long id)
{
return weMsgTlpScopeMapper.deleteWeMsgTlpScopeById(id);
}
/**
* 批量保存模板使用人员范围
* @param weMsgTlpScopes
* @return
*/
@Override
public int batchInsetWeMsgTlpScope(List<WeMsgTlpScope> weMsgTlpScopes) {
return weMsgTlpScopeMapper.batchInsetWeMsgTlpScope(weMsgTlpScopes);
}
/**
* 通过使用者id,批量删除
* @param useUserIds
* @return
*/
@Override
public int batchRemoveWeMsgTlpScopesByMsgTlpIds(List<Long> useUserIds) {
return weMsgTlpScopeMapper.batchRemoveWeMsgTlpScopesByMsgTlpIds(useUserIds);
}
}
package com.linkwechat.wecom.service.impl;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.collection.ListUtil;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.wecom.domain.WeMsgTlpScope;
import com.linkwechat.wecom.service.IWeMsgTlpScopeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.linkwechat.wecom.mapper.WeMsgTlpMapper;
import com.linkwechat.wecom.domain.WeMsgTlp;
import com.linkwechat.wecom.service.IWeMsgTlpService;
import org.springframework.transaction.annotation.Transactional;
/**
* 欢迎语模板Service业务层处理
*
* @author ruoyi
* @date 2020-10-04
*/
@Service
public class WeMsgTlpServiceImpl implements IWeMsgTlpService
{
@Autowired
private WeMsgTlpMapper weMsgTlpMapper;
@Autowired
private IWeMsgTlpScopeService iWeMsgTlpScopeService;
/**
* 查询欢迎语模板
*
* @param id 欢迎语模板ID
* @return 欢迎语模板
*/
@Override
public WeMsgTlp selectWeMsgTlpById(Long id)
{
return weMsgTlpMapper.selectWeMsgTlpById(id);
}
/**
* 查询欢迎语模板列表
*
* @param weMsgTlp 欢迎语模板
* @return 欢迎语模板
*/
@Override
public List<WeMsgTlp> selectWeMsgTlpList(WeMsgTlp weMsgTlp)
{
return weMsgTlpMapper.selectWeMsgTlpList(weMsgTlp);
}
/**
* 新增欢迎语模板
*
* @param weMsgTlp 欢迎语模板
* @return 结果
*/
@Override
@Transactional
public int insertWeMsgTlp(WeMsgTlp weMsgTlp)
{
int returnCode = weMsgTlpMapper.insertWeMsgTlp(weMsgTlp);
if(returnCode>0){
List<WeMsgTlpScope> weMsgTlpScopes=weMsgTlp.getWeMsgTlpScopes().stream().filter(c -> c.getUseUserId() != null).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(weMsgTlpScopes)){
weMsgTlpScopes.forEach(v->{
v.setMsgTlpId(weMsgTlp.getId());
v.setId(SnowFlakeUtil.nextId());
});
iWeMsgTlpScopeService.batchInsetWeMsgTlpScope(weMsgTlpScopes);
}
}
return returnCode;
}
/**
* 修改欢迎语模板
*
* @param weMsgTlp 欢迎语模板
* @return 结果
*/
@Override
@Transactional
public int updateWeMsgTlp(WeMsgTlp weMsgTlp)
{
int returnCode = weMsgTlpMapper.updateWeMsgTlp(weMsgTlp);
if(returnCode>0){
iWeMsgTlpScopeService.batchRemoveWeMsgTlpScopesByMsgTlpIds(ListUtil.toList(weMsgTlp.getId()));
List<WeMsgTlpScope> weMsgTlpScopes = weMsgTlp.getWeMsgTlpScopes().stream().filter(c -> c.getUseUserId() != null).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(weMsgTlpScopes)){
weMsgTlpScopes.stream().forEach(v->v.setMsgTlpId(weMsgTlp.getId()));
iWeMsgTlpScopeService.batchInsetWeMsgTlpScope(weMsgTlpScopes);
}
}
return weMsgTlpMapper.updateWeMsgTlp(weMsgTlp);
}
/**
* 批量删除欢迎语模板
*
* @param ids 需要删除的欢迎语模板ID
* @return 结果
*/
@Override
public int deleteWeMsgTlpByIds(Long[] ids)
{
return weMsgTlpMapper.deleteWeMsgTlpByIds(ids);
}
/**
* 删除欢迎语模板信息
*
* @param id 欢迎语模板ID
* @return 结果
*/
@Override
public int deleteWeMsgTlpById(Long id)
{
return weMsgTlpMapper.deleteWeMsgTlpById(id);
}
/**
* 批量逻辑删除
* @param msgTlpIds
* @return
*/
@Override
public int batchRemoveByids(List<Long> msgTlpIds) {
return weMsgTlpMapper.batchRemoveByids(msgTlpIds);
}
}
...@@ -94,7 +94,7 @@ public class WeUserServiceImpl implements IWeUserService ...@@ -94,7 +94,7 @@ public class WeUserServiceImpl implements IWeUserService
); );
if(!WeConstans.WE_SUCCESS_CODE.equals(weResultDto.getErrcode())){ if(!WeConstans.WE_SUCCESS_CODE.equals(weResultDto.getErrcode())){
throw new WeComException(weResultDto.getErrmsg()); throw new WeComException(weResultDto.getErrcode(),weResultDto.getErrmsg());
} }
} }
...@@ -119,7 +119,7 @@ public class WeUserServiceImpl implements IWeUserService ...@@ -119,7 +119,7 @@ public class WeUserServiceImpl implements IWeUserService
); );
if(!WeConstans.WE_SUCCESS_CODE.equals(weResultDto.getErrcode())){ if(!WeConstans.WE_SUCCESS_CODE.equals(weResultDto.getErrcode())){
throw new WeComException(weResultDto.getErrmsg()); throw new WeComException(weResultDto.getErrcode(),weResultDto.getErrmsg());
} }
} }
......
<?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.linkwechat.wecom.mapper.WeEmpleCodeMapper">
<resultMap type="WeEmpleCode" id="WeEmpleCodeResult">
<result property="id" column="id" />
<result property="codeType" column="code_type" />
<result property="isJoinConfirmFriends" column="is_join_confirm_friends" />
<result property="activityScene" column="activity_scene" />
<result property="welcomeMsg" column="welcome_msg" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectWeEmpleCodeVo">
select id, code_type, is_join_confirm_friends, activity_scene, welcome_msg, create_by, create_time, del_flag from we_emple_code
</sql>
<select id="selectWeEmpleCodeList" parameterType="WeEmpleCode" resultMap="WeEmpleCodeResult">
<include refid="selectWeEmpleCodeVo"/>
<where>
<if test="codeType != null "> and code_type = #{codeType}</if>
<if test="isJoinConfirmFriends != null "> and is_join_confirm_friends = #{isJoinConfirmFriends}</if>
<if test="activityScene != null and activityScene != ''"> and activity_scene = #{activityScene}</if>
<if test="welcomeMsg != null "> and welcome_msg = #{welcomeMsg}</if>
</where>
</select>
<select id="selectWeEmpleCodeById" parameterType="Long" resultMap="WeEmpleCodeResult">
<include refid="selectWeEmpleCodeVo"/>
where id = #{id}
</select>
<insert id="insertWeEmpleCode" parameterType="WeEmpleCode">
insert into we_emple_code
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="codeType != null">code_type,</if>
<if test="isJoinConfirmFriends != null">is_join_confirm_friends,</if>
<if test="activityScene != null">activity_scene,</if>
<if test="welcomeMsg != null">welcome_msg,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="codeType != null">#{codeType},</if>
<if test="isJoinConfirmFriends != null">#{isJoinConfirmFriends},</if>
<if test="activityScene != null">#{activityScene},</if>
<if test="welcomeMsg != null">#{welcomeMsg},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateWeEmpleCode" parameterType="WeEmpleCode">
update we_emple_code
<trim prefix="SET" suffixOverrides=",">
<if test="codeType != null">code_type = #{codeType},</if>
<if test="isJoinConfirmFriends != null">is_join_confirm_friends = #{isJoinConfirmFriends},</if>
<if test="activityScene != null">activity_scene = #{activityScene},</if>
<if test="welcomeMsg != null">welcome_msg = #{welcomeMsg},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeEmpleCodeById" parameterType="Long">
delete from we_emple_code where id = #{id}
</delete>
<delete id="deleteWeEmpleCodeByIds" parameterType="String">
delete from we_emple_code where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="batchRemoveWeEmpleCodeIds">
update we_emple_code set
del_flag = 2
where id in
<foreach collection="ids" item="id" index="index"
separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.linkwechat.wecom.mapper.WeEmpleCodeTagMapper">
<resultMap type="WeEmpleCodeTag" id="WeEmpleCodeTagResult">
<result property="id" column="id" />
<result property="tagId" column="tag_id" />
<result property="empleCodeId" column="emple_code_id" />
<result property="delFlag" column="del_flag" />
<result property="tagName" column="name" />
</resultMap>
<sql id="selectWeEmpleCodeTagVo">
select id, tag_id, emple_code_id, del_flag from we_emple_code_tag
</sql>
<select id="selectWeEmpleCodeTagListById" parameterType="Long" resultMap="WeEmpleCodeTagResult">
SELECT
wect.id,
wect.tag_id,
wect.emple_code_id,
wect.del_flag,
wt.`name`
FROM
we_emple_code_tag wect
LEFT JOIN we_tag wt ON wt.id=wect.tag_id
WHERE wect.del_flag=0 and wect.emple_code_id=#{empleCodeId}
</select>
<select id="selectWeEmpleCodeTagById" parameterType="Long" resultMap="WeEmpleCodeTagResult">
<include refid="selectWeEmpleCodeTagVo"/>
where id = #{id}
</select>
<insert id="insertWeEmpleCodeTag" parameterType="WeEmpleCodeTag">
insert into we_emple_code_tag
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="tagId != null">tag_id,</if>
<if test="empleCodeId != null">emple_code_id,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="tagId != null">#{tagId},</if>
<if test="empleCodeId != null">#{empleCodeId},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateWeEmpleCodeTag" parameterType="WeEmpleCodeTag">
update we_emple_code_tag
<trim prefix="SET" suffixOverrides=",">
<if test="tagId != null">tag_id = #{tagId},</if>
<if test="empleCodeId != null">emple_code_id = #{empleCodeId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeEmpleCodeTagById" parameterType="Long">
delete from we_emple_code_tag where id = #{id}
</delete>
<delete id="deleteWeEmpleCodeTagByIds" parameterType="String">
delete from we_emple_code_tag where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchInsetWeEmpleCodeTag">
insert into we_emple_code_tag (id,tag_id,emple_code_id,del_flag)
values
<foreach collection="weEmpleCodeTags" item="scop" index="index" separator=",">
(#{scop.id},#{scop.tagId},#{scop.empleCodeId},#{scop.delFlag})
</foreach>
</insert>
<update id="batchRemoveWeEmpleCodeTagIds">
update we_emple_code_tag set
del_flag = 2
where emple_code_id in
<foreach collection="ids" item="id" index="index"
separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.linkwechat.wecom.mapper.WeEmpleCodeUseScopMapper">
<resultMap type="WeEmpleCodeUseScop" id="WeEmpleCodeUseScopResult">
<result property="id" column="id" />
<result property="empleCodeId" column="emple_code_id" />
<result property="useUserId" column="use_user_id" />
<result property="delFlag" column="del_flag" />
<result property="userUserName" column="user_name"/>
</resultMap>
<sql id="selectWeEmpleCodeUseScopVo">
select id, emple_code_id, use_user_id, del_flag from we_emple_code_use_scop
</sql>
<select id="selectWeEmpleCodeUseScopListById" parameterType="Long" resultMap="WeEmpleCodeUseScopResult">
SELECT
wecus.id, wecus.emple_code_id,wecus.use_user_id,wu.user_name
FROM
we_emple_code_use_scop wecus
LEFT JOIN we_user wu ON wu.id = wecus.use_user_id
WHERE
wecus.del_flag = 0
AND wecus.emple_code_id=#{empleCodeId}
</select>
<select id="selectWeEmpleCodeUseScopById" parameterType="Long" resultMap="WeEmpleCodeUseScopResult">
<include refid="selectWeEmpleCodeUseScopVo"/>
where id = #{id}
</select>
<insert id="insertWeEmpleCodeUseScop" parameterType="WeEmpleCodeUseScop">
insert into we_emple_code_use_scop
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="empleCodeId != null">emple_code_id,</if>
<if test="useUserId != null">use_user_id,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="empleCodeId != null">#{empleCodeId},</if>
<if test="useUserId != null">#{useUserId},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateWeEmpleCodeUseScop" parameterType="WeEmpleCodeUseScop">
update we_emple_code_use_scop
<trim prefix="SET" suffixOverrides=",">
<if test="empleCodeId != null">emple_code_id = #{empleCodeId},</if>
<if test="useUserId != null">use_user_id = #{useUserId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeEmpleCodeUseScopById" parameterType="Long">
delete from we_emple_code_use_scop where id = #{id}
</delete>
<delete id="deleteWeEmpleCodeUseScopByIds" parameterType="String">
delete from we_emple_code_use_scop where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchInsetWeEmpleCodeUseScop">
insert into we_emple_code_use_scop (id,emple_code_id,use_user_id,del_flag)
values
<foreach collection="weEmpleCodeUseScops" item="scop" index="index" separator=",">
(#{scop.id},#{scop.empleCodeId},#{scop.useUserId},#{scop.delFlag})
</foreach>
</insert>
<update id="batchRemoveWeEmpleCodeUseScopIds">
update we_emple_code_use_scop set
del_flag = 2
where emple_code_id in
<foreach collection="array" item="id" index="index"
separator="," open="(" close=")">
#{id}
</foreach>
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.linkwechat.wecom.mapper.WeGroupCodeActualMapper">
<resultMap type="WeGroupCodeActual" id="WeGroupCodeActualResult">
<result property="id" column="id" />
<result property="actualGroupQrCode" column="actual_group_qr_code" />
<result property="groupName" column="group_name" />
<result property="effectTime" column="effect_time" />
<result property="scanCodeTimesLimit" column="scan_code_times_limit" />
<result property="groupCodeId" column="group_code_id" />
<result property="scanCodeTimes" column="scan_code_times" />
<result property="delFlag" column="del_flag" />
<result property="status" column="status" />
</resultMap>
<sql id="selectWeGroupCodeActualVo">
select id, actual_group_qr_code, group_name, effect_time, scan_code_times_limit, group_code_id, scan_code_times, del_flag, status from we_group_code_actual
</sql>
<select id="selectWeGroupCodeActualList" parameterType="WeGroupCodeActual" resultMap="WeGroupCodeActualResult">
<include refid="selectWeGroupCodeActualVo"/>
<where>
<if test="actualGroupQrCode != null and actualGroupQrCode != ''"> and actual_group_qr_code = #{actualGroupQrCode}</if>
<if test="groupName != null and groupName != ''"> and group_name like concat('%', #{groupName}, '%')</if>
<if test="effectTime != null "> and effect_time = #{effectTime}</if>
<if test="scanCodeTimesLimit != null "> and scan_code_times_limit = #{scanCodeTimesLimit}</if>
<if test="groupCodeId != null "> and group_code_id = #{groupCodeId}</if>
<if test="scanCodeTimes != null "> and scan_code_times = #{scanCodeTimes}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectWeGroupCodeActualById" parameterType="Long" resultMap="WeGroupCodeActualResult">
<include refid="selectWeGroupCodeActualVo"/>
where id = #{id}
</select>
<insert id="insertWeGroupCodeActual" parameterType="WeGroupCodeActual">
insert into we_group_code_actual
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="actualGroupQrCode != null">actual_group_qr_code,</if>
<if test="groupName != null">group_name,</if>
<if test="effectTime != null">effect_time,</if>
<if test="scanCodeTimesLimit != null">scan_code_times_limit,</if>
<if test="groupCodeId != null">group_code_id,</if>
<if test="scanCodeTimes != null">scan_code_times,</if>
<if test="delFlag != null">del_flag,</if>
<if test="status != null">status,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="actualGroupQrCode != null">#{actualGroupQrCode},</if>
<if test="groupName != null">#{groupName},</if>
<if test="effectTime != null">#{effectTime},</if>
<if test="scanCodeTimesLimit != null">#{scanCodeTimesLimit},</if>
<if test="groupCodeId != null">#{groupCodeId},</if>
<if test="scanCodeTimes != null">#{scanCodeTimes},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="status != null">#{status},</if>
</trim>
</insert>
<update id="updateWeGroupCodeActual" parameterType="WeGroupCodeActual">
update we_group_code_actual
<trim prefix="SET" suffixOverrides=",">
<if test="actualGroupQrCode != null">actual_group_qr_code = #{actualGroupQrCode},</if>
<if test="groupName != null">group_name = #{groupName},</if>
<if test="effectTime != null">effect_time = #{effectTime},</if>
<if test="scanCodeTimesLimit != null">scan_code_times_limit = #{scanCodeTimesLimit},</if>
<if test="groupCodeId != null">group_code_id = #{groupCodeId},</if>
<if test="scanCodeTimes != null">scan_code_times = #{scanCodeTimes},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="status != null">status = #{status},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeGroupCodeActualById" parameterType="Long">
delete from we_group_code_actual where id = #{id}
</delete>
<delete id="deleteWeGroupCodeActualByIds" parameterType="String">
delete from we_group_code_actual where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.linkwechat.wecom.mapper.WeGroupCodeMapper">
<resultMap type="WeGroupCode" id="WeGroupCodeResult">
<result property="id" column="id" />
<result property="activityHeadUrl" column="activity_head_url" />
<result property="activityName" column="activity_name" />
<result property="activityScene" column="activity_scene" />
<result property="guide" column="guide" />
<result property="joinGroupIsTip" column="join_group_is_tip" />
<result property="tipMsg" column="tip_msg" />
<result property="customerServerQrCode" column="customer_server_qr_code" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectWeGroupCodeVo">
select id, activity_head_url, activity_name, activity_scene, guide, join_group_is_tip, tip_msg, customer_server_qr_code, del_flag from we_group_code
</sql>
<select id="selectWeGroupCodeList" parameterType="WeGroupCode" resultMap="WeGroupCodeResult">
<include refid="selectWeGroupCodeVo"/>
<where>
<if test="activityHeadUrl != null and activityHeadUrl != ''"> and activity_head_url = #{activityHeadUrl}</if>
<if test="activityName != null and activityName != ''"> and activity_name like concat('%', #{activityName}, '%')</if>
<if test="activityScene != null and activityScene != ''"> and activity_scene = #{activityScene}</if>
<if test="guide != null and guide != ''"> and guide = #{guide}</if>
<if test="joinGroupIsTip != null "> and join_group_is_tip = #{joinGroupIsTip}</if>
<if test="tipMsg != null and tipMsg != ''"> and tip_msg = #{tipMsg}</if>
<if test="customerServerQrCode != null and customerServerQrCode != ''"> and customer_server_qr_code = #{customerServerQrCode}</if>
</where>
</select>
<select id="selectWeGroupCodeById" parameterType="Long" resultMap="WeGroupCodeResult">
<include refid="selectWeGroupCodeVo"/>
where id = #{id}
</select>
<insert id="insertWeGroupCode" parameterType="WeGroupCode">
insert into we_group_code
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="activityHeadUrl != null">activity_head_url,</if>
<if test="activityName != null">activity_name,</if>
<if test="activityScene != null">activity_scene,</if>
<if test="guide != null">guide,</if>
<if test="joinGroupIsTip != null">join_group_is_tip,</if>
<if test="tipMsg != null">tip_msg,</if>
<if test="customerServerQrCode != null">customer_server_qr_code,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="activityHeadUrl != null">#{activityHeadUrl},</if>
<if test="activityName != null">#{activityName},</if>
<if test="activityScene != null">#{activityScene},</if>
<if test="guide != null">#{guide},</if>
<if test="joinGroupIsTip != null">#{joinGroupIsTip},</if>
<if test="tipMsg != null">#{tipMsg},</if>
<if test="customerServerQrCode != null">#{customerServerQrCode},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateWeGroupCode" parameterType="WeGroupCode">
update we_group_code
<trim prefix="SET" suffixOverrides=",">
<if test="activityHeadUrl != null">activity_head_url = #{activityHeadUrl},</if>
<if test="activityName != null">activity_name = #{activityName},</if>
<if test="activityScene != null">activity_scene = #{activityScene},</if>
<if test="guide != null">guide = #{guide},</if>
<if test="joinGroupIsTip != null">join_group_is_tip = #{joinGroupIsTip},</if>
<if test="tipMsg != null">tip_msg = #{tipMsg},</if>
<if test="customerServerQrCode != null">customer_server_qr_code = #{customerServerQrCode},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeGroupCodeById" parameterType="Long">
delete from we_group_code where id = #{id}
</delete>
<delete id="deleteWeGroupCodeByIds" parameterType="String">
delete from we_group_code where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.linkwechat.wecom.mapper.WeMsgTlpMapper">
<resultMap type="WeMsgTlp" id="WeMsgTlpResult">
<result property="id" column="id" />
<result property="welcomeMsg" column="welcome_msg" />
<result property="mediaId" column="media_id" />
<result property="delFlag" column="del_flag" />
<result property="welcomeMsgTplType" column="welcome_msg_tpl_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectWeMsgTlpVo">
select id, welcome_msg, media_id, del_flag, welcome_msg_tpl_type,create_by,create_time from we_msg_tlp
</sql>
<select id="selectWeMsgTlpList" parameterType="WeMsgTlp" resultMap="WeMsgTlpResult">
<include refid="selectWeMsgTlpVo"/>
<where>
<if test="welcomeMsg != null and welcomeMsg != ''"> and welcome_msg like CONCAT('%',#{welcomeMsg,jdbcType=VARCHAR},'%') </if>
<if test="mediaId != null "> and media_id = #{mediaId}</if>
<if test="welcomeMsgTplType != null "> and welcome_msg_tpl_type = #{welcomeMsgTplType}</if>
<if test="delFlag != null ">and del_flag = #{delFlag}</if>
</where>
</select>
<select id="selectWeMsgTlpById" parameterType="Long" resultMap="WeMsgTlpResult">
<include refid="selectWeMsgTlpVo"/>
where id = #{id}
</select>
<insert id="insertWeMsgTlp" parameterType="WeMsgTlp">
insert into we_msg_tlp
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="welcomeMsg != null">welcome_msg,</if>
<if test="mediaId != null">media_id,</if>
<if test="delFlag != null">del_flag,</if>
<if test="welcomeMsgTplType != null">welcome_msg_tpl_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="welcomeMsg != null">#{welcomeMsg},</if>
<if test="mediaId != null">#{mediaId},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="welcomeMsgTplType != null">#{welcomeMsgTplType},</if>
</trim>
</insert>
<update id="updateWeMsgTlp" parameterType="WeMsgTlp">
update we_msg_tlp
<trim prefix="SET" suffixOverrides=",">
<if test="welcomeMsg != null">welcome_msg = #{welcomeMsg},</if>
<if test="mediaId != null">media_id = #{mediaId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="welcomeMsgTplType != null">welcome_msg_tpl_type = #{welcomeMsgTplType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeMsgTlpById" parameterType="Long">
delete from we_msg_tlp where id = #{id}
</delete>
<delete id="deleteWeMsgTlpByIds" parameterType="String">
delete from we_msg_tlp where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="batchRemoveByids">
update we_msg_tlp set
del_flag = 2
where id in
<foreach collection="msgTlpIds" item="msgTlpId" index="index"
separator="," open="(" close=")">
#{msgTlpId}
</foreach>
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
<?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.linkwechat.wecom.mapper.WeMsgTlpScopeMapper">
<resultMap type="WeMsgTlpScope" id="WeMsgTlpScopeResult">
<result property="id" column="id" />
<result property="msgTlpId" column="msg_tlp_id" />
<result property="useUserId" column="use_user_id" />
<result property="delFlag" column="del_flag" />
</resultMap>
<sql id="selectWeMsgTlpScopeVo">
select id, msg_tlp_id, use_user_id, del_flag from we_msg_tlp_scope
</sql>
<select id="selectWeMsgTlpScopeList" parameterType="WeMsgTlpScope" resultMap="WeMsgTlpScopeResult">
<include refid="selectWeMsgTlpScopeVo"/>
<where>
<if test="msgTlpId != null "> and msg_tlp_id = #{msgTlpId}</if>
<if test="useUserId != null "> and use_user_id = #{useUserId}</if>
</where>
</select>
<select id="selectWeMsgTlpScopeById" parameterType="Long" resultMap="WeMsgTlpScopeResult">
<include refid="selectWeMsgTlpScopeVo"/>
where id = #{id}
</select>
<insert id="insertWeMsgTlpScope" parameterType="WeMsgTlpScope">
insert into we_msg_tlp_scope
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="msgTlpId != null">msg_tlp_id,</if>
<if test="useUserId != null">use_user_id,</if>
<if test="delFlag != null">del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="msgTlpId != null">#{msgTlpId},</if>
<if test="useUserId != null">#{useUserId},</if>
<if test="delFlag != null">#{delFlag},</if>
</trim>
</insert>
<update id="updateWeMsgTlpScope" parameterType="WeMsgTlpScope">
update we_msg_tlp_scope
<trim prefix="SET" suffixOverrides=",">
<if test="msgTlpId != null">msg_tlp_id = #{msgTlpId},</if>
<if test="useUserId != null">use_user_id = #{useUserId},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteWeMsgTlpScopeById" parameterType="Long">
delete from we_msg_tlp_scope where id = #{id}
</delete>
<delete id="deleteWeMsgTlpScopeByIds" parameterType="String">
delete from we_msg_tlp_scope where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchInsetWeMsgTlpScope">
insert into we_msg_tlp_scope (id,msg_tlp_id,use_user_id,del_flag)
values
<foreach collection="weMsgTlpScopes" item="scop" index="index" separator=",">
(#{scop.id},#{scop.msgTlpId},#{scop.useUserId},#{scop.delFlag})
</foreach>
</insert>
<update id="batchRemoveWeMsgTlpScopesByMsgTlpIds">
update we_msg_tlp_scope set
del_flag = 2
where msgTlpId in
<foreach collection="msgTlpIds" item="msgTlpId" index="index"
separator="," open="(" close=")">
#{msgTlpId.msgTlpId}
</foreach>
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
...@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -29,7 +29,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectWeUserVo"> <sql id="selectWeUserVo">
select id, head_image_url as avatarMediaid, user_name as name, alias, user_id, gender, mobile, email, wx_account, department, position, is_leader_in_dept, join_time, enable, id_card, qq_account, telephone, address, birthday, remark, is_activate from we_user select id, head_image_url as avatarMediaid, user_name, alias, user_id, gender, mobile, email, wx_account, department, position, is_leader_in_dept, join_time, enable, id_card, qq_account, telephone, address, birthday, remark, is_activate from we_user
</sql> </sql>
<select id="selectWeUserList" parameterType="WeUser" resultMap="WeUserResult"> <select id="selectWeUserList" parameterType="WeUser" resultMap="WeUserResult">
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<lombok.version>1.16.18</lombok.version> <lombok.version>1.16.18</lombok.version>
<reflectasm.version>1.11.9</reflectasm.version> <reflectasm.version>1.11.9</reflectasm.version>
<hutool.version>5.4.1</hutool.version> <hutool.version>5.4.1</hutool.version>
<zxing.version>3.3.3</zxing.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
...@@ -221,6 +222,13 @@ ...@@ -221,6 +222,13 @@
<version>${hutool.version}</version> <version>${hutool.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>${zxing.version}</version>
</dependency>
</dependencies> </dependencies>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!