fwq
2024-01-23 91f667b42d4c38f29523fa29e3b6fb1eb66db866
用户资金处理
6个文件已修改
142 ■■■■■ 已修改文件
phi_platform_common/src/main/resources/mapper/platform/UserIntegralRecordMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/platform/UserMoneyUnclaimedMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/platform/UserValueAddedFundRecordMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserIntegralRecordServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserValueAddedFundRecordServiceImpl.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/service/userMoney/impl/UserMoneyUnclaimedServiceImpl.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_common/src/main/resources/mapper/platform/UserIntegralRecordMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,userId = #{userId},opType = #{opType},opName = #{opName},opId = #{opId},originChannel = #{originChannel},orderId = #{orderId},orderItemId = #{orderItemId},orderType = #{orderType},totalQuantity = #{totalQuantity},notUsedQuantity = #{notUsedQuantity},usedQuantity = #{usedQuantity},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},expirationTime = #{expirationTime},remarks = #{remarks},commonId = #{commonId},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
            ,userId = #{userId},opType = #{opType},opName = #{opName},opId = #{opId},originChannel = #{originChannel},orderId = #{orderId},orderItemId = #{orderItemId},orderType = #{orderType},totalQuantity = #{totalQuantity},notUsedQuantity = #{notUsedQuantity},usedQuantity = #{usedQuantity},isLimitTime = #{isLimitTime},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},expirationTime = #{expirationTime},remarks = #{remarks},commonId = #{commonId},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
        </trim>
    </sql>
     
@@ -19,8 +19,12 @@
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into user_integral_record (id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalQuantity,notUsedQuantity,usedQuantity,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime)  values (#{id},#{userId},#{opType},#{opName},#{opId},#{originChannel},#{orderId},#{orderItemId},#{orderType},#{totalQuantity},#{notUsedQuantity},#{usedQuantity},#{limitStartTime},#{limitEndTime},#{expirationTime},#{remarks},#{commonId},#{isDel},#{createTime},#{editTime})
        insert into user_integral_record (id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalQuantity,notUsedQuantity,usedQuantity,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime)  values (#{id},#{userId},#{opType},#{opName},#{opId},#{originChannel},#{orderId},#{orderItemId},#{orderType},#{totalQuantity},#{notUsedQuantity},#{usedQuantity},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{remarks},#{commonId},#{isDel},#{createTime},#{editTime})
    </insert>
    <insert id="insertById" parameterType="com.hx.phiappt.model.UserIntegralRecord">
        insert into user_integral_record (id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalQuantity,notUsedQuantity,usedQuantity,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime)  values (#{id},#{userId},#{opType},#{opName},#{opId},#{originChannel},#{orderId},#{orderItemId},#{orderType},#{totalQuantity},#{notUsedQuantity},#{usedQuantity},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{remarks},#{commonId},#{isDel},#{createTime},#{editTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.UserIntegralRecord" parameterType="com.hx.mybatisTool.SqlSentence" >
        ${sqlSentence}
@@ -51,14 +55,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.UserIntegralRecord" parameterType="java.lang.Object" >
        select 
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalQuantity,notUsedQuantity,usedQuantity,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalQuantity,notUsedQuantity,usedQuantity,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
        from user_integral_record
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.UserIntegralRecord" parameterType="java.lang.Object" >
        select 
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalQuantity,notUsedQuantity,usedQuantity,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalQuantity,notUsedQuantity,usedQuantity,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
        from user_integral_record
        WHERE id = #{value}
    </select>
phi_platform_common/src/main/resources/mapper/platform/UserMoneyUnclaimedMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,userId = #{userId},fundType = #{fundType},originChannel = #{originChannel},originSubject = #{originSubject},opType = #{opType},commonId = #{commonId},opNumber = #{opNumber},fundOpType = #{fundOpType},status = #{status},operatorId = #{operatorId},operatorName = #{operatorName},operatorType = #{operatorType},operatorShopId = #{operatorShopId},operatorShopName = #{operatorShopName},operationReason = #{operationReason},orderType = #{orderType},orderId = #{orderId},orderNo = #{orderNo},orderItemId = #{orderItemId},isValid = #{isValid},isLimitTime = #{isLimitTime},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},expirationTime = #{expirationTime},receiveTime = #{receiveTime},isSentSMS = #{isSentSMS},SMSStatus = #{SMSStatus},SMSUrl = #{SMSUrl},SMSInfo = #{SMSInfo},remarks = #{remarks},isSyncHis = #{isSyncHis},appId = #{appId},moneyRuleId = #{moneyRuleId},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
            ,userId = #{userId},fundType = #{fundType},originChannel = #{originChannel},originSubject = #{originSubject},opType = #{opType},commonId = #{commonId},opNumber = #{opNumber},fundOpType = #{fundOpType},status = #{status},operatorId = #{operatorId},operatorName = #{operatorName},operatorType = #{operatorType},operatorShopId = #{operatorShopId},operatorShopName = #{operatorShopName},operationReason = #{operationReason},orderType = #{orderType},orderId = #{orderId},orderNo = #{orderNo},orderItemId = #{orderItemId},isValid = #{isValid},isLimitTime = #{isLimitTime},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},expirationTime = #{expirationTime},receiveTime = #{receiveTime},isSentSMS = #{isSentSMS},SMSStatus = #{SMSStatus},SMSUrl = #{SMSUrl},SMSInfo = #{SMSInfo},remarks = #{remarks},isSyncHis = #{isSyncHis},appId = #{appId},moneyRuleId = #{moneyRuleId},isNeedReceive = #{isNeedReceive},isUserReceive = #{isUserReceive},waitReceiveLimit = #{waitReceiveLimit},waitReceiveLimitDay = #{waitReceiveLimitDay},isReceiveLimit = #{isReceiveLimit},receiveLimitType = #{receiveLimitType},receiveLimitData = #{receiveLimitData},receiveMoneyLimit = #{receiveMoneyLimit},receiveMoneyLimitDay = #{receiveMoneyLimitDay},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
        </trim>
    </sql>
     
@@ -19,11 +19,11 @@
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into user_money_unclaimed (id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isDel,createTime,editTime)  values (#{id},#{userId},#{fundType},#{originChannel},#{originSubject},#{opType},#{commonId},#{opNumber},#{fundOpType},#{status},#{operatorId},#{operatorName},#{operatorType},#{operatorShopId},#{operatorShopName},#{operationReason},#{orderType},#{orderId},#{orderNo},#{orderItemId},#{isValid},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{receiveTime},#{isSentSMS},#{SMSStatus},#{SMSUrl},#{SMSInfo},#{remarks},#{isSyncHis},#{appId},#{moneyRuleId},#{isDel},#{createTime},#{editTime})
        insert into user_money_unclaimed (id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isNeedReceive,isUserReceive,waitReceiveLimit,waitReceiveLimitDay,isReceiveLimit,receiveLimitType,receiveLimitData,receiveMoneyLimit,receiveMoneyLimitDay,isDel,createTime,editTime)  values (#{id},#{userId},#{fundType},#{originChannel},#{originSubject},#{opType},#{commonId},#{opNumber},#{fundOpType},#{status},#{operatorId},#{operatorName},#{operatorType},#{operatorShopId},#{operatorShopName},#{operationReason},#{orderType},#{orderId},#{orderNo},#{orderItemId},#{isValid},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{receiveTime},#{isSentSMS},#{SMSStatus},#{SMSUrl},#{SMSInfo},#{remarks},#{isSyncHis},#{appId},#{moneyRuleId},#{isNeedReceive},#{isUserReceive},#{waitReceiveLimit},#{waitReceiveLimitDay},#{isReceiveLimit},#{receiveLimitType},#{receiveLimitData},#{receiveMoneyLimit},#{receiveMoneyLimitDay},#{isDel},#{createTime},#{editTime})
    </insert>
    <insert id="insertById" parameterType="com.hx.phiappt.model.userMoney.UserMoneyUnclaimed">
        insert into user_money_unclaimed (id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isDel,createTime,editTime)  values (#{id},#{userId},#{fundType},#{originChannel},#{originSubject},#{opType},#{commonId},#{opNumber},#{fundOpType},#{status},#{operatorId},#{operatorName},#{operatorType},#{operatorShopId},#{operatorShopName},#{operationReason},#{orderType},#{orderId},#{orderNo},#{orderItemId},#{isValid},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{receiveTime},#{isSentSMS},#{SMSStatus},#{SMSUrl},#{SMSInfo},#{remarks},#{isSyncHis},#{appId},#{moneyRuleId},#{isDel},#{createTime},#{editTime})
        insert into user_money_unclaimed (id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isNeedReceive,isUserReceive,waitReceiveLimit,waitReceiveLimitDay,isReceiveLimit,receiveLimitType,receiveLimitData,receiveMoneyLimit,receiveMoneyLimitDay,isDel,createTime,editTime)  values (#{id},#{userId},#{fundType},#{originChannel},#{originSubject},#{opType},#{commonId},#{opNumber},#{fundOpType},#{status},#{operatorId},#{operatorName},#{operatorType},#{operatorShopId},#{operatorShopName},#{operationReason},#{orderType},#{orderId},#{orderNo},#{orderItemId},#{isValid},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{receiveTime},#{isSentSMS},#{SMSStatus},#{SMSUrl},#{SMSInfo},#{remarks},#{isSyncHis},#{appId},#{moneyRuleId},#{isNeedReceive},#{isUserReceive},#{waitReceiveLimit},#{waitReceiveLimitDay},#{isReceiveLimit},#{receiveLimitType},#{receiveLimitData},#{receiveMoneyLimit},#{receiveMoneyLimitDay},#{isDel},#{createTime},#{editTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.userMoney.UserMoneyUnclaimed" parameterType="com.hx.mybatisTool.SqlSentence" >
@@ -55,14 +55,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.userMoney.UserMoneyUnclaimed" parameterType="java.lang.Object" >
        select 
            id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isDel,createTime,editTime
            id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isNeedReceive,isUserReceive,waitReceiveLimit,waitReceiveLimitDay,isReceiveLimit,receiveLimitType,receiveLimitData,receiveMoneyLimit,receiveMoneyLimitDay,isDel,createTime,editTime
        from user_money_unclaimed
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.userMoney.UserMoneyUnclaimed" parameterType="java.lang.Object" >
        select 
            id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isDel,createTime,editTime
            id,userId,fundType,originChannel,originSubject,opType,commonId,opNumber,fundOpType,status,operatorId,operatorName,operatorType,operatorShopId,operatorShopName,operationReason,orderType,orderId,orderNo,orderItemId,isValid,isLimitTime,limitStartTime,limitEndTime,expirationTime,receiveTime,isSentSMS,SMSStatus,SMSUrl,SMSInfo,remarks,isSyncHis,appId,moneyRuleId,isNeedReceive,isUserReceive,waitReceiveLimit,waitReceiveLimitDay,isReceiveLimit,receiveLimitType,receiveLimitData,receiveMoneyLimit,receiveMoneyLimitDay,isDel,createTime,editTime
        from user_money_unclaimed
        WHERE id = #{value}
    </select>
phi_platform_common/src/main/resources/mapper/platform/UserValueAddedFundRecordMapper.xml
@@ -8,7 +8,7 @@
    <!-- 整个实体类修改,表字段=实体类字段-->
    <sql id="Update_Column_All">
        <trim prefixOverrides=",">
            ,userId = #{userId},opType = #{opType},opName = #{opName},opId = #{opId},originChannel = #{originChannel},orderId = #{orderId},orderItemId = #{orderItemId},orderType = #{orderType},totalAmount = #{totalAmount},notUsedAmount = #{notUsedAmount},usedAmount = #{usedAmount},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},expirationTime = #{expirationTime},remarks = #{remarks},commonId = #{commonId},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
            ,userId = #{userId},opType = #{opType},opName = #{opName},opId = #{opId},originChannel = #{originChannel},orderId = #{orderId},orderItemId = #{orderItemId},orderType = #{orderType},totalAmount = #{totalAmount},notUsedAmount = #{notUsedAmount},usedAmount = #{usedAmount},isLimitTime = #{isLimitTime},limitStartTime = #{limitStartTime},limitEndTime = #{limitEndTime},expirationTime = #{expirationTime},remarks = #{remarks},commonId = #{commonId},isDel = #{isDel},createTime = #{createTime},editTime = #{editTime}
        </trim>
    </sql>
     
@@ -19,8 +19,12 @@
        <selectKey keyProperty="id" resultType="String" order="BEFORE">
               select replace(uuid(),'-','') from dual
        </selectKey>
        insert into user_value_added_fund_record (id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalAmount,notUsedAmount,usedAmount,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime)  values (#{id},#{userId},#{opType},#{opName},#{opId},#{originChannel},#{orderId},#{orderItemId},#{orderType},#{totalAmount},#{notUsedAmount},#{usedAmount},#{limitStartTime},#{limitEndTime},#{expirationTime},#{remarks},#{commonId},#{isDel},#{createTime},#{editTime})
        insert into user_value_added_fund_record (id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalAmount,notUsedAmount,usedAmount,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime)  values (#{id},#{userId},#{opType},#{opName},#{opId},#{originChannel},#{orderId},#{orderItemId},#{orderType},#{totalAmount},#{notUsedAmount},#{usedAmount},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{remarks},#{commonId},#{isDel},#{createTime},#{editTime})
    </insert>
    <insert id="insertById" parameterType="com.hx.phiappt.model.UserValueAddedFundRecord">
        insert into user_value_added_fund_record (id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalAmount,notUsedAmount,usedAmount,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime)  values (#{id},#{userId},#{opType},#{opName},#{opId},#{originChannel},#{orderId},#{orderItemId},#{orderType},#{totalAmount},#{notUsedAmount},#{usedAmount},#{isLimitTime},#{limitStartTime},#{limitEndTime},#{expirationTime},#{remarks},#{commonId},#{isDel},#{createTime},#{editTime})
    </insert>
    <select id="selectList" resultType="com.hx.phiappt.model.UserValueAddedFundRecord" parameterType="com.hx.mybatisTool.SqlSentence" >
        ${sqlSentence}
@@ -51,14 +55,14 @@
    <select id="selectOneByKey" resultType="com.hx.phiappt.model.UserValueAddedFundRecord" parameterType="java.lang.Object" >
        select 
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalAmount,notUsedAmount,usedAmount,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalAmount,notUsedAmount,usedAmount,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
        from user_value_added_fund_record
        WHERE id = #{value}
    </select>
    <select id="selectOneByKeyBlob" resultType="com.hx.phiappt.model.UserValueAddedFundRecord" parameterType="java.lang.Object" >
        select 
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalAmount,notUsedAmount,usedAmount,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
            id,userId,opType,opName,opId,originChannel,orderId,orderItemId,orderType,totalAmount,notUsedAmount,usedAmount,isLimitTime,limitStartTime,limitEndTime,expirationTime,remarks,commonId,isDel,createTime,editTime
        from user_value_added_fund_record
        WHERE id = #{value}
    </select>
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserIntegralRecordServiceImpl.java
@@ -396,10 +396,14 @@
            opNumber = userMoneyUnclaimed.getOpNumber();
        }
        // 获取有效期
        Date expirationTime = UserMoneyTool.getUserIntegralExpirationTime(commonService);
        //Date expirationTime = UserMoneyTool.getUserIntegralExpirationTime(commonService);
        //外面处理结束时间传进来
        Date expirationTime = userMoneyUnclaimed.getLimitEndTime();
        // 添加记录
        UserIntegralRecord userIntegralRecord = new UserIntegralRecord(userMoneyUnclaimed.getUserId(), userMoneyUnclaimed.getOrderId(), userMoneyUnclaimed.getOrderItemId(),
        UserIntegralRecord userIntegralRecord = new UserIntegralRecord(userMoneyUnclaimed.getUserId()
                , userMoneyUnclaimed.getOrderId(), userMoneyUnclaimed.getOrderItemId(),
                userMoneyUnclaimed.getOperationReason(), opNumber, expirationTime, userMoneyUnclaimed.getId());
        userIntegralRecord.setIsLimitTime(userMoneyUnclaimed.getIsLimitTime());
        int insert = commonService.insert(UserIntegralRecordMapper.class, userIntegralRecord);
        if (insert != 1) {
            throw new TipsException("新增数据失败!");
phi_platform_user/src/main/java/com/hx/phip/service/impl/UserValueAddedFundRecordServiceImpl.java
@@ -426,10 +426,14 @@
            opNumber = userMoneyUnclaimed.getOpNumber();
        }
        // 获取有效期
        Date expirationTime = UserMoneyTool.getUserValueAddedFundExpirationTime(commonService);
        //Date expirationTime = UserMoneyTool.getUserValueAddedFundExpirationTime(commonService);
        //外面处理结束时间传进来
        Date expirationTime = userMoneyUnclaimed.getLimitEndTime();
        // 添加记录
        UserValueAddedFundRecord userValueAddedFundRecord = new UserValueAddedFundRecord(userMoneyUnclaimed.getUserId(), userMoneyUnclaimed.getOrderId(), userMoneyUnclaimed.getOrderItemId(),
        UserValueAddedFundRecord userValueAddedFundRecord = new UserValueAddedFundRecord(userMoneyUnclaimed.getUserId()
                , userMoneyUnclaimed.getOrderId(), userMoneyUnclaimed.getOrderItemId(),
                userMoneyUnclaimed.getOperationReason(), opNumber, expirationTime, userMoneyUnclaimed.getId());
        userValueAddedFundRecord.setIsLimitTime(userMoneyUnclaimed.getIsLimitTime());
        int insert = commonService.insert(UserValueAddedFundRecordMapper.class, userValueAddedFundRecord);
        if (insert != 1) {
            throw new TipsException("新增数据失败!");
phi_platform_user/src/main/java/com/hx/phip/service/userMoney/impl/UserMoneyUnclaimedServiceImpl.java
@@ -361,6 +361,16 @@
                    && !userMoneyUnclaimed.getFundType().equals(UserMoneyUnclaimed.FUND_TYPE_INTEGRAL)){
                throw new PlatTipsException(PlatformCode.ERROR_TIPS, "操作资金类型与金额规则类型匹配!");
            }
            userMoneyUnclaimed.setMoneyRuleId(moneyRule.getId());
            userMoneyUnclaimed.setIsNeedReceive(moneyRule.getIsNeedReceive());
            userMoneyUnclaimed.setIsUserReceive(moneyRule.getIsUserReceive());
            userMoneyUnclaimed.setWaitReceiveLimit(moneyRule.getWaitReceiveLimit());
            userMoneyUnclaimed.setWaitReceiveLimitDay(moneyRule.getWaitReceiveLimitDay());
            userMoneyUnclaimed.setIsReceiveLimit(moneyRule.getIsReceiveLimit());
            userMoneyUnclaimed.setReceiveLimitType(moneyRule.getReceiveLimitType());
            userMoneyUnclaimed.setReceiveLimitData(moneyRule.getReceiveLimitData());
            userMoneyUnclaimed.setReceiveMoneyLimit(moneyRule.getReceiveMoneyLimit());
            userMoneyUnclaimed.setReceiveMoneyLimitDay(moneyRule.getReceiveMoneyLimitDay());
        }
        // 来源渠道
        if (StringUtils.isEmpty(userMoneyUnclaimed.getOriginChannel())) {
@@ -744,25 +754,26 @@
                    logger.info("待领取资产处理跳过,数据id:{},原因:数据已失效无法领取", userMoneyUnclaimed.getId());
                    return;
                }
                //获取关联的规则
                MoneyRule moneyRule = getMoneyRule(userMoneyUnclaimed.getMoneyRuleId());
                if (moneyRule != null && moneyRule.getIsReceiveLimit().equals(BaseEntity.YES)){
                    //有领取限制
                    List<MoneyRuleValueDto> moneyRuleValueDtoList = JSONArray.parseArray(moneyRule.getReceiveLimitData(), MoneyRuleValueDto.class);
                //有领取限制
                if (userMoneyUnclaimed.getIsReceiveLimit() != null && userMoneyUnclaimed.getIsReceiveLimit().equals(BaseEntity.YES)){
                    List<MoneyRuleValueDto> moneyRuleValueDtoList = JSONArray.parseArray(userMoneyUnclaimed.getReceiveLimitData(), MoneyRuleValueDto.class);
                    logger.info("待领取资产限制数据"+JSON.toJSONString(moneyRuleValueDtoList));
                    boolean isPass = false;
                    if (moneyRule.getReceiveLimitType().equals(BaseEntity.YES)){
                        //满足其一
                        for (MoneyRuleValueDto moneyRuleValueDto : moneyRuleValueDtoList) {
                            if (SysFunctionLimitEnum.checkPassByCode(moneyRuleValueDto.getFunctionCode(),userMoneyUnclaimed.getUserId())){
                                isPass = true;
                                break;
                    if (moneyRuleValueDtoList != null && moneyRuleValueDtoList.size() > 0){
                        if (userMoneyUnclaimed.getReceiveLimitType().equals(BaseEntity.YES)){
                            //满足其一
                            for (MoneyRuleValueDto moneyRuleValueDto : moneyRuleValueDtoList) {
                                if (SysFunctionLimitEnum.checkPassByCode(moneyRuleValueDto.getFunctionCode(),userMoneyUnclaimed.getUserId())){
                                    isPass = true;
                                    break;
                                }
                            }
                        }
                    }else if (moneyRule.getReceiveLimitType().equals(BaseEntity.NO)){
                        //都要满足
                        for (MoneyRuleValueDto moneyRuleValueDto : moneyRuleValueDtoList) {
                            if (!SysFunctionLimitEnum.checkPassByCode(moneyRuleValueDto.getFunctionCode(),userMoneyUnclaimed.getUserId())){
                                break;
                        }else if (userMoneyUnclaimed.getReceiveLimitType().equals(BaseEntity.NO)){
                            //都要满足
                            for (MoneyRuleValueDto moneyRuleValueDto : moneyRuleValueDtoList) {
                                if (!SysFunctionLimitEnum.checkPassByCode(moneyRuleValueDto.getFunctionCode(),userMoneyUnclaimed.getUserId())){
                                    break;
                                }
                            }
                        }
                    }
@@ -776,6 +787,28 @@
                if (BaseEntity.NO.equals(isReceive)) {
                    addUserLog(userMoneyUnclaimed, BaseEntity.YES);
                }
                //计算有效结束时间
                Date limitEndTime = null;
                Map<String, Object> sqlValue = new HashMap<>();
                //有限制规则
                if (StringUtils.noNull(userMoneyUnclaimed.getMoneyRuleId())){
                    if (userMoneyUnclaimed.getReceiveMoneyLimit() != null && userMoneyUnclaimed.getReceiveMoneyLimit().equals(BaseEntity.YES)){
                        //有限制,限制结束时间计算
                        limitEndTime = DateUtil.addDay(userMoneyUnclaimed.getLimitStartTime(),userMoneyUnclaimed.getWaitReceiveLimitDay());
                    }else {
                        //无限制,默认100年
                        limitEndTime = DateUtil.addYear(userMoneyUnclaimed.getLimitStartTime(), 100);
                    }
                }else {
                    // 已领取调整领取时间
                    int validityPeriod = UserMoneyTool.getReceivedValidityTime(commonService);
                    // 获取时间
                    limitEndTime = DateUtil.addDay(userMoneyUnclaimed.getLimitStartTime(), validityPeriod);
                }
                // 传进去资金处理
                userMoneyUnclaimed.setLimitEndTime(limitEndTime);
                // 操作资金处理
                switch (userMoneyUnclaimed.getFundType()) {
                    case UserMoneyUnclaimed.FUND_TYPE_STORED_VALUE_FUND:
@@ -792,31 +825,14 @@
                        userIntegralRecordService.handleData(userMoneyUnclaimed);
                        break;
                }
                // 更新状态成已处理
                SqlSentence sqlSentence = new SqlSentence();
                Map<String, Object> sqlValue = new HashMap<>();
                String sql = " status=#{m.status},receiveTime=#{m.nowTime},limitEndTime=#{m.limitEndTime},editTime=#{m.nowTime} WHERE id=#{m.id}";
                sqlValue.put("nowTime", new Date());
                sqlValue.put("id", userMoneyUnclaimed.getId());
                sqlValue.put("status", UserMoneyUnclaimed.STATUS_SUCCEED);
                if (moneyRule != null){
                    //有限制
                    if (moneyRule.getReceiveMoneyLimit().equals(BaseEntity.YES)){
                        //无限制,默认100年
                        Date limitEndTime = DateUtil.addDay(userMoneyUnclaimed.getLimitStartTime(),moneyRule.getWaitReceiveLimitDay());
                        sqlValue.put("limitEndTime", limitEndTime);
                    }else {
                        //无限制,默认100年
                        Date limitEndTime = DateUtil.addYear(userMoneyUnclaimed.getLimitStartTime(), 100);
                        sqlValue.put("limitEndTime", limitEndTime);
                    }
                }else {
                    // 已领取调整领取时间
                    int validityPeriod = UserMoneyTool.getReceivedValidityTime(commonService);
                    // 获取时间
                    Date limitEndTime = DateUtil.addDay(userMoneyUnclaimed.getLimitStartTime(), validityPeriod);
                    sqlValue.put("limitEndTime", limitEndTime);
                }
                sqlValue.put("nowTime", new Date());
                sqlValue.put("limitEndTime", limitEndTime);
                sqlValue.put("id", userMoneyUnclaimed.getId());
                sqlSentence.sqlSentence(sql, sqlValue);
                commonService.updateWhere(UserMoneyUnclaimedMapper.class, sqlSentence);
            }