From 2fb8abf0bcf2533f6897c1ba8516417b8fe967c8 Mon Sep 17 00:00:00 2001 From: winter Date: Sun, 5 Nov 2023 20:28:11 +0800 Subject: [PATCH] fix --- .../migration/V2023110300001_personmould.sql | 7 +++ .../controller/UserMouldVideoController.java | 4 +- .../controller/WxUserGrantController.java | 7 +++ .../iformall/domain/po/sm/UserMouldVideo.java | 7 ++- .../mapper/WxCUserBasicInfoMapper.java | 2 + .../service/WxCUserBasicInfoService.java | 2 + .../service/impl/ProductServiceImpl.java | 5 +- .../impl/WxCUserBasicInfoServiceImpl.java | 5 ++ .../service/payProduct/PayProductFactory.java | 61 ------------------- .../payProduct/service/PayProductService.java | 8 --- .../service/impl/CommonPayProductService.java | 17 ------ .../service/impl/HBPayProductService.java | 17 ------ .../service/impl/HKPayProductService.java | 17 ------ .../service/impl/HYPayProductService.java | 18 ------ .../service/impl/HYuPayProductService.java | 17 ------ .../service/impl/ZXPayProductService.java | 17 ------ .../service/project/ProjectFactory.java | 60 ++++++++++++++++++ .../service/project/entity/CreateBilling.java | 24 ++++++++ .../project/service/ProjectService.java | 20 ++++++ .../service/impl/BaseProjectService.java | 11 ++++ .../service/impl/CommonProjectService.java | 24 ++++++++ .../service/impl/HBProjectService.java | 23 +++++++ .../service/impl/HKProjectService.java | 24 ++++++++ .../service/impl/HYProjectService.java | 30 +++++++++ .../service/impl/HYuProjectService.java | 24 ++++++++ .../service/impl/ZXProjectService.java | 24 ++++++++ .../sm/impl/UserMouldVideoServiceImpl.java | 17 ++++++ .../resources/mapper/UserMouldVideoMapper.xml | 11 +++- .../mapper/WxCUserBasicInfoMapper.xml | 4 ++ 29 files changed, 328 insertions(+), 179 deletions(-) delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/PayProductFactory.java delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/service/PayProductService.java delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/service/impl/CommonPayProductService.java delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HBPayProductService.java delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HKPayProductService.java delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYPayProductService.java delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYuPayProductService.java delete mode 100644 suimangService/src/main/java/com/iformall/service/payProduct/service/impl/ZXPayProductService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/ProjectFactory.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/entity/CreateBilling.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/ProjectService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/impl/BaseProjectService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/impl/CommonProjectService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/impl/HBProjectService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/impl/HKProjectService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/impl/HYProjectService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/impl/HYuProjectService.java create mode 100644 suimangService/src/main/java/com/iformall/service/project/service/impl/ZXProjectService.java diff --git a/suimangAdmin/src/main/resources/db/migration/V2023110300001_personmould.sql b/suimangAdmin/src/main/resources/db/migration/V2023110300001_personmould.sql index 06d2a40..28c7232 100644 --- a/suimangAdmin/src/main/resources/db/migration/V2023110300001_personmould.sql +++ b/suimangAdmin/src/main/resources/db/migration/V2023110300001_personmould.sql @@ -12,4 +12,11 @@ ALTER TABLE `voice_language` 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 '消耗金币明细' ; + + + diff --git a/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java b/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java index 3b40d75..0d1a7d8 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/UserMouldVideoController.java @@ -13,6 +13,7 @@ import com.iformall.domain.po.sm.UserMouldVideo; import com.iformall.domain.po.sm.VoiceInfo; import com.iformall.domain.vo.WxCouponOrderBVo; import com.iformall.enums.EnumMouldSendType; +import com.iformall.enums.EnumProject; import com.iformall.enums.EnumVideoStatus; import com.iformall.enums.EnumaMouldPatchStatus; import com.iformall.exception.MallinkException; @@ -153,7 +154,7 @@ public class UserMouldVideoController extends BaseController { return userMouldVideoService.saveOrUpdate(record); } - @ApiOperation("生成视频") + @ApiOperation("慧影项目生成视频") @PostMapping("createVideo") public ResultData create(@RequestBody UserMouldVideo record) { logger.debug("[" + getIpAddr() + "] MouldPatchController::saveOrUpdate"); @@ -194,6 +195,7 @@ public class UserMouldVideoController extends BaseController { mouldVideoUpd.setCreateVideoDate(new Date()); userMouldVideoService.saveOrUpdate(mouldVideoUpd); + userMouldVideoService.createVideo(mouldVideo); return new ResultData(); diff --git a/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java b/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java index 9be1154..3b4624e 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/WxUserGrantController.java @@ -793,4 +793,11 @@ public class WxUserGrantController extends BaseController { return new ResultData(userConsumptionPackageService.getPackageInfo()); } + @ApiOperation("获取用户币值") + @GetMapping("/getUserPoins") + public ResultData getUserPoins() { + WxCUserBasicInfo userBasicInfo = wxCUserBasicInfoService.getById(getMemberId()); + return new ResultData(userBasicInfo.getPoins()); + } + } diff --git a/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java b/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java index 5dc9320..c1daed3 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java +++ b/suimangService/src/main/java/com/iformall/domain/po/sm/UserMouldVideo.java @@ -197,7 +197,12 @@ public class UserMouldVideo extends TenantEntity { private Date createDate; @io.swagger.annotations.ApiModelProperty(value="更新时间",name="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) private List videoStatuss; diff --git a/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java b/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java index 7c6b85f..4fd226e 100644 --- a/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java +++ b/suimangService/src/main/java/com/iformall/mapper/WxCUserBasicInfoMapper.java @@ -69,5 +69,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper listAsPage(Product record, Integer pageIndex, Integer pageSize) { diff --git a/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java index 1b75922..372e764 100644 --- a/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.java @@ -1540,5 +1540,10 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService,IExc } return null; } + + @Override + public void reducePoints(Long id,String finalTenantId, Integer reducePoints) { + wxCUserBasicInfoMapper.reductPoints(id, finalTenantId, reducePoints); + } } diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/PayProductFactory.java b/suimangService/src/main/java/com/iformall/service/payProduct/PayProductFactory.java deleted file mode 100644 index 2da26fa..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/PayProductFactory.java +++ /dev/null @@ -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 serviceMap = null; - - @Autowired - CommonPayProductService commonPayProductService; - @Autowired - HYPayProductService hYPayProductService; - @Autowired - HBPayProductService hBPayProductService; - @Autowired - HYuPayProductService hYuPayProductService; - @Autowired - HKPayProductService hKPayProductService; - @Autowired - ZXPayProductService zXPayProductService; - - - private Map getServiceMap() { - if (null == serviceMap) { - serviceMap = new ConcurrentHashMap(); - 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; - } -} diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/service/PayProductService.java b/suimangService/src/main/java/com/iformall/service/payProduct/service/PayProductService.java deleted file mode 100644 index c73cb4d..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/service/PayProductService.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.iformall.service.payProduct.service; - -import com.iformall.domain.po.Product; - -public interface PayProductService { - - public Object getProductExtroInfo(Product product); -} diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/CommonPayProductService.java b/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/CommonPayProductService.java deleted file mode 100644 index 7859874..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/CommonPayProductService.java +++ /dev/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 CommonPayProductService implements PayProductService{ - - @Override - public Object getProductExtroInfo(Product product) { - return null; - } - -} diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HBPayProductService.java b/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HBPayProductService.java deleted file mode 100644 index 23e0acb..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HBPayProductService.java +++ /dev/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; - } - -} diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HKPayProductService.java b/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HKPayProductService.java deleted file mode 100644 index 970a9be..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HKPayProductService.java +++ /dev/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; - } - -} diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYPayProductService.java b/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYPayProductService.java deleted file mode 100644 index 50860bd..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYPayProductService.java +++ /dev/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; - } - -} diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYuPayProductService.java b/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYuPayProductService.java deleted file mode 100644 index e6ca25c..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/HYuPayProductService.java +++ /dev/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; - } - -} diff --git a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/ZXPayProductService.java b/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/ZXPayProductService.java deleted file mode 100644 index c4ff477..0000000 --- a/suimangService/src/main/java/com/iformall/service/payProduct/service/impl/ZXPayProductService.java +++ /dev/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; - } - -} diff --git a/suimangService/src/main/java/com/iformall/service/project/ProjectFactory.java b/suimangService/src/main/java/com/iformall/service/project/ProjectFactory.java new file mode 100644 index 0000000..9bfaceb --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/ProjectFactory.java @@ -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 serviceMap = null; + + @Autowired + CommonProjectService commonPayProductService; + @Autowired + HYProjectService hYPayProductService; + @Autowired + HBProjectService hBPayProductService; + @Autowired + HYuProjectService hYuPayProductService; + @Autowired + HKProjectService hKPayProductService; + @Autowired + ZXProjectService zXPayProductService; + + + private Map getServiceMap() { + if (null == serviceMap) { + serviceMap = new ConcurrentHashMap(); + 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; + } +} diff --git a/suimangService/src/main/java/com/iformall/service/project/entity/CreateBilling.java b/suimangService/src/main/java/com/iformall/service/project/entity/CreateBilling.java new file mode 100644 index 0000000..307c35f --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/entity/CreateBilling.java @@ -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; + } +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/ProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/ProjectService.java new file mode 100644 index 0000000..da7c4a5 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/ProjectService.java @@ -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); +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/impl/BaseProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/impl/BaseProjectService.java new file mode 100644 index 0000000..85dc4d1 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/impl/BaseProjectService.java @@ -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; + } + +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/impl/CommonProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/impl/CommonProjectService.java new file mode 100644 index 0000000..3c3c3e9 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/impl/CommonProjectService.java @@ -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; + } + +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/impl/HBProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/impl/HBProjectService.java new file mode 100644 index 0000000..d310eba --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/impl/HBProjectService.java @@ -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; + } + +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/impl/HKProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/impl/HKProjectService.java new file mode 100644 index 0000000..11707c2 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/impl/HKProjectService.java @@ -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; + } + +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/impl/HYProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/impl/HYProjectService.java new file mode 100644 index 0000000..68abafa --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/impl/HYProjectService.java @@ -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; + } + +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/impl/HYuProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/impl/HYuProjectService.java new file mode 100644 index 0000000..5fd9a76 --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/impl/HYuProjectService.java @@ -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; + } + +} diff --git a/suimangService/src/main/java/com/iformall/service/project/service/impl/ZXProjectService.java b/suimangService/src/main/java/com/iformall/service/project/service/impl/ZXProjectService.java new file mode 100644 index 0000000..05a3cbd --- /dev/null +++ b/suimangService/src/main/java/com/iformall/service/project/service/impl/ZXProjectService.java @@ -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; + } + +} diff --git a/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java index 4917271..75975ff 100644 --- a/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/sm/impl/UserMouldVideoServiceImpl.java @@ -11,6 +11,9 @@ import com.iformall.common.ResultData; import com.iformall.domain.po.sm.*; import com.iformall.enums.*; 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.sm.AiVideoHelper; import com.iformall.sm.AiVideoParam; @@ -63,6 +66,12 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { @Autowired RedisLock redisLock; + + @Autowired + ProjectFactory projectFactory; + + @Autowired + WxCUserBasicInfoService wxCUserBasicInfoService; @Override public PageInfo listAsPage(UserMouldVideo record, Integer pageIndex, Integer pageSize) { @@ -463,6 +472,14 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { videoUpd.setVideoStatus(EnumVideoStatus.upload_success.getCode()); videoUpd.setVideoMsg("视频上传成功"); 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); break; } diff --git a/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml b/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml index f312790..f5d1721 100644 --- a/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml +++ b/suimangService/src/main/resources/mapper/UserMouldVideoMapper.xml @@ -35,12 +35,17 @@ + + + `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` @@ -132,7 +137,7 @@ `id`, `video_type`, `paperwork`, `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 diff --git a/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml index 4feab76..63faaeb 100644 --- a/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml +++ b/suimangService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml @@ -580,5 +580,9 @@ {call cuser_old_to_new(#{oldCuserId},#{newCuserId},#{tableIndex},#{finalTableIndex})} + + + UPDATE wx_c_user_basic_info set points = points - #{reductPoints} where id = #{id} + \ No newline at end of file