lchao il y a 7 mois
Parent
commit
2d48c4212e

+ 104 - 0
songhua-admin/src/main/java/com/songhua/web/controller/system/PzTicketTypeManagementController.java

@@ -0,0 +1,104 @@
+package com.songhua.system.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+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.enums.BusinessType;
+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;
+
+/**
+ * 票种管理Controller
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+@RestController
+@RequestMapping("/system/ticket")
+public class PzTicketTypeManagementController extends BaseController
+{
+    @Autowired
+    private IPzTicketTypeManagementService pzTicketTypeManagementService;
+
+    /**
+     * 查询票种管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:management:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PzTicketTypeManagement pzTicketTypeManagement)
+    {
+        startPage();
+        List<PzTicketTypeManagement> list = pzTicketTypeManagementService.selectPzTicketTypeManagementList(pzTicketTypeManagement);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出票种管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:management:export')")
+    @Log(title = "票种管理", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, PzTicketTypeManagement pzTicketTypeManagement)
+    {
+        List<PzTicketTypeManagement> list = pzTicketTypeManagementService.selectPzTicketTypeManagementList(pzTicketTypeManagement);
+        ExcelUtil<PzTicketTypeManagement> util = new ExcelUtil<PzTicketTypeManagement>(PzTicketTypeManagement.class);
+        util.exportExcel(response, list, "票种管理数据");
+    }
+
+    /**
+     * 获取票种管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:management:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(pzTicketTypeManagementService.selectPzTicketTypeManagementById(id));
+    }
+
+    /**
+     * 新增票种管理
+     */
+    @PreAuthorize("@ss.hasPermi('system:management:add')")
+    @Log(title = "票种管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody PzTicketTypeManagement pzTicketTypeManagement)
+    {
+        return toAjax(pzTicketTypeManagementService.insertPzTicketTypeManagement(pzTicketTypeManagement));
+    }
+
+    /**
+     * 修改票种管理
+     */
+    @PreAuthorize("@ss.hasPermi('system:management:edit')")
+    @Log(title = "票种管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody PzTicketTypeManagement pzTicketTypeManagement)
+    {
+        return toAjax(pzTicketTypeManagementService.updatePzTicketTypeManagement(pzTicketTypeManagement));
+    }
+
+    /**
+     * 删除票种管理
+     */
+    @PreAuthorize("@ss.hasPermi('system:management:remove')")
+    @Log(title = "票种管理", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(pzTicketTypeManagementService.deletePzTicketTypeManagementByIds(ids));
+    }
+}

+ 94 - 0
songhua-system/src/main/java/com/songhua/system/domain/PzTicketTypeManagement.java

@@ -0,0 +1,94 @@
+package com.songhua.system.domain;
+
+import java.math.BigDecimal;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.songhua.common.annotation.Excel;
+import com.songhua.common.core.domain.BaseEntity;
+
+/**
+ * 票种管理对象 pz_ticket_type_management
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public class PzTicketTypeManagement extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 票种ID */
+    private Long id;
+
+    /** 票种名 */
+    @Excel(name = "票种名")
+    private String ticketName;
+
+    /** 票种类型 */
+    @Excel(name = "票种类型")
+    private String ticketType;
+
+    /** 结算价格 */
+    @Excel(name = "结算价格")
+    private BigDecimal settlementPrice;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setTicketName(String ticketName) 
+    {
+        this.ticketName = ticketName;
+    }
+
+    public String getTicketName() 
+    {
+        return ticketName;
+    }
+    public void setTicketType(String ticketType) 
+    {
+        this.ticketType = ticketType;
+    }
+
+    public String getTicketType() 
+    {
+        return ticketType;
+    }
+    public void setSettlementPrice(BigDecimal settlementPrice) 
+    {
+        this.settlementPrice = settlementPrice;
+    }
+
+    public BigDecimal getSettlementPrice() 
+    {
+        return settlementPrice;
+    }
+    public void setRemarks(String remarks) 
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() 
+    {
+        return remarks;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("ticketName", getTicketName())
+            .append("ticketType", getTicketType())
+            .append("settlementPrice", getSettlementPrice())
+            .append("remarks", getRemarks())
+            .toString();
+    }
+}

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

@@ -0,0 +1,61 @@
+package com.songhua.system.mapper;
+
+import java.util.List;
+import com.songhua.system.domain.PzTicketTypeManagement;
+
+/**
+ * 票种管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public interface PzTicketTypeManagementMapper 
+{
+    /**
+     * 查询票种管理
+     * 
+     * @param id 票种管理主键
+     * @return 票种管理
+     */
+    public PzTicketTypeManagement selectPzTicketTypeManagementById(Long id);
+
+    /**
+     * 查询票种管理列表
+     * 
+     * @param pzTicketTypeManagement 票种管理
+     * @return 票种管理集合
+     */
+    public List<PzTicketTypeManagement> selectPzTicketTypeManagementList(PzTicketTypeManagement pzTicketTypeManagement);
+
+    /**
+     * 新增票种管理
+     * 
+     * @param pzTicketTypeManagement 票种管理
+     * @return 结果
+     */
+    public int insertPzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement);
+
+    /**
+     * 修改票种管理
+     * 
+     * @param pzTicketTypeManagement 票种管理
+     * @return 结果
+     */
+    public int updatePzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement);
+
+    /**
+     * 删除票种管理
+     * 
+     * @param id 票种管理主键
+     * @return 结果
+     */
+    public int deletePzTicketTypeManagementById(Long id);
+
+    /**
+     * 批量删除票种管理
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePzTicketTypeManagementByIds(Long[] ids);
+}

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

@@ -0,0 +1,61 @@
+package com.songhua.system.service;
+
+import java.util.List;
+import com.songhua.system.domain.PzTicketTypeManagement;
+
+/**
+ * 票种管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public interface IPzTicketTypeManagementService 
+{
+    /**
+     * 查询票种管理
+     * 
+     * @param id 票种管理主键
+     * @return 票种管理
+     */
+    public PzTicketTypeManagement selectPzTicketTypeManagementById(Long id);
+
+    /**
+     * 查询票种管理列表
+     * 
+     * @param pzTicketTypeManagement 票种管理
+     * @return 票种管理集合
+     */
+    public List<PzTicketTypeManagement> selectPzTicketTypeManagementList(PzTicketTypeManagement pzTicketTypeManagement);
+
+    /**
+     * 新增票种管理
+     * 
+     * @param pzTicketTypeManagement 票种管理
+     * @return 结果
+     */
+    public int insertPzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement);
+
+    /**
+     * 修改票种管理
+     * 
+     * @param pzTicketTypeManagement 票种管理
+     * @return 结果
+     */
+    public int updatePzTicketTypeManagement(PzTicketTypeManagement pzTicketTypeManagement);
+
+    /**
+     * 批量删除票种管理
+     * 
+     * @param ids 需要删除的票种管理主键集合
+     * @return 结果
+     */
+    public int deletePzTicketTypeManagementByIds(Long[] ids);
+
+    /**
+     * 删除票种管理信息
+     * 
+     * @param id 票种管理主键
+     * @return 结果
+     */
+    public int deletePzTicketTypeManagementById(Long id);
+}

+ 93 - 0
songhua-system/src/main/java/com/songhua/system/service/impl/PzTicketTypeManagementServiceImpl.java

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

+ 71 - 0
songhua-system/src/main/resources/mapper/system/PzTicketTypeManagementMapper.xml

@@ -0,0 +1,71 @@
+<?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.PzTicketTypeManagementMapper">
+    
+    <resultMap type="PzTicketTypeManagement" id="PzTicketTypeManagementResult">
+        <result property="id"    column="id"    />
+        <result property="ticketName"    column="ticket_name"    />
+        <result property="ticketType"    column="ticket_type"    />
+        <result property="settlementPrice"    column="settlement_price"    />
+        <result property="remarks"    column="remarks"    />
+    </resultMap>
+
+    <sql id="selectPzTicketTypeManagementVo">
+        select id, ticket_name, ticket_type, settlement_price, remarks from pz_ticket_type_management
+    </sql>
+
+    <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>
+    </select>
+    
+    <select id="selectPzTicketTypeManagementById" parameterType="Long" resultMap="PzTicketTypeManagementResult">
+        <include refid="selectPzTicketTypeManagementVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertPzTicketTypeManagement" parameterType="PzTicketTypeManagement" useGeneratedKeys="true" keyProperty="id">
+        insert into pz_ticket_type_management
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="ticketName != null">ticket_name,</if>
+            <if test="ticketType != null">ticket_type,</if>
+            <if test="settlementPrice != null">settlement_price,</if>
+            <if test="remarks != null">remarks,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="ticketName != null">#{ticketName},</if>
+            <if test="ticketType != null">#{ticketType},</if>
+            <if test="settlementPrice != null">#{settlementPrice},</if>
+            <if test="remarks != null">#{remarks},</if>
+         </trim>
+    </insert>
+
+    <update id="updatePzTicketTypeManagement" parameterType="PzTicketTypeManagement">
+        update pz_ticket_type_management
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="ticketName != null">ticket_name = #{ticketName},</if>
+            <if test="ticketType != null">ticket_type = #{ticketType},</if>
+            <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deletePzTicketTypeManagementById" parameterType="Long">
+        delete from pz_ticket_type_management where id = #{id}
+    </delete>
+
+    <delete id="deletePzTicketTypeManagementByIds" parameterType="String">
+        delete from pz_ticket_type_management where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

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

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询票种管理列表
+export function listManagement(query) {
+  return request({
+    url: '/system/ticket/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询票种管理详细
+export function getManagement(id) {
+  return request({
+    url: '/system/ticket/' + id,
+    method: 'get'
+  })
+}
+
+// 新增票种管理
+export function addManagement(data) {
+  return request({
+    url: '/system/ticket',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改票种管理
+export function updateManagement(data) {
+  return request({
+    url: '/system/ticket',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除票种管理
+export function delManagement(id) {
+  return request({
+    url: '/system/ticket/' + id,
+    method: 'delete'
+  })
+}