Procházet zdrojové kódy

积分规则有效时间修改

jk-GitHub-coder před 4 roky
rodič
revize
856ed6a869

+ 4 - 21
YijiaRestful/src/main/java/com/platform/yijia/controller/IntegralShoppingMallController.java

@@ -274,7 +274,7 @@ public class IntegralShoppingMallController {
     //获取油站油品积分规则信息 根据油站ID和油品名称
     @RequestMapping(value = "/getIntegralRuleListByOilNameAndStationId", method = RequestMethod.GET)
     @ResponseBody
-    public String getIntegralRuleList(@RequestParam Integer stationId, String oilName){
+    public String getIntegralRuleList(@RequestParam Integer stationId, String oilName, String oilType){
         Gson gson =new Gson();
         //返回结果集
         ResultData resultData = null;
@@ -282,27 +282,9 @@ public class IntegralShoppingMallController {
             IntegralRule integralRule = new IntegralRule();
             integralRule.setStationId(stationId);
             integralRule.setOilName(oilName);
+            integralRule.setOilType(oilType);
+            integralRule.setEmptyDate(new Date()); //有效期时间是否大于当前时间
             List<IntegralRule> integralRuleList = integralRuleService.getIntegralRule(integralRule);
-
-//            String gzhAppId ="";
-//            String gzhAppSecret ="";
-//            String stationName = "";        //油站名称
-//            Map<String, String> m = stationService.getStationAppIdAndAppSecret(stationId);
-//            if(m !=null && m.containsKey("stationName") && m.containsKey("gzhAppId") && m.containsKey("gzhAppSecret")){
-//                stationName = m.get("stationName");
-//                gzhAppId = m.get("gzhAppId");
-//                gzhAppSecret = m.get("gzhAppSecret");
-//            }
-//            List<WxMpTemplateData> wxMpTemplate = new ArrayList<>();
-//            wxMpTemplate.add(new WxMpTemplateData("first","尊敬的"+"M"+",您好:\n" + "您在"+stationName+"的积分最新交易信息如下"));
-//            wxMpTemplate.add(new WxMpTemplateData("time", new SimpleDateFormat("yyyy年MM月dd日HH时mm分").format(new Date())));
-//            wxMpTemplate.add(new WxMpTemplateData("type", "增加"));
-//            wxMpTemplate.add(new WxMpTemplateData("Point", "212"));
-//            wxMpTemplate.add(new WxMpTemplateData("From", "中化加油站"));
-//            wxMpTemplate.add(new WxMpTemplateData("remark",
-//                    "截止至" + new SimpleDateFormat(" yyyy年MM月dd日HH时mm分").format(new Date())+",您在"+stationName+"的可用积分为 22222 分"));
-//            String templateId = "G9tN--a3tGM5BN3otqZr73b4ErQCYWISSgyshbTqLYc";  //积分兑换成功通知模板
-//            wxPushUtil.push(gzhAppId, gzhAppSecret, templateId, "oJR5R6r4EJhaORFcPap70r_mtFZo", wxMpTemplate);
             resultData=ResultData.success(integralRuleList);
         }else {
             resultData=ResultData.success(CodeMsg.REQUEST_FAIL);
@@ -320,6 +302,7 @@ public class IntegralShoppingMallController {
         if(stationId !=null){
             IntegralRule integralRule = new IntegralRule();
             integralRule.setStationId(stationId);
+            integralRule.setEmptyDate(new Date()); //有效期时间是否大于当前时间
             List<IntegralRule> integralRuleList = integralRuleService.getIntegralRule(integralRule);
             resultData=ResultData.success(integralRuleList);
         }else {

+ 1 - 0
YijiaRestful/src/main/java/com/platform/yijia/controller/PayController.java

@@ -673,6 +673,7 @@ public class PayController {
                             }
 
                             //获取该油站的积分规则
+                            integralRule.setEmptyDate(new Date());
                             List<IntegralRule> rule = integralRuleService.getIntegralRule(integralRule);
                             if(rule !=null && rule.size() > 0 && rule.get(0).getEmptyDate().compareTo(new Date()) ==1){
                                 CustomerPoints customerPoints = new CustomerPoints();       //客户积分实体表

+ 3 - 0
YijiaRestful/src/main/resources/mapper/IntegralRuleMapper.xml

@@ -64,6 +64,9 @@
           <if test="oilName !=null and oilName !=''">
             AND T2.oil_name = #{oilName}
           </if>
+          <if test="emptyDate !=null">
+              <![CDATA[ AND T1.empty_date >=  #{emptyDate}  ]]>
+          </if>
           <if test="oilType !=null and oilType !=''">
             AND T2.oil_type = #{oilType}
           </if>