|
|
@@ -2,6 +2,7 @@ package com.cyksj.web.controller.manage.register;
|
|
|
|
|
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
@@ -209,25 +210,31 @@ public class CmsRegisterController {
|
|
|
@GetMapping("/get/gpt")
|
|
|
public Result<String> takeGpt() {
|
|
|
List<GroupsTrips> groupsTrips = groupsMapper.selectList(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
- .eq(GroupsTrips::getSkuId, 161l));
|
|
|
- Integer max = 20;
|
|
|
+ .eq(GroupsTrips::getSkuId, 178l));
|
|
|
+ Integer max = 6;
|
|
|
groupsTrips.forEach(data->{
|
|
|
- Integer num = data.getNum();
|
|
|
- data.setNum(num + 5);
|
|
|
- Integer availableNum = data.getAvailableNum();
|
|
|
- data.setAvailableNum(availableNum + 5);
|
|
|
- groupsMapper.updateById(data);
|
|
|
- List<GroupsRelation> groupsRelations = groupRelationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
- .eq(GroupsRelation::getGroupsId, data.getId()));
|
|
|
- Integer size = groupsRelations.size() + 1;
|
|
|
- for (int i = size; i <= 20; i++) {
|
|
|
- GroupsRelation relation = new GroupsRelation();
|
|
|
- relation.setGroupsId(data.getId());
|
|
|
- relation.setStatus(GroupsRelation.Status.none);
|
|
|
- relation.setNum(i);
|
|
|
- groupRelationMapper.insert(relation);
|
|
|
+ if (data.getNum() == 4) {
|
|
|
+ Integer num = data.getNum();
|
|
|
+ data.setNum(num + 2);
|
|
|
+ Integer availableNum = data.getAvailableNum();
|
|
|
+ data.setAvailableNum(availableNum + 2);
|
|
|
+ groupsMapper.updateById(data);
|
|
|
+ List<GroupsRelation> groupsRelations = groupRelationMapper.selectList(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
+ .eq(GroupsRelation::getGroupsId, data.getId()));
|
|
|
+ Integer size = groupsRelations.size() + 1;
|
|
|
+ for (int i = size; i <= 6; i++) {
|
|
|
+ GroupsRelation relation = new GroupsRelation();
|
|
|
+ relation.setGroupsId(data.getId());
|
|
|
+ relation.setStatus(GroupsRelation.Status.none);
|
|
|
+ relation.setNum(i);
|
|
|
+ DateTime parse = DateUtil.parse("2023-02-01 00:00:00", "yyyy-MM-dd HH:mm:ss");
|
|
|
+ groupRelationMapper.insert(relation);
|
|
|
+ groupRelationMapper.update(null, Wrappers.lambdaUpdate(GroupsRelation.class)
|
|
|
+ .set(GroupsRelation::getUpdateTime, parse)
|
|
|
+ .eq(GroupsRelation::getId, relation.getId()));
|
|
|
+ }
|
|
|
+ log.info("xxxxxxxxxxxxxxxxxxx");
|
|
|
}
|
|
|
- log.info("xxxxxxxxxxxxxxxxxxx");
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|