Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	songhua-admin/src/main/java/com/songhua/web/controller/system/PzTicketTypeManagementController.java
#	songhua-system/src/main/java/com/songhua/system/mapper/PzTicketTypeManagementMapper.java
#	songhua-system/src/main/java/com/songhua/system/service/IPzTicketTypeManagementService.java
#	songhua-system/src/main/java/com/songhua/system/service/impl/PzTicketTypeManagementServiceImpl.java
#	songhua-ui/src/api/system/ticket.js
lchao 7 months ago
parent
commit
c5a8105659
18 changed files with 1103 additions and 64 deletions
  1. 20 18
      songhua-admin/src/main/java/com/songhua/web/controller/system/PzTicketTypeManagementController.java
  2. 84 0
      songhua-admin/src/main/java/com/songhua/web/controller/system/ShhTicketRulesController.java
  3. 97 0
      songhua-system/src/main/java/com/songhua/system/domain/ShhTicketRules.java
  4. 66 0
      songhua-system/src/main/java/com/songhua/system/domain/ShhTicketRulesData.java
  5. 10 9
      songhua-system/src/main/java/com/songhua/system/mapper/PzTicketTypeManagementMapper.java
  6. 69 0
      songhua-system/src/main/java/com/songhua/system/mapper/ShhTicketRulesDataMapper.java
  7. 61 0
      songhua-system/src/main/java/com/songhua/system/mapper/ShhTicketRulesMapper.java
  8. 10 9
      songhua-system/src/main/java/com/songhua/system/service/IPzTicketTypeManagementService.java
  9. 61 0
      songhua-system/src/main/java/com/songhua/system/service/IShhTicketRulesService.java
  10. 19 21
      songhua-system/src/main/java/com/songhua/system/service/impl/PzTicketTypeManagementServiceImpl.java
  11. 125 0
      songhua-system/src/main/java/com/songhua/system/service/impl/ShhTicketRulesServiceImpl.java
  12. 6 5
      songhua-system/src/main/resources/mapper/system/PzTicketTypeManagementMapper.xml
  13. 76 0
      songhua-system/src/main/resources/mapper/system/ShhTicketRulesDataMapper.xml
  14. 70 0
      songhua-system/src/main/resources/mapper/system/ShhTicketRulesMapper.xml
  15. 10 1
      songhua-ui/src/api/system/ticket.js
  16. 44 0
      songhua-ui/src/api/system/ticketRules.js
  17. 1 1
      songhua-ui/src/views/system/ships/index.vue
  18. 274 0
      songhua-ui/src/views/system/ticketRules/index.vue

+ 20 - 18
songhua-admin/src/main/java/com/songhua/web/controller/system/PzTicketTypeManagementController.java

@@ -1,27 +1,19 @@
-package com.songhua.system.controller;
+package com.songhua.web.controller.system;
 
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
-import com.songhua.common.core.domain.entity.SysUser;
-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.songhua.common.annotation.Log;
 import com.songhua.common.core.controller.BaseController;
 import com.songhua.common.core.domain.AjaxResult;
+import com.songhua.common.core.page.TableDataInfo;
 import com.songhua.common.enums.BusinessType;
+import com.songhua.common.utils.poi.ExcelUtil;
 import com.songhua.system.domain.PzTicketTypeManagement;
 import com.songhua.system.service.IPzTicketTypeManagementService;
-import com.songhua.common.utils.poi.ExcelUtil;
-import com.songhua.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
 
 /**
  * 票种管理Controller
@@ -36,7 +28,7 @@ public class PzTicketTypeManagementController extends BaseController {
     private IPzTicketTypeManagementService pzTicketTypeManagementService;
 
     /**
-     * 查询票种管理列表
+     * 查询票种管理分页列表
      */
     @PreAuthorize("@ss.hasPermi('system:management:list')")
     @GetMapping("/list")
@@ -98,6 +90,16 @@ public class PzTicketTypeManagementController extends BaseController {
     }
 
     /**
+     * 查询票种管理列表
+     */
+    @GetMapping("/ticketAllList")
+    public AjaxResult ticketAllList() {
+        PzTicketTypeManagement pzTicketTypeManagement = new PzTicketTypeManagement();
+        return success(pzTicketTypeManagementService.selectPzTicketTypeManagementList(pzTicketTypeManagement));
+    }
+
+
+    /**
      * 状态修改
      */
     @PutMapping("/changeStatus")

+ 84 - 0
songhua-admin/src/main/java/com/songhua/web/controller/system/ShhTicketRulesController.java

@@ -0,0 +1,84 @@
+package com.songhua.web.controller.system;
+
+import com.songhua.common.annotation.Log;
+import com.songhua.common.core.controller.BaseController;
+import com.songhua.common.core.domain.AjaxResult;
+import com.songhua.common.core.page.TableDataInfo;
+import com.songhua.common.enums.BusinessType;
+import com.songhua.common.utils.poi.ExcelUtil;
+import com.songhua.system.domain.ShhTicketRules;
+import com.songhua.system.service.IShhTicketRulesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * 票种规则Controller
+ *
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+@RestController
+@RequestMapping("/ticket/rules")
+public class ShhTicketRulesController extends BaseController {
+    @Autowired
+    private IShhTicketRulesService shhTicketRulesService;
+
+    /**
+     * 查询票种规则列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(ShhTicketRules shhTicketRules) {
+        startPage();
+        List<ShhTicketRules> list = shhTicketRulesService.selectShhTicketRulesList(shhTicketRules);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出票种规则列表
+     */
+    @Log(title = "票种规则", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, ShhTicketRules shhTicketRules) {
+        List<ShhTicketRules> list = shhTicketRulesService.selectShhTicketRulesList(shhTicketRules);
+        ExcelUtil<ShhTicketRules> util = new ExcelUtil<ShhTicketRules>(ShhTicketRules.class);
+        util.exportExcel(response, list, "票种规则数据");
+    }
+
+    /**
+     * 获取票种规则详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(shhTicketRulesService.selectShhTicketRulesById(id));
+    }
+
+    /**
+     * 新增票种规则
+     */
+    @Log(title = "票种规则", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody ShhTicketRules shhTicketRules) {
+        return toAjax(shhTicketRulesService.insertShhTicketRules(shhTicketRules));
+    }
+
+    /**
+     * 修改票种规则
+     */
+    @Log(title = "票种规则", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody ShhTicketRules shhTicketRules) {
+        return toAjax(shhTicketRulesService.updateShhTicketRules(shhTicketRules));
+    }
+
+    /**
+     * 删除票种规则
+     */
+    @Log(title = "票种规则", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(shhTicketRulesService.deleteShhTicketRulesByIds(ids));
+    }
+}

+ 97 - 0
songhua-system/src/main/java/com/songhua/system/domain/ShhTicketRules.java

@@ -0,0 +1,97 @@
+package com.songhua.system.domain;
+
+import com.songhua.common.annotation.Excel;
+import com.songhua.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 票种规则对象 shh_ticket_rules
+ *
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+
+public class ShhTicketRules extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 票务规则名称
+     */
+    @Excel(name = "票务规则名称")
+    private String ticketRules;
+
+    /**
+     * 票种id
+     */
+    private String ticketId;
+
+    /**
+     * 票种
+     */
+    private String ticketName;
+
+    /**
+     * 票种集合
+     */
+    private List<Long> ticketList;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setTicketRules(String ticketRules) {
+        this.ticketRules = ticketRules;
+    }
+
+    public String getTicketRules() {
+        return ticketRules;
+    }
+
+    public void setTicketName(String ticketName) {
+        this.ticketName = ticketName;
+    }
+
+    public String getTicketName() {
+        return ticketName;
+    }
+
+    public void setTicketId(String ticketId) {
+        this.ticketId = ticketId;
+    }
+
+    public String getTicketId() {
+        return ticketId;
+    }
+
+    public void setTicketList(List<Long> ticketList) {
+        this.ticketList = ticketList;
+    }
+
+    public List<Long> getTicketList() {
+        return ticketList;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("ticketRules", getTicketRules())
+                .append("ticketId", getTicketId())
+                .append("ticketName", getTicketName())
+                .append("ticketList", getTicketList())
+                .toString();
+    }
+}

+ 66 - 0
songhua-system/src/main/java/com/songhua/system/domain/ShhTicketRulesData.java

@@ -0,0 +1,66 @@
+package com.songhua.system.domain;
+
+import com.songhua.common.annotation.Excel;
+import com.songhua.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 票种规则子对象 shh_ticket_rules_data
+ *
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public class ShhTicketRulesData extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键id
+     */
+    private Long id;
+
+    /**
+     * 票务规则id
+     */
+    @Excel(name = "票务规则id")
+    private Long rulesId;
+
+    /**
+     * 票种id
+     */
+    @Excel(name = "票种id")
+    private Long ticketId;
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setRulesId(Long rulesId) {
+        this.rulesId = rulesId;
+    }
+
+    public Long getRulesId() {
+        return rulesId;
+    }
+
+    public void setTicketId(Long ticketId) {
+        this.ticketId = ticketId;
+    }
+
+    public Long getTicketId() {
+        return ticketId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("rulesId", getRulesId())
+                .append("ticketId", getTicketId())
+                .toString();
+    }
+}

+ 10 - 9
songhua-system/src/main/java/com/songhua/system/mapper/PzTicketTypeManagementMapper.java

@@ -5,17 +5,18 @@ import java.util.List;
 import com.songhua.common.core.domain.entity.SysUser;
 import com.songhua.system.domain.PzTicketTypeManagement;
 
+import java.util.List;
+
 /**
  * 票种管理Mapper接口
- * 
+ *
  * @author ruoyi
  * @date 2024-11-04
  */
-public interface PzTicketTypeManagementMapper 
-{
+public interface PzTicketTypeManagementMapper {
     /**
      * 查询票种管理
-     * 
+     *
      * @param id 票种管理主键
      * @return 票种管理
      */
@@ -23,7 +24,7 @@ public interface PzTicketTypeManagementMapper
 
     /**
      * 查询票种管理列表
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 票种管理集合
      */
@@ -31,7 +32,7 @@ public interface PzTicketTypeManagementMapper
 
     /**
      * 新增票种管理
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 结果
      */
@@ -39,7 +40,7 @@ public interface PzTicketTypeManagementMapper
 
     /**
      * 修改票种管理
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 结果
      */
@@ -47,7 +48,7 @@ public interface PzTicketTypeManagementMapper
 
     /**
      * 删除票种管理
-     * 
+     *
      * @param id 票种管理主键
      * @return 结果
      */
@@ -55,7 +56,7 @@ public interface PzTicketTypeManagementMapper
 
     /**
      * 批量删除票种管理
-     * 
+     *
      * @param ids 需要删除的数据主键集合
      * @return 结果
      */

+ 69 - 0
songhua-system/src/main/java/com/songhua/system/mapper/ShhTicketRulesDataMapper.java

@@ -0,0 +1,69 @@
+package com.songhua.system.mapper;
+
+import com.songhua.system.domain.ShhTicketRules;
+import com.songhua.system.domain.ShhTicketRulesData;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 票种规则子Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public interface ShhTicketRulesDataMapper {
+    /**
+     * 查询票种规则子
+     *
+     * @param id 票种规则子主键
+     * @return 票种规则子
+     */
+    public ShhTicketRulesData selectShhTicketRulesDataById(Long id);
+
+    /**
+     * 查询票种规则子列表
+     *
+     * @param shhTicketRulesData 票种规则子
+     * @return 票种规则子集合
+     */
+    public List<ShhTicketRulesData> selectShhTicketRulesDataList(ShhTicketRulesData shhTicketRulesData);
+
+    /**
+     * 新增票种规则子
+     *
+     * @param shhTicketRulesData 票种规则子
+     * @return 结果
+     */
+    public int insertShhTicketRulesData(ShhTicketRulesData shhTicketRulesData);
+
+    /**
+     * 修改票种规则子
+     *
+     * @param shhTicketRulesData 票种规则子
+     * @return 结果
+     */
+    public int updateShhTicketRulesData(ShhTicketRulesData shhTicketRulesData);
+
+    /**
+     * 删除票种规则子
+     *
+     * @param id 票种规则子主键
+     * @return 结果
+     */
+    public int deleteShhTicketRulesDataById(Long id);
+
+    /**
+     * 批量删除票种规则子
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteShhTicketRulesDataByIds(Long[] ids);
+
+    void insertTicketRulesDataBatch(List<ShhTicketRulesData> list);
+
+
+    public int deleteShhTicketRulesDataByRulesId(@Param("rulesId") Long rulesId);
+
+}

+ 61 - 0
songhua-system/src/main/java/com/songhua/system/mapper/ShhTicketRulesMapper.java

@@ -0,0 +1,61 @@
+package com.songhua.system.mapper;
+
+import com.songhua.system.domain.ShhTicketRules;
+
+import java.util.List;
+
+/**
+ * 票种规则Mapper接口
+ *
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public interface ShhTicketRulesMapper {
+    /**
+     * 查询票种规则
+     *
+     * @param id 票种规则主键
+     * @return 票种规则
+     */
+    public ShhTicketRules selectShhTicketRulesById(Long id);
+
+    /**
+     * 查询票种规则列表
+     *
+     * @param shhTicketRules 票种规则
+     * @return 票种规则集合
+     */
+    public List<ShhTicketRules> selectShhTicketRulesList(ShhTicketRules shhTicketRules);
+
+    /**
+     * 新增票种规则
+     *
+     * @param shhTicketRules 票种规则
+     * @return 结果
+     */
+    public int insertShhTicketRules(ShhTicketRules shhTicketRules);
+
+    /**
+     * 修改票种规则
+     *
+     * @param shhTicketRules 票种规则
+     * @return 结果
+     */
+    public int updateShhTicketRules(ShhTicketRules shhTicketRules);
+
+    /**
+     * 删除票种规则
+     *
+     * @param id 票种规则主键
+     * @return 结果
+     */
+    public int deleteShhTicketRulesById(Long id);
+
+    /**
+     * 批量删除票种规则
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteShhTicketRulesByIds(Long[] ids);
+}

+ 10 - 9
songhua-system/src/main/java/com/songhua/system/service/IPzTicketTypeManagementService.java

@@ -5,17 +5,18 @@ import java.util.List;
 import com.songhua.common.core.domain.entity.SysUser;
 import com.songhua.system.domain.PzTicketTypeManagement;
 
+import java.util.List;
+
 /**
  * 票种管理Service接口
- * 
+ *
  * @author ruoyi
  * @date 2024-11-04
  */
-public interface IPzTicketTypeManagementService 
-{
+public interface IPzTicketTypeManagementService {
     /**
      * 查询票种管理
-     * 
+     *
      * @param id 票种管理主键
      * @return 票种管理
      */
@@ -23,7 +24,7 @@ public interface IPzTicketTypeManagementService
 
     /**
      * 查询票种管理列表
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 票种管理集合
      */
@@ -31,7 +32,7 @@ public interface IPzTicketTypeManagementService
 
     /**
      * 新增票种管理
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 结果
      */
@@ -39,7 +40,7 @@ public interface IPzTicketTypeManagementService
 
     /**
      * 修改票种管理
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 结果
      */
@@ -47,7 +48,7 @@ public interface IPzTicketTypeManagementService
 
     /**
      * 批量删除票种管理
-     * 
+     *
      * @param ids 需要删除的票种管理主键集合
      * @return 结果
      */
@@ -55,7 +56,7 @@ public interface IPzTicketTypeManagementService
 
     /**
      * 删除票种管理信息
-     * 
+     *
      * @param id 票种管理主键
      * @return 结果
      */

+ 61 - 0
songhua-system/src/main/java/com/songhua/system/service/IShhTicketRulesService.java

@@ -0,0 +1,61 @@
+package com.songhua.system.service;
+
+import com.songhua.system.domain.ShhTicketRules;
+
+import java.util.List;
+
+/**
+ * 票种规则Service接口
+ *
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public interface IShhTicketRulesService {
+    /**
+     * 查询票种规则
+     *
+     * @param id 票种规则主键
+     * @return 票种规则
+     */
+    public ShhTicketRules selectShhTicketRulesById(Long id);
+
+    /**
+     * 查询票种规则列表
+     *
+     * @param shhTicketRules 票种规则
+     * @return 票种规则集合
+     */
+    public List<ShhTicketRules> selectShhTicketRulesList(ShhTicketRules shhTicketRules);
+
+    /**
+     * 新增票种规则
+     *
+     * @param shhTicketRules 票种规则
+     * @return 结果
+     */
+    public int insertShhTicketRules(ShhTicketRules shhTicketRules);
+
+    /**
+     * 修改票种规则
+     *
+     * @param shhTicketRules 票种规则
+     * @return 结果
+     */
+    public int updateShhTicketRules(ShhTicketRules shhTicketRules);
+
+    /**
+     * 批量删除票种规则
+     *
+     * @param ids 需要删除的票种规则主键集合
+     * @return 结果
+     */
+    public int deleteShhTicketRulesByIds(Long[] ids);
+
+    /**
+     * 删除票种规则信息
+     *
+     * @param id 票种规则主键
+     * @return 结果
+     */
+    public int deleteShhTicketRulesById(Long id);
+}

+ 19 - 21
songhua-system/src/main/java/com/songhua/system/service/impl/PzTicketTypeManagementServiceImpl.java

@@ -7,89 +7,87 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.songhua.system.mapper.PzTicketTypeManagementMapper;
 import com.songhua.system.domain.PzTicketTypeManagement;
+import com.songhua.system.mapper.PzTicketTypeManagementMapper;
 import com.songhua.system.service.IPzTicketTypeManagementService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 票种管理Service业务层处理
- * 
+ *
  * @author ruoyi
  * @date 2024-11-04
  */
 @Service
-public class PzTicketTypeManagementServiceImpl implements IPzTicketTypeManagementService 
-{
+public class PzTicketTypeManagementServiceImpl implements IPzTicketTypeManagementService {
     @Autowired
     private PzTicketTypeManagementMapper pzTicketTypeManagementMapper;
 
     /**
      * 查询票种管理
-     * 
+     *
      * @param id 票种管理主键
      * @return 票种管理
      */
     @Override
-    public PzTicketTypeManagement selectPzTicketTypeManagementById(Long id)
-    {
+    public PzTicketTypeManagement selectPzTicketTypeManagementById(Long id) {
         return pzTicketTypeManagementMapper.selectPzTicketTypeManagementById(id);
     }
 
     /**
      * 查询票种管理列表
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 票种管理
      */
     @Override
-    public List<PzTicketTypeManagement> selectPzTicketTypeManagementList(PzTicketTypeManagement pzTicketTypeManagement)
-    {
+    public List<PzTicketTypeManagement> selectPzTicketTypeManagementList(PzTicketTypeManagement pzTicketTypeManagement) {
         return pzTicketTypeManagementMapper.selectPzTicketTypeManagementList(pzTicketTypeManagement);
     }
 
     /**
      * 新增票种管理
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 结果
      */
     @Override
-    public int insertPzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement)
-    {
+    public int insertPzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement) {
         return pzTicketTypeManagementMapper.insertPzTicketTypeManagement(pzTicketTypeManagement);
     }
 
     /**
      * 修改票种管理
-     * 
+     *
      * @param pzTicketTypeManagement 票种管理
      * @return 结果
      */
     @Override
-    public int updatePzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement)
-    {
+    public int updatePzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement) {
         return pzTicketTypeManagementMapper.updatePzTicketTypeManagement(pzTicketTypeManagement);
     }
 
     /**
      * 批量删除票种管理
-     * 
+     *
      * @param ids 需要删除的票种管理主键
      * @return 结果
      */
     @Override
-    public int deletePzTicketTypeManagementByIds(Long[] ids)
-    {
+    public int deletePzTicketTypeManagementByIds(Long[] ids) {
         return pzTicketTypeManagementMapper.deletePzTicketTypeManagementByIds(ids);
     }
 
     /**
      * 删除票种管理信息
-     * 
+     *
      * @param id 票种管理主键
      * @return 结果
      */
     @Override
-    public int deletePzTicketTypeManagementById(Long id)
-    {
+    public int deletePzTicketTypeManagementById(Long id) {
         return pzTicketTypeManagementMapper.deletePzTicketTypeManagementById(id);
     }
 

+ 125 - 0
songhua-system/src/main/java/com/songhua/system/service/impl/ShhTicketRulesServiceImpl.java

@@ -0,0 +1,125 @@
+package com.songhua.system.service.impl;
+
+import com.songhua.system.domain.ShhTicketRules;
+import com.songhua.system.domain.ShhTicketRulesData;
+import com.songhua.system.mapper.ShhTicketRulesDataMapper;
+import com.songhua.system.mapper.ShhTicketRulesMapper;
+import com.songhua.system.service.IShhTicketRulesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 票种规则Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+@Service
+public class ShhTicketRulesServiceImpl implements IShhTicketRulesService {
+    @Autowired
+    private ShhTicketRulesMapper shhTicketRulesMapper;
+    @Autowired
+    private ShhTicketRulesDataMapper shhTicketRulesDataMapper;
+
+    /**
+     * 查询票种规则
+     *
+     * @param id 票种规则主键
+     * @return 票种规则
+     */
+    @Override
+    public ShhTicketRules selectShhTicketRulesById(Long id) {
+        ShhTicketRules returnEntity = shhTicketRulesMapper.selectShhTicketRulesById(id);
+        String[] split = returnEntity.getTicketId().split(",");
+        List<Long> list = Arrays.stream(split).map(Long::parseLong).collect(Collectors.toList());
+        returnEntity.setTicketList(list);
+        return returnEntity;
+    }
+
+    /**
+     * 查询票种规则列表
+     *
+     * @param shhTicketRules 票种规则
+     * @return 票种规则
+     */
+    @Override
+    public List<ShhTicketRules> selectShhTicketRulesList(ShhTicketRules shhTicketRules) {
+        return shhTicketRulesMapper.selectShhTicketRulesList(shhTicketRules);
+    }
+
+    /**
+     * 新增票种规则
+     *
+     * @param shhTicketRules 票种规则
+     * @return 结果
+     */
+    @Override
+    public int insertShhTicketRules(ShhTicketRules shhTicketRules) {
+        shhTicketRulesMapper.insertShhTicketRules(shhTicketRules);
+        extracted(shhTicketRules);
+        return 1;
+    }
+
+    private void extracted(ShhTicketRules shhTicketRules) {
+        List<ShhTicketRulesData> saveList = new ArrayList<>();
+        if (!CollectionUtils.isEmpty(shhTicketRules.getTicketList())) {
+            for (Long var : shhTicketRules.getTicketList()) {
+                ShhTicketRulesData saveData = new ShhTicketRulesData();
+                saveData.setRulesId(shhTicketRules.getId());
+                saveData.setTicketId(var);
+                saveList.add(saveData);
+            }
+            if (!CollectionUtils.isEmpty(saveList)) {
+                shhTicketRulesDataMapper.insertTicketRulesDataBatch(saveList);
+            }
+        }
+    }
+
+    /**
+     * 修改票种规则
+     *
+     * @param shhTicketRules 票种规则
+     * @return 结果
+     */
+    @Override
+    public int updateShhTicketRules(ShhTicketRules shhTicketRules) {
+        if (!CollectionUtils.isEmpty(shhTicketRules.getTicketList())) {
+            shhTicketRulesDataMapper.deleteShhTicketRulesDataByRulesId(shhTicketRules.getId());
+            extracted(shhTicketRules);
+        }
+        return shhTicketRulesMapper.updateShhTicketRules(shhTicketRules);
+    }
+
+    /**
+     * 批量删除票种规则
+     *
+     * @param ids 需要删除的票种规则主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShhTicketRulesByIds(Long[] ids) {
+        for (Long id : ids) {
+            shhTicketRulesDataMapper.deleteShhTicketRulesDataByRulesId(id);
+        }
+        return shhTicketRulesMapper.deleteShhTicketRulesByIds(ids);
+    }
+
+    /**
+     * 删除票种规则信息
+     *
+     * @param id 票种规则主键
+     * @return 结果
+     */
+    @Override
+    public int deleteShhTicketRulesById(Long id) {
+        return shhTicketRulesMapper.deleteShhTicketRulesById(id);
+    }
+
+
+}

+ 6 - 5
songhua-system/src/main/resources/mapper/system/PzTicketTypeManagementMapper.xml

@@ -19,11 +19,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectPzTicketTypeManagementList" parameterType="PzTicketTypeManagement" resultMap="PzTicketTypeManagementResult">
         <include refid="selectPzTicketTypeManagementVo"/>
-        <where>  
-            <if test="ticketName != null  and ticketName != ''"> and ticket_name like concat('%', #{ticketName}, '%')</if>
-            <if test="ticketType != null  and ticketType != ''"> and ticket_type = #{ticketType}</if>
-            <if test="settlementPrice != null "> and settlement_price = #{settlementPrice}</if>
-            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+        <where>
+            <if test="ticketName != null  and ticketName != ''">and ticket_name like concat('%', #{ticketName}, '%')
+            </if>
+            <if test="ticketType != null  and ticketType != ''">and ticket_type = #{ticketType}</if>
+            <if test="settlementPrice != null ">and settlement_price = #{settlementPrice}</if>
+            <if test="remarks != null  and remarks != ''">and remarks = #{remarks}</if>
         </where>
     </select>
     

+ 76 - 0
songhua-system/src/main/resources/mapper/system/ShhTicketRulesDataMapper.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.songhua.system.mapper.ShhTicketRulesDataMapper">
+
+    <resultMap type="ShhTicketRulesData" id="ShhTicketRulesDataResult">
+        <result property="id" column="id"/>
+        <result property="rulesId" column="rules_id"/>
+        <result property="ticketId" column="ticket_id"/>
+    </resultMap>
+
+    <sql id="selectShhTicketRulesDataVo">
+        select id, rules_id, ticket_id
+        from shh_ticket_rules_data
+    </sql>
+
+    <select id="selectShhTicketRulesDataList" parameterType="ShhTicketRulesData" resultMap="ShhTicketRulesDataResult">
+        <include refid="selectShhTicketRulesDataVo"/>
+        <where>
+            <if test="rulesId != null ">and rules_id = #{rulesId}</if>
+            <if test="ticketId != null ">and ticket_id = #{ticketId}</if>
+        </where>
+    </select>
+
+    <select id="selectShhTicketRulesDataById" parameterType="Long" resultMap="ShhTicketRulesDataResult">
+        <include refid="selectShhTicketRulesDataVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertShhTicketRulesData" parameterType="ShhTicketRulesData" useGeneratedKeys="true" keyProperty="id">
+        insert into shh_ticket_rules_data
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="rulesId != null">rules_id,</if>
+            <if test="ticketId != null">ticket_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="rulesId != null">#{rulesId},</if>
+            <if test="ticketId != null">#{ticketId},</if>
+        </trim>
+    </insert>
+
+    <update id="updateShhTicketRulesData" parameterType="ShhTicketRulesData">
+        update shh_ticket_rules_data
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="rulesId != null">rules_id = #{rulesId},</if>
+            <if test="ticketId != null">ticket_id = #{ticketId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteShhTicketRulesDataById" parameterType="Long">
+        delete
+        from shh_ticket_rules_data
+        where id = #{id}
+    </delete>
+
+    <delete id="deleteShhTicketRulesDataByIds" parameterType="String">
+        delete from shh_ticket_rules_data where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    <insert id="insertTicketRulesDataBatch" parameterType="int">
+        insert into shh_ticket_rules_data(rules_id, ticket_id) values
+        <foreach collection="list" item="item" separator=",">
+            (#{item.rulesId}, #{item.ticketId})
+        </foreach>
+    </insert>
+    <delete id="deleteShhTicketRulesDataByRulesId" parameterType="Long">
+        delete
+        from shh_ticket_rules_data
+        where rules_id = #{rulesId}
+    </delete>
+
+</mapper>

+ 70 - 0
songhua-system/src/main/resources/mapper/system/ShhTicketRulesMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.songhua.system.mapper.ShhTicketRulesMapper">
+    
+    <resultMap type="ShhTicketRules" id="ShhTicketRulesResult">
+        <result property="id"    column="id"    />
+        <result property="ticketRules"    column="ticket_rules"    />
+    </resultMap>
+
+    <sql id="selectShhTicketRulesVo">
+        select id, ticket_rules
+        from shh_ticket_rules
+    </sql>
+
+    <select id="selectShhTicketRulesList" parameterType="ShhTicketRules" resultMap="ShhTicketRulesResult">
+        SELECT
+        tr.id,
+        ticket_rules,
+        GROUP_CONCAT( pttm.ticket_name ) AS ticketName
+        FROM
+        shh_ticket_rules tr
+        LEFT JOIN shh_ticket_rules_data trd ON tr.id = trd.rules_id
+        LEFT JOIN pz_ticket_type_management pttm ON trd.ticket_id = pttm.id
+        <where>  
+            <if test="ticketRules != null  and ticketRules != ''"> and tr.ticket_rules like concat('%',#{ticketRules},'%')</if>
+        </where>
+        GROUP BY
+        tr.id
+    </select>
+    
+    <select id="selectShhTicketRulesById" parameterType="Long" resultMap="ShhTicketRulesResult">
+        select tr.id, ticket_rules, GROUP_CONCAT(trd.ticket_id) as ticketId
+        from shh_ticket_rules tr
+                 left join shh_ticket_rules_data trd on tr.id = trd.rules_id
+        where tr.id = #{id}
+        GROUP BY
+            tr.id
+    </select>
+        
+    <insert id="insertShhTicketRules" parameterType="ShhTicketRules" useGeneratedKeys="true" keyProperty="id">
+        insert into shh_ticket_rules
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="ticketRules != null">ticket_rules,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="ticketRules != null">#{ticketRules},</if>
+         </trim>
+    </insert>
+
+    <update id="updateShhTicketRules" parameterType="ShhTicketRules">
+        update shh_ticket_rules
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="ticketRules != null">ticket_rules = #{ticketRules},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteShhTicketRulesById" parameterType="Long">
+        delete from shh_ticket_rules where id = #{id}
+    </delete>
+
+    <delete id="deleteShhTicketRulesByIds" parameterType="String">
+        delete from shh_ticket_rules where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 10 - 1
songhua-ui/src/api/system/ticket.js

@@ -1,6 +1,6 @@
 import request from '@/utils/request'
 
-// 查询票种管理列表
+// 查询票种管理分页列表
 export function listManagement(query) {
   return request({
     url: '/system/ticket/list',
@@ -55,3 +55,12 @@ export function changeStatus(id, status) {
     data: data
   })
 }
+
+// 查询票种管理列表
+export function ticketAllList(query) {
+  return request({
+    url: '/system/ticket/ticketAllList',
+    method: 'get',
+    params: query
+  })
+}

+ 44 - 0
songhua-ui/src/api/system/ticketRules.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询票种规则列表
+export function listRules(query) {
+  return request({
+    url: '/ticket/rules/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询票种规则详细
+export function getRules(id) {
+  return request({
+    url: '/ticket/rules/' + id,
+    method: 'get'
+  })
+}
+
+// 新增票种规则
+export function addRules(data) {
+  return request({
+    url: '/ticket/rules',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改票种规则
+export function updateRules(data) {
+  return request({
+    url: '/ticket/rules',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除票种规则
+export function delRules(id) {
+  return request({
+    url: '/ticket/rules/' + id,
+    method: 'delete'
+  })
+}

+ 1 - 1
songhua-ui/src/views/system/ships/index.vue

@@ -186,7 +186,7 @@ export default {
       // 表单校验
       rules: {
         shipName: [
-          { required: true, message: "船名不能为空", trigger: "chablurnge" },
+          { required: true, message: "船名不能为空", trigger: "blur" },
         ],
         registrationNumber: [
           { required: true, message: "船舶注册号不能为空", trigger: "blur" },

+ 274 - 0
songhua-ui/src/views/system/ticketRules/index.vue

@@ -0,0 +1,274 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
+      <el-form-item label="票务规则名称" prop="ticketRules">
+        <el-input
+          v-model="queryParams.ticketRules"
+          placeholder="请输入票务规则名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+        >新增
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+        >修改
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+        >删除
+        </el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="rulesList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center"/>
+      <el-table-column label="序号" align="center" type="index"/>
+      <el-table-column label="票务规则名称" align="center" prop="ticketRules"/>
+      <el-table-column label="票种名称" align="center" prop="ticketName"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+          >修改
+          </el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+          >删除
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改票种规则对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="票务规则名称" prop="ticketRules">
+          <el-input v-model="form.ticketRules" placeholder="请输入票务规则名称"/>
+        </el-form-item>
+        <el-form-item label="票种名称" prop="ticketList">
+          <el-select v-model="form.ticketList" multiple placeholder="请选择票种名称" style="width:340px"
+                     @change="onChange"
+          >
+            <el-option
+              v-for="item in ticketList"
+              :key="item.index"
+              :label="item.ticketName"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {listRules, getRules, delRules, addRules, updateRules} from "@/api/system/ticketRules";
+import {ticketAllList} from "@/api/system/ticket";
+
+export default {
+  name: "Rules",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 票种规则表格数据
+      rulesList: [],
+      // 票种数据
+      ticketList: [],
+      // 票种存储数据
+      tickets: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        ticketRules: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        ticketRules: [
+          { required: true, message: "票务规则名称不能为空", trigger: "blur" },
+        ],
+        ticketList: [
+          { required: true, message: "票种名称不能为空", trigger: "blur" },
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getTicketList();
+  },
+  methods: {
+    onChange(e) {
+      this.form.tickets = this.ticketList.filter((item) =>
+        e.includes(item.id)
+      )
+    },
+    /** 查询票种全部列表 */
+    getTicketList() {
+      this.loading = true;
+      ticketAllList().then(response => {
+        this.ticketList = response.data;
+        this.loading = false;
+      });
+    },
+    /** 查询票种规则列表 */
+    getList() {
+      this.loading = true;
+      listRules(this.queryParams).then(response => {
+        this.rulesList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        ticketRules: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加票种规则";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getRules(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改票种规则";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateRules(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addRules(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除票种规则编号为"' + ids + '"的数据项?').then(function () {
+        return delRules(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('system/rules/export', {
+        ...this.queryParams
+      }, `rules_${new Date().getTime()}.xlsx`)
+    }
+  }
+};
+</script>