记得上下班打卡 | git大法好,push需谨慎

Commit c67ec502 authored by jiangxiulong's avatar jiangxiulong

Merge remote-tracking branch 'origin/master' into jxl_1214_refund

parents 0b9ef1bf f207d622
...@@ -50,10 +50,12 @@ ...@@ -50,10 +50,12 @@
and amo.source = #{source} and amo.source = #{source}
</if> </if>
<if test="paymentAtStart != null and paymentAtStart != ''"> <if test="paymentAtStart != null and paymentAtStart != ''">
and amo.payment_at &gt; #{paymentAtStart} # and amo.payment_at &gt; #{paymentAtStart}
and amo.payment_at <![CDATA[>=]]> #{paymentAtStart}
</if> </if>
<if test="paymentAtEnd != null and paymentAtEnd != ''"> <if test="paymentAtEnd != null and paymentAtEnd != ''">
and amo.payment_at &lt; #{paymentAtEnd} # and amo.payment_at &lt; #{paymentAtEnd}
and amo.payment_at <![CDATA[<=]]> #{paymentAtEnd}
</if> </if>
</where> </where>
order by amo.created_at desc order by amo.created_at desc
......
...@@ -4,6 +4,7 @@ import com.liquidnet.service.base.ResponseDto; ...@@ -4,6 +4,7 @@ import com.liquidnet.service.base.ResponseDto;
import feign.hystrix.FallbackFactory; import feign.hystrix.FallbackFactory;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
@Component @Component
...@@ -27,4 +28,7 @@ public interface FeignPlatformCandyTaskClient { ...@@ -27,4 +28,7 @@ public interface FeignPlatformCandyTaskClient {
@PutMapping("ccoupon/task/due/user") @PutMapping("ccoupon/task/due/user")
ResponseDto<String> dueProcessForUser(); ResponseDto<String> dueProcessForUser();
@GetMapping("followDoTask/doTask")
ResponseDto doTask();
} }
...@@ -129,4 +129,22 @@ public class PlatformTaskHandler { ...@@ -129,4 +129,22 @@ public class PlatformTaskHandler {
return fail; return fail;
} }
} }
// 关注任务加积分脚本
@XxlJob(value = "sev-platform:followDoTask")
public ReturnT<String> followDoTask() {
try {
ResponseDto<String> dto = feignPlatformCandyTaskClient.doTask();
String dtoStr = JsonUtils.toJson(dto);
log.info("result of handler:{}", dtoStr);
ReturnT<String> success = ReturnT.SUCCESS;
success.setMsg(dtoStr);
return success;
} catch (Exception e) {
log.error("exception of handler:{}", e.getMessage(), e);
ReturnT<String> fail = ReturnT.FAIL;
fail.setMsg(e.getLocalizedMessage());
return fail;
}
}
} }
package com.liquidnet.service.platform.controller.sweet;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.feign.stone.api.FeignStoneIntegralClient;
import com.liquidnet.service.platform.utils.DataUtils;
import com.liquidnet.service.sweet.entity.SweetWechatUsers;
import com.liquidnet.service.sweet.mapper.SweetWechatUsersMapper;
import com.liquidnet.service.sweet.vo.SweetAppletUsersVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
/**
* <p>
* 关注任务加积分脚本
* </p>
*
* @author jiangxiulong
* @since 2021-12-28
*/
@Api(tags = "关注任务加积分脚本")
@Slf4j
@RestController
@RequestMapping("followDoTask")
public class TaskController {
@Autowired
private SweetWechatUsersMapper usersMapper;
@Autowired
private FeignStoneIntegralClient feignStoneIntegralClient;
@Autowired
private DataUtils dataUtils;
@GetMapping("doTask")
@ApiOperation("退款回调")
public ResponseDto doTask() {
int size = 1000;
LocalDateTime localDateTime = LocalDateTime.now();
LocalDateTime newTime = localDateTime.minusMinutes(10);
// String timeStr = "2021-12-28 00:00:00";
// DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
// LocalDateTime dateTime = LocalDateTime.parse(timeStr, df);
// 获取总记录数
Integer count = usersMapper.selectCount(
Wrappers.lambdaQuery(SweetWechatUsers.class)
.gt(SweetWechatUsers::getCreatedAt, newTime)
.eq(SweetWechatUsers::getType, 2)
);
// 总page
int countPage = (int) Math.ceil(count / size);
countPage = countPage + 1;
for (int page = 0; page < countPage; page++) {
List<SweetWechatUsers> sweetWechatUsers = usersMapper.selectList(
Wrappers.lambdaQuery(SweetWechatUsers.class)
.gt(SweetWechatUsers::getCreatedAt, newTime)
.last("limit " + (page * size) + "," + ((page + 1) * size))
);
for (SweetWechatUsers info : sweetWechatUsers) {
try {
SweetAppletUsersVo sweetAppletUsers = dataUtils.getSweetAppletUsersOfUnionId(info.getUnionId());
if (sweetAppletUsers != null) {
if (sweetAppletUsers.getUserId() != null && !sweetAppletUsers.getUserId().isEmpty()) {
log.info("followDoTask userId:{}", sweetAppletUsers.getUserId());
ResponseDto<HashMap<String, Object>> hashMapResponseDto = feignStoneIntegralClient.doTask(4, sweetAppletUsers.getUserId());
//log.info("followDoTask res:{}", hashMapResponseDto);
}
}
} catch (Exception e) {
}
}
}
return ResponseDto.success();
}
}
...@@ -13,6 +13,8 @@ import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderListVo; ...@@ -13,6 +13,8 @@ import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderListVo;
import com.liquidnet.service.kylin.entity.KylinBuyNotice; import com.liquidnet.service.kylin.entity.KylinBuyNotice;
import com.liquidnet.service.kylin.entity.KylinOrderCoupons; import com.liquidnet.service.kylin.entity.KylinOrderCoupons;
import com.liquidnet.service.kylin.mapper.KylinBuyNoticeMapper; import com.liquidnet.service.kylin.mapper.KylinBuyNoticeMapper;
import com.liquidnet.service.sweet.constant.SweetConstant;
import com.liquidnet.service.sweet.vo.SweetAppletUsersVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
...@@ -400,4 +402,15 @@ public class DataUtils { ...@@ -400,4 +402,15 @@ public class DataUtils {
return (ArrayList<KylinOrderCoupons>) obj; return (ArrayList<KylinOrderCoupons>) obj;
} }
} }
public SweetAppletUsersVo getSweetAppletUsersOfUnionId(String unionId) {
String redisKey = SweetConstant.REDIS_KEY_SWEET_APPLET_USERS_UNIONID.concat(unionId);
Object obj = redisDataSourceUtil.getRedisSweetUtil().get(redisKey);
if (null == obj) {
return null;
} else {
SweetAppletUsersVo sweetAppletUsersVo = (SweetAppletUsersVo) obj;
return sweetAppletUsersVo;
}
}
} }
...@@ -88,15 +88,15 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService { ...@@ -88,15 +88,15 @@ public class StoneScoreLogsServiceImpl implements IStoneScoreLogsService {
} }
Date userMonth = DateUtil.parse(vo.getCurrentMonth() == null ? DateUtil.getNowTime() : vo.getCurrentMonth(), "yyyy-MM"); Date userMonth = DateUtil.parse(vo.getCurrentMonth() == null ? DateUtil.getNowTime() : vo.getCurrentMonth(), "yyyy-MM");
int monthScore = vo.getMonthScore() == null ? 0 : vo.getMonthScore(); int monthScore = vo.getMonthScore() == null ? 0 : vo.getMonthScore();
if (DateUtil.compareMonth(userMonth, DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM")) == 0) {//当月 // if (DateUtil.compareMonth(userMonth, DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM")) == 0) {//当月
if ((monthScore + score) >= monthMax) { // if ((monthScore + score) >= monthMax) {
score = monthMax - monthScore; // score = monthMax - monthScore;
} // }
} else { // } else {
if (score >= monthMax) { // if (score >= monthMax) {
score = monthMax; // score = monthMax;
} // }
} // }
// Date userDay = DateUtil.parse(vo.getCurrentDay() == null ? DateUtil.getNowTime() : vo.getCurrentDay(), "yyyy-MM-dd"); // Date userDay = DateUtil.parse(vo.getCurrentDay() == null ? DateUtil.getNowTime() : vo.getCurrentDay(), "yyyy-MM-dd");
// int dayScore = vo.getDayScore() == null ? 0 : vo.getDayScore(); // int dayScore = vo.getDayScore() == null ? 0 : vo.getDayScore();
// if (DateUtil.compareDay(userDay, DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd")) == 0) {//当日 // if (DateUtil.compareDay(userDay, DateUtil.parse(DateUtil.getNowTime(), "yyyy-MM-dd")) == 0) {//当日
......
...@@ -33,7 +33,7 @@ public class SweetWechatMaoDengController { ...@@ -33,7 +33,7 @@ public class SweetWechatMaoDengController {
@GetMapping("/backData") @GetMapping("/backData")
@ApiOperation("返回文字图片") @ApiOperation("返回文字图片")
public ResponseDto<SweetMaoDengVo> backDatas(String userId, String maoId) { public ResponseDto<SweetMaoDengVo> backDatas(String userId) {
SweetWechatUsersVo wechatUsers = redisUtils.getSweetWechatUsersOfUnionId(userId, 2); SweetWechatUsersVo wechatUsers = redisUtils.getSweetWechatUsersOfUnionId(userId, 2);
if (null == wechatUsers) { if (null == wechatUsers) {
return ResponseDto.failure("获取信息失败"); return ResponseDto.failure("获取信息失败");
...@@ -51,7 +51,7 @@ public class SweetWechatMaoDengController { ...@@ -51,7 +51,7 @@ public class SweetWechatMaoDengController {
return ResponseDto.failure("获取信息失败"); return ResponseDto.failure("获取信息失败");
} }
@PostMapping("/backData") @PostMapping("/addBuilderImg")
@ApiOperation("存生成的图") @ApiOperation("存生成的图")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "userId", value = "userId"), @ApiImplicitParam(type = "query", dataType = "String", name = "userId", value = "userId"),
......
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