Commit be7a3994 by 18356073052

修改素材上传逻辑

1 parent b98cd09f
......@@ -61,8 +61,6 @@ public class WeConstans {
public static final Integer LEAVE_NO_ALLOCATE_STATE = 0;
/**
* 离职已分配分配
*/
......@@ -72,28 +70,25 @@ public class WeConstans {
/**
* 已激活
*/
public static final Integer WE_USER_IS_ACTIVATE=1;
public static final Integer WE_USER_IS_ACTIVATE = 1;
/**
* 已禁用
*/
public static final Integer WE_USER_IS_FORBIDDEN=2;
public static final Integer WE_USER_IS_FORBIDDEN = 2;
/**
* 已离职
*/
public static final Integer WE_USER_IS_LEAVE=6;
public static final Integer WE_USER_IS_LEAVE = 6;
/**
* 未激活
*/
public static final Integer WE_USER_IS_NO_ACTIVATE=4;
public static final Integer WE_USER_IS_NO_ACTIVATE = 4;
/**
......@@ -123,57 +118,57 @@ public class WeConstans {
/**
* 在小程序中联系场景
*/
public static final Integer SMALL_ROUTINE_EMPLE_CODE_SCENE=1;
public static final Integer SMALL_ROUTINE_EMPLE_CODE_SCENE = 1;
/**
* 通过二维码联系场景
*/
public static final Integer QR_CODE_EMPLE_CODE_SCENE=2;
public static final Integer QR_CODE_EMPLE_CODE_SCENE = 2;
/**
* 微信接口相应端错误字段
*/
public static final String WE_ERROR_FIELD="errcode";
public static final String WE_ERROR_FIELD = "errcode";
/**
* 递归
*/
public static final Integer YES_IS_RECURSION=0;
public static final Integer YES_IS_RECURSION = 0;
/**
* 获取所有子部门数据
*/
public static final Integer DEPARTMENT_SUB_WEUSER=1;
public static final Integer DEPARTMENT_SUB_WEUSER = 1;
/**
* 获取当前部门
*/
public static final Integer DEPARTMENT_CURRENT_WEUSER=0;
public static final Integer DEPARTMENT_CURRENT_WEUSER = 0;
/**
* 通讯录用户激活
*/
public static final Integer YES_IS_ACTIVATE=1;
public static final Integer YES_IS_ACTIVATE = 1;
/**
* 通讯录用户未激活
*/
public static final Integer NO_IS_ACTIVATE=2;
public static final Integer NO_IS_ACTIVATE = 2;
/**
* 不存在外部联系人的关系
* 不存在外部联系人的关系
*/
public static final Integer NOT_EXIST_CONTACT=84061;
public static final Integer NOT_EXIST_CONTACT = 84061;
public static final String COMMA = ",";
}
......@@ -32,7 +32,7 @@ public enum MediaType {
this.mediaType = mediaType;
}
public static Optional<MediaType> of(String type){
return Stream.of(values()).filter(s->s.type.equals(type)).findFirst();
public static Optional<MediaType> of(String type) {
return Stream.of(values()).filter(s -> s.type.equals(type)).findFirst();
}
}
package com.linkwechat.wecom.service.impl;
import cn.hutool.core.date.DateUtil;
import com.linkwechat.common.core.domain.Tree;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.TreeUtil;
import com.linkwechat.wecom.domain.WeCategory;
import com.linkwechat.wecom.domain.vo.WeCategoryVo;
......@@ -28,6 +30,8 @@ public class WeCategoryServiceImpl implements IWeCategoryService {
if (null != weCategory) {
throw new WeComException("名称已存在!");
}
category.setCreateTime(DateUtil.date());
category.setId(SnowFlakeUtil.nextId());
return weCategoryMapper.insertWeCategory(category);
}
......@@ -38,6 +42,7 @@ public class WeCategoryServiceImpl implements IWeCategoryService {
if (null != weCategory) {
throw new WeComException("名称已存在!");
}
category.setUpdateTime(DateUtil.date());
return weCategoryMapper.updateWeCategory(category);
}
......
package com.linkwechat.wecom.service.impl;
import cn.hutool.core.date.DateUtil;
import com.linkwechat.common.config.RuoYiConfig;
import com.linkwechat.common.config.ServerConfig;
import com.linkwechat.common.enums.MediaType;
import com.linkwechat.common.exception.wecom.WeComException;
import com.linkwechat.common.utils.SnowFlakeUtil;
import com.linkwechat.common.utils.file.FileUploadUtils;
import com.linkwechat.wecom.domain.WeMaterial;
import com.linkwechat.wecom.domain.vo.WeMaterialFileVO;
......@@ -60,6 +62,8 @@ public class WeMaterialServiceImpl implements IWeMaterialService {
@Override
public int insertWeMaterial(WeMaterial weMaterial) {
weMaterial.setCreateTime(DateUtil.date());
weMaterial.setId(SnowFlakeUtil.nextId());
return weMaterialMapper.insertWeMaterial(weMaterial);
}
......@@ -75,6 +79,7 @@ public class WeMaterialServiceImpl implements IWeMaterialService {
@Override
public int updateWeMaterial(WeMaterial weMaterial) {
weMaterial.setCreateTime(DateUtil.date());
return weMaterialMapper.updateWeMaterial(weMaterial);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!