彬彬 4 лет назад
Родитель
Сommit
7d9418e87b

+ 2 - 1
src/main/java/org/springblade/gateway/common_gateway/controller/OrderUrlAndColorController.java

@@ -25,8 +25,9 @@ public class OrderUrlAndColorController {
 	@ApiOperation(value = "保存", notes = "传入orderId,orderUrl,color")
 	public R saveOrderUrlAndColor(@ApiParam(value = "订单id", required = true) @RequestParam Long orderId,
 									 @ApiParam(value = "url", required = true) @RequestParam String orderUrl,
+									 @ApiParam(value = "type", required = true) @RequestParam String type,
 									 @ApiParam(value = "color", required = true) @RequestParam String color) {
-		orderUrlAndColorService.SaveOrderUrlAndColor(orderId, orderUrl, color);
+		orderUrlAndColorService.SaveOrderUrlAndColor(orderId, orderUrl, color,type);
 		return R.status(true);
 	}
 

+ 1 - 1
src/main/java/org/springblade/gateway/common_gateway/service/IOrderUrlAndColorService.java

@@ -3,7 +3,7 @@ package org.springblade.gateway.common_gateway.service;
 import java.util.HashMap;
 
 public interface IOrderUrlAndColorService {
-	void SaveOrderUrlAndColor(Long activeId,String orderUrl,String color);
+	void SaveOrderUrlAndColor(Long activeId,String orderUrl,String color,String type);
 
 	HashMap<String,Object> getSaveOrderUrlAndColor(Long activeId);
 }

+ 7 - 1
src/main/java/org/springblade/gateway/common_gateway/service/impl/SaveOrderUrlServiceImpl.java

@@ -15,22 +15,28 @@ public class SaveOrderUrlServiceImpl implements IOrderUrlAndColorService {
 
 	public static final String YEEPAY_ORDERURL = "yeepay_orderUrl";
 	public static final String BACKGROUND_COLOR = "background_color";
+	public static final String ORDER_TYPE = "order_type";
 	@Override
-	public void SaveOrderUrlAndColor(Long orderId, String orderUrl, String color) {
+	public void SaveOrderUrlAndColor(Long orderId, String orderUrl, String color,String type) {
 		String url_key = YEEPAY_ORDERURL.concat(":").concat(orderId.toString());
 		String color_key = BACKGROUND_COLOR.concat(":").concat(orderId.toString());
+		String type_key = ORDER_TYPE.concat(":").concat(orderId.toString());
 		redisTemplate.opsForValue().set(url_key,orderUrl,600, TimeUnit.SECONDS);
 		redisTemplate.opsForValue().set(color_key,color,600, TimeUnit.SECONDS);
+		redisTemplate.opsForValue().set(type_key,type,600, TimeUnit.SECONDS);
 	}
 
 	@Override
 	public HashMap<String, Object> getSaveOrderUrlAndColor(Long orderId) {
 		String url_key = YEEPAY_ORDERURL.concat(":").concat(orderId.toString());
 		String color_key = BACKGROUND_COLOR.concat(":").concat(orderId.toString());
+		String type_key = ORDER_TYPE.concat(":").concat(orderId.toString());
 		String url = redisTemplate.opsForValue().get(url_key);
 		String color = redisTemplate.opsForValue().get(color_key);
+		String type = redisTemplate.opsForValue().get(type_key);
 		HashMap<String,Object> map = new HashMap<>();
 		map.put("url",url);
+		map.put("type",type);
 		map.put("color",color);
 		return map;
 	}

+ 6 - 2
src/main/java/org/springblade/sing/active/mapper/ActiveHelpRecordMapper.xml

@@ -19,7 +19,7 @@
         <result column="userName" property="userName"/>
         <result column="productTitle" property="productTitle"/>
         <result column="ip" property="ip"/>
-
+        <result column="active_name" property="activeName"/>
     </resultMap>
 
     <resultMap id="productVoteResultMap" type="org.springblade.sing.active.entity.ProductVote">
@@ -32,10 +32,11 @@
 
 
     <select id="selectActiveHelpRecordPage" resultMap="activeHelpRecordResultMap">
-        select hr.*,g.name helpGoodsName,u.nick_name userName,pr.title productTitle from sing_active_help_record hr
+        select hr.*,g.name helpGoodsName,u.nick_name userName,pr.title productTitle,sar.title active_name from sing_active_help_record hr
         inner JOIN sing_help_goods g on hr.help_goods_id = g.id
         inner JOIN sing_login_user u on hr.user_id = u.id
         inner JOIN sing_active_product_record pr on hr.product_id = pr.id
+        inner JOIN sing_active_record sar on hr.active_id = sar.id
         where hr.is_deleted = 0
         <if test="activeHelpRecord.helpGoodsName != null">
             and g.name like concat('%',#{activeHelpRecord.helpGoodsName},'%')
@@ -52,6 +53,9 @@
         <if test="activeHelpRecord.status != null">
             and hr.status = #{activeHelpRecord.status}
         </if>
+        <if test="activeHelpRecord.activeId != null">
+            and hr.active_id = #{activeHelpRecord.activeId}
+        </if>
         order by hr.create_time DESC
     </select>
 

+ 2 - 0
src/main/java/org/springblade/sing/active/vo/ActiveHelpRecordVO.java

@@ -62,4 +62,6 @@ public class ActiveHelpRecordVO extends ActiveHelpRecord {
 
 	private Long productNo;
 
+	private String activeName;
+
 }

+ 9 - 0
src/main/java/org/springblade/sing/active/wrapper/ActiveHelpRecordWrapper.java

@@ -20,9 +20,12 @@ import org.apache.commons.lang3.ObjectUtils;
 import org.springblade.common.utils.SpringContextHolder;
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.sing.active.entity.ActiveHelpRecord;
 import org.springblade.sing.active.entity.ActiveProductRecord;
+import org.springblade.sing.active.entity.ActiveRecord;
 import org.springblade.sing.active.service.IActiveProductRecordService;
+import org.springblade.sing.active.service.IActiveRecordService;
 import org.springblade.sing.active.vo.ActiveHelpRecordVO;
 import org.springblade.sing.goods.entity.HelpGoods;
 import org.springblade.sing.goods.service.IHelpGoodsService;
@@ -44,6 +47,7 @@ public class ActiveHelpRecordWrapper extends BaseEntityWrapper<ActiveHelpRecord,
 	private IActiveProductRecordService activeProductRecordService;
 	private IHelpGoodsService helpGoodsService;
 	private final static ILoginUserService loginUserService = SpringContextHolder.getBean(ILoginUserService.class);
+	private final static IActiveRecordService activeRecordService = SpringContextHolder.getBean(IActiveRecordService.class);
 
 	public ActiveHelpRecordWrapper() {
 	}
@@ -80,6 +84,11 @@ public class ActiveHelpRecordWrapper extends BaseEntityWrapper<ActiveHelpRecord,
 		if(ObjectUtils.isNotEmpty(loginUser)){
 			activeHelpRecordVO.setUserName(loginUser.getNickName());
 		}
+
+		ActiveRecord activeRecord = activeRecordService.getById(activeHelpRecordVO.getActiveId());
+		if (ObjectUtil.isNotEmpty(activeHelpRecord)){
+			activeHelpRecordVO.setActiveName(activeRecord.getTitle());
+		}
 		//User createUser = UserCache.getUser(activeHelpRecord.getCreateUser());
 		//User updateUser = UserCache.getUser(activeHelpRecord.getUpdateUser());
 		//activeHelpRecordVO.setCreateUserName(createUser.getName());