| @@ -13,6 +13,7 @@ import lombok.ToString; | |||
| import java.math.BigDecimal; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @TableName(value = "tt_coupon") | |||
| @Data | |||
| @@ -133,9 +134,12 @@ public class TtCoupon extends TenantEntity { | |||
| private TtCoupon couponCoumn; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "columnCoupons") | |||
| private List<TtCoupon> columnCoupons; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value = "审批流参数", name = "flowParams") | |||
| private Map<String, Object> flowParams; | |||
| public String getSalePriceStr() { | |||
| if(salePrice!=null) { | |||
| @@ -0,0 +1,20 @@ | |||
| package com.iformall.domain.po.tt; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| @TableName(value = "tt_user_collect") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class TtUserCollect extends TtUserCollectFollow { | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="couponId") | |||
| private Long couponId; | |||
| } | |||
| @@ -0,0 +1,32 @@ | |||
| package com.iformall.domain.po.tt; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.Date; | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class TtUserCollectFollow extends TenantEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | |||
| private Integer isDel; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-起始时间",name="startdate") | |||
| private Date startdate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate") | |||
| private Date enddate; | |||
| } | |||
| @@ -0,0 +1,18 @@ | |||
| package com.iformall.domain.po.tt; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| @TableName(value = "tt_user_follow") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class TtUserFollow extends TtUserCollectFollow { | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="merchernId") | |||
| private Long merchernId; | |||
| } | |||
| @@ -0,0 +1,42 @@ | |||
| package com.iformall.domain.po.tt; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import lombok.ToString; | |||
| import java.util.Date; | |||
| @TableName(value = "tt_video_library") | |||
| @Data | |||
| @ToString(callSuper = true) | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class TtVideoLibrary extends TenantEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="preview") | |||
| private String preview; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="name") | |||
| private String name; | |||
| @io.swagger.annotations.ApiModelProperty(value="时长",name="duration") | |||
| private Integer duration; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "是否删除1是0否", name = "isDel") | |||
| private Integer isDel; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-起始时间",name="startdate") | |||
| private Date startdate; | |||
| @TableField(exist = false) | |||
| @io.swagger.annotations.ApiModelProperty(value="查询-结束时间",name="enddate") | |||
| private Date enddate; | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.tt.TtUserCollect; | |||
| import java.util.List; | |||
| public interface TtUserCollectMapper extends CommonMapper<TtUserCollect, Long> { | |||
| List<TtUserCollect> findList(TtUserCollect collect); | |||
| int deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.tt.TtUserFollow; | |||
| import java.util.List; | |||
| public interface TtUserFollowMapper extends CommonMapper<TtUserFollow, Long> { | |||
| List<TtUserFollow> findList(TtUserFollow collect); | |||
| int deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.tt.TtVideoLibrary; | |||
| import java.util.List; | |||
| public interface TtVideoLibraryMapper extends CommonMapper<TtVideoLibrary, Long> { | |||
| List<TtVideoLibrary> findList(TtVideoLibrary video); | |||
| int deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,67 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.TtUserCollectMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.tt.TtUserCollect"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="user_id" jdbcType="BIGINT" property="userId"/> | |||
| <result column="coupon_id" jdbcType="BIGINT" property="couponId"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`, `tenant_id`, `parent_tenant_id`, `user_id`, `coupon_id`, `create_date`, `update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where `is_del` = 0 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != userId "> | |||
| and `user_id` = #{userId} | |||
| </if> | |||
| <if test=" null != couponId "> | |||
| and `coupon_id` = #{couponId} | |||
| </if> | |||
| <if test="startdate != null"> | |||
| and `create_date` >= #{startdate} | |||
| </if> | |||
| <if test="enddate != null"> | |||
| and `create_date` <= #{enddate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.tt.TtUserCollect" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from tt_user_collect | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <delete id="deleteById" parameterType="Long"> | |||
| update tt_user_collect set is_del = 1,update_date=now() where id = #{id} | |||
| </delete> | |||
| </mapper> | |||
| @@ -0,0 +1,67 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.TtUserFollowMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.tt.TtUserFollow"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="user_id" jdbcType="BIGINT" property="userId"/> | |||
| <result column="merchern_id" jdbcType="BIGINT" property="merchernId"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`, `tenant_id`, `parent_tenant_id`, `user_id`, `merchern_id`, `create_date`, `update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where `is_del` = 0 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != userId "> | |||
| and `user_id` = #{userId} | |||
| </if> | |||
| <if test=" null != merchernId "> | |||
| and `merchern_id` = #{merchernId} | |||
| </if> | |||
| <if test="startdate != null"> | |||
| and `create_date` >= #{startdate} | |||
| </if> | |||
| <if test="enddate != null"> | |||
| and `create_date` <= #{enddate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.tt.TtUserFollow" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from tt_user_follow | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <delete id="deleteById" parameterType="Long"> | |||
| update tt_user_follow set is_del = 1,update_date=now() where id = #{id} | |||
| </delete> | |||
| </mapper> | |||
| @@ -0,0 +1,64 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.TtVideoLibraryMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.tt.TtVideoLibrary"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="preview" jdbcType="VARCHAR" property="preview"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="duration" jdbcType="INTEGER" property="duration"/> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate"/> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`, `tenant_id`, `parent_tenant_id`, `preview`, `name`, `duration`, `create_date`, `update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where `is_del` = 0 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != name and ''!=name"> | |||
| and `title` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test="startdate != null"> | |||
| and `create_date` >= #{startdate} | |||
| </if> | |||
| <if test="enddate != null"> | |||
| and `create_date` <= #{enddate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.tt.TtVideoLibrary" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from tt_video_library | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <delete id="deleteById" parameterType="Long"> | |||
| update tt_video_library set is_del = 1,update_date=now() where id = #{id} | |||
| </delete> | |||
| </mapper> | |||
| @@ -7,6 +7,7 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.tt.TtCoupon; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.service.WxFlowService; | |||
| import com.iformall.service.tt.TtCouponService; | |||
| import com.iformall.utils.RedisLock; | |||
| import io.swagger.annotations.Api; | |||
| @@ -28,6 +29,9 @@ public class TtCouponController extends BaseController { | |||
| @Autowired | |||
| private TtCouponService ttCouponService; | |||
| @Autowired | |||
| private WxFlowService wxFlowService; | |||
| @Autowired | |||
| RedisLock redisLock; | |||
| @@ -57,12 +61,12 @@ public class TtCouponController extends BaseController { | |||
| } | |||
| //启动投放审批 | |||
| // if(record.getFlowParams() !=null && record.getFlowParams().size()>0) { | |||
| // record.getFlowParams().put("businessId",record.getId()); | |||
| // wxFlowService.start(record.getFlowParams(), getUserId(), getUser().getName(), tenantEntity); | |||
| // //修改coupon applyStatus状态为审核中 | |||
| // record.setPutApplyStatus(EnumRentContractAppStatus.APPLYING.getCode()); | |||
| // } | |||
| if(record.getFlowParams() !=null && record.getFlowParams().size()>0) { | |||
| record.getFlowParams().put("businessId",record.getId()); | |||
| wxFlowService.start(record.getFlowParams(), getUserId(), getUser().getName(), tenantEntity); | |||
| //修改coupon applyStatus状态为审核中 | |||
| record.setStatus(EnumTtCouponStatus.TTCOUPON_STATUS_EXAMINE.getCode()); | |||
| } | |||
| return resultData; | |||
| } | |||
| @@ -1,41 +1,9 @@ | |||
| package com.iformall.controller.video; | |||
| import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.annotation.SystemControllerLog; | |||
| import com.iformall.annotation.UserDataRuleAnnotation; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.po.WxBillProperty; | |||
| import com.iformall.domain.po.WxMallBuilding; | |||
| import com.iformall.domain.po.WxMallFloor; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxPropertyContract; | |||
| import com.iformall.domain.po.WxRentContract; | |||
| import com.iformall.domain.po.WxShop; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.po.base.BaseEntity.SortField; | |||
| import com.iformall.enums.EnumContractOperationType; | |||
| import com.iformall.enums.EnumContractType; | |||
| import com.iformall.enums.EnumFlowContractType; | |||
| import com.iformall.enums.EnumFlowKey; | |||
| import com.iformall.enums.EnumIsPreview; | |||
| import com.iformall.enums.EnumRentContractAppStatus; | |||
| import com.iformall.enums.EnumRentContractStatus; | |||
| import com.iformall.enums.EnumRentShopType; | |||
| import com.iformall.enums.EnumRentStartType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxPropertyContractMapper; | |||
| import com.iformall.service.WxBillPropertyService; | |||
| import com.iformall.service.WxMallBuildingService; | |||
| import com.iformall.service.WxMallFloorService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.WxRentPropertyContractService; | |||
| import com.iformall.service.WxShopService; | |||
| import com.iformall.video.VideoFactory; | |||
| import com.iformall.video.entity.VideUploadResult; | |||
| @@ -43,20 +11,12 @@ import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import org.springframework.web.multipart.MultipartFile; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| @@ -69,7 +29,7 @@ public class VideoController extends BaseController { | |||
| @Autowired | |||
| VideoFactory videoFactory; | |||
| @Autowired | |||
| String videoType; | |||
| @@ -80,7 +40,7 @@ public class VideoController extends BaseController { | |||
| VideUploadResult result = videoFactory.getExcutor(videoType).uploadLocalVideo("123123213", "/root/111.mp4"); | |||
| return new ResultData(result); | |||
| } | |||
| /** | |||
| * 上传视频 | |||
| * | |||
| @@ -90,10 +50,9 @@ public class VideoController extends BaseController { | |||
| */ | |||
| @PostMapping(value = "/upload", consumes = "multipart/*", headers = "content-type=multipart/form-data") | |||
| @ApiOperation("上传视频") | |||
| @SystemControllerLog(description = "文件上传") | |||
| public ResultData awsfileUpload(@RequestParam("file") MultipartFile multiReq,@RequestParam Map<String, String> param) { | |||
| public ResultData upload(@RequestParam("file") MultipartFile multiReq,@RequestParam Map<String, String> param) { | |||
| try { | |||
| String title = param.get("title"); | |||
| String title = param.get("title"); | |||
| VideUploadResult result = videoFactory.getExcutor(videoType).uploadLocalVideo(title, multiReq.getInputStream()); | |||
| return new ResultData(result); | |||
| } catch (Exception e) { | |||
| @@ -102,4 +61,25 @@ public class VideoController extends BaseController { | |||
| } | |||
| } | |||
| /** | |||
| * 上传视频 | |||
| * | |||
| * @param multiReq | |||
| * @return | |||
| * @throws Exception | |||
| */ | |||
| @GetMapping(value = "/uploadProgress") | |||
| @ApiOperation("上传视频进度") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "videoId", value = "视频编号", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData uploadProgress(String videoId) { | |||
| try { | |||
| String result = videoFactory.getExcutor(videoType).getVedioUploadProgress(videoId); | |||
| return new ResultData(result); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.PICTURE_ANALYZING_ERROR); | |||
| } | |||
| } | |||
| } | |||