Przeglądaj źródła

物业费用开发测试完成

wuxw 7 lat temu
rodzic
commit
01d17791e2

+ 35 - 0
PropertyService/doc/savePropertyFee.json

@@ -0,0 +1,35 @@
+{
+  "orders": {
+    "appId": "外系统ID,分配得到",
+    "transactionId": "100000000020180409224736000001",
+    "userId": "用户ID",
+    "orderTypeCd": "订单类型,查询,受理",
+    "requestTime": "20180409224736",
+    "remark": "备注",
+    "sign": "这个服务是否要求MD5签名",
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  },
+  "business": {
+    "serviceCode": "save.property.fee",
+    "serviceName": "保存物业费用",
+    "remark": "备注",
+    "datas": {
+      "businessPropertyFee":[{
+        "feeId":"-1",
+        "propertyId":"123213",
+        "feeTypeCd":"T",
+        "feeMoney":"10",
+        "feeTime":"0.5",
+        "startTime": "2018-01-01",
+        "endTime": "2020-12-31"
+      }]
+    },
+    "attrs": [{
+      "specCd": "配置的字段ID",
+      "value": "具体值"
+    }]
+  }
+}

+ 37 - 1
PropertyService/src/main/java/com/java110/property/dao/IPropertyServiceDao.java

@@ -52,6 +52,12 @@ public interface IPropertyServiceDao {
      */
     public void saveBusinessPropertyUser(Map info) throws DAOException;
 
+    /**
+     * 保存物业费用信息
+     * @param info
+     * @throws DAOException
+     */
+    public void saveBusinessPropertyFee(Map info) throws DAOException;
     /**
      * 查询物业信息(business过程)
      * 根据bId 查询物业信息
@@ -95,6 +101,14 @@ public interface IPropertyServiceDao {
      * @throws DAOException
      */
     public List<Map> getBusinessPropertyUser(Map info) throws DAOException;
+
+    /**
+     * 查询物业费用信息
+     * @param info bId 信息
+     * @return 物业照片
+     * @throws DAOException
+     */
+    public List<Map> getBusinessPropertyFee(Map info) throws DAOException;
     /**
      * 保存 物业信息 Business数据到 Instance中
      * @param info
@@ -133,7 +147,12 @@ public interface IPropertyServiceDao {
      */
     public void savePropertyUserInstance(Map info) throws DAOException;
 
-
+    /**
+     * 保存 物业费用信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException
+     */
+    public void savePropertyFeeInstance(Map info) throws DAOException;
 
     /**
      * 查询物业信息(instance过程)
@@ -178,6 +197,14 @@ public interface IPropertyServiceDao {
      */
     public List<Map> getPropertyUser(Map info) throws DAOException;
 
+    /**
+     * 查询物业费用信息(instance 过程)
+     * @param info bId 信息
+     * @return 物业照片
+     * @throws DAOException
+     */
+    public List<Map> getPropertyFee(Map info) throws DAOException;
+
     /**
      * 修改物业信息
      * @param info 修改信息
@@ -218,4 +245,13 @@ public interface IPropertyServiceDao {
 
 
 
+    /**
+     * 修改物业费用信息
+     * @param info 修改信息
+     * @throws DAOException
+     */
+    public void updatePropertyFeeInstance(Map info) throws DAOException;
+
+
+
 }

+ 66 - 0
PropertyService/src/main/java/com/java110/property/dao/impl/PropertyServiceDaoImpl.java

@@ -108,6 +108,22 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         }
     }
 
+    /**
+     * 保存物业费用信息
+     * @param info
+     * @throws DAOException
+     */
+    public void saveBusinessPropertyFee(Map info) throws DAOException{
+        info.put("month", DateUtil.getCurrentMonth());
+        logger.debug("保存物业费用信息入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("propertyServiceDaoImpl.saveBusinessPropertyFee",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存物业费用信息数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
     /**
      * 查询物业信息
      * @param info bId 信息
@@ -189,6 +205,19 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         return businessPropertyUsers;
     }
 
+    /**
+     * 查询物业费用信息
+     * @param info bId 信息
+     * @return 物业照片
+     * @throws DAOException
+     */
+    public List<Map> getBusinessPropertyFee(Map info) throws DAOException{
+        logger.debug("查询物业用户信息 入参 info : {}",info);
+
+        List<Map> businessPropertyUsers = sqlSessionTemplate.selectList("propertyServiceDaoImpl.getBusinessPropertyFee",info);
+
+        return businessPropertyUsers;
+    }
 
 
     /**
@@ -255,6 +284,20 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         }
     }
 
+    /**
+     * 保存 物业费用信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException
+     */
+    public void savePropertyFeeInstance(Map info) throws DAOException{
+        logger.debug("保存物业费用信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("propertyServiceDaoImpl.savePropertyFeeInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存物业费用信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
 
 
     /**
@@ -337,6 +380,12 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         return propertyUsers;
     }
 
+    public List<Map> getPropertyFee(Map info) throws DAOException{
+        logger.debug("查询物业费用信息 入参 info : {}",info);
+        List<Map> propertyFees = sqlSessionTemplate.selectList("propertyServiceDaoImpl.getPropertyFee",info);
+        return propertyFees;
+    }
+
     /**
      * 修改物业信息
      * @param info 修改信息
@@ -416,4 +465,21 @@ public class PropertyServiceDaoImpl extends BaseServiceDao implements IPropertyS
         }
     }
 
+
+
+    /**
+     * 修改物业费用信息
+     * @param info 修改信息
+     * @throws DAOException
+     */
+    public void updatePropertyFeeInstance(Map info) throws DAOException{
+        logger.debug("修改物业费用信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("propertyServiceDaoImpl.updatePropertyFeeInstance",info);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改物业费用信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        }
+    }
+
 }

+ 27 - 200
PropertyService/src/main/java/com/java110/property/listener/SavePropertyFeeListener.java

@@ -2,13 +2,9 @@ package com.java110.property.listener;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.java110.common.constant.ResponseConstant;
 import com.java110.common.constant.ServiceCodeConstant;
 import com.java110.common.constant.StatusConstant;
-import com.java110.common.exception.ListenerExecuteException;
 import com.java110.common.util.Assert;
-import com.java110.common.util.DateUtil;
-import com.java110.common.util.StringUtil;
 import com.java110.core.annotation.Java110Listener;
 import com.java110.core.context.DataFlowContext;
 import com.java110.core.factory.GenerateCodeFactory;
@@ -19,8 +15,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.text.ParseException;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -58,27 +52,12 @@ public class SavePropertyFeeListener extends AbstractPropertyBusinessServiceData
         JSONObject data = business.getDatas();
         Assert.notEmpty(data,"没有datas 节点,或没有子节点需要处理");
 
-        //处理 businessProperty 节点
-        if(data.containsKey("businessProperty")){
-            JSONObject businessProperty = data.getJSONObject("businessProperty");
-            doBusinessProperty(business,businessProperty);
-            dataFlowContext.addParamOut("propertyId",businessProperty.getString("propertyId"));
+        //物业费用节点处理
+        if(data.containsKey("businessPropertyFee")){
+            JSONArray businessPropertyFees = data.getJSONArray("businessPropertyFee");
+            doBusinessPropertyFee(business,businessPropertyFees);
         }
 
-        if(data.containsKey("businessPropertyAttr")){
-            JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
-            doSaveBusinessPropertyAttrs(business,businessPropertyAttrs);
-        }
-
-        if(data.containsKey("businessPropertyPhoto")){
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            doBusinessPropertyPhoto(business,businessPropertyPhotos);
-        }
-
-        if(data.containsKey("businessPropertyCerdentials")){
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            doBusinessPropertyCerdentials(business,businessPropertyCerdentialses);
-        }
     }
 
     /**
@@ -94,27 +73,13 @@ public class SavePropertyFeeListener extends AbstractPropertyBusinessServiceData
         info.put("bId",business.getbId());
         info.put("operate",StatusConstant.OPERATE_ADD);
 
-        //物业信息
-        Map businessPropertyInfo = propertyServiceDaoImpl.getBusinessPropertyInfo(info);
-        if( businessPropertyInfo != null && !businessPropertyInfo.isEmpty()) {
-            propertyServiceDaoImpl.savePropertyInfoInstance(info);
-            dataFlowContext.addParamOut("propertyId",businessPropertyInfo.get("property_id"));
-        }
-        //物业属性
-        List<Map> businessPropertyAttrs = propertyServiceDaoImpl.getBusinessPropertyAttrs(info);
-        if(businessPropertyAttrs != null && businessPropertyAttrs.size() > 0) {
-            propertyServiceDaoImpl.savePropertyAttrsInstance(info);
-        }
-        //物业照片
-        List<Map> businessPropertyPhotos = propertyServiceDaoImpl.getBusinessPropertyPhoto(info);
-        if(businessPropertyPhotos != null && businessPropertyPhotos.size() >0){
-            propertyServiceDaoImpl.savePropertyPhotoInstance(info);
-        }
-        //物业证件
-        List<Map> businessPropertyCerdentialses = propertyServiceDaoImpl.getBusinessPropertyCerdentials(info);
-        if(businessPropertyCerdentialses != null && businessPropertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.savePropertyCerdentialsInstance(info);
+
+        //物业费用
+        List<Map> businessPropertyFees = propertyServiceDaoImpl.getBusinessPropertyFee(info);
+        if(businessPropertyFees != null && businessPropertyFees.size() >0){
+            propertyServiceDaoImpl.savePropertyFeeInstance(info);
         }
+
     }
 
     /**
@@ -132,174 +97,36 @@ public class SavePropertyFeeListener extends AbstractPropertyBusinessServiceData
         Map paramIn = new HashMap();
         paramIn.put("bId",bId);
         paramIn.put("statusCd",StatusConstant.STATUS_CD_INVALID);
-        //物业信息
-        Map propertyInfo = propertyServiceDaoImpl.getPropertyInfo(info);
-        if(propertyInfo != null && !propertyInfo.isEmpty()){
-            paramIn.put("propertyId",propertyInfo.get("property_id").toString());
-            propertyServiceDaoImpl.updatePropertyInfoInstance(paramIn);
-            dataFlowContext.addParamOut("propertyId",propertyInfo.get("property_id"));
-        }
-
-        //物业属性
-        List<Map> propertyAttrs = propertyServiceDaoImpl.getPropertyAttrs(info);
-        if(propertyAttrs != null && propertyAttrs.size()>0){
-            propertyServiceDaoImpl.updatePropertyAttrInstance(paramIn);
-        }
-
-        //物业照片
-        List<Map> propertyPhotos = propertyServiceDaoImpl.getPropertyPhoto(info);
-        if(propertyPhotos != null && propertyPhotos.size()>0){
-            propertyServiceDaoImpl.updatePropertyPhotoInstance(paramIn);
-        }
-
-        //物业属性
-        List<Map> propertyCerdentialses = propertyServiceDaoImpl.getPropertyCerdentials(info);
-        if(propertyCerdentialses != null && propertyCerdentialses.size()>0){
-            propertyServiceDaoImpl.updatePropertyCerdentailsInstance(paramIn);
+        
+        //物业费用
+        List<Map> propertyFees = propertyServiceDaoImpl.getPropertyFee(info);
+        if(propertyFees != null && propertyFees.size()>0){
+            propertyServiceDaoImpl.updatePropertyFeeInstance(paramIn);
         }
     }
 
     /**
-     * 保存物业照片
+     * 保存物业费用
      * @param business 业务对象
-     * @param businessPropertyPhotos 物业照片
+     * @param businessPropertyFees 物业费用
      */
-    private void doBusinessPropertyPhoto(Business business, JSONArray businessPropertyPhotos) {
+    private void doBusinessPropertyFee(Business business, JSONArray businessPropertyFees) {
 
-        for(int businessPropertyPhotoIndex = 0 ;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-            JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-            Assert.jsonObjectHaveKey(businessPropertyPhoto, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
+        for(int businessPropertyFeeIndex = 0 ;businessPropertyFeeIndex < businessPropertyFees.size();businessPropertyFeeIndex++) {
+            JSONObject businessPropertyFee = businessPropertyFees.getJSONObject(businessPropertyFeeIndex);
+            Assert.jsonObjectHaveKey(businessPropertyFee, "propertyId", "businessPropertyFee 节点下没有包含 propertyId 节点");
 
-            if (businessPropertyPhoto.getString("propertyPhotoId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyPhotoId();
-                businessPropertyPhoto.put("propertyPhotoId", propertyPhotoId);
+            if (businessPropertyFee.getString("feeId").startsWith("-")) {
+                String propertyFeeId = GenerateCodeFactory.getPropertyFeeId();
+                businessPropertyFee.put("feeId", propertyFeeId);
             }
-            businessPropertyPhoto.put("bId", business.getbId());
-            businessPropertyPhoto.put("operate", StatusConstant.OPERATE_ADD);
+            businessPropertyFee.put("bId", business.getbId());
+            businessPropertyFee.put("operate", StatusConstant.OPERATE_ADD);
             //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyPhoto(businessPropertyPhoto);
+            propertyServiceDaoImpl.saveBusinessPropertyFee(businessPropertyFee);
         }
     }
 
-    /**
-     * 处理 businessProperty 节点
-     * @param business 总的数据节点
-     * @param businessProperty 物业节点
-     */
-    private void doBusinessProperty(Business business,JSONObject businessProperty){
-
-        Assert.jsonObjectHaveKey(businessProperty,"propertyId","businessProperty 节点下没有包含 propertyId 节点");
-
-        if(businessProperty.getString("propertyId").startsWith("-")){
-            //刷新缓存
-            flushPropertyId(business.getDatas());
-        }
-
-        businessProperty.put("bId",business.getbId());
-        businessProperty.put("operate", StatusConstant.OPERATE_ADD);
-        //保存物业信息
-        propertyServiceDaoImpl.saveBusinessPropertyInfo(businessProperty);
-
-    }
-
-
-
-    /**
-     * 保存物业属性信息
-     * @param business 当前业务
-     * @param businessPropertyAttrs 物业属性
-     */
-    private void doSaveBusinessPropertyAttrs(Business business,JSONArray businessPropertyAttrs){
-        JSONObject data = business.getDatas();
-        JSONObject businessProperty = data.getJSONObject("businessProperty");
-        for(int propertyAttrIndex = 0 ; propertyAttrIndex < businessPropertyAttrs.size();propertyAttrIndex ++){
-            JSONObject propertyAttr = businessPropertyAttrs.getJSONObject(propertyAttrIndex);
-            Assert.jsonObjectHaveKey(propertyAttr,"attrId","businessPropertyAttr 节点下没有包含 attrId 节点");
-
-            if(propertyAttr.getString("attrId").startsWith("-")){
-                String attrId = GenerateCodeFactory.getAttrId();
-                propertyAttr.put("attrId",attrId);
-            }
-
-            propertyAttr.put("bId",business.getbId());
-            propertyAttr.put("propertyId",businessProperty.getString("propertyId"));
-            propertyAttr.put("operate", StatusConstant.OPERATE_ADD);
-
-            propertyServiceDaoImpl.saveBusinessPropertyAttr(propertyAttr);
-        }
-    }
-
-
-    /**
-     * 保存 物业证件 信息
-     * @param business 当前业务
-     * @param businessPropertyCerdentialses 物业证件
-     */
-    private void doBusinessPropertyCerdentials(Business business, JSONArray businessPropertyCerdentialses) {
-        for(int businessPropertyCerdentialsIndex = 0 ; businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size() ; businessPropertyCerdentialsIndex ++) {
-            JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
-            Assert.jsonObjectHaveKey(businessPropertyCerdentials, "propertyId", "businessPropertyPhoto 节点下没有包含 propertyId 节点");
-
-            if (businessPropertyCerdentials.getString("propertyCerdentialsId").startsWith("-")) {
-                String propertyPhotoId = GenerateCodeFactory.getPropertyCerdentialsId();
-                businessPropertyCerdentials.put("propertyCerdentialsId", propertyPhotoId);
-            }
-            Date validityPeriod = null;
-            try {
-                if(StringUtil.isNullOrNone(businessPropertyCerdentials.getString("validityPeriod"))){
-                    validityPeriod = DateUtil.getLastDate();
-                }else {
-                    validityPeriod = DateUtil.getDateFromString(businessPropertyCerdentials.getString("validityPeriod"), DateUtil.DATE_FORMATE_STRING_B);
-                }
-            } catch (ParseException e) {
-                throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR,"传入参数 validityPeriod 格式不正确,请填写 "+DateUtil.DATE_FORMATE_STRING_B +" 格式,"+businessPropertyCerdentials);
-            }
-            businessPropertyCerdentials.put("validityPeriod",validityPeriod);
-            businessPropertyCerdentials.put("bId", business.getbId());
-            businessPropertyCerdentials.put("operate", StatusConstant.OPERATE_ADD);
-            //保存物业信息
-            propertyServiceDaoImpl.saveBusinessPropertyCerdentials(businessPropertyCerdentials);
-        }
-    }
-
-
-
-    /**
-     * 刷新 物业ID
-     * @param data
-     */
-    private void flushPropertyId(JSONObject data) {
-
-        String propertyId = GenerateCodeFactory.getPropertyId();
-        JSONObject businessProperty = data.getJSONObject("businessProperty");
-        businessProperty.put("propertyId",propertyId);
-        //刷物业属性
-        if(data.containsKey("businessPropertyAttr")) {
-            JSONArray businessPropertyAttrs = data.getJSONArray("businessPropertyAttr");
-            for(int businessPropertyAttrIndex = 0;businessPropertyAttrIndex < businessPropertyAttrs.size();businessPropertyAttrIndex++) {
-                JSONObject businessPropertyAttr = businessPropertyAttrs.getJSONObject(businessPropertyAttrIndex);
-                businessPropertyAttr.put("propertyId", propertyId);
-            }
-        }
-        //刷 是物业照片 的 propertyId
-        if(data.containsKey("businessPropertyPhoto")) {
-            JSONArray businessPropertyPhotos = data.getJSONArray("businessPropertyPhoto");
-            for(int businessPropertyPhotoIndex = 0;businessPropertyPhotoIndex < businessPropertyPhotos.size();businessPropertyPhotoIndex++) {
-                JSONObject businessPropertyPhoto = businessPropertyPhotos.getJSONObject(businessPropertyPhotoIndex);
-                businessPropertyPhoto.put("propertyId", propertyId);
-            }
-        }
-        //刷 物业证件 的propertyId
-        if(data.containsKey("businessPropertyCerdentials")) {
-            JSONArray businessPropertyCerdentialses = data.getJSONArray("businessPropertyCerdentials");
-            for(int businessPropertyCerdentialsIndex = 0;businessPropertyCerdentialsIndex < businessPropertyCerdentialses.size();businessPropertyCerdentialsIndex++) {
-                JSONObject businessPropertyCerdentials = businessPropertyCerdentialses.getJSONObject(businessPropertyCerdentialsIndex);
-                businessPropertyCerdentials.put("propertyId", propertyId);
-            }
-        }
-    }
-
-
     public IPropertyServiceDao getPropertyServiceDaoImpl() {
         return propertyServiceDaoImpl;
     }

+ 79 - 3
java110-config/src/main/resources/mapper/property/PropertyServiceDaoImplMapper.xml

@@ -30,7 +30,11 @@
         insert into business_property_user(property_user_id,b_id,property_id,user_id,rel_cd,month,operate)
         values(#{propertyUserId},#{bId},#{propertyId},#{userId},#{relCd},#{month},#{operate})
     </insert>
-
+    <!-- 保存物业费用信息 add by wuxw 2018-12-20 -->
+    <insert id="saveBusinessPropertyFee" parameterType="Map">
+        insert into business_property_fee(fee_id,b_id,property_id,fee_type_cd,fee_money,fee_time,start_time,end_time,month,operate)
+        values(#{feeId},#{bId},#{propertyId},#{feeTypeCd},#{feeMoney},#{feeTime},#{startTime},#{endTime},#{month},#{operate})
+    </insert>
     <!-- 查询商户信息(Business) add by wuxw 2018-07-03 -->
     <select id="getBusinessPropertyInfo" parameterType="Map" resultType="Map">
         select s.property_id,s.b_id,s.name,s.address,s.tel,s.nearby_landmarks,s.map_x,s.map_y,s.operate
@@ -49,7 +53,7 @@
 
     <!-- 查询商户属性信息(Business) add by wuxw 2018-07-03 -->
     <select id="getBusinessPropertyAttrs" parameterType="Map" resultType="Map">
-        select sa.b_id,sa.attr_id,sa.property_id,sa.spec_cd,sa.value,sa.operate
+        select sa.b_id,sa.attr_id,sa.property_id,sa.spec_cd,sa.value,sa.oppropertyServiceDaoImplerate
         from business_property_attr sa where 1=1
         <if test="operate != null and operate != ''">
             and sa.operate = #{operate}
@@ -110,6 +114,21 @@
         </if>
     </select>
 
+    <!-- 查询物业费用 add by wuxw 2018-12-20 -->
+    <select id="getBusinessPropertyFee" parameterType="Map" resultType="Map">
+        select sc.fee_id,sc.b_id,sc.property_id,sc.fee_type_cd,sc.fee_money,sc.fee_time,sc.create_time,sc.start_time,sc.end_time,sc.operate
+        from business_property_fee sc where 1 = 1
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="operate != null and operate != ''">
+            and sc.operate = #{operate}
+        </if>
+        <if test="propertyId != null and propertyId != ''">
+            and sc.property_id = #{propertyId}
+        </if>
+    </select>
+
     <!-- 保存商户信息至 instance表中 add by wuxw 2018-07-03 -->
     <insert id="savePropertyInfoInstance" parameterType="Map">
         insert into p_property(property_id,b_id,name,address,tel,nearby_landmarks,map_x,map_y,status_cd)
@@ -149,6 +168,15 @@
         where sc.operate = 'ADD' and sc.b_id=#{bId}
     </insert>
 
+
+    <!-- 保存 商户用户信息 instance add by wuxw 2018-07-03 -->
+    <insert id="savePropertyFeeInstance" parameterType="Map">
+        insert into p_property_fee(fee_id,b_id,property_id,fee_type_cd,fee_money,fee_time,start_time,end_time,status_cd)
+        select sc.fee_id,sc.b_id,sc.property_id,sc.fee_type_cd,sc.fee_money,sc.fee_time,sc.start_time,sc.end_time,'0'
+        from business_property_fee sc
+        where sc.operate = 'ADD' and sc.b_id=#{bId}
+    </insert>
+
     <!-- 查询商户信息 add by wuxw 2018-07-03 -->
     <select id="getPropertyInfo" parameterType="Map" resultType="Map">
         select s.property_id,s.b_id,s.name,s.address,s.tel,s.nearby_landmarks,s.map_x,s.map_y,s.status_cd
@@ -170,7 +198,7 @@
     <select id="getPropertyAttrs" parameterType="Map" resultType="Map">
         select sa.b_id,sa.attr_id,sa.property_id,sa.spec_cd,sa.value,sa.status_cd
         from p_property_attr sa
-        where
+        wheregetPropertyFee
         1=1
         <if test="statusCd != null and statusCd != ''">
             and sa.status_cd = #{statusCd}
@@ -235,6 +263,23 @@
     </select>
 
 
+    <!-- 查询物业费用信息 add by wuxw 2018-07-03 -->
+    <select id="getPropertyFee" parameterType="Map" resultType="Map">
+        select sc.fee_id,sc.b_id,sc.property_id,sc.fee_type_cd,sc.fee_money,sc.fee_time,sc.start_time,sc.end_time,sc.status_cd
+        from p_property_fee sc
+        where 1=1
+        <if test="statusCd != null and statusCd != ''">
+            and sc.status_cd = #{statusCd}
+        </if>
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sc.property_id = #{propertyId}
+        </if>
+    </select>
+
+
     <!-- 修改商户信息 add by wuxw 2018-07-03 -->
     <update id="updatePropertyInfoInstance" parameterType="Map">
         update p_property s set s.status_cd = #{statusCd}
@@ -371,4 +416,35 @@
         </if>
     </update>
 
+
+    <!-- 修改商户用户信息 add by wuxw 2018-07-03 -->
+    <update id="updatePropertyFeeInstance" parameterType="Map">
+        update p_property_fee sc set sc.status_cd = #{statusCd}
+        <if test="newBId != null and newBId != ''">
+            ,sc.b_id = #{newBId}
+        </if>
+        <if test="feeMoney != null and feeMoney != ''">
+            ,sc.fee_money = #{feeMoney}
+        </if>
+        <if test="feeTime != null and feeTime != ''">
+            ,sc.fee_time = #{feeTime}
+        </if>
+        <if test="startTime != null and startTime != ''">
+            ,sc.start_time = #{startTime}
+        </if>
+        <if test="endTime != null and endTime != ''">
+            ,sc.end_time = #{endTime}
+        </if>
+        where 1=1
+        <if test="bId != null and bId !=''">
+            and sc.b_id = #{bId}
+        </if>
+        <if test="propertyId != null and propertyId !=''">
+            and sc.property_id = #{propertyId}
+        </if>
+        <if test="feeId != null and feeId !=''">
+            and sc.fee_id = #{feeId}
+        </if>
+    </update>
+
 </mapper>

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

@@ -79,6 +79,7 @@ public class GenerateCodeFactory {
         prefixMap.put("propertyPhotoId","91");
         prefixMap.put("propertyCerdentialsId","92");
         prefixMap.put("propertyUserId","93");
+        prefixMap.put("propertyFeeId","94");
     }
 
     private static String PLATFORM_CODE = "0001";
@@ -385,6 +386,19 @@ public class GenerateCodeFactory {
         return getCode(prefixMap.get("propertyUserId"));
     }
 
+    /**
+     * 物业费用ID生成
+     * @return
+     * @throws GenerateCodeException
+     */
+    public static String getPropertyFeeId() throws GenerateCodeException{
+        if(!MappingConstant.VALUE_ON.equals(MappingCache.getValue(MappingConstant.KEY_NEED_INVOKE_GENERATE_ID))){
+            return prefixMap.get("propertyFeeId") + DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_H+nextId("%06d"));
+        }
+
+        return getCode(prefixMap.get("propertyFeeId"));
+    }
+
 
     /**
      * 商品ID生成