Commit c1dcc266 authored by codezwjava's avatar codezwjava

Merge remote-tracking branch 'origin/master'

parents 6d29445b 74862b8b
......@@ -2,6 +2,7 @@ package cn.wisenergy.mapper;
import cn.wisenergy.model.app.shopZx;
import cn.wisenergy.model.dto.ZxUserDto;
import cn.wisenergy.model.vo.ShopZxUserVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
......@@ -34,7 +35,7 @@ public interface ShopZxMapper extends BaseMapper<shopZx> {
/**
* 倒叙查询资讯与用户发布数据
*/
List<ShopZxUserVo> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
List<ZxUserDto> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
//
// /**
// * 用于查询资讯单表全部信息
......
......@@ -55,7 +55,8 @@
<!--资讯内容倒叙查询-->
<select id="selectPage" parameterType="java.lang.Integer" resultType="cn.wisenergy.model.vo.UserVo">
<!--资讯内容倒叙查询-->
<select id="selectPage" parameterType="java.lang.Integer" resultType="cn.wisenergy.model.dto.ZxUserDto">
select
b.zx_id as zxid,
b.zx_url as zxUrl,
......@@ -68,7 +69,6 @@
from shop_zx b left join user_info a ON a.invite_code=b.invite_code
WHERE zx_to_examine != 0
AND a.user_id !=0
and a.user_id !=null
order by zxid desc limit #{pageNum},#{pageSize}
</select>
<!--资讯总记录数查询-->
......
......@@ -113,9 +113,9 @@
date_format(create_time,'%Y-%m') as yearMonth
FROM
<include refid="table"/>
WHERE date_format(create_time,'%Y-%m') &lt; date_format(now(),'%Y-%m')
and date_format(create_time,'%Y-%m') >= date_format(now() - interval 7 month,'%Y-%m')
and (status=1 or status=3)
WHERE date_format(create_time,'%Y-%m') &lt;= date_format(now(),'%Y-%m')
and date_format(create_time,'%Y-%m') >= date_format(now() - interval 5 month,'%Y-%m')
and (status=1 or status=0)
and user_id=#{userId}
group by user_id ,create_time;
</select>
......
package cn.wisenergy.model.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* Created by m1991 on 2021/3/29 15:38
*/
@Data
public class ZxUserDto {
/**
* 手机号作为用户账号
*/
@TableField(exist = false)
@ApiModelProperty(name = "user_id", value = "用户id")
private String userId;
/*
* 用户头像
*/
@TableField(exist = false)
@ApiModelProperty(name = "headImage", value = "用户头像")
private String headImage;
/**
* 资讯主键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;
@ApiModelProperty(name = "liked_status", value = "点赞状态")
private Integer likedStatus;
/**
* 资讯文字输入字段
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_field", value = "资讯文字输入字段")
private String zxField;
/**
* 资讯数据创建时间
*/
@TableField(exist = false)
@ApiModelProperty(name = "zx_date", value = "资讯数据创建时间")
private Long zxDate;
@TableField(exist = false)
private List<String> askImgList;
}
......@@ -12,17 +12,17 @@ public enum TradeRecordEnum {
*/
WITHDRAW_DEPOSIT(1, "提现"),
ORDER_REBATE(2, "订单返佣"),
ORDER_REBATE(2, "返佣奖"),
PLACE_ORDER(3, "订单下单"),
MONTHLY_FERTILIZER(4, "月度肥料"),
MONTHLY_FERTILIZER(4, "月度肥料"),
CULTIVATING_PRIZE(5, "培育奖"),
SALARY_REWARD(6, "工资奖励"),
PROGRESS_PRIZE(7, "最大进步奖"),
PROGRESS_PRIZE(7, "进步奖"),
RUN_CENTER_SUBSIDY(8, "运营中心补贴");
private Integer code;
......
......@@ -29,9 +29,9 @@ public class MoneyPackageDetailVo {
List<IncomeDetailVo> list;
/**
* 累计收益
* 本月累计收益
*/
@ApiModelProperty(value = "累计收益", name = "totalIncome")
@ApiModelProperty(value = "本月累计收益", name = "totalIncome")
private BigDecimal totalIncome;
......
......@@ -52,7 +52,7 @@ public interface UploadService {
* @param pageSize
* @return
*/
Map selectPage(Integer pageNum, Integer pageSize,String inviteCode);
Map selectPage(int pageNum, int pageSize,String inviteCode);
/**
* TODO 资讯单表分页全部信息展示
......
......@@ -95,7 +95,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
if (!tradeRecord.getTradeNo().equals(version)) {
return R.ok(DOWNLOAD_URL);
}
return R.ok("当前已是最新版本!");
return R.error(1, "当前已是最新版本!");
}
/**
......
......@@ -198,13 +198,6 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
BigDecimal frozenMoney = accountInfo.getFrozenMoney().add(money);
accountInfo.setFrozenMoney(frozenMoney);
BigDecimal earningsMonth = accountInfo.getEarningsMonth().subtract(money);
accountInfo.setEarningsMonth(earningsMonth);
BigDecimal earningsTotal = accountInfo.getEarningsTotal().subtract(money);
accountInfo.setEarningsTotal(earningsTotal);
//4、添加提现交易流水记录
TradeRecord tradeRecord = new TradeRecord();
tradeRecord.setUserId(accountInfo.getUserId());
......
......@@ -10,6 +10,7 @@ import cn.wisenergy.mapper.UsersMapper;
import cn.wisenergy.mapper.userLikesMapper;
import cn.wisenergy.model.app.*;
import cn.wisenergy.model.dto.ShopZxUserDto;
import cn.wisenergy.model.dto.ZxUserDto;
import cn.wisenergy.model.vo.ShopZxUserVo;
import com.github.pagehelper.PageInfo;
import org.springframework.core.io.Resource;
......@@ -180,7 +181,7 @@ public class UploadServiceImpl implements UploadService {
//过滤传入的邀请码带有“”的符号
inviteCode = inviteCode.replace("\"", "").replace("\"", "");
//获取上传图片数量,打印在控制台
if(null!=files&&"".equals(files)){
if(null!=files&&!"".equals(files)){
System.out.println("上传图片数量" + files.length);
//创建集合
List<Map<String, Object>> root = new ArrayList<Map<String, Object>>();
......@@ -191,11 +192,11 @@ public class UploadServiceImpl implements UploadService {
Map<String, Object> result = new HashMap<String, Object>();//一个文件上传的结果
String msg = "";//上传结果信息
//上传图片不为空时
long sa = 0;
for (MultipartFile file : files) {
sa = file.getSize();
}
if (sa > 0) {
// long sa = 0;
// for (MultipartFile file : files) {
// sa = file.getSize();
// }
if (null!=files&&!"".equals(files)) {
//遍历图片数据
for (MultipartFile file : files) {
......@@ -263,13 +264,13 @@ public class UploadServiceImpl implements UploadService {
// zxUrl="0";
shopZxMapper.zxadd(zxUrl, zxField, inviteCode, zxDate);
//图片与文字都为null的时候,给前端返回提示!
} else {
} else
if (null == files && null == zxField) {
map.put("code", 1);
map.put("msg", "上传资讯不能为空,请重新上传!");
return map;
}
}
map.put("code", 0);
map.put("msg", "资讯上传成功!");
return map;
......@@ -334,20 +335,28 @@ public class UploadServiceImpl implements UploadService {
* 资讯文件展示
*/
@Override
public Map selectPage(Integer pageNum, Integer pageSize, String inviteCode) {
public Map selectPage(int pageNum, int pageSize, String inviteCode) {
Map map = new HashMap();
pageNum = pageNum - 1;
List<ShopZxUserVo> shopZxList = shopZxMapper.selectPage(pageNum, pageSize);
List<ZxUserDto> shopZxList = shopZxMapper.selectPage(pageNum,pageSize);
for (ZxUserDto shopZx : shopZxList) {
for (ShopZxUserVo shopZx : shopZxList) {
String[] zxUrl = shopZx.getZxUrl().split(",");
ArrayList list = new ArrayList();
if (null != zxUrl) {
if (!"".equals(zxUrl)) {
for (String split : zxUrl) {
if ("".equals(split)){
shopZx.setAskImgList(null);
}else {
boolean arrayList = Collections.addAll(list, split);
shopZx.setAskImgList(list);
}
}
}
int likedId = shopZx.getZxid();
if (shopZx.getUserId() == null && "" != shopZx.getUserId()) {
......@@ -374,6 +383,7 @@ public class UploadServiceImpl implements UploadService {
}
}
}
map.put("data", shopZxList);
return map;
}
......@@ -407,6 +417,8 @@ public class UploadServiceImpl implements UploadService {
return R.ok(info);
}
/**
* 分页处理方法
*
......
......@@ -132,7 +132,7 @@ public class WalletServiceImpl implements WalletService {
MoneyPackageDetailVo detailVo = new MoneyPackageDetailVo();
detailVo.setUserId(userId);
detailVo.setTotalIncome(accountInfo.getEarningsTotal());
detailVo.setTotalIncome(accountInfo.getEarningsMonth());
//获取本月交易记录
List<TradeRecord> list = getTradeRecordList(userId);
......
This diff is collapsed.
......@@ -102,11 +102,11 @@ public class UploadController {
* @param pageSize
* @return
*/
@ApiOperation(value = "用户发布已审核资讯信息倒叙展示", notes = "倒叙展示", httpMethod = "POST", produces = "application/json; charset=UTF-8")
@ApiOperation(value = "用户发布已审核资讯信息倒叙展示", notes = "倒叙展示")
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "从几开始", required = true,dataType = "integer"),
@ApiImplicitParam(name = "inviteCode", value = "用户本人邀请码(发布人)", required = false, dataType = "String"),
@ApiImplicitParam(name = "pageSize", value = "一页展示数量", required = true, dataType = "Integger")})
@ApiImplicitParam(name = "pageNum", value = "从几开始", required = true,dataType = "Integer"),
@ApiImplicitParam(name = "pageSize", value = "一页展示数量", required = true, dataType = "Integer")})
@RequestMapping(method = RequestMethod.GET, value = "/zxAll")
public Map selectPage(int pageNum, int pageSize,String inviteCode){
......
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