Sfoglia il codice sorgente

修改油品价格,油品调价表字段,油枪字段

MS-QJVSRANLTYEO\Administrator 4 anni fa
parent
commit
fa83f0a9b3

+ 10 - 4
yijia-station/src/main/java/com/yijia/station/controller/StationOilPriceAdjustController.java

@@ -81,9 +81,17 @@ public class StationOilPriceAdjustController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(StationOilPriceAdjust stationOilPriceAdjust)
     {
-        List<StationOilPriceAdjust> list = stationOilPriceAdjustService.selectStationOilPriceAdjustList(stationOilPriceAdjust);
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+        SysDept dept =new SysDept();
+        dept.setDeptId(currentUser.getUser().getDeptId());
+        List<String> list = sysDeptService.selectDeptId(dept);
+        if(list!=null && list.size()>0){
+            stationOilPriceAdjust.setStationIdList(list);
+            stationOilPriceAdjust.setStationId(null);
+        }
+        List<StationOilPriceAdjust> adjustList = stationOilPriceAdjustService.selectStationOilPriceAdjustList(stationOilPriceAdjust);
         ExcelUtil<StationOilPriceAdjust> util = new ExcelUtil<StationOilPriceAdjust>(StationOilPriceAdjust.class);
-        return util.exportExcel(list, "adjust");
+        return util.exportExcel(adjustList, "adjust");
     }
 
     /**
@@ -113,7 +121,6 @@ public class StationOilPriceAdjustController extends BaseController
         stationOilPriceAdjust.setOperator(currentUser.getUsername());
         stationOilPriceAdjust.setStatus("1");
         stationOilPriceAdjust.setStationId(currentUser.getUser().getDeptId());
-        stationOilPriceAdjust.setStationName(currentUser.getUser().getDept().getDeptName());
        int i= stationOilPriceAdjustService.insertStationOilPriceAdjust(stationOilPriceAdjust);
        //查询出刚添加的油品调价信息
         if(stationOilPriceAdjust.getTakeEffectStatus()!=null && stationOilPriceAdjust.getTakeEffectStatus().equals("1")){
@@ -155,7 +162,6 @@ public class StationOilPriceAdjustController extends BaseController
     {
         LoginUser currentUser = SecurityUtils.getLoginUser();
         stationOilPriceAdjust.setStationId(currentUser.getUser().getDeptId());
-        stationOilPriceAdjust.setStationName(currentUser.getUser().getDept().getDeptName());
         return toAjax(stationOilPriceAdjustService.updateStationOilPriceAdjust(stationOilPriceAdjust));
     }
 

+ 0 - 1
yijia-station/src/main/java/com/yijia/station/domain/StationOilPrice.java

@@ -36,7 +36,6 @@ public class StationOilPrice extends BaseEntity
     private Long stationId;
 
     /** 油站名称 */
-    @Excel(name = "油站名称")
     private String stationName;
 
     /** 操作时间 */

+ 16 - 11
yijia-station/src/main/java/com/yijia/station/service/impl/StationPayServiceImpl.java

@@ -1,5 +1,6 @@
 package com.yijia.station.service.impl;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.alibaba.fastjson.JSON;
@@ -13,12 +14,12 @@ import com.yijia.station.service.IStationPayService;
 
 /**
  * 油站支付设置Service业务层处理
- * 
+ *
  * @author yijia
  * @date 2020-12-10
  */
 @Service
-public class StationPayServiceImpl implements IStationPayService 
+public class StationPayServiceImpl implements IStationPayService
 {
     @Autowired
     private StationPayMapper stationPayMapper;
@@ -27,7 +28,7 @@ public class StationPayServiceImpl implements IStationPayService
 
     /**
      * 查询油站支付设置
-     * 
+     *
      * @param payId 油站支付设置ID
      * @return 油站支付设置
      */
@@ -39,7 +40,7 @@ public class StationPayServiceImpl implements IStationPayService
 
     /**
      * 查询油站支付设置列表
-     * 
+     *
      * @param stationPay 油站支付设置
      * @return 油站支付设置
      */
@@ -51,7 +52,7 @@ public class StationPayServiceImpl implements IStationPayService
 
     /**
      * 新增油站支付设置
-     * 
+     *
      * @param stationPay 油站支付设置
      * @return 结果
      */
@@ -74,7 +75,7 @@ public class StationPayServiceImpl implements IStationPayService
 
     /**
      * 修改油站支付设置
-     * 
+     *
      * @param stationPay 油站支付设置
      * @return 结果
      */
@@ -103,7 +104,7 @@ public class StationPayServiceImpl implements IStationPayService
 
     /**
      * 批量删除油站支付设置
-     * 
+     *
      * @param payIds 需要删除的油站支付设置ID
      * @return 结果
      */
@@ -115,7 +116,7 @@ public class StationPayServiceImpl implements IStationPayService
 
     /**
      * 删除油站支付设置信息
-     * 
+     *
      * @param payId 油站支付设置ID
      * @return 结果
      */
@@ -131,7 +132,6 @@ public class StationPayServiceImpl implements IStationPayService
         List<StationPay>  list= stationPayMapper.selectStationPayList(stationPay);
          if(list!=null && list.size()>0){
             pay.setPayId(list.get(0).getPayId());
-            pay.setPayMode(list.get(0).getPayMode());
             pay.setStationId(list.get(0).getStationId());
             pay.setStationName(list.get(0).getStationName());
             pay.setImagePhotosFlag(list.get(0).getImagePhotosFlag());
@@ -151,8 +151,13 @@ public class StationPayServiceImpl implements IStationPayService
             StationPic stationPic =new StationPic();
             stationPic.setStationId(pay.getStationId());
             stationPic.setParentId(pay.getPayId());
-            List<StationPic> stationPicList =stationPicMapper.selectStationPicList(stationPic);
-            pay.setImgFileList(stationPicList);
+            List<StationPic> stationPicList = new ArrayList<>();
+            if(stationPicList!=null && stationPicList.size()>0){
+                stationPicList =stationPicMapper.selectStationPicList(stationPic);
+                pay.setImgFileList(stationPicList);
+            }else{
+                pay.setImgFileList(stationPicList);
+            }
         }
         return pay;
     }

+ 13 - 32
yijia-station/src/main/resources/mapper/station/StationOilGunMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yijia.station.mapper.StationOilGunMapper">
-    
+
     <resultMap type="StationOilGun" id="StationOilGunResult">
         <result property="oilGunId"    column="oil_gun_id"    />
         <result property="oilGunNo"    column="oil_gun_no"    />
@@ -12,25 +12,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="stationId"    column="station_id"    />
         <result property="stationName"    column="station_name"    />
         <result property="date"    column="date"    />
-        <result property="status"    column="status"    />
-        <result property="oilGunType"    column="oil_gun_type"    />
     </resultMap>
 
-    <sql id="selectStationOilGunVo">
-        select oil_gun_id, oil_gun_no, oil_name, oil_price, station_id, station_name, date, status, oil_gun_type from station_oil_gun
-    </sql>
-
     <select id="selectStationOilGunList" parameterType="StationOilGun" resultMap="StationOilGunResult">
-        <include refid="selectStationOilGunVo"/>
-        <where>  
-            <if test="oilGunNo != null  and oilGunNo != ''"> and oil_gun_no = #{oilGunNo}</if>
-            <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
-            <if test="oilPrice != null "> and oil_price = #{oilPrice}</if>
+        select oil_gun_id, oil_gun_no, oil_name, oil_price, station_id,d.dept_name as station_name, date
+        from station_oil_gun  g  join sys_dept  d on g.station_id =d.dept_id
+        <where>
+            <if test="oilGunNo != null  and oilGunNo != ''"> and g.oil_gun_no = #{oilGunNo}</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="date != null "> and date = #{date}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="oilGunType != null  and oilGunType != ''"> and oil_gun_type = #{oilGunType}</if>
             <if test="stationIdList != null ">
                 and station_id in
                 <foreach item="item" index="index" collection="stationIdList"
@@ -40,12 +29,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
     </select>
-    
+
     <select id="selectStationOilGunById" parameterType="Long" resultMap="StationOilGunResult">
-        <include refid="selectStationOilGunVo"/>
-        where oil_gun_id = #{oilGunId}
+      select oil_gun_id, oil_gun_no, oil_name, oil_price, station_id,d.dept_name as station_name, date
+		from station_oil_gun  g  join sys_dept  d on g.station_id =d.dept_id
+        where g.oil_gun_id = #{oilGunId}
     </select>
-        
+
     <insert id="insertStationOilGun" parameterType="StationOilGun" useGeneratedKeys="true" keyProperty="oilGunId">
         insert into station_oil_gun
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -53,20 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilName != null">oil_name,</if>
             <if test="oilPrice != null">oil_price,</if>
             <if test="stationId != null">station_id,</if>
-            <if test="stationName != null">station_name,</if>
             <if test="date != null">date,</if>
-            <if test="status != null">status,</if>
-            <if test="oilGunType != null">oil_gun_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="oilGunNo != null">#{oilGunNo},</if>
             <if test="oilName != null">#{oilName},</if>
             <if test="oilPrice != null">#{oilPrice},</if>
             <if test="stationId != null">#{stationId},</if>
-            <if test="stationName != null">#{stationName},</if>
             <if test="date != null">#{date},</if>
-            <if test="status != null">#{status},</if>
-            <if test="oilGunType != null">#{oilGunType},</if>
          </trim>
     </insert>
 
@@ -77,10 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="oilName != null">oil_name = #{oilName},</if>
             <if test="oilPrice != null">oil_price = #{oilPrice},</if>
             <if test="stationId != null">station_id = #{stationId},</if>
-            <if test="stationName != null">station_name = #{stationName},</if>
             <if test="date != null">date = #{date},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="oilGunType != null">oil_gun_type = #{oilGunType},</if>
         </trim>
         where oil_gun_id = #{oilGunId}
     </update>
@@ -90,10 +71,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteStationOilGunByIds" parameterType="String">
-        delete from station_oil_gun where oil_gun_id in 
+        delete from station_oil_gun where oil_gun_id in
         <foreach item="oilGunId" collection="array" open="(" separator="," close=")">
             #{oilGunId}
         </foreach>
     </delete>
-    
-</mapper>
+
+</mapper>

+ 28 - 33
yijia-station/src/main/resources/mapper/station/StationOilPriceAdjustMapper.xml

@@ -3,7 +3,7 @@
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.yijia.station.mapper.StationOilPriceAdjustMapper">
-    
+
     <resultMap type="StationOilPriceAdjust" id="StationOilPriceAdjustResult">
         <result property="adjustPriceId"    column="adjust_price_id"    />
         <result property="oilName"    column="oil_name"    />
@@ -18,42 +18,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="oilPriceId"    column="oil_price_id"    />
     </resultMap>
 
-    <sql id="selectStationOilPriceAdjustVo">
-        select adjust_price_id, oil_name, oil_adjust_price, take_effect_status, take_effect_date, adjust_date, station_id, station_name, operator, status, oil_price_id from station_oil_price_adjust
-    </sql>
-
     <select id="selectStationOilPriceAdjustList" parameterType="StationOilPriceAdjust" resultMap="StationOilPriceAdjustResult">
-        <include refid="selectStationOilPriceAdjustVo"/>
-        <where>  
-            <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
-            <if test="oilAdjustPrice != null  and oilAdjustPrice != ''"> and oil_adjust_price = #{oilAdjustPrice}</if>
-            <if test="takeEffectStatus != null  and takeEffectStatus != ''"> and take_effect_status = #{takeEffectStatus}</if>
-            <if test="takeEffectDate != null "> and take_effect_date = #{takeEffectDate}</if>
-            <if test="adjustDate != null "> and adjust_date = #{adjustDate}</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="operator != null  and operator != ''"> and operator = #{operator}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-            <if test="oilPriceId != null "> and oil_price_id = #{oilPriceId}</if>
+        select a.adjust_price_id, a.oil_name, a.oil_adjust_price, a.take_effect_status, a.take_effect_date, a.adjust_date, a.station_id, d.dept_name as station_name,a.operator,
+        a.oil_price_id,a.status
+        from station_oil_price_adjust a join sys_dept  d on a.station_id =d.dept_id
+        <where>
+            <if test="oilName != null  and oilName != ''"> and a.oil_name like concat('%', #{oilName}, '%')</if>
+            <if test="oilAdjustPrice != null  and oilAdjustPrice != ''"> and a.oil_adjust_price = #{oilAdjustPrice}</if>
+            <if test="takeEffectStatus != null  and takeEffectStatus != ''"> and a.take_effect_status = #{takeEffectStatus}</if>
+            <if test="takeEffectDate != null "> and a.take_effect_date = #{takeEffectDate}</if>
+            <if test="adjustDate != null "> and a.adjust_date = #{adjustDate}</if>
+            <if test="stationId != null "> and a.station_id = #{stationId}</if>
+            <if test="oilPriceId != null "> and a.oil_price_id = #{oilPriceId}</if>
+            <if test="status != null "> and a.status = #{status}</if>
             <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
-                AND date_format(take_effect_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
+                AND date_format(a.take_effect_date,'%Y-%m-%d %H:%i:%s') &lt;= date_format(#{endTime},'%Y-%m-%d %H:%i:%s')
             </if>
             <if test="stationIdList != null ">
-                and station_id in
+                and a.station_id in
                 <foreach item="item" index="index" collection="stationIdList"
                          open="(" separator="," close=")">
                     #{item}
                 </foreach>
             </if>
         </where>
-        order by adjust_price_id desc
+        order by a.adjust_price_id desc
     </select>
-    
+
     <select id="selectStationOilPriceAdjustById" parameterType="Long" resultMap="StationOilPriceAdjustResult">
-        <include refid="selectStationOilPriceAdjustVo"/>
-        where adjust_price_id = #{adjustPriceId}
+         select a.adjust_price_id, a.oil_name, a.oil_adjust_price, a.take_effect_status, a.take_effect_date, a.adjust_date, a.station_id, d.dept_name as station_name,a.operator,
+        a.oil_price_id,a.status
+        from station_oil_price_adjust a join sys_dept  d on a.station_id =d.dept_id
+        where a.adjust_price_id = #{adjustPriceId}
     </select>
-        
+
     <insert id="insertStationOilPriceAdjust" parameterType="StationOilPriceAdjust" useGeneratedKeys="true" keyProperty="adjustPriceId">
         insert into station_oil_price_adjust
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -63,10 +61,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="takeEffectDate != null">take_effect_date,</if>
             <if test="adjustDate != null">adjust_date,</if>
             <if test="stationId != null">station_id,</if>
-            <if test="stationName != null">station_name,</if>
             <if test="operator != null">operator,</if>
-            <if test="status != null">status,</if>
             <if test="oilPriceId != null">oil_price_id,</if>
+            <if test="status != null "> status,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="oilName != null">#{oilName},</if>
@@ -75,10 +72,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="takeEffectDate != null">#{takeEffectDate},</if>
             <if test="adjustDate != null">#{adjustDate},</if>
             <if test="stationId != null">#{stationId},</if>
-            <if test="stationName != null">#{stationName},</if>
             <if test="operator != null">#{operator},</if>
-            <if test="status != null">#{status},</if>
             <if test="oilPriceId != null">#{oilPriceId},</if>
+            <if test="status != null "> #{status},</if>
          </trim>
     </insert>
 
@@ -91,9 +87,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="takeEffectDate != null">take_effect_date = #{takeEffectDate},</if>
             <if test="adjustDate != null">adjust_date = #{adjustDate},</if>
             <if test="stationId != null">station_id = #{stationId},</if>
-            <if test="stationName != null">station_name = #{stationName},</if>
             <if test="operator != null">operator = #{operator},</if>
-            <if test="status != null">status = #{status},</if>
+            <if test="status != null "> status = #{status},</if>
             <if test="oilPriceId != null">oil_price_id = #{oilPriceId},</if>
         </trim>
         where adjust_price_id = #{adjustPriceId}
@@ -104,10 +99,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <delete id="deleteStationOilPriceAdjustByIds" parameterType="String">
-        delete from station_oil_price_adjust where adjust_price_id in 
+        delete from station_oil_price_adjust where adjust_price_id in
         <foreach item="adjustPriceId" collection="array" open="(" separator="," close=")">
             #{adjustPriceId}
         </foreach>
     </delete>
-    
-</mapper>
+
+</mapper>

+ 18 - 22
yijia-station/src/main/resources/mapper/station/StationOilPriceMapper.xml

@@ -12,21 +12,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="stationName"    column="station_name"    />
         <result property="date"    column="date"    />
     </resultMap>
-
-    <sql id="selectStationOilPriceVo">
-        select oil_price_id, oil_name, oil_price, station_id, station_name, date from station_oil_price
-    </sql>
-
     <select id="selectStationOilPriceList" parameterType="StationOilPrice" resultMap="StationOilPriceResult">
-        <include refid="selectStationOilPriceVo"/>
+        select oil_price_id, oil_name, oil_price, station_id, d.dept_name as station_name, date
+        from station_oil_price p join sys_dept d
+        on  p.station_id = d.dept_id
         <where>
-            <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
-            <if test="oilPrice != null  and oilPrice != ''"> and oil_price = #{oilPrice}</if>
-            <if test="stationId != null "> and station_id = #{stationId}</if>
-            <if test="stationName != null  and stationName != ''"> and station_name = #{stationName}</if>
-            <if test="date != null "> and date = #{date}</if>
+            <if test="oilName != null  and oilName != ''"> and p.oil_name like concat('%', #{oilName}, '%')</if>
+            <if test="oilPrice != null  and oilPrice != ''"> and p.oil_price = #{oilPrice}</if>
+            <if test="stationId != null "> and p.station_id = #{stationId}</if>
             <if test="stationIdList != null ">
-                and station_id in
+                and p.station_id in
                 <foreach item="item" index="index" collection="stationIdList"
                          open="(" separator="," close=")">
                     #{item}
@@ -35,15 +30,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
     <select id="oilNameInfo" parameterType="StationOilPrice" resultMap="StationOilPriceResult">
-        <include refid="selectStationOilPriceVo"/>
+        select oil_price_id, oil_name, oil_price, station_id, d.dept_name as station_name, date
+        from station_oil_price p join sys_dept d
+        on  p.station_id = d.dept_id
         <where>
-            <if test="oilName != null  and oilName != ''"> and oil_name like concat('%', #{oilName}, '%')</if>
-            <if test="oilPrice != null  and oilPrice != ''"> and oil_price = #{oilPrice}</if>
-            <if test="stationId != null "> and station_id = #{stationId}</if>
-            <if test="stationName != null  and stationName != ''"> and station_name = #{stationName}</if>
-            <if test="date != null "> and date = #{date}</if>
+            <if test="oilName != null  and oilName != ''"> and p.oil_name like concat('%', #{oilName}, '%')</if>
+            <if test="oilPrice != null  and oilPrice != ''"> and p.oil_price = #{oilPrice}</if>
+            <if test="stationId != null "> and p.station_id = #{stationId}</if>
             <if test="stationIdList != null ">
-                and station_id in
+                and p.station_id in
                 <foreach item="item" index="index" collection="stationIdList"
                          open="(" separator="," close=")">
                     #{item}
@@ -53,10 +48,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
 
-
     <select id="selectStationOilPriceById" parameterType="Long" resultMap="StationOilPriceResult">
-        <include refid="selectStationOilPriceVo"/>
-        where oil_price_id = #{oilPriceId}
+        select oil_price_id, oil_name, oil_price, station_id, d.dept_name as station_name, date
+        from station_oil_price p join sys_dept d
+        on  p.station_id = d.dept_id
+        where p.oil_price_id = #{oilPriceId}
     </select>
 
     <insert id="insertStationOilPrice" parameterType="StationOilPrice" useGeneratedKeys="true" keyProperty="oilPriceId">