浏览代码

票种管理

lchao 8 月之前
父节点
当前提交
8c452ca386

+ 121 - 0
songhua-admin/src/main/java/com/songhua/web/controller/system/PzRawDataController.java

@@ -0,0 +1,121 @@
+package com.songhua.system.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.songhua.common.core.domain.entity.SysUser;
+import com.songhua.system.domain.PzRawDataVo;
+import io.swagger.annotations.ApiOperation;
+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.PzRawData;
+import com.songhua.system.service.IPzRawDataService;
+import com.songhua.common.utils.poi.ExcelUtil;
+import com.songhua.common.core.page.TableDataInfo;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 原始数据导入Controller
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+@RestController
+@RequestMapping("/system/data")
+public class PzRawDataController extends BaseController
+{
+    @Autowired
+    private IPzRawDataService pzRawDataService;
+
+    /**
+     * 查询原始数据导入列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:data:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PzRawData pzRawData)
+    {
+        startPage();
+        List<PzRawDataVo> list = pzRawDataService.selectPzRawDataList(pzRawData);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 导入原始数据列表
+     */
+    @PostMapping("/importData")
+    public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception
+    {
+        ExcelUtil<PzRawDataVo> util = new ExcelUtil<PzRawDataVo>(PzRawDataVo.class);
+        List<PzRawDataVo> userList = util.importExcel(file.getInputStream());
+        String operName = getUsername();
+        String message = pzRawDataService.importData(userList, updateSupport, operName);
+        return success(message);
+    }
+
+    /**
+     * 导入模板
+     */
+    @ApiOperation(value = "导入模板", notes = "导入模板")
+    @PostMapping("/importTemplate")
+    public void importTemplate(HttpServletResponse response){
+        ExcelUtil<PzRawData> util = new ExcelUtil<>(PzRawData.class);
+        util.importTemplateExcel(response, "票务原始数据");
+    }
+
+    /**
+     * 获取原始数据导入详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:data:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(pzRawDataService.selectPzRawDataById(id));
+    }
+
+    /**
+     * 新增原始数据导入
+     */
+    @PreAuthorize("@ss.hasPermi('system:data:add')")
+    @Log(title = "原始数据导入", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody PzRawData pzRawData)
+    {
+        return toAjax(pzRawDataService.insertPzRawData(pzRawData));
+    }
+
+    /**
+     * 修改原始数据导入
+     */
+    @PreAuthorize("@ss.hasPermi('system:data:edit')")
+    @Log(title = "原始数据导入", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody PzRawData pzRawData)
+    {
+        return toAjax(pzRawDataService.updatePzRawData(pzRawData));
+    }
+
+    /**
+     * 删除原始数据导入
+     */
+    @PreAuthorize("@ss.hasPermi('system:data:remove')")
+    @Log(title = "原始数据导入", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(pzRawDataService.deletePzRawDataByIds(ids));
+    }
+
+}

+ 19 - 16
songhua-admin/src/main/java/com/songhua/web/controller/system/PzTicketTypeManagementController.java

@@ -2,6 +2,8 @@ package com.songhua.system.controller;
 
 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;
@@ -23,14 +25,13 @@ import com.songhua.common.core.page.TableDataInfo;
 
 /**
  * 票种管理Controller
- * 
+ *
  * @author ruoyi
  * @date 2024-11-04
  */
 @RestController
 @RequestMapping("/system/ticket")
-public class PzTicketTypeManagementController extends BaseController
-{
+public class PzTicketTypeManagementController extends BaseController {
     @Autowired
     private IPzTicketTypeManagementService pzTicketTypeManagementService;
 
@@ -39,8 +40,7 @@ public class PzTicketTypeManagementController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:management:list')")
     @GetMapping("/list")
-    public TableDataInfo list(PzTicketTypeManagement pzTicketTypeManagement)
-    {
+    public TableDataInfo list(PzTicketTypeManagement pzTicketTypeManagement) {
         startPage();
         List<PzTicketTypeManagement> list = pzTicketTypeManagementService.selectPzTicketTypeManagementList(pzTicketTypeManagement);
         return getDataTable(list);
@@ -52,8 +52,7 @@ public class PzTicketTypeManagementController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:management:export')")
     @Log(title = "票种管理", businessType = BusinessType.EXPORT)
     @PostMapping("/export")
-    public void export(HttpServletResponse response, PzTicketTypeManagement pzTicketTypeManagement)
-    {
+    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, "票种管理数据");
@@ -64,8 +63,7 @@ public class PzTicketTypeManagementController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:management:query')")
     @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(pzTicketTypeManagementService.selectPzTicketTypeManagementById(id));
     }
 
@@ -75,8 +73,7 @@ public class PzTicketTypeManagementController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:management:add')")
     @Log(title = "票种管理", businessType = BusinessType.INSERT)
     @PostMapping
-    public AjaxResult add(@RequestBody PzTicketTypeManagement pzTicketTypeManagement)
-    {
+    public AjaxResult add(@RequestBody PzTicketTypeManagement pzTicketTypeManagement) {
         return toAjax(pzTicketTypeManagementService.insertPzTicketTypeManagement(pzTicketTypeManagement));
     }
 
@@ -86,8 +83,7 @@ public class PzTicketTypeManagementController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:management:edit')")
     @Log(title = "票种管理", businessType = BusinessType.UPDATE)
     @PutMapping
-    public AjaxResult edit(@RequestBody PzTicketTypeManagement pzTicketTypeManagement)
-    {
+    public AjaxResult edit(@RequestBody PzTicketTypeManagement pzTicketTypeManagement) {
         return toAjax(pzTicketTypeManagementService.updatePzTicketTypeManagement(pzTicketTypeManagement));
     }
 
@@ -96,9 +92,16 @@ public class PzTicketTypeManagementController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('system:management:remove')")
     @Log(title = "票种管理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
         return toAjax(pzTicketTypeManagementService.deletePzTicketTypeManagementByIds(ids));
     }
+
+    /**
+     * 状态修改
+     */
+    @PutMapping("/changeStatus")
+    public AjaxResult changeStatus(@RequestBody PzTicketTypeManagement pzTicketTypeManagement) {
+        return toAjax(pzTicketTypeManagementService.updateStatus(pzTicketTypeManagement));
+    }
 }

+ 87 - 0
songhua-system/src/main/java/com/songhua/system/domain/PzRawData.java

@@ -0,0 +1,87 @@
+package com.songhua.system.domain;
+
+import lombok.Data;
+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_raw_data
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+@Data
+public class PzRawData extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 票种id */
+    private Long id;
+
+    /** 票种名 */
+    @Excel(name = "票种名")
+    private Long ticketId;
+
+    /** 支付类型 */
+    @Excel(name = "支付类型", readConverterExp = "1=微信,2=支付宝,3=现金,4=云闪付,5=支付宝小程序余额支付,6=微信小程序余额支付,7=ota余额支付,8=灵活代收,9=旅行社余额支付")
+    private String payType;
+
+    /** 张数 */
+    @Excel(name = "张数")
+    private Long number;
+
+    /** 金额 */
+    @Excel(name = "金额")
+    private String money;
+
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setNumber(Long number) 
+    {
+        this.number = number;
+    }
+
+    public Long getNumber() 
+    {
+        return number;
+    }
+    public void setMoney(String money) 
+    {
+        this.money = money;
+    }
+
+    public String getMoney() 
+    {
+        return money;
+    }
+    public void setPayType(String payType) 
+    {
+        this.payType = payType;
+    }
+
+    public String getPayType() 
+    {
+        return payType;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("number", getNumber())
+            .append("money", getMoney())
+            .append("payType", getPayType())
+            .append("createTime", getCreateTime())
+            .toString();
+    }
+}

+ 43 - 0
songhua-system/src/main/java/com/songhua/system/domain/PzRawDataVo.java

@@ -0,0 +1,43 @@
+package com.songhua.system.domain;
+
+import com.songhua.common.annotation.Excel;
+import com.songhua.common.core.domain.BaseEntity;
+import lombok.Data;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import java.util.List;
+
+/**
+ * 原始数据导入对象 pz_raw_data
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+@Data
+public class PzRawDataVo extends BaseEntity
+{
+
+    private Long id;
+    /** 票种名 */
+    @Excel(name = "票种名")
+    private String ticketName;
+
+    /** 张数 */
+    @Excel(name = "张数")
+    private Long number;
+
+    /** 金额 */
+    @Excel(name = "金额")
+    private String money;
+
+    /** 支付类型 */
+    @Excel(name = "支付类型", readConverterExp = "1=微信,2=支付宝,3=现金,4=云闪付,5=支付宝小程序余额支付,6=微信小程序余额支付,7=ota余额支付,8=灵活代收,9=旅行社余额支付")
+    private String payType;
+
+
+    private Long ticketId;
+
+    private List<PzRawDataVo> paymentTypeDataList;
+
+}

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

@@ -1,6 +1,8 @@
 package com.songhua.system.domain;
 
 import java.math.BigDecimal;
+
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.songhua.common.annotation.Excel;
@@ -12,6 +14,7 @@ import com.songhua.common.core.domain.BaseEntity;
  * @author ruoyi
  * @date 2024-11-04
  */
+@Data
 public class PzTicketTypeManagement extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -35,6 +38,10 @@ public class PzTicketTypeManagement extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
+    /** 状态 */
+    @Excel(name = "状态")
+    private String status;
+
     public void setId(Long id) 
     {
         this.id = id;

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

@@ -0,0 +1,69 @@
+package com.songhua.system.mapper;
+
+import java.util.List;
+
+import com.songhua.common.core.domain.entity.SysUser;
+import com.songhua.system.domain.PzRawData;
+import com.songhua.system.domain.PzRawDataVo;
+
+/**
+ * 原始数据导入Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public interface PzRawDataMapper 
+{
+    /**
+     * 查询原始数据导入
+     * 
+     * @param id 原始数据导入主键
+     * @return 原始数据导入
+     */
+    public PzRawData selectPzRawDataById(Long id);
+
+    /**
+     * 查询原始数据导入列表
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 原始数据导入集合
+     */
+    public List<PzRawDataVo> selectPzRawDataList(PzRawData pzRawData);
+
+    /**
+     * 新增原始数据导入
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 结果
+     */
+    public int insertPzRawData(PzRawData pzRawData);
+    public int insertPzRawDataVo(PzRawDataVo pzRawDataVo);
+
+    /**
+     * 修改原始数据导入
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 结果
+     */
+    public int updatePzRawData(PzRawData pzRawData);
+    public int updatePzRawDataVo(PzRawDataVo pzRawDataVo);
+
+    /**
+     * 删除原始数据导入
+     * 
+     * @param id 原始数据导入主键
+     * @return 结果
+     */
+    public int deletePzRawDataById(Long id);
+
+    /**
+     * 批量删除原始数据导入
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deletePzRawDataByIds(Long[] ids);
+
+    public PzRawDataVo checkIfDataExists(String ticketName);
+
+}

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

@@ -1,6 +1,8 @@
 package com.songhua.system.mapper;
 
 import java.util.List;
+
+import com.songhua.common.core.domain.entity.SysUser;
 import com.songhua.system.domain.PzTicketTypeManagement;
 
 /**
@@ -58,4 +60,5 @@ public interface PzTicketTypeManagementMapper
      * @return 结果
      */
     public int deletePzTicketTypeManagementByIds(Long[] ids);
+
 }

+ 82 - 0
songhua-system/src/main/java/com/songhua/system/service/IPzRawDataService.java

@@ -0,0 +1,82 @@
+package com.songhua.system.service;
+
+import java.util.List;
+
+import com.songhua.system.domain.PzRawData;
+import com.songhua.system.domain.PzRawDataVo;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * 原始数据导入Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+public interface IPzRawDataService 
+{
+    /**
+     * 查询原始数据导入
+     * 
+     * @param id 原始数据导入主键
+     * @return 原始数据导入
+     */
+    public PzRawData selectPzRawDataById(Long id);
+
+    /**
+     * 查询原始数据导入列表
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 原始数据导入集合
+     */
+    public List<PzRawDataVo> selectPzRawDataList(PzRawData pzRawData);
+
+
+    /**
+     * 新增原始数据导入
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 结果
+     */
+    public int insertPzRawData(PzRawData pzRawData);
+
+    int insertPzRawDataVo(PzRawDataVo pzRawDataVo);
+
+    /**
+     * 修改原始数据导入
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 结果
+     */
+    public int updatePzRawData(PzRawData pzRawData);
+
+    int updatePzRawDataVo(PzRawDataVo pzRawDataVo);
+
+    /**
+     * 批量删除原始数据导入
+     * 
+     * @param ids 需要删除的原始数据导入主键集合
+     * @return 结果
+     */
+    public int deletePzRawDataByIds(Long[] ids);
+
+    /**
+     * 删除原始数据导入信息
+     * 
+     * @param id 原始数据导入主键
+     * @return 结果
+     */
+    public int deletePzRawDataById(Long id);
+
+    PzRawDataVo checkIfDataExists(String ticketName);
+
+    /**
+     * 导入用户数据
+     *
+     * @param userList 用户数据列表
+     * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
+     * @param operName 操作用户
+     * @return 结果
+     */
+    public String importData(List<PzRawDataVo> userList, Boolean isUpdateSupport, String operName);
+
+}

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

@@ -1,6 +1,8 @@
 package com.songhua.system.service;
 
 import java.util.List;
+
+import com.songhua.common.core.domain.entity.SysUser;
 import com.songhua.system.domain.PzTicketTypeManagement;
 
 /**
@@ -58,4 +60,6 @@ public interface IPzTicketTypeManagementService
      * @return 结果
      */
     public int deletePzTicketTypeManagementById(Long id);
+
+    public int updateStatus(PzTicketTypeManagement pzTicketTypeManagement);
 }

+ 154 - 0
songhua-system/src/main/java/com/songhua/system/service/impl/PzRawDataServiceImpl.java

@@ -0,0 +1,154 @@
+package com.songhua.system.service.impl;
+
+import java.util.List;
+
+import com.songhua.common.exception.ServiceException;
+import com.songhua.common.utils.DateUtils;
+import com.songhua.common.utils.StringUtils;
+import com.songhua.system.domain.PzRawDataVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.songhua.system.mapper.PzRawDataMapper;
+import com.songhua.system.domain.PzRawData;
+import com.songhua.system.service.IPzRawDataService;
+
+/**
+ * 原始数据导入Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-11-04
+ */
+@Service
+public class PzRawDataServiceImpl implements IPzRawDataService 
+{
+    @Autowired
+    private PzRawDataMapper pzRawDataMapper;
+
+
+
+
+    /**
+     * 查询原始数据导入
+     * 
+     * @param id 原始数据导入主键
+     * @return 原始数据导入
+     */
+    @Override
+    public PzRawData selectPzRawDataById(Long id)
+    {
+        return pzRawDataMapper.selectPzRawDataById(id);
+    }
+
+    /**
+     * 查询原始数据导入列表
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 原始数据导入
+     */
+    @Override
+    public List<PzRawDataVo> selectPzRawDataList(PzRawData pzRawData)
+    {
+        return pzRawDataMapper.selectPzRawDataList(pzRawData);
+    }
+
+    /**
+     * 新增原始数据导入
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 结果
+     */
+    @Override
+    public int insertPzRawData(PzRawData pzRawData)
+    {
+        pzRawData.setCreateTime(DateUtils.getNowDate());
+        return pzRawDataMapper.insertPzRawData(pzRawData);
+    }
+
+    @Override
+    public int insertPzRawDataVo(PzRawDataVo pzRawDataVo)
+    {
+        pzRawDataVo.setCreateTime(DateUtils.getNowDate());
+        return pzRawDataMapper.insertPzRawDataVo(pzRawDataVo);
+    }
+
+    /**
+     * 修改原始数据导入
+     * 
+     * @param pzRawData 原始数据导入
+     * @return 结果
+     */
+    @Override
+    public int updatePzRawData(PzRawData pzRawData)
+    {
+        return pzRawDataMapper.updatePzRawData(pzRawData);
+    }
+    @Override
+    public int updatePzRawDataVo(PzRawDataVo pzRawDataVo)
+    {
+        return pzRawDataMapper.updatePzRawDataVo(pzRawDataVo);
+    }
+
+    /**
+     * 批量删除原始数据导入
+     * 
+     * @param ids 需要删除的原始数据导入主键
+     * @return 结果
+     */
+    @Override
+    public int deletePzRawDataByIds(Long[] ids)
+    {
+        return pzRawDataMapper.deletePzRawDataByIds(ids);
+    }
+
+    /**
+     * 删除原始数据导入信息
+     * 
+     * @param id 原始数据导入主键
+     * @return 结果
+     */
+    @Override
+    public int deletePzRawDataById(Long id)
+    {
+        return pzRawDataMapper.deletePzRawDataById(id);
+    }
+
+    @Override
+    public PzRawDataVo checkIfDataExists(String ticketName)
+    {
+        PzRawDataVo pzRawDataVo = pzRawDataMapper.checkIfDataExists(ticketName);
+        return pzRawDataVo;
+    }
+
+    /**
+     * 导入用户数据
+     *
+     * @param userList        用户数据列表
+     * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
+     * @param operName        操作用户
+     * @return 结果
+     */
+    @Override
+    public String importData(List<PzRawDataVo> userList, Boolean isUpdateSupport, String operName) {
+        if (StringUtils.isNull(userList) || userList.size() == 0) {
+            throw new ServiceException("导入用户数据不能为空!");
+        }
+        StringBuilder successMsg = new StringBuilder();
+        StringBuilder failureMsg = new StringBuilder();
+        for (PzRawDataVo data : userList) {
+            try {
+                // 检查数据是否已存在
+                PzRawDataVo isExist = checkIfDataExists(data.getTicketName());
+                data.setTicketId(isExist.getId());
+                insertPzRawDataVo(data);
+                String msg = "【成功】" + data.toString() + " 导入成功:" ;
+                failureMsg.append(msg).append("\n");
+            } catch (Exception e) {
+                String msg = "【失败】" + data.toString() + " 导入失败:" + e.getMessage();
+                failureMsg.append(msg).append("\n");
+            }
+        }
+        return successMsg.toString();
+    }
+
+
+}

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

@@ -1,6 +1,8 @@
 package com.songhua.system.service.impl;
 
 import java.util.List;
+
+import com.songhua.common.core.domain.entity.SysUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.songhua.system.mapper.PzTicketTypeManagementMapper;
@@ -90,4 +92,9 @@ public class PzTicketTypeManagementServiceImpl implements IPzTicketTypeManagemen
     {
         return pzTicketTypeManagementMapper.deletePzTicketTypeManagementById(id);
     }
+
+    @Override
+    public int updateStatus(PzTicketTypeManagement pzTicketTypeManagement) {
+        return pzTicketTypeManagementMapper.updatePzTicketTypeManagement(pzTicketTypeManagement);
+    }
 }

+ 129 - 0
songhua-system/src/main/resources/mapper/system/PzRawDataMapper.xml

@@ -0,0 +1,129 @@
+<?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.PzRawDataMapper">
+    
+    <resultMap type="PzRawData" id="PzRawDataResult">
+        <result property="id"    column="id"    />
+        <result property="number"    column="number"    />
+        <result property="money"    column="money"    />
+        <result property="payType"    column="pay_type"    />
+        <result property="ticketId"    column="ticket_id"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <resultMap type="PzRawDataVo" id="PzRawDataVoResult">
+        <result property="id"    column="id"    />
+        <result property="ticketName"    column="ticket_name"    />
+        <result property="number"    column="number"    />
+        <result property="money"    column="money"    />
+        <result property="payType"    column="pay_type"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="ticketId"    column="ticket_id"    />
+    </resultMap>
+
+    <sql id="selectPzRawDataVo">
+        select id, number, money, pay_type, create_time,ticket_id from pz_raw_data
+    </sql>
+
+    <select id="selectPzRawDataList" parameterType="PzRawDataVo" resultMap="PzRawDataVoResult">
+        SELECT
+        a.id,
+        a.number,
+        a.money,
+        a.pay_type,
+        a.create_time,
+        a.ticket_id,
+        b.ticket_name
+        FROM
+        pz_raw_data a
+        LEFT JOIN pz_ticket_type_management b ON a.ticket_id = b.id
+        <where>  
+            <if test="number != null "> and number = #{number}</if>
+            <if test="money != null  and money != ''"> and money = #{money}</if>
+            <if test="payType != null  and payType != ''"> and pay_type = #{payType}</if>
+        </where>
+    </select>
+    
+    <select id="selectPzRawDataById" parameterType="Long" resultMap="PzRawDataResult">
+        <include refid="selectPzRawDataVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertPzRawData" parameterType="PzRawData" useGeneratedKeys="true" keyProperty="id">
+        insert into pz_raw_data
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="number != null">number,</if>
+            <if test="money != null">money,</if>
+            <if test="payType != null">pay_type,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="number != null">#{number},</if>
+            <if test="money != null">#{money},</if>
+            <if test="payType != null">#{payType},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <insert id="insertPzRawDataVo" parameterType="PzRawDataVo" useGeneratedKeys="true" keyProperty="id">
+        insert into pz_raw_data
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="number != null">number,</if>
+            <if test="ticketId != null">ticket_id,</if>
+            <if test="money != null">money,</if>
+            <if test="payType != null">pay_type,</if>
+            <if test="createTime != null">create_time,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="number != null">#{number},</if>
+            <if test="ticketId != null">#{ticketId},</if>
+            <if test="money != null">#{money},</if>
+            <if test="payType != null">#{payType},</if>
+            <if test="createTime != null">#{createTime},</if>
+        </trim>
+    </insert>
+
+    <update id="updatePzRawData" parameterType="PzRawData">
+        update pz_raw_data
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="number != null">number = #{number},</if>
+            <if test="money != null">money = #{money},</if>
+            <if test="payType != null">pay_type = #{payType},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updatePzRawDataVo" parameterType="PzRawDataVo">
+        update pz_raw_data
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="number != null">number = #{number},</if>
+            <if test="ticketId != null">ticket_id = #{ticketId},</if>
+            <if test="money != null">money = #{money},</if>
+            <if test="payType != null">pay_type = #{payType},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deletePzRawDataById" parameterType="Long">
+        delete from pz_raw_data where id = #{id}
+    </delete>
+
+    <delete id="deletePzRawDataByIds" parameterType="String">
+        delete from pz_raw_data where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="checkIfDataExists" parameterType="PzRawDataVo" resultMap="PzRawDataVoResult">
+        SELECT
+            id
+        FROM
+            pz_ticket_type_management  where ticket_name = #{ticketName}
+    </select>
+
+</mapper>

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

@@ -10,10 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="ticketType"    column="ticket_type"    />
         <result property="settlementPrice"    column="settlement_price"    />
         <result property="remarks"    column="remarks"    />
+        <result property="status"    column="status"    />
     </resultMap>
 
     <sql id="selectPzTicketTypeManagementVo">
-        select id, ticket_name, ticket_type, settlement_price, remarks from pz_ticket_type_management
+        select id, ticket_name, ticket_type, settlement_price, remarks,status from pz_ticket_type_management
     </sql>
 
     <select id="selectPzTicketTypeManagementList" parameterType="PzTicketTypeManagement" resultMap="PzTicketTypeManagementResult">
@@ -38,12 +39,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ticketType != null">ticket_type,</if>
             <if test="settlementPrice != null">settlement_price,</if>
             <if test="remarks != null">remarks,</if>
+            <if test="status != null">status,</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>
+            <if test="status != null">#{status},</if>
          </trim>
     </insert>
 
@@ -54,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="ticketType != null">ticket_type = #{ticketType},</if>
             <if test="settlementPrice != null">settlement_price = #{settlementPrice},</if>
             <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
         </trim>
         where id = #{id}
     </update>

+ 45 - 0
songhua-ui/src/api/system/data.js

@@ -0,0 +1,45 @@
+import request from '@/utils/request'
+
+// 查询原始数据导入列表
+export function listData(query) {
+  return request({
+    url: '/system/data/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询原始数据导入详细
+export function getData(id) {
+  return request({
+    url: '/system/data/' + id,
+    method: 'get'
+  })
+}
+
+// 新增原始数据导入
+export function addData(data) {
+  return request({
+    url: '/system/data',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改原始数据导入
+export function updateData(data) {
+  return request({
+    url: '/system/data',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除原始数据导入
+export function delData(id) {
+  return request({
+    url: '/system/data/' + id,
+    method: 'delete'
+  })
+}
+

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

@@ -42,3 +42,16 @@ export function delManagement(id) {
     method: 'delete'
   })
 }
+
+// 状态修改
+export function changeStatus(id, status) {
+  const data = {
+    id,
+    status
+  }
+  return request({
+    url: '/system/ticket/changeStatus',
+    method: 'put',
+    data: data
+  })
+}