|
@@ -14,6 +14,7 @@ import com.zswl.cloud.bdb.client.vo.InviteReceiptsRoleVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -58,9 +59,44 @@ public class TestController {
|
|
|
// return ResultContent.buildSuccess();
|
|
|
// }
|
|
|
|
|
|
- @ApiOperation("结算奖励")
|
|
|
+ @ApiOperation("修改入账及消息时间")
|
|
|
@PostMapping("settle")
|
|
|
public Object settle(@RequestBody TestSettleParam param){
|
|
|
+ if (param.getTime()!=null && param.getTime() != 0L){
|
|
|
+ Date date = new Date(param.getTime());
|
|
|
+ if (param.getIdList()!=null && !param.getIdList().isEmpty()){
|
|
|
+ Iterable<WalletReceipts> allById = walletReceiptsDao.findAllById(param.getIdList());
|
|
|
+ allById.forEach(it->{
|
|
|
+ it.setCreateTime(param.getTime());
|
|
|
+ it.setEstimatedTime(param.getTime());
|
|
|
+ VipUserRecord vipUserRecord = it.getVipUserRecord();
|
|
|
+ vipUserRecord.setOperateTime(param.getTime());
|
|
|
+ it.setVipUserRecord(vipUserRecord);
|
|
|
+ InviteReceiptsRoleVo ruler = it.getRuler();
|
|
|
+ ruler.setDay(Integer.parseInt(String.format("%tm", date)));
|
|
|
+ it.setRuler(ruler);
|
|
|
+ });
|
|
|
+ walletReceiptsDao.saveAll(allById);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (param.getVipRecordIdList()!=null && !param.getVipRecordIdList().isEmpty()){
|
|
|
+ Iterable<VipUserRecord> vipRecordList = vipUserRecordDao.findAllById(param.getVipRecordIdList());
|
|
|
+ vipRecordList.forEach(it->{
|
|
|
+ it.setOperateTime(param.getTime());
|
|
|
+ it.setCreateTime(param.getTime());
|
|
|
+ });
|
|
|
+ vipUserRecordDao.saveAll(vipRecordList);
|
|
|
+ }
|
|
|
+
|
|
|
+ walletReceiptsService.settle(Integer.parseInt(String.format("%td", date)));
|
|
|
+ }else {
|
|
|
+ updateTime(param);
|
|
|
+ }
|
|
|
+ return ResultContent.buildSuccess();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateTime(TestSettleParam param) {
|
|
|
Date date = new Date();
|
|
|
if (param.getIdList()!=null && !param.getIdList().isEmpty()){
|
|
|
Iterable<WalletReceipts> allById = walletReceiptsDao.findAllById(param.getIdList());
|
|
@@ -88,7 +124,6 @@ public class TestController {
|
|
|
}
|
|
|
|
|
|
walletReceiptsService.settle(Integer.parseInt(String.format("%td", date)));
|
|
|
- return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
// @ApiOperation("生成持续订购返利")
|