Explorar o código

Merge branch 'master' of http://git.homecommunity.cn/supervip/MicroCommunity

wuxw %!s(int64=4) %!d(string=hai) anos
pai
achega
105f802974
Modificáronse 28 ficheiros con 925 adicións e 200 borrados
  1. 7 0
      java110-bean/src/main/java/com/java110/po/owner/OwnerAttrPo.java
  2. 36 39
      java110-core/src/main/java/com/java110/core/factory/AuthenticationFactory.java
  3. 5 0
      java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml
  4. 20 2
      java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml
  5. 7 1
      java110-db/src/main/resources/mapper/report/ReportFeeServiceDaoImplMapper.xml
  6. 15 0
      java110-db/src/main/resources/mapper/report/ReportFeeYearCollectionServiceDaoImplMapper.xml
  7. 11 0
      java110-interface/src/main/java/com/java110/intf/community/ICommunityInnerServiceSMO.java
  8. 1 1
      java110-interface/src/main/java/com/java110/intf/fee/IPayFeeDetailDiscountInnerServiceSMO.java
  9. 19 17
      service-common/src/main/java/com/java110/common/smo/impl/OaWorkflowUserInnerServiceSMOImpl.java
  10. 7 0
      service-community/src/main/java/com/java110/community/dao/ICommunityServiceDao.java
  11. 9 0
      service-community/src/main/java/com/java110/community/dao/impl/CommunityServiceDaoImpl.java
  12. 11 0
      service-community/src/main/java/com/java110/community/smo/impl/CommunityInnerServiceSMOImpl.java
  13. 1 0
      service-fee/src/main/java/com/java110/fee/FeeServiceApplicationStart.java
  14. 1 0
      service-job/src/main/java/com/java110/job/adapt/hcGov/owner/AddOwnerToHcGovReturnAdapt.java
  15. 237 0
      service-job/src/main/java/com/java110/job/adapt/hcGov/owner/EditOwnerToHcGovAdapt.java
  16. 85 0
      service-job/src/main/java/com/java110/job/adapt/hcGov/owner/EditOwnerToHcGovReturnAdapt.java
  17. 1 0
      service-job/src/main/java/com/java110/job/adapt/hcGov/room/EditRoomToHcGovReturnAdapt.java
  18. 1 1
      service-job/src/main/java/com/java110/job/adapt/hcToTianchuang/GetTianChuangToken.java
  19. 329 35
      service-job/src/main/java/com/java110/job/adapt/hcToTianchuang/PersonToTianchuangAdapt.java
  20. 28 75
      service-job/src/main/java/com/java110/job/adapt/hcToTianchuang/TianChuangConstant.java
  21. 20 1
      service-oa/src/main/java/com/java110/oa/bmo/oaWorkflowForm/impl/GetOaWorkflowFormBMOImpl.java
  22. 10 4
      service-report/src/main/java/com/java110/report/bmo/reportOweFee/impl/GetReportOweFeeBMOImpl.java
  23. 2 0
      service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java
  24. 7 0
      service-report/src/main/java/com/java110/report/dao/IReportFeeYearCollectionServiceDao.java
  25. 13 0
      service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java
  26. 40 22
      service-report/src/main/java/com/java110/report/dao/impl/ReportFeeYearCollectionServiceDaoImpl.java
  27. 1 1
      service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java
  28. 1 1
      service-report/src/main/java/com/java110/report/smo/impl/ReportFeeYearCollectionInnerServiceSMOImpl.java

+ 7 - 0
java110-bean/src/main/java/com/java110/po/owner/OwnerAttrPo.java

@@ -9,6 +9,7 @@ public class OwnerAttrPo implements Serializable {
     private String communityId;
     private String value;
     private String memberId;
+    private String statusCd = "0";
 
     public String getAttrId() {
         return attrId;
@@ -50,5 +51,11 @@ public class OwnerAttrPo implements Serializable {
         this.memberId = memberId;
     }
 
+    public String getStatusCd() {
+        return statusCd;
+    }
 
+    public void setStatusCd(String statusCd) {
+        this.statusCd = statusCd;
+    }
 }

+ 36 - 39
java110-core/src/main/java/com/java110/core/factory/AuthenticationFactory.java

@@ -22,7 +22,6 @@ import com.java110.utils.exception.NoAuthorityException;
 import com.java110.utils.util.Base64Convert;
 import com.java110.utils.util.StringUtil;
 import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.logging.log4j.util.Base64Util;
 
 import javax.crypto.Cipher;
 import javax.crypto.SecretKeyFactory;
@@ -32,15 +31,7 @@ import javax.crypto.spec.SecretKeySpec;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.security.InvalidParameterException;
-import java.security.Key;
-import java.security.KeyFactory;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
-import java.security.MessageDigest;
-import java.security.PrivateKey;
-import java.security.PublicKey;
+import java.security.*;
 import java.security.spec.PKCS8EncodedKeySpec;
 import java.security.spec.X509EncodedKeySpec;
 import java.util.Base64;
@@ -73,8 +64,9 @@ public class AuthenticationFactory {
     private static final String CHARSET = "utf-8";
 
 
-        // 加密
-        public static String AesEncrypt(String sSrc, String sKey) throws Exception {
+    // 加密
+    public static String AesEncrypt(String sSrc, String sKey) {
+        try {
             if (sKey == null) {
                 System.out.print("Key为空null");
                 return null;
@@ -91,39 +83,43 @@ public class AuthenticationFactory {
             byte[] encrypted = cipher.doFinal(sSrc.getBytes("utf-8"));
 
             return Base64Convert.byteToBase64(encrypted);//此处使用BASE64做转码功能,同时能起到2次加密的作用。
+        } catch (Exception e) {
+            e.printStackTrace();
         }
+        return "";
+    }
 
-        // 解密
-        public static String AesDecrypt(String sSrc, String sKey) throws Exception {
+    // 解密
+    public static String AesDecrypt(String sSrc, String sKey) {
+        try {
+            // 判断Key是否正确
+            if (sKey == null) {
+                System.out.print("Key为空null");
+                return null;
+            }
+            // 判断Key是否为16位
+            if (sKey.length() != 16) {
+                System.out.print("Key长度不是16位");
+                return null;
+            }
+            byte[] raw = sKey.getBytes("utf-8");
+            SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
+            Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
+            cipher.init(Cipher.DECRYPT_MODE, skeySpec);
+            byte[] encrypted1 = Base64Convert.base64ToByte(sSrc);//先用base64解密
             try {
-                // 判断Key是否正确
-                if (sKey == null) {
-                    System.out.print("Key为空null");
-                    return null;
-                }
-                // 判断Key是否为16位
-                if (sKey.length() != 16) {
-                    System.out.print("Key长度不是16位");
-                    return null;
-                }
-                byte[] raw = sKey.getBytes("utf-8");
-                SecretKeySpec skeySpec = new SecretKeySpec(raw, "AES");
-                Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
-                cipher.init(Cipher.DECRYPT_MODE, skeySpec);
-                byte[] encrypted1 = Base64Convert.base64ToByte(sSrc);//先用base64解密
-                try {
-                    byte[] original = cipher.doFinal(encrypted1);
-                    String originalString = new String(original,"utf-8");
-                    return originalString;
-                } catch (Exception e) {
-                    System.out.println(e.toString());
-                    return null;
-                }
-            } catch (Exception ex) {
-                System.out.println(ex.toString());
+                byte[] original = cipher.doFinal(encrypted1);
+                String originalString = new String(original, "utf-8");
+                return originalString;
+            } catch (Exception e) {
+                System.out.println(e.toString());
                 return null;
             }
+        } catch (Exception ex) {
+            System.out.println(ex.toString());
+            return null;
         }
+    }
 
 
     /**
@@ -463,6 +459,7 @@ public class AuthenticationFactory {
         String newSign = md5(reportDataHeaderDto.getTranId() + reportDataHeaderDto.getReqTime() + reportDataDto.getReportDataBodyDto().toJSONString() + code).toLowerCase();
         reportDataHeaderDto.setSign(newSign);
     }
+
     /**
      * 加载公钥
      *

+ 5 - 0
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

@@ -12,6 +12,11 @@
         #{nearbyLandmarks},#{mapX},#{mapY},#{month},#{state},#{operate},#{communityArea},#{tel})
     </insert>
 
+    <!-- 保存小区属性信息  add by wuxw 2018-07-03 -->
+    <insert id="saveCommunityAttr" parameterType="Map">
+        insert into s_community_attr(b_id,attr_id,community_id,spec_cd,value,month,status_cd)
+        values(#{bId},#{attrId},#{communityId},#{specCd},#{value},#{month},#{statusCd})
+    </insert>
 
 
     <!-- 保存小区属性信息  add by wuxw 2018-07-03 -->

+ 20 - 2
java110-db/src/main/resources/mapper/report/ReportFeeMonthStatisticsServiceDaoImplMapper.xml

@@ -89,9 +89,7 @@
         update report_fee_month_statistics t set
         t.owe_amount= #{oweAmount}
         where 1=1
-        <if test="statisticsId !=null and statisticsId != ''">
             and t.statistics_id= #{statisticsId}
-        </if>
         <if test="curMaxTime !=null ">
             and t.cur_max_time &lt;= #{curMaxTime}
         </if>
@@ -160,6 +158,26 @@
 
     </update>
 
+    <!-- 修改费用月统计信息 add by wuxw 2018-07-03 -->
+    <update id="deleteReportFeeMonthStatisticsInfo" parameterType="Map">
+        update report_fee_month_statistics t set t.status_cd = '1'
+        where 1=1
+        <if test="statisticsId !=null and statisticsId != ''">
+            and t.statistics_id= #{statisticsId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="feeId !=null and feeId != ''">
+            and t.fee_id= #{feeId}
+        </if>
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
+
+    </update>
+
+
     <!-- 查询费用月统计数量 add by wuxw 2018-07-03 -->
     <select id="queryReportFeeMonthStatisticssCount" parameterType="Map" resultType="Map">
         select count(1) count

+ 7 - 1
java110-db/src/main/resources/mapper/report/ReportFeeServiceDaoImplMapper.xml

@@ -63,7 +63,8 @@
         storeTypeCd,
         t.community_id communityId,pfa.value importFeeName,ifd.end_time importFeeEndTime,mw.cur_degrees
         curDegrees,mw.pre_degrees preDegrees,
-        mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime,pfa1.`value` deadlineTime,mw.price mwPrice
+        mw.pre_reading_time preReadingTime,mw.cur_reading_time curReadingTime,pfa1.`value` deadlineTime,mw.price mwPrice,
+        pfa2.`value` ownerTel,   pfa3.`value` ownerName
         from pay_fee t
         INNER JOIN pay_fee_config pfc on t.config_id = pfc.config_id and pfc.status_cd = '0'
         left join building_room br on t.payer_obj_id = br.room_id and t.payer_obj_type = '3333' and br.status_cd = '0'
@@ -72,6 +73,8 @@
         left join s_store ss on t.income_obj_id = ss.store_id and ss.status_cd = '0'
         LEFT JOIN pay_fee_attrs pfa on t.fee_id = pfa.fee_id and pfa.spec_cd = '390002' and pfa.status_cd = '0'
         LEFT JOIN pay_fee_attrs pfa1 on t.fee_id = pfa1.fee_id and pfa1.spec_cd = '390010' and pfa1.status_cd = '0'
+        LEFT JOIN pay_fee_attrs pfa2 on t.fee_id = pfa2.fee_id and pfa2.spec_cd = '390009' and pfa2.status_cd = '0'
+        LEFT JOIN pay_fee_attrs pfa3 on t.fee_id = pfa3.fee_id and pfa3.spec_cd = '390008' and pfa3.status_cd = '0'
         left join import_fee_detail ifd on t.fee_id = ifd.fee_id and ifd.status_cd = '0' and t.fee_flag = '2006012'
         LEFT JOIN meter_water mw on t.fee_id = mw.fee_id and mw.status_cd = '0' and mw.community_id = t.community_id
         where t.status_cd = '0'
@@ -87,6 +90,9 @@
         <if test="communityId !=null and communityId != ''">
             and t.community_id= #{communityId}
         </if>
+        <if test="configId !=null and configId != ''">
+            and t.config_id= #{configId}
+        </if>
         <if test="feeFlag !=null and feeFlag != ''">
             and t.fee_flag= #{feeFlag}
         </if>

+ 15 - 0
java110-db/src/main/resources/mapper/report/ReportFeeYearCollectionServiceDaoImplMapper.xml

@@ -178,6 +178,21 @@
 
     </update>
 
+    <update id="deleteReportFeeYearCollectionInfo" parameterType="Map">
+        update report_fee_year_collection t set t.status_cd = '1'
+        where 1=1
+        <if test="feeId !=null and feeId != ''">
+            and t.fee_id= #{feeId}
+        </if>
+        <if test="communityId !=null and communityId != ''">
+            and t.community_id= #{communityId}
+        </if>
+        <if test="collectionId !=null and collectionId != ''">
+            and t.collection_id= #{collectionId}
+        </if>
+
+    </update>
+
     <!-- 查询费用年收费数量 add by wuxw 2018-07-03 -->
     <select id="queryReportFeeYearCollectionsCount" parameterType="Map" resultType="Map">
         select count(DISTINCT t.collection_id) count

+ 11 - 0
java110-interface/src/main/java/com/java110/intf/community/ICommunityInnerServiceSMO.java

@@ -4,6 +4,7 @@ import com.java110.config.feign.FeignConfiguration;
 import com.java110.dto.CommunityMemberDto;
 import com.java110.dto.community.CommunityAttrDto;
 import com.java110.dto.community.CommunityDto;
+import com.java110.po.community.CommunityAttrPo;
 import com.java110.po.community.CommunityPo;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -88,4 +89,14 @@ public interface ICommunityInnerServiceSMO {
      */
     @RequestMapping(value = "/getCommunityAttrsCount", method = RequestMethod.POST)
     int getCommunityAttrsCount(@RequestBody CommunityAttrDto communityAttrDto);
+
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param communityAttrPo 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/saveCommunityAttr", method = RequestMethod.POST)
+    int saveCommunityAttr(@RequestBody CommunityAttrPo communityAttrPo);
 }

+ 1 - 1
java110-interface/src/main/java/com/java110/intf/fee/IPayFeeDetailDiscountInnerServiceSMO.java

@@ -17,7 +17,7 @@ import java.util.List;
  * @Version 1.0
  * add by wuxw 2019/4/24
  **/
-@FeignClient(name = "community-service", configuration = {FeignConfiguration.class})
+@FeignClient(name = "fee-service", configuration = {FeignConfiguration.class})
 @RequestMapping("/payFeeDetailDiscountApi")
 public interface IPayFeeDetailDiscountInnerServiceSMO {
 

+ 19 - 17
service-common/src/main/java/com/java110/common/smo/impl/OaWorkflowUserInnerServiceSMOImpl.java

@@ -18,17 +18,8 @@ import com.java110.po.oaWorkflowData.OaWorkflowDataPo;
 import com.java110.utils.util.Assert;
 import com.java110.utils.util.DateUtil;
 import com.java110.utils.util.StringUtil;
-import org.activiti.bpmn.model.BpmnModel;
-import org.activiti.bpmn.model.EndEvent;
-import org.activiti.bpmn.model.FlowElement;
-import org.activiti.bpmn.model.FlowNode;
-import org.activiti.bpmn.model.SequenceFlow;
-import org.activiti.bpmn.model.UserTask;
-import org.activiti.engine.HistoryService;
-import org.activiti.engine.ProcessEngine;
-import org.activiti.engine.RepositoryService;
-import org.activiti.engine.RuntimeService;
-import org.activiti.engine.TaskService;
+import org.activiti.bpmn.model.*;
+import org.activiti.engine.*;
 import org.activiti.engine.history.HistoricProcessInstance;
 import org.activiti.engine.history.HistoricTaskInstance;
 import org.activiti.engine.history.HistoricTaskInstanceQuery;
@@ -562,6 +553,7 @@ public class OaWorkflowUserInnerServiceSMOImpl extends BaseServiceSMO implements
         List<SequenceFlow> outgoingFlows = flowNode.getOutgoingFlows();
         JSONObject taskObj = null;
         taskObj = new JSONObject();
+        taskObj.put("assignee", "-1"); //  默认 不需要指定下一个处理人 表示结束
         boolean isReturn = false;
         //遍历输出连线
         for (SequenceFlow outgoingFlow : outgoingFlows) {
@@ -584,21 +576,31 @@ public class OaWorkflowUserInnerServiceSMOImpl extends BaseServiceSMO implements
                     taskObj.put("backIndex", outgoingFlow.getTargetFlowElement().getName());
                     isReturn = true;
                 }
+                //结束
+                vars.put("auditCode", "1500");
+                if (isCondition(outgoingFlow.getConditionExpression(), vars)) {
+                    //true 获取输出节点名称
+                    taskObj.put("exit", outgoingFlow.getTargetFlowElement().getName());
+                    isReturn = true;
+                }
                 if (!isReturn) {
                     String assignee = ((UserTask) targetFlowElement).getAssignee();
                     if (!StringUtil.isEmpty(assignee) && assignee.indexOf("${") < 0) {
                         taskObj.put("assignee", assignee); // 下一节点处理人
                     }
+                    if ("${startUserId}".equals(assignee)) {
+                        taskObj.put("assignee", reqJson.getString("startUserId")); // 开始人
+                    }
+                    if ("${nextUserId}".equals(assignee)) {
+                        taskObj.put("assignee", "-2"); // 需要前台指定
+                    }
+                    taskObj.put("next", outgoingFlow.getTargetFlowElement().getName());
                 }
             }
-
             //如果下一个为 结束节点
             if (targetFlowElement instanceof EndEvent) {
-                Map vars = new HashMap();
-                vars.put("auditCode", "1100");
-                if (isCondition(outgoingFlow.getConditionExpression(), vars)) {
-                    taskObj.put("assignee", "-1"); // 没有下一处理人了
-                }
+                //true 获取输出节点名称
+                taskObj.put("exit", "1");
             }
         }
         tasks.add(taskObj);

+ 7 - 0
service-community/src/main/java/com/java110/community/dao/ICommunityServiceDao.java

@@ -267,4 +267,11 @@ public interface ICommunityServiceDao {
     List<Map> getStoreCommunitys(Map beanCovertMap);
 
 
+    /**
+     * 添加属性
+     *
+     * @param info
+     * @return
+     */
+    int saveCommunityAttr(Map info);
 }

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

@@ -489,5 +489,14 @@ public class CommunityServiceDaoImpl extends BaseServiceDao implements ICommunit
         return businessCommunityInfos;
     }
 
+    @Override
+    public int saveCommunityAttr(Map info) {
+        logger.debug("小区成员加入Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("communityServiceDaoImpl.saveCommunityAttr", info);
+
+        return saveFlag;
+    }
+
 
 }

+ 11 - 0
service-community/src/main/java/com/java110/community/smo/impl/CommunityInnerServiceSMOImpl.java

@@ -8,6 +8,7 @@ import com.java110.dto.PageDto;
 import com.java110.dto.community.CommunityAttrDto;
 import com.java110.dto.community.CommunityDto;
 import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.po.community.CommunityAttrPo;
 import com.java110.po.community.CommunityPo;
 import com.java110.utils.util.BeanConvertUtil;
 import org.slf4j.Logger;
@@ -101,6 +102,16 @@ public class CommunityInnerServiceSMOImpl extends BaseServiceSMO implements ICom
         return communityServiceDaoImpl.getCommunityAttrsCount(BeanConvertUtil.beanCovertMap(communityAttrDto));
     }
 
+    /**
+     * 保存小区属性
+     * @param communityAttrPo 数据对象分享
+     * @return
+     */
+    @Override
+    public int saveCommunityAttr(CommunityAttrPo communityAttrPo) {
+        return communityServiceDaoImpl.saveCommunityAttr(BeanConvertUtil.beanCovertMap(communityAttrPo));
+    }
+
     @Override
     public List<CommunityDto> queryCommunitys(@RequestBody CommunityDto communityDto) {
 

+ 1 - 0
service-fee/src/main/java/com/java110/fee/FeeServiceApplicationStart.java

@@ -37,6 +37,7 @@ import java.nio.charset.Charset;
         "com.java110.intf.order",
         "com.java110.intf.community",
         "com.java110.intf.job",
+        "com.java110.intf.acct",
         "com.java110.intf.store"})
 public class FeeServiceApplicationStart {
 

+ 1 - 0
service-job/src/main/java/com/java110/job/adapt/hcGov/owner/AddOwnerToHcGovReturnAdapt.java

@@ -67,6 +67,7 @@ public class AddOwnerToHcGovReturnAdapt implements IReportReturnDataAdapt {
         ownerAttrPo.setMemberId(ownerAttrDto.getMemberId());
         ownerAttrPo.setSpecCd(ownerAttrDto.getSpecCd());
         ownerAttrPo.setValue(reportDataDto.getReportDataBodyDto().getString("extOwnerId"));
+        ownerAttrPo.setCommunityId(hcGovTranslateDtos.get(0).getCommunityId());
 
         if (ownerAttr == null || ownerAttr.size() < 1) {
             int flag = ownerAttrInnerServiceSMOImpl.saveOwnerAttr(ownerAttrPo);

+ 237 - 0
service-job/src/main/java/com/java110/job/adapt/hcGov/owner/EditOwnerToHcGovAdapt.java

@@ -0,0 +1,237 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.job.adapt.hcGov.owner;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.java110.dto.RoomAttrDto;
+import com.java110.dto.community.CommunityAttrDto;
+import com.java110.dto.community.CommunityDto;
+import com.java110.dto.owner.OwnerAttrDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.dto.owner.OwnerRoomRelDto;
+import com.java110.entity.order.Business;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.intf.community.IRoomAttrInnerServiceSMO;
+import com.java110.intf.user.IOwnerAttrInnerServiceSMO;
+import com.java110.intf.user.IOwnerInnerServiceSMO;
+import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
+import com.java110.job.adapt.DatabusAdaptImpl;
+import com.java110.job.adapt.hcGov.HcGovConstant;
+import com.java110.job.adapt.hcGov.asyn.BaseHcGovSendAsyn;
+import com.java110.po.owner.OwnerPo;
+import com.java110.po.owner.OwnerRoomRelPo;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.utils.util.DateUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 新增业主信息同步HC政务接口
+ * <p>
+ * 接口协议地址: https://gitee.com/java110/microCommunityInformation/tree/master/info-doc#1%E6%A5%BC%E6%A0%8B%E4%B8%8A%E4%BC%A0
+ *
+ * @desc add by 吴学文 16:20
+ */
+@Component(value = "editOwnerToHcGovAdapt")
+public class EditOwnerToHcGovAdapt extends DatabusAdaptImpl {
+
+    @Autowired
+    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
+    @Autowired
+    private IRoomAttrInnerServiceSMO roomAttrInnerServiceSMOImpl;
+    @Autowired
+    private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl;
+    @Autowired
+    private BaseHcGovSendAsyn baseHcGovSendAsynImpl;
+    @Autowired
+    private IOwnerAttrInnerServiceSMO ownerAttrInnerServiceSMOImpl;
+    @Autowired
+    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
+
+
+    /**
+     * @param business   当前处理业务
+     * @param businesses 所有业务信息
+     */
+    @Override
+    public void execute(Business business, List<Business> businesses) {
+        JSONObject data = business.getData();
+        if (data.containsKey(OwnerRoomRelPo.class.getSimpleName())) {
+            Object bObj = data.get(OwnerRoomRelPo.class.getSimpleName());
+            JSONArray businessOwnerRoomRelPo = null;
+            if (bObj instanceof JSONObject) {
+                businessOwnerRoomRelPo = new JSONArray();
+                businessOwnerRoomRelPo.add(bObj);
+            } else if (bObj instanceof List) {
+                businessOwnerRoomRelPo = JSONArray.parseArray(JSONObject.toJSONString(bObj));
+            } else {
+                businessOwnerRoomRelPo = (JSONArray) bObj;
+            }
+            //JSONObject businessOwnerCar = data.getJSONObject("businessOwnerCar");
+            for (int bOwnerIndex = 0; bOwnerIndex < businessOwnerRoomRelPo.size(); bOwnerIndex++) {
+                JSONObject businessOwnerCar = businessOwnerRoomRelPo.getJSONObject(bOwnerIndex);
+                doAddOwner(business, businessOwnerCar);
+
+            }
+        }
+    }
+
+    private void doAddOwner(Business business, JSONObject businessOwner) {
+
+        OwnerRoomRelPo ownerRoomRelPo = BeanConvertUtil.covertBean(businessOwner, OwnerRoomRelPo.class);
+        OwnerDto ownerDto = new OwnerDto();
+        ownerDto.setMemberId(ownerRoomRelPo.getOwnerId());
+        List<OwnerDto> ownerDtoList = ownerInnerServiceSMOImpl.queryAllOwners(ownerDto);
+        Assert.listNotNull(ownerDtoList, "未查询到业主信息信息");
+        OwnerPo ownerPo = BeanConvertUtil.covertBean(ownerDtoList.get(0), OwnerPo.class);
+
+        CommunityDto communityDto = new CommunityDto();
+        communityDto.setCommunityId(ownerPo.getCommunityId());
+        List<CommunityDto> communityDtos = communityInnerServiceSMOImpl.queryCommunitys(communityDto);
+        Assert.listNotNull(communityDtos, "未包含小区信息");
+
+        CommunityDto tmpCommunityDto = communityDtos.get(0);
+        String extCommunityId = "";
+        JSONArray extRoomId = null;
+        String communityId = tmpCommunityDto.getCommunityId();
+        String memberId = ownerPo.getMemberId();
+
+        for (CommunityAttrDto communityAttrDto : tmpCommunityDto.getCommunityAttrDtos()) {
+            if (HcGovConstant.EXT_COMMUNITY_ID.equals(communityAttrDto.getSpecCd())) {
+                extCommunityId = communityAttrDto.getValue();
+            }
+        }
+        OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
+        ownerRoomRelDto.setOwnerId(memberId);
+        List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
+        if (ownerRoomRelDtos != null && ownerRoomRelDtos.size() > 0) {
+            for (OwnerRoomRelDto ownerRoomRelD : ownerRoomRelDtos) {
+                RoomAttrDto roomAttrDto = new RoomAttrDto();
+                roomAttrDto.setRoomId(ownerRoomRelD.getRoomId());
+                roomAttrDto.setSpecCd(HcGovConstant.EXT_COMMUNITY_ID);
+                List<RoomAttrDto> roomAttrDtos = roomAttrInnerServiceSMOImpl.queryRoomAttrs(roomAttrDto);
+                if (roomAttrDtos == null || roomAttrDtos.size() < 1) {
+                    return;
+                }
+                if (roomAttrDtos != null && roomAttrDtos.size() > 0) {
+                    extRoomId = new JSONArray();
+                    for (RoomAttrDto roomAttr : roomAttrDtos) {
+                        if (HcGovConstant.EXT_COMMUNITY_ID.equals(roomAttr.getSpecCd())) {
+                            extRoomId.add(roomAttr.getValue());
+                        }
+                    }
+                }
+            }
+
+        }
+        JSONObject body = new JSONObject();
+        //1001 业主本人 1002 家庭成员
+        if ("1001".equals(ownerPo.getOwnerTypeCd())) {
+            String extMemberId = "";
+            OwnerAttrDto ownerAttrDto = new OwnerAttrDto();
+            ownerAttrDto.setMemberId(ownerPo.getMemberId());
+            ownerAttrDto.setSpecCd(HcGovConstant.EXT_COMMUNITY_ID);
+            List<OwnerAttrDto> ownerAttr = ownerAttrInnerServiceSMOImpl.queryOwnerAttrs(ownerAttrDto);
+            if (ownerAttr != null && ownerAttr.size() > 0) {
+                for (OwnerAttrDto roomAttr : ownerAttr) {
+                    if (HcGovConstant.EXT_COMMUNITY_ID.equals(roomAttr.getSpecCd())) {
+                        extMemberId = roomAttr.getValue();
+                    }
+                }
+            }
+            if ("".equals(extMemberId)) {
+                throw new IllegalArgumentException("未获得业主外部编码!");
+            }
+            body.put("idType", "1");
+            body.put("idCard", ownerPo.getIdCard());
+            body.put("personName", ownerPo.getName());
+            body.put("personTel", ownerPo.getLink());
+            body.put("personSex", ownerPo.getSex());
+            body.put("prePersonName", ownerPo.getName());
+            body.put("birthday", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B));
+            body.put("nation", "未知");
+            body.put("nativePlace", "中国");
+            body.put("politicalOutlook", "无");
+            body.put("maritalStatus", "N");
+            body.put("religiousBelief", "无");
+            body.put("ramark", ownerPo.getRemark());
+            body.put("extRoomId", extRoomId.toJSONString());
+            body.put("ownerType", "2002");
+            body.put("ownerAddress", "无");
+            body.put("ownerTypeCd", ownerPo.getOwnerTypeCd());
+            body.put("extMemberId", extMemberId);
+        }
+        if ("1002".equals(ownerPo.getOwnerTypeCd())) {
+            String extOwnerId = "";
+            OwnerAttrDto ownerAttrDto = new OwnerAttrDto();
+            ownerAttrDto.setMemberId(ownerPo.getOwnerId());
+            ownerAttrDto.setSpecCd(HcGovConstant.EXT_COMMUNITY_ID);
+            List<OwnerAttrDto> ownerAttr = ownerAttrInnerServiceSMOImpl.queryOwnerAttrs(ownerAttrDto);
+            if (ownerAttr != null && ownerAttr.size() > 0) {
+                for (OwnerAttrDto roomAttr : ownerAttr) {
+                    if (HcGovConstant.EXT_COMMUNITY_ID.equals(roomAttr.getSpecCd())) {
+                        extOwnerId = roomAttr.getValue();
+                    }
+                }
+            }
+            if ("".equals(extOwnerId)) {
+                throw new IllegalArgumentException("未获得业主外部编码!");
+            }
+
+            String extMemberId = "";
+            ownerAttrDto = new OwnerAttrDto();
+            ownerAttrDto.setMemberId(ownerPo.getMemberId());
+            ownerAttrDto.setSpecCd(HcGovConstant.EXT_COMMUNITY_ID);
+            ownerAttr = ownerAttrInnerServiceSMOImpl.queryOwnerAttrs(ownerAttrDto);
+            if (ownerAttr != null && ownerAttr.size() > 0) {
+                for (OwnerAttrDto roomAttr : ownerAttr) {
+                    if (HcGovConstant.EXT_COMMUNITY_ID.equals(roomAttr.getSpecCd())) {
+                        extMemberId = roomAttr.getValue();
+                    }
+                }
+            }
+            if ("".equals(extOwnerId)) {
+                throw new IllegalArgumentException("未获得成员外部编码!");
+            }
+
+            body.put("idType", "1");
+            body.put("idCard", ownerPo.getIdCard());
+            body.put("personName", ownerPo.getName());
+            body.put("personTel", ownerPo.getLink());
+            body.put("personSex", ownerPo.getSex());
+            body.put("prePersonName", ownerPo.getName());
+            body.put("birthday", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_B));
+            body.put("nation", "未知");
+            body.put("nativePlace", "中国");
+            body.put("politicalOutlook", "无");
+            body.put("maritalStatus", "N");
+            body.put("religiousBelief", "无");
+            body.put("ramark", ownerPo.getRemark());
+            body.put("ownerType", "2002");
+            body.put("ownerAddress", "无");
+            body.put("extOwnerId", extOwnerId);
+            body.put("extMemberId", extMemberId);
+        }
+
+        JSONObject kafkaData = baseHcGovSendAsynImpl.createHeadersOrBody(body, extCommunityId, HcGovConstant.ADD_OWNER_ACTION, HcGovConstant.COMMUNITY_SECURE);
+        baseHcGovSendAsynImpl.sendKafka(HcGovConstant.GOV_TOPIC, kafkaData, communityId, memberId, HcGovConstant.COMMUNITY_SECURE);
+    }
+
+}

+ 85 - 0
service-job/src/main/java/com/java110/job/adapt/hcGov/owner/EditOwnerToHcGovReturnAdapt.java

@@ -0,0 +1,85 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.job.adapt.hcGov.owner;
+
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.hcGovTranslate.HcGovTranslateDto;
+import com.java110.dto.owner.OwnerAttrDto;
+import com.java110.dto.reportData.ReportDataDto;
+import com.java110.intf.common.IHcGovTranslateInnerServiceSMO;
+import com.java110.intf.user.IOwnerAttrInnerServiceSMO;
+import com.java110.job.adapt.hcGov.HcGovConstant;
+import com.java110.job.adapt.hcGov.IReportReturnDataAdapt;
+import com.java110.po.owner.OwnerAttrPo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+/**
+ * 新增房屋同步HC政务接口 返回
+ * <p>
+ * 接口协议地址: https://gitee.com/java110/microCommunityInformation/tree/master/info-doc#1%E6%A5%BC%E6%A0%8B%E4%B8%8A%E4%BC%A0
+ *
+ * @desc add by 吴学文 16:20
+ */
+@Component(value = "EDIT_OWNER_RETURN")
+public class EditOwnerToHcGovReturnAdapt implements IReportReturnDataAdapt {
+
+    @Autowired
+    private IOwnerAttrInnerServiceSMO ownerAttrInnerServiceSMOImpl;
+    @Autowired
+    private IHcGovTranslateInnerServiceSMO hcGovTranslateInnerServiceSMOImpl;
+
+    @Override
+    public void reportReturn(ReportDataDto reportDataDto, String extCommunityId) {
+
+        HcGovTranslateDto hcGovTranslateDto = new HcGovTranslateDto();
+        hcGovTranslateDto.setTranId(reportDataDto.getReportDataHeaderDto().getTranId());
+        hcGovTranslateDto.setServiceCode(reportDataDto.getReportDataHeaderDto().getServiceCode());
+        List<HcGovTranslateDto> hcGovTranslateDtos = hcGovTranslateInnerServiceSMOImpl.queryHcGovTranslates(hcGovTranslateDto);
+        if (hcGovTranslateDtos == null || hcGovTranslateDtos.size() < 1) {
+            throw new IllegalArgumentException("查询推送报文失败。不是同一订单信息");
+        }
+        OwnerAttrDto ownerAttrDto = new OwnerAttrDto();
+        ownerAttrDto.setMemberId(hcGovTranslateDtos.get(0).getObjId());
+        ownerAttrDto.setSpecCd( HcGovConstant.EXT_COMMUNITY_ID );
+        List<OwnerAttrDto>  ownerAttr = ownerAttrInnerServiceSMOImpl.queryOwnerAttrs(ownerAttrDto);
+
+        OwnerAttrPo ownerAttrPo = new OwnerAttrPo();
+        ownerAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_ownerId));
+        ownerAttrPo.setMemberId(ownerAttrDto.getMemberId());
+        ownerAttrPo.setSpecCd(ownerAttrDto.getSpecCd());
+        ownerAttrPo.setValue(reportDataDto.getReportDataBodyDto().getString("extOwnerId"));
+        ownerAttrPo.setCommunityId(hcGovTranslateDtos.get(0).getCommunityId());
+
+        if (ownerAttr == null || ownerAttr.size() < 1) {
+            int flag = ownerAttrInnerServiceSMOImpl.saveOwnerAttr(ownerAttrPo);
+            if (flag < 1) {
+                throw new IllegalArgumentException("保存业主属性失败");
+            }
+        } else {
+            ownerAttrPo.setAttrId(ownerAttr.get(0).getAttrId());
+            int flag = ownerAttrInnerServiceSMOImpl.updateOwnerAttrInfoInstance(ownerAttrPo);
+            if (flag < 1) {
+                throw new IllegalArgumentException("修改业主属性失败");
+            }
+
+        }
+
+
+    }
+}

+ 1 - 0
service-job/src/main/java/com/java110/job/adapt/hcGov/room/EditRoomToHcGovReturnAdapt.java

@@ -65,6 +65,7 @@ public class EditRoomToHcGovReturnAdapt implements IReportReturnDataAdapt {
         roomAttrPo.setRoomId(roomAttrDto.getRoomId());
         roomAttrPo.setSpecCd(roomAttrDto.getSpecCd());
         roomAttrPo.setValue(reportDataDto.getReportDataBodyDto().getString("extRoomId"));
+        roomAttrPo.setStatusCd("0");
         if (roomAttrDtos == null || roomAttrDtos.size() < 1) {
             int flag = roomAttrInnerServiceSMOImpl.saveRoomAttr(roomAttrPo);
             if (flag < 1) {

+ 1 - 1
service-job/src/main/java/com/java110/job/adapt/hcToTianchuang/GetTianChuangToken.java

@@ -50,7 +50,7 @@ public class GetTianChuangToken {
      *
      * @return
      */
-    private HttpHeaders getHeaders(String serviceId,String data) {
+    public static HttpHeaders getHeaders(String serviceId,String data) {
         HttpHeaders httpHeaders = new HttpHeaders();
         httpHeaders.add("appId", TianChuangConstant.getAppId());
         httpHeaders.add("token", get(data));

+ 329 - 35
service-job/src/main/java/com/java110/job/adapt/hcToTianchuang/PersonToTianchuangAdapt.java

@@ -17,34 +17,50 @@ package com.java110.job.adapt.hcToTianchuang;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.java110.dto.UnitDto;
+import com.java110.core.client.RestTemplate;
+import com.java110.core.factory.AuthenticationFactory;
+import com.java110.core.factory.GenerateCodeFactory;
+import com.java110.dto.RoomAttrDto;
+import com.java110.dto.RoomDto;
 import com.java110.dto.businessDatabus.CustomBusinessDatabusDto;
 import com.java110.dto.community.CommunityAttrDto;
 import com.java110.dto.community.CommunityDto;
-import com.java110.dto.communityLocationAttr.CommunityLocationAttrDto;
 import com.java110.dto.file.FileRelDto;
+import com.java110.dto.machine.MachineAttrDto;
 import com.java110.dto.machine.MachineDto;
+import com.java110.dto.owner.OwnerAttrDto;
+import com.java110.dto.owner.OwnerDto;
+import com.java110.dto.owner.OwnerRoomRelDto;
 import com.java110.entity.order.Business;
 import com.java110.intf.common.IFileRelInnerServiceSMO;
+import com.java110.intf.common.IMachineAttrInnerServiceSMO;
 import com.java110.intf.common.IMachineInnerServiceSMO;
 import com.java110.intf.community.ICommunityInnerServiceSMO;
 import com.java110.intf.community.ICommunityLocationAttrInnerServiceSMO;
-import com.java110.intf.community.IUnitInnerServiceSMO;
+import com.java110.intf.community.IRoomInnerServiceSMO;
+import com.java110.intf.user.IOwnerAttrInnerServiceSMO;
+import com.java110.intf.user.IOwnerInnerServiceSMO;
+import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
 import com.java110.job.adapt.DatabusAdaptImpl;
-import com.java110.job.adapt.hcGov.HcGovConstant;
 import com.java110.job.adapt.hcGov.asyn.BaseHcGovSendAsyn;
-import com.java110.po.floor.FloorPo;
+import com.java110.po.community.CommunityAttrPo;
+import com.java110.po.machine.MachineAttrPo;
 import com.java110.po.machine.MachineRecordPo;
+import com.java110.po.owner.OwnerAttrPo;
 import com.java110.utils.cache.MappingCache;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.utils.util.StringUtil;
+import com.java110.utils.util.*;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 
 import java.util.List;
 
 /**
+ * databus 监听业务类型 990000060001
  * 开门记录信息 同步天窗接口
  * <p>
  * 接口协议地址: https://gitee.com/java110/microCommunityInformation/tree/master/info-doc#1%E6%A5%BC%E6%A0%8B%E4%B8%8A%E4%BC%A0
@@ -54,20 +70,41 @@ import java.util.List;
 @Component(value = "personToTianchuangAdapt")
 public class PersonToTianchuangAdapt extends DatabusAdaptImpl {
 
+    private static Logger logger = LoggerFactory.getLogger(PersonToTianchuangAdapt.class);
     @Autowired
     private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
 
+
     @Autowired
     private BaseHcGovSendAsyn baseHcGovSendAsynImpl;
 
     @Autowired
     private IMachineInnerServiceSMO machineInnerServiceSMOImpl;
 
+    @Autowired
+    private IMachineAttrInnerServiceSMO machineAttrInnerServiceSMOImpl;
+
     @Autowired
     private ICommunityLocationAttrInnerServiceSMO communityLocationAttrInnerServiceSMOImpl;
 
     @Autowired
     private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerInnerServiceSMO ownerInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerAttrInnerServiceSMO ownerAttrInnerServiceSMOImpl;
+
+    @Autowired
+    private IOwnerRoomRelInnerServiceSMO ownerRoomRelInnerServiceSMOImpl;
+
+    @Autowired
+    private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
+
+    @Autowired
+    private RestTemplate outRestTemplate;
+
     /**
      * @param customBusinessDatabusDto 当前处理业务
      */
@@ -91,29 +128,78 @@ public class PersonToTianchuangAdapt extends DatabusAdaptImpl {
         String machineRecordId = machineRecordPo.getMachineRecordId();
 
         for (CommunityAttrDto communityAttrDto : tmpCommunityDto.getCommunityAttrDtos()) {
-            if (HcGovConstant.EXT_COMMUNITY_ID.equals(communityAttrDto.getSpecCd())) {
+            if (TianChuangConstant.EXT_TC_COMMUNITY_ID.equals(communityAttrDto.getSpecCd())) {
                 extCommunityId = communityAttrDto.getValue();
             }
         }
+        if (StringUtil.isEmpty(extCommunityId)) {
+            //传送小区信息
+            extCommunityId = sendCommunity(communityDtos.get(0));
+        }
 
-        //查询设备对应的位置
+        //判断设备是否 传天创
         MachineDto machineDto = new MachineDto();
         machineDto.setCommunityId(communityId);
         machineDto.setMachineId(machineRecordPo.getMachineId());
         List<MachineDto> machineDtos = machineInnerServiceSMOImpl.queryMachines(machineDto);
-
         Assert.listOnlyOne(machineDtos, "不包含 设备信息");
+        String extMachineId = "";
+        for (MachineAttrDto machineAttrDto : machineDtos.get(0).getMachineAttrs()) {
+            if (TianChuangConstant.EXT_TC_MACHINE_ID.equals(machineAttrDto.getSpecCd())) {
+                extMachineId = machineAttrDto.getValue();
+            }
+        }
+
+        if (StringUtil.isEmpty(extMachineId)) {
+            //传送门禁信息
+            extMachineId = sendMachine(machineDtos.get(0), extCommunityId, tmpCommunityDto);
+        }
+
+        //判断住户是否传天创
+        String idCard = machineRecordPo.getIdCard();
 
-        String locationId = machineDtos.get(0).getLocationTypeCd();
+        //身份证为空时 ,门禁记录没法传 所以就不传了
+        if (StringUtil.isEmpty(idCard)) {
+            return;
+        }
+        OwnerDto ownerDto = new OwnerDto();
+        ownerDto.setIdCard(idCard);
+        List<OwnerDto> ownerDtos = ownerInnerServiceSMOImpl.queryOwnerMembers(ownerDto);
+
+        if (ownerDtos == null || ownerDtos.size() < 1) {
+            throw new IllegalArgumentException("业主不存在");
+        }
 
-        CommunityLocationAttrDto communityLocationAttrDto = new CommunityLocationAttrDto();
-        communityLocationAttrDto.setCommunityId(machineDtos.get(0).getCommunityId());
-        communityLocationAttrDto.setLocationId(locationId);
-        communityLocationAttrDto.setSpecCd(HcGovConstant.EXT_COMMUNITY_ID);
-        List<CommunityLocationAttrDto> communityLocationAttrDtos
-                = communityLocationAttrInnerServiceSMOImpl.queryCommunityLocationAttrs(communityLocationAttrDto);
+        String extMemberId = "";
+        for (OwnerAttrDto ownerAttrDto : ownerDtos.get(0).getOwnerAttrDtos()) {
+            if (TianChuangConstant.EXT_TC_OWNER_ID.equals(ownerAttrDto.getSpecCd())) {
+                extMemberId = ownerAttrDto.getValue();
+            }
+        }
 
-        Assert.listOnlyOne(communityLocationAttrDtos, "未找到 位置外部ID");
+        if (StringUtil.isEmpty(extMemberId)) {
+            //传送门禁信息
+            extMemberId = sendOwner(ownerDtos.get(0), extCommunityId, tmpCommunityDto);
+        }
+
+        // 送人员进出记录
+        sendPersonInout(machineRecordPo, extCommunityId, machineDtos.get(0), ownerDtos.get(0));
+    }
+
+    private void sendPersonInout(MachineRecordPo machineRecordPo, String extCommunityId, MachineDto machineDto, OwnerDto ownerDto) {
+        JSONObject data = new JSONObject();
+        JSONArray datas = new JSONArray();
+        JSONObject dataObj = new JSONObject();
+        dataObj.put("lv_ssxqbm", extCommunityId);
+        dataObj.put("lv_gmsfhm", machineRecordPo.getIdCard());
+        dataObj.put("lv_crlb", "3306".equals(machineDto.getDirection()) ? "1" : "2");
+        dataObj.put("lv_zpsj", DateUtil.getNow(DateUtil.DATE_FORMATE_STRING_DEFAULT));
+        dataObj.put("lv_sbxt", "小区管理系统");
+        dataObj.put("lv_mjxtwybm", machineDto.getMachineId());
+        dataObj.put("lv_ry_id", ownerDto.getMemberId());
+        dataObj.put("lv_ffms", "1");
+        dataObj.put("lv_kmfs", "1");
+        dataObj.put("lv_procmode", "PMINSERT");
 
         FileRelDto fileRelDto = new FileRelDto();
         fileRelDto.setRelTypeCd("60000");
@@ -126,25 +212,233 @@ public class PersonToTianchuangAdapt extends DatabusAdaptImpl {
             url = imgUrl + fileRelDtos.get(0).getFileRealName();
         }
 
-        JSONObject body = new JSONObject();
-        body.put("extLocationId", communityLocationAttrDtos.get(0).getValue());
-        body.put("name", machineRecordPo.getName());
-        body.put("openTypeCd", machineRecordPo.getOpenTypeCd());
-        body.put("tel", machineRecordPo.getTel());
-        body.put("idCard", machineRecordPo.getIdCard());
-        body.put("recordTypeCd", machineRecordPo.getRecordTypeCd());
-        body.put("faceUrl", url);
-        String state = "F";
-        if (StringUtil.isNumber(machineRecordPo.getSimilar())) {
-            double similar = Double.parseDouble(machineRecordPo.getSimilar());
-            if (similar > 0.5) {
-                state = "C";
+        dataObj.put("lv_zpzpa", ImageUtils.getBase64ByImgUrl(url));
+
+        datas.add(dataObj);
+
+        data.put("datas", datas);
+
+        JSONArray pages = new JSONArray();
+        JSONObject page = new JSONObject();
+        page.put("psize", "100");
+        page.put("tcount", "1");
+        page.put("pno", "1");
+        page.put("tsize", "");
+        pages.add(page);
+
+        data.put("pages", pages);
+
+        String dataStr = AuthenticationFactory.AesDecrypt(data.toJSONString(), TianChuangConstant.getAppSecret());
+
+        HttpEntity httpEntity = new HttpEntity(dataStr, GetTianChuangToken.getHeaders(TianChuangConstant.SERVICE_ID_PERSON_INOUT, dataStr));
+        ResponseEntity<String> responseEntity = outRestTemplate.exchange(TianChuangConstant.getUrl(), HttpMethod.POST, httpEntity, String.class);
+        logger.debug("调用HC IOT信息:" + responseEntity);
+        JSONObject paramOut = JSONObject.parseObject(AuthenticationFactory.AesEncrypt(responseEntity.getBody(), TianChuangConstant.getAppSecret()));
+
+        String code = paramOut.getJSONObject("sta").getString("cod");
+        if (!"0000".equals(code)) {
+            throw new IllegalArgumentException("同步小区失败," + paramOut.toJSONString());
+        }
+    }
+
+    /**
+     * 住户信息上报
+     *
+     * @param ownerDto
+     * @param tmpCommunityDto
+     * @return
+     */
+    private String sendOwner(OwnerDto ownerDto, String extCommunityId, CommunityDto tmpCommunityDto) {
+        //查询业主房屋
+        OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
+        ownerRoomRelDto.setOwnerId(ownerDto.getOwnerId());
+        List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
+        //
+        if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
+            throw new IllegalArgumentException("业主不存在房屋无法同步,因为没有地址二维码编码");
+        }
+        RoomDto roomDto = new RoomDto();
+        roomDto.setCommunityId(ownerDto.getCommunityId());
+        roomDto.setRoomId(ownerRoomRelDtos.get(0).getRoomId());
+        List<RoomDto> roomDtos = roomInnerServiceSMOImpl.queryRooms(roomDto);
+
+        Assert.listOnlyOne(roomDtos, "房屋不存在");
+
+        JSONObject data = new JSONObject();
+        JSONArray datas = new JSONArray();
+        JSONObject dataObj = new JSONObject();
+        dataObj.put("lvgmsfhm", ownerDto.getIdCard());
+        dataObj.put("lvxm", ownerDto.getName());
+        dataObj.put("lvlxdh", ownerDto.getLink());
+        dataObj.put("lvdjsj", ownerDto.getCreateTime());
+        dataObj.put("lvrybm", ownerDto.getMemberId());
+        String qrCodeAddress = "";
+        for (RoomAttrDto roomAttrDto : roomDtos.get(0).getRoomAttrDto()) {
+            if (TianChuangConstant.EXT_TC_ROOM_QRCODE.equals(roomAttrDto.getSpecCd())) {
+                qrCodeAddress = roomAttrDto.getValue();
+            }
+        }
+        dataObj.put("lvdzbm", qrCodeAddress);
+        dataObj.put("lvzhlx", OwnerDto.OWNER_TYPE_CD_OWNER.equals(ownerDto.getOwnerTypeCd()) ? "10" : "11");
+        dataObj.put("lvssxqbm", extCommunityId);
+        dataObj.put("lv_procmode", "PMINSERT");
+
+        datas.add(dataObj);
+
+        data.put("datas", datas);
+
+        JSONArray pages = new JSONArray();
+        JSONObject page = new JSONObject();
+        page.put("psize", "100");
+        page.put("tcount", "1");
+        page.put("pno", "1");
+        page.put("tsize", "");
+        pages.add(page);
+
+        data.put("pages", pages);
+
+        String dataStr = AuthenticationFactory.AesDecrypt(data.toJSONString(), TianChuangConstant.getAppSecret());
+
+        HttpEntity httpEntity = new HttpEntity(dataStr, GetTianChuangToken.getHeaders(TianChuangConstant.SERVICE_ID_OWNER, dataStr));
+        ResponseEntity<String> responseEntity = outRestTemplate.exchange(TianChuangConstant.getUrl(), HttpMethod.POST, httpEntity, String.class);
+        logger.debug("调用HC IOT信息:" + responseEntity);
+        JSONObject paramOut = JSONObject.parseObject(AuthenticationFactory.AesEncrypt(responseEntity.getBody(), TianChuangConstant.getAppSecret()));
+
+        String code = paramOut.getJSONObject("sta").getString("cod");
+        if (!"0000".equals(code)) {
+            throw new IllegalArgumentException("同步小区失败," + paramOut.toJSONString());
+        }
+        String extTcOwnerId = paramOut.getJSONArray("data").getJSONObject(0).getString("result");
+        OwnerAttrPo ownerAttrPo = new OwnerAttrPo();
+        ownerAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
+        ownerAttrPo.setCommunityId(ownerDto.getCommunityId());
+        ownerAttrPo.setMemberId(ownerDto.getMemberId());
+        ownerAttrPo.setSpecCd(TianChuangConstant.EXT_TC_OWNER_ID);
+        ownerAttrPo.setValue(extTcOwnerId);
+        ownerAttrInnerServiceSMOImpl.saveOwnerAttr(ownerAttrPo);
+
+        return extTcOwnerId;
+    }
+
+    /**
+     * 门禁信息上报
+     *
+     * @param machineDto
+     * @return
+     */
+    private String sendMachine(MachineDto machineDto, String extCommunityId, CommunityDto communityDto) {
+        JSONObject data = new JSONObject();
+        JSONArray datas = new JSONArray();
+        JSONObject dataObj = new JSONObject();
+        dataObj.put("lv_mjmc", machineDto.getMachineName());
+        dataObj.put("lv_wzms", machineDto.getLocationObjName());
+        dataObj.put("lv_sfysxt", "1");
+        dataObj.put("lv_ssxqbm", extCommunityId);
+        dataObj.put("lv_mjxtwybm", machineDto.getMachineId());
+        String qrCodeAddress = "";
+        for (CommunityAttrDto communityAttrDto : communityDto.getCommunityAttrDtos()) {
+            if (TianChuangConstant.EXT_TC_COMMUNITY_QRCODE.equals(communityAttrDto.getSpecCd())) {
+                qrCodeAddress = communityAttrDto.getValue();
+            }
+        }
+        dataObj.put("lv_dzewmbm", qrCodeAddress);
+        dataObj.put("lv_sbxt", "小区管理系统");
+        dataObj.put("lv_procmode", "PMINSERT");
+
+        datas.add(dataObj);
+
+        data.put("datas", datas);
+
+        JSONArray pages = new JSONArray();
+        JSONObject page = new JSONObject();
+        page.put("psize", "100");
+        page.put("tcount", "1");
+        page.put("pno", "1");
+        page.put("tsize", "");
+        pages.add(page);
+
+        data.put("pages", pages);
+
+        String dataStr = AuthenticationFactory.AesDecrypt(data.toJSONString(), TianChuangConstant.getAppSecret());
+
+        HttpEntity httpEntity = new HttpEntity(dataStr, GetTianChuangToken.getHeaders(TianChuangConstant.SERVICE_ID_MACHINE, dataStr));
+        ResponseEntity<String> responseEntity = outRestTemplate.exchange(TianChuangConstant.getUrl(), HttpMethod.POST, httpEntity, String.class);
+        logger.debug("调用HC IOT信息:" + responseEntity);
+        JSONObject paramOut = JSONObject.parseObject(AuthenticationFactory.AesEncrypt(responseEntity.getBody(), TianChuangConstant.getAppSecret()));
+
+        String code = paramOut.getJSONObject("sta").getString("cod");
+        if (!"0000".equals(code)) {
+            throw new IllegalArgumentException("同步小区失败," + paramOut.toJSONString());
+        }
+        String extTcMachineId = paramOut.getJSONArray("data").getJSONObject(0).getString("result");
+        MachineAttrPo machineAttrPo = new MachineAttrPo();
+        machineAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
+        machineAttrPo.setCommunityId(communityDto.getCommunityId());
+        machineAttrPo.setMachineId(machineDto.getMachineId());
+        machineAttrPo.setSpecCd(TianChuangConstant.EXT_TC_MACHINE_ID);
+        machineAttrPo.setValue(extTcMachineId);
+        machineAttrInnerServiceSMOImpl.saveMachineAttrs(machineAttrPo);
+
+        return extTcMachineId;
+    }
+
+    /**
+     * 发送小区代码
+     *
+     * @param communityDto
+     */
+    private String sendCommunity(CommunityDto communityDto) {
+        JSONObject data = new JSONObject();
+        JSONArray datas = new JSONArray();
+        JSONObject dataObj = new JSONObject();
+        dataObj.put("lv_mjbh", TianChuangConstant.getCompany());
+        dataObj.put("lv_sbxqmc", communityDto.getName());
+        dataObj.put("lv_zt", "0");
+        dataObj.put("lv_dxtzhm", StringUtil.isEmpty(communityDto.getTel()) ? "18909711234" : communityDto.getTel());
+        String qrCodeAddress = "";
+        for (CommunityAttrDto communityAttrDto : communityDto.getCommunityAttrDtos()) {
+            if (TianChuangConstant.EXT_TC_COMMUNITY_QRCODE.equals(communityAttrDto.getSpecCd())) {
+                qrCodeAddress = communityAttrDto.getValue();
             }
         }
-        body.put("state", state);
 
-        JSONObject kafkaData = baseHcGovSendAsynImpl.createHeadersOrBody(body, extCommunityId, HcGovConstant.ADD_INOUT_RECORD_ACTION, HcGovConstant.COMMUNITY_SECURE);
-        baseHcGovSendAsynImpl.sendKafka(HcGovConstant.GOV_TOPIC, kafkaData, communityId, machineRecordId, HcGovConstant.COMMUNITY_SECURE);
+        dataObj.put("lv_sbxqdzbm", qrCodeAddress);
+        dataObj.put("lv_procmode", "PMINSERT");
+
+        datas.add(dataObj);
+
+        data.put("datas", datas);
+
+        JSONArray pages = new JSONArray();
+        JSONObject page = new JSONObject();
+        page.put("psize", "100");
+        page.put("tcount", "1");
+        page.put("pno", "1");
+        page.put("tsize", "");
+        pages.add(page);
+
+        data.put("pages", pages);
+
+        String dataStr = AuthenticationFactory.AesDecrypt(data.toJSONString(), TianChuangConstant.getAppSecret());
+
+        HttpEntity httpEntity = new HttpEntity(dataStr, GetTianChuangToken.getHeaders(TianChuangConstant.SERVICE_ID_COMMUNITY, dataStr));
+        ResponseEntity<String> responseEntity = outRestTemplate.exchange(TianChuangConstant.getUrl(), HttpMethod.POST, httpEntity, String.class);
+        logger.debug("调用HC IOT信息:" + responseEntity);
+        JSONObject paramOut = JSONObject.parseObject(AuthenticationFactory.AesEncrypt(responseEntity.getBody(), TianChuangConstant.getAppSecret()));
+
+        String code = paramOut.getJSONObject("sta").getString("cod");
+        if (!"0000".equals(code)) {
+            throw new IllegalArgumentException("同步小区失败," + paramOut.toJSONString());
+        }
+        String extTcCommunityId = paramOut.getJSONArray("data").getJSONObject(0).getString("result");
+        CommunityAttrPo communityAttrPo = new CommunityAttrPo();
+        communityAttrPo.setAttrId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_attrId));
+        communityAttrPo.setCommunityId(communityDto.getCommunityId());
+        communityAttrPo.setSpecCd(TianChuangConstant.EXT_TC_COMMUNITY_ID);
+        communityAttrPo.setValue(extTcCommunityId);
+        communityInnerServiceSMOImpl.saveCommunityAttr(communityAttrPo);
+
+        return extTcCommunityId;
     }
 
 }

+ 28 - 75
service-job/src/main/java/com/java110/job/adapt/hcToTianchuang/TianChuangConstant.java

@@ -32,92 +32,35 @@ public class TianChuangConstant {
     public static final String TC_APP_SECRET = "TC_APP_SECRET"; // 物联网域
 
     private static final String DEFAULT_TC_URL = "http://112.51.96.125:9080/ywxzservice/dbClient.do";
-    //122350112432
+    //
     private static final String DEFAULT_APP_ID = "26810B9FE0532D03";
     private static final String DEFAULT_APP_SECRET = "CAD3218426800B9FE0532D03A8C0310E";
+    private static final String DEFAULT_COMPANY = "122350112432"; //单位编号
 
-    public static final String GET_TOKEN_URL = "/extApi/auth/getAccessToken?appId=APP_ID&appSecret=APP_SECRET";
+    private static final String TC_COMPANY = "COMPANY";//公司
 
-    //添加小区
-    public static final String ADD_COMMUNITY_URL = "/extApi/community/addCommunity";
-    //修改小区
-    public static final String UPDATE_COMMUNITY_URL = "/extApi/community/updateCommunity";
-    //删除小区
-    public static final String DELETE_COMMUNITY_URL = "/extApi/community/deleteCommunity";
+    //政务小区编码/楼栋外部便阿门/房屋外部编码/业主外部编码 SPEC_CD
+    public static final String EXT_TC_COMMUNITY_ID = "1329000004";
+    //政务小区编码/楼栋外部便阿门/房屋外部编码/业主外部编码 SPEC_CD
+    public static final String EXT_TC_MACHINE_ID = "1329000004";
+    public static final String EXT_TC_OWNER_ID = "1329000004";
 
-    //添加设备
-    public static final String ADD_MACHINE_URL = "/extApi/machine/addMachine";
-    //修改设备
-    public static final String UPDATE_MACHINE_URL = "/extApi/machine/updateMachine";
-    //删除设备
-    public static final String DELETE_MACHINE_URL = "/extApi/machine/deleteMachine";
+    //政务小区编码/楼栋外部便阿门/房屋外部编码/业主外部编码 SPEC_CD
+    public static final String EXT_TC_COMMUNITY_QRCODE = "3329000004";
 
-    //添加停车场
-    public static final String ADD_PARKING_AREA_URL = "/extApi/parkingArea/addParkingArea";
-    //修改停车场
-    public static final String UPDATE_PARKING_AREA_URL = "/extApi/parkingArea/updateParkingArea";
-    //删除停车场
-    public static final String DELETE_PARKING_AREA_URL = "/extApi/parkingArea/deleteParkingArea";
+    public static final String EXT_TC_ROOM_QRCODE = "3329000004";
 
-    //添加车辆
-    public static final String ADD_OWNER_CAR_URL = "/extApi/car/addCar";
-    //修改车辆
-    public static final String UPDATE_OWNER_CAR_URL = "/extApi/car/updateCar";
-    //删除车辆
-    public static final String DELETE_OWNER_CAR_URL = "/extApi/car/deleteCar";
+    public static final String SERVICE_ID_COMMUNITY = "ZHSQ_XQSBXX";
 
-    //添加车辆
-    public static final String ADD_CAR_BLACK_WHITE_URL = "/extApi/car/addBlackWhite";
+    public static final String SERVICE_ID_MACHINE = "ZHSQ_MJSBXX";
 
-    //删除车辆
-    public static final String DELETE_CAR_BLACK_WHITE_URL = "/extApi/car/deleteBlackWhite";
-
-    //开门接口
-    public static final String OPEN_DOOR = "/extApi/machine/openDoor";
-
-    //获取二维码
-    public static final String GET_QRCODE = "/extApi/machine/getQRcode";
-    //重启接口
-    public static final String RESTART_MACHINE = "/extApi/machine/restartMachine";
-
-    //查询临时停车费订单
-    public static final String GET_TEMP_CAR_FEE_ORDER = "/extApi/fee/getTempCarFeeOrder";
-
-    //查询临时停车费订单
-    public static final String NOTIFY_TEMP_CAR_FEE_ORDER = "/extApi/fee/notifyTempCarFeeOrder";
-
-    //添加车辆
-    public static final String ADD_TEAM_CAR_FEE_CONFIG = "/extApi/fee/addTempCarFee";
-    //修改车辆
-    public static final String UPDATE_TEAM_CAR_FEE_CONFIG = "/extApi/fee/updateTempCarFee";
-    //删除车辆
-    public static final String DELETE_TEAM_CAR_FEE_CONFIG = "/extApi/fee/deleteTempCarFee";
-
-    //添加考勤班次
-    public static final String ADD_ATTENDANCE_CLASSES_STAFFS = "/extApi/attendance/addAttendanceClassStaffs";
-
-
-    //删除考勤班次
-    public static final String DELETE_ATTENDANCE_CLASSES_STAFFS = "/extApi/attendance/deleteAttendanceClassStaff";
-
-    //添加考勤班次
-    public static final String ADD_ATTENDANCE_CLASSES = "/extApi/attendance/addAttendanceClass";
-    //修改考勤班次
-    public static final String UPDATE_ATTENDANCE_CLASSES = "/extApi/attendance/updateAttendanceClass";
-    //删除考勤班次
-    public static final String DELETE_ATTENDANCE_CLASSES = "/extApi/attendance/deleteAttendanceClass";
-
-    public static final String HC_TOKEN = "HC_ACCESS_TOKEN";
-
-    //单位为秒
-    public static final int DEFAULT_LOG_TIME = 5 * 60;
-
-    //添加业主
-    public static final String ADD_OWNER = "/extApi/user/addUser";
-    public static final String EDIT_OWNER = "/extApi/user/updateUser";
-    public static final String DELETE_OWNER = "/extApi/user/deleteUser";
+    public static final String SERVICE_ID_OWNER = "ZHSQ_ZHXX";
 
+    public static final String SERVICE_ID_PERSON_INOUT = "ZHSQ_RYJCJL";
 
+    public static String getUrl() {
+        return getUrl("");
+    }
     public static String getUrl(String param) {
         String url = MappingCache.getValue(TC_DOMAIN, TianChuangConstant.TC_URL);
 
@@ -147,4 +90,14 @@ public class TianChuangConstant {
 
         return appSecret;
     }
+
+    public static String getCompany() {
+        String appSecret = MappingCache.getValue(TC_DOMAIN, TianChuangConstant.TC_COMPANY);
+
+        if (StringUtil.isEmpty(appSecret)) {
+            return DEFAULT_COMPANY;
+        }
+
+        return appSecret;
+    }
 }

+ 20 - 1
service-oa/src/main/java/com/java110/oa/bmo/oaWorkflowForm/impl/GetOaWorkflowFormBMOImpl.java

@@ -300,7 +300,8 @@ public class GetOaWorkflowFormBMOImpl implements IGetOaWorkflowFormBMO {
         reqJson.put("startUserId", formDatas.get(0).get("create_user_id"));
 
         //业务办理
-        if ("1100".equals(reqJson.getString("auditCode"))) { //办理操作
+        if ("1100".equals(reqJson.getString("auditCode"))
+                || "1500".equals(reqJson.getString("auditCode"))) { //办理操作
             reqJson.put("nextUserId", reqJson.getString("staffId"));
             boolean isLastTask = oaWorkflowUserInnerServiceSMOImpl.completeTask(reqJson);
             if (isLastTask) {
@@ -334,6 +335,24 @@ public class GetOaWorkflowFormBMOImpl implements IGetOaWorkflowFormBMO {
 
     @Override
     public ResponseEntity<String> getNextTask(JSONObject reqJson) {
+//流程表单是否存在
+        OaWorkflowFormDto oaWorkflowFormDto = new OaWorkflowFormDto();
+        oaWorkflowFormDto.setFlowId(reqJson.get("flowId").toString());
+        oaWorkflowFormDto.setStoreId(reqJson.get("storeId").toString());
+        oaWorkflowFormDto.setRow(1);
+        oaWorkflowFormDto.setPage(1);
+        List<OaWorkflowFormDto> oaWorkflowFormDtos = oaWorkflowFormInnerServiceSMOImpl.queryOaWorkflowForms(oaWorkflowFormDto);
+        Assert.listOnlyOne(oaWorkflowFormDtos, "未包含流程表单,请先设置表单");
+
+        Map paramMap = new HashMap();
+        paramMap.put("storeId", reqJson.getString("storeId"));
+        paramMap.put("id", reqJson.getString("id"));
+        paramMap.put("tableName", oaWorkflowFormDto.getTableName());
+        paramMap.put("page", 1);
+        paramMap.put("row", 1);
+        List<Map> formDatas = oaWorkflowFormInnerServiceSMOImpl.queryOaWorkflowFormDatas(paramMap);
+        Assert.listOnlyOne(formDatas, "表单数据不存在");
+        reqJson.put("startUserId", formDatas.get(0).get("create_user_id"));
         List<JSONObject> tasks = oaWorkflowUserInnerServiceSMOImpl.nextAllNodeTaskList(reqJson);
         return ResultVo.createResponseEntity(tasks);
     }

+ 10 - 4
service-report/src/main/java/com/java110/report/bmo/reportOweFee/impl/GetReportOweFeeBMOImpl.java

@@ -14,9 +14,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 @Service("getReportOweFeeBMOImpl")
 public class GetReportOweFeeBMOImpl implements IGetReportOweFeeBMO {
@@ -41,7 +39,15 @@ public class GetReportOweFeeBMOImpl implements IGetReportOweFeeBMO {
         } else {
             reportOweFeeDtos = new ArrayList<>();
         }
-
+        //按照 amountOwed 降序排列
+        // reportOweFeeDtos.sort(Comparator.comparing(ReportOweFeeDto :: getAmountOwed).reversed());
+        Collections.sort(reportOweFeeDtos, new Comparator<ReportOweFeeDto>() {
+            @Override
+            public int compare(ReportOweFeeDto o1, ReportOweFeeDto o2) {
+                //降序
+                return o2.getAmountOwed().compareTo(o1.getAmountOwed());
+            }
+        });
         ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reportOweFeeDto.getRow()), count, reportOweFeeDtos);
 
         ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);

+ 2 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeMonthStatisticsServiceDao.java

@@ -325,4 +325,6 @@ public interface IReportFeeMonthStatisticsServiceDao {
     int queryHuaningOweFeeDetailCount(Map paramInfo);
 
     List<Map> queryHuaningOweFeeDetail(Map beanCovertMap);
+
+    void deleteReportFeeMonthStatisticsInfo(Map beanCovertMap);
 }

+ 7 - 0
service-report/src/main/java/com/java110/report/dao/IReportFeeYearCollectionServiceDao.java

@@ -50,6 +50,13 @@ public interface IReportFeeYearCollectionServiceDao {
      */
     void updateReportFeeYearCollectionInfo(Map info) throws DAOException;
 
+    /**
+     * 修改费用年收费信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    void deleteReportFeeYearCollectionInfo(Map info) throws DAOException;
+
 
     /**
      * 查询费用年收费总数

+ 13 - 0
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeMonthStatisticsServiceDaoImpl.java

@@ -75,6 +75,18 @@ public class ReportFeeMonthStatisticsServiceDaoImpl extends BaseServiceDao imple
         }
     }
 
+
+    @Override
+    public void deleteReportFeeMonthStatisticsInfo(Map info) {
+        logger.debug("deleteReportFeeMonthStatisticsInfo 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("reportFeeMonthStatisticsServiceDaoImpl.deleteReportFeeMonthStatisticsInfo", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改费用月统计信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
     /**
      * 修改费用月统计信息
      *
@@ -333,6 +345,7 @@ public class ReportFeeMonthStatisticsServiceDaoImpl extends BaseServiceDao imple
         return businessReportFeeMonthStatisticsInfos;
     }
 
+
     @Override
     public Map queryPayFeeDetailCount(Map info) {
         logger.debug("查询费用月统计数据 入参 info : {}", info);

+ 40 - 22
service-report/src/main/java/com/java110/report/dao/impl/ReportFeeYearCollectionServiceDaoImpl.java

@@ -1,15 +1,13 @@
 package com.java110.report.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.report.dao.IReportFeeYearCollectionServiceDao;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
 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;
@@ -25,51 +23,52 @@ public class ReportFeeYearCollectionServiceDaoImpl extends BaseServiceDao implem
     private static Logger logger = LoggerFactory.getLogger(ReportFeeYearCollectionServiceDaoImpl.class);
 
 
-
-
-
     /**
      * 保存费用年收费信息 到 instance
-     * @param info   bId 信息
+     *
+     * @param info bId 信息
      * @throws DAOException DAO异常
      */
     @Override
     public void saveReportFeeYearCollectionInfo(Map info) throws DAOException {
-        logger.debug("保存费用年收费信息Instance 入参 info : {}",info);
+        logger.debug("保存费用年收费信息Instance 入参 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.insert("reportFeeYearCollectionServiceDaoImpl.saveReportFeeYearCollectionInfo",info);
+        int saveFlag = sqlSessionTemplate.insert("reportFeeYearCollectionServiceDaoImpl.saveReportFeeYearCollectionInfo", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存费用年收费信息Instance数据失败:"+ JSONObject.toJSONString(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> getReportFeeYearCollectionInfo(Map info) throws DAOException {
-        logger.debug("查询费用年收费信息 入参 info : {}",info);
+        logger.debug("查询费用年收费信息 入参 info : {}", info);
 
-        List<Map> businessReportFeeYearCollectionInfos = sqlSessionTemplate.selectList("reportFeeYearCollectionServiceDaoImpl.getReportFeeYearCollectionInfo",info);
+        List<Map> businessReportFeeYearCollectionInfos = sqlSessionTemplate.selectList("reportFeeYearCollectionServiceDaoImpl.getReportFeeYearCollectionInfo", info);
 
         return businessReportFeeYearCollectionInfos;
     }
+
     /**
      * 查询费用年收费信息(instance)
+     *
      * @param info bId 信息
      * @return List<Map>
      * @throws DAOException DAO异常
      */
     @Override
     public List<Map> getReportFeeYearCollectionInfos(Map info) throws DAOException {
-        logger.debug("查询费用年收费信息 入参 info : {}",info);
+        logger.debug("查询费用年收费信息 入参 info : {}", info);
 
-        List<Map> businessReportFeeYearCollectionInfos = sqlSessionTemplate.selectList("reportFeeYearCollectionServiceDaoImpl.getReportFeeYearCollectionInfos",info);
+        List<Map> businessReportFeeYearCollectionInfos = sqlSessionTemplate.selectList("reportFeeYearCollectionServiceDaoImpl.getReportFeeYearCollectionInfos", info);
 
         return businessReportFeeYearCollectionInfos;
     }
@@ -77,28 +76,47 @@ public class ReportFeeYearCollectionServiceDaoImpl extends BaseServiceDao implem
 
     /**
      * 修改费用年收费信息
+     *
      * @param info 修改信息
      * @throws DAOException DAO异常
      */
     @Override
     public void updateReportFeeYearCollectionInfo(Map info) throws DAOException {
-        logger.debug("修改费用年收费信息Instance 入参 info : {}",info);
+        logger.debug("修改费用年收费信息Instance 入参 info : {}", info);
 
-        int saveFlag = sqlSessionTemplate.update("reportFeeYearCollectionServiceDaoImpl.updateReportFeeYearCollectionInfo",info);
+        int saveFlag = sqlSessionTemplate.update("reportFeeYearCollectionServiceDaoImpl.updateReportFeeYearCollectionInfo", info);
 
-        if(saveFlag < 1){
-            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改费用年收费信息Instance数据失败:"+ JSONObject.toJSONString(info));
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改费用年收费信息Instance数据失败:" + JSONObject.toJSONString(info));
         }
     }
 
-     /**
+    /**
+     * 修改费用年收费信息
+     *
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void deleteReportFeeYearCollectionInfo(Map info) throws DAOException {
+        logger.debug("deleteReportFeeYearCollectionInfo 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("reportFeeYearCollectionServiceDaoImpl.deleteReportFeeYearCollectionInfo", info);
+
+        if (saveFlag < 1) {
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改费用年收费信息Instance数据失败:" + JSONObject.toJSONString(info));
+        }
+    }
+
+    /**
      * 查询费用年收费数量
+     *
      * @param info 费用年收费信息
      * @return 费用年收费数量
      */
     @Override
     public int queryReportFeeYearCollectionsCount(Map info) {
-        logger.debug("查询费用年收费数据 入参 info : {}",info);
+        logger.debug("查询费用年收费数据 入参 info : {}", info);
 
         List<Map> businessReportFeeYearCollectionInfos = sqlSessionTemplate.selectList("reportFeeYearCollectionServiceDaoImpl.queryReportFeeYearCollectionsCount", info);
         if (businessReportFeeYearCollectionInfos.size() < 1) {

+ 1 - 1
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeMonthStatisticsInnerServiceSMOImpl.java

@@ -56,7 +56,7 @@ public class ReportFeeMonthStatisticsInnerServiceSMOImpl extends BaseServiceSMO
     public int deleteReportFeeMonthStatistics(@RequestBody ReportFeeMonthStatisticsPo reportFeeMonthStatisticsPo) {
         int saveFlag = 1;
         reportFeeMonthStatisticsPo.setStatusCd("1");
-        reportFeeMonthStatisticsServiceDaoImpl.updateReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
+        reportFeeMonthStatisticsServiceDaoImpl.deleteReportFeeMonthStatisticsInfo(BeanConvertUtil.beanCovertMap(reportFeeMonthStatisticsPo));
         return saveFlag;
     }
 

+ 1 - 1
service-report/src/main/java/com/java110/report/smo/impl/ReportFeeYearCollectionInnerServiceSMOImpl.java

@@ -54,7 +54,7 @@ public class ReportFeeYearCollectionInnerServiceSMOImpl extends BaseServiceSMO i
     public int deleteReportFeeYearCollection(@RequestBody ReportFeeYearCollectionPo reportFeeYearCollectionPo) {
         int saveFlag = 1;
         reportFeeYearCollectionPo.setStatusCd("1");
-        reportFeeYearCollectionServiceDaoImpl.updateReportFeeYearCollectionInfo(BeanConvertUtil.beanCovertMap(reportFeeYearCollectionPo));
+        reportFeeYearCollectionServiceDaoImpl.deleteReportFeeYearCollectionInfo(BeanConvertUtil.beanCovertMap(reportFeeYearCollectionPo));
         return saveFlag;
     }