Commit faadb547 by xunj

优化

1 parent 118d015c
package com.polysoft.activity.config.exception;
import javax.servlet.http.HttpServletResponse;
/**
* @author by zhangbr
* @date 2020/4/20.
*/
public class BusinessException extends Exception {
private static final long serialVersionUID = 1L;
private Integer statusCode;
public BusinessException() {
super ();
this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
}
public BusinessException(String message) {
super (message);
this.statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
}
public BusinessException(Integer statusCode, String message) {
super (message);
this.statusCode = statusCode;
}
public BusinessException(Long statusCode, String message) {
super (message);
this.statusCode = Integer.parseInt(statusCode.toString());
}
public Integer getStatusCode() {
return statusCode;
}
public void setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
}
}
...@@ -3,6 +3,7 @@ package com.polysoft.activity.controller; ...@@ -3,6 +3,7 @@ package com.polysoft.activity.controller;
import com.polysoft.activity.constant.CommonTypeEnum; import com.polysoft.activity.constant.CommonTypeEnum;
import com.polysoft.activity.mapper.ActivityMapper; import com.polysoft.activity.mapper.ActivityMapper;
import com.polysoft.activity.model.dto.AddRedRainDto; import com.polysoft.activity.model.dto.AddRedRainDto;
import com.polysoft.activity.service.ActItemService;
import com.polysoft.activity.utils.ApiResult; import com.polysoft.activity.utils.ApiResult;
import com.polysoft.activity.utils.SnowFlakeUtil; import com.polysoft.activity.utils.SnowFlakeUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -26,23 +27,14 @@ import java.util.Date; ...@@ -26,23 +27,14 @@ import java.util.Date;
public class TestController { public class TestController {
@Resource @Resource
private ActivityMapper activityMapper; private ActItemService actItemService;
@GetMapping("/testOne" ) @GetMapping("/testOne" )
@ResponseBody @ResponseBody
public ApiResult testOne(@RequestParam(value = "amount") double amount) { public ApiResult testOne() throws Exception {
AddRedRainDto rainDto = new AddRedRainDto();
rainDto.setRedId(SnowFlakeUtil.nextId());
rainDto.setUserId(152L);
rainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode()); return ApiResult.ok(actItemService.testOne());
rainDto.setRedAmount(BigDecimal.valueOf(0.00));
rainDto.setBatchNum(98);
rainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode());
rainDto.setSourceType(CommonTypeEnum.REDPACK_SOURCE_TYPE4.getCode());
rainDto.setCreateTime(new Date());
activityMapper.saveRedRainForOne(rainDto);
return ApiResult.ok(activityMapper.getRedIdToCattle(amount));
} }
} }
...@@ -44,6 +44,6 @@ public interface ActivityMapper extends BaseMapper<ActItemDto> { ...@@ -44,6 +44,6 @@ public interface ActivityMapper extends BaseMapper<ActItemDto> {
GrapRedPackResultVO getGrapRedPackResult(GrapRedPackResultDto dto); GrapRedPackResultVO getGrapRedPackResult(GrapRedPackResultDto dto);
List<GrapRedPackResultVO> getGrapRedRainRank(GrapRedPackResultDto dto); List<GrapRedPackResultVO> getGrapRedRainRank(GrapRedPackResultDto dto);
RedAmountConfVO getRedAmountConf(@Param("redSource") String redSource,@Param("batchNum") Long batchNum); RedAmountConfVO getRedAmountConf(@Param("redSource") String redSource,@Param("batchNum") Long batchNum);
List<Long> getRedIdToCattle(@Param("redAmount") double redAmount); List<Long> getRedIdToCattle(@Param("redAmount") BigDecimal redAmount);
} }
package com.polysoft.activity.model.param; package com.polysoft.activity.model.param;
import com.polysoft.activity.common.utils.PageQuery; import com.polysoft.activity.common.utils.PageQuery;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ApiModel("用户信息类")
@Data @Data
public class UserInfoParam extends PageQuery { public class UserInfoParam extends PageQuery {
private static final long serialVersionUID = 1L;
private String phone; private String phone;
private Long userId; private Long userId;
private Long signId; private Long signId;
......
...@@ -19,4 +19,5 @@ public interface ActItemService { ...@@ -19,4 +19,5 @@ public interface ActItemService {
ApiResult getSmashBasinInfo(QuerySmashBasinParam param); ApiResult getSmashBasinInfo(QuerySmashBasinParam param);
ApiResult getGrapRedPackResult(QueeryGrapRedPackResultParam param); ApiResult getGrapRedPackResult(QueeryGrapRedPackResultParam param);
ApiResult getGrapRedRainRank(QueeryGrapRedPackResultParam param); ApiResult getGrapRedRainRank(QueeryGrapRedPackResultParam param);
ApiResult testOne();
} }
...@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper; ...@@ -5,6 +5,7 @@ import com.github.pagehelper.PageHelper;
import com.polysoft.activity.common.utils.BeanTransferUtils; import com.polysoft.activity.common.utils.BeanTransferUtils;
import com.polysoft.activity.common.utils.PageQuery; import com.polysoft.activity.common.utils.PageQuery;
import com.polysoft.activity.common.utils.PageResult; import com.polysoft.activity.common.utils.PageResult;
import com.polysoft.activity.config.exception.BusinessException;
import com.polysoft.activity.constant.CommonTypeEnum; import com.polysoft.activity.constant.CommonTypeEnum;
import com.polysoft.activity.mapper.ActivityMapper; import com.polysoft.activity.mapper.ActivityMapper;
import com.polysoft.activity.mapper.UserInfoMapper; import com.polysoft.activity.mapper.UserInfoMapper;
...@@ -21,6 +22,7 @@ import com.polysoft.activity.service.ActItemService; ...@@ -21,6 +22,7 @@ import com.polysoft.activity.service.ActItemService;
import com.polysoft.activity.utils.ApiResult; import com.polysoft.activity.utils.ApiResult;
import com.polysoft.activity.utils.SnowFlakeUtil; import com.polysoft.activity.utils.SnowFlakeUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -143,4 +145,32 @@ public class ActItemServiceImpl implements ActItemService{ ...@@ -143,4 +145,32 @@ public class ActItemServiceImpl implements ActItemService{
return ApiResult.ok(activityMapper.getGrapRedRainRank(dto)); return ApiResult.ok(activityMapper.getGrapRedRainRank(dto));
} }
@Transactional(rollbackFor = Exception.class)
@Override
public ApiResult testOne() {
AddRedRainDto rainDto = new AddRedRainDto();
rainDto.setRedId(SnowFlakeUtil.nextId());
rainDto.setUserId(66L);
rainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode());
rainDto.setRedAmount(BigDecimal.valueOf(0.00));
rainDto.setBatchNum(98);
rainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode());
rainDto.setSourceType(CommonTypeEnum.REDPACK_SOURCE_TYPE1.getCode());
rainDto.setCreateTime(new Date());
int i = activityMapper.saveRedRainForOne(rainDto);
AddRedRainDto rainDto1 = new AddRedRainDto();
rainDto1.setRedId(SnowFlakeUtil.nextId());
rainDto1.setUserId(66L);
rainDto1.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode());
rainDto1.setRedAmount(BigDecimal.valueOf(0.00));
rainDto1.setBatchNum(98);
rainDto1.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode()+"9999");
rainDto1.setSourceType(CommonTypeEnum.REDPACK_SOURCE_TYPE1.getCode());
rainDto1.setCreateTime(new Date());
int j = activityMapper.saveRedRainForOne(rainDto1);
return ApiResult.ok();
}
} }
...@@ -63,7 +63,7 @@ public class UserInfoServiceImpl implements UserInfoService { ...@@ -63,7 +63,7 @@ public class UserInfoServiceImpl implements UserInfoService {
if(StringUtils.isNotBlank(param.getPhone()) || param.getUserId() !=null ){ if(StringUtils.isNotBlank(param.getPhone()) || param.getUserId() !=null ){
UserInfoVO user = mapper.queryAuthUser(param); UserInfoVO user = mapper.queryAuthUser(param);
if(user == null){ if(user == null){
return ApiResult.error(500,"【很抱歉,您非宝利成员无法领取红包】"); return ApiResult.error(500,"【很抱歉,您非宝利成员无法参与活动】");
} }
user.setSysCurretTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss")); user.setSysCurretTime(DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
return ApiResult.ok(user); return ApiResult.ok(user);
...@@ -130,7 +130,7 @@ public class UserInfoServiceImpl implements UserInfoService { ...@@ -130,7 +130,7 @@ public class UserInfoServiceImpl implements UserInfoService {
if(cattleVO == null){ if(cattleVO == null){
object.put("cardType",param.getCardType()); object.put("cardType",param.getCardType());
object.put("isReceived",false); object.put("isReceived",false);
return ApiResult.ok("200","牛牌已被他人领取,领取牛牌失败",object); return ApiResult.ok("200","牛牌已被领取",object);
} }
List<SaveUserCattleDto> list = new ArrayList<>(); List<SaveUserCattleDto> list = new ArrayList<>();
SaveUserCattleDto dto = new SaveUserCattleDto(); SaveUserCattleDto dto = new SaveUserCattleDto();
...@@ -164,7 +164,7 @@ public class UserInfoServiceImpl implements UserInfoService { ...@@ -164,7 +164,7 @@ public class UserInfoServiceImpl implements UserInfoService {
CattleBrandConfVO confVO = cattleBrandMapper.queryCattleBrandConf(today); CattleBrandConfVO confVO = cattleBrandMapper.queryCattleBrandConf(today);
if(param.getSignId() != null){ if(param.getSignId() != null){
//扣除金额 //扣除金额
BigDecimal kouchu = BigDecimal.valueOf(5.00); BigDecimal kouchu = BigDecimal.valueOf(20.00);
//查询余额是否大于 5 元 //查询余额是否大于 5 元
UserInfoParam userInfoParam = new UserInfoParam(); UserInfoParam userInfoParam = new UserInfoParam();
userInfoParam.setUserId(param.getUserId()); userInfoParam.setUserId(param.getUserId());
...@@ -179,7 +179,7 @@ public class UserInfoServiceImpl implements UserInfoService { ...@@ -179,7 +179,7 @@ public class UserInfoServiceImpl implements UserInfoService {
AddRedRainDto rainDto = new AddRedRainDto(); AddRedRainDto rainDto = new AddRedRainDto();
rainDto.setRedId(SnowFlakeUtil.nextId()); rainDto.setRedId(SnowFlakeUtil.nextId());
rainDto.setUserId(param.getUserId()); rainDto.setUserId(param.getUserId());
rainDto.setRedAmount(BigDecimal.valueOf(-5.00)); rainDto.setRedAmount(BigDecimal.valueOf(-20.00));
rainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode()); rainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode());
rainDto.setCreateTime(date); rainDto.setCreateTime(date);
rainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_YES.getCode()); rainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_YES.getCode());
......
...@@ -57,26 +57,27 @@ public class WishServiceImpl implements WishService { ...@@ -57,26 +57,27 @@ public class WishServiceImpl implements WishService {
@Override @Override
public ApiResult addWish(AddWishParam param) { public ApiResult addWish(AddWishParam param) {
try { try {
Date date = new Date();
AddWishDto dto = BeanTransferUtils.transfer(param,AddWishDto.class); AddWishDto dto = BeanTransferUtils.transfer(param,AddWishDto.class);
Long wishId = SnowFlakeUtil.nextId(); Long wishId = SnowFlakeUtil.nextId();
CattleBrandVO cattleBrandVO = null; CattleBrandVO cattleBrandVO = null;
//判断是否当天首次发布心愿 //判断是否当天首次发布心愿
int firstPushNum = mapper.getWishFirstPushOnDay(param.getUserId(),DateUtil.format(new Date(),"yyyy-MM-dd")); int firstPushNum = mapper.getWishFirstPushOnDay(param.getUserId(),DateUtil.format(date,"yyyy-MM-dd"));
for (MultipartFile multipartFile : param.getMultipartFiles()) { for (MultipartFile multipartFile : param.getMultipartFiles()) {
ApiResult result = FileUtils.upload(multipartFile,saveWishPicPath,wishId); ApiResult result = FileUtils.upload(multipartFile,saveWishPicPath,wishId);
WishPicDto wishPicDto = new WishPicDto(); WishPicDto wishPicDto = new WishPicDto();
wishPicDto.setPicId(SnowFlakeUtil.nextId()); wishPicDto.setPicId(SnowFlakeUtil.nextId());
wishPicDto.setWishId(wishId); wishPicDto.setWishId(wishId);
wishPicDto.setCreateTime(new Date()); wishPicDto.setCreateTime(date);
wishPicDto.setPicUrl(callWishPicUrl+result.get("data").toString()); wishPicDto.setPicUrl(callWishPicUrl+result.get("data").toString());
wishPicMapper.insert(wishPicDto); wishPicMapper.insert(wishPicDto);
} }
dto.setWishId(wishId); dto.setWishId(wishId);
dto.setCreateTime(new Date()); dto.setCreateTime(date);
dto.setPushDate(new Date()); dto.setPushDate(date);
int i = mapper.insert(dto); int i = mapper.insert(dto);
//发放牛牌 //发放牛牌
if(i > 0 && firstPushNum == 0){ if(i > 0 && firstPushNum < 2){
CattleBrandConfVO confVO = cattleBrandMapper.queryCattleBrandConf(DateUtil.format(new Date(),"yyyy-MM-dd")); CattleBrandConfVO confVO = cattleBrandMapper.queryCattleBrandConf(DateUtil.format(new Date(),"yyyy-MM-dd"));
MathRandom random = new MathRandom(confVO.getRate1(),confVO.getRate2(),confVO.getRate3(),confVO.getRate4(),confVO.getRate5()); MathRandom random = new MathRandom(confVO.getRate1(),confVO.getRate2(),confVO.getRate3(),confVO.getRate4(),confVO.getRate5());
List<SaveUserCattleDto> list = new ArrayList<>(); List<SaveUserCattleDto> list = new ArrayList<>();
......
...@@ -35,6 +35,7 @@ public class CattleBrandCarveUpTask { ...@@ -35,6 +35,7 @@ public class CattleBrandCarveUpTask {
private ActivityMapper activityMapper; private ActivityMapper activityMapper;
// @Scheduled( cron = "0 20 20 * * ? ") // @Scheduled( cron = "0 20 20 * * ? ")
// @Scheduled(initialDelay = 60000, fixedRate = 1*15*60*1000)
@Scheduled( cron = "0 5 20 17 2 ? ") // 2021年2月17号 20时5分0秒 执行 @Scheduled( cron = "0 5 20 17 2 ? ") // 2021年2月17号 20时5分0秒 执行
public void execute() { public void execute() {
try { try {
...@@ -46,7 +47,8 @@ public class CattleBrandCarveUpTask { ...@@ -46,7 +47,8 @@ public class CattleBrandCarveUpTask {
private void sendWechat() { private void sendWechat() {
log.info("牛牌瓜分红包任务开始"); log.info("牛牌瓜分红包任务开始");
//查询已经合成牛牌的红包 //查询已经合成牛牌的红包
List<Long> list = activityMapper.getRedIdToCattle(0); List<Long> list = activityMapper.getRedIdToCattle(null);
List<Long> lastList = activityMapper.getRedIdToCattle(BigDecimal.valueOf(0.00));
//第一批 牛牌瓜分 //第一批 牛牌瓜分
//生成数量 //生成数量
int count_1 = (int) (list.size()*0.05); int count_1 = (int) (list.size()*0.05);
...@@ -71,12 +73,13 @@ public class CattleBrandCarveUpTask { ...@@ -71,12 +73,13 @@ public class CattleBrandCarveUpTask {
} }
activityMapper.updateRedPackage(batchList_1); activityMapper.updateRedPackage(batchList_1);
//第二批 牛牌瓜分 //第二批 牛牌瓜分
//未充值的牛牌红包
List<Long> redCattlePacke_2 = activityMapper.getRedIdToCattle(BigDecimal.valueOf(0.00));
//生成数量 //生成数量
int count_2 = (int) (list.size()*0.15); int count_2 = (int) (list.size()*0.15);
//生成范围 //生成范围
int random_2 = list.size(); int random_2 = redCattlePacke_2.size();
HashSet<Integer> set_2 = getLuckUser(count_2,random_2); HashSet<Integer> set_2 = getLuckUser(count_2,random_2);
//第一批瓜分
//查询第二批红包配置 //查询第二批红包配置
RedAmountConfVO confVO_2 = activityMapper.getRedAmountConf("4",2L); RedAmountConfVO confVO_2 = activityMapper.getRedAmountConf("4",2L);
List<Double> redAmount_2 = redpack.getMoney(confVO_2.getTotalMoney(),count_2,confVO_2.getRedMinAmount(),confVO_2.getRedMaxAmonut(),2.1); List<Double> redAmount_2 = redpack.getMoney(confVO_2.getTotalMoney(),count_2,confVO_2.getRedMinAmount(),confVO_2.getRedMaxAmonut(),2.1);
...@@ -84,7 +87,7 @@ public class CattleBrandCarveUpTask { ...@@ -84,7 +87,7 @@ public class CattleBrandCarveUpTask {
int bt_2 = 0; int bt_2 = 0;
for (Integer s:set_2) { for (Integer s:set_2) {
AddRedRainDto addRedRainDto = new AddRedRainDto(); AddRedRainDto addRedRainDto = new AddRedRainDto();
addRedRainDto.setRedId(list.get(s)); addRedRainDto.setRedId(redCattlePacke_2.get(s));
addRedRainDto.setRedAmount(BigDecimal.valueOf(redAmount_2.get(bt_2))); addRedRainDto.setRedAmount(BigDecimal.valueOf(redAmount_2.get(bt_2)));
addRedRainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode()); addRedRainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode());
addRedRainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode()); addRedRainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode());
...@@ -93,10 +96,12 @@ public class CattleBrandCarveUpTask { ...@@ -93,10 +96,12 @@ public class CattleBrandCarveUpTask {
} }
activityMapper.updateRedPackage(batchList_2); activityMapper.updateRedPackage(batchList_2);
//第三批 牛牌瓜分 //第三批 牛牌瓜分
//未充值的牛牌红包
List<Long> redCattlePacke_3 = activityMapper.getRedIdToCattle(BigDecimal.valueOf(0.00));
//生成数量 //生成数量
int count_3 = (int) (list.size()*0.40); int count_3 = (int) (list.size()*0.40);
//生成范围 //生成范围
int random_3 = list.size(); int random_3 = redCattlePacke_3.size();
HashSet<Integer> set_3 = getLuckUser(count_3,random_3); HashSet<Integer> set_3 = getLuckUser(count_3,random_3);
//查询第三批红包配置 //查询第三批红包配置
RedAmountConfVO confVO_3 = activityMapper.getRedAmountConf("4",3L); RedAmountConfVO confVO_3 = activityMapper.getRedAmountConf("4",3L);
...@@ -105,7 +110,7 @@ public class CattleBrandCarveUpTask { ...@@ -105,7 +110,7 @@ public class CattleBrandCarveUpTask {
int bt_3 = 0; int bt_3 = 0;
for (Integer s:set_3) { for (Integer s:set_3) {
AddRedRainDto addRedRainDto = new AddRedRainDto(); AddRedRainDto addRedRainDto = new AddRedRainDto();
addRedRainDto.setRedId(list.get(s)); addRedRainDto.setRedId(redCattlePacke_3.get(s));
addRedRainDto.setRedAmount(BigDecimal.valueOf(redAmount_3.get(bt_3))); addRedRainDto.setRedAmount(BigDecimal.valueOf(redAmount_3.get(bt_3)));
addRedRainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode()); addRedRainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode());
addRedRainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode()); addRedRainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode());
...@@ -114,10 +119,12 @@ public class CattleBrandCarveUpTask { ...@@ -114,10 +119,12 @@ public class CattleBrandCarveUpTask {
} }
activityMapper.updateRedPackage(batchList_3); activityMapper.updateRedPackage(batchList_3);
//第四批 牛牌瓜分 //第四批 牛牌瓜分
//未充值的牛牌红包
List<Long> redCattlePacke_4 = activityMapper.getRedIdToCattle(BigDecimal.valueOf(0.00));
//生成数量 //生成数量
int count_4 = (int) (list.size()*0.25); int count_4 = redCattlePacke_4.size();
//生成范围 //生成范围
int random_4 = list.size(); int random_4 = redCattlePacke_4.size();
HashSet<Integer> set_4 = getLuckUser(count_4,random_4); HashSet<Integer> set_4 = getLuckUser(count_4,random_4);
//查询第四批红包配置 //查询第四批红包配置
RedAmountConfVO confVO_4 = activityMapper.getRedAmountConf("4",4L); RedAmountConfVO confVO_4 = activityMapper.getRedAmountConf("4",4L);
...@@ -126,7 +133,7 @@ public class CattleBrandCarveUpTask { ...@@ -126,7 +133,7 @@ public class CattleBrandCarveUpTask {
int bt_4 = 0; int bt_4 = 0;
for (Integer s:set_4) { for (Integer s:set_4) {
AddRedRainDto addRedRainDto = new AddRedRainDto(); AddRedRainDto addRedRainDto = new AddRedRainDto();
addRedRainDto.setRedId(list.get(s)); addRedRainDto.setRedId(redCattlePacke_4.get(s));
addRedRainDto.setRedAmount(BigDecimal.valueOf(redAmount_4.get(bt_4))); addRedRainDto.setRedAmount(BigDecimal.valueOf(redAmount_4.get(bt_4)));
addRedRainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode()); addRedRainDto.setRedType(CommonTypeEnum.REDPACK_TYPE1.getCode());
addRedRainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode()); addRedRainDto.setIsEnble(CommonTypeEnum.RED_ISENBLE_NO.getCode());
......
...@@ -30,7 +30,8 @@ public class UserSignTask { ...@@ -30,7 +30,8 @@ public class UserSignTask {
* 补签任务 * 补签任务
*/ */
// @Scheduled( cron = "0 21 20 * * ? ") // @Scheduled( cron = "0 21 20 * * ? ")
@Scheduled( cron = "0 5 0 12,13,14,15,16,17 2 ? ") //2月12,13,14,15,16,17 0时5分0秒执行 // @Scheduled(initialDelay = 10000, fixedRate = 1*15*60*1000)
@Scheduled( cron = "0 5 0 4,13,14,15,16,17 2 ? ") //2月12,13,14,15,16,17 0时5分0秒执行
public void execute() { public void execute() {
try { try {
sendWechat(); sendWechat();
......
...@@ -70,3 +70,5 @@ wechat: ...@@ -70,3 +70,5 @@ wechat:
fileUpload: fileUpload:
saveWishPicPath: /home/spring_fistival/images saveWishPicPath: /home/spring_fistival/images
callWishPicUrl: http://quality.item.polyhome.net/spfest/images callWishPicUrl: http://quality.item.polyhome.net/spfest/images
spring_user:
userName: ypenglv
...@@ -178,7 +178,7 @@ ...@@ -178,7 +178,7 @@
FROM FROM
t_red_rain t t_red_rain t
WHERE WHERE
t.user_id = #{userId} and red_type = '1' t.user_id = #{userId} and red_type = '1' and t.is_enble='1'
ORDER BY ORDER BY
t.create_time DESC t.create_time DESC
</select> </select>
...@@ -257,8 +257,8 @@ ...@@ -257,8 +257,8 @@
FROM FROM
t_red_rain t_red_rain
WHERE WHERE
red_amount = 0.00
AND source_type = '4' and is_enble='0' source_type = '4' and is_enble='0'
<if test="redAmount != null"> <if test="redAmount != null">
and red_amount = #{redAmount} and red_amount = #{redAmount}
</if> </if>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<select id="queryWishList" resultType="com.polysoft.activity.model.vo.WishVO" <select id="queryWishList" resultType="com.polysoft.activity.model.vo.WishVO"
parameterType="com.polysoft.activity.model.param.QueryWishParam"> parameterType="com.polysoft.activity.model.param.QueryWishParam">
SELECT SELECT
t1.wish_id, DISTINCT(t1.wish_id),
t1.user_id, t1.user_id,
t1.address, t1.address,
t1.wish_context, t1.wish_context,
......
...@@ -12,8 +12,8 @@ public class PageQuery { ...@@ -12,8 +12,8 @@ public class PageQuery {
@ApiModelProperty("当前页码") @ApiModelProperty("当前页码")
private Integer pageNum = 1; private Integer pageNum = 1;
@ApiModelProperty("每页显示条数,默认20") @ApiModelProperty("每页显示条数,默认10")
private Integer pageSize = 20; private Integer pageSize = 10;
@ApiModelProperty(value = "是否分页,默认:true") @ApiModelProperty(value = "是否分页,默认:true")
private Boolean isPage = true; private Boolean isPage = true;
} }
......
...@@ -31,7 +31,7 @@ public class FileUtils { ...@@ -31,7 +31,7 @@ public class FileUtils {
File dest = null; File dest = null;
try { try {
// String path=uploadpath+File.separator+date+File.separator+uuid+fileName; // String path=uploadpath+File.separator+date+File.separator+uuid+fileName;
String fileType = fileName.substring(fileName.indexOf("."),fileName.length()); String fileType = fileName.substring(fileName.lastIndexOf("."),fileName.length());
String path=uploadpath+"/"+date+"/"+uuid+fileType; String path=uploadpath+"/"+date+"/"+uuid+fileType;
dest = new File(path); dest = new File(path);
if (!dest.getParentFile().exists()) { if (!dest.getParentFile().exists()) {
...@@ -47,7 +47,7 @@ public class FileUtils { ...@@ -47,7 +47,7 @@ public class FileUtils {
} }
public static void main(String[] args) { public static void main(String[] args) {
String ss = "0ab520bfbbcd4ca8b3c66c7b4dbd8e3eF5A3F540-D6A3-404F-807C-A55D5D2FBE1E.jpeg"; String ss = "e0dc4a00e87e433284387484df6b921b.redocn.com_201206_4_88952_1338814806KZQi.jpg&refer=http___img.redocn.jpeg";
System.out.println(ss.substring(ss.indexOf("."),ss.length())); System.out.println(ss.substring(ss.lastIndexOf("."),ss.length()));
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!