Browse Source

update:商品相关信息数据隔离

yonge 3 năm trước cách đây
mục cha
commit
573808d1cc

+ 4 - 3
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/GoodsDao.java

@@ -29,7 +29,7 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
      * @param goodsCategoryId
      * @return
      */
-    int findGoodsNumByCategoryId(@Param("goodsCategoryId") Integer goodsCategoryId);
+    int findGoodsNumByCategoryId(@Param("goodsCategoryId") Integer goodsCategoryId, @Param("tenantId") Integer tenantId);
 
     /**
      * 根据ids获取商品信息
@@ -39,7 +39,7 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
      */
     List<Goods> findGoodsByIds(@Param("ids") String ids);
 
-    List<Goods> findTypeGoods(@Param("type") String type);
+    List<Goods> findTypeGoods(@Param("type") String type, @Param("tenantId") Integer tenantId);
 
     /**
      * @param goodsList:
@@ -148,7 +148,8 @@ public interface GoodsDao extends BaseDAO<Integer, Goods> {
     List<MusicGroupGoodsAndDiscountDto> getMusicGroupGoodsAndDiscount(@Param("subjectId") Integer subjectId,
                                                                       @Param("type") String type,
                                                                       @Param("courseViewType") Integer courseViewType,
-                                                                      @Param("organId") Integer organId);
+                                                                      @Param("organId") Integer organId,
+                                                                      @Param("tenantId") Integer tenantId);
 
     /**
      * 是否存在已上架的商品编号

+ 4 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/GoodsService.java

@@ -9,8 +9,10 @@ import com.ym.mec.biz.dal.page.GoodsQuery;
 import com.ym.mec.biz.dal.page.GoodsQueryInfo;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.BaseService;
+
 import org.apache.ibatis.annotations.Param;
 import org.springframework.web.multipart.MultipartFile;
+
 import java.util.List;
 
 public interface GoodsService extends BaseService<Integer, Goods> {
@@ -43,7 +45,7 @@ public interface GoodsService extends BaseService<Integer, Goods> {
      * @param goodsCategoryId
      * @return
      */
-    int findGoodsNumByCategoryId(@Param("goodsCategoryId") Integer goodsCategoryId);
+    int findGoodsNumByCategoryId(Integer goodsCategoryId, Integer tenantId);
 
     /**
      * 根据ids获取商品信息
@@ -57,7 +59,7 @@ public interface GoodsService extends BaseService<Integer, Goods> {
      * @param type
      * @return
      */
-    List<Goods> findTypeGoods(String type);
+    List<Goods> findTypeGoods(String type, Integer tenantId);
 
     /**
      * @describe 商品导入

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/GoodsServiceImpl.java

@@ -181,8 +181,8 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 		return goodsDao.findGoodsBySubId(goodsQuery);
 	}
 
-	public int findGoodsNumByCategoryId(Integer goodsCategoryId){
-		return goodsDao.findGoodsNumByCategoryId(goodsCategoryId);
+	public int findGoodsNumByCategoryId(Integer goodsCategoryId, Integer tenantId){
+		return goodsDao.findGoodsNumByCategoryId(goodsCategoryId, tenantId);
 	}
 
 	@Override
@@ -191,8 +191,8 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods>  implement
 	}
 
 	@Override
-	public List<Goods> findTypeGoods(String type) {
-		return goodsDao.findTypeGoods(type);
+	public List<Goods> findTypeGoods(String type, Integer tenantId) {
+		return goodsDao.findTypeGoods(type, tenantId);
 	}
 
 	@Override

+ 4 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupSubjectPlanServiceImpl.java

@@ -13,11 +13,14 @@ import com.ym.mec.biz.service.*;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.common.tenant.TenantContextHolder;
+
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
+
 import java.math.BigDecimal;
 import java.util.Date;
 import java.util.List;
@@ -246,7 +249,7 @@ public class MusicGroupSubjectPlanServiceImpl extends BaseServiceImpl<Integer, M
             courseViewType = musicGroup.getCourseViewType().getCode();
             organId = musicGroup.getOrganId();
         }
-        List<MusicGroupGoodsAndDiscountDto> goodsList = goodsDao.getMusicGroupGoodsAndDiscount(subjectId, type, courseViewType,organId);
+        List<MusicGroupGoodsAndDiscountDto> goodsList = goodsDao.getMusicGroupGoodsAndDiscount(subjectId, type, courseViewType,organId, TenantContextHolder.getTenantId());
         if (chargeTypeId == null || (type != null && !"INSTRUMENT".equals(type))) {
             return goodsList;
         }

+ 14 - 12
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -46,6 +46,7 @@
         <result column="course_fee_show_organ_name_" property="courseFeeShowOrganName"/>
         <result column="member_fee_show_organ_id_" property="memberFeeShowOrganId"/>
         <result column="member_fee_show_organ_name_" property="memberFeeShowOrganName"/>
+        <result column="tenant_id_" property="tenantId"/>
     </resultMap>
 
     <!-- 根据主键查询一条记录 -->
@@ -60,7 +61,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="Goods">
-		SELECT * FROM goods ORDER BY id_
+		SELECT * FROM goods where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -70,20 +71,20 @@
         (goods_category_id_,sn_,name_,brand_,specification_,image_,stock_count_,tax_stock_count_,sell_count_,market_price_,
         discount_price_,group_purchase_price_,brief_,desc_,is_new_,is_top_,status_,memo_,publish_time_,
         complement_goods_id_list_,update_time_,create_time_,type_,agree_cost_price_,stock_warning_,stock_type_
-            ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_)
+            ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_,tenant_id_)
         VALUES(#{goodsCategoryId},#{sn},#{name},#{brand},#{specification},#{image},#{stockCount},#{taxStockCount},#{sellCount},#{marketPrice},
         #{discountPrice},#{groupPurchasePrice},#{brief},#{desc},
         #{isNew,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{isTop,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{status,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
         #{memo},#{publishTime},#{complementGoodsIdList},now(),now(),#{type,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{agreeCostPrice},
         #{stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}, #{stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-        #{studentShowOrganId},#{educationShowOrganId},#{replacementShowOrganId},#{courseFeeShowOrganId},#{memberFeeShowOrganId})
+        #{studentShowOrganId},#{educationShowOrganId},#{replacementShowOrganId},#{courseFeeShowOrganId},#{memberFeeShowOrganId},#{tenantId})
     </insert>
     <insert id="batchInsert" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
         INSERT INTO goods
         (goods_category_id_,name_,brand_,specification_,image_,market_price_,
         discount_price_,group_purchase_price_,brief_,desc_,update_time_,create_time_,type_,agree_cost_price_,sn_,
         stock_count_,tax_stock_count_,stock_warning_,stock_type_
-        ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_)
+        ,student_show_organ_id_,education_show_organ_id_,replacement_show_organ_id_,course_fee_show_organ_id_,member_fee_show_organ_id_,tenant_id_)
         VALUES
         <foreach collection="list" separator="," item="goods">
             (#{goods.goodsCategoryId},#{goods.name},#{goods.brand},#{goods.specification},#{goods.image},#{goods.marketPrice},
@@ -92,7 +93,7 @@
             #{goods.stockCount},#{goods.taxStockCount},
             #{goods.stockWarning,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
             #{goods.stockType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
-            #{goods.studentShowOrganId},#{goods.educationShowOrganId},#{goods.replacementShowOrganId},#{goods.courseFeeShowOrganId},#{goods.memberFeeShowOrganId}
+            #{goods.studentShowOrganId},#{goods.educationShowOrganId},#{goods.replacementShowOrganId},#{goods.courseFeeShowOrganId},#{goods.memberFeeShowOrganId},#{goods.tenantId}
             )
         </foreach>
     </insert>
@@ -179,7 +180,7 @@
             </if>
                 update_time_ = NOW()
         </set>
-        WHERE id_ = #{id}
+        WHERE id_ = #{id} and tenant_id_ = #{tenantId}
     </update>
 
     <update id="batchUpdate" parameterType="com.ym.mec.biz.dal.entity.Goods">
@@ -275,7 +276,7 @@
                 </if>
                     update_time_ = NOW()
             </set>
-            WHERE id_ = #{goods.id}
+            WHERE id_ = #{goods.id} and tenant_id_ = #{goods.tenantId}
         </foreach>
     </update>
 
@@ -301,6 +302,7 @@
 
     <sql id="queryGoodsPageSql">
         <where>
+        	g.tenant_id_ = #{tenantId}
             <if test="goodsCategoryId != null">
                 AND g.goods_category_id_ = #{goodsCategoryId}
             </if>
@@ -361,7 +363,7 @@
 
     <sql id="queryOrganIdSql">
         <where>
-                AND g.status_ != 0
+                AND g.status_ != 0 and g.tenant_id_ = #{goodsQuery.tenantId}
             <if test="goodsQuery.subjectId != null">
                 AND sgm.subject_id_ = #{goodsQuery.subjectId}
             </if>
@@ -396,13 +398,13 @@
 
     <!-- 根据 -->
     <select id="findGoodsNumByCategoryId" resultType="int">
-        SELECT COUNT(*) FROM goods WHERE goods_category_id_ = #{goodsCategoryId}
+        SELECT COUNT(*) FROM goods WHERE goods_category_id_ = #{goodsCategoryId} and tenant_id_ = #{tenantId}
     </select>
     <select id="findGoodsByIds" resultMap="Goods">
         SELECT * FROM goods WHERE FIND_IN_SET(id_,#{ids})
     </select>
     <select id="findTypeGoods" resultMap="Goods">
-        SELECT * FROM goods WHERE type_ = #{type} AND status_ != 0
+        SELECT * FROM goods WHERE type_ = #{type} AND status_ != 0 and tenant_id_ = #{tenantId}
     </select>
     <select id="getGoodies" resultMap="Goods">
         SELECT * FROM goods WHERE id_ IN
@@ -459,7 +461,7 @@
     <select id="getMusicGroupGoodsAndDiscount" resultMap="MusicGroupGoods">
         SELECT g.* FROM subject_goods_mapper sgm
         LEFT JOIN goods g ON sgm.goods_category_id_ = g.goods_category_id_
-        WHERE sgm.subject_id_ = #{subjectId} AND g.status_ != 0
+        WHERE sgm.subject_id_ = #{subjectId} AND g.status_ != 0 and g.tenant_id_ = #{tenantId}
         <if test="organId != null">
             <if test="courseViewType != null">
                 <if test="courseViewType == 2">
@@ -523,7 +525,7 @@
         <where>
             g.status_ != 0
             AND g.type_ = 'INSTRUMENT'
-            AND gc.del_flag_ = 0
+            AND gc.del_flag_ = 0 and g.tenant_id_ = #{tenantId}
             <if test="organId != null">
                 AND FIND_IN_SET(#{organId},g.replacement_show_organ_id_)
             </if>

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/GoodsOrderItemMapper.xml

@@ -13,6 +13,7 @@
 		<result column="goods_quantity_" property="goodsQuantity" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -23,7 +24,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="GoodsOrderItem">
-		SELECT * FROM goods_order_item
+		SELECT * FROM goods_order_item where tenant_id_ = #{tenantId}
 		ORDER BY id_
 	</select>
 
@@ -31,8 +32,8 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.GoodsOrderItem"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO goods_order_item
-		(id_,goods_order_id_,goods_id_,market_price_,discount_price_,goods_quantity_,create_time_,update_time_)
-		VALUES(#{id},#{goodsOrderId},#{goodsId},#{marketPrice},#{discountPrice},#{goodsQuantity},now(),now())
+		(id_,goods_order_id_,goods_id_,market_price_,discount_price_,goods_quantity_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{goodsOrderId},#{goodsId},#{marketPrice},#{discountPrice},#{goodsQuantity},now(),now(),#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -64,7 +65,7 @@
 				create_time_ = #{createTime},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -75,13 +76,13 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="GoodsOrderItem" parameterType="map">
-		SELECT * FROM goods_order_item ORDER BY id_
+		SELECT * FROM goods_order_item where tenant_id_ = #{tenantId} ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM
-		goods_order_item
+		goods_order_item where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/GoodsOrderMapper.xml

@@ -18,6 +18,7 @@
 		<result column="express_num_" property="expressNum" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -28,7 +29,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="GoodsOrder">
-		SELECT * FROM goods_order ORDER
+		SELECT * FROM goods_order where tenant_id_ = #{tenantId} ORDER
 		BY id_
 	</select>
 
@@ -38,8 +39,8 @@
 		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
 			AS ID FROM DUAL </selectKey> -->
 		INSERT INTO goods_order
-		(id_,user_id_,status_,total_amount_,coupon_amount_,goods_quantity_,user_note_,order_no_,order_source_,receiver_id_,express_company_code_,express_num_,create_time_,update_time_)
-		VALUES(#{id},#{userId},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{totalAmount},#{couponAmount},#{goodsQuantity},#{userNote},#{orderNo},#{orderSource},#{receiverId},#{expressCompanyCode},#{expressNum},now(),now())
+		(id_,user_id_,status_,total_amount_,coupon_amount_,goods_quantity_,user_note_,order_no_,order_source_,receiver_id_,express_company_code_,express_num_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{userId},#{status, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{totalAmount},#{couponAmount},#{goodsQuantity},#{userNote},#{orderNo},#{orderSource},#{receiverId},#{expressCompanyCode},#{expressNum},now(),now(),#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -89,7 +90,7 @@
 				express_num_ = #{expressNum},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -99,13 +100,13 @@
 
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="GoodsOrder" parameterType="map">
-		SELECT * FROM goods_order ORDER BY id_
+		SELECT * FROM goods_order where tenant_id_ = #{tenantId} ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM
-		goods_order
+		goods_order where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

+ 7 - 6
mec-biz/src/main/resources/config/mybatis/GoodsOrderPaymentMapper.xml

@@ -19,6 +19,7 @@
 		<result column="remark_" property="remark" />
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 
 	<!-- 根据主键查询一条记录 -->
@@ -29,7 +30,7 @@
 
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="GoodsOrderPayment">
-		SELECT * FROM goods_order_payment
+		SELECT * FROM goods_order_payment where tenant_id_ = #{tenantId}
 		ORDER BY id_
 	</select>
 
@@ -37,8 +38,8 @@
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.GoodsOrderPayment"
 		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
 		INSERT INTO goods_order_payment
-		(id_,user_id_,goods_order_id_,payment_channel_,payment_business_channel_,payment_account_no_,amount_,trans_no_,order_no_,pay_status_,arrival_time_,remark_,create_time_,update_time_)
-		VALUES(#{id},#{userId},#{goodsOrderId},#{paymentChannel},#{paymentBusinessChannel},#{paymentAccountNo},#{amount},#{transNo},#{orderNo},#{payStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{arrivalTime},#{remark},now(),now())
+		(id_,user_id_,goods_order_id_,payment_channel_,payment_business_channel_,payment_account_no_,amount_,trans_no_,order_no_,pay_status_,arrival_time_,remark_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{userId},#{goodsOrderId},#{paymentChannel},#{paymentBusinessChannel},#{paymentAccountNo},#{amount},#{transNo},#{orderNo},#{payStatus, typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{arrivalTime},#{remark},now(),now(),#{tenantId})
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->
@@ -88,7 +89,7 @@
 				trans_no_ = #{transNo},
 			</if>
 		</set>
-		WHERE id_ = #{id}
+		WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 
 	<!-- 根据主键删除一条记录 -->
@@ -100,13 +101,13 @@
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="GoodsOrderPayment"
 		parameterType="map">
-		SELECT * FROM goods_order_payment ORDER BY id_
+		SELECT * FROM goods_order_payment where tenant_id_ = #{tenantId} ORDER BY id_
 		<include refid="global.limit" />
 	</select>
 
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
 		SELECT COUNT(*) FROM
-		goods_order_payment
+		goods_order_payment where tenant_id_ = #{tenantId}
 	</select>
 </mapper>

+ 10 - 9
mec-biz/src/main/resources/config/mybatis/GoodsProcurementMapper.xml

@@ -21,6 +21,7 @@
 		<result column="tax_stock_sold_num_" property="taxStockSoldNum"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
+        <result column="tenant_id_" property="tenantId"/>
 	</resultMap>
 	
 	<!-- 根据主键查询一条记录 -->
@@ -30,20 +31,20 @@
 	
 	<!-- 全查询 -->
 	<select id="findAll" resultMap="GoodsProcurement">
-		SELECT * FROM goods_procurement ORDER BY id_
+		SELECT * FROM goods_procurement where tenant_id_ = #{tenantId} ORDER BY id_
 	</select>
 	
 	<!-- 向数据库增加一条记录 -->
 	<insert id="insert" parameterType="com.ym.mec.biz.dal.entity.GoodsProcurement" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO goods_procurement (goods_id_,goods_category_id_,supply_channel_,discount_price_,agree_cost_price_,stock_count_,tax_stock_count_,operator_id_,batch_no_,create_time_,update_time_)
-		VALUES(#{goodsId},#{goodsCategoryId},#{supplyChannel},#{discountPrice},#{agreeCostPrice},#{stockCount},#{taxStockCount},#{operatorId},#{batchNo},NOW(),NOW())
+		INSERT INTO goods_procurement (goods_id_,goods_category_id_,supply_channel_,discount_price_,agree_cost_price_,stock_count_,tax_stock_count_,operator_id_,batch_no_,create_time_,update_time_,tenant_id_)
+		VALUES(#{goodsId},#{goodsCategoryId},#{supplyChannel},#{discountPrice},#{agreeCostPrice},#{stockCount},#{taxStockCount},#{operatorId},#{batchNo},NOW(),NOW(),#{tenantId})
 	</insert>
 
 	<insert id="batchInsert" parameterType="com.ym.mec.biz.dal.entity.GoodsProcurement" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
-		INSERT INTO goods_procurement (goods_id_,goods_category_id_,supply_channel_,discount_price_,agree_cost_price_,stock_count_,tax_stock_count_,operator_id_,batch_no_,create_time_,update_time_)
+		INSERT INTO goods_procurement (goods_id_,goods_category_id_,supply_channel_,discount_price_,agree_cost_price_,stock_count_,tax_stock_count_,operator_id_,batch_no_,create_time_,update_time_,tenant_id_)
 		VALUE
 		<foreach collection="goodsProcurements" item="gp" separator=",">
-			(#{gp.goodsId},#{gp.goodsCategoryId},#{gp.supplyChannel},#{gp.discountPrice},#{gp.agreeCostPrice},#{gp.stockCount},#{gp.taxStockCount},#{gp.operatorId},#{gp.batchNo},NOW(),NOW())
+			(#{gp.goodsId},#{gp.goodsCategoryId},#{gp.supplyChannel},#{gp.discountPrice},#{gp.agreeCostPrice},#{gp.stockCount},#{gp.taxStockCount},#{gp.operatorId},#{gp.batchNo},NOW(),NOW(),#{gp.tenantId})
 		</foreach>
 	</insert>
 	
@@ -88,7 +89,7 @@
 				tax_stock_sold_num_ = #{taxStockSoldNum},
 			</if>
 				update_time_ = NOW(),
-		</set> WHERE id_ = #{id}
+		</set> WHERE id_ = #{id} and tenant_id_ = #{tenantId}
 	</update>
 	
 	<!-- 根据主键删除一条记录 -->
@@ -98,7 +99,7 @@
 
 	<sql id="queryCondition">
 		<where>
-			1=1
+			tenant_id_ = #{tenantId}
 			<if test="goodsId!=null">
 				AND goods_id_ = #{goodsId}
 			</if>
@@ -124,13 +125,13 @@
 	
 	<!-- 分页查询 -->
 	<select id="queryPage" resultMap="GoodsProcurement" parameterType="map">
-		SELECT * FROM goods_procurement
+		SELECT * FROM goods_procurement where tenant_id_ = #{tenantId}
 		ORDER BY id_ DESC <include refid="global.limit"/>
 	</select>
 	
 	<!-- 查询当前表的总记录数 -->
 	<select id="queryCount" resultType="int">
-		SELECT COUNT(*) FROM goods_procurement
+		SELECT COUNT(*) FROM goods_procurement where tenant_id_ = #{tenantId}
 	</select>
 
 	<select id="getWithStockSurplusProcurement" resultMap="GoodsProcurement" useCache="false" flushCache="true">

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/StudentApplication.java

@@ -25,8 +25,8 @@ import com.ym.mec.common.filters.EmojiEncodingFilter;
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")
-@MapperScan("com.ym.mec.biz.dal.dao")
-@ComponentScan(basePackages = {"com.ym.mec", "com.yonge.log"})
+@MapperScan(basePackages = {"com.ym.mec.biz.**.dao", "com.yonge.datasource.dao"})
+@ComponentScan(basePackages = {"com.ym.mec", "com.yonge.log", "com.yonge.datasource"})
 @Configuration
 @EnableSwagger2Doc
 @EnableAsync

+ 2 - 2
mec-teacher/src/main/java/com/ym/mec/teacher/TeacherApplication.java

@@ -21,8 +21,8 @@ import com.ym.mec.common.filters.EmojiEncodingFilter;
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")
-@MapperScan("com.ym.mec.biz.dal.dao")
-@ComponentScan(basePackages = { "com.ym.mec", "org.snaker.engine", "com.yonge.log"})
+@MapperScan(basePackages = {"com.ym.mec.biz.**.dao", "com.yonge.datasource.dao"})
+@ComponentScan(basePackages = { "com.ym.mec", "org.snaker.engine", "com.yonge.log", "com.yonge.datasource"})
 @Configuration
 @EnableSwagger2Doc
 @EnableAsync

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/WebApplication.java

@@ -25,7 +25,7 @@ import com.ym.mec.common.filters.EmojiEncodingFilter;
 @EnableDiscoveryClient
 @EnableFeignClients("com.ym.mec")
 @MapperScan(basePackages = {"com.ym.mec.biz.**.dao", "com.yonge.datasource.dao"})
-@ComponentScan(basePackages = {"com.ym.mec", "com.yonge.log"})
+@ComponentScan(basePackages = {"com.ym.mec", "com.yonge.log", "com.yonge.datasource"})
 @Configuration
 @EnableSwagger2Doc
 @EnableAsync