提交 fec4ced5 作者: zhenjie

Merge branch 'develop'

......@@ -104,4 +104,6 @@ public class PilotCertificationDTO {
private String reason;
@ApiModelProperty(value = "飞手头像", example = "http://")
private String userImg;
@ApiModelProperty(value = "关注状态")
private Boolean status;
}
......@@ -58,5 +58,8 @@ public class PilotCertificationQO implements Serializable {
this.pageNo = (pageNo - 1) * pageSize;
}
@ApiModelProperty(value = "",hidden = true)
private Integer tokenUserId;
}
......@@ -29,7 +29,7 @@ public class PayUavWalletVO implements Serializable {
@ApiModelProperty(value = "佣金")
private BigDecimal salaryAmount;
@ApiModelProperty(value = "订单状态 100:订单支付 1400:商城订单退款 1500:订单提成 999:确认收货", required = true)
@ApiModelProperty(value = "订单状态 100:订单支付 1400:商城订单退款 1500:订单提成 999:确认收货 1600:租赁押金退回", required = true)
private Integer orderStatus;
@ApiModelProperty(value = "订单备注")
......
......@@ -61,6 +61,11 @@ public class PilotCertificationController extends BaseController {
@PostMapping("/appListPilot")
public ResultBody<PilotCertificationDTO> pilotList(HttpServletRequest request,
@Validated(value = {Page.class}) @ApiParam(value = "飞手查询", required = true) @RequestBody PilotCertificationQO param) {
String token = request.getHeader("token");
if (token!=null){
Integer userAccountId = this.getUserLoginInfoFromRedis(request).getUserAccountId();
param.setTokenUserId(userAccountId);
}
return ResultBody.success(certificationService.pilotList(param));
}
......
package com.mmc.iuav.user.entity.dronepilot;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author small
* @Date 2023/10/12 10:23
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ForumAttentionDO {
private Integer id;
@ApiModelProperty(value = "被关注的用户")
private Integer userAccountId;
@ApiModelProperty(value = "关注用户")
private Integer attentionUserAccountId;
@ApiModelProperty(value = "关注状态")
private Boolean status;
@ApiModelProperty(value = "是否相互关注")
private Boolean mutualAttention;
private String createTime;
private String updateTime;
}
......@@ -18,7 +18,8 @@ public enum PayMethodEnums {
FLYING_HAND_CONFIRM_LT(1000, "飞手确认修改金额小于原订单状态"),
USER_TOP_UP(1100, "充值"),
PAY_UAV_ORDER_REFUND(1400, "商城订单退款"),
ORDER_INCOME(1500, "订单收益");
ORDER_INCOME(1500, "订单收益"),
GIVE_BACK_PLEDGE(1600, "租赁押金退回");
PayMethodEnums(Integer code, String method) {
this.code = code;
......
package com.mmc.iuav.user.service.dronepilot.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.http.HttpsRequestUtil;
import com.mmc.iuav.page.PageResult;
......@@ -28,8 +29,11 @@ import com.mmc.iuav.user.model.vo.dronepilot.PilotCertificationVO;
import com.mmc.iuav.user.model.vo.userpoints.UserPointsVO;
import com.mmc.iuav.user.service.dronepilot.PilotCertificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -60,6 +64,13 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
@Autowired
private UserPointsDetailsDao userPointsDetailsDao;
@Autowired
private RestTemplate restTemplate;
@Value("${iuav.ims.uri}")
private String imsApp;
@Override
public ResultBody insertPilot(PilotCertificationVO certificationVO, LoginSuccessDTO userLoginInfoFromRedis) {
......@@ -135,11 +146,46 @@ public class PilotCertificationServiceImpl implements PilotCertificationService
List<PilotCertificationDTO> collect = pilotList.stream().map(PilotCertificationDO::buildPilotCertificationDTO).collect(Collectors.toList());
collect = collect.stream().skip((pageNo - 1) * param.getPageSize()).limit(param.getPageSize()).
collect(Collectors.toList());
Integer tokenUserId = param.getTokenUserId();
if (tokenUserId!=null){
List<ForumAttentionDO> info = info(param.getTokenUserId());
for (ForumAttentionDO forumAttentionDO : info) {
for (PilotCertificationDTO pilotCertificationDTO : collect) {
if (forumAttentionDO.getMutualAttention().equals(true)){
if (pilotCertificationDTO.getUserAccountId().equals(forumAttentionDO.getUserAccountId())||
pilotCertificationDTO.getUserAccountId().equals(forumAttentionDO.getAttentionUserAccountId())){
pilotCertificationDTO.setStatus(true);
}
}
if (forumAttentionDO.getMutualAttention().equals(false)){
if (pilotCertificationDTO.getUserAccountId().equals(forumAttentionDO.getUserAccountId())){
pilotCertificationDTO.setStatus(true);
}
}
}
}
}
PageResult pageResult = PageResult.buildPage(pageNo, param.getPageSize(), pilotList.size(), collect);
return pageResult;
}
public List<ForumAttentionDO> info( Integer userAccountId) {
String token = null;
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("token", token);
HttpEntity<String> entity = new HttpEntity<>(userAccountId.toString(), headers);
ResponseEntity<String> exchange = restTemplate.exchange(imsApp + "/release/dynamic/getPilot?userAccountId=" + userAccountId , HttpMethod.GET, entity, String.class);
Object body = exchange.getBody();
JSONObject jsonObject1 = JSONObject.parseObject(body.toString());
List<Map> mapList = (List<Map>)jsonObject1.get("result");
List<ForumAttentionDO> forumAttentionDOS = JSON.parseArray(JSON.toJSONString(mapList), ForumAttentionDO.class);
return forumAttentionDOS;
}
@Override
public PilotCertificationDTO detailPilot(Integer id) {
PilotCertificationDO certificationDO = certificationDao.detailPilot(id);
......
......@@ -620,12 +620,27 @@ public class PayWalletServiceImpl implements PayWalletService {
return handleOrderRefund(payUavWalletVO, userWalletInfo, payLogDO, payWalletDO);
} else if (orderStatus.equals(PayMethodEnums.ORDER_INCOME.getCode())) {
return handleOrderIncome(payUavWalletVO, userWalletInfo, payLogDO, payWalletDO);
} else if (orderStatus.equals(PayMethodEnums.GIVE_BACK_PLEDGE.getCode())) {
return handleGiveBackPledge(payUavWalletVO, userWalletInfo, payLogDO, payWalletDO);
} else {
return handleConfirmReceipt(payUavWalletVO, userWalletInfo, payLogDO, payWalletDO);
}
}
@Transactional(rollbackFor = Exception.class)
ResultBody handleGiveBackPledge(PayUavWalletVO payUavWalletVO, PayWalletDO userWalletInfo, PayLogDO payLogDO, PayWalletDO payWalletDO) {
payLogDO.setPayMethod(payUavWalletVO.getOrderStatus());
payLogDO.setCashAmtPaid(payUavWalletVO.getCashAmount());
payLogDO.setSalaryAmtPaid(payUavWalletVO.getSalaryAmount());
// 如果是1600 回滚解冻金额
payWalletDO.setCashAmt(userWalletInfo.getCashAmt().add(payUavWalletVO.getCashAmount()));
payWalletDO.setSalaryAmt(userWalletInfo.getSalaryAmt().add(payUavWalletVO.getSalaryAmount()));
payWalletDao.insertPayLogDO(payLogDO);
payWalletDao.updatePayWallet(payWalletDO);
return ResultBody.success();
}
@Transactional(rollbackFor = Exception.class)
public ResultBody handlePublishOrder(PayUavWalletVO payUavWalletVO, PayWalletDO userWalletInfo, PayLogDO payLogDO, PayWalletDO payWalletDO) {
// 获取下单金额是否大于该用户钱包金额
if (userWalletInfo.getCashAmt().compareTo(payUavWalletVO.getCashAmount()) < 0) {
......
......@@ -97,5 +97,7 @@ iuav:
uri: http://payment-svc:8088
pms:
uri: http://pms-svc:8099
ims:
uri: http://ims-svc:10001
scheduling:
enabled: true
\ No newline at end of file
enabled: true
......@@ -61,3 +61,5 @@ iuav:
uri: http://127.0.0.1:8088
pms:
uri: http://127.0.0.1:8099
ims:
uri: http://localhost:10001
......@@ -89,5 +89,7 @@ iuav:
uri: http://payment-svc:8088
pms:
uri: http://pms-svc:8099
ims:
uri: http://ims-svc:10001
scheduling:
enabled: true
\ No newline at end of file
enabled: true
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 483af31aa68c82799c8554fe778ce23f35088b8b
newTag: 31caad5477754d8ddc1ecc24cbd85ecb416cfba0
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论