Commit 0e6b8355 authored by liqin's avatar liqin 💬

Merge branch 'master' of http://111.203.232.171:8888/licc/shop-mall into master

parents 16ce5021 39c85355
package cn.wisenergy.common.config;
/**
* Created by m1991 on 2021/3/10 17:27
*/
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
@Configuration
public class UploadConfig {
//显示声明CommonsMultipartResolver为mutipartResolver
@Bean(name = "multipartResolver")
public MultipartResolver multipartResolver() {
CommonsMultipartResolver resolver = new CommonsMultipartResolver();
resolver.setDefaultEncoding("UTF-8");
//resolveLazily属性启用是为了推迟文件解析,以在在UploadAction中捕获文件大小异常
resolver.setResolveLazily(true);
resolver.setMaxInMemorySize(40960);
//上传文件大小 5M 5*1024*1024
resolver.setMaxUploadSize(5 * 1024 * 1024);
return resolver;
}
}
......@@ -18,7 +18,7 @@ public class FileUtils {
public static boolean upload(MultipartFile file, String path, String fileName) {
//确定上传的文件名
String realPath = path + "\\" + fileName;
String realPath = path + fileName;
System.out.println("上传文件:" + realPath);
File dest = new File(realPath);
......
......@@ -2,11 +2,11 @@ package cn.wisenergy.mapper;
import cn.wisenergy.model.app.shopZx;
import cn.wisenergy.model.app.zxUserDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigInteger;
import java.util.List;
......@@ -26,5 +26,5 @@ public interface ShopZxMapper extends BaseMapper<shopZx> {
/**
* 查询资讯数据
*/
List<shopZx> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
List<zxUserDto> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
}
......@@ -44,33 +44,40 @@ public interface UsersMapper extends BaseMapper<User> {
List<User> getList(Map<String, Object> map);
List<User> findAll();
User findByName(String name);
String findPswByName(String UserName);
void save(User user);
/**
* 获取用户信息
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
User getByUserId(@Param("userId") String userId);
/**
* 获取用户信息
* 获取用户信息
*
* @param userId 用户id
* @return 用户信息
*/
Integer ByUserId(@Param("userId") String userId);
/**
* 获取用户信息
* 获取用户信息
*
* @param
* @return 用户信息
*/
Integer beInvitedCode1(@Param("beInvitedCode") String beInvitedCode);
/**
* 获取用户信息
* 获取用户信息
*
* @param beInvitedCode 用户被邀请码
* @return 用户信息
*/
......@@ -78,39 +85,46 @@ public interface UsersMapper extends BaseMapper<User> {
/**
* 获取黄金树以上会员用户
*
* @return
*/
List<User> getAllGoldUser();
/**
* 查询用户
*
* @param param
* @return
*/
public List<User> getUsersListByMap(Map<String,Object> param);
public List<User> getUsersListByMap(Map<String, Object> param);
//根据手机号查询用户Integer
User queryUsersByPhone(@Param("userId")String userId);
User queryUsersByPhone(@Param("userId") String userId);
//根据用户的推荐人邀请码比对推荐人的本人邀请码,查询推荐人的用户ID
Integer inviteCodeBeInvitedCode(@Param("beInvitedCode")Integer beInvitedCode);
Integer inviteCodeBeInvitedCode(@Param("beInvitedCode") Integer beInvitedCode);
/**
* 用户注册
*
* @param userId
* @param inviteCode
* @param beInvitedCode
* @param userLevel
*/
Integer save(@Param("userId")String userId, @Param("inviteCode") String inviteCode, @Param("beInvitedCode") String beInvitedCode, @Param("userLevel") Integer userLevel);
Integer insertbyint(@Param("userId")String userId, @Param("beInvitedCode") String beInvitedCode);
Integer save(@Param("userId") String userId, @Param("inviteCode") String inviteCode, @Param("beInvitedCode") String beInvitedCode, @Param("userLevel") Integer userLevel);
Integer insertbyint(@Param("userId") String userId, @Param("beInvitedCode") String beInvitedCode);
User edit1(int userLevel, String intiveCode, String userId);
Integer getuserIdById(@Param("userId") String userId);
User edit1(int userLevel, String intiveCode,String userId);
Integer BYQMById(@Param("userId") String userId);
Integer getuserIdById(@Param("userId")String userId);
Integer BYQMById(@Param("userId")String userId);
/**
* 根据userid获取获取所有的直接推荐人
*
* @param inviteCode 用户本人的邀请码
* @return 所有填写此人的邀请码的用户
*/
......@@ -118,8 +132,24 @@ public interface UsersMapper extends BaseMapper<User> {
/**
* 通过邀请码,获取用户信息
*
* @param inviteCode 邀请码
* @return 用户信息
*/
User queryByInviteCode(@Param("inviteCode") String inviteCode);
/**
* 通过用户等级,获取该等级用户列表
*
* @param userLevel 用户等级
* @return 等级用户列表
*/
List<User> getByLevel(@Param("userLevel") Integer userLevel);
/**
*
* @param
* @return
*/
User biInvitedCode1(@Param("inviteCode") String inviteCode);
}
......@@ -38,7 +38,7 @@
</insert>
<!--资讯内容倒叙查询-->
<select id="selectPage" parameterType="java.lang.Integer" resultType="cn.wisenergy.model.app.shopZx">
<select id="selectPage" parameterType="java.lang.Integer" resultType="cn.wisenergy.model.app.zxUserDto">
select
b.zx_id as zxid,
b.zx_url as zxUrl,
......@@ -50,7 +50,7 @@
a.user_id as userId,
a.head_image as headImage
from shop_zx b inner join user_info a ON a.invite_code=b.invite_code
WHERE zx_to_examine!=0
WHERE zx_to_examine != 1
order by zxid desc limit #{pageNum},#{pageSize}
</select>
......
......@@ -101,15 +101,15 @@
<include refid="table"/>
<where>
be_invited_code=1
<if test="createTime != null">
and(YEAR(create_time) = YEAR(#{createTime})
AND MONTH(create_time) = MONTH(#{createTime}))
</if>
<if test="createTime != null">
and(YEAR(create_time) = YEAR(#{createTime})
AND MONTH(create_time) = MONTH(#{createTime}))
</if>
</where>
order by create_time desc
</select>
<select id="getByUserId" resultType="cn.wisenergy.model.app.User">
<select id="getByUserId" resultType="cn.wisenergy.model.app.User" parameterType="string">
select
<include refid="cols_all"/>
from
......@@ -165,7 +165,8 @@
<!--用户注册-->
<insert id="save">
insert into user(user_id,invite_code,be_invited_code,user_level) value (#{userId},#{inviteCode},#{beInvitedCode},#{userLevel})
insert into user(user_id,invite_code,be_invited_code,user_level) value
(#{userId},#{inviteCode},#{beInvitedCode},#{userLevel})
</insert>
<insert id="insertbyint">
insert into user_info(user_id,be_invited_code) value (#{userId},#{beInvitedCode})
......@@ -173,7 +174,7 @@
<select id="queryUsersByPhone" resultType="cn.wisenergy.model.app.User">
select
<include refid="vals"/>
<include refid="vals"/>
from
<include refid="table"/>
<where>
......@@ -219,7 +220,7 @@
user_id=#{userId}
</where>
</select>
<update id="edit1" >
<update id="edit1">
update
user_info
<set>
......@@ -229,7 +230,7 @@
update_time =now()
</set>
<where>
user_id = #{userId}
user_id = #{userId}
</where>
</update>
......@@ -289,7 +290,7 @@
</if>
</select>
<!-- 获取当前用户的所有直接推荐人-->
<!-- 获取当前用户的所有直接推荐人-->
<select id="getByInviteCode" resultType="cn.wisenergy.model.app.User" parameterType="string">
select
<include refid="cols_all"/>
......@@ -311,5 +312,15 @@
</where>
</select>
<select id="getByLevel" resultType="cn.wisenergy.model.app.User">
select
<include refid="cols_all"/>
from
<include refid="table"/>
<where>
user_level=#{userLevel}
</where>
</select>
</mapper>
package cn.wisenergy.model.app;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......
package cn.wisenergy.model.app;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* Created by m1991 on 2021/3/10 20:29
*/
@Data
public class zxUserDto {
/**
* 手机号作为用户账号
*/
@TableField(exist = false)
@ApiModelProperty(name = "user_id", value = "用户id")
private String userId;
/**
* 资讯主键id
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_id", value = "资讯主键id")
private Integer zxid;
/**
* 视频存放地址
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_url", value = "视频/图片存放地址")
private String zxUrl;
/**
* 用户本人邀请码
*/
@TableField(exist = false)
@ApiModelProperty(name = "invite_code", value = "用户本人邀请码")
private String inviteCode;
/**
* 获赞数
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_likes", value = "获赞数")
private Integer zxLikes;
/**
* 审核字段
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_to_examine", value = "审核字段")
private Integer zxToExamine;
/**
* 资讯文字输入字段
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_field", value = "资讯文字输入字段")
private String zxField;
/**
* 用户发布地址
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_address", value = "用户发布地址")
private String zxAddress;
/**
* 资讯数据创建时间
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_date", value = "资讯数据创建时间")
private Long zxDate;
@TableField(exist = false)
private List<String> askImgList;
}
......@@ -16,6 +16,12 @@ public class UserAndRecommendVo {
@ApiModelProperty(value = "用户id", name = "userId")
private String userId;
/**
* 用户level
*/
@ApiModelProperty(value = "用户level", name = "userLevel")
private int userLevel;
/**
* 当月消费金额
*/
......
......@@ -46,6 +46,9 @@ public class AccountManager {
@Autowired
private TradeRecordMapper tradeRecordMapper;
@Autowired
private MonthManureMapper monthManureMapper;
private static final String PATTERN = "yyyy-MM";
......@@ -229,4 +232,40 @@ public class AccountManager {
}
return true;
}
/**
* 更新账户信息和保存交易流水记录、保存上月剩余月度肥料奖金
*
* @param accountInfoList 账户列表
* @param recordList 交易流水信息
*/
@Transactional(rollbackFor = Exception.class)
public Boolean updateAccountAddRecordAndManure(List<AccountInfo> accountInfoList,
List<TradeRecord> recordList,
MonthManure manure) {
//更新月收益
if (!CollectionUtils.isEmpty(accountInfoList)) {
for (AccountInfo accountInfo : accountInfoList) {
int count = accountMapper.updateById(accountInfo);
if (count == 0) {
return false;
}
}
}
//新增交易流水记录
if (!CollectionUtils.isEmpty(recordList)) {
for (TradeRecord tradeRecord : recordList) {
int count = tradeRecordMapper.add(tradeRecord);
if (count == 0) {
return false;
}
}
}
//新增上月剩余月度肥料奖金
int count = monthManureMapper.add(manure);
return count != 0;
}
}
......@@ -50,9 +50,4 @@ public interface AccountService {
* @return true or false
*/
R<Boolean> progressPrizeCount();
/**
* 账户表镜像---每月更新一次,保存上一个的数据
*/
void mirrorImage();
}
package cn.wisenergy.service.app;
import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.OrderInfo;
import java.util.List;
/**
*@ Description: 月定时任务接口定义
*@ Author : 86187
......@@ -6,4 +12,30 @@ package cn.wisenergy.service.app;
* @author 86187
*/
public interface MonthTaskService {
/**
* 订单返佣-月任务
* @return true or false
*/
R<Boolean> orderRebate();
/**
* 收益和业绩统计(月度肥料)-月任务
*
* @param list 订单信息
* @return true or false
*/
R<Boolean> performanceCount(List<OrderInfo> list);
/**
* 进步奖收益统计(最大进步奖) -月任务
*
* @return true or false
*/
R<Boolean> progressPrizeCount();
/**
* 账户表镜像---每月更新一次,保存上一个的数据
*/
void mirrorImage();
}
package cn.wisenergy.service.app;
import cn.wisenergy.model.app.shopZx;
import org.springframework.core.io.Resource;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.math.BigInteger;
import java.util.List;
import java.util.Map;
......@@ -39,6 +37,10 @@ public interface UploadService {
* @return
*/
List imageUpload( MultipartFile[] file, String zxField, String zxAddress,String inviteCode);
String storeFile(MultipartFile file);
Resource loadFileAsResource(String fileName);
......@@ -49,7 +51,7 @@ public interface UploadService {
* @param pageSize
* @return
*/
List<shopZx> selectPage(Integer pageNum, Integer pageSize);
Map selectPage(Integer pageNum, Integer pageSize);
}
......@@ -57,10 +57,10 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
private ProgressPrizeMapper progressPrizeMapper;
@Autowired
private LastAccountMapper lastAccountMapper;
private OrderMapper orderMapper;
@Autowired
private OrderMapper orderMapper;
private MonthManureMapper monthManureMapper;
private static final String PATTERN = "yyyy-MM";
......@@ -70,7 +70,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
public R<Boolean> orderRebate() {
//获取返佣订单
List<OrderInfo> list=orderMapper.getListBySuccessTime(new Date());
List<OrderInfo> list = orderMapper.getListBySuccessTime(new Date());
log.info("shop-mall[]AccountServiceImpl[]orderRebate[]input.param.list:{}", list.size());
if (CollectionUtils.isEmpty(list)) {
return R.ok(0, true);
......@@ -292,29 +292,6 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
return R.ok(0, true);
}
@Override
public void mirrorImage() {
//1、把账户表account_info复制给表account_image CREATE TABLE table_2 SELECT * FROM table_1;
lastAccountMapper.copyTable("account_info", "account_image");
//删除上月备份
lastAccountMapper.deleteTable("account_backup");
//备份
lastAccountMapper.copyTable("account_info", "account_backup");
//2、把上月账户表last_month_account 复制给month_account_image
lastAccountMapper.copyTable("last_month_account", "month_account_image");
//3、删除last_month_account
lastAccountMapper.deleteTable("last_month_account");
//4、把account_image 更名为 last_month_account rename table table_2 to table_1;
lastAccountMapper.updateTableName("account_image", "last_month_account");
//5、删除month_account_image DROP table table_2;
lastAccountMapper.deleteTable("month_account_image");
}
public void getUser(List<User> list, String userId) {
User user = usersMapper.getByUserId(userId);
......@@ -341,6 +318,17 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
double moneyMonth = Math.floor(total / 3980 / 12);
List<AccountInfo> accountInfoList = new ArrayList<>();
List<TradeRecord> tradeRecordList = new ArrayList<>();
//获取上月未分配完的奖金
double lastMonthAward;
Date last = DateUtil.getLastMonth(new Date());
String yearMonthTime = DateUtil.convertDateToStr(last, PATTERN);
MonthManure monthManure = monthManureMapper.queryByTime(yearMonthTime);
if (null == monthManure) {
lastMonthAward = 0.00;
} else {
lastMonthAward = monthManure.getManureAward();
}
for (User user : userList) {
if (moneyMonth != 0) {
//获取等级优惠百分比
......@@ -355,7 +343,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
double month = teamPerformance.getMonthTeamPerformance().doubleValue();
double percent = memberPercent.getPercent().doubleValue();
//计算收益
double income = moneyMonth * 3980 * percent * month / teamTotal;
double income = (moneyMonth + lastMonthAward) * 3980 * percent * month / teamTotal;
//获取账户信息
AccountInfo accountInfo = accountMapper.getByUserId(user.getUserId());
......@@ -371,7 +359,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
//5、添加交易流水记录
TradeRecord tradeRecord = new TradeRecord();
tradeRecord.setUserId(user.getUserId());
tradeRecord.setTradeType(TradeRecordEnum.ORDER_REBATE.getCode());
tradeRecord.setTradeType(TradeRecordEnum.MONTHLY_FERTILIZER.getCode());
tradeRecord.setTradeNo(null);
tradeRecord.setStatus(TradeStatusEnum.NO_SETTLE_ACCOUNTS.getCode());
tradeRecordList.add(tradeRecord);
......
......@@ -68,7 +68,7 @@ public class CustomerServiceServiceImpl implements CustomerServiceService {
file.transferTo(newFile);
//入库地址
String serviceUrl = basePath + "/upload/" + newName;
String serviceUrl = "/upload/" + newName;
CustomerService customerService = new CustomerService();
customerService.setWechatId(wechatId);
customerService.setWechatImgUrl(serviceUrl);
......
......@@ -4,6 +4,7 @@ import cn.wisenergy.mapper.OrderMapper;
import cn.wisenergy.model.app.OrderInfo;
import cn.wisenergy.service.app.OrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.youzan.cloud.open.sdk.common.exception.SDKException;
import com.youzan.cloud.open.sdk.core.client.auth.Token;
import com.youzan.cloud.open.sdk.core.client.core.DefaultYZClient;
......@@ -51,6 +52,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, OrderInfo> implem
* @return
* @throws SDKException
*/
@XxlJob(value = "YouZanOrdersjobhandler")
@Override
public void getYouZanOrdersForCreateTime() throws SDKException {
Token token = youzanToken();
......
......@@ -53,6 +53,7 @@ public class RecommendUserServiceImpl implements RecommendUserService {
List<UserAndRecommendVo> userAndRecommendVos = new ArrayList<>();
for (User user : byInviteCode) {
UserAndRecommendVo userAndRecommendVo = new UserAndRecommendVo();
userAndRecommendVo.setUserLevel(user.getUserLevel());
userAndRecommendVo.setHeadImage(user.getHeadImage());
userAndRecommendVo.setUserId(user.getUserId());
userAndRecommendVo.setMonthyCount(recommendUserMapper.getByUserId(userId).getMonthyCount());
......
......@@ -2,7 +2,8 @@ package cn.wisenergy.service.app.impl;
import cn.wisenergy.common.utils.*;
import cn.wisenergy.model.app.shopZx;
import cn.wisenergy.mapper.UsersMapper;
import cn.wisenergy.model.app.zxUserDto;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
......@@ -38,6 +39,9 @@ public class UploadServiceImpl implements UploadService {
@Autowired
private ShopZxMapper shopZxMapper;
@Autowired
private UsersMapper usersMapper;
@Value("${file.upload.path:#{null}}")
private String path;
......@@ -48,10 +52,10 @@ public class UploadServiceImpl implements UploadService {
public Map<String, Object> uploadVideo(MultipartFile file,HttpServletRequest request,String zxField,String zxAddress,String inviteCode) throws Exception {
Map<String, Object> resultMap=new HashMap<String, Object>();
/**
* http://路径
* http://路径 request.getScheme() + "://" + request.getServerName()
* + ":" + request.getServerPort()+/upload/";"
*/
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort()+"/upload/";
String basePath ="/upload/";
Long time = new Date().getTime();
String fileName = file.getOriginalFilename();//文件原始名称
......@@ -105,8 +109,10 @@ public class UploadServiceImpl implements UploadService {
*/
Long zxDate= Long.valueOf(System.currentTimeMillis());
String basePath = request.getScheme() + "://" + request.getServerName()
+ ":" + request.getServerPort()+"/mimi/upload/images/";
// request.getScheme() + "://" + request.getServerName()
// + ":" + request.getServerPort()+"/upload/";
String basePath = "/upload/";
Long time = System.currentTimeMillis();
......@@ -115,7 +121,6 @@ public class UploadServiceImpl implements UploadService {
String newzxName = time+suffixName; //文件新名称
//设置文件存储路径,可以存放在你想要指定的路径里面
String rootPath="/opt/upload/video/"; //上传图片存放位置
String filePath = rootPath+newzxName;
File newFile = new File(filePath);
//判断目标文件所在目录是否存在
......@@ -135,48 +140,50 @@ public class UploadServiceImpl implements UploadService {
return resultMap;
}
/**
* 多图片
* @param files
* @param zxField
* @param zxAddress
* @param inviteCode
* @return
*/
@Override
public List imageUpload(MultipartFile[] files, String zxField, String zxAddress,String inviteCode) {
/**
* 生成当前时间戳
*/
Long zxDate= Long.valueOf(System.currentTimeMillis());
//获取上传图片数量,打印在控制台
System.out.println("上传图片数量" + files.length);
//创建集合
List<Map<String, Object>> root = new ArrayList<Map<String, Object>>();
String fileName=null;
String fileName1=null;
String zxUrl=null;
// 要上传的目标文件存放的绝对路径
final String localPath = path;
// final String localPath = path;
Long time = new Date().getTime();
String localPath = "/upload/";
Map<String, Object> result = new HashMap<String, Object>();//一个文件上传的结果
String result_msg = "";//上传结果信息
//遍历图片数据
for (MultipartFile file : files) {
// Map<String, Object> result = new HashMap<String, Object>();//一个文件上传的结果
if (file.isEmpty()) {
System.out.println("上传图片为空,请重新上传");
}
//判断上传文件格式
String fileType = file.getContentType();
if (fileType.equals("image/jpeg") || fileType.equals("image/png")) {
// 要上传的目标文件存放的绝对路径
//上传后保存的文件名(需要防止图片重名导致的文件覆盖)
//获取文件名
fileName = file.getOriginalFilename();
fileName1 = file.getOriginalFilename();
//获取文件后缀名
String suffixName = fileName.substring(fileName.lastIndexOf("."));
String suffixName = fileName1.substring(fileName1.lastIndexOf("."));
//重新生成文件名
fileName = UUID.randomUUID() + suffixName;
String fileName ="1"+UUID.randomUUID()+suffixName;//文件新名称
//设置文件存储路径,可以存放在你想要指定的路径里面
String Path="/opt/upload/video/"; //上传图片存放位置
zxUrl+=localPath+fileName+",";
// shopZxMapper.zxadd(zxUrl,userId,zxName,zxField,imgUrl,zxAddress);
if (FileUtils.upload(file, localPath, fileName)) {
if (FileUtils.upload(file,Path, fileName)) {
//文件存放的相对路径(一般存放在数据库用于img标签的src)
String relativePath = "img/" + fileName;
String relativePath ="用于判断是否图片上传成功,返回值有:"+fileName;
result.put("relativePath", relativePath);//前端根据是否存在该字段来判断上传是否成功
result_msg = "图片上传成功";
result.put("zxUrl", zxUrl);
......@@ -194,6 +201,10 @@ public class UploadServiceImpl implements UploadService {
String root_json = JSON.toJSONString(root);
System.out.println(root_json);
result.put("returnCode", 0);
/**
* 生成当前时间戳
*/
Long zxDate= Long.valueOf(System.currentTimeMillis());
shopZxMapper.zxadd(zxUrl,zxField,zxAddress,inviteCode, zxDate);
return root;
}
......@@ -259,19 +270,21 @@ public class UploadServiceImpl implements UploadService {
* 资讯文件展示
*/
@Override
public List selectPage(Integer pageNum, Integer pageSize) {
List<shopZx> shopZxList = shopZxMapper.selectPage(pageNum,pageSize);
for (shopZx shopZx : shopZxList) {
public Map selectPage(Integer pageNum, Integer pageSize) {
Map map = new HashMap();
List<zxUserDto> shopZxList = shopZxMapper.selectPage(pageNum,pageSize);
for (zxUserDto shopZx : shopZxList) {
String zxUrl = shopZx.getZxUrl();
;
shopZx.setUserId(shopZx.getUserId().replaceAll("(\\d{3})\\d{4}(\\d{4})","$1****$2"));
String[] split = StringUtils.split(zxUrl, ",");
if (null != split){
List<String> strings = Arrays.asList(split);
shopZx.setAskImgList(strings);
}
}
return shopZxList;
}
map.put("data",shopZxList);
return map;
}
}
package cn.wisenergy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.servlet.MultipartAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
......
......@@ -22,9 +22,9 @@ public class LastAccountController {
@Autowired
private AccountService accountService;
@ApiOperation(value = "复制表-结构和数据", notes = "复制表-结构和数据", httpMethod = "PUT")
@PutMapping("/add")
public void copyTable(){
accountService.mirrorImage();
}
// @ApiOperation(value = "复制表-结构和数据", notes = "复制表-结构和数据", httpMethod = "PUT")
// @PutMapping("/add")
// public void copyTable(){
// accountService.mirrorImage();
// }
}
package cn.wisenergy.web.admin.controller.app;
import cn.wisenergy.common.utils.PageRequest;
import cn.wisenergy.common.utils.Result;
import cn.wisenergy.model.app.shopZx;
import cn.wisenergy.service.app.UploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
......@@ -94,7 +91,7 @@ public class UploadController {
@ApiImplicitParam(name = "inviteCode", value = "用户本人邀请码(发布人)", required = true, dataType = "String")})
@RequestMapping(method = RequestMethod.POST, value = "/multipleImageUpload", headers = "content-type=multipart/form-data")
public List multipleImageUpload(@RequestParam(value = "files") MultipartFile[] files, String zxField, String zxAddress,String inviteCode) {
public List multipleImageUpload(@RequestParam(required=false,value = "files") MultipartFile[] files, String zxField, String zxAddress,String inviteCode) {
return uploadService.imageUpload(files, zxField, zxAddress,inviteCode);
}
......@@ -109,7 +106,8 @@ public class UploadController {
@ApiImplicitParam(name = "pageNum", value = "从几开始", required = true,dataType = "integer"),
@ApiImplicitParam(name = "pageSize", value = "一页展示数量", required = true, dataType = "Integger")})
@RequestMapping(method = RequestMethod.GET, value = "/zxAll")
public List<shopZx> selectPage(int pageNum, int pageSize){
public Map selectPage(int pageNum, int pageSize){
return uploadService.selectPage(pageNum,pageSize);
}
}
\ No newline at end of file
......@@ -62,7 +62,7 @@ uploadFile:
location: /opt/images/upload_flowChart/ #自定义上传文件服务器硬盘保存路径 ,linux服务器保存路径 /home/changfa/app/wxbjgkpt/upload_flowChart/
file:
upload:
path: /opt/upload/video/
path: /opt/upload/
jwt:
# 加密秘钥
secret: f4e2e52034348f86b67cde581c0f9eb5
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment