Forráskód Böngészése

Merge remote-tracking branch 'origin/test' into test

dongxin 1 éve
szülő
commit
b3f42201e5
45 módosított fájl, 922 hozzáadás és 675 törlés
  1. 2 3
      src/main/java/com/ydtech/modules/admin/controller/APPPartnerController.java
  2. 1 0
      src/main/java/com/ydtech/modules/admin/dao/SysLogDao.java
  3. 3 1
      src/main/java/com/ydtech/modules/admin/dao/SysPartnerMapper.java
  4. 6 0
      src/main/java/com/ydtech/modules/admin/dao/SysPremiumDetailsMapper.java
  5. 10 15
      src/main/java/com/ydtech/modules/admin/dao/SysUserBankCardMapper.java
  6. 24 4
      src/main/java/com/ydtech/modules/admin/model/SysPremiumDetails.java
  7. 2 0
      src/main/java/com/ydtech/modules/admin/model/dto/PartnerInfoDto.java
  8. 0 3
      src/main/java/com/ydtech/modules/admin/model/vo/AppSysPartnerVo.java
  9. 20 0
      src/main/java/com/ydtech/modules/admin/model/vo/LevelPartnerInfoVo.java
  10. 7 0
      src/main/java/com/ydtech/modules/admin/model/vo/SysUserBaseVO.java
  11. 2 2
      src/main/java/com/ydtech/modules/admin/service/SysPartnerService.java
  12. 7 3
      src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java
  13. 4 3
      src/main/java/com/ydtech/modules/admin/service/impl/SysAmountAuditingServiceImpl.java
  14. 504 233
      src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java
  15. 3 2
      src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java
  16. 1 0
      src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java
  17. 8 4
      src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java
  18. 1 1
      src/main/java/com/ydtech/modules/ins/model/vo/res/BxOtherDetailsNorExcel.java
  19. 1 1
      src/main/java/com/ydtech/modules/ins/model/vo/res/SettlementFeesExcel.java
  20. 5 8
      src/main/java/com/ydtech/modules/inv/utils/CheckInsPlyComeUtils.java
  21. 18 11
      src/main/java/com/ydtech/modules/lg/PushLgLogUtils.java
  22. 32 13
      src/main/java/com/ydtech/modules/lg/PushRetry.java
  23. 1 1
      src/main/java/com/ydtech/modules/lg/SendUtils.java
  24. 5 0
      src/main/java/com/ydtech/modules/lg/model/PushLgEntity.java
  25. 8 9
      src/main/java/com/ydtech/modules/order/entity/api/yangguang/constants/YgUseNatureCode.java
  26. 6 2
      src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangAccuracyCalculateRequest.java
  27. 1 0
      src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java
  28. 14 10
      src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java
  29. 1 0
      src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java
  30. 0 32
      src/main/java/com/ydtech/modules/ttqf/QuartzUserSign.java
  31. 0 77
      src/main/java/com/ydtech/modules/ttqf/RegularlyPaymentStatus.java
  32. 0 71
      src/main/java/com/ydtech/modules/ttqf/RegularlyUpdateStatus.java
  33. 46 40
      src/main/java/com/ydtech/modules/ttqf/RetrieveTTQFApi.java
  34. 1 2
      src/main/java/com/ydtech/modules/ttqf/SavePayOrder.java
  35. 0 18
      src/main/java/com/ydtech/modules/ttqf/controller/TtqfController.java
  36. 2 1
      src/main/java/com/ydtech/modules/ttqf/entity/vo/UserWithdrawal.java
  37. 85 79
      src/main/java/com/ydtech/modules/ttqf/service/impl/TtqfServiceImpl.java
  38. 1 1
      src/main/resources/application-pre.yml
  39. 1 1
      src/main/resources/application-prod.yml
  40. 1 1
      src/main/resources/application-test.yml
  41. 8 1
      src/main/resources/mapper/modules/admin/SysAmountAuditingMapper.xml
  42. 15 8
      src/main/resources/mapper/modules/admin/SysPartnerMapper.xml
  43. 51 0
      src/main/resources/mapper/modules/admin/SysPremiumDetailsMapper.xml
  44. 1 1
      src/main/resources/mapper/modules/esm/EsmUserImageMapper.xml
  45. 13 13
      src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

+ 2 - 3
src/main/java/com/ydtech/modules/admin/controller/APPPartnerController.java

@@ -4,7 +4,6 @@ import com.alipay.api.AlipayApiException;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysPartnerAccount;
-import com.ydtech.modules.admin.model.SysPremiumDetails;
 import com.ydtech.modules.admin.model.dto.*;
 import com.ydtech.modules.admin.model.vo.*;
 import com.ydtech.modules.admin.service.SysPartnerService;
@@ -135,7 +134,7 @@ public class APPPartnerController extends BaseController {
      */
     @PostMapping("/getCommissionInfo")
     @ApiOperation(value = "总佣金组成明细")
-    public HttpResult<BasePageResult<SysPremiumDetails>> getCommissionInfo(@RequestBody CommissionInfoDto commissionInfoDto) {
+    public HttpResult<BasePageResult<SysPremiumDetailsVo>> getCommissionInfo(@RequestBody CommissionInfoDto commissionInfoDto) {
         if (commissionInfoDto.getPageNum() == 0) {
             commissionInfoDto.setPageNum(1);
         }
@@ -218,7 +217,7 @@ public class APPPartnerController extends BaseController {
      */
     @PostMapping("/getLevelPartnerInfo")
     @ApiOperation(value = "排行榜->查看详情")
-    public HttpResult<PartnerInfoFreeVo> getLevelPartnerInfo(@RequestBody List<String> partnerIds) {
+    public HttpResult<List<LevelPartnerInfoVo>> getLevelPartnerInfo(@RequestBody List<String> partnerIds) {
 
         return HttpResult.ok("success",this.sysPartnerService.getLevelPartnerInfo(partnerIds));
     }

+ 1 - 0
src/main/java/com/ydtech/modules/admin/dao/SysLogDao.java

@@ -10,6 +10,7 @@ import java.util.List;
 @Repository
 public interface SysLogDao {
 
+
     /**
      * description:selectByPrimaryKey
      *

+ 3 - 1
src/main/java/com/ydtech/modules/admin/dao/SysPartnerMapper.java

@@ -35,8 +35,10 @@ public interface SysPartnerMapper extends BaseMapper<SysPartner> {
      *  @Description:  机构树形
      */
     List<SysPartnerConsoleDto> getTreeDeptUser(PartnerBalanceVo partnerBalanceVo);
-
+    //直接
     List<SysPartner> queryByLoginId(@Param("userId") String userId);
+    //间接
+    List<SysPartner> queryIndirectByLoginId(@Param("userId") String userId);
 
     List<CountUserNumVo> queryDeptByTime(@Param("deptIds") List<String> deptIds, @Param("dto") CountUserDto countUserDto);
     List<CountUserNumVo> queryDeptByTimes(@Param("deptIds") List<String> deptIds, @Param("dto") CountUserDto countUserDto);

+ 6 - 0
src/main/java/com/ydtech/modules/admin/dao/SysPremiumDetailsMapper.java

@@ -5,14 +5,20 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ydtech.modules.admin.model.SysPremiumDetails;
 import com.ydtech.modules.admin.model.dto.AgencyUserInsAreaDto;
+import com.ydtech.modules.admin.model.dto.CommissionInfoDto;
 import com.ydtech.modules.admin.model.vo.AgencyUserInsAreaVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
+import java.util.List;
+import java.util.Map;
+
 @Mapper
 public interface SysPremiumDetailsMapper extends BaseMapper<SysPremiumDetails> {
 
     void updateStatus(String id);
 
     IPage<AgencyUserInsAreaVo> queryInsAreaPageById(Page page,@Param("dto") AgencyUserInsAreaDto agencyUserInsAreaDto);
+
+    List<Map<String, Object>> queryInfoPage(@Param("userId") String userId,  @Param("dto") CommissionInfoDto commissionInfoDto);
 }

+ 10 - 15
src/main/java/com/ydtech/modules/admin/dao/SysUserBankCardMapper.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.admin.dao;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.po.SysUserBankCard;
 import com.ydtech.modules.admin.model.po.SysUserBankCardHistory;
 import com.ydtech.modules.admin.model.vo.SysUserBankCardVO;
@@ -30,22 +31,16 @@ public interface SysUserBankCardMapper extends BaseMapper<SysUserBankCard> {
     List<SysUserBankCardHistory> getUserBankCardHistoryList(@Param("sysUserBankCardHistory") SysUserBankCardHistory sysUserBankCardHistory);
 
     @Select("SELECT " +
-            "  u.mobile, " +
-            "  u.identity, " +
-            "  u.identity_time, " +
-            "  b.real_user_name AS user_name, " +
-            "  b.user_id, " +
-            "  b.bank_number, " +
-            "  d.management_source " +
+            " u.mobile,u.id, " +
+            " u.identity, " +
+            " u.identity_time, " +
+            " u.`name`, " +
+            " d.management_source  " +
             " FROM " +
-            "  sys_user_bank_card b " +
-            "  INNER JOIN sys_user u ON u.id = b.user_id " +
-            "  INNER JOIN sys_dept d ON u.dept_id = d.id " +
-            "   " +
-            " WHERE " +
-            "  b.is_default = 1  " +
-            "  AND b.user_id = #{userId}")
-    SysUserBankCard selectByIdPay(@Param("userId") String userId);
+            " sys_user u " +
+            " INNER JOIN sys_dept d ON u.dept_id = d.id " +
+            " WHERE u.id = #{userId}")
+    SysUser selectByIdPay(@Param("userId") String userId);
 }
 
 

+ 24 - 4
src/main/java/com/ydtech/modules/admin/model/SysPremiumDetails.java

@@ -119,8 +119,28 @@ public class SysPremiumDetails {
     @ApiModelProperty(value = "费用来源(1,2,3,4,5级)")
     private Integer source;
 
-
-
-
-
+    @Override
+    public String toString() {
+        return "SysPremiumDetails{" +
+                "id=" + id +
+                ", userId='" + userId + '\'' +
+                ", userName='" + userName + '\'' +
+                ", issuerId='" + issuerId + '\'' +
+                ", issuerName='" + issuerName + '\'' +
+                ", orderno='" + orderno + '\'' +
+                ", companyId='" + companyId + '\'' +
+                ", sumpremium=" + sumpremium +
+                ", jqpremium=" + jqpremium +
+                ", sypremium=" + sypremium +
+                ", jypremium=" + jypremium +
+                ", proportional='" + proportional + '\'' +
+                ", extractFee=" + extractFee +
+                ", status=" + status +
+                ", type=" + type +
+                ", industrySector=" + industrySector +
+                ", createTime=" + createTime +
+                ", licenseno='" + licenseno + '\'' +
+                ", source=" + source +
+                '}';
+    }
 }

+ 2 - 0
src/main/java/com/ydtech/modules/admin/model/dto/PartnerInfoDto.java

@@ -15,4 +15,6 @@ public class PartnerInfoDto {
 
     @ApiModelProperty(value = "等级 1一级;2二级;3级")
     private Integer partnerType;
+    @ApiModelProperty(value = "用户ID")
+    private String userId;
 }

+ 0 - 3
src/main/java/com/ydtech/modules/admin/model/vo/AppSysPartnerVo.java

@@ -34,9 +34,6 @@ public class AppSysPartnerVo {
     @ApiModelProperty(value = "团队总人数")
     private Integer TeamManNum;
 
-    @ApiModelProperty(value = "合伙人+工作室数量")
-    private Integer number;
-
     @ApiModelProperty(value = "工作室数量")
     private Integer workNumber;
     //二级以下使用

+ 20 - 0
src/main/java/com/ydtech/modules/admin/model/vo/LevelPartnerInfoVo.java

@@ -0,0 +1,20 @@
+package com.ydtech.modules.admin.model.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class LevelPartnerInfoVo {
+
+    @ApiModelProperty(value = "用户Id")
+    private String userId;
+
+    @ApiModelProperty(value = "用户名称")
+    private String userName;
+
+    @ApiModelProperty(value = "用户等级")
+    private Integer level;
+
+    @ApiModelProperty(value = "人数")
+    private int deptManNum;
+}

+ 7 - 0
src/main/java/com/ydtech/modules/admin/model/vo/SysUserBaseVO.java

@@ -119,4 +119,11 @@ public class SysUserBaseVO {
 
     @ApiModelProperty(value = "银行卡号信息")
     private String bankCardNumbers;
+
+
+    @ApiModelProperty(value = "身份证号")
+    private String identity;
+
+    @ApiModelProperty(value = "居住地址")
+    private String liveAddress = "";
 }

+ 2 - 2
src/main/java/com/ydtech/modules/admin/service/SysPartnerService.java

@@ -55,7 +55,7 @@ public interface SysPartnerService extends IService<SysPartner> {
 
     PartnerInfoFreeVo queryPartnerInfo(PartnerGradeInfo partnerGradeInfo);
 
-    BasePageResult<SysPremiumDetails> getCommissionInfo(CommissionInfoDto commissionInfoDto);
+    BasePageResult<SysPremiumDetailsVo> getCommissionInfo(CommissionInfoDto commissionInfoDto);
 
     List<SysPremiumDetailsVo> getCommissionInfos(CommissionInfoDto commissionInfoDto);
 
@@ -88,5 +88,5 @@ public interface SysPartnerService extends IService<SysPartner> {
 
     String checkBindWechat();
 
-    PartnerInfoFreeVo getLevelPartnerInfo(List<String> partnerIds);
+    List<LevelPartnerInfoVo> getLevelPartnerInfo(List<String> partnerIds);
 }

+ 7 - 3
src/main/java/com/ydtech/modules/admin/service/impl/ProfitAnalysisServiceImpl.java

@@ -81,11 +81,15 @@ public class ProfitAnalysisServiceImpl implements ProfitAnalysisService {
                     String enterCardNum = analysisDto.getEnterCardNum();
                     InvAccountCardVo outAccount = invAccountMapper.getByCarNumber(outCardNum);
                     InvAccountCardVo enterAccount  = invAccountMapper.getByCarNumber(enterCardNum);
-                    if(StringUtils.isNotEmpty(outAccount.getOuterFlag()) && StringUtils.isNotEmpty(enterAccount.getOuterFlag())){
-                        if(!enterAccount.getOuterFlag().equals(outAccount.getOuterFlag())){
-                            variableCost=variableCost.add(analysisDto.getApplyAmount());
+                    if(ObjectUtils.isNotEmpty(outAccount) &&  ObjectUtils.isNotEmpty(enterAccount) ){
+                        if( (StringUtils.isNotEmpty(outAccount.getOuterFlag()) && StringUtils.isNotEmpty(enterAccount.getOuterFlag()))){
+                            if(!enterAccount.getOuterFlag().equals(outAccount.getOuterFlag())){
+                                variableCost=variableCost.add(analysisDto.getApplyAmount());
+                            }
                         }
                     }
+
+
                 }
                 profitAnalysisDto.setVariableCost(variableCost);
             }

+ 4 - 3
src/main/java/com/ydtech/modules/admin/service/impl/SysAmountAuditingServiceImpl.java

@@ -139,20 +139,21 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
             //插入轨迹表
             SysAmountAuditingHistory sysAmountAuditingHistory =new SysAmountAuditingHistory(null, sysAmountAuditingEntity.getId(), amount, userId,new Date(),"4", "1",sysUserAccountHistory.getId());
             sysAmountAuditingHistoryService.save(sysAmountAuditingHistory);
+            sendLgParams(sysAmountAuditingEntity,sysAmountAuditingHistory.getAuditingStatus());
         }
     }
 
 
-    public void sendLgParams(SysAmountAuditingHistory sysAmountAuditingHistory,SysAmountAuditingEntity sysAmountAuditingEntity){
+    public void sendLgParams(SysAmountAuditingEntity sysAmountAuditingEntity,String auditingStatus){
         PushLgEntity lgEntity = new PushLgEntity();
         lgEntity.setApplicationTime(new Date());
         lgEntity.setBusinessUmber(sysAmountAuditingEntity.getId());
         lgEntity.setPayee(sysAmountAuditingEntity.getUserName());
         lgEntity.setPayeeId(String.valueOf(sysAmountAuditingEntity.getUserId()));
         lgEntity.setReceivingAccount(sysAmountAuditingEntity.getBankNumber());
-        lgEntity.setExtractMoney(sysAmountAuditingHistory.getAmount());
+        lgEntity.setExtractMoney(sysAmountAuditingEntity.getAmount());
         lgEntity.setServiceCharge(null);
-        lgEntity.setExtractStatus(sysAmountAuditingHistory.getAuditingStatus());
+        lgEntity.setExtractStatus(auditingStatus);
         pushLgEntityService.sendLgData(lgEntity);
     }
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 504 - 233
src/main/java/com/ydtech/modules/admin/service/impl/SysPartnerServiceImpl.java


+ 3 - 2
src/main/java/com/ydtech/modules/admin/service/impl/SysUserAccountServiceImpl.java

@@ -297,6 +297,7 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
             UserWithdrawal withdrawal = new UserWithdrawal();
             withdrawal.setUserId(userId);
             withdrawal.setAmount(sysUserAccountVo.getAmount());
+            withdrawal.setBankNumber(sysUserAccountVo.getFromBankCardId());
             return ttqfService.userCashOut(withdrawal);
         }
         //add  by  hxl   2024-09-26 添加电销组员开关
@@ -416,8 +417,8 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
     }
 
     public boolean isManagement(String userId) {
-        SysUserBankCard bankCard = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(userId);
-        if (ManagementSource.MS_02.getCode().equals(bankCard.getManagementSource())){
+        SysUser sysUser = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(userId);
+        if (ManagementSource.MS_02.getCode().equals(sysUser.getManagementSource())){
             return true;
         }
         return false;

+ 1 - 0
src/main/java/com/ydtech/modules/fnc/controller/InsPlyIncomeController.java

@@ -413,6 +413,7 @@ public class InsPlyIncomeController extends BaseController {
     @PostMapping("pinHandlingExcel")
     public HttpResult pinHandlingexcel(@RequestBody @ApiParam(name = "insPlyIncomeVo") InsPlyIncomeVo insPlyIncomeVo, HttpServletRequest request, HttpServletResponse response) {
         return insPlyIncomeService.pinHandlingexcel(insPlyIncomeVo, request, response);
+
     }
 
     @ApiModelProperty("保险手续费导出")

+ 8 - 4
src/main/java/com/ydtech/modules/fnc/service/impl/InsPlyIncomeServiceImpl.java

@@ -2012,12 +2012,15 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                         item.setHandlingFeesStatus("2");
                         if (StringUtils.isNotEmpty(item.getTaskId())) {
                             return HttpResult.error("该单据已经开票 ");
-                        } else {
-                            item.setTaskId(importResult.getId());
-                            item.setSettlementTime(LocalDateTime.now());
-                            baseMapper.updateById(item);
                         }
+
+//                        else {
+//                            item.setTaskId(importResult.getId());
+//                            item.setSettlementTime(LocalDateTime.now());
+//                            baseMapper.updateById(item);
+//                        }
                     }
+                    this.saveOrUpdateBatch(insPlyIncomes);
                 }
             }
         }
@@ -2997,6 +3000,7 @@ public class InsPlyIncomeServiceImpl extends ServiceImpl<InsPlyIncomeMapper, Ins
                     byBxLicenseno.setCommissionFeerate(this.calculateTotal(jqSuperviseCostsProportion,sySuperviseCostsProportion,noSuperviseCostsProportion));
 
                     byBxLicenseno.setAllFeeValue(this.calculateTotal(byBxLicenseno.getOtherFeevalue(),byBxLicenseno.getCommissionFeevalue(),null));
+                    byBxLicenseno.setReceivableAmount(this.calculateTotal(byBxLicenseno.getOtherFeevalue(),byBxLicenseno.getCommissionFeevalue(),null));
 
                     byBxLicenseno.setJqReceivableProportion(this.calculateTotal(jqSuperviseCostsProportion,jqOtherCostsProportion,null));
                     byBxLicenseno.setSyReceivableProportion(this.calculateTotal(sySuperviseCostsProportion,syOtherCostsProportion,null));

+ 1 - 1
src/main/java/com/ydtech/modules/ins/model/vo/res/BxOtherDetailsNorExcel.java

@@ -57,6 +57,6 @@ public class BxOtherDetailsNorExcel {
 
     @ApiModelProperty("跟单费金额")
     @ExcelProperty(value = "跟单费金额",index = 9)
-    private BigDecimal noOtherCostsPremium;
+    private BigDecimal otherFeevalue;
 
 }

+ 1 - 1
src/main/java/com/ydtech/modules/ins/model/vo/res/SettlementFeesExcel.java

@@ -139,7 +139,7 @@ public class SettlementFeesExcel implements Serializable {
 
     @ApiModelProperty("应收金额")
     @ExcelProperty("应收金额")
-    private BigDecimal receivableAmount;
+    private BigDecimal allFeeValue;
 
     @ExcelProperty(value = "创建日期", converter = DateConverter.class)
     @ApiModelProperty(value = "创建日期")

+ 5 - 8
src/main/java/com/ydtech/modules/inv/utils/CheckInsPlyComeUtils.java

@@ -284,15 +284,12 @@ public class CheckInsPlyComeUtils {
     }
 
     private static String pareTimeLocalDate(String signDate) {
-        DateTimeFormatter originalFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+        DateTimeFormatter originalFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
         DateTimeFormatter targetFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-
-        // 解析原始字符串日期为 LocalDate
-        LocalDate originalDate = LocalDate.parse(signDate, originalFormatter);
-
-        // 将 LocalDate 转换为 LocalDateTime,时间设为午夜
-        LocalDateTime dateTime = originalDate.atStartOfDay();
-        String b = dateTime.format(targetFormatter);
+        // 解析原始字符串日期为 LocalDateTime
+        LocalDateTime originalDateTime = LocalDateTime.parse(signDate, originalFormatter);
+        // 将 LocalDateTime 转换为目标格式的字符串
+        String b = originalDateTime.format(targetFormatter);
         return b;
     }
 

+ 18 - 11
src/main/java/com/ydtech/modules/lg/PushLgLogUtils.java

@@ -10,6 +10,7 @@ import com.ydtech.utils.StringUtils;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
 import java.util.HashMap;
 
 @Component
@@ -17,17 +18,22 @@ public class PushLgLogUtils {
 
     @Async
     public void pushLg(PushLgEntity lgEntity){
-        JSONObject jsonObject = JSONObject.parseObject(SendUtils.send(JSONObject.toJSONString(lgEntity)));
-        if (null != jsonObject){
-            lgEntity.setPushStatus(String.valueOf(jsonObject.getInteger("code")));
-            lgEntity.setMsg(jsonObject.getString("msg"));
-        }else {
-            lgEntity.setPushStatus("");
-            lgEntity.setMsg("推送失败");
-        }
-        SpringUtil.getBean(PushLgEntityMapper.class).insert(lgEntity);
-        if (!StringUtils.equals(lgEntity.getPushStatus(),"200")){
-            pushLgRetry(lgEntity);
+        int insert = SpringUtil.getBean(PushLgEntityMapper.class).insert(lgEntity);
+        if (insert > 0){
+            lgEntity.setZgUuid(lgEntity.getId());
+            lgEntity.setId(null);
+            JSONObject jsonObject = JSONObject.parseObject(SendUtils.send(JSONObject.toJSONString(lgEntity)));
+            if (null != jsonObject && String.valueOf(jsonObject.getInteger("code")).equals("200")){
+                lgEntity.setPushStatus(String.valueOf(jsonObject.getInteger("code")));
+                lgEntity.setMsg(jsonObject.getString("msg"));
+                lgEntity.setSuccessPushTime(new Date());
+            }else {
+                lgEntity.setPushStatus("");
+                lgEntity.setMsg("推送失败");
+            }
+            if (!StringUtils.equals(lgEntity.getPushStatus(),"200")){
+                pushLgRetry(lgEntity);
+            }
         }
     }
 
@@ -37,6 +43,7 @@ public class PushLgLogUtils {
             HashMap<String, Object> map = new HashMap<>();
             map.put("lgEntity", lgEntity);
             QuartzManager manager = QuartzManager.getInstance();
+            manager.getContext().put("executionFrequency",1);
             manager.addJob(String.valueOf(lgEntity.getId()),"jobGroup" + lgEntity.getId(), PushRetry.class,"*/5 * * * * ?",map);
             manager.start();
         }catch (Exception e){

+ 32 - 13
src/main/java/com/ydtech/modules/lg/PushRetry.java

@@ -5,26 +5,45 @@ import com.alibaba.fastjson.JSONObject;
 import com.ydtech.modules.lg.dao.PushLgEntityMapper;
 import com.ydtech.modules.lg.model.PushLgEntity;
 import com.ydtech.modules.ttqf.QuartzManager;
+import lombok.extern.slf4j.Slf4j;
 import org.quartz.*;
 
+import java.util.Date;
+
+@Slf4j
 public class PushRetry implements Job {
     @Override
     public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        JobDataMap mergedJobDataMap = jobExecutionContext.getMergedJobDataMap();
-        Object object = mergedJobDataMap.get("lgEntity");
-        PushLgEntity lgEntity = JSONObject.parseObject((JSONObject.toJSONString(object)) , PushLgEntity.class);
-        JSONObject jsonObject = JSONObject.parseObject(SendUtils.send(JSONObject.toJSONString(lgEntity)));
-        if (null != jsonObject){
-            if (String.valueOf(jsonObject.getInteger("code")).equals("200")){
-                lgEntity.setPushStatus(String.valueOf(jsonObject.getInteger("code")));
-                lgEntity.setMsg(jsonObject.getString("msg"));
-                SpringUtil.getBean(PushLgEntityMapper.class).updateById(lgEntity);
-                try {
-                    QuartzManager.getInstance().removeJob(jobExecutionContext);
-                }catch (Exception e){
-                    e.printStackTrace();
+        try {
+            Integer executionFrequency = (Integer)QuartzManager.getInstance().getContext().get("executionFrequency");
+            JobDataMap mergedJobDataMap = jobExecutionContext.getMergedJobDataMap();
+            Object object = mergedJobDataMap.get("lgEntity");
+            PushLgEntity lgEntity = JSONObject.parseObject((JSONObject.toJSONString(object)) , PushLgEntity.class);
+            JSONObject jsonObject = JSONObject.parseObject(SendUtils.send(JSONObject.toJSONString(lgEntity)));
+            if (null != jsonObject){
+                if (String.valueOf(jsonObject.getInteger("code")).equals("200")){
+                    lgEntity.setPushStatus(String.valueOf(jsonObject.getInteger("code")));
+                    lgEntity.setMsg(jsonObject.getString("msg"));
+                    lgEntity.setSendNumber(executionFrequency);
+                    lgEntity.setSuccessPushTime(new Date());
+                    SpringUtil.getBean(PushLgEntityMapper.class).updateById(lgEntity);
+                    try {
+                        QuartzManager.getInstance().removeJob(jobExecutionContext);
+                    }catch (Exception e){
+                        e.printStackTrace();
+                    }
                 }
             }
+            if (executionFrequency > 10){
+                lgEntity.setSendNumber(executionFrequency);
+                SpringUtil.getBean(PushLgEntityMapper.class).updateById(lgEntity);
+                QuartzManager.getInstance().removeJob(jobExecutionContext);
+            }
+            executionFrequency ++;
+            log.info("lg推送重试任务执行{}",executionFrequency);
+            QuartzManager.getInstance().getContext().put("executionFrequency",executionFrequency);
+        }catch (Exception e){
+            e.printStackTrace();
         }
     }
 }

+ 1 - 1
src/main/java/com/ydtech/modules/lg/SendUtils.java

@@ -29,7 +29,7 @@ public class SendUtils {
         // 获得Http客户端(可以理解为:你得先有一个浏览器;注意:实际上HttpClient与浏览器是不一样的)
         CloseableHttpClient httpClient = HttpClientBuilder.create().build();
         // 创建Post请求
-        HttpPost httpPost = new HttpPost(sendMessageIP + "withdrawal/record/acceptPushWithdrawalData");
+        HttpPost httpPost = new HttpPost(sendMessageIP + "/withdrawal/record/acceptPushWithdrawalData");
         StringEntity entity = new StringEntity(data, "UTF-8");
         // post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
         httpPost.setEntity(entity);

+ 5 - 0
src/main/java/com/ydtech/modules/lg/model/PushLgEntity.java

@@ -1,6 +1,7 @@
 package com.ydtech.modules.lg.model;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.annotation.JsonFormat;
@@ -52,5 +53,9 @@ public class PushLgEntity {
 
     private int sendNumber;
 
+    private Date successPushTime;
+
+    @TableField(exist = false)
+    private Long zgUuid;
 
 }

+ 8 - 9
src/main/java/com/ydtech/modules/order/entity/api/yangguang/constants/YgUseNatureCode.java

@@ -6,17 +6,16 @@ import lombok.Getter;
 @Getter
 @AllArgsConstructor
 public enum YgUseNatureCode {
-    UNC_01("8D", "非营业个人"),
-    UNC_02("8A", "家庭自用"),
-    UNC_03("8B", "非营业企业"),
-    UNC_04("8F", "非营业事业团体"),
-    UNC_05("8E", "非营业党政机关"),
+    UNC_08("8D", "非营业个人"),
+    UNC_05("8A", "家庭自用"),
+    UNC_07("8B", "非营业企业"),
+//    UNC_05("8E", "非营业党政机关"),
     UNC_06("8G", "教练"),
-    UNC_07("9B", "营业城市公交"),
-    UNC_08("9C", "营业公路客运"),
-    UNC_09("9D", "营业货运"),
+    UNC_02("9B", "营业城市公交"),
+    UNC_03("9C", "营业公路客运"),
+    UNC_04("9D", "营业货运"),
     UNC_10("9E", "营业旅游客运"),
-    UNC_11("9F", "营业出租"),
+    UNC_01("9F", "营业出租"),
     UNC_12("9J", "营业"),
 
     UNC_13("9G", "营业租赁"),

+ 6 - 2
src/main/java/com/ydtech/modules/order/entity/api/yangguang/request/YangGuangAccuracyCalculateRequest.java

@@ -708,9 +708,13 @@ public class YangGuangAccuracyCalculateRequest extends YangGuangBaseRequest{
 //            this.CompleteKerbmass = carInfoVo.getVehicleweight();
 //            this.TonCount = String.valueOf(carInfoVo.limitLoadTon());
             this.LicenseType = carInfoVo.getLicenseTypeCode();
-            this.VehicleType = carInfoVo.getCimodelclass();
+            if (carInfoVo.getCimodelclass().equals("A1")) {
+                this.VehicleType = "H0";
+            } else {
+                this.VehicleType = carInfoVo.getCimodelclass();
+            }
             // 车辆使用性质代码
-            YgUseNatureCode ygUseNatureCode1 = Enum.valueOf(YgUseNatureCode.class, YgUseNatureCode.TITLE + carInfoVo.getCarnature());
+            YgUseNatureCode ygUseNatureCode1 = Enum.valueOf(YgUseNatureCode.class, YgUseNatureCode.TITLE + carInfoVo.getVehicleUse());
             this.UseNatureCode = ygUseNatureCode1.getCode();
             this.EnrollDate = carInfoVo.getRegisterDate();
             this.LicenseNo = carInfoVo.getLicenseNo();

+ 1 - 0
src/main/java/com/ydtech/modules/order/service/impl/InsCrawlerOrderServiceImpl.java

@@ -457,6 +457,7 @@ public class InsCrawlerOrderServiceImpl implements InsCrawlerOrderService {
             quoteRespVo.setWarnMessageList(response.getOther().getErrorCodeMap());
         }
         // 验车支付链接
+        insAreaCompany.setVehicleInspectionUrl(response.getOther().getUpimageUrl());
         quoteRespVo.setVehicleInspectionUrl(response.getOther().getUpimageUrl());
         
         if(response.getOther().getCiMessage() != null && !response.getOther().getCiMessage().equals("")){

+ 14 - 10
src/main/java/com/ydtech/modules/order/service/impl/YangGuangOrderApiServiceImpl.java

@@ -574,35 +574,39 @@ public class YangGuangOrderApiServiceImpl implements YangGuangOrderApiService {
         String productid = insAreaCompany.getProductid();
         //单交
         if (productid.equals("0330")) {
-            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequest = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqpolicyno());
+            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequest = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqapplyno());
             YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponse = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequest);
             if (yangGuangAutoWriteOffResponse.getErrorCode().equals("0")) {
-                HttpResult.ok(yangGuangAutoWriteOffResponse);
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                return true;
             }
-            return false;
         }
         // 单商
         if (productid.equals("034001")) {
-            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequest = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getSypolicyno());
+            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequest = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getSyapplyno());
             YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponse = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequest);
             if (yangGuangAutoWriteOffResponse.getErrorCode().equals("0")) {
-                HttpResult.ok(yangGuangAutoWriteOffResponse);
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                return true;
             }
-            return false;
         }
             //交商同保
         if (insAreaCompany.getJqpolicyno() != null && insAreaCompany.getSypolicyno() != null && !insAreaCompany.getJqpolicyno().equals("") && !insAreaCompany.getSypolicyno().equals("")) {
-            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestJq = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqpolicyno());
+            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestJq = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getJqapplyno());
             YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponseJq = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequestJq);
-            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestSy = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getSypolicyno());
+            YangGuangAutoWriteOffRequest yangGuangAutoWriteOffRequestSy = new YangGuangAutoWriteOffRequest(ygConfigureParameters, insAreaCompany.getSyapplyno());
             YangGuangAutoWriteOffResponse yangGuangAutoWriteOffResponseSy = yangGuangRequestApiComponents.autoWriteOff(yangGuangAutoWriteOffRequestSy);
             if (yangGuangAutoWriteOffResponseJq.getErrorCode().equals("0") && yangGuangAutoWriteOffResponseSy.getErrorCode().equals("0")) {
-                HttpResult.ok("撤单成功");
+                insAreaCompany.setOrderstatus(InsOrderStatusEnum.QUOTE_ING.getCode());
+                insAreaCompanyService.updateCompanyAndOrders(insAreaCompany);
+                return true;
             } else {
                 return false;
             }
         }
-        return false;
+        return true;
     }
 
     public QuoteRespVo getQuoteRespVo (YangGuangAccuracyCalculateResponse yangGuangAccuracyCalculateResponse, BaseQuoteInfoVo yaQuoteInfoVo, List<YgQuoteAccidentVo> accidentalDrivingVo, boolean isEnergy) {

+ 1 - 0
src/main/java/com/ydtech/modules/order/service/impl/YongchengOrderApiServiceImpl.java

@@ -871,6 +871,7 @@ public class YongchengOrderApiServiceImpl implements YongchengOrderApiService {
     public HttpResult callbackAnOrder(String quoteOrderNo) {
 
         InsAreaCompany iac = insAreaCompanyService.getById(quoteOrderNo);
+
         InsOrders order = insOrdersService.getById(iac.getOrderno());
         AssertionUtils.isEmpty(iac, "报价订单不存在");
 

+ 0 - 32
src/main/java/com/ydtech/modules/ttqf/QuartzUserSign.java

@@ -1,32 +0,0 @@
-package com.ydtech.modules.ttqf;
-
-import cn.hutool.extra.spring.SpringUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.*;
-
-
-@Slf4j
-public class QuartzUserSign implements Job {
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        try {
-            if ((boolean) QuartzManager.getInstance().getContext().get("flag")){
-                JobDataMap mergedJobDataMap = jobExecutionContext.getMergedJobDataMap();
-                String idCardNo = String.valueOf(mergedJobDataMap.get("idCardNo"));
-                log.info("用户签约状态查询入参:{}",idCardNo);
-                if (SpringUtil.getBean(RetrieveTTQFApi.class).queryPressing(idCardNo)){
-                    log.info("用户签约状态查询成功");
-                    QuartzManager.getInstance().removeJob(jobExecutionContext);
-                }
-                log.info("当前线程+++++++++++++{}",Thread.currentThread().getId());
-            }else {
-                log.info("获取天天企赋状态退出",jobExecutionContext.getJobDetail().getKey().getName());
-                QuartzManager.getInstance().removeJob(jobExecutionContext);
-            }
-        } catch (SchedulerException e) {
-            throw new RuntimeException(e);
-        }
-
-    }
-
-}

+ 0 - 77
src/main/java/com/ydtech/modules/ttqf/RegularlyPaymentStatus.java

@@ -1,77 +0,0 @@
-package com.ydtech.modules.ttqf;
-
-
-import cn.hutool.extra.spring.SpringUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.ipaynow.jiaxin.domain.OrderQueryResultModel;
-import com.ipaynow.jiaxin.response.OrderQueryResponse;
-import com.ydtech.modules.ttqf.dao.PaymentNoticeMapper;
-import com.ydtech.modules.ttqf.entity.PaymentNoticeEntity;
-import com.ydtech.utils.StringUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.scheduling.annotation.Async;
-import org.springframework.stereotype.Component;
-
-import java.util.*;
-
-@Component
-@Slf4j
-public class RegularlyPaymentStatus {
-
-
-    @Async
-    public void  updatePaymentStatus(String orderNo){
-        Timer timer = new Timer();
-        final int[] executionCount = {1};
-        TimerTask task = new TimerTask() {
-            @Override
-            public void run() {
-                try {
-                    log.info("打款状态定时任务入参:{}",orderNo);
-                    OrderQueryResponse response = SpringUtil.getBean(RetrieveTTQFApi.class).orderQuery(orderNo);
-                    log.info("打款状态定时返回执行数据:{}", JSONObject.toJSONString(response.getResultModel()));
-                    if (response == null || !StringUtils.equals(response.getBizCode(),"0000")) {
-                        log.info("获取打款状态任务退出{}");
-                        timer.cancel();
-                    }
-                    if (response.isSuccess()) {
-                        if (Arrays.stream(PayConstantStatus.ORDER_ARRAY).anyMatch(i -> Objects.equals(i,response.getResultModel().getStatus()))){
-                            updatePayLog(orderNo,response.getResultModel());
-                            log.info("获取打款状态任务退出");
-                            timer.cancel();
-                        }
-                    }
-                    log.info("当前线程+++++++++++++{}",Thread.currentThread().getId());
-//                    if (executionCount[0] == 20){
-//                        log.info("获取打款状态任务退出{}");
-//                        timer.cancel();
-//                    }
-                }catch (Exception e){
-                    log.error("定时获取打款状态任务异常:{}",e.getMessage());
-                    timer.cancel();
-                }
-                executionCount[0]++;
-            }
-        };
-        timer.schedule(task, 2000, 5000);
-    }
-
-
-    public void updatePayLog(String orderNo, OrderQueryResultModel resultModel){
-        QueryWrapper<PaymentNoticeEntity> wrapper = new QueryWrapper<>();
-        wrapper.eq("order_no",orderNo);
-        PaymentNoticeEntity notice = SpringUtil.getBean(PaymentNoticeMapper.class).selectOne(wrapper);
-        if (null == notice){
-            PaymentNoticeEntity noticeEntity = JSONObject.parseObject(JSONObject.toJSONString(resultModel), PaymentNoticeEntity.class);
-            if (null == noticeEntity.getPayTime()){
-                noticeEntity.setPayTime(new Date());
-            }
-            noticeEntity.setCreateTime(new Date());
-            int update = SpringUtil.getBean(PaymentNoticeMapper.class).insert(noticeEntity);
-            log.info("获取打款状态成功正在保存===========:{}",orderNo ,"+++++", update > 0 ? "保存成功" : "保存失败");
-        }
-    }
-
-
-}

+ 0 - 71
src/main/java/com/ydtech/modules/ttqf/RegularlyUpdateStatus.java

@@ -1,71 +0,0 @@
-package com.ydtech.modules.ttqf;
-
-import cn.hutool.extra.spring.SpringUtil;
-import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.ipaynow.jiaxin.domain.OrderQueryResultModel;
-import com.ipaynow.jiaxin.response.OrderQueryResponse;
-import com.ydtech.modules.ttqf.dao.PaymentNoticeMapper;
-import com.ydtech.modules.ttqf.entity.PaymentNoticeEntity;
-import com.ydtech.utils.StringUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.quartz.*;
-
-import java.util.Arrays;
-import java.util.Date;
-import java.util.Objects;
-
-
-@Slf4j
-public class RegularlyUpdateStatus implements Job {
-    @Override
-    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
-        try {
-            if ((boolean) QuartzManager.getInstance().getContext().get("flag")){
-                JobDataMap mergedJobDataMap = jobExecutionContext.getMergedJobDataMap();
-                String orderNo = String.valueOf(mergedJobDataMap.get("orderNo"));
-                log.info("打款状态定时任务入参:{}",orderNo);
-                OrderQueryResponse response = SpringUtil.getBean(RetrieveTTQFApi.class).orderQuery(orderNo);
-                log.info("打款状态定时返回执行数据:{}", JSONObject.toJSONString(response.getResultModel()));
-                if (response == null || !StringUtils.equals(response.getBizCode(),"0000")) {
-                    log.info("获取打款状态任务退出{}");
-                    QuartzManager.getInstance().removeJob(jobExecutionContext);
-                }
-                if (response.isSuccess()) {
-                    if (Arrays.stream(PayConstantStatus.ORDER_ARRAY).anyMatch(i -> Objects.equals(i,response.getResultModel().getStatus()))){
-                        updatePayLog(orderNo,response.getResultModel());
-                        log.info("获取打款状态任务退出");
-                    }
-                    QuartzManager.getInstance().removeJob(jobExecutionContext);
-                }
-                log.info("当前线程+++++++++++++{}",Thread.currentThread().getId());
-            }else {
-                log.info("获取天天企赋状态退出",jobExecutionContext.getJobDetail().getKey().getName());
-                QuartzManager.getInstance().removeJob(jobExecutionContext);
-            }
-
-        } catch (SchedulerException e) {
-            throw new RuntimeException(e);
-        }
-
-    }
-
-
-
-    public void updatePayLog(String orderNo, OrderQueryResultModel resultModel){
-        QueryWrapper<PaymentNoticeEntity> wrapper = new QueryWrapper<>();
-        wrapper.eq("order_no",orderNo);
-        PaymentNoticeEntity notice = SpringUtil.getBean(PaymentNoticeMapper.class).selectOne(wrapper);
-        if (null == notice){
-            PaymentNoticeEntity noticeEntity = JSONObject.parseObject(JSONObject.toJSONString(resultModel), PaymentNoticeEntity.class);
-            if (null == noticeEntity.getPayTime()){
-                noticeEntity.setPayTime(new Date());
-            }
-            noticeEntity.setCreateTime(new Date());
-            int update = SpringUtil.getBean(PaymentNoticeMapper.class).insert(noticeEntity);
-            log.info("获取打款状态成功正在保存===========:{}",orderNo ,"+++++", update > 0 ? "保存成功" : "保存失败");
-        }
-    }
-
-
-}

+ 46 - 40
src/main/java/com/ydtech/modules/ttqf/RetrieveTTQFApi.java

@@ -10,7 +10,7 @@ import com.ipaynow.jiaxin.domain.*;
 import com.ipaynow.jiaxin.request.*;
 import com.ipaynow.jiaxin.response.*;
 import com.ydtech.exception.SystemException;
-import com.ydtech.modules.admin.model.po.SysUserBankCard;
+import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.esm.model.vo.EsmUserImageQueryVo;
 import com.ydtech.modules.esm.service.EsmUserImageService;
 import com.ydtech.modules.order.entity.api.bohai.constants.DocumentClass;
@@ -41,7 +41,6 @@ public class RetrieveTTQFApi {
 
     private static PayUserSignService signService;
 
-    private static RegularlyPaymentStatus paymentStatus;
 
     @Resource
     private void setSignService(PayUserSignService userSignService){
@@ -49,12 +48,6 @@ public class RetrieveTTQFApi {
     }
 
 
-    @Resource
-    private void setPaymentStatus(RegularlyPaymentStatus status){
-        paymentStatus = status;
-    }
-
-
     @Resource
     private void setSavePayOrder(SavePayOrder order){
         savePayOrder = order;
@@ -64,32 +57,44 @@ public class RetrieveTTQFApi {
     private void setConfig(TangClient client){
         tangClient = client;
     }
-    public  static boolean extractBalance(SysUserBankCard bankCard,UserWithdrawal withdrawal){
-        if (queryPressing(bankCard.getIdentity())){
+
+
+
+    public  static boolean extractBalance(SysUser sysUser,UserWithdrawal withdrawal){
+        QueryPresignResultModel resultModel = queryPressing(sysUser.getIdentity());
+        //这俩验证银行卡是否处于绑定状态
+        List<QueryPresignResultModel.BankCard> cards = resultModel.getCards();
+        //
+        QueryPresignResultModel.BankCard bankCard = cards.stream().filter(v -> v.getBankCardNo().equals(withdrawal.getBankNumber())).findAny().orElse(null);
+        if (bankCard == null){
+            throw new SystemException("银行卡未绑定");
+        }
+        if (Objects.equals(PayConstantStatus.SIGN_STATUS,resultModel.getSignStatus()) &&
+                Objects.equals(PayConstantStatus.AUTH_STATUS,resultModel.getAuthStatus())){
             BigDecimal accountBalance = balance();
             if (BigDecimal.ZERO.compareTo(accountBalance) == 0 || (accountBalance.compareTo(withdrawal.getAmount()) == -1)){
                 throw new SystemException("商户余额不足,请联系管理员");
             }
             //用户已经签约  进行打款操作
-            return orderAdd(bankCard, withdrawal.getAmount(), withdrawal.getRemarks());
+            return orderAdd(sysUser, withdrawal);
         } else {
             return false;
         }
     }
 
     
-    public  static boolean orderAdd(SysUserBankCard bankCard,BigDecimal amount,String remark){
+    public  static boolean orderAdd(SysUser sysUser,UserWithdrawal withdrawal){
         OrderAddModel addModel = OrderAddModel.builder()
                 .mchBatchNo(System.currentTimeMillis() + "")
                 .mchOrderNo(GenerateOrderNumberUtils.nextNumber() + "")
                 //收款人姓名
-                .userName(bankCard.getUserName())
+                .userName(sysUser.getName())
                 //收款人手机号
-                .userMobile(bankCard.getMobile())
+                .userMobile(sysUser.getMobile())
                 //收款账号
-                .userBankCardNo(bankCard.getBankNumber())
+                .userBankCardNo(withdrawal.getBankNumber())
                 //收款人身份证号
-                .userIdCardNo(bankCard.getIdentity())
+                .userIdCardNo(sysUser.getIdentity())
                 //工作量衡量标准模板
                 .userWorkload("1849326302238785538")
                 //工作量衡量标准
@@ -98,15 +103,15 @@ public class RetrieveTTQFApi {
                 )
                 //打款金额 Number(15,2)
                 // M 单位为元,风控可调额
-                .amount(amount)
-                .remark(remark)
+                .amount(withdrawal.getAmount())
+                .remark(withdrawal.getRemarks())
                 //收款方式非必填:默认0-银行卡枚举:0-银行卡、1-支付宝、2-微信
                 .paymentType(0)
                 //选填项:微信APPID,若填写,以填写项稳准,否则应用预留配置的微信appid;该字段适用于同主体下含有多个公众号或小程序的场景
                 .wechatAppId("")
                 .notifyUrl(PayConstantStatus.getPaymentNoticeUrl())
                 .build();
-        OrderAddResponse response = testOrderAdd(addModel, bankCard.getUserId());
+        OrderAddResponse response = testOrderAdd(addModel, sysUser.getId());
         if(response.isSuccess()) {
             log.info("成功 ====>orderAdd {}", response.getResultModel());
         } else {
@@ -187,20 +192,20 @@ public class RetrieveTTQFApi {
     /**
      * 用户预签约接口
      */
-    public static String pres(SysUserBankCard bankCard){
+    public static String pres(SysUser sysUser,UserWithdrawal withdrawal){
         PresignRequest request = new PresignRequest();
-        List<EsmUserImageQueryVo> esmUserImageQueryVo = SpringUtil.getBean(EsmUserImageService.class).getEsmUserImageQueryVo(bankCard.getUserId());
+        List<EsmUserImageQueryVo> esmUserImageQueryVo = SpringUtil.getBean(EsmUserImageService.class).getEsmUserImageQueryVo(sysUser.getId());
         if (CollectionUtils.isEmpty(esmUserImageQueryVo)){
             throw new SystemException("用户影像资料不存在,请补全后在申请提现");
         }
         PresignModel presignModel = new PresignModel();
-        presignModel.setName(bankCard.getUserName());
-        presignModel.setMobile(bankCard.getMobile());
-        presignModel.setIdCardNo(bankCard.getIdentity());
-        presignModel.setBankCardNo(bankCard.getBankNumber());
-        if (bankCard.getIdentityTime().contains(",")){
-            presignModel.setExpiryStart(bankCard.getIdentityTime().split(",")[0]);
-            presignModel.setExpiryEnd(bankCard.getIdentityTime().split(",")[1]);
+        presignModel.setName(sysUser.getName());
+        presignModel.setMobile(sysUser.getMobile());
+        presignModel.setIdCardNo(sysUser.getIdentity());
+        presignModel.setBankCardNo(withdrawal.getBankNumber());
+        if (sysUser.getIdentityTime().contains(",")){
+            presignModel.setExpiryStart(sysUser.getIdentityTime().split(",")[0]);
+            presignModel.setExpiryEnd(sysUser.getIdentityTime().split(",")[1]);
         }else {
             throw new SystemException("用户身份证有效日期不全,请检查");
         }
@@ -231,7 +236,7 @@ public class RetrieveTTQFApi {
         PresignResponse response = tangClient.execute(request);
         if(response.isSuccess()) {
             log.info("成功 ====>Pressing {}", response.getResultModel());
-            return contractH5(bankCard.getIdentity());
+            return contractH5(sysUser.getIdentity());
         } else {
             log.error("失败{}", response);
             return response.getBizMsg();
@@ -241,20 +246,16 @@ public class RetrieveTTQFApi {
     /**
      * 用户预签约结果查询接口
      */
-    public static boolean queryPressing(String idCardNo) {
+    public static QueryPresignResultModel queryPressing(String idCardNo) {
         QueryPresignResponse response = tangClient.execute(QueryPresignRequest.builder().requestId(System.currentTimeMillis() + "")
                 .bizModel(new QueryPresignModel(idCardNo)).build());
         if(response.isSuccess()) {
-            QueryPresignResultModel resultModel = response.getResultModel();
-            if (Objects.equals(PayConstantStatus.SIGN_STATUS,resultModel.getSignStatus()) &&
-                    Objects.equals(PayConstantStatus.AUTH_STATUS,resultModel.getAuthStatus())){
-                return true;
-            }
-            log.info("成功 ====>QueryPressing {}", resultModel);
+            log.info("成功 ====>QueryPressing {}", response.getResultModel());
+            return response.getResultModel();
         } else {
             log.error("失败{}", response);
         }
-        return false;
+        return null;
     }
 
     /**
@@ -285,8 +286,13 @@ public class RetrieveTTQFApi {
                 .bizModel(addModel)
                 .build();
         OrderAddResponse response = tangClient.execute(addRequest);
-        boolean confirm = confirm(response.getResultModel().getOrderNo(),response.getResultModel().getBatchNo());
-        savePayOrder.savePayOrder(addRequest.getApiUrl(),response, JSONObject.toJSONString(addModel),JSONObject.toJSONString(response),userId, confirm,addModel.getUserBankCardNo());
+        boolean confirm = false;
+        String sysAmountAuditingId = "";
+        if (response.isSuccess()){
+            confirm = confirm(response.getResultModel().getOrderNo(),response.getResultModel().getBatchNo());
+            sysAmountAuditingId = SpringUtil.getBean(AmountAuditingService.class).sendMessage(response.getResultModel().getAmount(), userId, addModel.getUserBankCardNo());
+        }
+        savePayOrder.savePayOrder(addRequest.getApiUrl(),response, JSONObject.toJSONString(addModel),JSONObject.toJSONString(response),userId, confirm,sysAmountAuditingId);
         return response;
     }
 
@@ -350,7 +356,7 @@ public class RetrieveTTQFApi {
             hashMap.put("orderNo",orderNo);
             QuartzManager manager = QuartzManager.getInstance();
             manager.getContext().put("flag",true);
-            manager.addJob(orderNo,"jobGroup" + orderNo, RegularlyUpdateStatus.class,"*/5 * * * * ?",hashMap);
+            //manager.addJob(orderNo,"jobGroup" + orderNo, RegularlyUpdateStatus.class,"*/5 * * * * ?",hashMap);
             manager.start();
         }catch (Exception e){
             e.printStackTrace();

+ 1 - 2
src/main/java/com/ydtech/modules/ttqf/SavePayOrder.java

@@ -16,7 +16,7 @@ import java.util.Date;
 public class SavePayOrder {
 
     @Async
-    public  void savePayOrder(String url, OrderAddResponse response, String requestData, String responseData, String userId,boolean confirm,String userBankCardNo){
+    public  void savePayOrder(String url, OrderAddResponse response, String requestData, String responseData, String userId,boolean confirm,String sysAmountAuditingId){
         PayTtqfLog ttqfLog = new PayTtqfLog();
         ttqfLog.setSedStatus(response.isSuccess());
         ttqfLog.setApiUrl(url);
@@ -35,7 +35,6 @@ public class SavePayOrder {
         ttqfLog.setAmount(response.getResultModel().getAmount());
         ttqfLog.setFeeAmount(response.getResultModel().getFeeAmount());
         ttqfLog.setPaymentType(response.getResultModel().getPaymentType());
-        String sysAmountAuditingId = SpringUtil.getBean(AmountAuditingService.class).sendMessage(response.getResultModel().getAmount(), userId, userBankCardNo);
         ttqfLog.setSysAmountAuditingId(sysAmountAuditingId);
         SpringUtil.getBean(PayTtqfLogMapper.class).insert(ttqfLog);
     }

+ 0 - 18
src/main/java/com/ydtech/modules/ttqf/controller/TtqfController.java

@@ -2,7 +2,6 @@ package com.ydtech.modules.ttqf.controller;
 
 
 import com.ydtech.core.page.HttpResult;
-import com.ydtech.modules.ttqf.RegularlyPaymentStatus;
 import com.ydtech.modules.ttqf.entity.response.TtqfResponse;
 import com.ydtech.modules.ttqf.entity.vo.UserWithdrawal;
 import com.ydtech.modules.ttqf.service.TtqfService;
@@ -16,15 +15,10 @@ import javax.annotation.Resource;
 public class TtqfController {
 
 
-    private static RegularlyPaymentStatus paymentStatus;
 
     @Resource
     private TtqfService ttqfService;
 
-    @Resource
-    private void setPaymentStatus(RegularlyPaymentStatus regularlyPaymentStatus){
-        paymentStatus = regularlyPaymentStatus;
-    }
 
 
     /**
@@ -110,17 +104,5 @@ public class TtqfController {
     }
 
 
-    @GetMapping("xx/{de}")
-    public String xx(@PathVariable("de")String de) throws Exception {
-        paymentStatus.updatePaymentStatus(de);
-        return "";
-    }
-
-
-    @GetMapping("aa")
-    public void getss() throws Exception {
-
-    }
-
 
 }

+ 2 - 1
src/main/java/com/ydtech/modules/ttqf/entity/vo/UserWithdrawal.java

@@ -13,9 +13,10 @@ public class UserWithdrawal {
 
     private String userId;
 
-
     private BigDecimal amount;
 
     private String remarks;
 
+    private String bankNumber;
+
 }

+ 85 - 79
src/main/java/com/ydtech/modules/ttqf/service/impl/TtqfServiceImpl.java

@@ -4,20 +4,24 @@ import cn.hutool.extra.spring.SpringUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.ipaynow.jiaxin.domain.QueryPresignResultModel;
 import com.ipaynow.jiaxin.response.BillDownloadResponse;
 import com.ipaynow.jiaxin.response.ReceiptlDownloadResponse;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.constants.ManagementSource;
 import com.ydtech.modules.admin.dao.SysAmountAuditingMapper;
 import com.ydtech.modules.admin.dao.SysUserAccountHistoryMapper;
 import com.ydtech.modules.admin.dao.SysUserBankCardMapper;
-import com.ydtech.modules.admin.model.po.*;
+import com.ydtech.modules.admin.model.SysUser;
+import com.ydtech.modules.admin.model.po.SysAmountAuditingEntity;
+import com.ydtech.modules.admin.model.po.SysAmountAuditingHistory;
+import com.ydtech.modules.admin.model.po.SysUserAccount;
+import com.ydtech.modules.admin.model.po.SysUserAccountHistory;
 import com.ydtech.modules.admin.model.vo.SysAmountAuditingVo;
-import com.ydtech.modules.admin.service.SysAmountAuditingHistoryService;
-import com.ydtech.modules.admin.service.SysAmountAuditingService;
-import com.ydtech.modules.admin.service.SysSwitchConfigService;
-import com.ydtech.modules.admin.service.SysUserAccountService;
+import com.ydtech.modules.admin.service.*;
 import com.ydtech.modules.lg.model.PushLgEntity;
+import com.ydtech.modules.lg.service.PushLgEntityService;
 import com.ydtech.modules.ttqf.LgInformationPush;
 import com.ydtech.modules.ttqf.PayConstantStatus;
 import com.ydtech.modules.ttqf.RetrieveTTQFApi;
@@ -84,6 +88,12 @@ public class TtqfServiceImpl implements TtqfService {
     @Autowired
     private SysAmountAuditingMapper amountAuditingMapper;
 
+    @Autowired
+    private PushLgEntityService pushLgEntityService;
+
+    @Autowired
+    private SysUserService userService;
+
     @Override
     public Object getUserPay(String userId) {
 
@@ -127,22 +137,29 @@ public class TtqfServiceImpl implements TtqfService {
         String parse = TtqfDecrypt.parse(obj);
         if (!StringUtils.isEmpty(parse)){
             PaymentNoticeEntity noticeEntity = JSONObject.parseObject(parse, PaymentNoticeEntity.class);
-            noticeEntity.setCreateTime(new Date());
-            noticeMapper.insert(noticeEntity);
+            if (null != noticeEntity){
+                LambdaQueryWrapper<PaymentNoticeEntity> paymentNoticeEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
+                paymentNoticeEntityLambdaQueryWrapper.eq(PaymentNoticeEntity::getMchOrderNo, noticeEntity.getMchOrderNo());
+                PaymentNoticeEntity notice = noticeMapper.selectOne(paymentNoticeEntityLambdaQueryWrapper);
+                if (null == notice){
+                    noticeEntity.setCreateTime(new Date());
+                    noticeMapper.insert(noticeEntity);
+                }
+            }
             LambdaQueryWrapper<PayTtqfLog> wrapper = new LambdaQueryWrapper<>();
             wrapper.eq(PayTtqfLog::getMchOrderNo, noticeEntity.getMchOrderNo());
             PayTtqfLog ttqfLog = logMapper.selectOne(wrapper);
             SysAmountAuditingVo amountAuditingVo = new SysAmountAuditingVo();
             amountAuditingVo.setAmount(noticeEntity.getAmount());
             amountAuditingVo.setUserId(ttqfLog.getUserId());
-            writeRecord(amountAuditingVo,ttqfLog.getSysAmountAuditingId());
+            writeRecord(amountAuditingVo,ttqfLog.getSysAmountAuditingId(),noticeEntity.getFeeAmount());
         }
         log.info("接收打款通知回调 + paymentNotice ================={}", parse);
         return TtqfResponse.ok();
     }
 
 
-    public void writeRecord(SysAmountAuditingVo sysAmountAuditingVo,String id){
+    public void writeRecord(SysAmountAuditingVo sysAmountAuditingVo,String id,BigDecimal feeAmount){
         SysAmountAuditingEntity sysAmountAuditingEntity = sysAmountAuditingService.getById(id);
         if (ObjectUtils.isEmpty(sysAmountAuditingEntity)){
             return;
@@ -152,43 +169,22 @@ public class TtqfServiceImpl implements TtqfService {
         BigDecimal amount = sysAmountAuditingVo.getAmount();
         //提现人
         String userId = sysAmountAuditingVo.getUserId();
-//        SysUserAccount sysUserAccountEntity = new SysUserAccount();
-//      用户扣减金额
+        //      用户扣减金额
         if (StringUtils.isNotEmpty(userId)) {
-//            sysUserAccountEntity.setUserId(userId);
             //提现人账户
             SysUserAccount sysUserAccount = sysUserAccountService.getById(userId);
             if (ObjectUtils.isNotEmpty(sysUserAccount)) {
-                //注释掉原先按类型提现的逻辑 ,改为不区分类型  add by hxl  2024-06-18
-                /**
-                 String amountStatus = sysAmountAuditingVo.getAmountStatus();
-                 if (StringUtils.isNotEmpty(amountStatus)) {
-                 if ("1".equals(amountStatus)) {
-                 sysUserAccount.setHandlingAmountAccount(amount);
-                 sysUserAccount.setHandlingAmountPayment(sysUserAccount.getHandlingAmountPayment().subtract(amount));
-                 //                        sysUserAccountEntity.setHandlingFee(afterAmount);
-                 } else if ("2".equals(amountStatus)) {
-                 sysUserAccount.setDocumentaryAmountAccount(amount);
-                 sysUserAccount.setDocumentaryAmountpayment(sysUserAccount.getDocumentaryAmountpayment().subtract(amount));
-                 //                        sysUserAccountEntity.setDocumentary(afterAmount);
-                 } else {
-                 sysUserAccount.setPromotionAmountAccount(amount);
-                 sysUserAccount.setPromotionAmountPayment(sysUserAccount.getPromotionAmountPayment().subtract(amount));
-                 //                        sysUserAccountEntity.setPromotion(afterAmount);
-                 }
-
-                 }
-                 **/
                 //已到账金额 =  原先的到账金额+ 已到账的金额
                 sysUserAccount.setSumAmountAccount((sysUserAccount.getSumAmountAccount() == null ? BigDecimal.ZERO : sysUserAccount.getSumAmountAccount()).add(amount));
                 //支付中的金额 = 原先的支付金额 -去提现的金额
                 sysUserAccount.setSumAmountPayment((sysUserAccount.getSumAmountPayment() == null ? BigDecimal.ZERO : sysUserAccount.getSumAmountPayment()).subtract(amount));
-
                 sysUserAccountService.updateById(sysUserAccount);
             }
             sysAmountAuditingVo.setAuditingStatus("3");
-            //sysAmountAuditingVo.setAuditingUserId(BaseController.getUser().getId());
             sysAmountAuditingVo.setAuditingTime(new Date());
+            sysAmountAuditingVo.setBankNumber(sysAmountAuditingEntity.getBankNumber());
+            sysAmountAuditingVo.setUserName(userService.getByUserId(sysAmountAuditingEntity.getUserId()).getName());
+            sysAmountAuditingVo.setUserId(sysAmountAuditingEntity.getUserId());
             BeanUtils.copyProperties(sysAmountAuditingVo, sysAmountAuditingEntity);
             sysAmountAuditingEntity.setCreateTime(null);
             amountAuditingMapper.updateById(sysAmountAuditingEntity);
@@ -201,6 +197,7 @@ public class TtqfServiceImpl implements TtqfService {
             //插入轨迹表
             SysAmountAuditingHistory sysAmountAuditingHistory = new SysAmountAuditingHistory(null, sysAmountAuditingEntity.getId(), amount, userId, new Date(), "4", "1", sysUserAccountHistory.getId());
             sysAmountAuditingHistoryService.save(sysAmountAuditingHistory);
+            sendCollect(sysAmountAuditingEntity,sysAmountAuditingHistory.getAuditingStatus(),feeAmount);
         }
     }
 
@@ -228,19 +225,19 @@ public class TtqfServiceImpl implements TtqfService {
         if (!sysSwitchConfigService.getBalanceExtractStatus()){
             return HttpResult.ok(WithdrawalFRes.builder().bizCode("0").msg("").url("").build());
         }
-        SysUserBankCard bankCard = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(withdrawal.getUserId());
-        if (Objects.isNull(bankCard)){
+        SysUser sysUser = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(withdrawal.getUserId());
+        if (Objects.isNull(sysUser)){
             return HttpResult.error("用户不存在,请检查");
         }
-        if (StringUtils.isEmpty(bankCard.getIdentity())){
+        if (StringUtils.isEmpty(sysUser.getIdentity())){
             return HttpResult.error("用户身份证号不存在,请检查");
         }
-        if (!ManagementSource.MS_02.getCode().equals(bankCard.getManagementSource())){
+        if (!ManagementSource.MS_02.getCode().equals(sysUser.getManagementSource())){
             return HttpResult.ok(WithdrawalFRes.builder().bizCode("0").msg("").url("").build());
         }
-        PayUserSign payUserSign = signService.selectOne(bankCard.getIdentity(),bankCard.getUserId());
+        PayUserSign payUserSign = signService.selectOne(sysUser.getIdentity(),sysUser.getId());
         if (!Objects.isNull(payUserSign)){
-            String signUrl = RetrieveTTQFApi.contractH5(bankCard.getIdentity());
+            String signUrl = RetrieveTTQFApi.contractH5(sysUser.getIdentity());
             if (Objects.equals(PayConstantStatus.SIGN_STATUS,payUserSign.getSign()) &&
                     Objects.equals(PayConstantStatus.AUTH_STATUS,payUserSign.getAuthStatus())){
 
@@ -249,7 +246,12 @@ public class TtqfServiceImpl implements TtqfService {
             return HttpResult.ok(WithdrawalFRes.builder().bizCode("2").msg("签约中").url(signUrl).build());
         }
         try {
-            boolean sign = RetrieveTTQFApi.queryPressing(bankCard.getIdentity());
+            boolean sign = false;
+            QueryPresignResultModel resultModel = RetrieveTTQFApi.queryPressing(sysUser.getIdentity());
+            if (Objects.equals(PayConstantStatus.SIGN_STATUS,resultModel.getSignStatus()) &&
+                    Objects.equals(PayConstantStatus.AUTH_STATUS,resultModel.getAuthStatus())){
+                sign = true;
+            }
             return HttpResult.ok(WithdrawalFRes.builder().bizCode(sign ? "3" : "1").url("").msg(sign ? "已签约" : "未签约").build());
         }catch (Exception e){
             log.info("查询签约状态异常:{}", e.getMessage());
@@ -259,55 +261,59 @@ public class TtqfServiceImpl implements TtqfService {
 
     @Override
     public HttpResult signingAddress(UserWithdrawal withdrawal) {
-        SysUserBankCard bankCard = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(withdrawal.getUserId());
-        if (Objects.isNull(bankCard)){
-            return HttpResult.error("用户不存在,请检查");
-        }
-        if (StringUtils.isEmpty(bankCard.getIdentity())){
-            return HttpResult.error("用户身份证号不存在,请检查");
-        }
-        String pres = RetrieveTTQFApi.pres(bankCard);
-        if (!StringUtils.isEmpty(pres)){
-            signService.saveUserSign(bankCard.getIdentity(),bankCard.getUserId());
+        try {
+            SysUser sysUser = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(withdrawal.getUserId());
+            if (Objects.isNull(sysUser)){
+                return HttpResult.error("用户不存在,请检查");
+            }
+            if (StringUtils.isEmpty(sysUser.getIdentity())){
+                return HttpResult.error("用户身份证号不存在,请检查");
+            }
+            String pres = RetrieveTTQFApi.pres(sysUser, withdrawal);
+            if (!StringUtils.isEmpty(pres)){
+                signService.saveUserSign(sysUser.getIdentity(),sysUser.getId());
+            }
+            return HttpResult.ok(WithdrawalFRes.builder().bizCode("").url(pres).msg("").build());
+        }catch (Exception e){
+            log.error("获取用户签约信息异常{}",e.getMessage());
+            throw new SystemException("提现申请提交失败");
         }
-        return HttpResult.ok(WithdrawalFRes.builder().bizCode("").url(pres).msg("").build());
     }
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpResult userCashOut(UserWithdrawal withdrawal) {
-        SysUserBankCard bankCard = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(withdrawal.getUserId());
-        if (Objects.isNull(bankCard)){
-            return HttpResult.error("用户不存在,请检查");
-        }
-        if (StringUtils.isEmpty(bankCard.getIdentity())){
-            return HttpResult.error("用户身份证号不存在,请检查");
-        }
-        if (!ManagementSource.MS_02.getCode().equals(bankCard.getManagementSource())){
-            return HttpResult.error("用户不是个代,请线下申请提现");
-        }
-        boolean balance = RetrieveTTQFApi.extractBalance(bankCard, withdrawal);
-        if (balance){
-            //推送提现记录
-            sendCollect( bankCard, withdrawal);
+        try {
+            SysUser sysUser = SpringUtil.getBean(SysUserBankCardMapper.class).selectByIdPay(withdrawal.getUserId());
+            if (Objects.isNull(sysUser)){
+                return HttpResult.error("用户不存在,请检查");
+            }
+            if (StringUtils.isEmpty(sysUser.getIdentity())){
+                return HttpResult.error("用户身份证号不存在,请检查");
+            }
+            if (!ManagementSource.MS_02.getCode().equals(sysUser.getManagementSource())){
+                return HttpResult.error("用户不是个代,请线下申请提现");
+            }
+            boolean balance = RetrieveTTQFApi.extractBalance(sysUser, withdrawal);
+            return HttpResult.ok(balance);
+        }catch (Exception e){
+            log.error("提现申请提交失败{}",e.getMessage());
+            throw new RuntimeException("提现申请提交失败");
         }
-        return HttpResult.ok(balance);
     }
 
 
-    public void sendCollect(SysUserBankCard bankCard,UserWithdrawal withdrawal){
+    public void sendCollect(SysAmountAuditingEntity sysAmountAuditingEntity,String auditingStatus,BigDecimal feeAmount ){
         PushLgEntity lgEntity = new PushLgEntity();
-
-        SysAmountAuditingVo sysAmountAuditingVo = new SysAmountAuditingVo();
-        sysAmountAuditingVo.setId("");
-        sysAmountAuditingVo.setUserId(bankCard.getUserId());
-        sysAmountAuditingVo.setBankNumber(bankCard.getBankNumber());
-        sysAmountAuditingVo.setAmount(withdrawal.getAmount());
-        sysAmountAuditingVo.setCreateTime(new Date());
-        sysAmountAuditingVo.setAuditingStatus("");
-        sysAmountAuditingVo.setUserName(bankCard.getUserName());
-        sysAmountAuditingVo.setMobile(bankCard.getMobile());
-        //sendCollectUtils.sendCollect(sysAmountAuditingVo);
+        lgEntity.setApplicationTime(new Date());
+        lgEntity.setBusinessUmber(sysAmountAuditingEntity.getId());
+        lgEntity.setPayee(sysAmountAuditingEntity.getUserName());
+        lgEntity.setPayeeId(sysAmountAuditingEntity.getUserId());
+        lgEntity.setReceivingAccount(sysAmountAuditingEntity.getBankNumber());
+        lgEntity.setExtractMoney(sysAmountAuditingEntity.getAmount());
+        lgEntity.setServiceCharge(feeAmount);
+        lgEntity.setExtractStatus(auditingStatus);
+        pushLgEntityService.sendLgData(lgEntity);
     }
 
 

+ 1 - 1
src/main/resources/application-pre.yml

@@ -445,4 +445,4 @@ ttqf:
   tokenUrl: https://test.baoxianzhanggui.com/web-api
 
 #灵活用工平台实时推送ip地址
-sendMessage-zg-yggl-IP: http://192.168.0.29:8080/
+sendMessage-zg-yggl-IP: https://test.baoxianzhanggui.com/prod-api

+ 1 - 1
src/main/resources/application-prod.yml

@@ -443,4 +443,4 @@ ttqf:
   tokenUrl: https://test.baoxianzhanggui.com/web-api
 
 #灵活用工平台实时推送ip地址
-sendMessage-zg-yggl-IP: http://192.168.0.29:8080/
+sendMessage-zg-yggl-IP: https://test.baoxianzhanggui.com/prod-api

+ 1 - 1
src/main/resources/application-test.yml

@@ -528,4 +528,4 @@ customer:
 httpUrl: https://test.baoxianzhanggui.com/copartnerH5/#/pages/index/result?
 
 #灵活用工平台实时推送ip地址
-sendMessage-zg-yggl-IP: http://192.168.0.29:8080/
+sendMessage-zg-yggl-IP: https://test.baoxianzhanggui.com/prod-api

+ 8 - 1
src/main/resources/mapper/modules/admin/SysAmountAuditingMapper.xml

@@ -146,10 +146,12 @@
             <if test="auditingStatus !=null  and auditingStatus != ''">
                 a.auditing_status=#{auditingStatus}
             </if>
+            <if test="auditingStatus !=null  and auditingStatus != '' and auditingStatus == 2">
+                and a.approval != 1
+            </if>
             <if test="amountStatus !=null  and amountStatus != ''">
                 and a.amount_status=#{amountStatus}
             </if>
-
             <if test="id !=null  and id != ''">
                 and a.id=#{id}
             </if>
@@ -272,10 +274,15 @@
         left join sys_user_account_history b on a.id = b.auditiing_id
         left join sys_user su on su.id =a.user_id
         left join sys_dept sd on sd.id =su.dept_id
+        left join sys_user_bank_card bc on bc.bank_number =a.bank_number
+        and bc.user_id =a.user_id
         <where>
             <if test="vo.auditingStatus !=null  and vo.auditingStatus != ''">
                 a.auditing_status=#{vo.auditingStatus}
             </if>
+            <if test="vo.auditingStatus !=null and vo.auditingStatus != '' and vo.auditingStatus == 2">
+                and a.approval != 1
+            </if>
             <if test="vo.amountStatus !=null  and vo.amountStatus != ''">
                 and a.amount_status=#{vo.amountStatus}
             </if>

+ 15 - 8
src/main/resources/mapper/modules/admin/SysPartnerMapper.xml

@@ -73,7 +73,14 @@
         select sal.*
         from sys_partner sal
         left join sys_relation_person srp on srp.agency_leader_id=sal.user_id
-        where srp.type = 0 and srp.suggest_id = #{userId}
+        where srp.type = 0 and srp.source = 0 and srp.suggest_id = #{userId}
+    </select>
+
+    <select id="queryIndirectByLoginId" resultType="com.ydtech.modules.admin.model.SysPartner">
+        select sal.*
+        from sys_partner sal
+        left join sys_relation_person srp on srp.agency_leader_id=sal.user_id
+        where srp.type = 0 and srp.source = 1 and srp.suggest_id = #{userId}
     </select>
 
     <select id="queryPartnerById" resultType="com.ydtech.modules.admin.model.SysPartner">
@@ -81,7 +88,7 @@
         from sys_partner sal
         left join sys_relation_person srp on srp.agency_leader_id=sal.user_id
         <where>
-            srp.type = 0
+            srp.type = 0 and srp.source = 0
             <if test="userId != null and userId != '' ">
                 and srp.suggest_id = #{userId}
             </if>
@@ -200,7 +207,7 @@
             s.id,DATE_FORMAT(s.create_time, '%Y-%m-%d %H' ) as time
         FROM sys_user  s
         <where>
-            s.status in (1, 4, 5, 6, 7)
+            s.status != 0
             <if test="deptIds != null and deptIds != '' and deptIds.size() > 0">
                 AND s.dept_id  in
                 <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
@@ -225,7 +232,7 @@
             s.id,DATE_FORMAT(s.create_time, '%Y-%m-%d' ) as time
         FROM sys_user  s
         <where>
-            s.status in (1, 4, 5, 6, 7)
+            s.status != 0
             <if test="deptIds != null and deptIds != '' and deptIds.size() > 0">
                 AND s.dept_id  in
                 <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
@@ -251,7 +258,7 @@
         s.id,DATE_FORMAT(s.create_time, '%Y-%m-%d %H' ) as time
         FROM sys_user  s
         <where>
-            s.status in (1, 4, 5, 6, 7)
+            s.status != 0
             <if test="deptIds != null and deptIds != '' and deptIds.size() > 0">
                 AND s.dept_id  in
                 <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
@@ -276,7 +283,7 @@
         s.id,DATE_FORMAT(s.create_time, '%Y-%m-%d' ) as time
         FROM sys_user  s
         <where>
-            s.status in (1, 4, 5, 6, 7)
+            s.status != 0
             <if test="deptIds != null and deptIds != '' and deptIds.size() > 0">
                 AND s.dept_id  in
                 <foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
@@ -304,7 +311,7 @@
         FROM sys_partner s
         left join sys_relation_person srp on srp.agency_leader_id = s.user_id
         <where>
-            s.del_flag = 1 and srp.type = 0
+            s.del_flag = 1 and srp.type = 0 and srp.source = 0
             <if test="userId != null and userId != '' ">
                 and srp.suggest_id = #{userId}
             </if>
@@ -329,7 +336,7 @@
         FROM sys_partner s
         left join sys_relation_person srp on srp.agency_leader_id = s.user_id
         <where>
-            s.del_flag = 1 and srp.type = 0
+            s.del_flag = 1 and srp.type = 0 and srp.source = 0
             <if test="userId != null and userId != '' ">
                 and srp.suggest_id = #{userId}
             </if>

+ 51 - 0
src/main/resources/mapper/modules/admin/SysPremiumDetailsMapper.xml

@@ -46,6 +46,57 @@
         ORDER BY apd.create_time desc
 
     </select>
+    <sql id="setGroupConcatMaxLen">
+        SET SESSION group_concat_max_len = 10000;
+    </sql>
+    <select id="queryInfoPage" resultType="java.util.Map">
+        <include refid="setGroupConcatMaxLen"/>
+        SELECT
+            company_id as companyId,
+            GROUP_CONCAT(
+                    CONCAT(
+                            '{"id":', id,
+                            ',"orderno":"', orderno,
+                            '","companyId":"', company_id,
+                            '","userId":"', user_id,
+                            '","userName":"', user_name,
+                            '","issuerId":"', issuer_id,
+                            '","issuerName":"', issuer_name,
+                            '","jqpremium":', jqpremium,
+                            ',"sypremium":', sypremium,
+                            ',"jypremium":', jypremium,
+                            ',"sumpremium":', sumpremium,
+                            ',"proportional":"', proportional,
+                            '","extractFee":', extract_fee,
+                            ',"status":', status,
+                            ',"createTime":"', DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s'),
+                            '","type":', type,
+                            ',"industrySector":', industry_sector,
+                            ',"licenseno":"', licenseno,
+                            '","source":', source,
+                            '}'
+                        )
+                ) AS sysPremiumDetails
+        FROM
+            sys_premium_details
+        <where>
+            status = 1
+            <if test="userId !=null and userId !=''">
+                and user_id = #{userId}
+            </if>
+            <if test="dto.industrySector != 0 ">
+                and industry_sector = #{dto.industrySector}
+            </if>
+            <if test="dto.beginTime != null and dto.beginTime != '' and dto.endTime != null and dto.endTime != ''">
+                and (DATE_FORMAT(create_time, '%Y-%m-%d %H:%i:%s') between DATE_FORMAT( #{dto.beginTime}, '%Y-%m-%d %H:%i:%s') and DATE_FORMAT( #{dto.endTime}, '%Y-%m-%d %H:%i:%s'))
+            </if>
+        </where>
+        GROUP BY
+            company_id
+        ORDER BY
+            company_id ASC
+        LIMIT #{dto.pageSize} OFFSET #{dto.pageNum};
+    </select>
 
 
 </mapper>

+ 1 - 1
src/main/resources/mapper/modules/esm/EsmUserImageMapper.xml

@@ -23,7 +23,7 @@
     </sql>
 
     <select id="selectEsmUserImageQueryVo" resultMap="EsmUserImageQueryVo">
-        select i.type, i.images_id, f.file_path as url
+        select i.type, i.images_id, f.url
         from esm_user_image as i
                  left join ins_upload_files as f
                            on i.images_id = f.id

+ 13 - 13
src/main/resources/mapper/modules/fnc/InsPlyIncomeMapper.xml

@@ -314,7 +314,7 @@
                 AND  a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                AND a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
 
             <if test="settlementDate !=null  and  settlementDate  !=''">
@@ -639,7 +639,7 @@
                 AND  a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                AND a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
 
             <if test="settlementDate !=null  and  settlementDate  !=''">
@@ -836,7 +836,7 @@
                     a.create_time =#{createTime}
                 </if>
                 <if test="settlementTime !=null  and  settlementTime  !=''">
-                    a.settlement_time =#{settlementTime}
+                    and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
                 </if>
 
                 <if test="userId !=null  and  userId  !=''">
@@ -971,7 +971,7 @@
                    AND a.create_time =#{createTime}
                 </if>
                 <if test="settlementTime !=null  and  settlementTime  !=''">
-                   AND a.settlement_time =#{settlementTime}
+                    and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
                 </if>
 
                 <if test="partnerCompaniesName !=null  and  partnerCompaniesName  !=''">
@@ -1116,7 +1116,7 @@
                    AND a.create_time =#{createTime}
                 </if>
                 <if test="settlementTime !=null  and  settlementTime  !=''">
-                   AND a.settlement_time =#{settlementTime}
+                    and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
                 </if>
 
                 <if test="partnerCompaniesName !=null  and  partnerCompaniesName  !=''">
@@ -1266,7 +1266,7 @@
             </if>
 
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                and  a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
 
             <if test="createTimeStart  !=null  and  createTimeStart  != ''  and  createTimeEnd   != null  and  createTimeEnd   !=''">
@@ -1437,7 +1437,7 @@
                 AND  a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                AND a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
 
             <if test="userId !=null  and  userId  !=''">
@@ -1631,7 +1631,7 @@
                 AND  a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                AND a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
             <if test="createTimeQuery != null and createTimeQuery != ''">
                 and DATE_FORMAT( a.create_time, '%Y-%m-%d')   =#{createTimeQuery}
@@ -1900,7 +1900,7 @@
                        AND  a.create_time =#{createTime}
                    </if>
                    <if test="settlementTime !=null  and  settlementTime  !=''">
-                       AND a.settlement_time =#{settlementTime}
+                       and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
                    </if>
 
                    <if test="userId !=null  and  userId  !=''">
@@ -1974,7 +1974,7 @@
         SELECT
             DATE_FORMAT(a.settlement_time, '%Y-%m-%d %H:%i:%s') as "settlementTime",
             MAX(upf.url) as "imageUrl",
-            sum(a.commission_feevalue + a.other_feevalue) AS "settlementAmount"
+            sum(IFNULL(a.commission_feevalue,0) + IFNULL(a.other_feevalue,0)) AS "settlementAmount"
         FROM
             ins_ply_income a
             LEFT  JOIN  ptl_agreement  pa  on  a.agreement_id  = pa.id
@@ -2151,7 +2151,7 @@
                 AND  a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                AND a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
 
             <if test="settlementDate !=null  and  settlementDate  !=''">
@@ -2353,7 +2353,7 @@
                 AND  a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                AND a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
 
             <if test="settlementDate !=null  and  settlementDate  !=''">
@@ -3379,7 +3379,7 @@
                 AND  a.create_time =#{createTime}
             </if>
             <if test="settlementTime !=null  and  settlementTime  !=''">
-                AND a.settlement_time =#{settlementTime}
+                and DATE_FORMAT( a.settlement_time, '%Y-%m-%d')  = DATE_FORMAT(#{settlementTime}, '%Y-%m-%d')
             </if>
 
             <if test="userId !=null  and  userId  !=''">

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott