Bläddra i källkod

增加油站支付上传图片

MS-QJVSRANLTYEO\Administrator 4 år sedan
förälder
incheckning
2786a33f5a

+ 44 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/NoOilOrderController.java

@@ -0,0 +1,44 @@
+package com.yijia.station.controller;
+
+import com.yijia.common.core.controller.BaseController;
+import com.yijia.common.core.domain.model.LoginUser;
+import com.yijia.common.core.page.TableDataInfo;
+import com.yijia.common.utils.SecurityUtils;
+import com.yijia.station.domain.PayOrder;
+import com.yijia.station.service.IPayOrderService;
+import com.yijia.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
+import java.util.List;
+
+@RestController
+@RequestMapping("/station/noorder")
+public class NoOilOrderController  extends BaseController {
+    @Autowired
+    private IPayOrderService payOrderService;
+    @Autowired
+    private ISysUserService sysUserService;
+    /**
+     * 查询订单支付列表
+     */
+    @PreAuthorize("@ss.hasPermi('station:noorder:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(PayOrder payOrder)
+    {
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        String selectDeptid= sysUserService.getUserRoleDeptId(currentUser);
+        if(selectDeptid !=null && selectDeptid!=""){
+            List<String> list = Arrays.asList(selectDeptid.split(","));
+            payOrder.setStationIdList(list);
+        }
+        startPage();
+        payOrder.setStatus("1");
+        List<PayOrder> list = payOrderService.selectPayOrderList(payOrder);
+        return getDataTable(list);
+    }
+}

+ 103 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/controller/StationPicController.java

@@ -0,0 +1,103 @@
+package com.yijia.station.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.station.domain.StationPic;
+import com.yijia.station.service.IStationPicService;
+import com.yijia.common.utils.poi.ExcelUtil;
+import com.yijia.common.core.page.TableDataInfo;
+
+/**
+ * 油站支付管理图片Controller
+ * 
+ * @author yijia
+ * @date 2021-03-19
+ */
+@RestController
+@RequestMapping("/station/pic")
+public class StationPicController extends BaseController
+{
+    @Autowired
+    private IStationPicService stationPicService;
+
+    /**
+     * 查询油站支付管理图片列表
+     */
+    @PreAuthorize("@ss.hasPermi('station:pic:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(StationPic stationPic)
+    {
+        startPage();
+        List<StationPic> list = stationPicService.selectStationPicList(stationPic);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出油站支付管理图片列表
+     */
+    @PreAuthorize("@ss.hasPermi('station:pic:export')")
+    @Log(title = "油站支付管理图片", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(StationPic stationPic)
+    {
+        List<StationPic> list = stationPicService.selectStationPicList(stationPic);
+        ExcelUtil<StationPic> util = new ExcelUtil<StationPic>(StationPic.class);
+        return util.exportExcel(list, "pic");
+    }
+
+    /**
+     * 获取油站支付管理图片详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('station:pic:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return AjaxResult.success(stationPicService.selectStationPicById(id));
+    }
+
+    /**
+     * 新增油站支付管理图片
+     */
+    @PreAuthorize("@ss.hasPermi('station:pic:add')")
+    @Log(title = "油站支付管理图片", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody StationPic stationPic)
+    {
+        return toAjax(stationPicService.insertStationPic(stationPic));
+    }
+
+    /**
+     * 修改油站支付管理图片
+     */
+    @PreAuthorize("@ss.hasPermi('station:pic:edit')")
+    @Log(title = "油站支付管理图片", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody StationPic stationPic)
+    {
+        return toAjax(stationPicService.updateStationPic(stationPic));
+    }
+
+    /**
+     * 删除油站支付管理图片
+     */
+    @PreAuthorize("@ss.hasPermi('station:pic:remove')")
+    @Log(title = "油站支付管理图片", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(stationPicService.deleteStationPicByIds(ids));
+    }
+}

+ 110 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/domain/StationPic.java

@@ -0,0 +1,110 @@
+package com.yijia.station.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.yijia.common.annotation.Excel;
+import com.yijia.common.core.domain.BaseEntity;
+
+import java.util.List;
+
+/**
+ * 油站支付管理图片对象 station_pic
+ * 
+ * @author yijia
+ * @date 2021-03-19
+ */
+public class StationPic extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 图片名称 */
+    @Excel(name = "图片名称")
+    private String name;
+
+    /** 图片地址 */
+    @Excel(name = "图片地址")
+    private String url;
+
+    /** 油站ID */
+    @Excel(name = "油站ID")
+    private Long stationId;
+
+    /** 油站名称 */
+    @Excel(name = "油站名称")
+    private String stationName;
+
+    /** 支付管理id */
+    @Excel(name = "支付管理id")
+    private Long parentId;
+
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setName(String name) 
+    {
+        this.name = name;
+    }
+
+    public String getName() 
+    {
+        return name;
+    }
+    public void setUrl(String url) 
+    {
+        this.url = url;
+    }
+
+    public String getUrl() 
+    {
+        return url;
+    }
+    public void setStationId(Long stationId) 
+    {
+        this.stationId = stationId;
+    }
+
+    public Long getStationId() 
+    {
+        return stationId;
+    }
+    public void setStationName(String stationName) 
+    {
+        this.stationName = stationName;
+    }
+
+    public String getStationName() 
+    {
+        return stationName;
+    }
+    public void setParentId(Long parentId) 
+    {
+        this.parentId = parentId;
+    }
+
+    public Long getParentId() 
+    {
+        return parentId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("name", getName())
+            .append("url", getUrl())
+            .append("stationId", getStationId())
+            .append("stationName", getStationName())
+            .append("parentId", getParentId())
+            .toString();
+    }
+}

+ 67 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/mapper/StationPicMapper.java

@@ -0,0 +1,67 @@
+package com.yijia.station.mapper;
+
+import java.util.List;
+import com.yijia.station.domain.StationPic;
+
+/**
+ * 油站支付管理图片Mapper接口
+ * 
+ * @author yijia
+ * @date 2021-03-19
+ */
+public interface StationPicMapper 
+{
+    /**
+     * 查询油站支付管理图片
+     * 
+     * @param id 油站支付管理图片ID
+     * @return 油站支付管理图片
+     */
+    public StationPic selectStationPicById(Long id);
+
+    /**
+     * 查询油站支付管理图片列表
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 油站支付管理图片集合
+     */
+    public List<StationPic> selectStationPicList(StationPic stationPic);
+
+    /**
+     * 新增油站支付管理图片
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 结果
+     */
+    public int insertStationPic(StationPic stationPic);
+
+    /**
+     * 修改油站支付管理图片
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 结果
+     */
+    public int updateStationPic(StationPic stationPic);
+
+    /**
+     * 删除油站支付管理图片
+     * 
+     * @param id 油站支付管理图片ID
+     * @return 结果
+     */
+    public int deleteStationPicById(Long id);
+
+    /**
+     * 批量删除油站支付管理图片
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteStationPicByIds(Long[] ids);
+
+
+    /**
+     * 根据对象删除数据
+     */
+    public void deleteStationPay(StationPic stationPic);
+}

+ 61 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/IStationPicService.java

@@ -0,0 +1,61 @@
+package com.yijia.station.service;
+
+import java.util.List;
+import com.yijia.station.domain.StationPic;
+
+/**
+ * 油站支付管理图片Service接口
+ * 
+ * @author yijia
+ * @date 2021-03-19
+ */
+public interface IStationPicService 
+{
+    /**
+     * 查询油站支付管理图片
+     * 
+     * @param id 油站支付管理图片ID
+     * @return 油站支付管理图片
+     */
+    public StationPic selectStationPicById(Long id);
+
+    /**
+     * 查询油站支付管理图片列表
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 油站支付管理图片集合
+     */
+    public List<StationPic> selectStationPicList(StationPic stationPic);
+
+    /**
+     * 新增油站支付管理图片
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 结果
+     */
+    public int insertStationPic(StationPic stationPic);
+
+    /**
+     * 修改油站支付管理图片
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 结果
+     */
+    public int updateStationPic(StationPic stationPic);
+
+    /**
+     * 批量删除油站支付管理图片
+     * 
+     * @param ids 需要删除的油站支付管理图片ID
+     * @return 结果
+     */
+    public int deleteStationPicByIds(Long[] ids);
+
+    /**
+     * 删除油站支付管理图片信息
+     * 
+     * @param id 油站支付管理图片ID
+     * @return 结果
+     */
+    public int deleteStationPicById(Long id);
+}

+ 94 - 0
Yijia-SaaS/yijia-station/src/main/java/com/yijia/station/service/impl/StationPicServiceImpl.java

@@ -0,0 +1,94 @@
+package com.yijia.station.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.yijia.station.mapper.StationPicMapper;
+import com.yijia.station.domain.StationPic;
+import com.yijia.station.service.IStationPicService;
+
+/**
+ * 油站支付管理图片Service业务层处理
+ * 
+ * @author yijia
+ * @date 2021-03-19
+ */
+@Service
+public class StationPicServiceImpl implements IStationPicService 
+{
+    @Autowired
+    private StationPicMapper stationPicMapper;
+
+    /**
+     * 查询油站支付管理图片
+     * 
+     * @param id 油站支付管理图片ID
+     * @return 油站支付管理图片
+     */
+    @Override
+    public StationPic selectStationPicById(Long id)
+    {
+        return stationPicMapper.selectStationPicById(id);
+    }
+
+    /**
+     * 查询油站支付管理图片列表
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 油站支付管理图片
+     */
+    @Override
+    public List<StationPic> selectStationPicList(StationPic stationPic)
+    {
+        return stationPicMapper.selectStationPicList(stationPic);
+    }
+
+    /**
+     * 新增油站支付管理图片
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 结果
+     */
+    @Override
+    public int insertStationPic(StationPic stationPic)
+    {
+
+        return stationPicMapper.insertStationPic(stationPic);
+    }
+
+    /**
+     * 修改油站支付管理图片
+     * 
+     * @param stationPic 油站支付管理图片
+     * @return 结果
+     */
+    @Override
+    public int updateStationPic(StationPic stationPic)
+    {
+        return stationPicMapper.updateStationPic(stationPic);
+    }
+
+    /**
+     * 批量删除油站支付管理图片
+     * 
+     * @param ids 需要删除的油站支付管理图片ID
+     * @return 结果
+     */
+    @Override
+    public int deleteStationPicByIds(Long[] ids)
+    {
+        return stationPicMapper.deleteStationPicByIds(ids);
+    }
+
+    /**
+     * 删除油站支付管理图片信息
+     * 
+     * @param id 油站支付管理图片ID
+     * @return 结果
+     */
+    @Override
+    public int deleteStationPicById(Long id)
+    {
+        return stationPicMapper.deleteStationPicById(id);
+    }
+}

+ 87 - 0
Yijia-SaaS/yijia-station/src/main/resources/mapper/station/StationPicMapper.xml

@@ -0,0 +1,87 @@
+<?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.yijia.station.mapper.StationPicMapper">
+    
+    <resultMap type="StationPic" id="StationPicResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="url"    column="url"    />
+        <result property="stationId"    column="station_id"    />
+        <result property="stationName"    column="station_name"    />
+        <result property="parentId"    column="parent_id"    />
+    </resultMap>
+
+    <sql id="selectStationPicVo">
+        select id, name, url, station_id, station_name, parent_id from station_pic
+    </sql>
+
+    <select id="selectStationPicList" parameterType="StationPic" resultMap="StationPicResult">
+        <include refid="selectStationPicVo"/>
+        <where>  
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="url != null  and url != ''"> and url = #{url}</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="parentId != null "> and parent_id = #{parentId}</if>
+        </where>
+    </select>
+    
+    <select id="selectStationPicById" parameterType="Long" resultMap="StationPicResult">
+        <include refid="selectStationPicVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertStationPic" parameterType="StationPic" useGeneratedKeys="true" keyProperty="id">
+        insert into station_pic
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="name != null">name,</if>
+            <if test="url != null">url,</if>
+            <if test="stationId != null">station_id,</if>
+            <if test="stationName != null">station_name,</if>
+            <if test="parentId != null">parent_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="name != null">#{name},</if>
+            <if test="url != null">#{url},</if>
+            <if test="stationId != null">#{stationId},</if>
+            <if test="stationName != null">#{stationName},</if>
+            <if test="parentId != null">#{parentId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateStationPic" parameterType="StationPic">
+        update station_pic
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="url != null">url = #{url},</if>
+            <if test="stationId != null">station_id = #{stationId},</if>
+            <if test="stationName != null">station_name = #{stationName},</if>
+            <if test="parentId != null">parent_id = #{parentId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteStationPicById" parameterType="Long">
+        delete from station_pic where id = #{id}
+    </delete>
+
+    <delete id="deleteStationPicByIds" parameterType="String">
+        delete from station_pic where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    <delete id="deleteStationPay"  parameterType="StationPic">
+        delete from station_pic
+        <where>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="url != null  and url != ''"> and url = #{url}</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="parentId != null "> and parent_id = #{parentId}</if>
+        </where>
+    </delete>
+
+</mapper>