| | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <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> |
| | | |
| | |
| | | <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} |
| | |
| | | |
| | | <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> |
| | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <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> |
| | | |
| | |
| | | <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" > |
| | |
| | | |
| | | <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> |
| | |
| | | <!-- 整个实体类修改,表字段=实体类字段--> |
| | | <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> |
| | | |
| | |
| | | <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} |
| | |
| | | |
| | | <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> |
| | |
| | | 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("新增数据失败!"); |
| | |
| | | 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("新增数据失败!"); |
| | |
| | | && !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())) { |
| | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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: |
| | |
| | | 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); |
| | | } |