shenhao преди 4 години
родител
ревизия
159394e75c

+ 1 - 1
src/main/java/com/ssj/dao/sys/poster/dao/impl/PosterQueryDaoImpl.java

@@ -55,7 +55,7 @@ public class PosterQueryDaoImpl  implements PosterQueryDao {
     @Override
     public Page<Map<String, Object>> findActivityJoinByPage(Map<String, Object> params, Pageable initPage) {
         StringBuilder sb = new StringBuilder();
-        sb.append("  SELECT a.name,t.name as join_name,b.id,b.create_time,b.poster_img,t.phone,t.logo_img,t.qrcode_img1,t.qrcode_img2 from poster_activity a  ");
+        sb.append("  SELECT a.name,t.name as join_name,b.id,b.create_time,b.poster_img,t.phone,t.logo_img,t.logo_img2,t.qrcode_img1,t.qrcode_img2 from poster_activity a  ");
         sb.append("   left join poster_activity_join b on a.id = b.activity_id ");
         sb.append("   left join poster_join t on b.join_id = t.id ");
         sb.append("  WHERE t.`status`=1    ");

+ 7 - 11
src/main/java/com/ssj/service/sys/poster/service/impl/PosterJoinServiceImpl.java

@@ -116,14 +116,14 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 		posterJoin.setPhone("吴老师 13265096161");
 		posterJoin.setAddress("广州市海珠区罗马家园中盛路拜庭二期04-06 商铺");
 
-		String url=runGeneratePosterImg(posterTemplate, posterJoin,"测试");
-		System.out.println(url);
+//		String url=runGeneratePosterImg(posterTemplate, posterJoin,"测试");
+//		System.out.println(url);
 
 
 	}
 	
     
-	public static String runGeneratePosterImg(PosterTemplate posterTemplate,PosterJoin posterJoin,String activityName) {
+	public  String runGeneratePosterImg(PosterTemplate posterTemplate,PosterJoin posterJoin,String activityName) {
     	try {
     		String savePath =PropertiesUtil.getValue("file_save_path");
     		String posterPath ="/poster/";
@@ -142,14 +142,12 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 	    	String[] logoPositions=posterTemplate.getLogoPosition().split(";");
 	    	BufferedImage logoImage = ImageIO.read(new File(savePath+posterJoin.getLogoImg()));
 	    	BufferedImage target_template=ImgBean.modifyImagetogeter(logoImage, source_template,Integer.parseInt(logoPositions[0]),Integer.parseInt(logoPositions[1]));
-
-	    	if(StringUtils.isNotEmpty(posterTemplate.getLogoPosition2())){
+	    	if(StringUtils.isNotEmpty(posterTemplate.getLogoPosition2()) && StringUtils.isNotEmpty(posterJoin.getLogoImg2())){
 				//合成logo2
 				logoImage = ImageIO.read(new File(savePath+posterJoin.getLogoImg2()));
 				target_template=ImgBean.modifyImagetogeter(logoImage, target_template,Integer.parseInt(logoPositions[2]),Integer.parseInt(logoPositions[3]));
 			}
 
-	    	
 	    	//合成二维码1
 	    	String[] qrcodePositions=posterTemplate.getQrcodePosition1().split(";");
 	       	String code=save_path+IdWorker.generateId()+ ".png";
@@ -166,12 +164,12 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 	        g3.drawImage(codeImage, 0, 0, null);
 	        g3.dispose();
 	    	ImgBean.modifyImagetogeter(codeOutput, target_template,Integer.parseInt(qrcodePositions[2]),Integer.parseInt(qrcodePositions[3]));
-
+			logger.error("生成海报3-1[{}]",target_path);
 	    	//合成后删除图片
 			File code1File = new File(code);
 			code1File.delete();
 	    	//合成二维码2
-	    	if(StringUtils.isNotEmpty(posterTemplate.getQrcodePosition2())) {
+	    	if(StringUtils.isNotEmpty(posterTemplate.getQrcodePosition2()) && StringUtils.isNotEmpty(posterJoin.getQrcodeImg2())) {
 		    	qrcodePositions=posterTemplate.getQrcodePosition2().split(";");
 		       	code=save_path+IdWorker.generateId()+ ".png";
 		     	ImageUtil.resizeImg(savePath+posterJoin.getQrcodeImg1(), code, Integer.parseInt(qrcodePositions[0]),  Integer.parseInt(qrcodePositions[1]), 1.0f);
@@ -192,7 +190,7 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 				File code1File2 = new File(code);
 				code1File2.delete();
 	    	}
-
+			logger.error("生成海报3-2[{}]",target_path);
 	    	//设置字体大小
 			int fontSize = posterTemplate.getFontSize();
             Font font = new Font("黑体", Font.BOLD, fontSize);
@@ -214,7 +212,6 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 			}
             //ImgBean.modifyImage(target_template,"联系人:"+posterJoin.getPhone(),leftX,topY,new Color(240,240,240),new Font("黑体", Font.PLAIN, 28));
 	    	ImgBean.modifyImage(target_template,phone,leftX,topY,color,font);
-	    	
 	    	//合成地址 x;y;rx
 	    	//长500的,最多33个字,500/33=15px  (33-Address.le)/2=?
 	    	String[] addressPositions=posterTemplate.getAddressPosition().split(";");
@@ -234,7 +231,6 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 
 	    	//生成海报
 	    	ImgBean.writeImageLocal(target_path,  source_template);
-	    	
 	    	return target_path.replaceAll(savePath, "");
 	    	
     	} catch (Exception e) {

+ 3 - 3
src/main/resources/templates/sys/org/edit.html

@@ -26,15 +26,15 @@
 			</li>
 			<li>
 				<label>编码<b>*</b></label>
-				<input type="text" name="code" th:value="${org.code}" class="dfinput" th:disabled="${org.id}" />
+				<input type="text" name="code" th:value="${org.code}" class="dfinput" th:readonly="${org.id}" />
 			</li>
 			<li>
 				<label>地区<b>*</b></label>
-				<input type="text" name="area" th:value="${org.area}" class="dfinput" th:disabled="${org.id}"/>
+				<input type="text" name="area" th:value="${org.area}" class="dfinput" th:readonly="${org.id}"/>
 			</li>
 			<li>
 				<label>排序号</label>
-				<input type="number" name="sortNo" th:value="${org.sortNo}" class="dfinput" th:disabled="${org.id}"/>
+				<input type="number" name="sortNo" th:value="${org.sortNo}" class="dfinput" th:readonly="${org.id}"/>
 			</li>
 			<li>
 				<label>&nbsp;</label>

+ 25 - 21
src/main/resources/templates/sys/poster/activity_join_list.html

@@ -37,30 +37,30 @@
 	</ul>
 </div>
 <div class="rightinfo">
-	<form id="seachform" th:action="@{/sys/poster/activityJoin/list.html}" method="post" style="float: left;width: 460px;">
+	<form id="seachform" th:action="@{/sys/poster/activityJoin/list.html}" method="post">
 	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<input name="id" type="hidden" id="id" class="scinput" th:value="${search.id}"  />
 	<ul class="seachform">
-			<li>
-			 <label>机构名称</label>
-			  <input name="id" type="hidden" id="id" class="scinput" th:value="${search.id}"  />
-			  <input name="name" type="text" class="scinput" th:value="${search.name}"  />
-		    </li>
-			<li>
-		<input type="button" class="scbtn selectbtu" value="查询" />
-	</li>
 		<li>
-			<a th:href="@{/sys/poster/activity/list.html}">
-				<input type="button" class="scbtn" value="返回" />
-			</a>
-		</li>
+		  <label>机构名称</label>
 
-			<li>
-				<ul class="toolbar">
-					<a href="javascript:;" onclick="edit('')">
-						<li class="click"><span><img th:src="@{/static/sys/images/t01.png}"></span>新增海报</li>
-					</a>
-				</ul>
-			</li>
+		  <input name="name" type="text" class="scinput" th:value="${search.name}"  />
+		</li>
+		<li>
+			<input type="button" class="scbtn" value="查询" />
+		</li>
+		<li>
+			<ul class="toolbar">
+				<a th:href="@{/sys/poster/activity/list.html}">
+					<input type="button" class="scbtn" value="返回" />
+				</a>
+			</ul>
+		</li>
+		<li>
+			<ul class="toolbar">
+				<li class="click" onclick="edit('')"><span><img th:src="@{/static/sys/images/t01.png}"></span>新增海报</li>
+			</ul>
+		</li>
 	</ul>
 	</form>
 
@@ -73,7 +73,8 @@
 				<th >创建时间</th>
 		    	<th >海报</th>
 		    	<th >联系方式</th>
-		    	<th >LOGO</th>
+		    	<th >LOGO1</th>
+		    	<th >LOGO2</th>
 		    	<th >二维码1</th>
 		    	<th >二维码2</th>
 		    	<th >操作</th>
@@ -94,6 +95,9 @@
 					<img  th:if="${item.logo_img!=null && item.logo_img!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.logo_img}">
 				</td>
 				<td class="imgtd">
+					<img  th:if="${item.logo_img2!=null && item.logo_img2!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.logo_img2}">
+				</td>
+				<td class="imgtd">
 					<img th:if="${item.qrcode_img1!=null && item.qrcode_img1!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.qrcode_img1}">
 				</td>
 				<td class="imgtd">

+ 3 - 1
src/main/resources/templates/sys/poster/activity_list.html

@@ -54,13 +54,15 @@
 						<input type="button" class="scbtn" value="导出" />
 					</a>
 				</ul>
+
+			</li>
+			<li>
 				<ul class="toolbar">
 					<a href="javascript:;" onclick="edit('')">
 						<li class="click"><span><img th:src="@{/static/sys/images/t01.png}"></span>新增活动</li>
 					</a>
 				</ul>
 			</li>
-			
 	</ul>
 	</form> 
 

+ 3 - 0
src/main/resources/templates/sys/poster/join_list.html

@@ -79,6 +79,7 @@
 		    	<th >地址</th>
 		    	<th >创建时间</th>
 		    	<th >LOGO</th>
+		    	<th >LOGO2</th>
 		    	<th >二维码1</th>
 		    	<th >二维码2</th>
 		    	<th >操作</th>
@@ -93,6 +94,8 @@
 				<td th:text="${item.create_time}"></td>
 				<td class="imgtd">
 					<img  th:if="${item.logo_img!=null && item.logo_img!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.logo_img}">
+				</td><td class="imgtd">
+					<img  th:if="${item.logo_img2!=null && item.logo_img2!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.logo_img2}">
 				</td>
 				<td class="imgtd">
 					<img th:if="${item.qrcode_img1!=null && item.qrcode_img1!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.qrcode_img1}">