Explorar el Código

积分管理,修改全局下拉组织机构

MS-QJVSRANLTYEO\Administrator hace 4 años
padre
commit
523935213f

+ 19 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/CustomerPointsController.java

@@ -1,6 +1,9 @@
 package com.yijia.integral.controller;
 
 import java.util.List;
+
+import com.yijia.common.core.domain.entity.SysDept;
+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;
@@ -32,7 +35,8 @@ public class CustomerPointsController extends BaseController
 {
     @Autowired
     private ICustomerPointsService customerPointsService;
-
+    @Autowired
+    private ISysDeptService deptService;
     /**
      * 查询用户积分列表
      */
@@ -40,6 +44,13 @@ public class CustomerPointsController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(CustomerPoints customerPoints)
     {
+        if(customerPoints!=null &&customerPoints.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(customerPoints.getStationId());
+            List<String> list = deptService.selectDeptId(dept);
+            customerPoints.setStationIdList(list);
+            customerPoints.setStationId(null);
+        }
         startPage();
         List<CustomerPoints> list = customerPointsService.selectCustomerPointsList(customerPoints);
         return getDataTable(list);
@@ -53,6 +64,13 @@ public class CustomerPointsController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(CustomerPoints customerPoints)
     {
+        if(customerPoints!=null &&customerPoints.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(customerPoints.getStationId());
+            List<String> list = deptService.selectDeptId(dept);
+            customerPoints.setStationIdList(list);
+            customerPoints.setStationId(null);
+        }
         List<CustomerPoints> list = customerPointsService.selectCustomerPointsList(customerPoints);
         ExcelUtil<CustomerPoints> util = new ExcelUtil<CustomerPoints>(CustomerPoints.class);
         return util.exportExcel(list, "points");

+ 103 - 0
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/CustomerPointsRecordController.java

@@ -0,0 +1,103 @@
+package com.yijia.integral.controller;
+
+import java.util.List;
+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 com.yijia.common.annotation.Log;
+import com.yijia.common.core.controller.BaseController;
+import com.yijia.common.core.domain.AjaxResult;
+import com.yijia.common.enums.BusinessType;
+import com.yijia.integral.domain.CustomerPointsRecord;
+import com.yijia.integral.service.ICustomerPointsRecordService;
+import com.yijia.common.utils.poi.ExcelUtil;
+import com.yijia.common.core.page.TableDataInfo;
+
+/**
+ * 客户积分记录Controller
+ * 
+ * @author yijia
+ * @date 2021-03-17
+ */
+@RestController
+@RequestMapping("/integral/record")
+public class CustomerPointsRecordController extends BaseController
+{
+    @Autowired
+    private ICustomerPointsRecordService customerPointsRecordService;
+
+    /**
+     * 查询客户积分记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('integral:record:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CustomerPointsRecord customerPointsRecord)
+    {
+        startPage();
+        List<CustomerPointsRecord> list = customerPointsRecordService.selectCustomerPointsRecordList(customerPointsRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出客户积分记录列表
+     */
+    @PreAuthorize("@ss.hasPermi('integral:record:export')")
+    @Log(title = "客户积分记录", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(CustomerPointsRecord customerPointsRecord)
+    {
+        List<CustomerPointsRecord> list = customerPointsRecordService.selectCustomerPointsRecordList(customerPointsRecord);
+        ExcelUtil<CustomerPointsRecord> util = new ExcelUtil<CustomerPointsRecord>(CustomerPointsRecord.class);
+        return util.exportExcel(list, "record");
+    }
+
+    /**
+     * 获取客户积分记录详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('integral:record:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(customerPointsRecordService.selectCustomerPointsRecordById(id));
+    }
+
+    /**
+     * 新增客户积分记录
+     */
+    @PreAuthorize("@ss.hasPermi('integral:record:add')")
+    @Log(title = "客户积分记录", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CustomerPointsRecord customerPointsRecord)
+    {
+        return toAjax(customerPointsRecordService.insertCustomerPointsRecord(customerPointsRecord));
+    }
+
+    /**
+     * 修改客户积分记录
+     */
+    @PreAuthorize("@ss.hasPermi('integral:record:edit')")
+    @Log(title = "客户积分记录", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CustomerPointsRecord customerPointsRecord)
+    {
+        return toAjax(customerPointsRecordService.updateCustomerPointsRecord(customerPointsRecord));
+    }
+
+    /**
+     * 删除客户积分记录
+     */
+    @PreAuthorize("@ss.hasPermi('integral:record:remove')")
+    @Log(title = "客户积分记录", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(customerPointsRecordService.deleteCustomerPointsRecordByIds(ids));
+    }
+}

+ 19 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/IntegralOrderController.java

@@ -1,6 +1,9 @@
 package com.yijia.integral.controller;
 
 import java.util.List;
+
+import com.yijia.common.core.domain.entity.SysDept;
+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;
@@ -32,7 +35,8 @@ public class IntegralOrderController extends BaseController
 {
     @Autowired
     private IIntegralOrderService integralOrderService;
-
+    @Autowired
+    private ISysDeptService sysDeptService;
     /**
      * 查询积分消费订单列表
      */
@@ -40,6 +44,13 @@ public class IntegralOrderController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(IntegralOrder integralOrder)
     {
+        if(integralOrder!=null &&integralOrder.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralOrder.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralOrder.setStationIdList(list);
+            integralOrder.setStationId(null);
+        }
         startPage();
         List<IntegralOrder> list = integralOrderService.selectIntegralOrderList(integralOrder);
         return getDataTable(list);
@@ -53,6 +64,13 @@ public class IntegralOrderController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(IntegralOrder integralOrder)
     {
+        if(integralOrder!=null &&integralOrder.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralOrder.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralOrder.setStationIdList(list);
+            integralOrder.setStationId(null);
+        }
         List<IntegralOrder> list = integralOrderService.selectIntegralOrderList(integralOrder);
         ExcelUtil<IntegralOrder> util = new ExcelUtil<IntegralOrder>(IntegralOrder.class);
         return util.exportExcel(list, "order");

+ 19 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/IntegralRuleController.java

@@ -1,6 +1,9 @@
 package com.yijia.integral.controller;
 
 import java.util.List;
+
+import com.yijia.common.core.domain.entity.SysDept;
+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;
@@ -32,7 +35,8 @@ public class IntegralRuleController extends BaseController
 {
     @Autowired
     private IIntegralRuleService integralRuleService;
-
+    @Autowired
+    private ISysDeptService sysDeptService;
     /**
      * 查询【请填写功能名称】列表
      */
@@ -40,6 +44,13 @@ public class IntegralRuleController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(IntegralRule integralRule)
     {
+        if(integralRule!=null &&integralRule.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralRule.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralRule.setStationIdList(list);
+            integralRule.setStationId(null);
+        }
         startPage();
         List<IntegralRule> list = integralRuleService.selectIntegralRuleList(integralRule);
         return getDataTable(list);
@@ -53,6 +64,13 @@ public class IntegralRuleController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(IntegralRule integralRule)
     {
+        if(integralRule!=null &&integralRule.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralRule.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralRule.setStationIdList(list);
+            integralRule.setStationId(null);
+        }
         List<IntegralRule> list = integralRuleService.selectIntegralRuleList(integralRule);
         ExcelUtil<IntegralRule> util = new ExcelUtil<IntegralRule>(IntegralRule.class);
         return util.exportExcel(list, "rule");

+ 19 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/IntegralShopPicController.java

@@ -1,6 +1,9 @@
 package com.yijia.integral.controller;
 
 import java.util.List;
+
+import com.yijia.common.core.domain.entity.SysDept;
+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;
@@ -32,7 +35,8 @@ public class IntegralShopPicController extends BaseController
 {
     @Autowired
     private IIntegralShopPicService integralShopPicService;
-
+    @Autowired
+    private ISysDeptService sysDeptService;
     /**
      * 查询积分商城图片信息列表
      */
@@ -40,6 +44,13 @@ public class IntegralShopPicController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(IntegralShopPic integralShopPic)
     {
+        if(integralShopPic!=null &&integralShopPic.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralShopPic.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralShopPic.setStationIdList(list);
+            integralShopPic.setStationId(null);
+        }
         startPage();
         List<IntegralShopPic> list = integralShopPicService.selectIntegralShopPicList(integralShopPic);
         return getDataTable(list);
@@ -53,6 +64,13 @@ public class IntegralShopPicController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(IntegralShopPic integralShopPic)
     {
+        if(integralShopPic!=null &&integralShopPic.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralShopPic.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralShopPic.setStationIdList(list);
+            integralShopPic.setStationId(null);
+        }
         List<IntegralShopPic> list = integralShopPicService.selectIntegralShopPicList(integralShopPic);
         ExcelUtil<IntegralShopPic> util = new ExcelUtil<IntegralShopPic>(IntegralShopPic.class);
         return util.exportExcel(list, "pic");

+ 18 - 1
Yijia-SaaS/yijia-integral/src/main/java/com/yijia/integral/controller/IntegralWaresController.java

@@ -2,8 +2,10 @@ package com.yijia.integral.controller;
 
 import java.util.List;
 
+import com.yijia.common.core.domain.entity.SysDept;
 import com.yijia.common.core.domain.model.LoginUser;
 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;
@@ -35,7 +37,8 @@ public class IntegralWaresController extends BaseController
 {
     @Autowired
     private IIntegralWaresService integralWaresService;
-
+    @Autowired
+    private ISysDeptService sysDeptService;
     /**
      * 查询【请填写功能名称】列表
      */
@@ -43,6 +46,13 @@ public class IntegralWaresController extends BaseController
     @GetMapping("/list")
     public TableDataInfo list(IntegralWares integralWares)
     {
+        if(integralWares!=null &&integralWares.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralWares.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralWares.setStationIdList(list);
+            integralWares.setStationId(null);
+        }
         startPage();
         List<IntegralWares> list = integralWaresService.selectIntegralWaresList(integralWares);
         return getDataTable(list);
@@ -56,6 +66,13 @@ public class IntegralWaresController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(IntegralWares integralWares)
     {
+        if(integralWares!=null &&integralWares.getStationId()!=null){
+            SysDept dept =new SysDept();
+            dept.setDeptId(integralWares.getStationId());
+            List<String> list = sysDeptService.selectDeptId(dept);
+            integralWares.setStationIdList(list);
+            integralWares.setStationId(null);
+        }
         List<IntegralWares> list = integralWaresService.selectIntegralWaresList(integralWares);
         ExcelUtil<IntegralWares> util = new ExcelUtil<IntegralWares>(IntegralWares.class);
         return util.exportExcel(list, "wares");

+ 8 - 0
Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/CustomerPointsMapper.xml

@@ -37,7 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="recentConsumptionDate != null "> and recent_consumption_date = #{recentConsumptionDate}</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"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
+        order by  id desc
     </select>
     
     <select id="selectCustomerPointsById" parameterType="Long" resultMap="CustomerPointsResult">

+ 8 - 0
Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/IntegralOrderMapper.xml

@@ -39,7 +39,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
+        order by  id desc
     </select>
     
     <select id="selectIntegralOrderById" parameterType="Long" resultMap="IntegralOrderResult">

+ 8 - 0
Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/IntegralRuleMapper.xml

@@ -37,7 +37,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <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="stationIdList != null ">
+                and station_id in
+                <foreach item="item" index="index" collection="stationIdList"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
+        order by  id desc
     </select>
     
     <select id="selectIntegralRuleById" parameterType="Long" resultMap="IntegralRuleResult">

+ 8 - 0
Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/IntegralShopPicMapper.xml

@@ -27,7 +27,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="stationId != null "> and station_id = #{stationId}</if>
             <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
             <if test="parentId != null "> and parent_id = #{parentId}</if>
+            <if test="stationIdList != null ">
+                and station_id in
+                <foreach item="item" index="index" collection="stationIdList"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
+        order by  id desc
     </select>
     
     <select id="selectIntegralShopPicById" parameterType="Long" resultMap="IntegralShopPicResult">

+ 8 - 0
Yijia-SaaS/yijia-integral/src/main/resources/mapper/integral/IntegralWaresMapper.xml

@@ -43,7 +43,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateName != null  and updateName != ''"> and update_name like concat('%', #{updateName}, '%')</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"
+                         open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
+        order by  id desc
     </select>
     
     <select id="selectIntegralWaresById" parameterType="Long" resultMap="IntegralWaresResult">