java110 5 éve%!(EXTRA string=óta)
szülő
commit
26d723ca21

+ 11 - 0
java110-bean/src/main/java/com/java110/dto/community/CommunityDto.java

@@ -4,6 +4,7 @@ import com.java110.dto.PageDto;
 
 
 import java.io.Serializable;
 import java.io.Serializable;
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
 
 
 /**
 /**
  * @ClassName FloorDto
  * @ClassName FloorDto
@@ -35,6 +36,8 @@ public class CommunityDto extends PageDto implements Serializable {
 
 
     private String communityArea;
     private String communityArea;
 
 
+    private List<CommunityAttrDto> communityAttrDtos;
+
 
 
     private Date createTime;
     private Date createTime;
 
 
@@ -202,4 +205,12 @@ public class CommunityDto extends PageDto implements Serializable {
     public void setCommunityArea(String communityArea) {
     public void setCommunityArea(String communityArea) {
         this.communityArea = communityArea;
         this.communityArea = communityArea;
     }
     }
+
+    public List<CommunityAttrDto> getCommunityAttrDtos() {
+        return communityAttrDtos;
+    }
+
+    public void setCommunityAttrDtos(List<CommunityAttrDto> communityAttrDtos) {
+        this.communityAttrDtos = communityAttrDtos;
+    }
 }
 }

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

@@ -135,6 +135,13 @@
         <if test="communityId != null and communityId !=''">
         <if test="communityId != null and communityId !=''">
             and sa.community_id = #{communityId}
             and sa.community_id = #{communityId}
         </if>
         </if>
+        <if test="communityIds != null ">
+            and sa.community_id in
+            <foreach collection="communityIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
         <if test="attrId != null and attrId != ''">
         <if test="attrId != null and attrId != ''">
             and sa.attr_id = #{attrId}
             and sa.attr_id = #{attrId}
         </if>
         </if>

+ 112 - 0
java110-interface/src/main/resources/logback-prod.xml

@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="60 seconds">
+
+<!--    <include resource="org/springframework/boot/logging/logback/base.xml"/>-->
+
+    <!-- 控制台输出 -->
+    <appender name="STDOUT_FILE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+            <!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
+            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>./logs/debug.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>./logs/debug-%d{yyyyMMdd}.log.%i</fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>500MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <maxHistory>2</maxHistory>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
+            </Pattern>
+        </layout>
+    </appender>
+
+    <appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>./logs/info.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>./logs/info-%d{yyyyMMdd}.log.%i</fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>500MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <maxHistory>2</maxHistory>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
+            </Pattern>
+        </layout>
+    </appender>
+
+    <appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
+            <level>ERROR</level>
+        </filter>
+        <File>./logs/error.log</File>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>${LOG_PATH}/error-%d{yyyyMMdd}.log.%i
+            </fileNamePattern>
+            <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+                <maxFileSize>500MB</maxFileSize>
+            </timeBasedFileNamingAndTriggeringPolicy>
+            <maxHistory>2</maxHistory>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n
+
+            </Pattern>
+        </layout>
+    </appender>
+
+    <logger name="org.springframework" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+    <logger name="com.java110.api" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+    <logger name="com.java110.order" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+
+    <!--myibatis log configure-->
+    <logger name="com.apache.ibatis" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+
+    <logger name="org.mybatis" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+    <logger name="druid.sql.Statement" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+    <logger name="druid.sql.ResultSet" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+
+
+    <logger name="com.java110" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+
+    <logger name="io.shardingsphere" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+
+    <logger name="org.thymeleaf" level="ERROR">
+        <appender-ref ref="STDOUT_FILE"/>
+    </logger>
+
+    <logger name="org.apache.kafka" level="ERROR">
+       <appender-ref ref="STDOUT_FILE"/>
+     </logger>
+
+    <!-- 日志输出级别
+    <root level="DEBUG">
+        <appender-ref ref="STDOUT_FILE" />
+        <appender-ref ref="DEBUG_FILE" />
+    </root>
+    -->
+</configuration>

+ 8 - 8
java110-interface/src/main/resources/logback.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <configuration scan="true" scanPeriod="60 seconds">
 <configuration scan="true" scanPeriod="60 seconds">
 
 
-<!--    <include resource="org/springframework/boot/logging/logback/base.xml"/>-->
+    <include resource="org/springframework/boot/logging/logback/base.xml"/>
 
 
     <!-- 控制台输出 -->
     <!-- 控制台输出 -->
     <appender name="STDOUT_FILE" class="ch.qos.logback.core.ConsoleAppender">
     <appender name="STDOUT_FILE" class="ch.qos.logback.core.ConsoleAppender">
@@ -64,7 +64,7 @@
     <logger name="org.springframework" level="ERROR">
     <logger name="org.springframework" level="ERROR">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
-    <logger name="com.java110.api" level="ERROR">
+    <logger name="com.java110.api" level="DEBUG">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
     <logger name="com.java110.order" level="ERROR">
     <logger name="com.java110.order" level="ERROR">
@@ -72,26 +72,26 @@
     </logger>
     </logger>
 
 
     <!--myibatis log configure-->
     <!--myibatis log configure-->
-    <logger name="com.apache.ibatis" level="ERROR">
+    <logger name="com.apache.ibatis" level="DEBUG">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
 
 
-    <logger name="org.mybatis" level="ERROR">
+    <logger name="org.mybatis" level="DEBUG">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
-    <logger name="druid.sql.Statement" level="ERROR">
+    <logger name="druid.sql.Statement" level="DEBUG">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
-    <logger name="druid.sql.ResultSet" level="ERROR">
+    <logger name="druid.sql.ResultSet" level="DEBUG">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
 
 
 
 
-    <logger name="com.java110" level="ERROR">
+    <logger name="com.java110" level="DEBUG">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
 
 
-    <logger name="io.shardingsphere" level="ERROR">
+    <logger name="io.shardingsphere" level="DEBUG">
         <appender-ref ref="STDOUT_FILE"/>
         <appender-ref ref="STDOUT_FILE"/>
     </logger>
     </logger>
 
 

+ 1 - 2
service-community/src/main/java/com/java110/community/listener/community/SaveCommunityInfoListener.java

@@ -225,7 +225,6 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
      */
      */
     private void doSaveBusinessCommunityAttrs(Business business, JSONArray businessCommunityAttrs) {
     private void doSaveBusinessCommunityAttrs(Business business, JSONArray businessCommunityAttrs) {
         JSONObject data = business.getDatas();
         JSONObject data = business.getDatas();
-        JSONObject businessCommunity = data.getJSONObject("businessCommunity");
         for (int communityAttrIndex = 0; communityAttrIndex < businessCommunityAttrs.size(); communityAttrIndex++) {
         for (int communityAttrIndex = 0; communityAttrIndex < businessCommunityAttrs.size(); communityAttrIndex++) {
             JSONObject communityAttr = businessCommunityAttrs.getJSONObject(communityAttrIndex);
             JSONObject communityAttr = businessCommunityAttrs.getJSONObject(communityAttrIndex);
             Assert.jsonObjectHaveKey(communityAttr, "attrId", "businessCommunityAttr 节点下没有包含 attrId 节点");
             Assert.jsonObjectHaveKey(communityAttr, "attrId", "businessCommunityAttr 节点下没有包含 attrId 节点");
@@ -236,7 +235,7 @@ public class SaveCommunityInfoListener extends AbstractCommunityBusinessServiceD
             }
             }
 
 
             communityAttr.put("bId", business.getbId());
             communityAttr.put("bId", business.getbId());
-            communityAttr.put("communityId", businessCommunity.getString("communityId"));
+            //communityAttr.put("communityId", businessCommunity.getString("communityId"));
             communityAttr.put("operate", StatusConstant.OPERATE_ADD);
             communityAttr.put("operate", StatusConstant.OPERATE_ADD);
 
 
             communityServiceDaoImpl.saveBusinessCommunityAttr(communityAttr);
             communityServiceDaoImpl.saveBusinessCommunityAttr(communityAttr);

+ 31 - 6
service-community/src/main/java/com/java110/community/smo/impl/CommunityInnerServiceSMOImpl.java

@@ -1,20 +1,22 @@
 package com.java110.community.smo.impl;
 package com.java110.community.smo.impl;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
-import com.java110.dto.community.CommunityAttrDto;
-import com.java110.utils.util.BeanConvertUtil;
 import com.java110.community.dao.ICommunityServiceDao;
 import com.java110.community.dao.ICommunityServiceDao;
 import com.java110.core.base.smo.BaseServiceSMO;
 import com.java110.core.base.smo.BaseServiceSMO;
-import com.java110.intf.community.ICommunityInnerServiceSMO;
 import com.java110.dto.CommunityMemberDto;
 import com.java110.dto.CommunityMemberDto;
 import com.java110.dto.PageDto;
 import com.java110.dto.PageDto;
+import com.java110.dto.community.CommunityAttrDto;
 import com.java110.dto.community.CommunityDto;
 import com.java110.dto.community.CommunityDto;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.utils.util.BeanConvertUtil;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
@@ -49,7 +51,7 @@ public class CommunityInnerServiceSMOImpl extends BaseServiceSMO implements ICom
 
 
     @Override
     @Override
     public int getCommunityMemberCount(@RequestBody CommunityMemberDto communityMemberDto) {
     public int getCommunityMemberCount(@RequestBody CommunityMemberDto communityMemberDto) {
-         logger.debug("getCommunityMemberCount:{}", JSONObject.toJSONString(communityMemberDto));
+        logger.debug("getCommunityMemberCount:{}", JSONObject.toJSONString(communityMemberDto));
 
 
         return communityServiceDaoImpl.getCommunityMemberCount(BeanConvertUtil.beanCovertMap(communityMemberDto));
         return communityServiceDaoImpl.getCommunityMemberCount(BeanConvertUtil.beanCovertMap(communityMemberDto));
     }
     }
@@ -79,13 +81,36 @@ public class CommunityInnerServiceSMOImpl extends BaseServiceSMO implements ICom
 
 
         List<CommunityDto> communitys = BeanConvertUtil.covertBeanList(communityServiceDaoImpl.getCommunityInfoNew(BeanConvertUtil.beanCovertMap(communityDto)), CommunityDto.class);
         List<CommunityDto> communitys = BeanConvertUtil.covertBeanList(communityServiceDaoImpl.getCommunityInfoNew(BeanConvertUtil.beanCovertMap(communityDto)), CommunityDto.class);
 
 
+        List<String> communityIds = new ArrayList<>();
 
 
+        if (communitys == null || communitys.size() < 1) {
+            return communitys;
+        }
+        for (CommunityDto tmpCommunityDto : communitys) {
+            communityIds.add(tmpCommunityDto.getCommunityId());
+        }
+        Map info = new HashMap();
+        info.put("communityIds", communityIds.toArray(new String[communityIds.size()]));
+        List<CommunityAttrDto> communityAttrDtos = BeanConvertUtil.covertBeanList(communityServiceDaoImpl.getCommunityAttrs(info), CommunityAttrDto.class);
 
 
-        return communitys;
-    }
+        if (communityAttrDtos == null || communityAttrDtos.size() < 1) {
+            return communitys;
+        }
 
 
 
 
+        for (CommunityDto tmpCommunityDto : communitys) {
+            List<CommunityAttrDto> tmpCommunityAttrDtos = new ArrayList<>();
+            for (CommunityAttrDto communityAttrDto : communityAttrDtos) {
+                if (tmpCommunityDto.getCommunityId().equals(communityAttrDto.getCommunityId())) {
+                    tmpCommunityAttrDtos.add(communityAttrDto);
+                }
+            }
+            tmpCommunityDto.setCommunityAttrDtos(tmpCommunityAttrDtos);
 
 
+        }
+
+        return communitys;
+    }
 
 
 
 
     @Override
     @Override

+ 24 - 7
service-job/src/main/java/com/java110/job/task/ownerToMachine/TranslateOwnerPhotoToMachineTemplate.java

@@ -2,13 +2,6 @@ package com.java110.job.task.ownerToMachine;
 
 
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.java110.core.factory.GenerateCodeFactory;
 import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.common.IMachineInnerServiceSMO;
-import com.java110.intf.common.IMachineTranslateInnerServiceSMO;
-import com.java110.intf.community.ICommunityLocationInnerServiceSMO;
-import com.java110.intf.order.IOrderInnerServiceSMO;
-import com.java110.intf.user.IOwnerInnerServiceSMO;
-import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
-import com.java110.intf.community.IRoomInnerServiceSMO;
 import com.java110.dto.RoomDto;
 import com.java110.dto.RoomDto;
 import com.java110.dto.machine.MachineDto;
 import com.java110.dto.machine.MachineDto;
 import com.java110.dto.machine.MachineTranslateDto;
 import com.java110.dto.machine.MachineTranslateDto;
@@ -16,6 +9,13 @@ import com.java110.dto.order.OrderDto;
 import com.java110.dto.owner.OwnerDto;
 import com.java110.dto.owner.OwnerDto;
 import com.java110.dto.owner.OwnerRoomRelDto;
 import com.java110.dto.owner.OwnerRoomRelDto;
 import com.java110.dto.task.TaskDto;
 import com.java110.dto.task.TaskDto;
+import com.java110.intf.common.IMachineInnerServiceSMO;
+import com.java110.intf.common.IMachineTranslateInnerServiceSMO;
+import com.java110.intf.community.ICommunityLocationInnerServiceSMO;
+import com.java110.intf.community.IRoomInnerServiceSMO;
+import com.java110.intf.order.IOrderInnerServiceSMO;
+import com.java110.intf.user.IOwnerInnerServiceSMO;
+import com.java110.intf.user.IOwnerRoomRelInnerServiceSMO;
 import com.java110.job.quartz.TaskSystemQuartz;
 import com.java110.job.quartz.TaskSystemQuartz;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.BusinessTypeConstant;
 import com.java110.utils.constant.StatusConstant;
 import com.java110.utils.constant.StatusConstant;
@@ -87,6 +87,19 @@ public class TranslateOwnerPhotoToMachineTemplate extends TaskSystemQuartz {
                     List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
                     List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
                     Assert.listOnlyOne(ownerRoomRelDtos, "数据错误 业主房屋关系未找到,或找到多条" + JSONObject.toJSONString(tmpOrderDto));
                     Assert.listOnlyOne(ownerRoomRelDtos, "数据错误 业主房屋关系未找到,或找到多条" + JSONObject.toJSONString(tmpOrderDto));
                     ownerDto.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId());
                     ownerDto.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId());
+                } else if (BusinessTypeConstant.BUSINESS_TYPE_DELETE_OWNER_ROOM_REL.equals(tmpOrderDto.getBusinessTypeCd())) {
+                    OwnerRoomRelDto ownerRoomRelDto = new OwnerRoomRelDto();
+                    ownerRoomRelDto.setbId(tmpOrderDto.getbId());
+                    ownerRoomRelDto.setStatusCd(StatusConstant.STATUS_CD_INVALID);
+                    List<OwnerRoomRelDto> ownerRoomRelDtos = ownerRoomRelInnerServiceSMOImpl.queryOwnerRoomRels(ownerRoomRelDto);
+
+                    if (ownerRoomRelDtos == null || ownerRoomRelDtos.size() < 1) {
+                        //刷新 状态为C1
+                        orderInnerServiceSMOImpl.updateBusinessStatusCd(tmpOrderDto);
+                        logger.debug("没有数据数据直接刷为C1" + JSONObject.toJSONString(tmpOrderDto));
+                        continue;
+                    }
+                    ownerDto.setOwnerId(ownerRoomRelDtos.get(0).getOwnerId());
                 } else {
                 } else {
                     ownerDto.setbId(tmpOrderDto.getbId());
                     ownerDto.setbId(tmpOrderDto.getbId());
                 }
                 }
@@ -109,6 +122,10 @@ public class TranslateOwnerPhotoToMachineTemplate extends TaskSystemQuartz {
                 }
                 }
                 RoomDto roomDto = new RoomDto();
                 RoomDto roomDto = new RoomDto();
                 roomDto.setOwnerId(ownerDtos.get(0).getOwnerId());
                 roomDto.setOwnerId(ownerDtos.get(0).getOwnerId());
+                //这种情况说明 业主已经删掉了 需要查询状态为 1 的数据
+                if (BusinessTypeConstant.BUSINESS_TYPE_DELETE_OWNER_ROOM_REL.equals(tmpOrderDto.getBusinessTypeCd())) {
+                    roomDto.setStatusCd(StatusConstant.STATUS_CD_INVALID);
+                }
                 List<RoomDto> rooms = roomInnerServiceSMOImpl.queryRoomsByOwner(roomDto);
                 List<RoomDto> rooms = roomInnerServiceSMOImpl.queryRoomsByOwner(roomDto);
 
 
                 dealData(tmpOrderDto, ownerDtos, rooms);
                 dealData(tmpOrderDto, ownerDtos, rooms);