@@ -12,4 +12,11 @@ ALTER TABLE `voice_language` | |||||
ADD COLUMN customized_user_id BIGINT(11) COMMENT '私人定制所属用户' AFTER `customized`; | ADD COLUMN customized_user_id BIGINT(11) COMMENT '私人定制所属用户' AFTER `customized`; | ||||
ALTER TABLE `user_mould_video` | |||||
ADD COLUMN cost_points int(11) NOT NULL DEFAULT 0 COMMENT '消耗金币' ; | |||||
ALTER TABLE `user_mould_video` | |||||
ADD COLUMN cost_points_detail varchar(500) COMMENT '消耗金币明细' ; | |||||
@@ -13,6 +13,7 @@ import com.iformall.domain.po.sm.UserMouldVideo; | |||||
import com.iformall.domain.po.sm.VoiceInfo; | import com.iformall.domain.po.sm.VoiceInfo; | ||||
import com.iformall.domain.vo.WxCouponOrderBVo; | import com.iformall.domain.vo.WxCouponOrderBVo; | ||||
import com.iformall.enums.EnumMouldSendType; | import com.iformall.enums.EnumMouldSendType; | ||||
import com.iformall.enums.EnumProject; | |||||
import com.iformall.enums.EnumVideoStatus; | import com.iformall.enums.EnumVideoStatus; | ||||
import com.iformall.enums.EnumaMouldPatchStatus; | import com.iformall.enums.EnumaMouldPatchStatus; | ||||
import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
@@ -153,7 +154,7 @@ public class UserMouldVideoController extends BaseController { | |||||
return userMouldVideoService.saveOrUpdate(record); | return userMouldVideoService.saveOrUpdate(record); | ||||
} | } | ||||
@ApiOperation("生成视频") | |||||
@ApiOperation("慧影项目生成视频") | |||||
@PostMapping("createVideo") | @PostMapping("createVideo") | ||||
public ResultData create(@RequestBody UserMouldVideo record) { | public ResultData create(@RequestBody UserMouldVideo record) { | ||||
logger.debug("[" + getIpAddr() + "] MouldPatchController::saveOrUpdate"); | logger.debug("[" + getIpAddr() + "] MouldPatchController::saveOrUpdate"); | ||||
@@ -194,6 +195,7 @@ public class UserMouldVideoController extends BaseController { | |||||
mouldVideoUpd.setCreateVideoDate(new Date()); | mouldVideoUpd.setCreateVideoDate(new Date()); | ||||
userMouldVideoService.saveOrUpdate(mouldVideoUpd); | userMouldVideoService.saveOrUpdate(mouldVideoUpd); | ||||
userMouldVideoService.createVideo(mouldVideo); | userMouldVideoService.createVideo(mouldVideo); | ||||
return new ResultData(); | return new ResultData(); | ||||
@@ -793,4 +793,11 @@ public class WxUserGrantController extends BaseController { | |||||
return new ResultData(userConsumptionPackageService.getPackageInfo()); | return new ResultData(userConsumptionPackageService.getPackageInfo()); | ||||
} | } | ||||
@ApiOperation("获取用户币值") | |||||
@GetMapping("/getUserPoins") | |||||
public ResultData getUserPoins() { | |||||
WxCUserBasicInfo userBasicInfo = wxCUserBasicInfoService.getById(getMemberId()); | |||||
return new ResultData(userBasicInfo.getPoins()); | |||||
} | |||||
} | } |
@@ -197,7 +197,12 @@ public class UserMouldVideo extends TenantEntity { | |||||
private Date createDate; | private Date createDate; | ||||
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | ||||
private Date updateDate; | private Date updateDate; | ||||
@io.swagger.annotations.ApiModelProperty(value="消耗金币",name="costPoints") | |||||
private Integer costPoints; | |||||
@io.swagger.annotations.ApiModelProperty(value="消耗金币明细",name="costPointsDetail") | |||||
private String costPointsDetail; | |||||
@TableField(exist = false) | @TableField(exist = false) | ||||
private List<Integer> videoStatuss; | private List<Integer> videoStatuss; | ||||
@@ -69,5 +69,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S | |||||
//WxCUserBasicInfo selectById1(Long id); | //WxCUserBasicInfo selectById1(Long id); | ||||
//void updateCode(Long id, String mcode); | //void updateCode(Long id, String mcode); | ||||
void reductPoints(@Param("id")Long id,@Param("finalTenantId")String finalTenantId,@Param("reductPoints")Integer reductPoints); | |||||
} | } | ||||
@@ -205,5 +205,7 @@ public interface WxCUserBasicInfoService { | |||||
// void updateCode(Long id, String mcode); | // void updateCode(Long id, String mcode); | ||||
void reducePoints(Long id,String finalTenantId,Integer reducePoints); | |||||
} | } | ||||
@@ -6,7 +6,8 @@ import com.iformall.domain.po.Product; | |||||
import com.iformall.enums.EnumProductType; | import com.iformall.enums.EnumProductType; | ||||
import com.iformall.mapper.ProductMapper; | import com.iformall.mapper.ProductMapper; | ||||
import com.iformall.service.ProductService; | import com.iformall.service.ProductService; | ||||
import com.iformall.service.payProduct.PayProductFactory; | |||||
import com.iformall.service.project.ProjectFactory; | |||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
@@ -24,7 +25,7 @@ public class ProductServiceImpl implements ProductService { | |||||
ProductMapper productMapper; | ProductMapper productMapper; | ||||
@Autowired | @Autowired | ||||
PayProductFactory payProductFactory; | |||||
ProjectFactory payProductFactory; | |||||
@Override | @Override | ||||
public PageInfo<Product> listAsPage(Product record, Integer pageIndex, Integer pageSize) { | public PageInfo<Product> listAsPage(Product record, Integer pageIndex, Integer pageSize) { | ||||
@@ -1540,5 +1540,10 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc | |||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
@Override | |||||
public void reducePoints(Long id,String finalTenantId, Integer reducePoints) { | |||||
wxCUserBasicInfoMapper.reductPoints(id, finalTenantId, reducePoints); | |||||
} | |||||
} | } | ||||
@@ -1,61 +0,0 @@ | |||||
package com.iformall.service.payProduct; | |||||
import java.util.Map; | |||||
import java.util.concurrent.ConcurrentHashMap; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.common.ErrorCode; | |||||
import com.iformall.enums.EnumProject; | |||||
import com.iformall.exception.MallinkException; | |||||
import com.iformall.service.payProduct.service.PayProductService; | |||||
import com.iformall.service.payProduct.service.impl.CommonPayProductService; | |||||
import com.iformall.service.payProduct.service.impl.HBPayProductService; | |||||
import com.iformall.service.payProduct.service.impl.HKPayProductService; | |||||
import com.iformall.service.payProduct.service.impl.HYPayProductService; | |||||
import com.iformall.service.payProduct.service.impl.HYuPayProductService; | |||||
import com.iformall.service.payProduct.service.impl.ZXPayProductService; | |||||
/** | |||||
* 支付套餐 | |||||
* @author Administrator | |||||
*/ | |||||
@Service | |||||
public class PayProductFactory { | |||||
private Map<Integer,PayProductService> serviceMap = null; | |||||
@Autowired | |||||
CommonPayProductService commonPayProductService; | |||||
@Autowired | |||||
HYPayProductService hYPayProductService; | |||||
@Autowired | |||||
HBPayProductService hBPayProductService; | |||||
@Autowired | |||||
HYuPayProductService hYuPayProductService; | |||||
@Autowired | |||||
HKPayProductService hKPayProductService; | |||||
@Autowired | |||||
ZXPayProductService zXPayProductService; | |||||
private Map<Integer,PayProductService> getServiceMap() { | |||||
if (null == serviceMap) { | |||||
serviceMap = new ConcurrentHashMap<Integer,PayProductService>(); | |||||
serviceMap.put(EnumProject.PROJECT_0.getCode(), commonPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_1.getCode(), hBPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_2.getCode(), hYPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_3.getCode(), hYuPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_4.getCode(), hKPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_5.getCode(), zXPayProductService); | |||||
} | |||||
return serviceMap; | |||||
} | |||||
public PayProductService getPayAdapterService(Integer productProject) throws MallinkException{ | |||||
PayProductService service = getServiceMap().get(productProject); | |||||
if (null == service) { | |||||
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"["+productProject+"] 支付套餐service未找到"); | |||||
} | |||||
return service; | |||||
} | |||||
} |
@@ -1,8 +0,0 @@ | |||||
package com.iformall.service.payProduct.service; | |||||
import com.iformall.domain.po.Product; | |||||
public interface PayProductService { | |||||
public Object getProductExtroInfo(Product product); | |||||
} |
@@ -1,17 +0,0 @@ | |||||
package com.iformall.service.payProduct.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.payProduct.service.PayProductService; | |||||
//慧影支付套餐 | |||||
@Service | |||||
public class CommonPayProductService implements PayProductService{ | |||||
@Override | |||||
public Object getProductExtroInfo(Product product) { | |||||
return null; | |||||
} | |||||
} |
@@ -1,17 +0,0 @@ | |||||
package com.iformall.service.payProduct.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.payProduct.service.PayProductService; | |||||
//慧播支付套餐 | |||||
@Service | |||||
public class HBPayProductService implements PayProductService{ | |||||
@Override | |||||
public Object getProductExtroInfo(Product product) { | |||||
return null; | |||||
} | |||||
} |
@@ -1,17 +0,0 @@ | |||||
package com.iformall.service.payProduct.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.payProduct.service.PayProductService; | |||||
//慧侃支付套餐 | |||||
@Service | |||||
public class HKPayProductService implements PayProductService{ | |||||
@Override | |||||
public Object getProductExtroInfo(Product product) { | |||||
return null; | |||||
} | |||||
} |
@@ -1,18 +0,0 @@ | |||||
package com.iformall.service.payProduct.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.payProduct.service.PayProductService; | |||||
//慧影支付套餐 | |||||
@Service | |||||
public class HYPayProductService implements PayProductService{ | |||||
@Override | |||||
public Object getProductExtroInfo(Product product) { | |||||
//慧影套餐表project_package_detail, 现在暂时不搞那么复杂 | |||||
return null; | |||||
} | |||||
} |
@@ -1,17 +0,0 @@ | |||||
package com.iformall.service.payProduct.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.payProduct.service.PayProductService; | |||||
//慧语支付套餐 | |||||
@Service | |||||
public class HYuPayProductService implements PayProductService{ | |||||
@Override | |||||
public Object getProductExtroInfo(Product product) { | |||||
return null; | |||||
} | |||||
} |
@@ -1,17 +0,0 @@ | |||||
package com.iformall.service.payProduct.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.payProduct.service.PayProductService; | |||||
//智象支付套餐 | |||||
@Service | |||||
public class ZXPayProductService implements PayProductService{ | |||||
@Override | |||||
public Object getProductExtroInfo(Product product) { | |||||
return null; | |||||
} | |||||
} |
@@ -0,0 +1,60 @@ | |||||
package com.iformall.service.project; | |||||
import java.util.Map; | |||||
import java.util.concurrent.ConcurrentHashMap; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.common.ErrorCode; | |||||
import com.iformall.enums.EnumProject; | |||||
import com.iformall.exception.MallinkException; | |||||
import com.iformall.service.project.service.ProjectService; | |||||
import com.iformall.service.project.service.impl.CommonProjectService; | |||||
import com.iformall.service.project.service.impl.HBProjectService; | |||||
import com.iformall.service.project.service.impl.HKProjectService; | |||||
import com.iformall.service.project.service.impl.HYProjectService; | |||||
import com.iformall.service.project.service.impl.HYuProjectService; | |||||
import com.iformall.service.project.service.impl.ZXProjectService; | |||||
/** | |||||
* @author Administrator | |||||
*/ | |||||
@Service | |||||
public class ProjectFactory { | |||||
private Map<Integer,ProjectService> serviceMap = null; | |||||
@Autowired | |||||
CommonProjectService commonPayProductService; | |||||
@Autowired | |||||
HYProjectService hYPayProductService; | |||||
@Autowired | |||||
HBProjectService hBPayProductService; | |||||
@Autowired | |||||
HYuProjectService hYuPayProductService; | |||||
@Autowired | |||||
HKProjectService hKPayProductService; | |||||
@Autowired | |||||
ZXProjectService zXPayProductService; | |||||
private Map<Integer,ProjectService> getServiceMap() { | |||||
if (null == serviceMap) { | |||||
serviceMap = new ConcurrentHashMap<Integer,ProjectService>(); | |||||
serviceMap.put(EnumProject.PROJECT_0.getCode(), commonPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_1.getCode(), hBPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_2.getCode(), hYPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_3.getCode(), hYuPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_4.getCode(), hKPayProductService); | |||||
serviceMap.put(EnumProject.PROJECT_5.getCode(), zXPayProductService); | |||||
} | |||||
return serviceMap; | |||||
} | |||||
public ProjectService getProjectService(Integer productProject) throws MallinkException{ | |||||
ProjectService service = getServiceMap().get(productProject); | |||||
if (null == service) { | |||||
throw new MallinkException(ErrorCode.SYS_SERVER_ERROR.getCode(),"["+productProject+"] 支付套餐service未找到"); | |||||
} | |||||
return service; | |||||
} | |||||
} |
@@ -0,0 +1,24 @@ | |||||
package com.iformall.service.project.entity; | |||||
import lombok.Data; | |||||
public class CreateBilling { | |||||
//总消耗金币数 | |||||
private Integer totalCostPoins; | |||||
//详细清单 | |||||
private String detail; | |||||
public Integer getTotalCostPoins() { | |||||
return totalCostPoins; | |||||
} | |||||
public void setTotalCostPoins(Integer totalCostPoins) { | |||||
this.totalCostPoins = totalCostPoins; | |||||
} | |||||
public String getDetail() { | |||||
return detail; | |||||
} | |||||
public void setDetail(String detail) { | |||||
this.detail = detail; | |||||
} | |||||
} |
@@ -0,0 +1,20 @@ | |||||
package com.iformall.service.project.service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
public interface ProjectService { | |||||
/** | |||||
* 查询支付产品其余信息(如套餐明细等信息) | |||||
* @param product | |||||
* @return | |||||
*/ | |||||
public Object getPayProductExtroInfo(Product product); | |||||
/** | |||||
* 计算生成视频账单 | |||||
* @return | |||||
*/ | |||||
public CreateBilling calcuteVideoBilling(String videoSeconds,Long videoSize); | |||||
} |
@@ -0,0 +1,11 @@ | |||||
package com.iformall.service.project.service.impl; | |||||
import com.iformall.domain.po.Product; | |||||
public class BaseProjectService { | |||||
public Object noPayProductExtroInfo(Product product) { | |||||
return null; | |||||
} | |||||
} |
@@ -0,0 +1,24 @@ | |||||
package com.iformall.service.project.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
import com.iformall.service.project.service.ProjectService; | |||||
//通用项目 | |||||
@Service | |||||
public class CommonProjectService extends BaseProjectService implements ProjectService{ | |||||
@Override | |||||
public Object getPayProductExtroInfo(Product product) { | |||||
return noPayProductExtroInfo(product); | |||||
} | |||||
@Override | |||||
public CreateBilling calcuteVideoBilling(String videoSeconds, Long videoSize) { | |||||
// TODO Auto-generated method stub | |||||
return null; | |||||
} | |||||
} |
@@ -0,0 +1,23 @@ | |||||
package com.iformall.service.project.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
import com.iformall.service.project.service.ProjectService; | |||||
//慧播 | |||||
@Service | |||||
public class HBProjectService extends BaseProjectService implements ProjectService{ | |||||
@Override | |||||
public Object getPayProductExtroInfo(Product product) { | |||||
return noPayProductExtroInfo(product); | |||||
} | |||||
@Override | |||||
public CreateBilling calcuteVideoBilling(String videoSeconds, Long videoSize) { | |||||
return null; | |||||
} | |||||
} |
@@ -0,0 +1,24 @@ | |||||
package com.iformall.service.project.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
import com.iformall.service.project.service.ProjectService; | |||||
//慧侃 | |||||
@Service | |||||
public class HKProjectService extends BaseProjectService implements ProjectService{ | |||||
@Override | |||||
public Object getPayProductExtroInfo(Product product) { | |||||
return noPayProductExtroInfo(product); | |||||
} | |||||
@Override | |||||
public CreateBilling calcuteVideoBilling(String videoSeconds, Long videoSize) { | |||||
// TODO Auto-generated method stub | |||||
return null; | |||||
} | |||||
} |
@@ -0,0 +1,30 @@ | |||||
package com.iformall.service.project.service.impl; | |||||
import java.math.BigDecimal; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
import com.iformall.service.project.service.ProjectService; | |||||
//慧影 | |||||
@Service | |||||
public class HYProjectService extends BaseProjectService implements ProjectService{ | |||||
@Override | |||||
public Object getPayProductExtroInfo(Product product) { | |||||
//慧影套餐表project_package_detail, 现在暂时不搞那么复杂 | |||||
return noPayProductExtroInfo(product); | |||||
} | |||||
@Override | |||||
public CreateBilling calcuteVideoBilling(String videoSeconds, Long videoSize) { | |||||
//慧影视频按照时长来扣币 | |||||
CreateBilling cb = new CreateBilling(); | |||||
//每秒扣币 | |||||
float poinsPerSeconds = 0.008F; | |||||
cb.setTotalCostPoins(new BigDecimal(videoSeconds).multiply(new BigDecimal(poinsPerSeconds)).intValue()); | |||||
cb.setDetail("每秒扣币"+poinsPerSeconds+"个,总共时长"+videoSeconds+"秒"); | |||||
return cb; | |||||
} | |||||
} |
@@ -0,0 +1,24 @@ | |||||
package com.iformall.service.project.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
import com.iformall.service.project.service.ProjectService; | |||||
//慧语 | |||||
@Service | |||||
public class HYuProjectService extends BaseProjectService implements ProjectService{ | |||||
@Override | |||||
public Object getPayProductExtroInfo(Product product) { | |||||
return noPayProductExtroInfo(product); | |||||
} | |||||
@Override | |||||
public CreateBilling calcuteVideoBilling(String videoSeconds, Long videoSize) { | |||||
// TODO Auto-generated method stub | |||||
return null; | |||||
} | |||||
} |
@@ -0,0 +1,24 @@ | |||||
package com.iformall.service.project.service.impl; | |||||
import org.springframework.stereotype.Service; | |||||
import com.iformall.domain.po.Product; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
import com.iformall.service.project.service.ProjectService; | |||||
//智象 | |||||
@Service | |||||
public class ZXProjectService extends BaseProjectService implements ProjectService{ | |||||
@Override | |||||
public Object getPayProductExtroInfo(Product product) { | |||||
return noPayProductExtroInfo(product); | |||||
} | |||||
@Override | |||||
public CreateBilling calcuteVideoBilling(String videoSeconds, Long videoSize) { | |||||
// TODO Auto-generated method stub | |||||
return null; | |||||
} | |||||
} |
@@ -11,6 +11,9 @@ import com.iformall.common.ResultData; | |||||
import com.iformall.domain.po.sm.*; | import com.iformall.domain.po.sm.*; | ||||
import com.iformall.enums.*; | import com.iformall.enums.*; | ||||
import com.iformall.mapper.UserMouldVideoMapper; | import com.iformall.mapper.UserMouldVideoMapper; | ||||
import com.iformall.service.WxCUserBasicInfoService; | |||||
import com.iformall.service.project.ProjectFactory; | |||||
import com.iformall.service.project.entity.CreateBilling; | |||||
import com.iformall.service.sm.*; | import com.iformall.service.sm.*; | ||||
import com.iformall.sm.AiVideoHelper; | import com.iformall.sm.AiVideoHelper; | ||||
import com.iformall.sm.AiVideoParam; | import com.iformall.sm.AiVideoParam; | ||||
@@ -63,6 +66,12 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { | |||||
@Autowired | @Autowired | ||||
RedisLock redisLock; | RedisLock redisLock; | ||||
@Autowired | |||||
ProjectFactory projectFactory; | |||||
@Autowired | |||||
WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
@Override | @Override | ||||
public PageInfo<UserMouldVideo> listAsPage(UserMouldVideo record, Integer pageIndex, Integer pageSize) { | public PageInfo<UserMouldVideo> listAsPage(UserMouldVideo record, Integer pageIndex, Integer pageSize) { | ||||
@@ -463,6 +472,14 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { | |||||
videoUpd.setVideoStatus(EnumVideoStatus.upload_success.getCode()); | videoUpd.setVideoStatus(EnumVideoStatus.upload_success.getCode()); | ||||
videoUpd.setVideoMsg("视频上传成功"); | videoUpd.setVideoMsg("视频上传成功"); | ||||
videoUpd.setUpdateDate(new Date()); | videoUpd.setUpdateDate(new Date()); | ||||
//设置扣费,当前方法是慧影项目专用的 | |||||
CreateBilling cb = projectFactory.getProjectService(EnumProject.PROJECT_2.getCode()).calcuteVideoBilling(videoUpd.getVideoTime(), videoUpd.getVideoSize()); | |||||
if (null != cb) { | |||||
videoUpd.setCostPoints(cb.getTotalCostPoins()); | |||||
videoUpd.setCostPointsDetail(cb.getDetail()); | |||||
//扣去当前用户的币 | |||||
wxCUserBasicInfoService.reducePoints(mouldVideo.getUserId(), mouldVideo.getFinalTenantId(),cb.getTotalCostPoins()); | |||||
} | |||||
this.updateById(videoUpd); | this.updateById(videoUpd); | ||||
break; | break; | ||||
} | } | ||||
@@ -35,12 +35,17 @@ | |||||
<result column="create_video_date" jdbcType="TIMESTAMP" property="createVideoDate"/> | <result column="create_video_date" jdbcType="TIMESTAMP" property="createVideoDate"/> | ||||
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | ||||
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | ||||
<result column="cost_points" jdbcType="INTEGER" property="costPoints"/> | |||||
<result column="cost_points_detail" jdbcType="VARCHAR" property="costPointsDetail"/> | |||||
</resultMap> | </resultMap> | ||||
<sql id="allColumns"> | <sql id="allColumns"> | ||||
`id`, `tenant_id`, `parent_tenant_id`, `user_id`, `video_type`, | `id`, `tenant_id`, `parent_tenant_id`, `user_id`, `video_type`, | ||||
`person_mould_id`, `person_mould_sm`,`person_json`, `subtitle_enabled`, `subtitle_params`, `voice_mould_id`, `voice_mould_sm`, `languages`, `paperwork`, `background_id`, `background_sm`,`material_ids`,`material_all_json`, | |||||
`title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`, `create_video_date`, `create_date`, `update_date` | |||||
`person_mould_id`, `person_mould_sm`,`person_json`, `subtitle_enabled`, `subtitle_params`, `voice_mould_id`, `voice_mould_sm`, `languages`, | |||||
`paperwork`, `background_id`, `background_sm`,`material_ids`,`material_all_json`,`title`, `cover_img`, `remark`, `video_id`, `video_path`, | |||||
`video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`, `create_video_date`, `create_date`, `update_date`,`cost_points`, | |||||
`cost_points_detail` | |||||
</sql> | </sql> | ||||
<sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
@@ -132,7 +137,7 @@ | |||||
`id`, `video_type`, | `id`, `video_type`, | ||||
`paperwork`, | `paperwork`, | ||||
`title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`, | `title`, `cover_img`, `remark`, `video_id`, `video_path`, `video_play_url`, `video_time`, `video_size`, `video_status`, `video_msg`, | ||||
`create_video_date`, `create_date`, `update_date` | |||||
`create_video_date`, `create_date`, `update_date`,`cost_points`,`cost_points_detail` | |||||
from user_mould_video | from user_mould_video | ||||
<include refid="dynamicWhereConditions"/> | <include refid="dynamicWhereConditions"/> | ||||
</select> | </select> | ||||
@@ -580,5 +580,9 @@ | |||||
<update id="cuserOldToNew" statementType="CALLABLE" > | <update id="cuserOldToNew" statementType="CALLABLE" > | ||||
{call cuser_old_to_new(#{oldCuserId},#{newCuserId},#{tableIndex},#{finalTableIndex})} | {call cuser_old_to_new(#{oldCuserId},#{newCuserId},#{tableIndex},#{finalTableIndex})} | ||||
</update> | </update> | ||||
<update id="reducePoints" parameterType="java.util.HashMap"> | |||||
UPDATE wx_c_user_basic_info set points = points - #{reductPoints} where id = #{id} | |||||
</update> | |||||
</mapper> | </mapper> |