Commit e987ed22 by 水库浪子

企业用户登录系统客户数据权限处理;素材分类删除BUG修复;素材上传BUG修复

1 parent 10685b72
package com.linkwechat.web.controller.wecom; package com.linkwechat.web.controller.wecom;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.annotation.Log; import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
import com.linkwechat.common.core.controller.BaseController; import com.linkwechat.common.core.controller.BaseController;
...@@ -78,21 +79,23 @@ public class WeCategoryController extends BaseController { ...@@ -78,21 +79,23 @@ public class WeCategoryController extends BaseController {
/** /**
* 删除类目 * 删除类目
*/ */
// @PreAuthorize("@ss.hasPermi('wechat:category:remove')") // @PreAuthorize("@ss.hasPermi('wechat:category:remove')") Constants.DELETE_CODE
@Log(title = "删除类目", businessType = BusinessType.DELETE) @Log(title = "删除类目", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
@ApiOperation("删除类目") @ApiOperation("删除类目")
public AjaxResult remove(@PathVariable Long[] ids) { public AjaxResult remove(@PathVariable Long[] ids) {
List<WeCategory> categorys=new ArrayList<>(); weCategoryService.deleteWeCategoryById(ids);
for (Long id:ids) { // List<WeCategory> categorys=new ArrayList<>();
categorys.add( // for (Long id:ids) {
WeCategory.builder() // categorys.add(
.id(id) // WeCategory.builder()
.delFlag(Constants.DELETE_CODE) // .id(id)
.build() // .delFlag("55")
); // .build()
} // );
weCategoryService.updateBatchById(categorys); // }
// weCategoryService.updateBatchById(categorys);
return AjaxResult.success(); return AjaxResult.success();
} }
......
...@@ -154,7 +154,7 @@ public class WeMaterialController extends BaseController { ...@@ -154,7 +154,7 @@ public class WeMaterialController extends BaseController {
// weMediaDto.setFileName(file.getResource().getFilename()); // weMediaDto.setFileName(file.getResource().getFilename());
WeMaterialFileVO weMaterialFileVO = materialService.uploadWeMaterialFile(file, MediaType.IMAGE.getType()); WeMaterialFileVO weMaterialFileVO = materialService.uploadWeMaterialFile(file, MediaType.IMAGE.getType());
weMediaDto.setFileName(weMaterialFileVO.getMaterialName()); weMediaDto.setFileName(weMaterialFileVO.getMaterialName());
weMediaDto.setUrl(weMaterialFileVO.getMaterialUrl()); weMediaDto.setUrl(weMaterialFileVO.getMaterialUrl()+weMaterialFileVO.getMaterialName());
return AjaxResult.success(weMediaDto); return AjaxResult.success(weMediaDto);
} }
......
...@@ -102,9 +102,9 @@ spring: ...@@ -102,9 +102,9 @@ spring:
druid: druid:
# 主库数据源 # 主库数据源
master: master:
url: jdbc:mysql://127.0.0.1:3306/link-wechat-prod?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 url: jdbc:mysql://127.0.0.1:10179/lw-test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root username: root
password: 123456 password: root
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
...@@ -247,8 +247,8 @@ xss: ...@@ -247,8 +247,8 @@ xss:
elasticsearch: elasticsearch:
schema: http schema: http
address: address:
userName: userName: "elastic"
password: password: "0p-0p-0p-"
connectTimeout: 10000 connectTimeout: 10000
socketTimeout: 10000 socketTimeout: 10000
connectionRequestTimeout: 10000 connectionRequestTimeout: 10000
...@@ -323,13 +323,13 @@ wecome: ...@@ -323,13 +323,13 @@ wecome:
- we_tag_group - we_tag_group
#企微回调通知配置 #企微回调通知配置
callBack: callBack:
appIdOrCorpId: ww38152475d1bca752 appIdOrCorpId:
token: Fm05d6n0NpuFrvOlgVxIbeSXtjgz token:
encodingAesKey: laevP8xCEG7BUqv5GuYXfg9HaRecxe4MU5F5cmnAI7n encodingAesKey:
# JS SDK 身份校验url # JS SDK 身份校验url
authorizeUrl: https://open.weixin.qq.com/connect/oauth2/authorize authorizeUrl:
# JS SDK身份校验成功后的redirect url # JS SDK身份校验成功后的redirect url
authorizeRedirectUrl: http://linkwechat.cn/mobile/#/task authorizeRedirectUrl:
weixin: weixin:
appid: appid:
......
...@@ -50,6 +50,9 @@ public class SysUser extends BaseEntity ...@@ -50,6 +50,9 @@ public class SysUser extends BaseEntity
/** 用户类型(00系统用户)(11:企业微信用户) */ /** 用户类型(00系统用户)(11:企业微信用户) */
private String userType; private String userType;
/**当前微信用户对应微信端的id*/
private String weUserId;
/** 用户邮箱 */ /** 用户邮箱 */
@Excel(name = "用户邮箱") @Excel(name = "用户邮箱")
private String email; private String email;
......
package com.linkwechat.framework.web.service; package com.linkwechat.framework.web.service;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.linkwechat.common.config.RuoYiConfig; import com.linkwechat.common.config.RuoYiConfig;
import com.linkwechat.common.constant.Constants; import com.linkwechat.common.constant.Constants;
...@@ -26,6 +27,7 @@ import org.springframework.security.core.userdetails.UserDetailsService; ...@@ -26,6 +27,7 @@ import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -71,7 +73,7 @@ public class UserDetailsServiceImpl implements UserDetailsService ...@@ -71,7 +73,7 @@ public class UserDetailsServiceImpl implements UserDetailsService
if (StringUtils.isNull(user)) if (StringUtils.isNull(user))
{ {
// //查询企业管理相关账号 //查询企业管理相关账号
WeCorpAccount weCorpByAccount = iWeCorpAccountService.getOne(new LambdaQueryWrapper<WeCorpAccount>().eq(WeCorpAccount::getCorpAccount, username) WeCorpAccount weCorpByAccount = iWeCorpAccountService.getOne(new LambdaQueryWrapper<WeCorpAccount>().eq(WeCorpAccount::getCorpAccount, username)
.eq(WeCorpAccount::getDelFlag, Constants.NORMAL_CODE)); .eq(WeCorpAccount::getDelFlag, Constants.NORMAL_CODE));
if(null != weCorpByAccount){ if(null != weCorpByAccount){
...@@ -87,31 +89,31 @@ public class UserDetailsServiceImpl implements UserDetailsService ...@@ -87,31 +89,31 @@ public class UserDetailsServiceImpl implements UserDetailsService
.build(); .build();
} else{ } else{
//we_user表中去查询,如果该表为空则提示用户不存在,如果不为空,则将用户记录注册到系统用户表中 //we_user表中去查询,如果该表为空则提示用户不存在,如果不为空,则将用户记录注册到系统用户表中
WeUser weUser WeUser weUser=iWeUserService.getOne(new LambdaQueryWrapper<WeUser>()
= new WeUser(); .eq(WeUser::getMobile,username)
try { .ne(WeUser::getIsActivate,new Integer(6)));
weUser=iWeUserService.getOne(new LambdaQueryWrapper<WeUser>()
.eq(WeUser::getUserId,username));
}catch (Exception e){
e.printStackTrace();
}
if(null == weUser){ if(null == weUser){
throw new BaseException("对不起,您的账号:" + username + " 不存在"); throw new BaseException("对不起,您的账号:" + username + " 不存在");
} }
if(StrUtil.isBlank(weUser.getMobile())){
throw new BaseException("请填写当前企业员工的手机号:" + username + " 然后再登录");
}
//注册到we_user表中 //注册到we_user表中
user=SysUser.builder() user=SysUser.builder()
.userName(weUser.getUserId()) .userName(username)
.nickName(weUser.getName()) .nickName(weUser.getName())
.userType(Constants.USER_TYPE_WECOME) .userType(Constants.USER_TYPE_WECOME)
.email(weUser.getEmail()) .email(weUser.getEmail())
.phonenumber(weUser.getMobile()) .phonenumber(weUser.getMobile())
.sex(weUser.getGender() ==0 ? "1": weUser.getGender() .toString()) .sex(weUser.getGender() ==0 ? "1": weUser.getGender() .toString())
.avatar(weUser.getAvatarMediaid()) .avatar(weUser.getAvatarMediaid())
.weUserId(weUser.getUserId())
.roleIds(ArrayUtil.toArray(iSysRoleService.selectRoleList(SysRole.builder() .roleIds(ArrayUtil.toArray(iSysRoleService.selectRoleList(SysRole.builder()
.roleKey(Constants.DEFAULT_WECOME_ROLE_KEY) .roleKey(Constants.DEFAULT_WECOME_ROLE_KEY)
.build()).stream().map(SysRole::getRoleId).collect(Collectors.toList()), Long.class)) .build()).stream().map(SysRole::getRoleId).collect(Collectors.toList()), Long.class))
.password(SecurityUtils.encryptPassword(ruoYiConfig.getWeUserDefaultPwd())) .password(SecurityUtils.encryptPassword(ruoYiConfig.getWeUserDefaultPwd()))
.build(); .build();
} }
if(user != null){ if(user != null){
......
...@@ -50,7 +50,7 @@ public class SysRoleServiceImpl implements ISysRoleService ...@@ -50,7 +50,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 角色数据集合信息 * @return 角色数据集合信息
*/ */
@Override @Override
@DataScope(deptAlias = "d") // @DataScope(deptAlias = "d")
public List<SysRole> selectRoleList(SysRole role) public List<SysRole> selectRoleList(SysRole role)
{ {
return roleMapper.selectRoleList(role); return roleMapper.selectRoleList(role);
......
...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="weUserId" column="we_user_id" />
<result property="userType" column="user_type"/> <result property="userType" column="user_type"/>
<association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, select u.user_id, u.we_user_id,u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,u.user_type, d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,u.user_type,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
...@@ -57,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -57,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</sql> </sql>
<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u select u.user_id,u.we_user_id,u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d on u.dept_id = d.dept_id
where u.del_flag = '0' where u.del_flag = '0'
<if test="userName != null and userName != ''"> <if test="userName != null and userName != ''">
...@@ -119,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -119,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="userType != null and userType != ''">user_type,</if> <if test="userType != null and userType != ''">user_type,</if>
<if test="weUserId != null and weUserId != ''">we_user_id,</if>
create_time create_time
)values( )values(
<if test="userId != null and userId != ''">#{userId},</if> <if test="userId != null and userId != ''">#{userId},</if>
...@@ -134,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -134,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="userType != null and userType != ''">#{userType},</if> <if test="userType != null and userType != ''">#{userType},</if>
<if test="weUserId != null and weUserId != ''">#{weUserId},</if>
sysdate() sysdate()
) )
</insert> </insert>
......
...@@ -7,5 +7,5 @@ import org.apache.ibatis.annotations.Param; ...@@ -7,5 +7,5 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
public interface WeCategoryMapper extends BaseMapper<WeCategory> { public interface WeCategoryMapper extends BaseMapper<WeCategory> {
void deleteWeCategoryById(Long[] ids);
} }
...@@ -34,6 +34,8 @@ public interface IWeCategoryService extends IService<WeCategory> { ...@@ -34,6 +34,8 @@ public interface IWeCategoryService extends IService<WeCategory> {
*/ */
List<? extends Tree<?>> findWeCategoryByMediaType(@Param("mediaType") String mediaType); List<? extends Tree<?>> findWeCategoryByMediaType(@Param("mediaType") String mediaType);
void deleteWeCategoryById(Long[] ids);
} }
...@@ -34,7 +34,7 @@ public class WeCategoryServiceImpl extends ServiceImpl<WeCategoryMapper,WeCatego ...@@ -34,7 +34,7 @@ public class WeCategoryServiceImpl extends ServiceImpl<WeCategoryMapper,WeCatego
if (null != weCategory) { if (null != weCategory) {
throw new WeComException("名称已存在!"); throw new WeComException("名称已存在!");
} }
category.setCreateTime(DateUtil.date()); // category.setCreateTime(DateUtil.date());
category.setId(SnowFlakeUtil.nextId()); category.setId(SnowFlakeUtil.nextId());
this.save(category); this.save(category);
} }
...@@ -50,7 +50,7 @@ public class WeCategoryServiceImpl extends ServiceImpl<WeCategoryMapper,WeCatego ...@@ -50,7 +50,7 @@ public class WeCategoryServiceImpl extends ServiceImpl<WeCategoryMapper,WeCatego
if (null != weCategory) { if (null != weCategory) {
throw new WeComException("名称已存在!"); throw new WeComException("名称已存在!");
} }
category.setUpdateTime(DateUtil.date()); // category.setUpdateTime(DateUtil.date());
this.updateById(category); this.updateById(category);
} }
...@@ -74,6 +74,10 @@ public class WeCategoryServiceImpl extends ServiceImpl<WeCategoryMapper,WeCatego ...@@ -74,6 +74,10 @@ public class WeCategoryServiceImpl extends ServiceImpl<WeCategoryMapper,WeCatego
return TreeUtil.build(weCategoryVos); return TreeUtil.build(weCategoryVos);
} }
@Override
public void deleteWeCategoryById(Long[] ids) {
this.baseMapper.deleteWeCategoryById(ids);
}
} }
...@@ -117,7 +117,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -117,7 +117,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
//当前登录用户为企业用户 //当前登录用户为企业用户
if(Constants.USER_TYPE_WECOME if(Constants.USER_TYPE_WECOME
.equals(SecurityUtils.getLoginUser().getUser().getUserType())){ .equals(SecurityUtils.getLoginUser().getUser().getUserType())){
weCustomer.setUserIds((SecurityUtils.getLoginUser().getUser().getUserName())); weCustomer.setUserIds((SecurityUtils.getLoginUser().getUser().getWeUserId()));
} }
return weCustomerMapper.selectWeCustomerList(weCustomer); return weCustomerMapper.selectWeCustomerList(weCustomer);
...@@ -478,7 +478,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto ...@@ -478,7 +478,7 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
public List<WeUser> getCustomersByUserId(String externalUserid) { public List<WeUser> getCustomersByUserId(String externalUserid) {
String userId=null; String userId=null;
if(Constants.USER_TYPE_WECOME.equals(SecurityUtils.getLoginUser().getUser().getUserType())){ if(Constants.USER_TYPE_WECOME.equals(SecurityUtils.getLoginUser().getUser().getUserType())){
userId=SecurityUtils.getLoginUser().getUser().getUserName(); userId=SecurityUtils.getLoginUser().getUser().getWeUserId();
} }
return this.baseMapper.getCustomersByUserId(externalUserid,userId); return this.baseMapper.getCustomersByUserId(externalUserid,userId);
} }
......
...@@ -46,7 +46,7 @@ public class WeMaterialServiceImpl implements IWeMaterialService { ...@@ -46,7 +46,7 @@ public class WeMaterialServiceImpl implements IWeMaterialService {
private WeMediaClient weMediaClient; private WeMediaClient weMediaClient;
@Autowired @Autowired
private CosConfig cosConfig; private RuoYiConfig ruoYiConfig;
@Override @Override
public WeMaterialFileVO uploadWeMaterialFile(MultipartFile file, String type) { public WeMaterialFileVO uploadWeMaterialFile(MultipartFile file, String type) {
...@@ -79,7 +79,7 @@ public class WeMaterialServiceImpl implements IWeMaterialService { ...@@ -79,7 +79,7 @@ public class WeMaterialServiceImpl implements IWeMaterialService {
//构造返回结果 //构造返回结果
// return WeMaterialFileVO.builder().materialUrl(url).materialName(file.getOriginalFilename()).build(); // return WeMaterialFileVO.builder().materialUrl(url).materialName(file.getOriginalFilename()).build();
return WeMaterialFileVO.builder().materialUrl(cosConfig.getImgUrlPrefix()).materialName(FileUploadUtils.upload2Cos(file, cosConfig)).build(); return WeMaterialFileVO.builder().materialUrl(ruoYiConfig.getFile().getImgUrlPrefix()).materialName(FileUploadUtils.upload2Cos(file, ruoYiConfig.getFile().getCos())).build();
} catch (Exception e) { } catch (Exception e) {
throw new WeComException(e.getMessage()); throw new WeComException(e.getMessage());
} }
......
...@@ -2,6 +2,7 @@ package com.linkwechat.wecom.service.impl; ...@@ -2,6 +2,7 @@ package com.linkwechat.wecom.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.config.CosConfig; import com.linkwechat.common.config.CosConfig;
import com.linkwechat.common.config.RuoYiConfig;
import com.linkwechat.common.config.ServerConfig; import com.linkwechat.common.config.ServerConfig;
import com.linkwechat.common.utils.file.FileUploadUtils; import com.linkwechat.common.utils.file.FileUploadUtils;
import com.linkwechat.common.utils.img.ImageUtils; import com.linkwechat.common.utils.img.ImageUtils;
...@@ -15,6 +16,7 @@ import com.linkwechat.wecom.service.IWePosterFontService; ...@@ -15,6 +16,7 @@ import com.linkwechat.wecom.service.IWePosterFontService;
import com.linkwechat.wecom.service.IWePosterService; import com.linkwechat.wecom.service.IWePosterService;
import com.linkwechat.wecom.service.IWePosterSubassemblyService; import com.linkwechat.wecom.service.IWePosterSubassemblyService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
...@@ -37,23 +39,27 @@ import java.util.stream.Collectors; ...@@ -37,23 +39,27 @@ import java.util.stream.Collectors;
@Service @Service
public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> implements IWePosterService { public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> implements IWePosterService {
@Resource // @Resource
private WePosterMapper wePosterMapper; // private WePosterMapper wePosterMapper;
@Resource @Autowired
private IWePosterSubassemblyService posterSubassemblyService; private IWePosterSubassemblyService posterSubassemblyService;
@Resource @Autowired
private IWePosterFontService posterFontService; private IWePosterFontService posterFontService;
@Resource
private ServerConfig serverConfig;
@Resource @Autowired
private IWeCategoryService weCategoryService; private RuoYiConfig ruoYiConfig;
@Resource // @Resource
private CosConfig cosConfig; // private ServerConfig serverConfig;
//
// @Resource
// private IWeCategoryService weCategoryService;
// @Resource
// private CosConfig cosConfig;
/** /**
* 查询一条 * 查询一条
...@@ -136,6 +142,8 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i ...@@ -136,6 +142,8 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
.collect(Collectors.toMap(wePosterSubassembly -> { .collect(Collectors.toMap(wePosterSubassembly -> {
return wePosterSubassembly.getFontId() + "_" + wePosterSubassembly.getFontSize() + "_" + wePosterSubassembly.getFontStyle(); return wePosterSubassembly.getFontId() + "_" + wePosterSubassembly.getFontSize() + "_" + wePosterSubassembly.getFontStyle();
}, wePosterSubassembly -> posterFontService.getFont(wePosterSubassembly.getFontId(), wePosterSubassembly.getFontSize(), wePosterSubassembly.getFontStyle()))); }, wePosterSubassembly -> posterFontService.getFont(wePosterSubassembly.getFontId(), wePosterSubassembly.getFontSize(), wePosterSubassembly.getFontStyle())));
Map<String, NetFileUtils.FileCallable> fileCallableMap = poster.getPosterSubassemblyList().stream().map(WePosterSubassembly::getImgPath).filter(StringUtils::isNotBlank).distinct().collect(Collectors.toMap(s -> s, NetFileUtils::getNetFile)); Map<String, NetFileUtils.FileCallable> fileCallableMap = poster.getPosterSubassemblyList().stream().map(WePosterSubassembly::getImgPath).filter(StringUtils::isNotBlank).distinct().collect(Collectors.toMap(s -> s, NetFileUtils::getNetFile));
if (CollectionUtils.isEmpty(fileCallableMap)) { if (CollectionUtils.isEmpty(fileCallableMap)) {
fileCallableMap = new HashMap<>(); fileCallableMap = new HashMap<>();
...@@ -193,8 +201,8 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i ...@@ -193,8 +201,8 @@ public class WePosterServiceImpl extends ServiceImpl<WePosterMapper, WePoster> i
ImageIO.write(backgroundImg, "png", byteArrayOutputStream); ImageIO.write(backgroundImg, "png", byteArrayOutputStream);
NetFileUtils.StreamMultipartFile streamMultipartFile = new NetFileUtils.StreamMultipartFile(System.currentTimeMillis() + ".jpg", byteArrayOutputStream.toByteArray()); NetFileUtils.StreamMultipartFile streamMultipartFile = new NetFileUtils.StreamMultipartFile(System.currentTimeMillis() + ".jpg", byteArrayOutputStream.toByteArray());
byteArrayOutputStream.close(); byteArrayOutputStream.close();
String path = FileUploadUtils.upload2Cos(streamMultipartFile, cosConfig); String path = FileUploadUtils.upload2Cos(streamMultipartFile, ruoYiConfig.getFile().getCos());
poster.setSampleImgPath(cosConfig.getImgUrlPrefix() + path); poster.setSampleImgPath(ruoYiConfig.getFile().getImgUrlPrefix() + path);
return poster.getSampleImgPath(); return poster.getSampleImgPath();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -5,4 +5,14 @@ ...@@ -5,4 +5,14 @@
<mapper namespace="com.linkwechat.wecom.mapper.WeCategoryMapper"> <mapper namespace="com.linkwechat.wecom.mapper.WeCategoryMapper">
<select id="deleteWeCategoryById">
UPDATE we_category
set del_flag=2
<where>
id in
<foreach collection="array" open="(" close=")" item="item" separator=",">
#{item}
</foreach>
</where>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -276,7 +276,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wfcrf.flower_customer_rel_id, wfcrf.flower_customer_rel_id,
wt.tag_id, wt.tag_id,
wt.create_time, wt.create_time,
DISTINCT wt.`name` as tagName, wt.`name` as tagName,
(SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department (SELECT GROUP_CONCAT(wd.`name`) FROM we_department wd WHERE wd.id=wu.department) as department
FROM FROM
we_customer wc we_customer wc
......
This diff could not be displayed because it is too large.
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!