Kaynağa Gözat

加入公式

java110 5 yıl önce
ebeveyn
işleme
20bf7cc7f8
21 değiştirilmiş dosya ile 1051 ekleme ve 99 silme
  1. 88 0
      java110-bean/src/main/java/com/java110/dto/feeFormula/FeeFormulaDto.java
  2. 62 0
      java110-bean/src/main/java/com/java110/po/feeFormula/FeeFormulaPo.java
  3. 1 0
      java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
  4. 103 0
      java110-db/src/main/resources/mapper/fee/FeeFormulaServiceDaoImplMapper.xml
  5. 15 15
      java110-generator/src/main/resources/newBack/template_1.json
  6. 28 0
      java110-generator/src/main/resources/newBack/template_rentingPoolAttr.json
  7. 20 84
      java110-generator/src/main/resources/web/template_1.json
  8. 107 0
      java110-generator/src/main/resources/web/template_meterWater.json
  9. 53 0
      java110-interface/src/main/java/com/java110/intf/fee/IFeeFormulaInnerServiceSMO.java
  10. 107 0
      service-fee/src/main/java/com/java110/fee/api/FeeFormulaApi.java
  11. 17 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/IDeleteFeeFormulaBMO.java
  12. 19 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/IGetFeeFormulaBMO.java
  13. 19 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/ISaveFeeFormulaBMO.java
  14. 19 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/IUpdateFeeFormulaBMO.java
  15. 34 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/DeleteFeeFormulaBMOImpl.java
  16. 44 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/GetFeeFormulaBMOImpl.java
  17. 38 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/SaveFeeFormulaBMOImpl.java
  18. 34 0
      service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/UpdateFeeFormulaBMOImpl.java
  19. 61 0
      service-fee/src/main/java/com/java110/fee/dao/IFeeFormulaServiceDao.java
  20. 98 0
      service-fee/src/main/java/com/java110/fee/dao/impl/FeeFormulaServiceDaoImpl.java
  21. 84 0
      service-fee/src/main/java/com/java110/fee/smo/impl/FeeFormulaInnerServiceSMOImpl.java

+ 88 - 0
java110-bean/src/main/java/com/java110/dto/feeFormula/FeeFormulaDto.java

@@ -0,0 +1,88 @@
+package com.java110.dto.feeFormula;
+
+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 FeeFormulaDto extends PageDto implements Serializable {
+
+    public static final String FORMULA_TYPE_PUBLIC = "6006"; // 公摊费用
+
+    private String formulaId;
+    private String formulaType;
+    private String formulaValue;
+    private String formulaDesc;
+    private String communityId;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getFormulaId() {
+        return formulaId;
+    }
+
+    public void setFormulaId(String formulaId) {
+        this.formulaId = formulaId;
+    }
+
+    public String getFormulaType() {
+        return formulaType;
+    }
+
+    public void setFormulaType(String formulaType) {
+        this.formulaType = formulaType;
+    }
+
+    public String getFormulaValue() {
+        return formulaValue;
+    }
+
+    public void setFormulaValue(String formulaValue) {
+        this.formulaValue = formulaValue;
+    }
+
+    public String getFormulaDesc() {
+        return formulaDesc;
+    }
+
+    public void setFormulaDesc(String formulaDesc) {
+        this.formulaDesc = formulaDesc;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+
+
+    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;
+    }
+}

+ 62 - 0
java110-bean/src/main/java/com/java110/po/feeFormula/FeeFormulaPo.java

@@ -0,0 +1,62 @@
+package com.java110.po.feeFormula;
+
+import java.io.Serializable;
+
+public class FeeFormulaPo implements Serializable {
+
+    private String formulaId;
+    private String formulaType;
+    private String formulaValue;
+    private String statusCd = "0";
+    private String formulaDesc;
+    private String communityId;
+
+
+    public String getFormulaId() {
+        return formulaId;
+    }
+
+    public void setFormulaId(String formulaId) {
+        this.formulaId = formulaId;
+    }
+
+    public String getFormulaType() {
+        return formulaType;
+    }
+
+    public void setFormulaType(String formulaType) {
+        this.formulaType = formulaType;
+    }
+
+    public String getFormulaValue() {
+        return formulaValue;
+    }
+
+    public void setFormulaValue(String formulaValue) {
+        this.formulaValue = formulaValue;
+    }
+
+    public String getStatusCd() {
+        return statusCd;
+    }
+
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
+
+    public String getFormulaDesc() {
+        return formulaDesc;
+    }
+
+    public void setFormulaDesc(String formulaDesc) {
+        this.formulaDesc = formulaDesc;
+    }
+
+    public String getCommunityId() {
+        return communityId;
+    }
+
+    public void setCommunityId(String communityId) {
+        this.communityId = communityId;
+    }
+}

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

@@ -142,6 +142,7 @@ public class GenerateCodeFactory {
 
 
     public static final String CODE_PREFIX_waterId = "78";
+    public static final String CODE_PREFIX_formulaId = "79";
 
 
     /**

+ 103 - 0
java110-db/src/main/resources/mapper/fee/FeeFormulaServiceDaoImplMapper.xml

@@ -0,0 +1,103 @@
+<?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="feeFormulaServiceDaoImpl">
+
+
+    <!-- 保存费用公式信息 add by wuxw 2018-07-03 -->
+    <insert id="saveFeeFormulaInfo" parameterType="Map">
+        insert into fee_formula(
+        formula_id,formula_type,formula_value,formula_desc,community_id
+        ) values (
+        #{formulaId},#{formulaType},#{formulaValue},#{formulaDesc},#{communityId}
+        )
+    </insert>
+
+
+    <!-- 查询费用公式信息 add by wuxw 2018-07-03 -->
+    <select id="getFeeFormulaInfo" parameterType="Map" resultType="Map">
+        select t.formula_id,t.formula_id formulaId,t.formula_type,t.formula_type
+        formulaType,t.formula_value,t.formula_value formulaValue,t.status_cd,t.status_cd
+        statusCd,t.formula_desc,t.formula_desc formulaDesc,t.community_id,t.community_id communityId
+        from fee_formula t
+        where 1 =1
+        <if test="formulaId !=null and formulaId != ''">
+            and t.formula_id= #{formulaId}
+        </if>
+        <if test="formulaType !=null and formulaType != ''">
+            and t.formula_type= #{formulaType}
+        </if>
+        <if test="formulaValue !=null and formulaValue != ''">
+            and t.formula_value= #{formulaValue}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="formulaDesc !=null and formulaDesc != ''">
+            and t.formula_desc= #{formulaDesc}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </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="updateFeeFormulaInfo" parameterType="Map">
+        update fee_formula t set t.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,t.b_id = #{newBId}
+        </if>
+        <if test="formulaType !=null and formulaType != ''">
+            , t.formula_type= #{formulaType}
+        </if>
+        <if test="formulaValue !=null and formulaValue != ''">
+            , t.formula_value= #{formulaValue}
+        </if>
+        <if test="formulaDesc !=null and formulaDesc != ''">
+            , t.formula_desc= #{formulaDesc}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            , t.community_id= #{communityId}
+        </if>
+        where 1=1
+        <if test="formulaId !=null and formulaId != ''">
+            and t.formula_id= #{formulaId}
+        </if>
+
+    </update>
+
+    <!-- 查询费用公式数量 add by wuxw 2018-07-03 -->
+    <select id="queryFeeFormulasCount" parameterType="Map" resultType="Map">
+        select count(1) count
+        from fee_formula t
+        where 1 =1
+        <if test="formulaId !=null and formulaId != ''">
+            and t.formula_id= #{formulaId}
+        </if>
+        <if test="formulaType !=null and formulaType != ''">
+            and t.formula_type= #{formulaType}
+        </if>
+        <if test="formulaValue !=null and formulaValue != ''">
+            and t.formula_value= #{formulaValue}
+        </if>
+        <if test="statusCd !=null and statusCd != ''">
+            and t.status_cd= #{statusCd}
+        </if>
+        <if test="formulaDesc !=null and formulaDesc != ''">
+            and t.formula_desc= #{formulaDesc}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+
+
+    </select>
+
+</mapper>

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

@@ -1,28 +1,28 @@
 {
   "autoMove": true,
-  "id": "attrId",
-  "name": "rentingPoolAttr",
-  "desc": "出租房屋属性",
+  "id": "formulaId",
+  "name": "feeFormula",
+  "desc": "费用公式",
   "shareParam": "communityId",
   "shareColumn": "community_id",
-  "shareName": "user",
-  "tableName": "renting_pool_attr",
+  "shareName": "fee",
+  "tableName": "fee_formula",
   "param": {
-    "rentingId": "renting_id",
-    "attrId": "attr_id",
-    "specCd": "spec_cd",
-    "value": "value",
+    "formulaId": "formula_id",
+    "formulaType": "formula_type",
+    "formulaValue": "formula_value",
+    "formulaDesc": "formula_desc",
+    "communityId": "community_id",
     "statusCd": "status_cd"
   },
   "required": [
     {
-      "code": "rentingId",
-      "msg": "出租房屋ID不能为空"
+      "code": "formulaValue",
+      "msg": "公式不能为空"
     },
     {
-      "code": "specCd",
-      "msg": "用户规格不能为空"
+      "code": "communityId",
+      "msg": "小区不能为空"
     }
   ]
-}
-
+}

+ 28 - 0
java110-generator/src/main/resources/newBack/template_rentingPoolAttr.json

@@ -0,0 +1,28 @@
+{
+  "autoMove": true,
+  "id": "attrId",
+  "name": "rentingPoolAttr",
+  "desc": "出租房屋属性",
+  "shareParam": "communityId",
+  "shareColumn": "community_id",
+  "shareName": "user",
+  "tableName": "renting_pool_attr",
+  "param": {
+    "rentingId": "renting_id",
+    "attrId": "attr_id",
+    "specCd": "spec_cd",
+    "value": "value",
+    "statusCd": "status_cd"
+  },
+  "required": [
+    {
+      "code": "rentingId",
+      "msg": "出租房屋ID不能为空"
+    },
+    {
+      "code": "specCd",
+      "msg": "用户规格不能为空"
+    }
+  ]
+}
+

+ 20 - 84
java110-generator/src/main/resources/web/template_1.json

@@ -1,107 +1,43 @@
 {
-  "templateName":"抄表",
+  "templateName":"公摊公式",
   "directories": "property",
-  "templateCode":"meterWater",
-  "templateKey":"waterId",
-  "templateKeyName":"ID",
-  "searchCode": "waterId",
-  "searchName": "ID",
+  "templateCode":"feeFormula",
+  "templateKey":"formulaId",
+  "templateKeyName":"公式ID",
+  "searchCode": "formulaId",
+  "searchName": "公式ID",
   "conditions": [
     {
-      "name": "ID",
+      "name": "公式ID",
       "inputType": "input",
-      "code": "waterId",
-      "whereCondition": "equal"
-    },
-    {
-      "name": "表类型",
-      "inputType": "select",
-      "selectValue":"1010,2020",
-      "selectValueName":"电表,水表",
-      "code": "meterType",
-      "whereCondition": "equal"
-    },
-    {
-      "name": "房屋编号",
-      "inputType": "input",
-      "code": "roomNum",
+      "code": "formulaId",
       "whereCondition": "equal"
     }
   ],
   "columns":[
     {
-      "code": "meterType",
-      "cnCode":"表类型",
-      "desc":"必填,请选择表类型",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "select",
-      "selectValue":"1010,2020",
-      "selectValueName":"电表,水表",
-      "limit":"num",
-      "limitParam":"",
-      "limitErrInfo":"表类型错误",
-      "show": true
-    },
-    {
-      "code": "preDegrees",
-      "cnCode":"上期度数",
-      "desc":"必填,请填写上期度数",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "input",
-      "limit":"money",
-      "limitParam":"",
-      "limitErrInfo":"上期度数格式错误",
-      "show": true
-    },
-    {
-      "code": "curDegrees",
-      "cnCode":"本期度数",
-      "desc":"必填,请填写本期度数",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "input",
-      "limit":"money",
-      "limitParam":"",
-      "limitErrInfo":"本期度数格式错误",
-      "show": true
-    },
-    {
-      "code": "preReadingTime",
-      "cnCode":"上期读表时间",
-      "desc":"必填,请填写上期读表时间",
+      "code": "formulaValue",
+      "cnCode":"公式",
+      "desc":"必填,请填写公式",
       "required":true,
       "hasDefaultValue":false,
       "inputType": "input",
-      "limit":"date",
-      "limitParam":"",
-      "limitErrInfo":"格式错误",
-      "show": true
-    },
-    {
-      "code": "curReadingTime",
-      "cnCode":"本期读表时间",
-      "desc":"必填,请填写本期读表时间",
-      "required":true,
-      "hasDefaultValue":false,
-      "inputType": "input",
-      "limit":"date",
-      "limitParam":"",
-      "limitErrInfo":"格式错误",
+      "limit":"maxLength",
+      "limitParam":"200",
+      "limitErrInfo":"公式太复杂",
       "show": true
     },
     {
-      "code": "remark",
-      "cnCode":"备注",
-      "desc":"选填,请填写备注",
+      "code": "formulaDesc",
+      "cnCode":"描述",
+      "desc":"选填,请填写本期度数",
       "required":false,
       "hasDefaultValue":false,
       "inputType": "input",
       "limit":"maxLength",
-      "limitParam":"500",
-      "limitErrInfo":"备注格式错误",
-      "show": false
+      "limitParam":"200",
+      "limitErrInfo":"描述太长",
+      "show": true
     }
   ]
 }

+ 107 - 0
java110-generator/src/main/resources/web/template_meterWater.json

@@ -0,0 +1,107 @@
+{
+  "templateName":"抄表",
+  "directories": "property",
+  "templateCode":"meterWater",
+  "templateKey":"waterId",
+  "templateKeyName":"表ID",
+  "searchCode": "waterId",
+  "searchName": "表ID",
+  "conditions": [
+    {
+      "name": "表ID",
+      "inputType": "input",
+      "code": "waterId",
+      "whereCondition": "equal"
+    },
+    {
+      "name": "表类型",
+      "inputType": "select",
+      "selectValue":"1010,2020",
+      "selectValueName":"电表,水表",
+      "code": "meterType",
+      "whereCondition": "equal"
+    },
+    {
+      "name": "房屋编号",
+      "inputType": "input",
+      "code": "roomNum",
+      "whereCondition": "equal"
+    }
+  ],
+  "columns":[
+    {
+      "code": "meterType",
+      "cnCode":"表类型",
+      "desc":"必填,请选择表类型",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "select",
+      "selectValue":"1010,2020",
+      "selectValueName":"电表,水表",
+      "limit":"num",
+      "limitParam":"",
+      "limitErrInfo":"表类型错误",
+      "show": true
+    },
+    {
+      "code": "preDegrees",
+      "cnCode":"上期度数",
+      "desc":"必填,请填写上期度数",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"上期度数格式错误",
+      "show": true
+    },
+    {
+      "code": "curDegrees",
+      "cnCode":"本期度数",
+      "desc":"必填,请填写本期度数",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"money",
+      "limitParam":"",
+      "limitErrInfo":"本期度数格式错误",
+      "show": true
+    },
+    {
+      "code": "preReadingTime",
+      "cnCode":"上期读表时间",
+      "desc":"必填,请填写上期读表时间",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"date",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
+      "show": true
+    },
+    {
+      "code": "curReadingTime",
+      "cnCode":"本期读表时间",
+      "desc":"必填,请填写本期读表时间",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"date",
+      "limitParam":"",
+      "limitErrInfo":"格式错误",
+      "show": true
+    },
+    {
+      "code": "remark",
+      "cnCode":"备注",
+      "desc":"选填,请填写备注",
+      "required":false,
+      "hasDefaultValue":false,
+      "inputType": "input",
+      "limit":"maxLength",
+      "limitParam":"500",
+      "limitErrInfo":"备注格式错误",
+      "show": false
+    }
+  ]
+}

+ 53 - 0
java110-interface/src/main/java/com/java110/intf/fee/IFeeFormulaInnerServiceSMO.java

@@ -0,0 +1,53 @@
+package com.java110.intf.fee;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.feeFormula.FeeFormulaDto;
+import com.java110.po.feeFormula.FeeFormulaPo;
+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 IFeeFormulaInnerServiceSMO
+ * @Description 费用公式接口类
+ * @Author wuxw
+ * @Date 2019/4/24 9:04
+ * @Version 1.0
+ * add by wuxw 2019/4/24
+ **/
+@FeignClient(name = "fee-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/feeFormulaApi")
+public interface IFeeFormulaInnerServiceSMO {
+
+
+    @RequestMapping(value = "/saveFeeFormula", method = RequestMethod.POST)
+    public int saveFeeFormula(@RequestBody FeeFormulaPo feeFormulaPo);
+
+    @RequestMapping(value = "/updateFeeFormula", method = RequestMethod.POST)
+    public int updateFeeFormula(@RequestBody  FeeFormulaPo feeFormulaPo);
+
+    @RequestMapping(value = "/deleteFeeFormula", method = RequestMethod.POST)
+    public int deleteFeeFormula(@RequestBody  FeeFormulaPo feeFormulaPo);
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param feeFormulaDto 数据对象分享
+     * @return FeeFormulaDto 对象数据
+     */
+    @RequestMapping(value = "/queryFeeFormulas", method = RequestMethod.POST)
+    List<FeeFormulaDto> queryFeeFormulas(@RequestBody FeeFormulaDto feeFormulaDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param feeFormulaDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryFeeFormulasCount", method = RequestMethod.POST)
+    int queryFeeFormulasCount(@RequestBody FeeFormulaDto feeFormulaDto);
+}

+ 107 - 0
service-fee/src/main/java/com/java110/fee/api/FeeFormulaApi.java

@@ -0,0 +1,107 @@
+package com.java110.fee.api;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.feeFormula.FeeFormulaDto;
+import com.java110.fee.bmo.feeFormula.IDeleteFeeFormulaBMO;
+import com.java110.fee.bmo.feeFormula.IGetFeeFormulaBMO;
+import com.java110.fee.bmo.feeFormula.ISaveFeeFormulaBMO;
+import com.java110.fee.bmo.feeFormula.IUpdateFeeFormulaBMO;
+import com.java110.po.feeFormula.FeeFormulaPo;
+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 = "/feeFormula")
+public class FeeFormulaApi {
+
+    @Autowired
+    private ISaveFeeFormulaBMO saveFeeFormulaBMOImpl;
+    @Autowired
+    private IUpdateFeeFormulaBMO updateFeeFormulaBMOImpl;
+    @Autowired
+    private IDeleteFeeFormulaBMO deleteFeeFormulaBMOImpl;
+
+    @Autowired
+    private IGetFeeFormulaBMO getFeeFormulaBMOImpl;
+
+    /**
+     * 微信保存消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /feeFormula/saveFeeFormula
+     * @path /app/feeFormula/saveFeeFormula
+     */
+    @RequestMapping(value = "/saveFeeFormula", method = RequestMethod.POST)
+    public ResponseEntity<String> saveFeeFormula(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "formulaValue", "请求报文中未包含formulaValue");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+
+
+        FeeFormulaPo feeFormulaPo = BeanConvertUtil.covertBean(reqJson, FeeFormulaPo.class);
+        feeFormulaPo.setFormulaType(FeeFormulaDto.FORMULA_TYPE_PUBLIC);
+        return saveFeeFormulaBMOImpl.save(feeFormulaPo);
+    }
+
+    /**
+     * 微信修改消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /feeFormula/updateFeeFormula
+     * @path /app/feeFormula/updateFeeFormula
+     */
+    @RequestMapping(value = "/updateFeeFormula", method = RequestMethod.POST)
+    public ResponseEntity<String> updateFeeFormula(@RequestBody JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "formulaValue", "请求报文中未包含formulaValue");
+        Assert.hasKeyAndValue(reqJson, "communityId", "请求报文中未包含communityId");
+        Assert.hasKeyAndValue(reqJson, "formulaId", "formulaId不能为空");
+
+
+        FeeFormulaPo feeFormulaPo = BeanConvertUtil.covertBean(reqJson, FeeFormulaPo.class);
+        return updateFeeFormulaBMOImpl.update(feeFormulaPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param reqJson
+     * @return
+     * @serviceCode /feeFormula/deleteFeeFormula
+     * @path /app/feeFormula/deleteFeeFormula
+     */
+    @RequestMapping(value = "/deleteFeeFormula", method = RequestMethod.POST)
+    public ResponseEntity<String> deleteFeeFormula(@RequestBody JSONObject reqJson) {
+        Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空");
+
+        Assert.hasKeyAndValue(reqJson, "formulaId", "formulaId不能为空");
+
+
+        FeeFormulaPo feeFormulaPo = BeanConvertUtil.covertBean(reqJson, FeeFormulaPo.class);
+        return deleteFeeFormulaBMOImpl.delete(feeFormulaPo);
+    }
+
+    /**
+     * 微信删除消息模板
+     *
+     * @param communityId 小区ID
+     * @return
+     * @serviceCode /feeFormula/queryFeeFormula
+     * @path /app/feeFormula/queryFeeFormula
+     */
+    @RequestMapping(value = "/queryFeeFormula", method = RequestMethod.GET)
+    public ResponseEntity<String> queryFeeFormula(@RequestParam(value = "communityId") String communityId,
+                                                  @RequestParam(value = "page") int page,
+                                                  @RequestParam(value = "row") int row) {
+        FeeFormulaDto feeFormulaDto = new FeeFormulaDto();
+        feeFormulaDto.setPage(page);
+        feeFormulaDto.setRow(row);
+        feeFormulaDto.setCommunityId(communityId);
+        return getFeeFormulaBMOImpl.get(feeFormulaDto);
+    }
+}

+ 17 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/IDeleteFeeFormulaBMO.java

@@ -0,0 +1,17 @@
+package com.java110.fee.bmo.feeFormula;
+import com.java110.po.feeFormula.FeeFormulaPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IDeleteFeeFormulaBMO {
+
+
+    /**
+     * 修改费用公式
+     * add by wuxw
+     * @param feeFormulaPo
+     * @return
+     */
+    ResponseEntity<String> delete(FeeFormulaPo feeFormulaPo);
+
+
+}

+ 19 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/IGetFeeFormulaBMO.java

@@ -0,0 +1,19 @@
+package com.java110.fee.bmo.feeFormula;
+
+import com.java110.dto.feeFormula.FeeFormulaDto;
+import org.springframework.http.ResponseEntity;
+
+public interface IGetFeeFormulaBMO {
+
+
+    /**
+     * 查询费用公式
+     * add by wuxw
+     *
+     * @param feeFormulaDto
+     * @return
+     */
+    ResponseEntity<String> get(FeeFormulaDto feeFormulaDto);
+
+
+}

+ 19 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/ISaveFeeFormulaBMO.java

@@ -0,0 +1,19 @@
+package com.java110.fee.bmo.feeFormula;
+
+import com.java110.po.feeFormula.FeeFormulaPo;
+import org.springframework.http.ResponseEntity;
+
+public interface ISaveFeeFormulaBMO {
+
+
+    /**
+     * 添加费用公式
+     * add by wuxw
+     *
+     * @param feeFormulaPo
+     * @return
+     */
+    ResponseEntity<String> save(FeeFormulaPo feeFormulaPo);
+
+
+}

+ 19 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/IUpdateFeeFormulaBMO.java

@@ -0,0 +1,19 @@
+package com.java110.fee.bmo.feeFormula;
+
+import com.java110.po.feeFormula.FeeFormulaPo;
+import org.springframework.http.ResponseEntity;
+
+public interface IUpdateFeeFormulaBMO {
+
+
+    /**
+     * 修改费用公式
+     * add by wuxw
+     *
+     * @param feeFormulaPo
+     * @return
+     */
+    ResponseEntity<String> update(FeeFormulaPo feeFormulaPo);
+
+
+}

+ 34 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/DeleteFeeFormulaBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.fee.bmo.feeFormula.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.fee.bmo.feeFormula.IDeleteFeeFormulaBMO;
+import com.java110.intf.fee.IFeeFormulaInnerServiceSMO;
+import com.java110.po.feeFormula.FeeFormulaPo;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("deleteFeeFormulaBMOImpl")
+public class DeleteFeeFormulaBMOImpl implements IDeleteFeeFormulaBMO {
+
+    @Autowired
+    private IFeeFormulaInnerServiceSMO feeFormulaInnerServiceSMOImpl;
+
+    /**
+     * @param feeFormulaPo 数据
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> delete(FeeFormulaPo feeFormulaPo) {
+
+        int flag = feeFormulaInnerServiceSMOImpl.deleteFeeFormula(feeFormulaPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 44 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/GetFeeFormulaBMOImpl.java

@@ -0,0 +1,44 @@
+package com.java110.fee.bmo.feeFormula.impl;
+
+import com.java110.dto.feeFormula.FeeFormulaDto;
+import com.java110.fee.bmo.feeFormula.IGetFeeFormulaBMO;
+import com.java110.intf.fee.IFeeFormulaInnerServiceSMO;
+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("getFeeFormulaBMOImpl")
+public class GetFeeFormulaBMOImpl implements IGetFeeFormulaBMO {
+
+    @Autowired
+    private IFeeFormulaInnerServiceSMO feeFormulaInnerServiceSMOImpl;
+
+    /**
+     * @param feeFormulaDto
+     * @return 订单服务能够接受的报文
+     */
+    public ResponseEntity<String> get(FeeFormulaDto feeFormulaDto) {
+
+
+        int count = feeFormulaInnerServiceSMOImpl.queryFeeFormulasCount(feeFormulaDto);
+
+        List<FeeFormulaDto> feeFormulaDtos = null;
+        if (count > 0) {
+            feeFormulaDtos = feeFormulaInnerServiceSMOImpl.queryFeeFormulas(feeFormulaDto);
+        } else {
+            feeFormulaDtos = new ArrayList<>();
+        }
+
+        ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) feeFormulaDto.getRow()), count, feeFormulaDtos);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+        return responseEntity;
+    }
+
+}

+ 38 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/SaveFeeFormulaBMOImpl.java

@@ -0,0 +1,38 @@
+package com.java110.fee.bmo.feeFormula.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.fee.bmo.feeFormula.ISaveFeeFormulaBMO;
+import com.java110.intf.fee.IFeeFormulaInnerServiceSMO;
+import com.java110.po.feeFormula.FeeFormulaPo;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("saveFeeFormulaBMOImpl")
+public class SaveFeeFormulaBMOImpl implements ISaveFeeFormulaBMO {
+
+    @Autowired
+    private IFeeFormulaInnerServiceSMO feeFormulaInnerServiceSMOImpl;
+
+    /**
+     * 添加小区信息
+     *
+     * @param feeFormulaPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> save(FeeFormulaPo feeFormulaPo) {
+
+        feeFormulaPo.setFormulaId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_formulaId));
+        int flag = feeFormulaInnerServiceSMOImpl.saveFeeFormula(feeFormulaPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 34 - 0
service-fee/src/main/java/com/java110/fee/bmo/feeFormula/impl/UpdateFeeFormulaBMOImpl.java

@@ -0,0 +1,34 @@
+package com.java110.fee.bmo.feeFormula.impl;
+
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.fee.bmo.feeFormula.IUpdateFeeFormulaBMO;
+import com.java110.intf.fee.IFeeFormulaInnerServiceSMO;
+import com.java110.po.feeFormula.FeeFormulaPo;
+import com.java110.vo.ResultVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+
+@Service("updateFeeFormulaBMOImpl")
+public class UpdateFeeFormulaBMOImpl implements IUpdateFeeFormulaBMO {
+
+    @Autowired
+    private IFeeFormulaInnerServiceSMO feeFormulaInnerServiceSMOImpl;
+
+    /**
+     * @param feeFormulaPo
+     * @return 订单服务能够接受的报文
+     */
+    @Java110Transactional
+    public ResponseEntity<String> update(FeeFormulaPo feeFormulaPo) {
+
+        int flag = feeFormulaInnerServiceSMOImpl.updateFeeFormula(feeFormulaPo);
+
+        if (flag > 0) {
+            return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功");
+        }
+
+        return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败");
+    }
+
+}

+ 61 - 0
service-fee/src/main/java/com/java110/fee/dao/IFeeFormulaServiceDao.java

@@ -0,0 +1,61 @@
+package com.java110.fee.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 IFeeFormulaServiceDao {
+
+
+    /**
+     * 保存 费用公式信息
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveFeeFormulaInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询费用公式信息(instance过程)
+     * 根据bId 查询费用公式信息
+     * @param info bId 信息
+     * @return 费用公式信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getFeeFormulaInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改费用公式信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void updateFeeFormulaInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询费用公式总数
+     *
+     * @param info 费用公式信息
+     * @return 费用公式数量
+     */
+    int queryFeeFormulasCount(Map info);
+
+}

+ 98 - 0
service-fee/src/main/java/com/java110/fee/dao/impl/FeeFormulaServiceDaoImpl.java

@@ -0,0 +1,98 @@
+package com.java110.fee.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.fee.dao.IFeeFormulaServiceDao;
+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("feeFormulaServiceDaoImpl")
+//@Transactional
+public class FeeFormulaServiceDaoImpl extends BaseServiceDao implements IFeeFormulaServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(FeeFormulaServiceDaoImpl.class);
+
+
+
+
+
+    /**
+     * 保存费用公式信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveFeeFormulaInfo(Map info) throws DAOException {
+        logger.debug("保存费用公式信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("feeFormulaServiceDaoImpl.saveFeeFormulaInfo",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> getFeeFormulaInfo(Map info) throws DAOException {
+        logger.debug("查询费用公式信息 入参 info : {}",info);
+
+        List<Map> businessFeeFormulaInfos = sqlSessionTemplate.selectList("feeFormulaServiceDaoImpl.getFeeFormulaInfo",info);
+
+        return businessFeeFormulaInfos;
+    }
+
+
+    /**
+     * 修改费用公式信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void updateFeeFormulaInfo(Map info) throws DAOException {
+        logger.debug("修改费用公式信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("feeFormulaServiceDaoImpl.updateFeeFormulaInfo",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改费用公式信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
+     /**
+     * 查询费用公式数量
+     * @param info 费用公式信息
+     * @return 费用公式数量
+     */
+    @Override
+    public int queryFeeFormulasCount(Map info) {
+        logger.debug("查询费用公式数据 入参 info : {}",info);
+
+        List<Map> businessFeeFormulaInfos = sqlSessionTemplate.selectList("feeFormulaServiceDaoImpl.queryFeeFormulasCount", info);
+        if (businessFeeFormulaInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessFeeFormulaInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 84 - 0
service-fee/src/main/java/com/java110/fee/smo/impl/FeeFormulaInnerServiceSMOImpl.java

@@ -0,0 +1,84 @@
+package com.java110.fee.smo.impl;
+
+
+import com.java110.fee.dao.IFeeFormulaServiceDao;
+import com.java110.intf.fee.IFeeFormulaInnerServiceSMO;
+import com.java110.dto.feeFormula.FeeFormulaDto;
+import com.java110.po.feeFormula.FeeFormulaPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+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 FeeFormulaInnerServiceSMOImpl extends BaseServiceSMO implements IFeeFormulaInnerServiceSMO {
+
+    @Autowired
+    private IFeeFormulaServiceDao feeFormulaServiceDaoImpl;
+
+
+    @Override
+    public int saveFeeFormula(@RequestBody FeeFormulaPo feeFormulaPo) {
+        int saveFlag = 1;
+        feeFormulaServiceDaoImpl.saveFeeFormulaInfo(BeanConvertUtil.beanCovertMap(feeFormulaPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int updateFeeFormula(@RequestBody  FeeFormulaPo feeFormulaPo) {
+        int saveFlag = 1;
+         feeFormulaServiceDaoImpl.updateFeeFormulaInfo(BeanConvertUtil.beanCovertMap(feeFormulaPo));
+        return saveFlag;
+    }
+
+     @Override
+    public int deleteFeeFormula(@RequestBody  FeeFormulaPo feeFormulaPo) {
+        int saveFlag = 1;
+        feeFormulaPo.setStatusCd("1");
+        feeFormulaServiceDaoImpl.updateFeeFormulaInfo(BeanConvertUtil.beanCovertMap(feeFormulaPo));
+        return saveFlag;
+    }
+
+    @Override
+    public List<FeeFormulaDto> queryFeeFormulas(@RequestBody  FeeFormulaDto feeFormulaDto) {
+
+        //校验是否传了 分页信息
+
+        int page = feeFormulaDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            feeFormulaDto.setPage((page - 1) * feeFormulaDto.getRow());
+        }
+
+        List<FeeFormulaDto> feeFormulas = BeanConvertUtil.covertBeanList(feeFormulaServiceDaoImpl.getFeeFormulaInfo(BeanConvertUtil.beanCovertMap(feeFormulaDto)), FeeFormulaDto.class);
+
+        return feeFormulas;
+    }
+
+
+    @Override
+    public int queryFeeFormulasCount(@RequestBody FeeFormulaDto feeFormulaDto) {
+        return feeFormulaServiceDaoImpl.queryFeeFormulasCount(BeanConvertUtil.beanCovertMap(feeFormulaDto));    }
+
+    public IFeeFormulaServiceDao getFeeFormulaServiceDaoImpl() {
+        return feeFormulaServiceDaoImpl;
+    }
+
+    public void setFeeFormulaServiceDaoImpl(IFeeFormulaServiceDao feeFormulaServiceDaoImpl) {
+        this.feeFormulaServiceDaoImpl = feeFormulaServiceDaoImpl;
+    }
+}