Prechádzať zdrojové kódy

修改积分规则表,接口

MS-QJVSRANLTYEO\Administrator 4 rokov pred
rodič
commit
3943924eda

+ 0 - 2
yijia-integral/src/main/java/com/yijia/integral/controller/IntegralRuleController.java

@@ -131,7 +131,6 @@ public class IntegralRuleController extends BaseController
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
         integralRule.setStationId(currentUser.getUser().getDeptId());
-        integralRule.setStationName(currentUser.getUser().getDept().getDeptName());
         if(integralRule!=null && integralRule.getIntegralActivity()==null){
             integralRule.setIntegralActivity("0");
         }
@@ -147,7 +146,6 @@ public class IntegralRuleController extends BaseController
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
         integralRule.setStationId(currentUser.getUser().getDeptId());
-        integralRule.setStationName(currentUser.getUser().getDept().getDeptName());
         if(integralRule!=null && integralRule.getIntegralActivity()==null){
             integralRule.setIntegralActivity("0");
         }

+ 20 - 88
yijia-integral/src/main/java/com/yijia/integral/domain/IntegralRule.java

@@ -7,12 +7,11 @@ import java.util.List;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
-import com.yijia.common.annotation.Excel;
 import com.yijia.common.core.domain.BaseEntity;
 
 /**
  * 【请填写功能名称】对象 integral_rule
- * 
+ *
  * @author yijia
  * @date 2021-03-11
  */
@@ -24,55 +23,29 @@ public class IntegralRule extends BaseEntity
     private Long id;
 
     /** 油站id */
-    @Excel(name = "油站id")
     private Long stationId;
 
     /** 油站名称 */
-    @Excel(name = "油站名称")
     private String stationName;
 
-    /** 订单积分计算规则类型(1以订单实付累计 2以订单应付累计) */
-    @Excel(name = "订单积分计算规则类型", readConverterExp = "1=以订单实付累计,2=以订单应付累计")
-    private String ruleType;
-
     /** 有效期设置 */
-    @Excel(name = "有效期设置")
     private String termDateManage;
 
     /** 清空积分时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "清空积分时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date emptyDate;
 
-    /** 到期提醒设置 */
-    @Excel(name = "到期提醒设置")
-    private String expirationReminder;
-
-    /** 提醒时间设置 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "提醒时间设置", width = 30, dateFormat = "yyyy-MM-dd")
-    private Date remindDate;
-
     /** 积分活动设置 */
-    @Excel(name = "积分活动设置")
     private String integralActivity;
 
     /** 日期选择 */
-    @Excel(name = "日期选择")
     private String datePicker;
 
     /** 日期选择 */
-    @Excel(name = "日期选择")
     private String datePickerTime;
     /** 积分比例 */
-    @Excel(name = "积分比例")
     private String integralProportion;
 
-
-    /** 积分抵扣油品规则 */
-    @Excel(name = "积分抵扣油品规则")
-    private String integralDeductionOil;
-
     /**
      * 积分有效期设置
      */
@@ -80,10 +53,9 @@ public class IntegralRule extends BaseEntity
     /**
      * 积分清空时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    private Date integralEmptyTime;
 
     private BigDecimal ruleTerms;
+    private String ruleType;
     /** 会员等级 */
     private String gread;
     /** 油品名称 */
@@ -161,14 +133,6 @@ public class IntegralRule extends BaseEntity
         this.integralTermSetting = integralTermSetting;
     }
 
-    public Date getIntegralEmptyTime() {
-        return integralEmptyTime;
-    }
-
-    public void setIntegralEmptyTime(Date integralEmptyTime) {
-        this.integralEmptyTime = integralEmptyTime;
-    }
-
     private List<IntegralRuleDetail> itemsDetail;
     private List<IntegralRuleDetail> notOilList;
     private List<IntegralShopPic> imgFileList;
@@ -210,125 +174,93 @@ public class IntegralRule extends BaseEntity
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setStationId(Long stationId) 
+    public void setStationId(Long stationId)
     {
         this.stationId = stationId;
     }
 
-    public Long getStationId() 
+    public Long getStationId()
     {
         return stationId;
     }
-    public void setStationName(String stationName) 
+    public void setStationName(String stationName)
     {
         this.stationName = stationName;
     }
 
-    public String getStationName() 
+    public String getStationName()
     {
         return stationName;
     }
-    public void setRuleType(String ruleType) 
+    public void setRuleType(String ruleType)
     {
         this.ruleType = ruleType;
     }
 
-    public String getRuleType() 
+    public String getRuleType()
     {
         return ruleType;
     }
-    public void setTermDateManage(String termDateManage) 
+    public void setTermDateManage(String termDateManage)
     {
         this.termDateManage = termDateManage;
     }
 
-    public String getTermDateManage() 
+    public String getTermDateManage()
     {
         return termDateManage;
     }
-    public void setEmptyDate(Date emptyDate) 
+    public void setEmptyDate(Date emptyDate)
     {
         this.emptyDate = emptyDate;
     }
 
-    public Date getEmptyDate() 
+    public Date getEmptyDate()
     {
         return emptyDate;
     }
-    public void setExpirationReminder(String expirationReminder) 
-    {
-        this.expirationReminder = expirationReminder;
-    }
-
-    public String getExpirationReminder() 
-    {
-        return expirationReminder;
-    }
-    public void setRemindDate(Date remindDate) 
-    {
-        this.remindDate = remindDate;
-    }
-
-    public Date getRemindDate() 
-    {
-        return remindDate;
-    }
-    public void setIntegralActivity(String integralActivity) 
+    public void setIntegralActivity(String integralActivity)
     {
         this.integralActivity = integralActivity;
     }
 
-    public String getIntegralActivity() 
+    public String getIntegralActivity()
     {
         return integralActivity;
     }
-    public void setDatePicker(String datePicker) 
+    public void setDatePicker(String datePicker)
     {
         this.datePicker = datePicker;
     }
 
-    public String getDatePicker() 
+    public String getDatePicker()
     {
         return datePicker;
     }
-    public void setIntegralProportion(String integralProportion) 
+    public void setIntegralProportion(String integralProportion)
     {
         this.integralProportion = integralProportion;
     }
 
-    public String getIntegralProportion() 
+    public String getIntegralProportion()
     {
         return integralProportion;
     }
-    public void setIntegralDeductionOil(String integralDeductionOil) 
-    {
-        this.integralDeductionOil = integralDeductionOil;
-    }
-
-    public String getIntegralDeductionOil() 
-    {
-        return integralDeductionOil;
-    }
 
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
             .append("id", getId())
             .append("stationId", getStationId())
-            .append("stationName", getStationName())
-            .append("ruleType", getRuleType())
             .append("termDateManage", getTermDateManage())
             .append("emptyDate", getEmptyDate())
-            .append("expirationReminder", getExpirationReminder())
-            .append("remindDate", getRemindDate())
             .append("integralActivity", getIntegralActivity())
             .append("datePicker", getDatePicker())
             .append("integralProportion", getIntegralProportion())
-            .append("integralDeductionOil", getIntegralDeductionOil())
             .toString();
     }
 }

+ 22 - 15
yijia-integral/src/main/java/com/yijia/integral/service/impl/IntegralRuleServiceImpl.java

@@ -3,6 +3,7 @@ package com.yijia.integral.service.impl;
 import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 import com.yijia.integral.domain.IntegralRuleDetail;
@@ -17,12 +18,12 @@ import com.yijia.integral.service.IIntegralRuleService;
 
 /**
  * 积分规则Service业务层处理
- * 
+ *
  * @author yijia
  * @date 2021-02-24
  */
 @Service
-public class IntegralRuleServiceImpl implements IIntegralRuleService 
+public class IntegralRuleServiceImpl implements IIntegralRuleService
 {
     @Autowired
     private IntegralRuleMapper integralRuleMapper;
@@ -32,7 +33,7 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
     private IntegralShopPicMapper integralShopPicMapper;
     /**
      * 查询积分规则
-     * 
+     *
      * @param id 积分规则ID
      * @return 积分规则
      */
@@ -50,19 +51,29 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
         IntegralRuleDetail  itemdetail  = new  IntegralRuleDetail();
         itemdetail.setParentId(id);
         itemdetail.setOilType("2");
-        List<IntegralRuleDetail> notOillist =  integralRuleDetailMapper.selectIntegralRuleDetailList(itemdetail);
-        integralRule.setNotOilList(notOillist);
+        List<IntegralRuleDetail>  notOillist =  integralRuleDetailMapper.selectIntegralRuleDetailList(itemdetail);
+        if(notOillist!=null && notOillist.size()>0){
+            integralRule.setNotOilList(notOillist);
+        }else{
+            notOillist =new ArrayList<>();
+            integralRule.setNotOilList(notOillist);
+        }
         //查询图片信息
         IntegralShopPic shopPic =new IntegralShopPic();
         shopPic.setParentId(id);
-        List<IntegralShopPic> shopPicList = integralShopPicMapper.selectIntegralShopPicList(shopPic);
-        integralRule.setImgFileList(shopPicList);
+        List<IntegralShopPic>  shopPicList = integralShopPicMapper.selectIntegralShopPicList(shopPic);
+        if(shopPicList!=null && shopPicList.size()>0){
+            integralRule.setImgFileList(shopPicList);
+        }else{
+            shopPicList =new ArrayList<>();
+            integralRule.setImgFileList(shopPicList);
+        }
         return integralRule;
     }
 
     /**
      * 查询积分规则列表
-     * 
+     *
      * @param integralRule 积分规则
      * @return 积分规则
      */
@@ -74,7 +85,7 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
 
     /**
      * 新增
-     * 
+     *
      * @param integralRule
      * @return 结果
      */
@@ -130,7 +141,7 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
 
     /**
      * 修改积分规则
-     * 
+     *
      * @param integralRule 积分规则
      * @return 结果
      */
@@ -182,10 +193,6 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
                 SimpleDateFormat sdf =   new SimpleDateFormat( "yyyy-MM-dd");
                 integralRule.setEmptyDate(sdf.parse("2099-12-31") );
             }
-            if(integralRule !=null && integralRule.getIntegralTermSetting()!=null && integralRule.getIntegralTermSetting().equals("1")){
-                SimpleDateFormat sdf =   new SimpleDateFormat( "yyyy-MM-dd");
-                integralRule.setIntegralEmptyTime(sdf.parse("2099-12-31") );
-            }
         } catch (ParseException e) {
             e.printStackTrace();
         }
@@ -206,7 +213,7 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
 
     /**
      * 删除积分规则信息
-     * 
+     *
      * @param id 积分规则ID
      * @return 结果
      */

+ 7 - 27
yijia-integral/src/main/resources/mapper/integral/IntegralRuleMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yijia.integral.mapper.IntegralRuleMapper">
-    
+
     <resultMap type="IntegralRule" id="IntegralRuleResult">
         <result property="id"    column="id"    />
         <result property="stationId"    column="station_id"    />
@@ -11,15 +11,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="ruleType"    column="rule_type"    />
         <result property="termDateManage"    column="term_date_manage"    />
         <result property="emptyDate"    column="empty_date"    />
-        <result property="expirationReminder"    column="expiration_reminder"    />
-        <result property="remindDate"    column="remind_date"    />
         <result property="integralActivity"    column="integral_activity"    />
         <result property="datePicker"    column="date_picker"    />
         <result property="integralProportion"    column="integral_proportion"    />
-        <result property="integralDeductionOil"    column="integral_deduction_oil"    />
         <result property="datePickerTime"    column="date_picker_time"    />
         <result property="integralTermSetting"    column="integral_term_setting"    />
-        <result property="integralEmptyTime"    column="integral_empty_time"    />
         <result property="ruleTerms"    column="rule_terms"    />
         <result property="gread"    column="gread"    />
         <result property="oilName"    column="oil_name"    />
@@ -30,25 +26,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectIntegralRuleVo">
-        select id, station_id, station_name, rule_type, term_date_manage, empty_date, expiration_reminder, remind_date, integral_activity, date_picker, integral_proportion, integral_deduction_oil,date_picker_time,integral_term_setting,integral_empty_time from integral_rule
+        select id, station_id, station_name, rule_type, term_date_manage, empty_date, integral_activity, date_picker, integral_proportion,date_picker_time,integral_term_setting from integral_rule
     </sql>
 
     <select id="selectIntegralRuleList" parameterType="IntegralRule" resultMap="IntegralRuleResult">
         <include refid="selectIntegralRuleVo"/>
-        <where>  
+        <where>
             <if test="stationId != null "> and station_id = #{stationId}</if>
             <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
             <if test="ruleType != null  and ruleType != ''"> and rule_type = #{ruleType}</if>
             <if test="termDateManage != null  and termDateManage != ''"> and term_date_manage = #{termDateManage}</if>
             <if test="emptyDate != null "> and empty_date = #{emptyDate}</if>
-            <if test="expirationReminder != null  and expirationReminder != ''"> and expiration_reminder = #{expirationReminder}</if>
-            <if test="remindDate != null "> and remind_date = #{remindDate}</if>
             <if test="integralActivity != null  and integralActivity != ''"> and integral_activity = #{integralActivity}</if>
             <if test="datePicker != null  and datePicker != ''"> and date_picker = #{datePicker}</if>
             <if test="integralProportion != null  and integralProportion != ''"> and integral_proportion = #{integralProportion}</if>
-            <if test="integralDeductionOil != null  and integralDeductionOil != ''"> and integral_deduction_oil = #{integralDeductionOil}</if>
             <if test="datePickerTime != null  and datePickerTime != ''"> and date_picker_time = #{datePickerTime}</if>
-            <if test="integralEmptyTime != null  and integralEmptyTime != ''"> and integral_empty_time = #{integralEmptyTime}</if>
             <if test="integralTermSetting != null  and integralTermSetting != ''"> and integral_term_setting = #{integralTermSetting}</if>
             <if test="stationIdList != null ">
                 and station_id in
@@ -60,12 +52,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by  id desc
     </select>
-    
+
     <select id="selectIntegralRuleById" parameterType="Long" resultMap="IntegralRuleResult">
         <include refid="selectIntegralRuleVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertIntegralRule" parameterType="IntegralRule" useGeneratedKeys="true" keyProperty="id">
         insert into integral_rule
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -74,14 +66,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ruleType != null">rule_type,</if>
             <if test="termDateManage != null">term_date_manage,</if>
             <if test="emptyDate != null">empty_date,</if>
-            <if test="expirationReminder != null">expiration_reminder,</if>
-            <if test="remindDate != null">remind_date,</if>
             <if test="integralActivity != null">integral_activity,</if>
             <if test="datePicker != null">date_picker,</if>
             <if test="integralProportion != null">integral_proportion,</if>
-            <if test="integralDeductionOil != null">integral_deduction_oil,</if>
             <if test="datePickerTime != null">date_picker_time,</if>
-            <if test="integralEmptyTime != null">integral_empty_time,</if>
             <if test="integralTermSetting != null">integral_term_setting,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -110,14 +98,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ruleType != null">rule_type = #{ruleType},</if>
             <if test="termDateManage != null">term_date_manage = #{termDateManage},</if>
             <if test="emptyDate != null">empty_date = #{emptyDate},</if>
-            <if test="expirationReminder != null">expiration_reminder = #{expirationReminder},</if>
-            <if test="remindDate != null">remind_date = #{remindDate},</if>
             <if test="integralActivity != null">integral_activity = #{integralActivity},</if>
             <if test="datePicker != null">date_picker = #{datePicker},</if>
             <if test="integralProportion != null">integral_proportion = #{integralProportion},</if>
-            <if test="integralDeductionOil != null">integral_deduction_oil = #{integralDeductionOil},</if>
             <if test="datePickerTime != null ">  date_picker_time = #{datePickerTime},</if>
-            <if test="integralEmptyTime != null  ">  integral_empty_time = #{integralEmptyTime},</if>
             <if test="integralTermSetting != null  ">  integral_term_setting = #{integralTermSetting},</if>
         </trim>
         where id = #{id}
@@ -128,7 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteIntegralRuleByIds" parameterType="String">
-        delete from integral_rule where id in 
+        delete from integral_rule where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
@@ -141,14 +125,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ruleType != null  and ruleType != ''"> and rule_type = #{ruleType}</if>
             <if test="termDateManage != null  and termDateManage != ''"> and term_date_manage = #{termDateManage}</if>
             <if test="emptyDate != null "> and empty_date = #{emptyDate}</if>
-            <if test="expirationReminder != null  and expirationReminder != ''"> and expiration_reminder = #{expirationReminder}</if>
-            <if test="remindDate != null "> and remind_date = #{remindDate}</if>
             <if test="integralActivity != null  and integralActivity != ''"> and integral_activity = #{integralActivity}</if>
             <if test="datePicker != null  and datePicker != ''"> and date_picker = #{datePicker}</if>
             <if test="integralProportion != null  and integralProportion != ''"> and integral_proportion = #{integralProportion}</if>
-            <if test="integralDeductionOil != null  and integralDeductionOil != ''"> and integral_deduction_oil = #{integralDeductionOil}</if>
             <if test="datePickerTime != null  and datePickerTime != ''"> and date_picker_time = #{datePickerTime}</if>
-            <if test="integralEmptyTime != null  and integralEmptyTime != ''"> and integral_empty_time = #{integralEmptyTime}</if>
             <if test="integralTermSetting != null  and integralTermSetting != ''"> and integral_term_setting = #{integralTermSetting}</if>
             <if test="stationIdList != null ">
                 and station_id in
@@ -179,4 +159,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
-</mapper>
+</mapper>