Преглед на файлове

修改积分规则设置,积分明细设置

zangguocen преди 4 години
родител
ревизия
979a9227cb

+ 0 - 6
yijia-integral/src/main/java/com/yijia/integral/controller/IntegralShopPicController.java

@@ -51,7 +51,6 @@ public class IntegralShopPicController extends BaseController
         List<String> list = sysDeptService.selectDeptId(dept);
         if(list!=null && list.size()>0){
             integralShopPic.setStationIdList(list);
-            integralShopPic.setStationId(null);
         }
         startPage();
         List<IntegralShopPic> piclist = integralShopPicService.selectIntegralShopPicList(integralShopPic);
@@ -72,7 +71,6 @@ public class IntegralShopPicController extends BaseController
         List<String> list = sysDeptService.selectDeptId(dept);
         if(list!=null && list.size()>0){
             integralShopPic.setStationIdList(list);
-            integralShopPic.setStationId(null);
         }
         List<IntegralShopPic> piclist = integralShopPicService.selectIntegralShopPicList(integralShopPic);
         ExcelUtil<IntegralShopPic> util = new ExcelUtil<IntegralShopPic>(IntegralShopPic.class);
@@ -98,8 +96,6 @@ public class IntegralShopPicController extends BaseController
     public AjaxResult add(@RequestBody IntegralShopPic integralShopPic)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
-        integralShopPic.setStationId(currentUser.getUser().getDeptId());
-        integralShopPic.setStationName(currentUser.getUser().getDept().getDeptName());
         return toAjax(integralShopPicService.insertIntegralShopPic(integralShopPic));
     }
 
@@ -112,8 +108,6 @@ public class IntegralShopPicController extends BaseController
     public AjaxResult edit(@RequestBody IntegralShopPic integralShopPic)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
-        integralShopPic.setStationId(currentUser.getUser().getDeptId());
-        integralShopPic.setStationName(currentUser.getUser().getDept().getDeptName());
         return toAjax(integralShopPicService.updateIntegralShopPic(integralShopPic));
     }
 

+ 35 - 19
yijia-integral/src/main/java/com/yijia/integral/controller/IntegralWaresController.java

@@ -1,5 +1,6 @@
 package com.yijia.integral.controller;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.yijia.common.core.domain.entity.SysDept;
@@ -9,14 +10,8 @@ import com.yijia.common.utils.SecurityUtils;
 import com.yijia.system.service.ISysDeptService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
 import com.yijia.common.annotation.Log;
 import com.yijia.common.core.controller.BaseController;
 import com.yijia.common.core.domain.AjaxResult;
@@ -27,7 +22,7 @@ import com.yijia.common.utils.poi.ExcelUtil;
 import com.yijia.common.core.page.TableDataInfo;
 
 /**
- * 【请填写功能名称】Controller
+ * 积分商品管理Controller
  *
  * @author yijia
  * @date 2021-03-01
@@ -41,7 +36,7 @@ public class IntegralWaresController extends BaseController
     @Autowired
     private ISysDeptService sysDeptService;
     /**
-     * 查询【请填写功能名称】列表
+     * 查询积分商品管理列表
      */
     @GetMapping("/list")
     public TableDataInfo list(IntegralWares integralWares)
@@ -54,15 +49,19 @@ public class IntegralWaresController extends BaseController
             integralWares.setStationIdList(list);
             integralWares.setStationId(null);
         }
+        List<String> wareslist =new ArrayList<>();
+        wareslist.add("1");
+        wareslist.add("2");
+        integralWares.setWaresStatusList(wareslist);
         startPage();
         List<IntegralWares> waresList = integralWaresService.selectIntegralWaresList(integralWares);
         return getDataTable(waresList);
     }
 
     /**
-     * 导出【请填写功能名称】列表
+     * 导出积分商品管理列表
      */
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
+    @Log(title = "积分商品管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(IntegralWares integralWares)
     {
@@ -74,13 +73,14 @@ public class IntegralWaresController extends BaseController
             integralWares.setStationIdList(list);
             integralWares.setStationId(null);
         }
+        integralWares.setWaresStatus("1");
         List<IntegralWares> waresList = integralWaresService.selectIntegralWaresList(integralWares);
         ExcelUtil<IntegralWares> util = new ExcelUtil<IntegralWares>(IntegralWares.class);
         return util.exportExcel(waresList, "wares");
     }
 
     /**
-     * 获取【请填写功能名称】详细信息
+     * 获取积分商品管理详细信息
      */
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id)
@@ -89,9 +89,9 @@ public class IntegralWaresController extends BaseController
     }
 
     /**
-     * 新增【请填写功能名称】
+     * 新增积分商品管理
      */
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @Log(title = "积分商品管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody IntegralWares integralWares)
     {
@@ -104,10 +104,11 @@ public class IntegralWaresController extends BaseController
     }
 
     /**
-     * 修改【请填写功能名称】
+     * 修改积分商品管理。默认删除再做新增
      */
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @Log(title = "积分商品管理", businessType = BusinessType.UPDATE)
     @PutMapping
+    @Transactional
     public AjaxResult edit(@RequestBody IntegralWares integralWares)
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
@@ -116,11 +117,26 @@ public class IntegralWaresController extends BaseController
         integralWares.setUpdateTime(DateUtils.getNowDate());
         return toAjax(integralWaresService.updateIntegralWares(integralWares));
     }
+    /**
+     * 修改积分商品管理
+     */
+    @Log(title = "积分商品管理", businessType = BusinessType.UPDATE)
+    @PostMapping(value ="/editInfoWares")
+    //@ResponseBody
+    public AjaxResult editInfoWares(@RequestBody IntegralWares integralWares)
+    {
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        integralWares.setStationId(currentUser.getUser().getDeptId());
+        integralWares.setUpdateBy(currentUser.getUser().getUserId().toString());
+        integralWares.setUpdateTime(DateUtils.getNowDate());
+        return toAjax(integralWaresService.editInfoWares(integralWares));
+    }
+
 
     /**
-     * 删除【请填写功能名称】
+     * 删除积分商品管理
      */
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @Log(title = "积分商品管理", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {

+ 65 - 0
yijia-integral/src/main/java/com/yijia/integral/domain/IntegralRule.java

@@ -68,6 +68,71 @@ public class IntegralRule extends BaseEntity
     private String oilType;
 
     private String  integralFlag;
+    private String  image1;
+    private String  image2;
+    private String  image3;
+    private String  image4;
+    private String  image5;
+    private String  gradeName;
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private String  integralEmptyTime;
+
+
+    public String getIntegralEmptyTime() {
+        return integralEmptyTime;
+    }
+
+    public void setIntegralEmptyTime(String integralEmptyTime) {
+        this.integralEmptyTime = integralEmptyTime;
+    }
+
+    public String getGradeName() {
+        return gradeName;
+    }
+
+    public void setGradeName(String gradeName) {
+        this.gradeName = gradeName;
+    }
+
+    public String getImage1() {
+        return image1;
+    }
+
+    public void setImage1(String image1) {
+        this.image1 = image1;
+    }
+
+    public String getImage2() {
+        return image2;
+    }
+
+    public void setImage2(String image2) {
+        this.image2 = image2;
+    }
+
+    public String getImage3() {
+        return image3;
+    }
+
+    public void setImage3(String image3) {
+        this.image3 = image3;
+    }
+
+    public String getImage4() {
+        return image4;
+    }
+
+    public void setImage4(String image4) {
+        this.image4 = image4;
+    }
+
+    public String getImage5() {
+        return image5;
+    }
+
+    public void setImage5(String image5) {
+        this.image5 = image5;
+    }
 
     public String getIntegralFlag() {
         return integralFlag;

+ 7 - 67
yijia-integral/src/main/java/com/yijia/integral/domain/IntegralShopPic.java

@@ -7,7 +7,7 @@ import com.yijia.common.core.domain.BaseEntity;
 
 /**
  * 积分商城图片信息对象 integral_shop_pic
- * 
+ *
  * @author yijia
  * @date 2021-03-18
  */
@@ -17,94 +17,38 @@ public class IntegralShopPic extends BaseEntity
 
     /** $column.columnComment */
     private Long id;
-
     /** 图片名称 */
-    @Excel(name = "图片名称")
     private String name;
-
     /** 图片地址 */
-    @Excel(name = "图片地址")
     private String url;
 
-    /** 图片状态:0,禁用;1,启用 */
-    @Excel(name = "图片状态:0,禁用;1,启用")
-    private String imgStatus;
-
-    /** 油站ID */
-    @Excel(name = "油站ID")
-    private Long stationId;
-
-    /** 油站名称 */
-    @Excel(name = "油站名称")
-    private String stationName;
-
-    /** 规则表主键id */
-    @Excel(name = "规则表主键id")
-    private Long parentId;
-
-    public void setId(Long id) 
+    public void setId(Long id)
     {
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setName(String name) 
+    public void setName(String name)
     {
         this.name = name;
     }
 
-    public String getName() 
+    public String getName()
     {
         return name;
     }
-    public void setUrl(String url) 
+    public void setUrl(String url)
     {
         this.url = url;
     }
 
-    public String getUrl() 
+    public String getUrl()
     {
         return url;
     }
-    public void setImgStatus(String imgStatus) 
-    {
-        this.imgStatus = imgStatus;
-    }
-
-    public String getImgStatus() 
-    {
-        return imgStatus;
-    }
-    public void setStationId(Long stationId) 
-    {
-        this.stationId = stationId;
-    }
-
-    public Long getStationId() 
-    {
-        return stationId;
-    }
-    public void setStationName(String stationName) 
-    {
-        this.stationName = stationName;
-    }
-
-    public String getStationName() 
-    {
-        return stationName;
-    }
-    public void setParentId(Long parentId) 
-    {
-        this.parentId = parentId;
-    }
-
-    public Long getParentId() 
-    {
-        return parentId;
-    }
 
     @Override
     public String toString() {
@@ -112,10 +56,6 @@ public class IntegralShopPic extends BaseEntity
             .append("id", getId())
             .append("name", getName())
             .append("url", getUrl())
-            .append("imgStatus", getImgStatus())
-            .append("stationId", getStationId())
-            .append("stationName", getStationName())
-            .append("parentId", getParentId())
             .toString();
     }
 }

+ 39 - 27
yijia-integral/src/main/java/com/yijia/integral/domain/IntegralWares.java

@@ -1,6 +1,8 @@
 package com.yijia.integral.domain;
 
 import java.math.BigDecimal;
+import java.util.List;
+
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.yijia.common.annotation.Excel;
@@ -8,7 +10,7 @@ import com.yijia.common.core.domain.BaseEntity;
 
 /**
  * 【请填写功能名称】对象 integral_wares
- * 
+ *
  * @author yijia
  * @date 2021-03-01
  */
@@ -67,120 +69,130 @@ public class IntegralWares extends BaseEntity
     @Excel(name = "油站名称")
     private String stationName;
 
-    public void setId(Long id) 
+    private List<String> waresStatusList;
+
+    public List<String> getWaresStatusList() {
+        return waresStatusList;
+    }
+
+    public void setWaresStatusList(List<String> waresStatusList) {
+        this.waresStatusList = waresStatusList;
+    }
+
+    public void setId(Long id)
     {
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setWaresType(String waresType) 
+    public void setWaresType(String waresType)
     {
         this.waresType = waresType;
     }
 
-    public String getWaresType() 
+    public String getWaresType()
     {
         return waresType;
     }
-    public void setWaresName(String waresName) 
+    public void setWaresName(String waresName)
     {
         this.waresName = waresName;
     }
 
-    public String getWaresName() 
+    public String getWaresName()
     {
         return waresName;
     }
-    public void setSaleIntegral(BigDecimal saleIntegral) 
+    public void setSaleIntegral(BigDecimal saleIntegral)
     {
         this.saleIntegral = saleIntegral;
     }
 
-    public BigDecimal getSaleIntegral() 
+    public BigDecimal getSaleIntegral()
     {
         return saleIntegral;
     }
-    public void setWaresPic(String waresPic) 
+    public void setWaresPic(String waresPic)
     {
         this.waresPic = waresPic;
     }
 
-    public String getWaresPic() 
+    public String getWaresPic()
     {
         return waresPic;
     }
-    public void setWaresDetail(String waresDetail) 
+    public void setWaresDetail(String waresDetail)
     {
         this.waresDetail = waresDetail;
     }
 
-    public String getWaresDetail() 
+    public String getWaresDetail()
     {
         return waresDetail;
     }
-    public void setWaresCount(Long waresCount) 
+    public void setWaresCount(Long waresCount)
     {
         this.waresCount = waresCount;
     }
 
-    public Long getWaresCount() 
+    public Long getWaresCount()
     {
         return waresCount;
     }
-    public void setWaresOutCount(Long waresOutCount) 
+    public void setWaresOutCount(Long waresOutCount)
     {
         this.waresOutCount = waresOutCount;
     }
 
-    public Long getWaresOutCount() 
+    public Long getWaresOutCount()
     {
         return waresOutCount;
     }
-    public void setWaresStatus(String waresStatus) 
+    public void setWaresStatus(String waresStatus)
     {
         this.waresStatus = waresStatus;
     }
 
-    public String getWaresStatus() 
+    public String getWaresStatus()
     {
         return waresStatus;
     }
-    public void setCreateName(String createName) 
+    public void setCreateName(String createName)
     {
         this.createName = createName;
     }
 
-    public String getCreateName() 
+    public String getCreateName()
     {
         return createName;
     }
-    public void setUpdateName(String updateName) 
+    public void setUpdateName(String updateName)
     {
         this.updateName = updateName;
     }
 
-    public String getUpdateName() 
+    public String getUpdateName()
     {
         return updateName;
     }
-    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;
     }

+ 31 - 22
yijia-integral/src/main/java/com/yijia/integral/service/IIntegralWaresService.java

@@ -5,57 +5,66 @@ import com.yijia.integral.domain.IntegralWares;
 
 /**
  * 【请填写功能名称】Service接口
- * 
+ *
  * @author yijia
  * @date 2021-03-01
  */
-public interface IIntegralWaresService 
+public interface IIntegralWaresService
 {
     /**
-     * 查询【请填写功能名称】
-     * 
-     * @param id 【请填写功能名称】ID
-     * @return 【请填写功能名称】
+     * 查询积分商品管理
+     *
+     * @param id 积分商品管理ID
+     * @return 积分商品管理
      */
     public IntegralWares selectIntegralWaresById(Long id);
 
     /**
-     * 查询【请填写功能名称】列表
-     * 
-     * @param integralWares 【请填写功能名称】
-     * @return 【请填写功能名称】集合
+     * 查询积分商品管理列表
+     *
+     * @param integralWares 积分商品管理
+     * @return 积分商品管理集合
      */
     public List<IntegralWares> selectIntegralWaresList(IntegralWares integralWares);
 
     /**
-     * 新增【请填写功能名称】
-     * 
-     * @param integralWares 【请填写功能名称】
+     * 新增积分商品管理
+     *
+     * @param integralWares 积分商品管理
      * @return 结果
      */
     public int insertIntegralWares(IntegralWares integralWares);
 
     /**
-     * 修改【请填写功能名称】
-     * 
-     * @param integralWares 【请填写功能名称】
+     * 修改积分商品管理。默认删除再做新增
+     *
+     * @param integralWares 积分商品管理
      * @return 结果
      */
     public int updateIntegralWares(IntegralWares integralWares);
 
     /**
-     * 批量删除【请填写功能名称】
-     * 
-     * @param ids 需要删除的【请填写功能名称】ID
+     * 修改积分商品管理
+     *
+     * @param integralWares 积分商品管理
+     * @return 结果
+     */
+    public int  editInfoWares(IntegralWares integralWares);
+    /**
+     * 批量删除积分商品管理
+     *
+     * @param ids 需要删除的积分商品管理ID
      * @return 结果
      */
     public int deleteIntegralWaresByIds(Long[] ids);
 
     /**
-     * 删除【请填写功能名称】信息
-     * 
-     * @param id 【请填写功能名称】ID
+     * 删除积分商品管理信息
+     *
+     * @param id 积分商品管理ID
      * @return 结果
      */
     public int deleteIntegralWaresById(Long id);
+
+
 }

+ 116 - 34
yijia-integral/src/main/java/com/yijia/integral/service/impl/IntegralRuleServiceImpl.java

@@ -6,9 +6,12 @@ import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.yijia.common.core.domain.entity.SysDictData;
 import com.yijia.common.core.domain.model.LoginUser;
 import com.yijia.common.utils.SecurityUtils;
+import com.yijia.customer.domain.CustomerCardSetting;
 import com.yijia.customer.domain.CustomerGradeSetting;
+import com.yijia.customer.mapper.CustomerCardSettingMapper;
 import com.yijia.customer.mapper.CustomerGradeSettingMapper;
 import com.yijia.integral.domain.IntegralRuleDetail;
 import com.yijia.integral.domain.IntegralShopPic;
@@ -16,6 +19,8 @@ import com.yijia.integral.mapper.IntegralRuleDetailMapper;
 import com.yijia.integral.mapper.IntegralShopPicMapper;
 import com.yijia.station.domain.StationOilPrice;
 import com.yijia.station.mapper.StationOilPriceMapper;
+import com.yijia.station.service.impl.StationOilPriceServiceImpl;
+import com.yijia.system.mapper.SysDictDataMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.yijia.integral.mapper.IntegralRuleMapper;
@@ -39,6 +44,8 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
     private IntegralShopPicMapper integralShopPicMapper;
     @Autowired
     private CustomerGradeSettingMapper customerGradeSettingMapper;
+    @Autowired
+    private SysDictDataMapper dictDataMapper;
     /**
      * 查询积分规则
      *
@@ -55,15 +62,38 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
         List<IntegralRuleDetail> list =  integralRuleDetailMapper.selectIntegralRuleDetailList(detail);
         integralRule.setItemsDetail(list);
         //查询图片信息
-        IntegralShopPic shopPic =new IntegralShopPic();
-        shopPic.setParentId(id);
-        List<IntegralShopPic>  shopPicList = integralShopPicMapper.selectIntegralShopPicList(shopPic);
-        if(shopPicList!=null && shopPicList.size()>0){
-            integralRule.setImgFileList(shopPicList);
-        }else{
-            shopPicList =new ArrayList<>();
-            integralRule.setImgFileList(shopPicList);
+        List<IntegralShopPic> shopPicList =new ArrayList<>();
+        if(integralRule!=null && integralRule.getImage1() !=null && !integralRule.getImage1().equals("")){
+            IntegralShopPic pic =new IntegralShopPic();
+            pic.setName("1");
+            pic.setUrl(integralRule.getImage1());
+            shopPicList.add(pic);
+        }
+        if(integralRule!=null && integralRule.getImage2() !=null && !integralRule.getImage2().equals("")){
+            IntegralShopPic pic =new IntegralShopPic();
+            pic.setName("2");
+            pic.setUrl(integralRule.getImage2());
+            shopPicList.add(pic);
+        }
+        if(integralRule!=null && integralRule.getImage3() !=null && !integralRule.getImage3().equals("")){
+            IntegralShopPic pic =new IntegralShopPic();
+            pic.setName("3");
+            pic.setUrl(integralRule.getImage3());
+            shopPicList.add(pic);
+        }
+        if(integralRule!=null && integralRule.getImage4() !=null && !integralRule.getImage4().equals("")){
+            IntegralShopPic pic =new IntegralShopPic();
+            pic.setName("4");
+            pic.setUrl(integralRule.getImage4());
+            shopPicList.add(pic);
+        }
+        if(integralRule!=null && integralRule.getImage5() !=null && !integralRule.getImage5().equals("")){
+            IntegralShopPic pic =new IntegralShopPic();
+            pic.setName("5");
+            pic.setUrl(integralRule.getImage5());
+            shopPicList.add(pic);
         }
+        integralRule.setImgFileList(shopPicList);
         return integralRule;
     }
 
@@ -97,27 +127,46 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
         if(integralRule.getDatePicker()==null){
             integralRule.setDatePicker("");
         }
+        if(integralRule.getImgFileList()!=null &&  integralRule.getImgFileList().size()>0){
+            List<IntegralShopPic> imgFileList =integralRule.getImgFileList();
+            for (int j=0;j<imgFileList.size();j++){
+                if(j==0){
+                    integralRule.setImage1(imgFileList.get(j).getUrl());
+                }else if(j==1){
+                    integralRule.setImage2(imgFileList.get(j).getUrl());
+                }else if(j==2){
+                    integralRule.setImage3(imgFileList.get(j).getUrl());
+                }else if(j==3){
+                    integralRule.setImage4(imgFileList.get(j).getUrl());
+                }else if(j==4){
+                    integralRule.setImage5(imgFileList.get(j).getUrl());
+                }
+            }
+        }
         int i =integralRuleMapper.insertIntegralRule(integralRule);
       //  IntegralRule rule=  integralRuleMapper.insertIntegralRule(integralRule);
         //判断规则明细
         if(integralRule.getItemsDetail()!=null &&  integralRule.getItemsDetail().size()>0){
             List<IntegralRuleDetail> list =integralRule.getItemsDetail();
             for (IntegralRuleDetail detail : list){
+                if(detail.getOilName()!=null && detail.getOilName()!=""){
+                    //查询当前油品对应的
+                    String dataValue= dictDataMapper.selectDictValue("oil_name",detail.getOilName());
+                    detail.setOilType(dataValue);
+                }else{
+                    i=0;
+                    return i;
+                }
                 if(detail.getSaleAmt()!=null  && detail.getIntegral()!=null && detail.getSaleAmt().compareTo(new BigDecimal("0"))==1){
                     detail.setParentId(integralRule.getId().longValue());
-                    integralRuleDetailMapper.insertIntegralRuleDetail(detail);
+                    i = integralRuleDetailMapper.insertIntegralRuleDetail(detail);
+                    if(i==0){
+                        return i;
+                    }
                 }
             }
         }
-        if(integralRule.getImgFileList()!=null &&  integralRule.getImgFileList().size()>0){
-            List<IntegralShopPic> imgFileList =integralRule.getImgFileList();
-            for (IntegralShopPic img : imgFileList){
-                img.setParentId(integralRule.getId().longValue());
-                img.setStationId(integralRule.getStationId());
-                img.setStationName(integralRule.getStationName());
-                integralShopPicMapper.insertIntegralShopPic(img);
-            }
-        }
+
         return i;
     }
 
@@ -138,22 +187,31 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
         if(integralRule.getItemsDetail()!=null &&  integralRule.getItemsDetail().size()>0){
             List<IntegralRuleDetail> list =integralRule.getItemsDetail();
             for (IntegralRuleDetail detail : list){
+                if(detail.getOilName()!=null && detail.getOilName()!=""){
+                    //查询当前油品对应的
+                    String dataValue= dictDataMapper.selectDictValue("oil_name",detail.getOilName());
+                    detail.setOilType(dataValue);
+                }
                 if(detail.getSaleAmt()!=null  && detail.getIntegral()!=null && detail.getSaleAmt().compareTo(new BigDecimal("0"))==1){
                     detail.setParentId(integralRule.getId().longValue());
                     integralRuleDetailMapper.insertIntegralRuleDetail(detail);
                 }
             }
         }
-        IntegralShopPic integralShopPic =new IntegralShopPic();
-        integralShopPic.setParentId(integralRule.getId().longValue());
-        integralShopPicMapper.deleteIntegralShopPic(integralShopPic);
         if(integralRule.getImgFileList()!=null &&  integralRule.getImgFileList().size()>0){
             List<IntegralShopPic> imgFileList =integralRule.getImgFileList();
-            for (IntegralShopPic img : imgFileList){
-                img.setParentId(integralRule.getId().longValue());
-                img.setStationId(integralRule.getStationId());
-                img.setStationName(integralRule.getStationName());
-                integralShopPicMapper.insertIntegralShopPic(img);
+            for (int j=0;j<imgFileList.size();j++){
+                if(j==0){
+                    integralRule.setImage1(imgFileList.get(j).getUrl());
+                }else if(j==1){
+                    integralRule.setImage2(imgFileList.get(j).getUrl());
+                }else if(j==2){
+                    integralRule.setImage3(imgFileList.get(j).getUrl());
+                }else if(j==3){
+                    integralRule.setImage4(imgFileList.get(j).getUrl());
+                }else if(j==4){
+                    integralRule.setImage5(imgFileList.get(j).getUrl());
+                }
             }
         }
         return  integralRuleMapper.updateIntegralRule(integralRule);
@@ -215,10 +273,38 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
             }
             rule.setItemsDetail(list);
             //查询图片信息
-            IntegralShopPic shopPic =new IntegralShopPic();
-            shopPic.setParentId(rule.getId());
-            List<IntegralShopPic> shopPicList = integralShopPicMapper.selectIntegralShopPicList(shopPic);
-            rule.setImgFileList(shopPicList);
+            List<IntegralShopPic> shopPicList =new ArrayList<>();
+            if(integralRule!=null && integralRule.getImage1() !=null && !integralRule.getImage1().equals("")){
+                IntegralShopPic pic =new IntegralShopPic();
+                pic.setName("1");
+                pic.setUrl(integralRule.getImage1());
+                shopPicList.add(pic);
+            }
+            if(integralRule!=null && integralRule.getImage2() !=null && !integralRule.getImage2().equals("")){
+                IntegralShopPic pic =new IntegralShopPic();
+                pic.setName("2");
+                pic.setUrl(integralRule.getImage2());
+                shopPicList.add(pic);
+            }
+            if(integralRule!=null && integralRule.getImage3() !=null && !integralRule.getImage3().equals("")){
+                IntegralShopPic pic =new IntegralShopPic();
+                pic.setName("3");
+                pic.setUrl(integralRule.getImage3());
+                shopPicList.add(pic);
+            }
+            if(integralRule!=null && integralRule.getImage4() !=null && !integralRule.getImage4().equals("")){
+                IntegralShopPic pic =new IntegralShopPic();
+                pic.setName("4");
+                pic.setUrl(integralRule.getImage4());
+                shopPicList.add(pic);
+            }
+            if(integralRule!=null && integralRule.getImage5() !=null && !integralRule.getImage5().equals("")){
+                IntegralShopPic pic =new IntegralShopPic();
+                pic.setName("5");
+                pic.setUrl(integralRule.getImage5());
+                shopPicList.add(pic);
+            }
+            integralRule.setImgFileList(shopPicList);
         }else{
             rule =new IntegralRule();
             rule.setIntegralFlag("0");
@@ -230,10 +316,6 @@ public class IntegralRuleServiceImpl implements IIntegralRuleService
             IntegralRuleDetail integralRuleDetail = new IntegralRuleDetail();
             list.add(integralRuleDetail);
             rule.setItemsDetail(list);
-            List<IntegralShopPic> shopPicList = new ArrayList<IntegralShopPic>();
-//            IntegralShopPic pic =new IntegralShopPic();
-//            shopPicList.add(pic);
-            rule.setImgFileList(shopPicList);
         }
         return rule;
     }

+ 51 - 24
yijia-integral/src/main/java/com/yijia/integral/service/impl/IntegralWaresServiceImpl.java

@@ -1,7 +1,10 @@
 package com.yijia.integral.service.impl;
 
 import java.util.List;
+
+import com.yijia.common.core.domain.model.LoginUser;
 import com.yijia.common.utils.DateUtils;
+import com.yijia.common.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.yijia.integral.mapper.IntegralWaresMapper;
@@ -9,22 +12,22 @@ import com.yijia.integral.domain.IntegralWares;
 import com.yijia.integral.service.IIntegralWaresService;
 
 /**
- * 【请填写功能名称】Service业务层处理
- * 
+ * 积分商品管理Service业务层处理
+ *
  * @author yijia
  * @date 2021-03-01
  */
 @Service
-public class IntegralWaresServiceImpl implements IIntegralWaresService 
+public class IntegralWaresServiceImpl implements IIntegralWaresService
 {
     @Autowired
     private IntegralWaresMapper integralWaresMapper;
 
     /**
-     * 查询【请填写功能名称】
-     * 
-     * @param id 【请填写功能名称】ID
-     * @return 【请填写功能名称】
+     * 查询积分商品管理
+     *
+     * @param id 积分商品管理ID
+     * @return 积分商品管理
      */
     @Override
     public IntegralWares selectIntegralWaresById(Long id)
@@ -33,10 +36,10 @@ public class IntegralWaresServiceImpl implements IIntegralWaresService
     }
 
     /**
-     * 查询【请填写功能名称】列表
-     * 
-     * @param integralWares 【请填写功能名称】
-     * @return 【请填写功能名称】
+     * 查询积分商品管理列表
+     *
+     * @param integralWares 积分商品管理
+     * @return 积分商品管理
      */
     @Override
     public List<IntegralWares> selectIntegralWaresList(IntegralWares integralWares)
@@ -45,9 +48,9 @@ public class IntegralWaresServiceImpl implements IIntegralWaresService
     }
 
     /**
-     * 新增【请填写功能名称】
-     * 
-     * @param integralWares 【请填写功能名称】
+     * 新增积分商品管理
+     *
+     * @param integralWares 积分商品管理
      * @return 结果
      */
     @Override
@@ -58,22 +61,46 @@ public class IntegralWaresServiceImpl implements IIntegralWaresService
     }
 
     /**
-     * 修改【请填写功能名称】
-     * 
-     * @param integralWares 【请填写功能名称】
+     * 修改积分商品管理,默认删除下架,再做新增
+     *
+     * @param integralWares 积分商品管理
      * @return 结果
      */
     @Override
     public int updateIntegralWares(IntegralWares integralWares)
     {
-        integralWares.setUpdateTime(DateUtils.getNowDate());
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        integralWares.setWaresStatus("3");
+        integralWaresMapper.updateIntegralWares(integralWares);
+        IntegralWares wares =new IntegralWares();
+        wares.setWaresStatus("1");
+        wares.setCreateTime(DateUtils.getNowDate());
+        wares.setCreateBy(currentUser.getUser().getUserId()+"");
+        wares.setStationId(integralWares.getStationId());
+        wares.setWaresName(integralWares.getWaresName());
+        wares.setSaleIntegral(integralWares.getSaleIntegral());
+        wares.setWaresPic(integralWares.getWaresPic());
+        wares.setWaresDetail(integralWares.getWaresDetail());
+        wares.setWaresCount(integralWares.getWaresCount());
+        wares.setWaresOutCount(integralWares.getWaresOutCount());
+        return integralWaresMapper.insertIntegralWares(wares);
+    }
+
+    /**
+     * 修改积分商品管理
+     *
+     * @param integralWares 积分商品管理
+     * @return 结果
+     */
+    @Override
+    public int editInfoWares(IntegralWares integralWares) {
         return integralWaresMapper.updateIntegralWares(integralWares);
     }
 
     /**
-     * 批量删除【请填写功能名称】
-     * 
-     * @param ids 需要删除的【请填写功能名称】ID
+     * 批量删除积分商品管理
+     *
+     * @param ids 需要删除的积分商品管理ID
      * @return 结果
      */
     @Override
@@ -83,9 +110,9 @@ public class IntegralWaresServiceImpl implements IIntegralWaresService
     }
 
     /**
-     * 删除【请填写功能名称】信息
-     * 
-     * @param id 【请填写功能名称】ID
+     * 删除积分商品管理信息
+     *
+     * @param id 积分商品管理ID
      * @return 结果
      */
     @Override

+ 9 - 10
yijia-integral/src/main/resources/mapper/integral/CustomerPointsMapper.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.CustomerPointsMapper">
-    
+
     <resultMap type="CustomerPoints" id="CustomerPointsResult">
         <result property="id"    column="id"    />
         <result property="unionId"    column="union_id"    />
@@ -26,19 +26,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCustomerPointsList" parameterType="CustomerPoints" resultMap="CustomerPointsResult">
         <include refid="selectCustomerPointsVo"/>
-        <where>  
+        <where>
             <if test="unionId != null  and unionId != ''"> and union_id = #{unionId}</if>
             <if test="blogOpenid != null  and blogOpenid != ''"> and blog_openid = #{blogOpenid}</if>
             <if test="minaOpenid != null  and minaOpenid != ''"> and mina_openid = #{minaOpenid}</if>
-            <if test="mobilePhone != null  and mobilePhone != ''"> and mobile_phone = #{mobilePhone}</if>
+            <if test="mobilePhone != null  and mobilePhone != ''"> and mobile_phone like concat('%', #{mobilePhone}, '%')</if>
              and points  != 0
             <if test="consumptionPoints != null"> and consumption_points = #{consumptionPoints}</if>
             <if test="accumulatePoints != null "> and accumulate_points = #{accumulatePoints}</if>
             <if test="invalidPoints != null "> and invalid_points = #{invalidPoints}</if>
             <if test="recentConsumptionDate != null "> and recent_consumption_date = #{recentConsumptionDate}</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
-            <if test="customerName != null and customerName != ''"> and customer_name = #{customerName}</if>
-            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
+            <if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
             <if test="stationIdList != null ">
                 and station_id in
                 <foreach item="item" index="index" collection="stationIdList"
@@ -49,12 +48,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by  recent_consumption_date desc
     </select>
-    
+
     <select id="selectCustomerPointsById" parameterType="Long" resultMap="CustomerPointsResult">
         <include refid="selectCustomerPointsVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertCustomerPoints" parameterType="CustomerPoints" useGeneratedKeys="true" keyProperty="id">
         insert into customer_points
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -108,10 +107,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteCustomerPointsByIds" parameterType="String">
-        delete from customer_points where id in 
+        delete from customer_points where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-    
-</mapper>
+
+</mapper>

+ 7 - 9
yijia-integral/src/main/resources/mapper/integral/CustomerPointsRecordMapper.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.CustomerPointsRecordMapper">
-    
+
     <resultMap type="CustomerPointsRecord" id="CustomerPointsRecordResult">
         <result property="id"    column="id"    />
         <result property="unionId"    column="union_id"    />
@@ -14,20 +14,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="stationId"    column="station_id"    />
         <result property="stationName"    column="station_name"    />
     </resultMap>
-
     <sql id="selectCustomerPointsRecordVo">
         select id, union_id, customer_name, record_type, integral, create_time, station_id, station_name from customer_points_record
     </sql>
 
     <select id="selectCustomerPointsRecordList" parameterType="CustomerPointsRecord" resultMap="CustomerPointsRecordResult">
         <include refid="selectCustomerPointsRecordVo"/>
-        <where>  
+        <where>
             <if test="unionId != null  and unionId != ''"> and union_id = #{unionId}</if>
             <if test="customerName != null  and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
             <if test="recordType != null  and recordType != ''"> and record_type = #{recordType}</if>
             <if test="integral != null "> and integral = #{integral}</if>
             <if test="stationId != null "> and station_id = #{stationId}</if>
-            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
             <if test="stationIdList != null ">
                 and station_id in
                 <foreach item="item" index="index" collection="stationIdList"
@@ -38,12 +36,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by  id desc
     </select>
-    
+
     <select id="selectCustomerPointsRecordById" parameterType="Long" resultMap="CustomerPointsRecordResult">
         <include refid="selectCustomerPointsRecordVo"/>
         where id = #{id}
     </select>
-        
+
     <insert id="insertCustomerPointsRecord" parameterType="CustomerPointsRecord" useGeneratedKeys="true" keyProperty="id">
         insert into customer_points_record
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -85,10 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteCustomerPointsRecordByIds" parameterType="String">
-        delete from customer_points_record where id in 
+        delete from customer_points_record where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>
     </delete>
-    
-</mapper>
+
+</mapper>

+ 4 - 1
yijia-integral/src/main/resources/mapper/integral/IntegralRuleDetailMapper.xml

@@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectIntegralRuleDetailVo">
-        select id, parent_id, rule_terms, grade, oil_name, sale_amt, integral, rule_type from integral_rule_detail
+        select id, parent_id, rule_terms, grade, oil_name, sale_amt, integral, rule_type,oil_type from integral_rule_detail
     </sql>
 
     <select id="selectIntegralRuleDetailList" parameterType="IntegralRuleDetail" resultMap="IntegralRuleDetailResult">
@@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="saleAmt != null">sale_amt,</if>
             <if test="integral != null">integral,</if>
             <if test="ruleType != null">rule_type,</if>
+            <if test="oilType != null">oil_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="parentId != null">#{parentId},</if>
@@ -57,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="saleAmt != null">#{saleAmt},</if>
             <if test="integral != null">#{integral},</if>
             <if test="ruleType != null">#{ruleType},</if>
+            <if test="oilType != null">#{oilType},</if>
          </trim>
     </insert>
 
@@ -70,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="saleAmt != null">sale_amt = #{saleAmt},</if>
             <if test="integral != null">integral = #{integral},</if>
             <if test="ruleType != null">rule_type = #{ruleType},</if>
+            <if test="oilType != null">oil_type = #{oilType},</if>
         </trim>
         where id = #{id}
     </update>

+ 23 - 12
yijia-integral/src/main/resources/mapper/integral/IntegralRuleMapper.xml

@@ -16,8 +16,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="integralProportion"    column="integral_proportion"    />
         <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="grade"    column="grade"    />
+        <result property="gradeName"    column="grade_name"    />
         <result property="oilName"    column="oil_name"    />
         <result property="saleAmt"    column="sale_amt"    />
         <result property="integral"    column="integral"    />
@@ -28,12 +30,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="integralFlag"    column="integral_flag"    />
+        <result property="image1"    column="image1"    />
+        <result property="image2"    column="image2"    />
+        <result property="image3"    column="image3"    />
+        <result property="image4"    column="image4"    />
+        <result property="image5"    column="image5"    />
     </resultMap>
 
     <sql id="selectIntegralRuleVo">
-       select id, station_id,d.dept_name as station_name, rule_type, term_date_manage, empty_date, integral_activity,
+       select id, station_id,d.dept_name as station_name, term_date_manage, empty_date, integral_activity,
         date_picker, integral_proportion,date_picker_time,integral_term_setting,r.create_by,r.create_time,
-        r.update_by,r.update_time,d.integral_flag
+        r.update_by,r.update_time,d.integral_flag,r.image1,r.image2,r.image3,r.image4,r.image5,r.integral_empty_time
         from integral_rule r join sys_dept d on r.station_id =d.dept_id
     </sql>
 
@@ -42,7 +49,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <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="integralActivity != null  and integralActivity != ''"> and integral_activity = #{integralActivity}</if>
@@ -71,7 +77,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="stationId != null">station_id,</if>
             <if test="stationName != null">station_name,</if>
-            <if test="ruleType != null">rule_type,</if>
             <if test="termDateManage != null">term_date_manage,</if>
             <if test="emptyDate != null">empty_date,</if>
             <if test="integralActivity != null">integral_activity,</if>
@@ -79,15 +84,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="integralProportion != null">integral_proportion,</if>
             <if test="datePickerTime != null">date_picker_time,</if>
             <if test="integralTermSetting != null">integral_term_setting,</if>
+            <if test="integralEmptyTime != null">integral_empty_time,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="image1 != null">image1,</if>
+            <if test="image2 != null">image2,</if>
+            <if test="image3 != null">image3,</if>
+            <if test="image4 != null">image4,</if>
+            <if test="image4 != null">image5,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="stationId != null">#{stationId},</if>
             <if test="stationName != null">#{stationName},</if>
-            <if test="ruleType != null">#{ruleType},</if>
             <if test="termDateManage != null">#{termDateManage},</if>
             <if test="emptyDate != null">#{emptyDate},</if>
             <if test="integralActivity != null">#{integralActivity},</if>
@@ -95,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="integralProportion != null">#{integralProportion},</if>
             <if test="datePickerTime != null">#{datePickerTime},</if>
             <if test="integralTermSetting != null">#{integralTermSetting},</if>
+            <if test="integralEmptyTime != null">#{integralEmptyTime},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -107,7 +118,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="stationId != null">station_id = #{stationId},</if>
             <if test="stationName != null">station_name = #{stationName},</if>
-            <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="integralActivity != null">integral_activity = #{integralActivity},</if>
@@ -115,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="integralProportion != null">integral_proportion = #{integralProportion},</if>
             <if test="datePickerTime != null ">  date_picker_time = #{datePickerTime},</if>
             <if test="integralTermSetting != null  ">  integral_term_setting = #{integralTermSetting},</if>
+            <if test="integralEmptyTime != null"> integral_empty_time=#{integralEmptyTime},</if>
             <if test="createBy != null  ">  create_by = #{createBy},</if>
             <if test="createTime != null  ">  create_time = #{createTime},</if>
             <if test="updateBy != null  ">  update_by = #{updateBy},</if>
@@ -138,7 +149,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <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="integralActivity != null  and integralActivity != ''"> and integral_activity = #{integralActivity}</if>
@@ -146,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="integralProportion != null  and integralProportion != ''"> and integral_proportion = #{integralProportion}</if>
             <if test="datePickerTime != null  and datePickerTime != ''"> and date_picker_time = #{datePickerTime}</if>
             <if test="integralTermSetting != null  and integralTermSetting != ''"> and integral_term_setting = #{integralTermSetting}</if>
+            <if test="integralEmptyTime != null  and integralEmptyTime != ''"> and integral_empty_time = #{integralEmptyTime}</if>
             <if test="stationIdList != null ">
                 and station_id in
                 <foreach item="item" index="index" collection="stationIdList"
@@ -158,16 +169,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="listRuleInfo" parameterType="IntegralRule" resultMap="IntegralRuleResult">
-        SELECT a.station_id,d.dept_name as station_name,a.term_date_manage,a.integral_activity,empty_date,date_picker,integral_proportion,
-        b.rule_type,rule_terms,grade,
-        oil_name,sale_amt,integral,oil_type,c.integral_flag
+        SELECT a.station_id,d.dept_name as station_name,a.term_date_manage,a.integral_activity,empty_date,date_picker,integral_proportion,s.grade as grade_name,
+        b.rule_type,rule_terms,b.grade,b.oil_name,b.sale_amt,b.integral,b.oil_type,c.integral_flag,a.integral_empty_time
         from integral_rule a
         join integral_rule_detail b on a.id =b.parent_id
         join station_pay c on a.station_id =c.station_id
         join sys_dept d on a.station_id =d.dept_id
+        left join customer_grade_setting s on s.id = b.grade
         <where>
             <if test="stationId != null "> and a.station_id = #{stationId}</if>
-            <if test="stationName != null  and stationName != ''"> and a.station_name like concat('%', #{stationName}, '%')</if>
+            <if test="stationName != null  and stationName != ''"> and d.dept_name like concat('%', #{stationName}, '%')</if>
             <if test="stationIdList != null ">
                 and a.station_id in
                 <foreach item="item" index="index" collection="stationIdList"
@@ -176,6 +187,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 </foreach>
             </if>
         </where>
+        order by  b.oil_name desc
     </select>
-
 </mapper>

+ 6 - 1
yijia-integral/src/main/resources/mapper/integral/IntegralWaresMapper.xml

@@ -40,7 +40,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="waresDetail != null  and waresDetail != ''"> and wares_detail = #{waresDetail}</if>
             <if test="waresCount != null "> and wares_count = #{waresCount}</if>
             <if test="waresOutCount != null "> and wares_out_count = #{waresOutCount}</if>
-            <if test="waresStatus != null  and waresStatus != ''"> and w.wares_status = #{waresStatus}</if>
+            <if test="waresStatusList != null ">
+                and wares_status in
+                <foreach item="item" index="index" collection="waresStatusList" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+             </if>
             <if test="stationId != null "> and w.station_id = #{stationId}</if>
             <if test="stationIdList != null ">
                 and station_id in