Browse Source

加入 产品大类

wuxw 5 years ago
parent
commit
e585b0a0cc
20 changed files with 954 additions and 14 deletions
  1. 90 0
      java110-bean/src/main/java/com/java110/dto/productCategory/ProductCategoryDto.java
  2. 67 0
      java110-bean/src/main/java/com/java110/po/productCategory/ProductCategoryPo.java
  3. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  4. 120 0
      java110-db/src/main/resources/mapper/goods/ProductCategoryServiceDaoImplMapper.xml
  5. 26 13
      java110-generator/src/main/resources/newBack/template_1.json
  6. 26 0
      java110-generator/src/main/resources/newBack/template_sysDocument.json
  7. 53 0
      java110-interface/src/main/java/com/java110/intf/goods/IProductCategoryInnerServiceSMO.java
  8. 111 0
      service-goods/src/main/java/com/java110/goods/api/ProductCategoryApi.java
  9. 17 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/IDeleteProductCategoryBMO.java
  10. 16 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/IGetProductCategoryBMO.java
  11. 17 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/ISaveProductCategoryBMO.java
  12. 17 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/IUpdateProductCategoryBMO.java
  13. 34 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/DeleteProductCategoryBMOImpl.java
  14. 44 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/GetProductCategoryBMOImpl.java
  15. 38 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/SaveProductCategoryBMOImpl.java
  16. 34 0
      service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/UpdateProductCategoryBMOImpl.java
  17. 61 0
      service-goods/src/main/java/com/java110/goods/dao/IProductCategoryServiceDao.java
  18. 98 0
      service-goods/src/main/java/com/java110/goods/dao/impl/ProductCategoryServiceDaoImpl.java
  19. 83 0
      service-goods/src/main/java/com/java110/goods/smo/impl/ProductCategoryInnerServiceSMOImpl.java
  20. 1 1
      service-goods/src/main/resources/dataSource.yml

+ 90 - 0
java110-bean/src/main/java/com/java110/dto/productCategory/ProductCategoryDto.java

@@ -0,0 +1,90 @@
+package com.java110.dto.productCategory;
+
+import com.java110.dto.PageDto;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @ClassName FloorDto
+ * @Description 产品目录数据层封装
+ * @Author wuxw
+ * @Date 2019/4/24 8:52
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+public class ProductCategoryDto extends PageDto implements Serializable {
+
+    private String categoryLevel;
+private String parentCategoryId;
+private String storeId;
+private String categoryName;
+private String categoryId;
+private String seq;
+private String isShow;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getCategoryLevel() {
+        return categoryLevel;
+    }
+public void setCategoryLevel(String categoryLevel) {
+        this.categoryLevel = categoryLevel;
+    }
+public String getParentCategoryId() {
+        return parentCategoryId;
+    }
+public void setParentCategoryId(String parentCategoryId) {
+        this.parentCategoryId = parentCategoryId;
+    }
+public String getStoreId() {
+        return storeId;
+    }
+public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+public String getCategoryName() {
+        return categoryName;
+    }
+public void setCategoryName(String categoryName) {
+        this.categoryName = categoryName;
+    }
+public String getCategoryId() {
+        return categoryId;
+    }
+public void setCategoryId(String categoryId) {
+        this.categoryId = categoryId;
+    }
+public String getSeq() {
+        return seq;
+    }
+public void setSeq(String seq) {
+        this.seq = seq;
+    }
+public String getIsShow() {
+        return isShow;
+    }
+public void setIsShow(String isShow) {
+        this.isShow = isShow;
+    }
+
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+}

+ 67 - 0
java110-bean/src/main/java/com/java110/po/productCategory/ProductCategoryPo.java

@@ -0,0 +1,67 @@
+package com.java110.po.productCategory;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class ProductCategoryPo implements Serializable {
+
+    private String categoryLevel;
+private String parentCategoryId;
+private String statusCd = "0";
+private String storeId;
+private String categoryName;
+private String categoryId;
+private String seq;
+private String isShow;
+public String getCategoryLevel() {
+        return categoryLevel;
+    }
+public void setCategoryLevel(String categoryLevel) {
+        this.categoryLevel = categoryLevel;
+    }
+public String getParentCategoryId() {
+        return parentCategoryId;
+    }
+public void setParentCategoryId(String parentCategoryId) {
+        this.parentCategoryId = parentCategoryId;
+    }
+public String getStatusCd() {
+        return statusCd;
+    }
+public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+public String getStoreId() {
+        return storeId;
+    }
+public void setStoreId(String storeId) {
+        this.storeId = storeId;
+    }
+public String getCategoryName() {
+        return categoryName;
+    }
+public void setCategoryName(String categoryName) {
+        this.categoryName = categoryName;
+    }
+public String getCategoryId() {
+        return categoryId;
+    }
+public void setCategoryId(String categoryId) {
+        this.categoryId = categoryId;
+    }
+public String getSeq() {
+        return seq;
+    }
+public void setSeq(String seq) {
+        this.seq = seq;
+    }
+public String getIsShow() {
+        return isShow;
+    }
+public void setIsShow(String isShow) {
+        this.isShow = isShow;
+    }
+
+
+
+}

+ 1 - 0
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java

@@ -155,6 +155,7 @@ public class GenerateCodeFactory {
     public static final String CODE_PREFIX_auditId = "84";
     public static final String CODE_PREFIX_typeCd = "85";
     public static final String CODE_PREFIX_docId = "86";
+    public static final String CODE_PREFIX_categoryId = "87";
 
 
 

+ 120 - 0
java110-db/src/main/resources/mapper/goods/ProductCategoryServiceDaoImplMapper.xml

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="productCategoryServiceDaoImpl">
+
+
+    <!-- 保存产品目录信息 add by wuxw 2018-07-03 -->
+    <insert id="saveProductCategoryInfo" parameterType="Map">
+        insert into product_category(
+        category_level,parent_category_id,store_id,category_name,category_id,seq,is_show
+        ) values (
+        #{categoryLevel},#{parentCategoryId},#{storeId},#{categoryName},#{categoryId},#{seq},#{isShow}
+        )
+    </insert>
+
+
+    <!-- 查询产品目录信息 add by wuxw 2018-07-03 -->
+    <select id="getProductCategoryInfo" parameterType="Map" resultType="Map">
+        select t.category_level,t.category_level categoryLevel,t.parent_category_id,t.parent_category_id parentCategoryId,t.status_cd,t.status_cd statusCd,t.store_id,t.store_id
+        storeId,t.category_name,t.category_name categoryName,t.category_id,t.category_id categoryId,t.seq,t.is_show,t.is_show isShow
+        from product_category t
+        where 1 =1
+        <if test="categoryLevel !=null and categoryLevel != ''">
+            and t.category_level= #{categoryLevel}
+        </if>
+        <if test="parentCategoryId !=null and parentCategoryId != ''">
+            and t.parent_category_id= #{parentCategoryId}
+        </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="categoryName !=null and categoryName != ''">
+            and t.category_name= #{categoryName}
+        </if>
+        <if test="categoryId !=null and categoryId != ''">
+            and t.category_id= #{categoryId}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
+        <if test="isShow !=null and isShow != ''">
+            and t.is_show= #{isShow}
+        </if>
+        order by t.create_time desc
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+
+    </select>
+
+
+    <!-- 修改产品目录信息 add by wuxw 2018-07-03 -->
+    <update id="updateProductCategoryInfo" parameterType="Map">
+        update product_category t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="categoryLevel !=null and categoryLevel != ''">
+            , t.category_level= #{categoryLevel}
+        </if>
+        <if test="parentCategoryId !=null and parentCategoryId != ''">
+            , t.parent_category_id= #{parentCategoryId}
+        </if>
+        <if test="storeId !=null and storeId != ''">
+            , t.store_id= #{storeId}
+        </if>
+        <if test="categoryName !=null and categoryName != ''">
+            , t.category_name= #{categoryName}
+        </if>
+        <if test="seq !=null and seq != ''">
+            , t.seq= #{seq}
+        </if>
+        <if test="isShow !=null and isShow != ''">
+            , t.is_show= #{isShow}
+        </if>
+        where 1=1
+        <if test="categoryId !=null and categoryId != ''">
+            and t.category_id= #{categoryId}
+        </if>
+
+    </update>
+
+    <!-- 查询产品目录数量 add by wuxw 2018-07-03 -->
+    <select id="queryProductCategorysCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from product_category t
+        where 1 =1
+        <if test="categoryLevel !=null and categoryLevel != ''">
+            and t.category_level= #{categoryLevel}
+        </if>
+        <if test="parentCategoryId !=null and parentCategoryId != ''">
+            and t.parent_category_id= #{parentCategoryId}
+        </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="categoryName !=null and categoryName != ''">
+            and t.category_name= #{categoryName}
+        </if>
+        <if test="categoryId !=null and categoryId != ''">
+            and t.category_id= #{categoryId}
+        </if>
+        <if test="seq !=null and seq != ''">
+            and t.seq= #{seq}
+        </if>
+        <if test="isShow !=null and isShow != ''">
+            and t.is_show= #{isShow}
+        </if>
+
+
+    </select>
+
+</mapper>

+ 26 - 13
java110-generator/src/main/resources/newBack/template_1.json

@@ -1,25 +1,38 @@
 {
   "autoMove": false,
-  "id": "docId",
-  "name": "sysDocument",
-  "desc": "系统文档",
-  "shareParam": "docId",
-  "shareColumn": "doc_id",
-  "shareName": "common",
-  "tableName": "sys_document",
+  "id": "categoryId",
+  "name": "productCategory",
+  "desc": "产品目录",
+  "shareParam": "categoryId",
+  "shareColumn": "category_id",
+  "shareName": "goods",
+  "tableName": "product_category",
   "param": {
-    "docCode": "doc_code",
-    "docContent": "doc_content",
+    "categoryId": "category_id",
+    "categoryName": "category_name",
+    "parentCategoryId": "parent_category_id",
+    "categoryLevel": "category_level",
+    "seq": "seq",
+    "isShow": "is_show",
+    "storeId": "store_id",
     "statusCd": "status_cd"
   },
   "required": [
     {
-      "code": "docCode",
-      "msg": "文档编码不能为空"
+      "code": "categoryName",
+      "msg": "目录名称不能为空"
     },
     {
-      "code": "docContent",
-      "msg": "文档内容不能为空"
+      "code": "categoryLevel",
+      "msg": "目录级别不能为空"
+    },
+    {
+      "code": "seq",
+      "msg": "顺序不能为空"
+    },
+    {
+      "code": "isShow",
+      "msg": "是否显示不能为空"
     }
   ]
 }

+ 26 - 0
java110-generator/src/main/resources/newBack/template_sysDocument.json

@@ -0,0 +1,26 @@
+{
+  "autoMove": false,
+  "id": "docId",
+  "name": "sysDocument",
+  "desc": "系统文档",
+  "shareParam": "docId",
+  "shareColumn": "doc_id",
+  "shareName": "common",
+  "tableName": "sys_document",
+  "param": {
+    "docCode": "doc_code",
+    "docContent": "doc_content",
+    "statusCd": "status_cd"
+  },
+  "required": [
+    {
+      "code": "docCode",
+      "msg": "文档编码不能为空"
+    },
+    {
+      "code": "docContent",
+      "msg": "文档内容不能为空"
+    }
+  ]
+}
+

+ 53 - 0
java110-interface/src/main/java/com/java110/intf/goods/IProductCategoryInnerServiceSMO.java

@@ -0,0 +1,53 @@
+package com.java110.intf.goods;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.productCategory.ProductCategoryDto;
+import com.java110.po.productCategory.ProductCategoryPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * @ClassName IProductCategoryInnerServiceSMO
+ * @Description 产品目录接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "goods-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/productCategoryApi")
+public interface IProductCategoryInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveProductCategory", method = RequestMethod.POST)
+    public int saveProductCategory(@RequestBody ProductCategoryPo productCategoryPo);
+
+    @RequestMapping(value = "/updateProductCategory", method = RequestMethod.POST)
+    public int updateProductCategory(@RequestBody ProductCategoryPo productCategoryPo);
+
+    @RequestMapping(value = "/deleteProductCategory", method = RequestMethod.POST)
+    public int deleteProductCategory(@RequestBody ProductCategoryPo productCategoryPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param productCategoryDto 数据对象分享
+     * @return ProductCategoryDto 对象数据
+     */
+    @RequestMapping(value = "/queryProductCategorys", method = RequestMethod.POST)
+    List<ProductCategoryDto> queryProductCategorys(@RequestBody ProductCategoryDto productCategoryDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param productCategoryDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryProductCategorysCount", method = RequestMethod.POST)
+    int queryProductCategorysCount(@RequestBody ProductCategoryDto productCategoryDto);
+}

+ 111 - 0
service-goods/src/main/java/com/java110/goods/api/ProductCategoryApi.java

@@ -0,0 +1,111 @@
+package com.java110.goods.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.productCategory.ProductCategoryDto;
+import com.java110.goods.bmo.productCategory.IDeleteProductCategoryBMO;
+import com.java110.goods.bmo.productCategory.IGetProductCategoryBMO;
+import com.java110.goods.bmo.productCategory.ISaveProductCategoryBMO;
+import com.java110.goods.bmo.productCategory.IUpdateProductCategoryBMO;
+import com.java110.po.productCategory.ProductCategoryPo;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+
+@RestController
+@RequestMapping(value = "/productCategory")
+public class ProductCategoryApi {
+
+    @Autowired
+    private ISaveProductCategoryBMO saveProductCategoryBMOImpl;
+    @Autowired
+    private IUpdateProductCategoryBMO updateProductCategoryBMOImpl;
+    @Autowired
+    private IDeleteProductCategoryBMO deleteProductCategoryBMOImpl;
+
+    @Autowired
+    private IGetProductCategoryBMO getProductCategoryBMOImpl;
+
+    /**
+     * 微信保存消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /productCategory/saveProductCategory
+     * @path /app/productCategory/saveProductCategory
+     */
+    @RequestMapping(value = "/saveProductCategory", method = RequestMethod.POST)
+    public ResponseEntity<String> saveProductCategory(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "categoryName", "请求报文中未包含categoryName");
+        Assert.hasKeyAndValue(reqJson, "categoryLevel", "请求报文中未包含categoryLevel");
+        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含seq");
+        Assert.hasKeyAndValue(reqJson, "isShow", "请求报文中未包含isShow");
+
+
+        ProductCategoryPo productCategoryPo = BeanConvertUtil.covertBean(reqJson, ProductCategoryPo.class);
+        return saveProductCategoryBMOImpl.save(productCategoryPo);
+    }
+
+    /**
+     * 微信修改消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /productCategory/updateProductCategory
+     * @path /app/productCategory/updateProductCategory
+     */
+    @RequestMapping(value = "/updateProductCategory", method = RequestMethod.POST)
+    public ResponseEntity<String> updateProductCategory(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "categoryName", "请求报文中未包含categoryName");
+        Assert.hasKeyAndValue(reqJson, "categoryLevel", "请求报文中未包含categoryLevel");
+        Assert.hasKeyAndValue(reqJson, "seq", "请求报文中未包含seq");
+        Assert.hasKeyAndValue(reqJson, "isShow", "请求报文中未包含isShow");
+        Assert.hasKeyAndValue(reqJson, "categoryId", "categoryId不能为空");
+
+
+        ProductCategoryPo productCategoryPo = BeanConvertUtil.covertBean(reqJson, ProductCategoryPo.class);
+        return updateProductCategoryBMOImpl.update(productCategoryPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /productCategory/deleteProductCategory
+     * @path /app/productCategory/deleteProductCategory
+     */
+    @RequestMapping(value = "/deleteProductCategory", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteProductCategory(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "categoryId", "categoryId不能为空");
+
+
+        ProductCategoryPo productCategoryPo = BeanConvertUtil.covertBean(reqJson, ProductCategoryPo.class);
+        return deleteProductCategoryBMOImpl.delete(productCategoryPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param storeId 商户ID
+     * @return
+     * @serviceCode /productCategory/queryProductCategory
+     * @path /app/productCategory/queryProductCategory
+     */
+    @RequestMapping(value = "/queryProductCategory", method = RequestMethod.GET)
+    public ResponseEntity<String> queryProductCategory(@RequestHeader(value = "store-id") String storeId,
+                                                       @RequestParam(value = "page") int page,
+                                                       @RequestParam(value = "row") int row) {
+        ProductCategoryDto productCategoryDto = new ProductCategoryDto();
+        productCategoryDto.setPage(page);
+        productCategoryDto.setRow(row);
+        productCategoryDto.setStoreId(storeId);
+        return getProductCategoryBMOImpl.get(productCategoryDto);
+    }
+}

+ 17 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/IDeleteProductCategoryBMO.java

@@ -0,0 +1,17 @@
+package com.java110.goods.bmo.productCategory;
+import com.java110.po.productCategory.ProductCategoryPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteProductCategoryBMO {
+
+
+    /**
+     * 修改产品目录
+     * add by wuxw
+     * @param productCategoryPo
+     * @return
+     */
+    ResponseEntity<String> delete(ProductCategoryPo productCategoryPo);
+
+
+}

+ 16 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/IGetProductCategoryBMO.java

@@ -0,0 +1,16 @@
+package com.java110.goods.bmo.productCategory;
+import com.java110.dto.productCategory.ProductCategoryDto;
+import org.springframework.http.ResponseEntity;
+public interface IGetProductCategoryBMO {
+
+
+    /**
+     * 查询产品目录
+     * add by wuxw
+     * @param  productCategoryDto
+     * @return
+     */
+    ResponseEntity<String> get(ProductCategoryDto productCategoryDto);
+
+
+}

+ 17 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/ISaveProductCategoryBMO.java

@@ -0,0 +1,17 @@
+package com.java110.goods.bmo.productCategory;
+
+import com.java110.po.productCategory.ProductCategoryPo;
+import org.springframework.http.ResponseEntity;
+public interface ISaveProductCategoryBMO {
+
+
+    /**
+     * 添加产品目录
+     * add by wuxw
+     * @param productCategoryPo
+     * @return
+     */
+    ResponseEntity<String> save(ProductCategoryPo productCategoryPo);
+
+
+}

+ 17 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/IUpdateProductCategoryBMO.java

@@ -0,0 +1,17 @@
+package com.java110.goods.bmo.productCategory;
+import com.java110.po.productCategory.ProductCategoryPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateProductCategoryBMO {
+
+
+    /**
+     * 修改产品目录
+     * add by wuxw
+     * @param productCategoryPo
+     * @return
+     */
+    ResponseEntity<String> update(ProductCategoryPo productCategoryPo);
+
+
+}

+ 34 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/DeleteProductCategoryBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.goods.bmo.productCategory.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.goods.bmo.productCategory.IDeleteProductCategoryBMO;
+import com.java110.intf.goods.IProductCategoryInnerServiceSMO;
+import com.java110.po.productCategory.ProductCategoryPo;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteProductCategoryBMOImpl")
+public class DeleteProductCategoryBMOImpl implements IDeleteProductCategoryBMO {
+
+    @Autowired
+    private IProductCategoryInnerServiceSMO productCategoryInnerServiceSMOImpl;
+
+    /**
+     * @param productCategoryPo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(ProductCategoryPo productCategoryPo) {
+
+        int flag = productCategoryInnerServiceSMOImpl.deleteProductCategory(productCategoryPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 44 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/GetProductCategoryBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.goods.bmo.productCategory.impl;
+
+import com.java110.dto.productCategory.ProductCategoryDto;
+import com.java110.goods.bmo.productCategory.IGetProductCategoryBMO;
+import com.java110.intf.goods.IProductCategoryInnerServiceSMO;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Service("getProductCategoryBMOImpl")
+public class GetProductCategoryBMOImpl implements IGetProductCategoryBMO {
+
+    @Autowired
+    private IProductCategoryInnerServiceSMO productCategoryInnerServiceSMOImpl;
+
+    /**
+     * @param productCategoryDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(ProductCategoryDto productCategoryDto) {
+
+
+        int count = productCategoryInnerServiceSMOImpl.queryProductCategorysCount(productCategoryDto);
+
+        List<ProductCategoryDto> productCategoryDtos = null;
+        if (count > 0) {
+            productCategoryDtos = productCategoryInnerServiceSMOImpl.queryProductCategorys(productCategoryDto);
+        } else {
+            productCategoryDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) productCategoryDto.getRow()), count, productCategoryDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/SaveProductCategoryBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.goods.bmo.productCategory.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.goods.bmo.productCategory.ISaveProductCategoryBMO;
+import com.java110.intf.goods.IProductCategoryInnerServiceSMO;
+import com.java110.po.productCategory.ProductCategoryPo;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveProductCategoryBMOImpl")
+public class SaveProductCategoryBMOImpl implements ISaveProductCategoryBMO {
+
+    @Autowired
+    private IProductCategoryInnerServiceSMO productCategoryInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param productCategoryPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(ProductCategoryPo productCategoryPo) {
+
+        productCategoryPo.setCategoryId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_categoryId));
+        int flag = productCategoryInnerServiceSMOImpl.saveProductCategory(productCategoryPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 34 - 0
service-goods/src/main/java/com/java110/goods/bmo/productCategory/impl/UpdateProductCategoryBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.goods.bmo.productCategory.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.goods.bmo.productCategory.IUpdateProductCategoryBMO;
+import com.java110.intf.goods.IProductCategoryInnerServiceSMO;
+import com.java110.po.productCategory.ProductCategoryPo;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateProductCategoryBMOImpl")
+public class UpdateProductCategoryBMOImpl implements IUpdateProductCategoryBMO {
+
+    @Autowired
+    private IProductCategoryInnerServiceSMO productCategoryInnerServiceSMOImpl;
+
+    /**
+     * @param productCategoryPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(ProductCategoryPo productCategoryPo) {
+
+        int flag = productCategoryInnerServiceSMOImpl.updateProductCategory(productCategoryPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 61 - 0
service-goods/src/main/java/com/java110/goods/dao/IProductCategoryServiceDao.java

@@ -0,0 +1,61 @@
+package com.java110.goods.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 产品目录组件内部之间使用,没有给外围系统提供服务能力
+ * 产品目录服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ *
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IProductCategoryServiceDao {
+
+
+    /**
+     * 保存 产品目录信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveProductCategoryInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询产品目录信息(instance过程)
+     * 根据bId 查询产品目录信息
+     * @param info bId 信息
+     * @return 产品目录信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getProductCategoryInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改产品目录信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateProductCategoryInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询产品目录总数
+     *
+     * @param info 产品目录信息
+     * @return 产品目录数量
+     */
+    int queryProductCategorysCount(Map info);
+
+}

+ 98 - 0
service-goods/src/main/java/com/java110/goods/dao/impl/ProductCategoryServiceDaoImpl.java

@@ -0,0 +1,98 @@
+package com.java110.goods.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.goods.dao.IProductCategoryServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 产品目录服务 与数据库交互
+ * Created by wuxw on 2017/4/5.
+ */
+@Service("productCategoryServiceDaoImpl")
+//@Transactional
+public class ProductCategoryServiceDaoImpl extends BaseServiceDao implements IProductCategoryServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(ProductCategoryServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存产品目录信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveProductCategoryInfo(Map info) throws DAOException {
+        logger.debug("保存产品目录信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("productCategoryServiceDaoImpl.saveProductCategoryInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存产品目录信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+
+    /**
+     * 查询产品目录信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getProductCategoryInfo(Map info) throws DAOException {
+        logger.debug("查询产品目录信息 入参 info : {}",info);
+
+        List<Map> businessProductCategoryInfos = sqlSessionTemplate.selectList("productCategoryServiceDaoImpl.getProductCategoryInfo",info);
+
+        return businessProductCategoryInfos;
+    }
+
+
+    /**
+     * 修改产品目录信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateProductCategoryInfo(Map info) throws DAOException {
+        logger.debug("修改产品目录信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("productCategoryServiceDaoImpl.updateProductCategoryInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改产品目录信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询产品目录数量
+     * @param info 产品目录信息
+     * @return 产品目录数量
+     */
+    @Override
+    public int queryProductCategorysCount(Map info) {
+        logger.debug("查询产品目录数据 入参 info : {}",info);
+
+        List<Map> businessProductCategoryInfos = sqlSessionTemplate.selectList("productCategoryServiceDaoImpl.queryProductCategorysCount", info);
+        if (businessProductCategoryInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessProductCategoryInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 83 - 0
service-goods/src/main/java/com/java110/goods/smo/impl/ProductCategoryInnerServiceSMOImpl.java

@@ -0,0 +1,83 @@
+package com.java110.goods.smo.impl;
+
+
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.productCategory.ProductCategoryDto;
+import com.java110.goods.dao.IProductCategoryServiceDao;
+import com.java110.intf.goods.IProductCategoryInnerServiceSMO;
+import com.java110.po.productCategory.ProductCategoryPo;
+import com.java110.utils.util.BeanConvertUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * @ClassName FloorInnerServiceSMOImpl
+ * @Description 产品目录内部服务实现类
+ * @Author wuxw
+ * @Date 2019/4/24 9:20
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@RestController
+public class ProductCategoryInnerServiceSMOImpl extends BaseServiceSMO implements IProductCategoryInnerServiceSMO {
+
+    @Autowired
+    private IProductCategoryServiceDao productCategoryServiceDaoImpl;
+
+
+    @Override
+    public int saveProductCategory(@RequestBody ProductCategoryPo productCategoryPo) {
+        int saveFlag = 1;
+        productCategoryServiceDaoImpl.saveProductCategoryInfo(BeanConvertUtil.beanCovertMap(productCategoryPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int updateProductCategory(@RequestBody ProductCategoryPo productCategoryPo) {
+        int saveFlag = 1;
+        productCategoryServiceDaoImpl.updateProductCategoryInfo(BeanConvertUtil.beanCovertMap(productCategoryPo));
+        return saveFlag;
+    }
+
+    @Override
+    public int deleteProductCategory(@RequestBody ProductCategoryPo productCategoryPo) {
+        int saveFlag = 1;
+        productCategoryPo.setStatusCd("1");
+        productCategoryServiceDaoImpl.updateProductCategoryInfo(BeanConvertUtil.beanCovertMap(productCategoryPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<ProductCategoryDto> queryProductCategorys(@RequestBody ProductCategoryDto productCategoryDto) {
+
+        //校验是否传了 分页信息
+
+        int page = productCategoryDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            productCategoryDto.setPage((page - 1) * productCategoryDto.getRow());
+        }
+
+        List<ProductCategoryDto> productCategorys = BeanConvertUtil.covertBeanList(productCategoryServiceDaoImpl.getProductCategoryInfo(BeanConvertUtil.beanCovertMap(productCategoryDto)), ProductCategoryDto.class);
+
+        return productCategorys;
+    }
+
+
+    @Override
+    public int queryProductCategorysCount(@RequestBody ProductCategoryDto productCategoryDto) {
+        return productCategoryServiceDaoImpl.queryProductCategorysCount(BeanConvertUtil.beanCovertMap(productCategoryDto));
+    }
+
+    public IProductCategoryServiceDao getProductCategoryServiceDaoImpl() {
+        return productCategoryServiceDaoImpl;
+    }
+
+    public void setProductCategoryServiceDaoImpl(IProductCategoryServiceDao productCategoryServiceDaoImpl) {
+        this.productCategoryServiceDaoImpl = productCategoryServiceDaoImpl;
+    }
+}

+ 1 - 1
service-goods/src/main/resources/dataSource.yml

@@ -54,7 +54,7 @@ shardingRule:
   bindingTables:
     - business_xxx
 
-  defaultDataSourceName: ds1
+  defaultDataSourceName: ds0
   defaultDatabaseStrategy:
     none:
   defaultTableStrategy: