Browse Source

商品资料水印添加

Aslee 3 years ago
parent
commit
157047cf6c

+ 5 - 1
src/main/java/com/caimei/modules/archive/utils/FFMPEG.java

@@ -1,5 +1,6 @@
 package com.caimei.modules.archive.utils;
 
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.util.StringUtils;
 
@@ -15,6 +16,9 @@ import java.util.regex.Pattern;
 
 public class FFMPEG {
 
+    @Value("${ffmpeg.path}")
+    private static String ffmepgPath;
+
     public static String dealString(String str) {
         Matcher m = Pattern.compile("^frame=.*").matcher(str);
         String msg = "";
@@ -135,7 +139,7 @@ public class FFMPEG {
     public static Map<String, Object> setVideoWaterMark(String fileUrl, String filePath) {
         HashMap<String, String> dto = new HashMap<String, String>();
         //必填
-        dto.put("ffmpeg_path", "D:\\workSoftWare\\ffmpeg\\bin\\ffmpeg.exe");
+        dto.put("ffmpeg_path", ffmepgPath);
         //必填
         dto.put("input_path", fileUrl);
 //        dto.put("input_path", "D:\\WorkSpace\\file\\video.mp4");

+ 10 - 1
src/main/java/com/caimei/modules/user/entity/CmUser.java

@@ -95,7 +95,6 @@ public class CmUser extends DataEntity<CmUser> {
     private Integer userIdentity;//用户身份
     private String realName;//真实姓名
 //    private Integer companyUserID;//企业用户id
-//    private String openID;//微信openID
     private String bindMobile;//企业绑定手机号
     private String tipStatus;//弹窗提示状态
     private String identityDisplay; //前台身份展示
@@ -110,6 +109,8 @@ public class CmUser extends DataEntity<CmUser> {
     private String shortName;   //机构简称
     private String userIds;  //用户id","隔开
     private boolean storeStatus = false; //是否存在数据库
+    private String openID;//呵呵商城用户微信openID
+
 
     public CmUser() {
         super();
@@ -861,4 +862,12 @@ public class CmUser extends DataEntity<CmUser> {
     public void setStoreStatus(boolean storeStatus) {
         this.storeStatus = storeStatus;
     }
+
+    public String getOpenID() {
+        return openID;
+    }
+
+    public void setOpenID(String openID) {
+        this.openID = openID;
+    }
 }

+ 5 - 0
src/main/resources/config/alpha/caimei.properties

@@ -143,3 +143,8 @@ yeepay.mails=jun.li@caimei365.com
 
 #�˷���ƷĬ��ID
 freightProductID=999
+
+#商品资料库文件临时路径
+archive.tempPath=/mnt/newdatadrive/data/runtime/tomcat-instance/manager/tempFile/
+#ffmpeg路径
+ffmpeg.path=D:\\workSoftWare\\ffmpeg\\bin\\ffmpeg.exe

+ 3 - 1
src/main/resources/config/beta/caimei.properties

@@ -182,5 +182,7 @@ aliyun.accessKeySecret=dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
 aliyun.bucketName=caimei-oss
 aliyun.endpoint=https://oss-cn-shenzhen.aliyuncs.com
 
-#商品资料库html文件临时路径
+#商品资料库文件临时路径
 archive.tempPath=/mnt/newdatadrive/data/runtime/tomcat-instance/manager/tempFile/
+#ffmpeg路径
+ffmpeg.path=/mnt/newdatadrive/apps/ffmpeg/ffmpeg-app/bin/ffmpeg

+ 3 - 2
src/main/resources/config/dev/caimei.properties

@@ -195,6 +195,7 @@ aliyun.accessKeySecret=dBjAXqbYiEPP6Ukuk2ZsXQeET7FVkK
 aliyun.bucketName=caimei-oss
 aliyun.endpoint=https://oss-cn-shenzhen.aliyuncs.com
 
-#商品资料库html文件临时路径
+#商品资料库文件临时路径
 archive.tempPath=D:\\poi-test\\tempFile\\
-
+#ffmpeg路径
+ffmpeg.path=D:\\workSoftWare\\ffmpeg\\bin\\ffmpeg.exe

+ 1 - 1
src/main/resources/mappings/modules/hehe/CmHeheCouponMapper.xml

@@ -56,7 +56,7 @@
 				AND (NOW() <![CDATA[ <= ]]> a.endTime OR a.permanentFlag = 1)
 			</if>
 			<if test='status == "3"'>
-				AND (NOW() <![CDATA[ > ]]> a.endDate and a.permanentFlag = 0)
+				AND (NOW() <![CDATA[ > ]]> a.endTime and a.permanentFlag = 0)
 			</if>
 		</where>
 		<choose>

+ 1 - 1
src/main/resources/mappings/modules/hehe/CmHeheFloorProductMapper.xml

@@ -101,7 +101,7 @@
 		<where>
 			hp.validFlag = 1
 			<if test="productID != null" >
-				AND hp.id = #{productID}
+				AND hp.productId = #{productID}
 			</if>
 			<if test="name != null and name != ''">
 				AND p.name LIKE concat('%',#{name},'%')

+ 0 - 1
src/main/resources/mappings/modules/hehe/HeHeNewOrderMapper.xml

@@ -105,7 +105,6 @@
         co.orderTime AS orderTime,
         co.confirmTime AS confirmTime,
         co.payTotalFee AS payTotalFee,
-        co.payWay AS payWay,
         co.payStatus AS payStatus,
         co.refundType AS refundType,
         co.sendOutStatus AS sendOutStatus,

+ 0 - 1
src/main/resources/mappings/modules/order/NewReceiptListMapper.xml

@@ -110,7 +110,6 @@
 		co.orderTotalFee AS "orderTotalFee",
 		co.freight AS "freight",
 		co.freePostFlag AS "freePostFlag",
-		co.payWay AS  "payWay",
 		cnfc.transactionType AS  "transactionType",
 		co.orderType AS "orderTypeSys",
 		co.orderSubmitType AS "orderTypeShow"

+ 16 - 6
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheCouponForm.jsp

@@ -15,7 +15,17 @@
 			//$("#name").focus();
 			$("#inputForm").validate({
 				submitHandler: function(form){
-					if (imageList.length > 0) {
+                    var productType = $("#productType").val() * 1;
+                    if (productType === 2 && imageList.length <= 0) {
+                        alertx("请先添加商品");
+                        return false;
+                    }
+                    var couponType = $("couponType").val() * 1;
+                    if (couponType === 2 && userList.length <= 0) {
+                        alertx("请先添加用户");
+                        return false;
+                    }
+                    if (imageList.length > 0) {
 						var productInfo = JSON.stringify(imageList);
 						$('#productInfo').val(productInfo);
 					}
@@ -30,15 +40,15 @@
                         alertx("优惠券金额必须小于优惠条件金额");
                         return false;
                     }
-					var startNowFlag = $("#startNowFlag").val();
-					var permanentFlag = $("#permanentFlag").val();
+					var startNowFlag = $("#startNowFlag").val() * 1;
+					var permanentFlag = $("#permanentFlag").val() * 1;
 					var startTime = $("#startTime").val();
 					var endTime = $("#endTime").val();
 					if (startNowFlag === 1) {
 						startTime = new Date();
 					}
 					if (permanentFlag === 0 && startTime >= endTime) {
-						alertx("结束时间不能早于开始时间");
+						alertx("下架时间不能早于上架时间");
 						return false;
 					}
 					loading('正在提交,请稍等...');
@@ -68,7 +78,7 @@
 <body>
 	<ul class="nav nav-tabs">
 		<li><a href="${ctx}/hehe/cmHeheCoupon/?couponType=${cmHeheCoupon.couponType}">优惠券列表</a></li>
-		<li class="active"><a href="${ctx}/hehe/cmHeheCoupon/form?id=${cmHeheCoupon.id}&couponType=${cmHeheCoupon.couponType}">${not empty cmHeheCoupon.id?'编辑':'添加'}</a></li>
+		<li class="active"><a href="${ctx}/hehe/cmHeheCoupon/form?id=${cmHeheCoupon.id}&couponType=${cmHeheCoupon.couponType}">${not empty cmHeheCoupon.id?'编辑':'添加'}${cmHeheCoupon.couponType eq 1?'活动':cmHeheCoupon.couponType eq 2?'专享':cmHeheCoupon.couponType eq 3?'新人':cmHeheCoupon.couponType eq 4?'好友分享':'好友消费'}券</a></li>
 	</ul><br/>
 	<form:form id="inputForm" modelAttribute="cmHeheCoupon" action="${ctx}/hehe/cmHeheCoupon/save" method="post" class="form-horizontal">
 		<form:hidden path="id"/>
@@ -134,7 +144,7 @@
 		<div class="control-group">
 			<label class="control-label"><font color="red">*</font>使用期限:</label>
 			<div class="controls">
-				<input type="number" id="usePeriod" name="usePeriod" value="${cmHeheCoupon.usePeriod}" min="1" required> 天
+				<input type="number" id="usePeriod" name="usePeriod" value="${cmHeheCoupon.usePeriod}" min="1"  onkeyup="onlynum(this)" required> 天
 			</div>
 		</div>
 		<div class="control-group">

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheCouponList.jsp

@@ -87,12 +87,12 @@
 					</c:if>
 				</td>
 				<td>
-					<fmt:formatDate value="${cmHeheCoupon.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+					<fmt:formatDate value="${cmHeheCoupon.startTime}" pattern="yyyy-MM-dd HH:mm"/>
 				</td>
 				<td>
 					<c:if test="${cmHeheCoupon.permanentFlag eq 1}">永久</c:if>
 					<c:if test="${cmHeheCoupon.permanentFlag ne 1}">
-						<fmt:formatDate value="${cmHeheCoupon.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
+						<fmt:formatDate value="${cmHeheCoupon.endTime}" pattern="yyyy-MM-dd HH:mm"/>
 					</c:if>
 				</td>
 				<td>

+ 9 - 0
src/main/webapp/WEB-INF/views/modules/hehe/cmHeheDiscountForm.jsp

@@ -10,6 +10,15 @@
 			//$("#name").focus();
 			$("#inputForm").validate({
 				submitHandler: function(form){
+					var productType = $("#productType").val() * 1;
+					if (productType === 2 && imageList.length <= 0) {
+						alertx("请先添加商品");
+						return false;
+					}
+					if (userList.length <= 0) {
+						alertx("请先添加用户");
+						return false;
+					}
 					if (imageList.length > 0) {
 						var productInfo = JSON.stringify(imageList);
 						$('#productInfo').val(productInfo);

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/hehe/toAddCouponProduct.jsp

@@ -91,7 +91,7 @@
     <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
     <div class="ul-form">
         <label>商品ID:</label>
-        <form:input path="productID" htmlEscape="false"  maxlength="10" class="input-mini" onchange="onlynum(this)"/>
+        <form:input path="productID" htmlEscape="false"  maxlength="8" class="input-mini" onchange="onlynum(this)"/>
         <label>商品名称:</label>
         <form:input path="name" htmlEscape="false" class="input-medium" maxlength="20"/>
         <label>供应商:</label>