Shanks 7 anni fa
parent
commit
1c7bc6f2b3

+ 5 - 0
src/main/java/com/ygj/yuemum/controller/customer/CustomerCouponController.java

@@ -52,6 +52,11 @@ public class CustomerCouponController {
         return jso;
     }
 
+    @GetMapping("/getWXCustomerCoupons")
+    public List<CustomerCoupon> getWXCustomerCoupons(@RequestParam("cm_phone") String cm_phone) {
+        return customerCouponService.getWXCustomerCoupons(cm_phone);
+    }
+
     @GetMapping("/getCustomerCoupon/{id}")
     public CustomerCoupon getOne(@PathVariable("id") Integer id) {
         return customerCouponService.getCustomerCoupon(id);

+ 5 - 0
src/main/java/com/ygj/yuemum/controller/wxmini/WXUserAddressController.java

@@ -18,6 +18,11 @@ public class WXUserAddressController {
         List<WXUserAddress> wxUserAddresses = wxUserAddressService.getWXUserAddress(xu_openid);
         return wxUserAddresses;
     }
+    @GetMapping("/getEqUserAddress")
+    public WXUserAddress getEqUserAddress(@RequestParam("xu_openid") String xu_openid) {
+        WXUserAddress wxUserAddresse = wxUserAddressService.getEqUserAddress(xu_openid);
+        return wxUserAddresse;
+    }
 
     @PostMapping("/insertWXUserAddress")
     public int insertWXUserAddress(@ModelAttribute WXUserAddress wxUserAddress) {

+ 4 - 0
src/main/java/com/ygj/yuemum/dao/customer/CustomerCouponDao.java

@@ -25,6 +25,10 @@ public interface CustomerCouponDao {
     int checkSumCustomerCoupon(String cm_phone);
 
     List<CustomerCoupon> getCustomerCoupons(CustomerCouponQuery customerCouponQuery);
+
+    List<CustomerCoupon> getWXCustomerCoupons(String cm_phone);
+
+
     int getCustomerCouponsCount(CustomerCouponQuery customerCouponQuery);
 
     List<CustomerCoupon> getCouponSum(CustomerCouponQuery customerCouponQuery);

+ 1 - 0
src/main/java/com/ygj/yuemum/dao/wxmini/WXUserAddressDao.java

@@ -8,6 +8,7 @@ import java.util.List;
 @Repository
 public interface WXUserAddressDao {
     List<WXUserAddress> getWXUserAddress(String xu_openid);
+    WXUserAddress getEqUserAddress(String xu_openid);
     int insertWXUserAddress(WXUserAddress wxUserAddress);
     int updateWXUserAddress(WXUserAddress wxUserAddress);
     int updateWXUserDefAddress (Integer id);

+ 12 - 10
src/main/java/com/ygj/yuemum/domain/maternitymatron/QueryServiceUserStock.java

@@ -8,7 +8,7 @@ public class QueryServiceUserStock {
     private String truename;
     private String status;
     private String cityname;
-    private String np;
+    private List<String> np;
     private String experiencestart;
     private String experienceend;
     private String experience;
@@ -20,7 +20,7 @@ public class QueryServiceUserStock {
     private String service_end;
     private String ids;
     private String ethnicgroup;
-    private String education;
+    private List<String> education;
     private String height;
     private String marriage;
     private String highlight;
@@ -56,11 +56,19 @@ public class QueryServiceUserStock {
         this.ethnicgroup = ethnicgroup;
     }
 
-    public String getEducation() {
+    public List<String> getNp() {
+        return np;
+    }
+
+    public void setNp(List<String> np) {
+        this.np = np;
+    }
+
+    public List<String> getEducation() {
         return education;
     }
 
-    public void setEducation(String education) {
+    public void setEducation(List<String> education) {
         this.education = education;
     }
 
@@ -160,13 +168,7 @@ public class QueryServiceUserStock {
         this.cityname = cityname;
     }
 
-    public String getNp() {
-        return np;
-    }
 
-    public void setNp(String np) {
-        this.np = np;
-    }
 
     public String getExperiencestart() {
         return experiencestart;

+ 10 - 0
src/main/java/com/ygj/yuemum/domain/wxmini/WXUser.java

@@ -5,6 +5,7 @@ public class WXUser {
     private String xu_openid;
     private String xu_sessionkey;
     private String xu_phone;
+    private String xu_countryCode;
     private String xu_name;
     private String xu_avatarUrl;
     private String xu_gender;
@@ -15,6 +16,15 @@ public class WXUser {
     private String xu_ydate;
     private Integer xu_isauthorize;
 
+
+    public String getXu_countryCode() {
+        return xu_countryCode;
+    }
+
+    public void setXu_countryCode(String xu_countryCode) {
+        this.xu_countryCode = xu_countryCode;
+    }
+
     public Integer getXu_isauthorize() {
         return xu_isauthorize;
     }

+ 5 - 0
src/main/java/com/ygj/yuemum/service/customer/CustomerCouponService.java

@@ -73,6 +73,11 @@ public class CustomerCouponService {
         return customerCouponDao.checkSumCustomerCoupon(phone);
     }
 
+
+    public List<CustomerCoupon> getWXCustomerCoupons(String cm_phone) {
+        return customerCouponDao.getWXCustomerCoupons(cm_phone);
+    }
+
     public Map<String, Object> getCustomerCoupons(CustomerCouponQuery customerCouponQuery) {
         PageHelper.startPage(customerCouponQuery.getPage(), customerCouponQuery.getLimit());
         List<CustomerCoupon> customerCoupons = customerCouponDao.getCustomerCoupons(customerCouponQuery);

+ 3 - 0
src/main/java/com/ygj/yuemum/service/wxmini/WXUserAddressService.java

@@ -17,6 +17,9 @@ public class WXUserAddressService {
     public List<WXUserAddress> getWXUserAddress(String xu_openid) {
         return wxUserAddressDao.getWXUserAddress(xu_openid);
     }
+    public WXUserAddress getEqUserAddress(String xu_openid) {
+        return wxUserAddressDao.getEqUserAddress(xu_openid);
+    }
     public int insertWXUserAddress(WXUserAddress wxUserAddress){
         //xa_default
         int addressCount = wxUserAddressDao.getWXUserAddressCount(wxUserAddress.getXu_openid());

+ 23 - 0
src/main/resources/mybatis/mapper/customer/CustomerCouponMapper.xml

@@ -114,6 +114,29 @@
     </select>
 
 
+
+    <select id="getWXCustomerCoupons" resultMap="BaseResultMap" parameterType="java.lang.String"  >
+        SELECT
+        ta.cc_code,
+        tb.cb_name,
+        tb.cb_rule,
+        fgetpackages(tb.id) cb_packages,
+        fgetmoretcityname(tb.id) cb_citys,
+        DATE_FORMAT(tc.cp_startdate,'%Y.%m.%d') cp_startdate,
+        DATE_FORMAT(tc.cp_enddate,'%Y.%m.%d') cp_enddate,
+        tc.cp_amount,
+        cc_getdate,
+        ta.cp_status
+        FROM
+        customer_coupon ta
+        LEFT JOIN coupon_batch tb ON ta.cb_code = tb.cb_code
+        left JOIN coupon tc on ta.cc_code = tc.cp_code
+        where
+        ta.cm_phone = #{cm_phone,jdbcType=VARCHAR}
+        order by ta.cb_code ,tc.cp_amount desc
+    </select>
+
+
     <select id="getCustomerCouponsCount" resultType="java.lang.Integer"  parameterType="com.ygj.yuemum.domain.customer.CustomerCouponQuery" >
         SELECT
         count(1)

+ 11 - 5
src/main/resources/mybatis/mapper/maternitymatron/JlServiceUserMapper.xml

@@ -367,9 +367,12 @@
               </foreach>
         </if>
         <if test="np != null ">
-            and city = #{np,jdbcType=VARCHAR}
+            and city
+            IN <foreach collection="np" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
         </if>
-        <if test="experiencestart != null and experienceend != null">
+        <if test="experiencestart != null and experienceend != null and experiencestart != 0 and experienceend !=0">
             and CAST( seniority AS SIGNED) &gt;= CAST( #{experiencestart,jdbcType=VARCHAR} AS SIGNED )
             and CAST( seniority AS SIGNED) &lt;= CAST( #{experienceend,jdbcType=VARCHAR} AS SIGNED )
         </if>
@@ -379,7 +382,7 @@
         <if test="status != null ">
             and status = #{status,jdbcType=VARCHAR}
         </if>
-        <if test="babynumber != null ">
+        <if test="babynumber != null and babynumber != 0">
             and babynumber = #{babynumber,jdbcType=VARCHAR}
         </if>
         <if test="cityname != null ">
@@ -389,7 +392,10 @@
             and ethnicgroup = #{ethnicgroup,jdbcType=VARCHAR}
         </if>
         <if test="education != null ">
-            and education = #{education,jdbcType=VARCHAR}
+            and education
+            IN <foreach collection="education" item="item" index="index" open="(" separator="," close=")">
+            #{item}
+        </foreach>
         </if>
         <if test="height != null ">
             and height = #{height,jdbcType=VARCHAR}
@@ -403,7 +409,7 @@
         <if test="weight != null ">
             and weight = #{weight,jdbcType=VARCHAR}
         </if>
-        <if test="agestart != null and ageend != null ">
+        <if test="agestart != null and ageend != null and agestart != 0 and ageend != 0">
             and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &gt;= #{agestart,jdbcType=VARCHAR}
             and year(CURDATE())-substring(jl_service_user_info.idcard,7,4) &lt;= #{ageend,jdbcType=VARCHAR}
         </if>

+ 10 - 0
src/main/resources/mybatis/mapper/wxmini/WXUserAddressMapper.xml

@@ -22,6 +22,16 @@
         order by xa_default desc,id asc
     </select>
 
+    <select id="getEqUserAddress" resultType="com.ygj.yuemum.domain.wxmini.WXUserAddress" parameterType="java.lang.String">
+        select
+        id,xu_openid,xa_phone,xa_consignee,xa_city,xa_county,xa_address,xa_default
+        from wx_user_address
+        where xu_openid = #{xu_openid,jdbcType=VARCHAR}
+        order by xa_default desc,id desc
+        limit 1
+    </select>
+
+
     <select id="getWXUserAddressCount" resultType="java.lang.Integer" parameterType="java.lang.String">
         select
         count(1)

+ 4 - 0
src/main/resources/mybatis/mapper/wxmini/WXUserMapper.xml

@@ -7,6 +7,7 @@
         <result column="xu_openid" property="xu_openid" jdbcType="VARCHAR"/>
         <result column="xu_sessionkey" property="xu_sessionkey" jdbcType="VARCHAR"/>
         <result column="xu_phone" property="xu_phone" jdbcType="VARCHAR"/>
+        <result column="xu_countryCode" property="xu_countryCode" jdbcType="VARCHAR"/>
         <result column="xu_name" property="xu_name" jdbcType="VARCHAR"/>
         <result column="xu_avatarUrl" property="xu_avatarUrl" jdbcType="VARCHAR"/>
         <result column="xu_gender" property="xu_gender" jdbcType="VARCHAR"/>
@@ -119,6 +120,9 @@
             <if test="xu_phone != null" >
                 xu_phone = #{xu_phone,jdbcType=VARCHAR},
             </if>
+            <if test="xu_countryCode != null" >
+                xu_countryCode = #{xu_countryCode,jdbcType=VARCHAR},
+            </if>
             <if test="xu_name != null" >
                 xu_name = #{xu_name,jdbcType=VARCHAR},
             </if>