|
@@ -23,10 +23,8 @@ import com.cyksj.model.excel.ExcelRechargeAccountData;
|
|
|
import com.cyksj.model.manage.views.AccountView;
|
|
import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.model.manage.views.GroupsRelationBackView;
|
|
import com.cyksj.model.manage.views.GroupsRelationBackView;
|
|
|
import com.cyksj.model.request.*;
|
|
import com.cyksj.model.request.*;
|
|
|
-import com.cyksj.model.views.DisableAccountView;
|
|
|
|
|
-import com.cyksj.model.views.GroupsRelationIndependentView;
|
|
|
|
|
-import com.cyksj.model.views.GroupsRelationRechargeView;
|
|
|
|
|
-import com.cyksj.model.views.OrderDonRenewView;
|
|
|
|
|
|
|
+import com.cyksj.model.response.GptRechargeStatisticsRecordResp;
|
|
|
|
|
+import com.cyksj.model.views.*;
|
|
|
import com.cyksj.server.recharge.dto.TaskResult;
|
|
import com.cyksj.server.recharge.dto.TaskResult;
|
|
|
import com.cyksj.server.recharge.dto.TokenParseResult;
|
|
import com.cyksj.server.recharge.dto.TokenParseResult;
|
|
|
import com.cyksj.service.chatgpt.GptUserRechargeRecordService;
|
|
import com.cyksj.service.chatgpt.GptUserRechargeRecordService;
|
|
@@ -89,6 +87,8 @@ public class CmsGroupRelationController {
|
|
|
|
|
|
|
|
private final GptRechargeService gptRechargeService;
|
|
private final GptRechargeService gptRechargeService;
|
|
|
|
|
|
|
|
|
|
+ private final GptRechargeOperatorChangeRecordMapper gptRechargeOperatorChangeRecordMapper;
|
|
|
|
|
+
|
|
|
@GetMapping("/get")
|
|
@GetMapping("/get")
|
|
|
public Result<List<GroupsRelationBackView>> get(){
|
|
public Result<List<GroupsRelationBackView>> get(){
|
|
|
List<GroupsRelationBackView> search = beanSearcher.searchAll(GroupsRelationBackView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
List<GroupsRelationBackView> search = beanSearcher.searchAll(GroupsRelationBackView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
@@ -222,7 +222,7 @@ public class CmsGroupRelationController {
|
|
|
//卡密
|
|
//卡密
|
|
|
String cardKey = rechargeView.getCardKey();
|
|
String cardKey = rechargeView.getCardKey();
|
|
|
if (StrUtil.isNotBlank(cardKey)) {
|
|
if (StrUtil.isNotBlank(cardKey)) {
|
|
|
- relation.setPassword(cardKey);
|
|
|
|
|
|
|
+ relation.setCardKey(cardKey);
|
|
|
}
|
|
}
|
|
|
String contact = rechargeView.getContact();
|
|
String contact = rechargeView.getContact();
|
|
|
if (StrUtil.isNotBlank(contact)) {
|
|
if (StrUtil.isNotBlank(contact)) {
|
|
@@ -364,6 +364,54 @@ public class CmsGroupRelationController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 编辑代充操作人员
|
|
|
|
|
+ */
|
|
|
|
|
+ @PutMapping("/update/recharge/operator")
|
|
|
|
|
+ public Result<String> updateRechargeOperator(@RequestBody GroupsRelation relation) {
|
|
|
|
|
+ Long adminId = StpUtil.getLoginIdAsLong();
|
|
|
|
|
+ Long relationId = relation.getId();
|
|
|
|
|
+ String af_operator = relation.getOperator();
|
|
|
|
|
+
|
|
|
|
|
+ GroupsRelation dbRelation = groupsRelationMapper.selectById(relationId);
|
|
|
|
|
+ String bfOperator = dbRelation.getOperator();
|
|
|
|
|
+ if (StrUtil.equals(bfOperator, af_operator)) {
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
|
|
+ dbRelation.setOperator(af_operator);
|
|
|
|
|
+ groupsRelationMapper.updateById(dbRelation);
|
|
|
|
|
+
|
|
|
|
|
+ GptRechargeOperatorChangeRecord changeRecord = new GptRechargeOperatorChangeRecord();
|
|
|
|
|
+ changeRecord.setBf(bfOperator);
|
|
|
|
|
+ changeRecord.setAf(af_operator);
|
|
|
|
|
+ changeRecord.setRelationId(relationId);
|
|
|
|
|
+ changeRecord.setUserId(dbRelation.getUserId());
|
|
|
|
|
+ changeRecord.setOperator(cmsUserMapper.selectById(adminId).getNickname());
|
|
|
|
|
+ gptRechargeOperatorChangeRecordMapper.insert(changeRecord);
|
|
|
|
|
+
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 统计 代充操作数据
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/recharge/operate/statistics/data")
|
|
|
|
|
+ public Result<List<GptRechargeStatisticsRecordResp>> getRechargeStatisticsData(Long goodsId, String start, String end) {
|
|
|
|
|
+ if (StrUtil.isEmpty(start)) {
|
|
|
|
|
+ start = DateUtil.beginOfMonth(DateTime.now()).toString();
|
|
|
|
|
+ end = DateUtil.endOfMonth(DateTime.now()).toString();
|
|
|
|
|
+ }
|
|
|
|
|
+ List<CmsUserVO> customers = beanSearcher.searchAll(CmsUserVO.class, MapUtils.builder()
|
|
|
|
|
+ .field(CmsUserVO::getRoleNames, List.of("客服", "root")).op(Operator.InList)
|
|
|
|
|
+ .field(CmsUserVO::getStatus, Boolean.TRUE)
|
|
|
|
|
+ .build());
|
|
|
|
|
+ List<String> showUsers = customers.stream().map(CmsUserVO::getNickname).collect(Collectors.toList());
|
|
|
|
|
+ List<GptRechargeStatisticsRecordResp> recordResps = groupsRelationMapper.selectRechargeRecordNum(goodsId, start, end);
|
|
|
|
|
+ //过滤
|
|
|
|
|
+ recordResps = recordResps.stream().filter(rsp -> showUsers.contains(rsp.getOperator())).collect(Collectors.toList());
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(recordResps);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 编辑代充备注
|
|
* 编辑代充备注
|
|
|
*/
|
|
*/
|