Parcourir la source

修改活动页抵用券为指定

anderx il y a 7 ans
Parent
commit
8e17cc552b

+ 2 - 2
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -160,8 +160,8 @@ public class PortalController extends BaseController {
 	@RequestMapping(value="/portal/invRegister",method = RequestMethod.GET)
 	public ModelAndView portalActivityDetails(ModelAndView modelAndView){
 		modelAndView.setViewName("/portal/invRegister");
-		//随机项目抵用券
-		List<JtVoucherListBo> vlist=voucherService.selectVoucherByClassify( null,null, 4);
+		//获得项目抵用券
+		List<JtVoucherListBo> vlist=voucherService.selectActivityVoucher();
 		for (JtVoucherListBo j : vlist) {
 			if (j.getName().length()>12) {
 				j.setName(j.getName().substring(0, 11)+"…");

+ 2 - 0
src/main/java/com/goafanti/common/dao/JtVoucherMapper.java

@@ -78,4 +78,6 @@ public interface JtVoucherMapper {
 	List<String> getSourceVoucher(Integer source);
 
 	List<JtVoucherListBo> selectVoucherByClassify(@Param("name")String name, @Param("isHot")Integer isHot,@Param("size")Integer size);
+
+	JtVoucherListBo selectByName(@Param("name")String string, @Param("name")Integer size);
 }

+ 8 - 0
src/main/java/com/goafanti/common/mapper/JtVoucherMapper.xml

@@ -416,5 +416,13 @@
     </if>
     limit #{size,jdbcType=INTEGER}
   </select>
+  <select id="selectByName" resultType="com.goafanti.voucher.bo.JtVoucherListBo">
+   select a.id,a.name,a.source,a.active_state as activeState,a.money,a.duration_day as durationDay,
+  a.granting_uid as grantingUid,a.limit_use as limitUse,a.limit_project_id as limitProjectId
+    from jt_voucher a
+    where a.source=4 and a.active_state=1
+    and a.name= #{name,jdbcType=VARCHAR}
+    limit #{size}
+  </select>
   
 </mapper>

+ 2 - 0
src/main/java/com/goafanti/voucher/service/VoucherService.java

@@ -21,4 +21,6 @@ public interface VoucherService {
 	List<String> getSourceVoucher(Integer source);
 
 	List<JtVoucherListBo> selectVoucherByClassify(String name, Integer isHot,Integer size);
+
+	List<JtVoucherListBo> selectActivityVoucher();
 }

+ 11 - 1
src/main/java/com/goafanti/voucher/service/impl/VoucherServiceImpl.java

@@ -1,5 +1,6 @@
 package com.goafanti.voucher.service.impl;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -75,8 +76,17 @@ public class VoucherServiceImpl extends BaseMybatisDao<JtVoucherMapper> implemen
 	@Override
 	public List<JtVoucherListBo> selectVoucherByClassify(String name,Integer isHot, Integer size) {
 		List<JtVoucherListBo> list=jtVoucherMapper.selectVoucherByClassify( name,  isHot, size);
-		
 		return list; 
 	}
 
+	@Override
+	public List<JtVoucherListBo> selectActivityVoucher() {
+		List<JtVoucherListBo> list=new ArrayList<JtVoucherListBo>();
+		list.add(jtVoucherMapper.selectByName("承制资格认证抵用券",1));
+		list.add(jtVoucherMapper.selectByName("保密资格认证抵用券",1));
+		list.add(jtVoucherMapper.selectByName("生产许可认证抵用券",1));
+		list.add(jtVoucherMapper.selectByName("高新认定抵用券",1));
+		return list;
+	}
+
 }