Преглед на файлове

分類→テーマ変更

libin преди 2 години
родител
ревизия
eee1bdda9f

+ 4 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/pcApi/domain/TCommodityManage.java

@@ -34,6 +34,10 @@ public class TCommodityManage extends BaseEntity
     @Excel(name = "商品类型id")
     private Long typeId;
 
+    /** 商品类型ids(复数) */
+    @Excel(name = "商品类型ids(复数) ")
+    private String typeSelected;
+
     /** 商品名称 */
     @Excel(name = "商品名称")
     private String commodityName;

+ 14 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/pcApi/service/impl/TCommodityManageServiceImpl.java

@@ -12,6 +12,7 @@ import com.ruoyi.web.pcApi.domain.TCommodityCoupon;
 import com.ruoyi.web.pcApi.domain.TCommoditySchedul;
 import com.ruoyi.web.pcApi.mapper.TCommodityCouponMapper;
 import com.ruoyi.web.pcApi.mapper.TCommoditySchedulMapper;
+import com.ruoyi.web.pcApi.mapper.TCommodityTypeMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -37,6 +38,8 @@ public class TCommodityManageServiceImpl implements ITCommodityManageService
     private TCommodityCouponMapper tCommodityCouponMapper;
     @Autowired
     private TCommoditySchedulMapper tCommoditySchedulMapper;
+    @Autowired
+    private TCommodityTypeMapper tCommodityTypeMapper;
     /**
      * 查询商品信息管理
      * 
@@ -62,7 +65,17 @@ public class TCommodityManageServiceImpl implements ITCommodityManageService
     @DataScope(deptAlias = "a")
     public List<TCommodityManage> selectTCommodityManageList(TCommodityManage tCommodityManage)
     {
-        return tCommodityManageMapper.selectTCommodityManageList(tCommodityManage);
+        List<TCommodityManage> tCommodityManagelist = tCommodityManageMapper.selectTCommodityManageList(tCommodityManage);
+        for (TCommodityManage tCommodity : tCommodityManagelist)
+        {
+            String[] selectedTypes = tCommodity.getTypeSelected().split(",");
+            ArrayList<String> selectedTypeNames=new ArrayList<>();
+            for (String selectedType : selectedTypes) {
+                selectedTypeNames.add(tCommodityTypeMapper.selectTCommodityTypeById(Long.valueOf(selectedType)).getTypeName());
+            };
+            tCommodity.setTypeName(String.join("・", selectedTypeNames));
+        }
+        return tCommodityManagelist;
     }
 
     /**

+ 10 - 3
ruoyi-admin/src/main/resources/mapper/commodity/TCommodityManageMapper.xml

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="TCommodityManage" id="TCommodityManageResult">
         <result property="id"    column="id"    />
         <result property="typeId"    column="type_id"    />
+        <result property="typeSelected"    column="type_selected"    />
         <result property="commodityName"    column="commodity_name"    />
         <result property="departurePlace"    column="departure_place"    />
         <result property="adultPrice"    column="adult_price"    />
@@ -57,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT
             a.id,
             a.type_id,
+            a.type_selected,
             a.commodity_name,
             a.departure_place,
             a.adult_price,
@@ -94,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTCommodityManageVo"/>
         where a.del_flag = '0'
             <if test="typeId != null "> and a.type_id = #{typeId}</if>
+            <if test="typeSelected != null "> and a.type_selected = #{typeSelected}</if>
             <if test="commodityName != null  and commodityName != ''"> and a.commodity_name like concat('%', #{commodityName}, '%')</if>
             <if test="departurePlace != null  and departurePlace != ''"> and a.departure_place = #{departurePlace}</if>
             <if test="adultPrice != null "> and a.adult_price = #{adultPrice}</if>
@@ -128,8 +131,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTCommodityManageList4H5" parameterType="TCommodityManage" resultMap="TCommodityManageResult">
         <include refid="selectTCommodityManageVo"/>
-        where a.del_flag = '0' and  date_format(now(),'%Y-%m-%d') between a.period_start and a.period_end
-        <if test="typeId != null "> and a.type_id = #{typeId}</if>
+        where a.del_flag = '0' and  date_format(now(),'%Y-%m-%d') &lt;= a.period_end
+        <if test="typeId != null "> and a.type_selected like concat('%', #{typeId},'%')</if>
         <if test="commodityName != null  and commodityName != ''"> and a.commodity_name like concat('%', #{commodityName}, '%')</if>
         <if test="departurePlace != null  and departurePlace != ''"> and a.departure_place = #{departurePlace}</if>
         <if test="adultPrice != null "> and a.adult_price = #{adultPrice}</if>
@@ -161,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     
     <select id="selectTCommodityManageById" parameterType="Long" resultMap="TCommodityManageTCommodityJourneyInformationResult">
-        select a.id, a.type_id, a.commodity_name, a.departure_place, a.adult_price, a.child_price, a.stock, a.child_price_explain, a.face_img, a.commodity_img, a.is_coupon, a.period_start, a.period_end, a.period_week, a.target_people_num, a.advance_period, a.attention, a.specification, a.sale_num, a.is_recommend, a.is_preferred, a.status, a.dept_id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
+        select a.id, a.type_id, a.type_selected, a.commodity_name, a.departure_place, a.adult_price, a.child_price, a.stock, a.child_price_explain, a.face_img, a.commodity_img, a.is_coupon, a.period_start, a.period_end, a.period_week, a.target_people_num, a.advance_period, a.attention, a.specification, a.sale_num, a.is_recommend, a.is_preferred, a.status, a.dept_id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark,
  b.id as sub_id, b.commodity_id as sub_commodity_id, b.journey_time as sub_journey_time, b.detail as sub_detail, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.remark as sub_remark
         from t_commodity_manage a
         left join t_commodity_journey_information b on b.commodity_id = a.id
@@ -172,6 +175,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into t_commodity_manage
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="typeId != null">type_id,</if>
+            <if test="typeSelected != null">type_selected,</if>
             <if test="commodityName != null and commodityName != ''">commodity_name,</if>
             <if test="departurePlace != null and departurePlace != ''">departure_place,</if>
             <if test="adultPrice != null">adult_price,</if>
@@ -202,6 +206,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="typeId != null">#{typeId},</if>
+            <if test="typeSelected != null">#{typeSelected},</if>
             <if test="commodityName != null and commodityName != ''">#{commodityName},</if>
             <if test="departurePlace != null and departurePlace != ''">#{departurePlace},</if>
             <if test="adultPrice != null">#{adultPrice},</if>
@@ -236,6 +241,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update t_commodity_manage
         <trim prefix="SET" suffixOverrides=",">
             <if test="typeId != null">type_id = #{typeId},</if>
+            <if test="typeSelected != null">type_selected = #{typeSelected},</if>
             <if test="commodityName != null and commodityName != ''">commodity_name = #{commodityName},</if>
             <if test="departurePlace != null and departurePlace != ''">departure_place = #{departurePlace},</if>
             <if test="adultPrice != null">adult_price = #{adultPrice},</if>
@@ -321,6 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectTCommodityManageVo"/>
         where a.del_flag = '0'
         <if test="typeId != null "> and a.type_id = #{typeId}</if>
+        <if test="typeSelected != null "> and a.type_selected = #{typeSelected}</if>
         <if test="commodityName != null  and commodityName != ''"> and a.commodity_name like concat('%', #{commodityName}, '%')</if>
         <if test="departurePlace != null  and departurePlace != ''"> and a.departure_place = #{departurePlace}</if>
         <if test="adultPrice != null "> and a.adult_price = #{adultPrice}</if>