浏览代码

优化代码权限

java110 2 年之前
父节点
当前提交
068fde7238

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/purchase/PurchaseApplyDetailDto.java

@@ -63,6 +63,7 @@ public class PurchaseApplyDetailDto extends PageDto implements Serializable {
 
 
     private String storeId;
+    private String communityId;
 
     public String getApplyOrderId() {
         return applyOrderId;
@@ -407,6 +408,14 @@ public class PurchaseApplyDetailDto extends PageDto implements Serializable {
     public void setIsFixedName(String isFixedName) {
         this.isFixedName = isFixedName;
     }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
 }
 
 

+ 11 - 0
java110-bean/src/main/java/com/java110/dto/resource/ResourceStoreDto.java

@@ -7,6 +7,7 @@ import java.util.Date;
 import java.util.List;
 
 /**
+ * 物品实体类
  * @ClassName FloorDto
  * @Description 资源数据层封装
  * @Author wuxw
@@ -75,6 +76,8 @@ public class ResourceStoreDto extends PageDto implements Serializable {
     private String isFixed;
     private String isFixedName;
 
+    private String communityId;
+
     private List<ResourceStoreTimesDto> times;
 
     public String getResName() {
@@ -408,4 +411,12 @@ public class ResourceStoreDto extends PageDto implements Serializable {
     public void setResCodeLike(String resCodeLike) {
         this.resCodeLike = resCodeLike;
     }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
 }

+ 12 - 0
java110-bean/src/main/java/com/java110/dto/resource/ResourceStoreTimesDto.java

@@ -31,6 +31,8 @@ public class ResourceStoreTimesDto extends ResourceStoreDto implements Serializa
 
     private String statusCd = "0";
 
+    private String communityId;
+
 
     public String getPrice() {
         return price;
@@ -136,4 +138,14 @@ public class ResourceStoreTimesDto extends ResourceStoreDto implements Serializa
     public void setResCodeLike(String resCodeLike) {
         this.resCodeLike = resCodeLike;
     }
+
+    @Override
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    @Override
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
 }

+ 10 - 0
java110-bean/src/main/java/com/java110/po/purchase/ResourceStorePo.java

@@ -50,6 +50,8 @@ public class ResourceStorePo implements Serializable {
     private String isFixed;
     private String isFixedName;
 
+    private String communityId;
+
     public String getResId() {
         return resId;
     }
@@ -313,4 +315,12 @@ public class ResourceStorePo implements Serializable {
     public void setIsFixedName(String isFixedName) {
         this.isFixedName = isFixedName;
     }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
 }

+ 10 - 0
java110-bean/src/main/java/com/java110/po/resource/ResourceStoreTimesPo.java

@@ -37,6 +37,8 @@ public class ResourceStoreTimesPo implements Serializable {
     private String timesId;
     private String shId;
 
+    private String communityId;
+
     public String getPrice() {
         return price;
     }
@@ -101,4 +103,12 @@ public class ResourceStoreTimesPo implements Serializable {
     public void setShId(String shId) {
         this.shId = shId;
     }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
 }

+ 6 - 0
java110-db/src/main/resources/mapper/store/PurchaseApplyDetailServiceDaoImplMapper.xml

@@ -173,6 +173,9 @@
         <if test="storeId !=null and storeId != ''">
             and pa.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and pa.community_id= #{communityId}
+        </if>
         <if test="rssId !=null and rssId != ''">
             and rs.rss_id= #{rssId}
         </if>
@@ -322,6 +325,9 @@
         <if test="storeId !=null and storeId != ''">
             and pa.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and pa.community_id= #{communityId}
+        </if>
         <if test="rssId !=null and rssId != ''">
             and rs.rss_id= #{rssId}
         </if>

+ 19 - 6
java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml

@@ -23,12 +23,12 @@
         insert into resource_store(res_id, b_id, store_id, res_name, res_code, unit_code, remark, out_low_price,
                                    out_high_price, show_mobile, description,
                                    price, stock, create_time, sh_id, warning_stock, average_price, rss_id, rst_id,
-                                   mini_unit_code, mini_unit_stock, mini_stock, parent_rst_id, is_fixed)
+                                   mini_unit_code, mini_unit_stock, mini_stock, parent_rst_id, is_fixed,community_id)
         values (#{resId}, #{bId}, #{storeId}, #{resName}, #{resCode}, #{unitCode}, #{remark}, #{outLowPrice},
                 #{outHighPrice},
                 #{showMobile}, #{description}, #{price}, #{stock}, #{createTime}, #{shId}, #{warningStock},
                 #{averagePrice}, #{rssId}, #{rstId}, #{miniUnitCode}, #{miniUnitStock}, #{miniStock}, #{parentRstId},
-                #{isFixed})
+                #{isFixed},#{communityId})
     </insert>
 
     <!-- 查询资源信息(Business) add by wuxw 2018-07-03 -->
@@ -212,7 +212,7 @@
         miniStock,t.mini_unit_stock,t.mini_unit_stock miniUnitStock,td.name unitCodeName,td1.name
         miniUnitCodeName,t.parent_rst_id parentRstId,t.rst_id rstId,rst1.name parentRstName,rst.name
         rstName,
-        t.is_fixed,t.is_fixed isFixed,td2.name isFixedName
+        t.is_fixed,t.is_fixed isFixed,td2.name isFixedName,t.community_id communityId
         from resource_store t
         left join resource_store_type rst on t.rst_id = rst.rst_id and rst.status_cd = '0'
         left join resource_store_type rst1 on t.parent_rst_id = rst1.rst_id and rst1.status_cd = '0'
@@ -270,6 +270,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="stock !=null and stock != ''">
             and t.stock= #{stock}
         </if>
@@ -367,9 +370,7 @@
         <if test="description !=null and description != ''">
             , t.description= #{description}
         </if>
-        <if test="storeId !=null and storeId != ''">
-            , t.store_id= #{storeId}
-        </if>
+
         , t.stock= #{stock}
         <if test="warningStock !=null and warningStock != ''">
             , t.warning_stock= #{warningStock}
@@ -399,6 +400,12 @@
         <if test="resId !=null and resId != ''">
             and t.res_id= #{resId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
     </update>
 
     <!-- 查询资源数量 add by wuxw 2018-07-03 -->
@@ -437,6 +444,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="stock !=null and stock != ''">
             and t.stock= #{stock}
         </if>
@@ -557,6 +567,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="stock !=null and stock != ''">
             and t.stock= #{stock}
         </if>

+ 15 - 3
java110-db/src/main/resources/mapper/store/ResourceStoreTimesV1ServiceDaoImplMapper.xml

@@ -8,9 +8,9 @@
     <!-- 保存物品次数信息 add by wuxw 2018-07-03 -->
     <insert id="saveResourceStoreTimesInfo" parameterType="Map">
         insert into resource_store_times(
-        price,apply_order_id,store_id,stock,res_code,times_id,sh_id
+        price,apply_order_id,store_id,stock,res_code,times_id,sh_id,community_id
         ) values (
-        #{price},#{applyOrderId},#{storeId},#{stock},#{resCode},#{timesId},#{shId}
+        #{price},#{applyOrderId},#{storeId},#{stock},#{resCode},#{timesId},#{shId},#{communityId}
         )
     </insert>
 
@@ -29,7 +29,7 @@
         miniStock,rs.mini_unit_stock,rs.mini_unit_stock miniUnitStock,td.name unitCodeName,td1.name
         miniUnitCodeName,rs.parent_rst_id parentRstId,rs.rst_id rstId,rst1.name parentRstName,rst.name
         rstName,
-        rs.is_fixed,rs.is_fixed isFixed,td2.name isFixedName
+        rs.is_fixed,rs.is_fixed isFixed,td2.name isFixedName,t.community_id communityId
         from resource_store_times t
         inner join resource_store rs on t.res_code = rs.res_code and rs.status_cd = '0' and t.sh_id = rs.sh_id
         left join resource_store_type rst on rs.rst_id = rst.rst_id and rst.status_cd = '0'
@@ -73,6 +73,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="stock !=null and stock != ''">
             and t.stock= #{stock}
         </if>
@@ -125,6 +128,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
 
     </update>
 
@@ -174,6 +180,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="stock !=null and stock != ''">
             and t.stock= #{stock}
         </if>
@@ -213,6 +222,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="stock !=null and stock != ''">
             and t.stock= #{stock}
         </if>

+ 15 - 5
java110-db/src/main/resources/mapper/store/ResourceStoreV1ServiceDaoImplMapper.xml

@@ -8,10 +8,10 @@
         insert into resource_store(sh_id, description, remark, store_id, res_id, parent_rst_id, warning_stock, rss_id,
                                    res_name, rst_id, out_low_price, price, mini_unit_stock, unit_code, res_code,
                                    mini_unit_code, average_price, stock, out_high_price, show_mobile, is_fixed,
-                                   mini_stock)
+                                   mini_stock,community_id)
         values (#{shId}, #{description}, #{remark}, #{storeId}, #{resId}, #{parentRstId}, #{warningStock}, #{rssId},
                 #{resName}, #{rstId}, #{outLowPrice}, #{price}, #{miniUnitStock}, #{unitCode}, #{resCode},
-                #{miniUnitCode}, #{averagePrice}, #{stock}, #{outHighPrice}, #{showMobile}, #{isFixed}, #{miniStock})
+                #{miniUnitCode}, #{averagePrice}, #{stock}, #{outHighPrice}, #{showMobile}, #{isFixed}, #{miniStock},#{communityId})
     </insert>
 
     <!-- 查询物品信息信息 add by wuxw 2018-07-03 -->
@@ -41,6 +41,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="resId !=null and resId != ''">
             and t.res_id= #{resId}
         </if>
@@ -116,9 +119,7 @@
         <if test="remark !=null and remark != ''">
             , t.remark= #{remark}
         </if>
-        <if test="storeId !=null and storeId != ''">
-            , t.store_id= #{storeId}
-        </if>
+
         <if test="parentRstId !=null and parentRstId != ''">
             , t.parent_rst_id= #{parentRstId}
         </if>
@@ -174,6 +175,12 @@
         <if test="resId !=null and resId != ''">
             and t.res_id= #{resId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
     </update>
 
     <!-- 查询物品信息数量 add by wuxw 2018-07-03 -->
@@ -196,6 +203,9 @@
         <if test="storeId !=null and storeId != ''">
             and t.store_id= #{storeId}
         </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
         <if test="resId !=null and resId != ''">
             and t.res_id= #{resId}
         </if>

+ 2 - 0
service-store/src/main/java/com/java110/store/bmo/allocation/impl/AllocationBMOImpl.java

@@ -106,6 +106,7 @@ public class AllocationBMOImpl implements IAllocationBMO {
             tmpResourceStorePo.setResId(GenerateCodeFactory.getGeneratorId("11"));
             tmpResourceStorePo.setStock(allocationStock + "");
             tmpResourceStorePo.setShId(tmpAllocationStorehouseDto.getShIdz());
+            tmpResourceStorePo.setCommunityId(resourceStoreDtoZs.get(0).getCommunityId());
             resourceStoreV1InnerServiceSMOImpl.saveResourceStore(tmpResourceStorePo);
 
             // todo 添加 times
@@ -113,6 +114,7 @@ public class AllocationBMOImpl implements IAllocationBMO {
             tmpResourceStoreTimesPo.setTimesId(GenerateCodeFactory.getGeneratorId("11"));
             tmpResourceStoreTimesPo.setStock(allocationStock + "");
             tmpResourceStoreTimesPo.setShId(tmpAllocationStorehouseDto.getShIdz());
+            tmpResourceStoreTimesPo.setCommunityId(resourceStoreDtoZs.get(0).getCommunityId());
 
             resourceStoreTimesV1InnerServiceSMOImpl.saveResourceStoreTimes(tmpResourceStoreTimesPo);
             return;

+ 2 - 10
service-store/src/main/java/com/java110/store/cmd/resourceStore/SaveResourceStoreCmd.java

@@ -132,6 +132,7 @@ public class SaveResourceStoreCmd extends Cmd {
         Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户信息");
         Assert.hasKeyAndValue(reqJson, "price", "必填,请填写物品价格");
         Assert.hasKeyAndValue(reqJson, "shId", "必填,请填写仓库");
+        Assert.hasKeyAndValue(reqJson, "communityId", "必填,请填写小区");
 
         //获取最低收费标准
         double outLowPrice = Double.parseDouble(reqJson.getString("outLowPrice"));
@@ -174,16 +175,6 @@ public class SaveResourceStoreCmd extends Cmd {
             throw new CmdException("保存数据失败");
         }
 
-        // todo 保存至 物品 times表
-//        ResourceStoreTimesPo resourceStoreTimesPo = new ResourceStoreTimesPo();
-//        resourceStoreTimesPo.setApplyOrderId("-1");
-//        resourceStoreTimesPo.setPrice(resourceStorePo.getPrice());
-//        resourceStoreTimesPo.setStock(resourceStorePo.getStock());
-//        resourceStoreTimesPo.setResCode(resourceStorePo.getResCode());
-//        resourceStoreTimesPo.setStoreId(resourceStorePo.getStoreId());
-//        resourceStoreTimesPo.setShId(resourceStorePo.getShId());
-//        resourceStoreTimesV1InnerServiceSMOImpl.saveOrUpdateResourceStoreTimes(resourceStoreTimesPo);
-
         //todo 入库
         inStore(reqJson, userId, storeId, resourceStorePo);
 
@@ -278,6 +269,7 @@ public class SaveResourceStoreCmd extends Cmd {
         resourceStoreTimesPo.setStoreId(resourceStorePo.getStoreId());
         resourceStoreTimesPo.setTimesId(GenerateCodeFactory.getGeneratorId("10"));
         resourceStoreTimesPo.setShId(resourceStorePo.getShId());
+        resourceStoreTimesPo.setCommunityId(reqJson.getString("communityId"));
 
         resourceStoreTimesV1InnerServiceSMOImpl.saveOrUpdateResourceStoreTimes(resourceStoreTimesPo);