This commit is contained in:
BOOL\25024
2025-03-06 15:36:44 +08:00
9 changed files with 121 additions and 32 deletions

View File

@@ -6,22 +6,18 @@ import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.PageUtils;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.dto.CreateMerchantDTO;
import com.jsowell.pile.dto.QueryMerchantInfoDTO;
import com.jsowell.pile.service.PileMerchantInfoService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import org.apache.commons.collections4.CollectionUtils;
import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
@@ -140,4 +136,23 @@ public class PileMerchantInfoController extends BaseController {
PageUtils.startPage(pageNum, pageSize);
return getDataTable(pileMerchantInfoService.queryMerchantInfoListByAuth(dto));
}
/**
* 查询运营商配置的提现方式
*/
@PreAuthorize("@ss.hasPermi('pile:merchant:query')")
@PostMapping("/queryWithdrawalType")
public AjaxResult queryWithdrawalType(@RequestBody QueryMerchantInfoDTO dto) {
return AjaxResult.success(pileMerchantInfoService.queryWithdrawalType(dto));
}
/**
* 修改提现方式
*/
@PreAuthorize("@ss.hasPermi('pile:merchant:edit')")
@Log(title = "修改提现方式", businessType = BusinessType.UPDATE)
@PutMapping("/updateWithdrawalType")
public AjaxResult updateWithdrawalType(@RequestBody MerchantWithdrawalTypeVO dto) {
return toAjax(pileMerchantInfoService.updateWithdrawalType(dto));
}
}

View File

@@ -0,0 +1,6 @@
package com.jsowell.pile.dto;
import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO;
public class MerchantWithdrawalTypeDTO extends MerchantWithdrawalTypeVO {
}

View File

@@ -5,6 +5,7 @@ import com.jsowell.pile.dto.CreateMerchantDTO;
import com.jsowell.pile.dto.QueryMerchantInfoDTO;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.web.MerchantSettleInfoVO;
import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO;
import com.jsowell.pile.vo.web.PileMerchantInfoVO;
import java.util.List;
@@ -187,4 +188,8 @@ public interface PileMerchantInfoService {
* @return
*/
PileMerchantInfoVO queryMerchantInfoByStationId(String stationId);
MerchantWithdrawalTypeVO queryWithdrawalType(QueryMerchantInfoDTO dto);
int updateWithdrawalType(MerchantWithdrawalTypeVO dto);
}

View File

@@ -8,10 +8,7 @@ import com.jsowell.common.core.domain.vo.AuthorizedDeptVO;
import com.jsowell.common.enums.adapay.AdapayPayChannelEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.DictUtils;
import com.jsowell.common.util.PageUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.*;
import com.jsowell.common.util.spring.SpringUtils;
import com.jsowell.pile.domain.PileMerchantInfo;
import com.jsowell.pile.dto.CreateMerchantDTO;
@@ -21,6 +18,7 @@ import com.jsowell.pile.service.PileMerchantInfoService;
import com.jsowell.pile.util.UserUtils;
import com.jsowell.pile.vo.base.MerchantInfoVO;
import com.jsowell.pile.vo.web.MerchantSettleInfoVO;
import com.jsowell.pile.vo.web.MerchantWithdrawalTypeVO;
import com.jsowell.pile.vo.web.PileMerchantInfoVO;
import com.jsowell.system.service.SysDeptService;
import com.jsowell.system.service.SysUserService;
@@ -643,4 +641,33 @@ public class PileMerchantInfoServiceImpl implements PileMerchantInfoService {
return pileMerchantInfoMapper.queryMerchantInfoByStationId(stationId);
}
@Override
public MerchantWithdrawalTypeVO queryWithdrawalType(QueryMerchantInfoDTO dto) {
PileMerchantInfo pileMerchantInfo = pileMerchantInfoMapper.selectPileMerchantInfoById(Long.parseLong(dto.getMerchantId()));
if (pileMerchantInfo != null) {
MerchantWithdrawalTypeVO merchantWithdrawalTypeVO = new MerchantWithdrawalTypeVO();
merchantWithdrawalTypeVO.setMerchantId(pileMerchantInfo.getId() + "");
merchantWithdrawalTypeVO.setWithdrawalType(pileMerchantInfo.getDelayMode());
merchantWithdrawalTypeVO.setReservedAmount(pileMerchantInfo.getReservedAmount());
return merchantWithdrawalTypeVO;
}
return null;
}
@Override
public int updateWithdrawalType(MerchantWithdrawalTypeVO dto) {
if (dto == null || StringUtils.isBlank(dto.getMerchantId()) || StringUtils.isBlank(dto.getWithdrawalType())) {
return 0;
}
PileMerchantInfo merchantInfo = new PileMerchantInfo();
merchantInfo.setId(Long.parseLong(dto.getMerchantId()));
merchantInfo.setWithdrawalType(dto.getWithdrawalType());
if (dto.getReservedAmount() != null) {
merchantInfo.setReservedAmount(dto.getReservedAmount());
}
merchantInfo.setUpdateBy(SecurityUtils.getUsername());
merchantInfo.setUpdateTime(DateUtils.getNowDate());
return pileMerchantInfoMapper.updatePileMerchantInfo(merchantInfo);
}
}

View File

@@ -5,6 +5,8 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
@Data
@NoArgsConstructor
@AllArgsConstructor
@@ -50,4 +52,14 @@ public class MerchantInfoVO {
*/
private String adapayMemberId;
/**
* 提现类型(1-手动提现, 2-自动提现)
*/
private String withdrawalType;
/**
* 预留金额
*/
private BigDecimal reservedAmount;
}

View File

@@ -0,0 +1,32 @@
package com.jsowell.pile.vo.web;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* 运营商提现类型VO
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class MerchantWithdrawalTypeVO {
/**
* 运营商ID
*/
private String merchantId;
/**
* 提现类型(1-手动提现, 2-自动提现)
*/
private String withdrawalType;
/**
* 预留金额
*/
private BigDecimal reservedAmount;
}

View File

@@ -226,6 +226,8 @@ public class JsowellTask {
/**
* 生成运营商日报表
* jsowellTask.generateMerchantBill()
*
*
*/
public void generateMerchantBill() {
// 查询运营商列表

View File

@@ -183,21 +183,13 @@ public class JiangSuPlatformServiceImpl implements ThirdPartyPlatformService {
data.put("StationInfo", nrStationInfo);
String jsonString = data.toString();
System.out.println("jsonString : " + jsonString);
// System.out.println("jsonString : " + jsonString);
// 获取令牌
String token = getToken(urlAddress, operatorId, operatorSecret, dataSecretIv, signSecret, dataSecret);
System.out.println(token);
String result = HttpRequestUtil.nrSendPost(token, jsonString, url, dataSecret
, dataSecretIv, operatorId, signSecret);
// 新增数据库
PushStationInfoDTO dto = new PushStationInfoDTO();
dto.setThirdPartyType(thirdPlatformType);
dto.setStationId(Long.parseLong(stationId));
commonService.insertInfo2DataBase(dto);
return thirdPlatformType + "" + result;
return result;
}

View File

@@ -541,8 +541,9 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
, dataSecretIv, operatorId, signSecret);
// 新增数据库
thirdPartyStationRelationService.insertInfo2DataBase(thirdPlatformType, stationId);
return thirdPlatformType + "" + result;
// thirdPartyStationRelationService.insertInfo2DataBase(thirdPlatformType, stationId);
// return thirdPlatformType + "" + result;
return result;
}
/**
@@ -618,17 +619,14 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService {
.totalMoney(new BigDecimal(realTimeMonitorData.getChargingAmount()).setScale(2, BigDecimal.ROUND_HALF_UP))
.build();
// 通过站点id查询相关配置信息
ThirdPartyStationRelationVO relationInfo = thirdPartyStationRelationService.selectRelationInfo(orderInfo.getStationId());
if (relationInfo == null) {
return null;
}
String operatorId = relationInfo.getOperatorId();
String operatorSecret = relationInfo.getOperatorSecret();
String signSecret = relationInfo.getSignSecret();
String dataSecret = relationInfo.getDataSecret();
String dataSecretIv = relationInfo.getDataSecretIv();
String urlAddress = relationInfo.getUrlAddress();
ThirdPartySecretInfoVO thirdPartySecretInfoVO = getLianLianPlatformSecretInfo();
String operatorId = thirdPartySecretInfoVO.getTheirOperatorId();
String operatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
String signSecret = thirdPartySecretInfoVO.getTheirSigSecret();
String dataSecret = thirdPartySecretInfoVO.getTheirDataSecret();
String dataSecretIv = thirdPartySecretInfoVO.getTheirDataSecretIv();
String urlAddress = thirdPartySecretInfoVO.getTheirUrlPrefix();
String url = urlAddress + "notification_connector_charge_status";