瀏覽代碼

悦所4月份测试开发2

huan.wang 6 年之前
父節點
當前提交
65a9729fe8

+ 6 - 0
src/main/java/com/ygj/yuemum/controller/promotion/PromotionDCController.java

@@ -5,6 +5,7 @@ import com.ygj.yuemum.domain.promotion.PromotionDC;
 import com.ygj.yuemum.service.promotion.PromotionDCService;
 import com.ygj.yuemum.service.promotion.PromotionDCService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
 import java.util.List;
 import java.util.List;
@@ -20,6 +21,11 @@ public class PromotionDCController {
         return promotionDCService.getPromotionDC();
         return promotionDCService.getPromotionDC();
     }
     }
 
 
+    @GetMapping("/getPromotionDCByID")
+    public PromotionDC getPromotionDCByID(@RequestParam("id") Integer id){
+        return promotionDCService.getPromotionDCByID(id);
+    }
+
     @GetMapping("/getPromotionDCs")
     @GetMapping("/getPromotionDCs")
     public List<PromotionDC> getPromotionDCs(){
     public List<PromotionDC> getPromotionDCs(){
         return promotionDCService.getPromotionDCs();
         return promotionDCService.getPromotionDCs();

+ 2 - 0
src/main/java/com/ygj/yuemum/dao/promotion/PromotionDCDao.java

@@ -10,4 +10,6 @@ public interface PromotionDCDao {
 
 
     PromotionDC getPromotionDC();
     PromotionDC getPromotionDC();
     List<PromotionDC> getPromotionDCs();
     List<PromotionDC> getPromotionDCs();
+    PromotionDC getPromotionDCByID(Integer id);
+
 }
 }

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/promotion/PromotionDC.java

@@ -8,6 +8,15 @@ public class PromotionDC {
     private String pd_enddate;
     private String pd_enddate;
     private Integer pd_type;
     private Integer pd_type;
     private String pd_imgurl;
     private String pd_imgurl;
+    private String pd_result_imgurl;
+
+    public String getPd_result_imgurl() {
+        return pd_result_imgurl;
+    }
+
+    public void setPd_result_imgurl(String pd_result_imgurl) {
+        this.pd_result_imgurl = pd_result_imgurl;
+    }
 
 
     public String getPd_imgurl() {
     public String getPd_imgurl() {
         return pd_imgurl;
         return pd_imgurl;

+ 9 - 0
src/main/java/com/ygj/yuemum/domain/promotion/PromotionTest.java

@@ -6,6 +6,15 @@ public class PromotionTest {
     private String pt_title;
     private String pt_title;
     private Integer pt_seq;
     private Integer pt_seq;
     private String pt_img_path;
     private String pt_img_path;
+    private String pt_tips;
+
+    public String getPt_tips() {
+        return pt_tips;
+    }
+
+    public void setPt_tips(String pt_tips) {
+        this.pt_tips = pt_tips;
+    }
 
 
     public Integer getId() {
     public Integer getId() {
         return id;
         return id;

+ 3 - 3
src/main/java/com/ygj/yuemum/service/global/CreatePOPService.java

@@ -57,7 +57,7 @@ public class CreatePOPService {
             scorex = 780;
             scorex = 780;
             fenx = 890;
             fenx = 890;
         }
         }
-        Font rewardFirstFont = new Font("PingFang SC Bold", Font.BOLD, 130);
+        Font rewardFirstFont = new Font("DejaVuLGCSansMono", Font.BOLD, 130);
         AffineTransform affineTransform = new AffineTransform();
         AffineTransform affineTransform = new AffineTransform();
         affineTransform.rotate(Math.toRadians(15), 0, 0);
         affineTransform.rotate(Math.toRadians(15), 0, 0);
         Font rotatedFont = rewardFirstFont.deriveFont(affineTransform);
         Font rotatedFont = rewardFirstFont.deriveFont(affineTransform);
@@ -65,7 +65,7 @@ public class CreatePOPService {
         g2.setFont(rotatedFont);
         g2.setFont(rotatedFont);
         g2.drawString(String.valueOf(score),scorex,50);
         g2.drawString(String.valueOf(score),scorex,50);
 
 
-        Font rewardLastFont = new Font("PingFang SC Bold", Font.CENTER_BASELINE, 70);
+        Font rewardLastFont = new Font("DejaVuLGCSansMono", Font.CENTER_BASELINE, 70);
         AffineTransform affineTransform2 = new AffineTransform();
         AffineTransform affineTransform2 = new AffineTransform();
         affineTransform2.rotate(Math.toRadians(15), 0, 0);
         affineTransform2.rotate(Math.toRadians(15), 0, 0);
         Font rotatedFont2 = rewardLastFont.deriveFont(affineTransform);
         Font rotatedFont2 = rewardLastFont.deriveFont(affineTransform);
@@ -128,7 +128,7 @@ public class CreatePOPService {
 //        drawString(g, Color.decode("#323232"), new Font("PingFang SC Bold", Font.BOLD, 34), title, 0, 400, width, 12, 5, true);
 //        drawString(g, Color.decode("#323232"), new Font("PingFang SC Bold", Font.BOLD, 34), title, 0, 400, width, 12, 5, true);
 //        //把宠物图片和二维码图片划入背景
 //        //把宠物图片和二维码图片划入背景
 //        g.drawImage(ImageIO.read(petImg), 130, 90, 362, 250, null);
 //        g.drawImage(ImageIO.read(petImg), 130, 90, 362, 250, null);
-        g.drawImage(ImageIO.read(qrCodeImg), 266, height-235, 220, 220, null);
+        g.drawImage(ImageIO.read(qrCodeImg), 430, height-278, 220, 220, null);
         //   ```````````结束作画```````````
         //   ```````````结束作画```````````
         //7、处理画作
         //7、处理画作
         g.dispose();
         g.dispose();

+ 4 - 0
src/main/java/com/ygj/yuemum/service/promotion/PromotionDCService.java

@@ -16,6 +16,10 @@ public class PromotionDCService {
         return promotionDCDao.getPromotionDC();
         return promotionDCDao.getPromotionDC();
     }
     }
 
 
+    public PromotionDC getPromotionDCByID(Integer id) {
+        return promotionDCDao.getPromotionDCByID(id);
+    }
+
     public List<PromotionDC> getPromotionDCs(){
     public List<PromotionDC> getPromotionDCs(){
         return promotionDCDao.getPromotionDCs();
         return promotionDCDao.getPromotionDCs();
     }
     }

+ 2 - 0
src/main/java/com/ygj/yuemum/shiro/ShiroConfig.java

@@ -93,6 +93,8 @@ public class ShiroConfig {
         filterChainDefinitionMap.put("/getPromotionTestResultByPtID", "anon");
         filterChainDefinitionMap.put("/getPromotionTestResultByPtID", "anon");
         filterChainDefinitionMap.put("/insertPromotionTestUserScore", "anon");
         filterChainDefinitionMap.put("/insertPromotionTestUserScore", "anon");
         filterChainDefinitionMap.put("/CreateTestShare", "anon");
         filterChainDefinitionMap.put("/CreateTestShare", "anon");
+        filterChainDefinitionMap.put("/getPromotionDCByID", "anon");
+        filterChainDefinitionMap.put("/getPromotionTestUserScoreByOpenID", "anon");
         //萌动开放权限
         //萌动开放权限
         filterChainDefinitionMap.put("/getNewUserCoupon", "anon");
         filterChainDefinitionMap.put("/getNewUserCoupon", "anon");
         filterChainDefinitionMap.put("/getConsultTaskCoupon", "anon");
         filterChainDefinitionMap.put("/getConsultTaskCoupon", "anon");

+ 12 - 2
src/main/resources/mybatis/mapper/promotion/PromotionDCMapper.xml

@@ -11,12 +11,13 @@
         <result column="pd_type" property="pd_type" jdbcType="INTEGER" />
         <result column="pd_type" property="pd_type" jdbcType="INTEGER" />
         <result column="pd_createdate" property="pd_createdate" jdbcType="DATE" />
         <result column="pd_createdate" property="pd_createdate" jdbcType="DATE" />
         <result column="pd_imgurl" property="pd_imgurl" jdbcType="VARCHAR" />
         <result column="pd_imgurl" property="pd_imgurl" jdbcType="VARCHAR" />
+        <result column="pd_result_imgurl" property="pd_result_imgurl" jdbcType="VARCHAR" />
     </resultMap>
     </resultMap>
 
 
     <!--获取所有数据-->
     <!--获取所有数据-->
     <select id="getPromotionDC" resultType="com.ygj.yuemum.domain.promotion.PromotionDC" parameterType="com.ygj.yuemum.domain.promotion.PromotionOffline" >
     <select id="getPromotionDC" resultType="com.ygj.yuemum.domain.promotion.PromotionDC" parameterType="com.ygj.yuemum.domain.promotion.PromotionOffline" >
         select
         select
-        id,pd_title,pd_headimg,pd_startdate,pd_enddate,pd_type,pd_imgurl
+        id,pd_title,pd_headimg,pd_startdate,pd_enddate,pd_type,pd_imgurl,pd_result_imgurl
         from promotion_dc
         from promotion_dc
         where
         where
          DATE_FORMAT(now(), '%Y-%m-%d')  &gt;=  pd_startdate
          DATE_FORMAT(now(), '%Y-%m-%d')  &gt;=  pd_startdate
@@ -25,9 +26,18 @@
     </select>
     </select>
 
 
 
 
+    <select id="getPromotionDCByID" resultType="com.ygj.yuemum.domain.promotion.PromotionDC" parameterType="java.lang.Integer" >
+        select
+        *
+        from promotion_dc
+        where
+        id = #{id,jdbcType=INTEGER}
+    </select>
+
+
     <select id="getPromotionDCs" resultType="com.ygj.yuemum.domain.promotion.PromotionDC"  >
     <select id="getPromotionDCs" resultType="com.ygj.yuemum.domain.promotion.PromotionDC"  >
         select
         select
-        id,pd_title,pd_imgurl
+        id,pd_title,pd_imgurl,pd_result_imgurl
         from promotion_dc
         from promotion_dc
         order by 1 desc
         order by 1 desc
     </select>
     </select>

+ 1 - 0
src/main/resources/mybatis/mapper/promotion/PromotionTestMapper.xml

@@ -8,6 +8,7 @@
         <result column="pt_title" property="pt_title" jdbcType="VARCHAR" />
         <result column="pt_title" property="pt_title" jdbcType="VARCHAR" />
         <result column="pt_seq" property="pt_seq" jdbcType="INTEGER" />
         <result column="pt_seq" property="pt_seq" jdbcType="INTEGER" />
         <result column="pt_img_path" property="pt_img_path" jdbcType="VARCHAR" />
         <result column="pt_img_path" property="pt_img_path" jdbcType="VARCHAR" />
+        <result column="pt_tips" property="pt_tips" jdbcType="VARCHAR" />
     </resultMap>
     </resultMap>
 
 
     <!--获取所有数据-->
     <!--获取所有数据-->

+ 1 - 1
src/main/resources/mybatis/mapper/promotion/PromotionTestUserScoreMapper.xml

@@ -16,7 +16,7 @@
         from promotion_test_user_score
         from promotion_test_user_score
         where
         where
          pc_openid = #{pc_openid,jdbcType=VARCHAR }
          pc_openid = #{pc_openid,jdbcType=VARCHAR }
-        order by 1 asc limit 1
+        order by 1 desc limit 1
     </select>
     </select>
     <insert id="insertPromotionTestUserScore" parameterType="com.ygj.yuemum.domain.promotion.PromotionTestUserScore" >
     <insert id="insertPromotionTestUserScore" parameterType="com.ygj.yuemum.domain.promotion.PromotionTestUserScore" >
         insert into promotion_test_user_score
         insert into promotion_test_user_score