TRX 1 yıl önce
ebeveyn
işleme
237065ba6c

+ 1 - 1
FullCardClient/src/main/java/com/zhongshu/card/client/model/scene/SceneInfoModel.java

@@ -39,7 +39,7 @@ public class SceneInfoModel extends SuperModel {
     }
 
     @Schema(description = "布局尺寸")
-    private String size;
+    private String layout;
 
     @Schema(description = "状态")
     private DataState state;

+ 1 - 1
FullCardClient/src/main/java/com/zhongshu/card/client/model/scene/SceneInfoParam.java

@@ -36,7 +36,7 @@ public class SceneInfoParam extends SuperParam {
 
     @NotEmpty
     @Schema(description = "布局尺寸")
-    private String size;
+    private String layout;
 
     @Schema(description = "状态")
     private DataState state = DataState.Enable;

+ 1 - 1
FullCardClient/src/main/java/com/zhongshu/card/client/model/scene/SceneInfoSearch.java

@@ -27,7 +27,7 @@ public class SceneInfoSearch extends SuperSearch {
     private SceneType sceneType;
 
     @Schema(description = "布局尺寸")
-    private String size;
+    private String layout;
 
     @Schema(description = "状态")
     private DataState state = DataState.Enable;

+ 3 - 3
FullCardServer/src/main/java/com/zhongshu/card/server/core/dao/scene/impl/SceneInfoDaoImpl.java

@@ -42,8 +42,8 @@ public class SceneInfoDaoImpl extends BaseImpl implements SceneInfoDaoExtend {
             criteria.and("sceneType").is(param.getSceneType());
         }
 
-        if (param.getSize() != null) {
-            criteria.and("size").is(param.getSize());
+        if (StringUtils.isNotEmpty(param.getLayout())) {
+            criteria.and("layout").is(param.getLayout());
         }
 
         if (param.getState() != null) {
@@ -51,7 +51,7 @@ public class SceneInfoDaoImpl extends BaseImpl implements SceneInfoDaoExtend {
         }
 
         if (!CommonUtil.longIsEmpty(param.getStartTime()) && !CommonUtil.longIsEmpty(param.getEndTime())) {
-            criteria.and("createTime").gte(param.getStartTime()).and("createTime").lte(param.getEndTime());
+            criteria.and("createTime").gte(param.getStartTime()).lte(param.getEndTime());
         }
 
         // 模糊搜索

+ 1 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/scene/SceneInfo.java

@@ -36,7 +36,7 @@ public class SceneInfo extends SuperMain {
     private SceneType sceneType;
 
     @Schema(description = "布局尺寸")
-    private String size;
+    private String layout;
 
     @Schema(description = "状态")
     private DataState state = DataState.Enable;

+ 12 - 17
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/pay/ChinaumsSenselessPayService.java

@@ -22,20 +22,17 @@ import com.github.microservice.types.payment.PaymentType;
 import com.zhongshu.card.client.model.pay.ChinaumsSenselessUserSignInfoModel;
 import com.zhongshu.card.client.model.pay.UnionApplySignParam;
 import com.zhongshu.card.client.type.ContractState;
-import com.zhongshu.card.client.type.RefundState;
 import com.zhongshu.card.client.type.ShareOrderType;
 import com.zhongshu.card.client.utils.DateUtils;
 import com.zhongshu.card.server.core.dao.pay.ChinaumsSenselessUserSignInfoDao;
 import com.zhongshu.card.server.core.dao.pay.ShareOrderDao;
-import com.zhongshu.card.server.core.dao.payment.ExpenseFlowDao;
 import com.zhongshu.card.server.core.domain.pay.ChinaumsSenselessUserSignInfo;
 import com.zhongshu.card.server.core.domain.pay.PayAccount;
 import com.zhongshu.card.server.core.domain.pay.ShareOrder;
-import com.zhongshu.card.server.core.domain.payment.ExpenseFlow;
 import com.zhongshu.card.server.core.model.pay.UnionFrictionlessPayFinishModel;
 import com.zhongshu.card.server.core.service.base.SuperService;
 import com.zhongshu.card.server.core.service.paySetting.OrgPayAccountService;
-import com.zhongshu.card.server.core.service.payment.PayCallService;
+import com.zhongshu.card.server.core.service.paySetting.ProjectMainPaySettingService;
 import com.zhongshu.card.server.core.util.BeanUtils;
 import com.zhongshu.card.server.core.util.CommonUtil;
 import io.micrometer.common.util.StringUtils;
@@ -74,7 +71,8 @@ public class ChinaumsSenselessPayService extends SuperService {
     @Autowired
     ShareOrderDao shareOrderDao;
 
-
+    @Autowired
+    private ProjectMainPaySettingService projectMainPaySettingService;
 
     /**
      * 银联申请签约
@@ -174,14 +172,11 @@ public class ChinaumsSenselessPayService extends SuperService {
         return ResultContent.buildFail("银联请求失败");
     }
 
-    public boolean isSigned(String projectOid, String userId){
-        String accountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
-        com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
-        if (!accountModelResultContent.getState().equals(ResultState.Success)) {
-            throw new RuntimeException(accountModelResultContent.getMsg());
+    public boolean isSigned(String projectOid, String userId) {
+        String mid = projectMainPaySettingService.getProjectPaymentMchId(projectOid, PaymentType.UnionFrictionlessPay);
+        if (org.apache.commons.lang3.StringUtils.isEmpty(mid)) {
+            return false;
         }
-        ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
-        String mid = conf.getMchId();
         ChinaumsSenselessUserSignInfo topByUserIdAndMidAndExpire = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
         return topByUserIdAndMidAndExpire.getContractState().equals(ContractState.SIGNED);
     }
@@ -425,23 +420,23 @@ public class ChinaumsSenselessPayService extends SuperService {
         Map bodyMap = JsonUtil.toObject(JsonUtil.toJson(refundResultContent.getContent()), Map.class);
 
         if (bodyMap.get("respCode").equals("TARGET_PROCESSING")) {
-            UnionFrictionlessPayFinishModel unionFrictionlessPayFinishModel = ExecuteQueueUtil.execute(5, index->{
+            UnionFrictionlessPayFinishModel unionFrictionlessPayFinishModel = ExecuteQueueUtil.execute(5, index -> {
                 return Map.of(1, 1000L, 2, 1000L, 3, 1000L, 4, 2000L).getOrDefault(index, 3000L);
-            }, it->{
+            }, it -> {
                 var result = new ExecuteQueueUtil.Result<UnionFrictionlessPayFinishModel>();
 
                 ResultContent<UnionFrictionlessPayFinishModel> refundQuery = refundQuery(projectOid, userId, oid, refundOrderNo, true);
-                if (!refundQuery.getState().equals(com.github.microservice.net.ResultState.Success)){
+                if (!refundQuery.getState().equals(com.github.microservice.net.ResultState.Success)) {
                     log.info("查询退款结果失败:{}", refundQuery.getMsg());
                     return null;
                 }
-                if (refundQuery.getContent().getRefundStatus().equals("SUCCESS") || refundQuery.getContent().getRefundStatus().equals("FAIL")){
+                if (refundQuery.getContent().getRefundStatus().equals("SUCCESS") || refundQuery.getContent().getRefundStatus().equals("FAIL")) {
                     result.setData(refundQuery.getContent());
                     result.setDone(true);
                     return result;
                 }
                 long time = System.currentTimeMillis() - it.getStartTime();
-                if (time > 3000L){
+                if (time > 3000L) {
 
                 }
                 log.info("退款状态未知或退款中,继续查询,index:{}", it.getIndex());

+ 0 - 15
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/PayOrderSettingService.java

@@ -19,7 +19,6 @@ import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.util.StopWatch;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -129,19 +128,14 @@ public class PayOrderSettingService extends SuperService {
      * @return
      */
     public ResultContent<List<PaymentType>> getUserPayment(String userId, String projectOid) {
-        StopWatch stopWatch = new StopWatch();
-        stopWatch.start("查询项目支付");
         // 得到项目支持的付款方式
         List<PaymentType> supportTypes = getProjectPayment(projectOid);
         if (ObjectUtils.isEmpty(supportTypes)) {
             return ResultContent.buildFail("项目暂无开启支付渠道");
         }
-        stopWatch.stop();
-
 
         // 不同的支付渠道 结合当前用户判断
         if (ObjectUtils.isNotEmpty(supportTypes)) {
-            stopWatch.start("查询用户排序");
             // 用户的排序
             List<PayOrderSetting> payOrderSettings = payOrderSettingDao.findByUserIdAndProjectOidOrderBySortAsc(userId, projectOid);
             if (ObjectUtils.isNotEmpty(payOrderSettings)) {
@@ -157,20 +151,14 @@ public class PayOrderSettingService extends SuperService {
                     }
                 });
             }
-            stopWatch.stop();
         }
-
-        stopWatch.start("3");
         // 转换后的
         List<PaymentType> userPaymentTypes = new ArrayList<>();
         if (ObjectUtils.isNotEmpty(supportTypes)) {
             for (PaymentType paymentType : supportTypes) {
                 paymentType = payCallService.turnPaymentType(paymentType);
                 if (paymentType == PaymentType.UnionFrictionlessPay) {
-                    stopWatch.stop();
-                    stopWatch.start("是否签约");
                     boolean b = chinaumsSenselessPayService.isSigned(projectOid, userId);
-                    stopWatch.stop();
                     if (!b) {
                         log.info("用户未开启银联无感支付: {}", userId);
                         continue;
@@ -182,9 +170,6 @@ public class PayOrderSettingService extends SuperService {
                 }
             }
         }
-        stopWatch.start("122");
-        stopWatch.stop();
-        log.info("cx111; {}", stopWatch.prettyPrint());
         return ResultContent.buildSuccess(userPaymentTypes);
     }
 

+ 1 - 1
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/paySetting/ProjectMainPaySettingService.java

@@ -158,7 +158,7 @@ public class ProjectMainPaySettingService extends SuperService {
      */
     public String getProjectPaymentMchId(String projectOid, PaymentType paymentType) {
         ProjectMainPaySetting mainPaySetting = projectMainPaySettingDao.findTopByProjectOidAndChannelType(projectOid, paymentType);
-        if (ObjectUtils.isNotEmpty(mainPaySetting)) {
+        if (mainPaySetting != null) {
             ProjectOrgPaySettingInfo paySettingInfo = mainPaySetting.getPaySettingInfo();
             if (paySettingInfo != null) {
                 return paySettingInfo.getMchId();

+ 7 - 7
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/scene/SceneInfoService.java

@@ -42,7 +42,7 @@ public class SceneInfoService extends SuperService {
         SceneInfo entity = null;
 
         SceneInfo temp = sceneInfoDao.findTopByName(param.getName());
-        SceneInfo codeTemp = sceneInfoDao.findTopByCode(param.getCode());
+//        SceneInfo codeTemp = sceneInfoDao.findTopByCode(param.getCode());
         if (StringUtils.isNotEmpty(param.getId())) {
             entity = sceneInfoDao.findTopById(param.getId());
             if (ObjectUtils.isEmpty(entity)) {
@@ -51,18 +51,18 @@ public class SceneInfoService extends SuperService {
             if (ObjectUtils.isNotEmpty(temp) && !temp.getId().equals(entity.getId())) {
                 return ResultContent.buildFail(String.format("名称已存在:%s", param.getName()));
             }
-            if (ObjectUtils.isNotEmpty(codeTemp) && !codeTemp.getId().equals(entity.getId())) {
-                return ResultContent.buildFail(String.format("code已存在:%s", param.getName()));
-            }
+//            if (ObjectUtils.isNotEmpty(codeTemp) && !codeTemp.getId().equals(entity.getId())) {
+//                return ResultContent.buildFail(String.format("code已存在:%s", param.getName()));
+//            }
             initUpdateEntity(entity);
             isAdd = false;
         } else {
             if (ObjectUtils.isNotEmpty(temp)) {
                 return ResultContent.buildFail(String.format("名称已存在:%s", param.getName()));
             }
-            if (ObjectUtils.isNotEmpty(codeTemp)) {
-                return ResultContent.buildFail(String.format("code已存在:%s", param.getName()));
-            }
+//            if (ObjectUtils.isNotEmpty(codeTemp)) {
+//                return ResultContent.buildFail(String.format("code已存在:%s", param.getName()));
+//            }
             entity = new SceneInfo();
             initEntityNoCheckOid(entity);
         }