|
|
@@ -162,9 +162,16 @@ public class CmsGroupRelationController {
|
|
|
* Chat GPT独立规格续费 列表
|
|
|
*/
|
|
|
@GetMapping("/get/chatGPT/independent/renew")
|
|
|
- public Result<SearchResult<GroupsRelationIndependentView>> getIndependentRenew() {
|
|
|
- String condition = " and sku_id in (select id from goods_don_sku sku where sku.goods_id = 18 and sku.num = 1)" +
|
|
|
- " and (select count(*) from order_don o where o.user_id = gr.user_id and o.relation_id = gr.relation_id and o.status not in ('close','noPayment','refund') and o.order_type = 2) > 0";
|
|
|
+ public Result<SearchResult<GroupsRelationIndependentView>> getIndependentRenew(Boolean isRenew) {
|
|
|
+ String condition = " sku_id in (select id from goods_don_sku sku where sku.goods_id = 18 and sku.num = 1)" +
|
|
|
+ " and exists (select id from order_don o where o.user_id = gr.user_id and o.relation_id = gr.id and o.status not in ('close','noPayment','refund') and o.order_type = 2 limit 1)";
|
|
|
+ if (isRenew != null) {
|
|
|
+ if (isRenew) {
|
|
|
+ condition += String.format(" and exists (select id from groups_relation_independent_renew gnr where gnr.user_id = gr.user_id and gnr.relation_id = gr.id and gnr.is_renew = 1 limit 1)");
|
|
|
+ } else {
|
|
|
+ condition += String.format(" and (select count(*) from groups_relation_independent_renew gnr where gnr.user_id = gr.user_id and gnr.relation_id = gr.id and gnr.is_renew = 1) = 0");
|
|
|
+ }
|
|
|
+ }
|
|
|
SearchResult<GroupsRelationIndependentView> search = beanSearcher.search(GroupsRelationIndependentView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.put("condition", condition)
|
|
|
.build());
|
|
|
@@ -193,13 +200,12 @@ public class CmsGroupRelationController {
|
|
|
if (cmsUser != null) {
|
|
|
groupsRelationIndependentRenew.setOperator(cmsUser.getNickname());
|
|
|
}
|
|
|
- if (groupsRelationIndependentRenew == null) {
|
|
|
+ if (groupsRelationIndependentRenew.getId() == null) {
|
|
|
groupsRelationIndependentRenew.setRelationId(relationId);
|
|
|
groupsRelationIndependentRenew.setUserId(userId);
|
|
|
groupsRelationIndependentRenew.setIsRenew(isRenew);
|
|
|
groupsRelationIndependentRenewMapper.insert(groupsRelationIndependentRenew);
|
|
|
} else {
|
|
|
- groupsRelationIndependentRenew.setOperator(cmsUser.getNickname());
|
|
|
groupsRelationIndependentRenew.setIsRenew(isRenew);
|
|
|
groupsRelationIndependentRenewMapper.updateById(groupsRelationIndependentRenew);
|
|
|
}
|