Преглед изворни кода

优化仓库物品信息查询问题,员工组织信息显示问题

xiaogang пре 4 година
родитељ
комит
4062bce96d

+ 9 - 0
java110-bean/src/main/java/com/java110/dto/resourceStore/ResourceStoreDto.java

@@ -45,6 +45,7 @@ public class ResourceStoreDto extends PageDto implements Serializable {
     private String warningStock;
     private String warningStock;
     private String shType;
     private String shType;
     private String shObjId;
     private String shObjId;
+    private String[] shObjIds;
     private String averagePrice;
     private String averagePrice;
     private List<String> fileUrls;
     private List<String> fileUrls;
     private Date createTime;
     private Date createTime;
@@ -392,4 +393,12 @@ public class ResourceStoreDto extends PageDto implements Serializable {
     public void setIsFixedName(String isFixedName) {
     public void setIsFixedName(String isFixedName) {
         this.isFixedName = isFixedName;
         this.isFixedName = isFixedName;
     }
     }
+
+    public String[] getShObjIds() {
+        return shObjIds;
+    }
+
+    public void setShObjIds(String[] shObjIds) {
+        this.shObjIds = shObjIds;
+    }
 }
 }

+ 18 - 0
java110-bean/src/main/java/com/java110/vo/api/resourceStore/ApiResourceStoreVo.java

@@ -7,6 +7,8 @@ import java.util.List;
 
 
 public class ApiResourceStoreVo extends MorePageVo implements Serializable {
 public class ApiResourceStoreVo extends MorePageVo implements Serializable {
     List<ApiResourceStoreDataVo> resourceStores;
     List<ApiResourceStoreDataVo> resourceStores;
+    private String subTotal;
+    private String totalPrice;
 
 
 
 
     public List<ApiResourceStoreDataVo> getResourceStores() {
     public List<ApiResourceStoreDataVo> getResourceStores() {
@@ -16,4 +18,20 @@ public class ApiResourceStoreVo extends MorePageVo implements Serializable {
     public void setResourceStores(List<ApiResourceStoreDataVo> resourceStores) {
     public void setResourceStores(List<ApiResourceStoreDataVo> resourceStores) {
         this.resourceStores = resourceStores;
         this.resourceStores = resourceStores;
     }
     }
+
+    public String getSubTotal() {
+        return subTotal;
+    }
+
+    public void setSubTotal(String subTotal) {
+        this.subTotal = subTotal;
+    }
+
+    public String getTotalPrice() {
+        return totalPrice;
+    }
+
+    public void setTotalPrice(String totalPrice) {
+        this.totalPrice = totalPrice;
+    }
 }
 }

+ 117 - 0
java110-db/src/main/resources/mapper/store/ResourceStoreServiceDaoImplMapper.xml

@@ -288,6 +288,12 @@
         <if test="shObjId !=null and shObjId != ''">
         <if test="shObjId !=null and shObjId != ''">
             and sh.sh_obj_id= #{shObjId}
             and sh.sh_obj_id= #{shObjId}
         </if>
         </if>
+        <if test="shObjIds !=null">
+            and sh.sh_obj_id in
+            <foreach collection="shObjIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
         <if test="showMobile != null and showMobile != ''">
         <if test="showMobile != null and showMobile != ''">
             and t.show_mobile = #{showMobile}
             and t.show_mobile = #{showMobile}
         </if>
         </if>
@@ -463,9 +469,115 @@
         <if test="shObjId !=null and shObjId != ''">
         <if test="shObjId !=null and shObjId != ''">
             and sh.sh_obj_id= #{shObjId}
             and sh.sh_obj_id= #{shObjId}
         </if>
         </if>
+        <if test="shObjIds !=null">
+            and sh.sh_obj_id in
+            <foreach collection="shObjIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="shType !=null and shType != ''">
+            and sh.sh_type= #{shType}
+        </if>
+        <if test="averagePrice != null and averagePrice != ''">
+            and t.average_price = #{averagePrice}
+        </if>
+        <if test="miniUnitCode !=null and miniUnitCode != ''">
+            and t.mini_unit_code= #{miniUnitCode}
+        </if>
+        <if test="miniUnitStock !=null and miniUnitStock != ''">
+            and t.mini_unit_stock= #{miniUnitStock}
+        </if>
+        <if test="miniStock !=null and miniStock != ''">
+            and t.mini_stock= #{miniStock}
+        </if>
+        <if test="isShow !=null and isShow != ''">
+            and sh.is_show= #{isShow}
+        </if>
+        <if test="isFixed !=null and isFixed != ''">
+            and t.is_fixed= #{isFixed}
+        </if>
+        <if test="resOrderType == '20000'">
+            and t.stock > 0
+        </if>
+    </select>
+    <!-- 查询资源信息 add by wuxw 2018-07-03 -->
+    <select id="queryResourceStoresTotalPrice" parameterType="Map" resultType="Map">
+        select sum(w.stock*w.average_price) as totalPrice from(
+        select t.stock,t.average_price from resource_store t
+        left join storehouse sh on t.sh_id = sh.sh_id and t.store_id = sh.store_id and sh.status_cd = '0'
+        where 1 = 1
+        <if test="resName !=null and resName != ''">
+            and t.res_name like concat('%',#{resName},'%')
+        </if>
+        <if test="name != null and name != ''">
+            and t.res_name = #{name}
+        </if>
+        <if test="price !=null and price != ''">
+            and t.price= #{price}
+        </if>
+        <if test="rstId !=null and rstId != ''">
+            and t.rst_id= #{rstId}
+        </if>
+        <if test="parentRstId !=null and parentRstId != ''">
+            and t.parent_rst_id= #{parentRstId}
+        </if>
+        <if test="rssId !=null and rssId != ''">
+            and t.rss_id= #{rssId}
+        </if>
+        <if test="outLowPrice !=null and outLowPrice != ''">
+            and t.out_low_price = #{outLowPrice}
+        </if>
+        <if test="outHighPrice != null and outHighPrice != ''">
+            and t.out_high_price = #{outHighPrice}
+        </if>
+        <if test="unitCode != null and unitCode != ''">
+            and t.unit_code = #{unitCode}
+        </if>
+        <if test="remark != null and remark != ''">
+            and t.remark = #{remark}
+        </if>
+        <if test="resCode !=null and resCode != ''">
+            and t.res_code= #{resCode}
+        </if>
+        <if test="description !=null and description != ''">
+            and t.description= #{description}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            and t.store_id= #{storeId}
+        </if>
+        <if test="stock !=null and stock != ''">
+            and t.stock= #{stock}
+        </if>
+        <if test="warningStock !=null and warningStock != ''">
+            and t.warning_stock= #{warningStock}
+        </if>
+        <if test="bId !=null and bId != ''">
+            and t.b_id= #{bId}
+        </if>
+        <if test="resId !=null and resId != ''">
+            and t.res_id= #{resId}
+        </if>
+        <if test="shId !=null and shId != ''">
+            and t.sh_id= #{shId}
+        </if>
         <if test="shType !=null and shType != ''">
         <if test="shType !=null and shType != ''">
             and sh.sh_type= #{shType}
             and sh.sh_type= #{shType}
         </if>
         </if>
+        <if test="shObjId !=null and shObjId != ''">
+            and sh.sh_obj_id= #{shObjId}
+        </if>
+        <if test="shObjIds !=null">
+            and sh.sh_obj_id in
+            <foreach collection="shObjIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="showMobile != null and showMobile != ''">
+            and t.show_mobile = #{showMobile}
+        </if>
         <if test="averagePrice != null and averagePrice != ''">
         <if test="averagePrice != null and averagePrice != ''">
             and t.average_price = #{averagePrice}
             and t.average_price = #{averagePrice}
         </if>
         </if>
@@ -487,5 +599,10 @@
         <if test="resOrderType == '20000'">
         <if test="resOrderType == '20000'">
             and t.stock > 0
             and t.stock > 0
         </if>
         </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+        )w
     </select>
     </select>
 </mapper>
 </mapper>

+ 10 - 0
java110-interface/src/main/java/com/java110/intf/store/IResourceStoreInnerServiceSMO.java

@@ -51,4 +51,14 @@ public interface IResourceStoreInnerServiceSMO {
     @RequestMapping(value = "/saveResourceStore", method = RequestMethod.POST)
     @RequestMapping(value = "/saveResourceStore", method = RequestMethod.POST)
     void saveResourceStore(@RequestBody ResourceStoreDto resourceStoreDto);
     void saveResourceStore(@RequestBody ResourceStoreDto resourceStoreDto);
 
 
+    /**
+     * <p>查询物品总价</p>
+     *
+     * @param resourceResourceStoreDto 数据对象分享
+     * @return ResourceStoreDto 对象数据
+     */
+    @RequestMapping(value = "/queryResourceStoresTotalPrice", method = RequestMethod.POST)
+    String queryResourceStoresTotalPrice(@RequestBody ResourceStoreDto resourceResourceStoreDto);
+
+
 }
 }

+ 3 - 3
service-api/src/main/java/com/java110/api/listener/org/ListOrgsListener.java

@@ -78,18 +78,18 @@ public class ListOrgsListener extends AbstractServiceApiListener {
 
 
         OrgDto orgDto = BeanConvertUtil.covertBean(reqJson, OrgDto.class);
         OrgDto orgDto = BeanConvertUtil.covertBean(reqJson, OrgDto.class);
         //2级别组织信息
         //2级别组织信息
-        if(reqJson.getString("orgLevel").equals("2")){
+        if (reqJson.containsKey("orgLevel") && reqJson.getString("orgLevel").equals("2")) {
             //默认只查看当前归属组织架构
             //默认只查看当前归属组织架构
             BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
             BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
             basePrivilegeDto.setResource("/viewAllOrganization");
             basePrivilegeDto.setResource("/viewAllOrganization");
             basePrivilegeDto.setUserId(reqJson.getString("userId"));
             basePrivilegeDto.setUserId(reqJson.getString("userId"));
             List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
             List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
-            if(privileges.size()==0){
+            if (privileges.size() == 0) {
                 //查询员工所属二级组织架构
                 //查询员工所属二级组织架构
                 OrgStaffRelDto orgStaffRelDto = new OrgStaffRelDto();
                 OrgStaffRelDto orgStaffRelDto = new OrgStaffRelDto();
                 orgStaffRelDto.setStaffId(reqJson.getString("userId"));
                 orgStaffRelDto.setStaffId(reqJson.getString("userId"));
                 List<OrgStaffRelDto> orgStaffRelDtos = iOrgStaffRelInnerServiceSMO.queryOrgInfoByStaffIds(orgStaffRelDto);
                 List<OrgStaffRelDto> orgStaffRelDtos = iOrgStaffRelInnerServiceSMO.queryOrgInfoByStaffIds(orgStaffRelDto);
-                if(orgStaffRelDtos.size()>0){
+                if (orgStaffRelDtos.size() > 0) {
                     orgDto.setOrgId(orgStaffRelDtos.get(0).getCompanyId());//当前人虽归属的二级组织信息
                     orgDto.setOrgId(orgStaffRelDtos.get(0).getCompanyId());//当前人虽归属的二级组织信息
                 }
                 }
 
 

+ 10 - 37
service-api/src/main/java/com/java110/api/listener/resourceStore/ListResourceStoresListener.java

@@ -79,7 +79,10 @@ public class ListResourceStoresListener extends AbstractServiceApiListener {
         basePrivilegeDto.setResource("/viewGroupResource");
         basePrivilegeDto.setResource("/viewGroupResource");
         basePrivilegeDto.setUserId(userId);
         basePrivilegeDto.setUserId(userId);
         List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
         List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
-        if (StorehouseDto.SH_TYPE_COMMUNITY.equals(resourceStoreDto.getShType()) || privileges.size() == 0) {
+        if (reqJson.containsKey("operationType") && reqJson.getString("operationType").equals("1000") && privileges.size() > 0) {
+            resourceStoreDto.setShType("");
+            resourceStoreDto.setShObjIds(new String[]{reqJson.getString("communityId"), reqJson.getString("storeId")});
+        } else if (StorehouseDto.SH_TYPE_COMMUNITY.equals(resourceStoreDto.getShType()) || privileges.size() == 0) {
             resourceStoreDto.setShType(StorehouseDto.SH_TYPE_COMMUNITY);
             resourceStoreDto.setShType(StorehouseDto.SH_TYPE_COMMUNITY);
             resourceStoreDto.setShObjId(reqJson.getString("communityId"));
             resourceStoreDto.setShObjId(reqJson.getString("communityId"));
         }
         }
@@ -90,43 +93,11 @@ public class ListResourceStoresListener extends AbstractServiceApiListener {
         //计算总价(大计)
         //计算总价(大计)
         BigDecimal totalPrice = BigDecimal.ZERO;
         BigDecimal totalPrice = BigDecimal.ZERO;
         if (count > 0) {
         if (count > 0) {
-            List<ApiResourceStoreDataVo> apiResourceStoreDataVos = BeanConvertUtil.covertBeanList(resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto), ApiResourceStoreDataVo.class);
-            for (ApiResourceStoreDataVo apiResourceStoreDataVo : apiResourceStoreDataVos) {
-                //获取均价
-                String averagePrice = apiResourceStoreDataVo.getAveragePrice();
-                //获取数量
-                String stock = apiResourceStoreDataVo.getStock();
-                if (!StringUtil.isEmpty(averagePrice) && !StringUtil.isEmpty(stock)) {
-                    //总价
-                    BigDecimal x1 = new BigDecimal(averagePrice);
-                    BigDecimal y1 = new BigDecimal(stock);
-                    BigDecimal price = x1.multiply(y1);
-                    //计算总价(小计)
-                    subTotalPrice = subTotalPrice.add(price);
-                }
-            }
+            resourceStores = BeanConvertUtil.covertBeanList(resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto), ApiResourceStoreDataVo.class);
+            //查询总价
+            subTotalPrice = new BigDecimal(resourceStoreInnerServiceSMOImpl.queryResourceStoresTotalPrice(resourceStoreDto));
             resourceStoreDto.setPage(PageDto.DEFAULT_PAGE);
             resourceStoreDto.setPage(PageDto.DEFAULT_PAGE);
-            //查询所有物品信息数据(不分组)
-            List<ResourceStoreDto> resourceStoreList = resourceStoreInnerServiceSMOImpl.queryResourceStores(resourceStoreDto);
-            for (ResourceStoreDto resourceStore : resourceStoreList) {
-                //获取均价
-                String averagePrice = resourceStore.getAveragePrice();
-                //获取数量
-                String stock = resourceStore.getStock();
-                if (!StringUtil.isEmpty(averagePrice) && !StringUtil.isEmpty(stock)) {
-                    //总价
-                    BigDecimal x1 = new BigDecimal(averagePrice);
-                    BigDecimal y1 = new BigDecimal(stock);
-                    BigDecimal price = x1.multiply(y1);
-                    //计算总价(大计)
-                    totalPrice = totalPrice.add(price);
-                }
-            }
-            for (ApiResourceStoreDataVo apiResourceStoreDataVo : apiResourceStoreDataVos) {
-                apiResourceStoreDataVo.setSubTotalPrice(String.format("%.2f", subTotalPrice));
-                apiResourceStoreDataVo.setHighTotalPrice(String.format("%.2f", totalPrice));
-                resourceStores.add(apiResourceStoreDataVo);
-            }
+            totalPrice = new BigDecimal(resourceStoreInnerServiceSMOImpl.queryResourceStoresTotalPrice(resourceStoreDto));
         } else {
         } else {
             resourceStores = new ArrayList<>();
             resourceStores = new ArrayList<>();
         }
         }
@@ -134,6 +105,8 @@ public class ListResourceStoresListener extends AbstractServiceApiListener {
         apiResourceStoreVo.setTotal(count);
         apiResourceStoreVo.setTotal(count);
         apiResourceStoreVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
         apiResourceStoreVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
         apiResourceStoreVo.setResourceStores(resourceStores);
         apiResourceStoreVo.setResourceStores(resourceStores);
+        apiResourceStoreVo.setTotalPrice(String.format("%.2f", totalPrice));
+        apiResourceStoreVo.setSubTotal(String.format("%.2f", subTotalPrice));
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiResourceStoreVo), HttpStatus.OK);
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiResourceStoreVo), HttpStatus.OK);
         context.setResponseEntity(responseEntity);
         context.setResponseEntity(responseEntity);
     }
     }

+ 3 - 0
service-api/src/main/java/com/java110/api/listener/resourceStore/ListStorehousesListener.java

@@ -78,6 +78,9 @@ public class ListStorehousesListener extends AbstractServiceApiListener {
         if (privileges.size() == 0) {
         if (privileges.size() == 0) {
             storehouseDto.setShObjIds(new String[]{reqJson.getString("communityId")});
             storehouseDto.setShObjIds(new String[]{reqJson.getString("communityId")});
         } else {
         } else {
+            if (reqJson.containsKey("operationType") && reqJson.getString("operationType").equals("1000")) {
+                storehouseDto.setShType("");
+            }
             storehouseDto.setShObjIds(new String[]{reqJson.getString("communityId"), reqJson.getString("storeId")});
             storehouseDto.setShObjIds(new String[]{reqJson.getString("communityId"), reqJson.getString("storeId")});
         }
         }
         if (reqJson.containsKey("flag") && reqJson.getString("flag").equals("0")) {//调拨申请查看所有仓库
         if (reqJson.containsKey("flag") && reqJson.getString("flag").equals("0")) {//调拨申请查看所有仓库

+ 33 - 0
service-api/src/main/java/com/java110/api/smo/impl/StaffServiceSMOImpl.java

@@ -5,8 +5,12 @@ import com.java110.api.smo.AppAbstractComponentSMO;
 import com.java110.api.smo.DefaultAbstractComponentSMO;
 import com.java110.api.smo.DefaultAbstractComponentSMO;
 import com.java110.core.component.BaseComponentSMO;
 import com.java110.core.component.BaseComponentSMO;
 import com.java110.core.context.IPageData;
 import com.java110.core.context.IPageData;
+import com.java110.dto.basePrivilege.BasePrivilegeDto;
+import com.java110.dto.org.OrgStaffRelDto;
 import com.java110.entity.component.ComponentValidateResult;
 import com.java110.entity.component.ComponentValidateResult;
 import com.java110.api.smo.IStaffServiceSMO;
 import com.java110.api.smo.IStaffServiceSMO;
+import com.java110.intf.community.IMenuInnerServiceSMO;
+import com.java110.intf.user.IOrgStaffRelInnerServiceSMO;
 import com.java110.utils.constant.ServiceConstant;
 import com.java110.utils.constant.ServiceConstant;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.StringUtil;
 import com.java110.utils.util.StringUtil;
@@ -19,6 +23,9 @@ import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 import org.springframework.web.client.RestTemplate;
 
 
+import java.util.List;
+import java.util.Map;
+
 /**
 /**
  * 员工服务类
  * 员工服务类
  * Created by Administrator on 2019/4/2.
  * Created by Administrator on 2019/4/2.
@@ -30,6 +37,12 @@ public class StaffServiceSMOImpl extends DefaultAbstractComponentSMO implements
     @Autowired
     @Autowired
     private RestTemplate restTemplate;
     private RestTemplate restTemplate;
 
 
+    @Autowired
+    private IOrgStaffRelInnerServiceSMO iOrgStaffRelInnerServiceSMO;
+
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
     /**
     /**
      * 添加员工信息
      * 添加员工信息
      *
      *
@@ -81,12 +94,32 @@ public class StaffServiceSMOImpl extends DefaultAbstractComponentSMO implements
 
 
         Assert.jsonObjectHaveKey(pd.getReqData(), "page", "请求报文中未包含page节点");
         Assert.jsonObjectHaveKey(pd.getReqData(), "page", "请求报文中未包含page节点");
         Assert.jsonObjectHaveKey(pd.getReqData(), "row", "请求报文中未包含rows节点");
         Assert.jsonObjectHaveKey(pd.getReqData(), "row", "请求报文中未包含rows节点");
+
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
         JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
         Assert.isInteger(paramIn.getString("page"), "page不是数字");
         Assert.isInteger(paramIn.getString("page"), "page不是数字");
         Assert.isInteger(paramIn.getString("row"), "rows不是数字");
         Assert.isInteger(paramIn.getString("row"), "rows不是数字");
         int page = Integer.parseInt(paramIn.getString("page"));
         int page = Integer.parseInt(paramIn.getString("page"));
         int rows = Integer.parseInt(paramIn.getString("row"));
         int rows = Integer.parseInt(paramIn.getString("row"));
         String staffName = paramIn.getString("staffName");
         String staffName = paramIn.getString("staffName");
+        //2级别组织信息
+        if (paramIn.containsKey("orgLevel") && paramIn.getString("orgLevel").equals("2")) {
+            //默认只查看当前归属组织架构
+            BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
+            basePrivilegeDto.setResource("/viewAllOrganization");
+            basePrivilegeDto.setUserId(pd.getUserId());
+            List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
+            if (privileges.size() == 0) {
+                //查询员工所属二级组织架构
+                OrgStaffRelDto orgStaffRelDto = new OrgStaffRelDto();
+                orgStaffRelDto.setStaffId(pd.getUserId());
+                List<OrgStaffRelDto> orgStaffRelDtos = iOrgStaffRelInnerServiceSMO.queryOrgInfoByStaffIds(orgStaffRelDto);
+                if (orgStaffRelDtos.size() > 0) {
+                    paramIn.put("branchOrgId", orgStaffRelDtos.get(0).getCompanyId());//当前人虽归属的二级组织信息
+                    paramIn.put("parentOrgId", orgStaffRelDtos.get(0).getCompanyId());//当前人虽归属的二级组织信息
+                }
+
+            }
+        }
 
 
         if (rows > 50) {
         if (rows > 50) {
             return new ResponseEntity<String>("rows 数量不能大于50", HttpStatus.BAD_REQUEST);
             return new ResponseEntity<String>("rows 数量不能大于50", HttpStatus.BAD_REQUEST);

+ 9 - 0
service-community/src/main/java/com/java110/community/dao/IResourceStoreServiceDao.java

@@ -21,4 +21,13 @@ public interface IResourceStoreServiceDao {
      */
      */
     int getResourceStoresCount(Map info);
     int getResourceStoresCount(Map info);
 
 
+    /**
+     * 查询资源总数
+     *
+     * @param info 资源信息
+     * @return 资源数量
+     */
+    String queryResourceStoresTotalPrice(Map info);
+
+
 }
 }

+ 17 - 0
service-community/src/main/java/com/java110/community/dao/impl/ResourceStoreServiceDaoImpl.java

@@ -36,4 +36,21 @@ public class ResourceStoreServiceDaoImpl extends BaseServiceDao implements IReso
         }
         }
         return Integer.parseInt(businessRoomRenovationInfos.get(0).get("count").toString());
         return Integer.parseInt(businessRoomRenovationInfos.get(0).get("count").toString());
     }
     }
+
+    /**
+     * 查询资源总价
+     *
+     * @param info 资源信息
+     * @return 资源数量
+     */
+    @Override
+    public String queryResourceStoresTotalPrice(Map info) {
+        logger.debug("查询资源数据 入参 info : {}", info);
+        List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.queryResourceStoresTotalPrice", info);
+        if (businessResourceStoreInfos.size() < 1) {
+            return "0";
+        }
+        return businessResourceStoreInfos.get(0).get("totalPrice").toString();
+    }
+
 }
 }

+ 9 - 0
service-store/src/main/java/com/java110/store/dao/IResourceStoreServiceDao.java

@@ -74,4 +74,13 @@ public interface IResourceStoreServiceDao {
      */
      */
     int queryResourceStoresCount(Map info);
     int queryResourceStoresCount(Map info);
 
 
+    /**
+     * 查询资源总数
+     *
+     * @param info 资源信息
+     * @return 资源数量
+     */
+    String queryResourceStoresTotalPrice(Map info);
+
+
 }
 }

+ 17 - 0
service-store/src/main/java/com/java110/store/dao/impl/ResourceStoreServiceDaoImpl.java

@@ -132,4 +132,21 @@ public class ResourceStoreServiceDaoImpl extends BaseServiceDao implements IReso
         return Integer.parseInt(businessResourceStoreInfos.get(0).get("count").toString());
         return Integer.parseInt(businessResourceStoreInfos.get(0).get("count").toString());
     }
     }
 
 
+    /**
+     * 查询资源总价
+     *
+     * @param info 资源信息
+     * @return 资源数量
+     */
+    @Override
+    public String queryResourceStoresTotalPrice(Map info) {
+        logger.debug("查询资源数据 入参 info : {}", info);
+        List<Map> businessResourceStoreInfos = sqlSessionTemplate.selectList("resourceResourceStoreServiceDaoImpl.queryResourceStoresTotalPrice", info);
+        if (businessResourceStoreInfos.size() < 1) {
+            return "0";
+        }
+        return businessResourceStoreInfos.get(0).get("totalPrice").toString();
+    }
+
+
 }
 }

+ 11 - 0
service-store/src/main/java/com/java110/store/smo/impl/ResourceStoreInnerServiceSMOImpl.java

@@ -145,6 +145,17 @@ public class ResourceStoreInnerServiceSMOImpl extends BaseServiceSMO implements
         this.resourceResourceStoreServiceDaoImpl = resourceResourceStoreServiceDaoImpl;
         this.resourceResourceStoreServiceDaoImpl = resourceResourceStoreServiceDaoImpl;
     }
     }
 
 
+    @Override
+    public String queryResourceStoresTotalPrice(@RequestBody ResourceStoreDto resourceResourceStoreDto) {
+        //校验是否传了 分页信息
+        int page = resourceResourceStoreDto.getPage();
+        if (page != PageDto.DEFAULT_PAGE) {
+            resourceResourceStoreDto.setPage((page - 1) * resourceResourceStoreDto.getRow());
+        }
+        return resourceResourceStoreServiceDaoImpl.queryResourceStoresTotalPrice(BeanConvertUtil.beanCovertMap(resourceResourceStoreDto));
+
+    }
+
     public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
     public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
         return userInnerServiceSMOImpl;
         return userInnerServiceSMOImpl;
     }
     }