springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml
@@ -22,11 +22,7 @@ <select /> </component> <component name="ChangeListManager"> <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment=""> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java" afterDir="false" /> </list> <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment="" /> <option name="SHOW_DIALOG" value="false" /> <option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> @@ -39,8 +35,8 @@ <option name="RECENT_TEMPLATES"> <list> <option value="Interface" /> <option value="Class" /> <option value="Kotlin File" /> <option value="Class" /> </list> </option> </component> @@ -78,7 +74,7 @@ <property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" /> <property name="WebServerToolWindowFactoryState" value="false" /> <property name="aspect.path.notification.shown" value="true" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../springcloud_demo_on_k8s-master/pom.xml" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../../../../easyexcel-master/easyexcel-master/pom.xml" /> <property name="project.structure.last.edited" value="Modules" /> <property name="project.structure.proportion" value="0.15" /> <property name="project.structure.side.proportion" value="0.2850575" /> @@ -413,7 +409,11 @@ <workItem from="1611834131869" duration="1431000" /> <workItem from="1611883117467" duration="13328000" /> <workItem from="1611913457874" duration="966000" /> <workItem from="1612141547518" duration="52901000" /> <workItem from="1612141547518" duration="53860000" /> <workItem from="1612406442748" duration="9358000" /> <workItem from="1612486797044" duration="146000" /> <workItem from="1612487068003" duration="7000" /> <workItem from="1612487277561" duration="2287000" /> </task> <servers /> </component> @@ -441,10 +441,10 @@ <screen x="0" y="0" width="1536" height="824" /> </state> <state x="464" y="213" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1536.824@0.0.1536.824" timestamp="1612177264050" /> <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser" timestamp="1611823461616"> <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser" timestamp="1612431598505"> <screen x="0" y="0" width="1536" height="824" /> </state> <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1611823461616" /> <state x="574" y="118" key="#com.intellij.ide.util.MemberChooser/0.0.1536.824@0.0.1536.824" timestamp="1612431598505" /> <state x="405" y="335" key="#com.intellij.refactoring.move.MoveHandler.SelectRefactoringDialog" timestamp="1606099594079"> <screen x="0" y="0" width="1536" height="824" /> </state> @@ -469,58 +469,58 @@ <screen x="0" y="0" width="1536" height="824" /> </state> <state x="93" y="93" width="1350" height="638" key="DiffContextDialog/0.0.1536.824@0.0.1536.824" timestamp="1612321934878" /> <state x="549" y="167" key="FileChooserDialogImpl" timestamp="1612172752103"> <state x="549" y="167" key="FileChooserDialogImpl" timestamp="1612426172959"> <screen x="0" y="0" width="1536" height="824" /> </state> <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1612172752103" /> <state width="1493" height="196" key="GridCell.Tab.0.bottom" timestamp="1612321035564"> <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1612426172959" /> <state width="1031" height="507" key="GridCell.Tab.0.bottom" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1493" height="196" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612321035564" /> <state width="1493" height="196" key="GridCell.Tab.0.center" timestamp="1612321035564"> <state width="1031" height="507" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.0.center" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1493" height="196" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1612321035564" /> <state width="1493" height="196" key="GridCell.Tab.0.left" timestamp="1612321035564"> <state width="1031" height="507" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.0.left" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1493" height="196" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1612321035564" /> <state width="1493" height="196" key="GridCell.Tab.0.right" timestamp="1612321035564"> <state width="1031" height="507" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.0.right" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1493" height="196" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1612321035564" /> <state width="1031" height="507" key="GridCell.Tab.1.bottom" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.1.bottom" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.1.center" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.1.center" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.1.left" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.1.left" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.1.right" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.1.right" timestamp="1612424826236"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.2.bottom" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1612424826236" /> <state width="1031" height="507" key="GridCell.Tab.2.bottom" timestamp="1612424826237"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.2.center" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1612424826237" /> <state width="1031" height="507" key="GridCell.Tab.2.center" timestamp="1612424826237"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.2.left" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1612424826237" /> <state width="1031" height="507" key="GridCell.Tab.2.left" timestamp="1612424826237"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.2.right" timestamp="1612319928260"> <state width="1031" height="507" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1612424826237" /> <state width="1031" height="507" key="GridCell.Tab.2.right" timestamp="1612424826237"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="1031" height="507" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1612319928260" /> <state width="1031" height="507" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1612424826237" /> <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1610611848124"> <screen x="0" y="0" width="1536" height="824" /> </state> @@ -533,10 +533,10 @@ <screen x="0" y="0" width="1536" height="824" /> </state> <state x="270" y="57" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1606120706449" /> <state width="498" height="540" key="SwitcherDM" timestamp="1611823082750"> <state width="498" height="540" key="SwitcherDM" timestamp="1612431298209"> <screen x="0" y="0" width="1536" height="824" /> </state> <state width="498" height="540" key="SwitcherDM/0.0.1536.824@0.0.1536.824" timestamp="1611823082750" /> <state width="498" height="540" key="SwitcherDM/0.0.1536.824@0.0.1536.824" timestamp="1612431298209" /> <state x="93" y="93" width="1350" height="638" key="com.intellij.history.integration.ui.views.DirectoryHistoryDialog" timestamp="1612321934878"> <screen x="0" y="0" width="1536" height="824" /> </state> @@ -549,10 +549,10 @@ <screen x="0" y="0" width="1536" height="824" /> </state> <state x="93" y="93" width="1350" height="638" key="com.intellij.history.integration.ui.views.SelectionHistoryDialog/0.0.1536.824@0.0.1536.824" timestamp="1611623127978" /> <state x="233" y="42" width="921" height="782" key="find.popup" timestamp="1612318003112"> <state x="233" y="42" width="921" height="782" key="find.popup" timestamp="1612421414933"> <screen x="0" y="0" width="1536" height="824" /> </state> <state x="233" y="42" width="921" height="782" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1612318003112" /> <state x="233" y="42" width="921" height="782" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1612421414933" /> <state width="600" height="428" key="javadoc.popup" timestamp="1610005781618"> <screen x="0" y="0" width="1536" height="824" /> </state> springcloud_k8s_panzhihuazhihuishequ/LOG_HOME_IS_UNDEFINED/zuul.log.2021-02-01.log
@@ -1,8 +1,8 @@ 2021-02-01 14:33:23.768 [background-preinit] INFO org.hibernate.validator.internal.util.Version - HV000001: Hibernate Validator 6.1.5.Final 2021-02-01 14:33:25.831 [main] INFO o.s.c.c.client.ConfigServicePropertySourceLocator - Fetching config from server at : http://localhost:8888 2021-02-01 14:33:28.129 [main] INFO o.s.c.c.client.ConfigServicePropertySourceLocator - Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available 2021-02-01 14:33:28.130 [main] WARN o.s.c.c.client.ConfigServicePropertySourceLocator - Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/zuul/prod": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect 2021-02-01 14:33:28.132 [main] INFO com.panzhihua.zuul.ZuulApplication - The following profiles are active: prod 2021-02-01 14:33:28.130 [main] WARN o.s.c.c.client.ConfigServicePropertySourceLocator - Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/zuul/${ENV:dev}": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect 2021-02-01 14:33:28.132 [main] INFO com.panzhihua.zuul.ZuulApplication - The following profiles are active: ${ENV:dev} 2021-02-01 14:33:32.039 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode! 2021-02-01 14:33:32.044 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode. 2021-02-01 14:33:32.128 [main] INFO o.s.d.r.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 26ms. Found 0 Redis repository interfaces. @@ -329,7 +329,7 @@ 2021-02-01 14:33:48.695 [RMI TCP Connection(5)-192.168.2.24] INFO org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet' 2021-02-01 14:33:48.711 [RMI TCP Connection(5)-192.168.2.24] INFO org.springframework.web.servlet.DispatcherServlet - Completed initialization in 15 ms 2021-02-01 14:33:50.426 [RMI TCP Connection(3)-192.168.2.24] INFO o.s.c.c.client.ConfigServicePropertySourceLocator - Connect Timeout Exception on Url - http://localhost:8888. Will be trying the next url if available 2021-02-01 14:33:50.427 [RMI TCP Connection(3)-192.168.2.24] WARN o.s.c.c.client.ConfigServicePropertySourceLocator - Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/zuul/prod": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect 2021-02-01 14:33:50.427 [RMI TCP Connection(3)-192.168.2.24] WARN o.s.c.c.client.ConfigServicePropertySourceLocator - Could not locate PropertySource: I/O error on GET request for "http://localhost:8888/zuul/${ENV:dev}": Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect 2021-02-01 14:33:52.033 [DiscoveryClient-InstanceInfoReplicator-0] INFO c.n.d.s.t.decorator.RedirectingEurekaHttpClient - Request execution error. endpoint=DefaultEndpoint{ serviceUrl='http://10.1.53.11:8192/eureka/}, exception=org.apache.http.conn.ConnectTimeoutException: Connect to 10.1.53.11:8192 timed out stacktrace=com.sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.ConnectTimeoutException: Connect to 10.1.53.11:8192 timed out at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123) springcloud_k8s_panzhihuazhihuishequ/applets/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} servlet: multipart: max-file-size: 10MB springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} servlet: multipart: max-file-size: 10MB springcloud_k8s_panzhihuazhihuishequ/auth/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} eureka: client: springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/user/EexcelUserDTO.java
New file @@ -0,0 +1,99 @@ package com.panzhihua.common.model.dtos.user; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 居民信息excel导入 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2021-02-04 16:06 **/ public class EexcelUserDTO { /** * 序号 */ private Integer order; /** * 门牌号 */ private String doorNumber; /** * 是否租住 */ private String isRent; /** * 姓名 */ private String name; /** * 民族 */ private String nation; /** * 政治面貌 */ private String politicalOutlook; /** * 婚姻状态 */ private String maritalStatus; /** * 联系方式 */ private String phone; /** * 文化程度 */ private String education; /** * 身份证 */ private String idCard; /** * 工作单位(学校) */ private String company; /** * 户口所在地 */ private String residence; /** * 目前是否在攀枝花 */ private String isPanZhiHua; /** * 近一个月离(返)攀情况 */ private String situation; /** * 是否有与疑似或确诊病例密切接触史 */ private String isContact; /** * 特殊情况(重大过往病史或者孕妇) */ private String major; /** * 退役军人 */ private String soldier; /** * 低保户 */ private String lowIncomeHouseholds; /** * 低收入人员 */ private String lowIncomePeople; /** * 高龄老人 */ private String oldPeople; /** *特服家庭 */ private String specialServiceFamily; /** *重点人员 */ private String keyPersonnel; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -2,6 +2,7 @@ import com.panzhihua.common.model.dtos.PageDTO; import com.panzhihua.common.model.dtos.community.NoticeReadDTO; import com.panzhihua.common.model.dtos.user.EexcelUserDTO; import com.panzhihua.common.model.dtos.user.PageFeedBackDTO; import com.panzhihua.common.model.dtos.user.PageUserAppletsBackstageDTO; import com.panzhihua.common.model.dtos.user.SysUserFeedbackDTO; @@ -500,4 +501,12 @@ */ @PostMapping("deletefeedback") R deleteFeedback(@RequestParam("id")Long id); /** * 批量导入居民用户 * @param list 居民用户集合 * @return */ @PostMapping("batchsaveuser") R batchSaveUser(@RequestBody List<EexcelUserDTO> list); } springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/dtos/user/EexcelUserDTO.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/service/user/UserService.classBinary files differ
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityManagerApi.java
@@ -1,7 +1,9 @@ package com.panzhihua.community_backstage.api; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.user.EexcelUserDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.*; @@ -16,8 +18,11 @@ import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.IOException; import java.math.BigDecimal; import java.util.Date; import java.util.List; @@ -402,7 +407,22 @@ } @ApiOperation(value = "导入居民") @DeleteMapping("importuser") public R importUser(MultipartFile multipartFile)throws IOException { String name = multipartFile.getName(); Float size = Float.parseFloat(String.valueOf(multipartFile.getSize())) / 1024; BigDecimal b = new BigDecimal(size); size = b.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue(); log.info("导入文件名字【{}】,文件大小【{}】KB",name,size); String fileType=name.substring(name.indexOf("."),name.length()); boolean isXls = !fileType.contains("xls") && !fileType.contains("xlsx"); if (isXls) { return R.fail("请上传xls或者xlsx格式的文件"); } // EasyExcel.read(multipartFile.getInputStream(), EexcelUserDTO.class, new UploadEexcelUserDTOListener(userService)).sheet().doRead(); return R.ok(); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/easyexcel/UploadEexcelUserDTOListener.java
New file @@ -0,0 +1,68 @@ package com.panzhihua.community_backstage.easyexcel; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSON; import com.panzhihua.common.model.dtos.user.EexcelUserDTO; import com.panzhihua.common.service.user.UserService; import lombok.extern.slf4j.Slf4j; import java.util.ArrayList; import java.util.List; /** * @program: springcloud_k8s_panzhihuazhihuishequ * @description: 导入居民 * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2021-02-04 17:36 **/ @Slf4j public class UploadEexcelUserDTOListener extends AnalysisEventListener<EexcelUserDTO> { /** * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 */ private UserService userService; /** * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 * * @param userService */ public UploadEexcelUserDTOListener(UserService userService) { this.userService = userService; } /** * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 */ private static final int BATCH_COUNT = 50; List<EexcelUserDTO> list = new ArrayList<EexcelUserDTO>(); @Override public void invoke(EexcelUserDTO eexcelUserDTO, AnalysisContext analysisContext) { log.info("解析到一条数据:{}", JSON.toJSONString(eexcelUserDTO)); list.add(eexcelUserDTO); // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM if (list.size() >= BATCH_COUNT) { saveData(); // 存储完成清理 list list.clear(); } } @Override public void doAfterAllAnalysed(AnalysisContext analysisContext) { // 这里也要保存数据,确保最后遗留的数据也存储到数据库 saveData(); log.info("所有数据解析完成!"); } /** * 加上存储数据库 */ private void saveData() { log.info("{}条数据,开始存储数据库!", list.size()); userService.batchSaveUser(list); log.info("存储数据库成功!"); } } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} servlet: multipart: max-file-size: 10MB springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import java.util.List; @@ -74,4 +75,6 @@ " </where>" + "</script>") IPage<ComActVO> pageCommunity(Page page, @Param("pageComActDTO") PageComActDTO pageComActDTO); @Update("update sys_user u set u.password=#{password} where u.account=#{account} and u.type=3 and u.community_id=#{communityId}") void updateAccountPassword(@Param("password") String password, @Param("account") String account, @Param("communityId")Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java
@@ -65,9 +65,26 @@ @Override public R putCommunity(ComActVO comActVO) { ComActDO comActDO=new ComActDO(); String password = comActVO.getPassword(); String account = comActVO.getAccount(); Long communityId = comActVO.getCommunityId(); // String contacts = comActVO.getContacts(); int a=0; if (!ObjectUtils.isEmpty(password)) { String encode = new BCryptPasswordEncoder().encode(password); comActVO.setPassword(encode); a=1; } // if(!ObjectUtils.isEmpty(account)||!ObjectUtils.isEmpty(contacts)){ // a=1; // } BeanUtils.copyProperties(comActVO,comActDO); int update = comActDAO.updateById(comActDO); if (update>0) { if (a==1) { // 修改登录账户的密码 comActDAO.updateAccountPassword(comActVO.getPassword(),account,communityId); } return R.ok(); } return R.fail(); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} servlet: multipart: max-file-size: 10MB springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} eureka: client: springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} eureka: client: springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/resources/bootstrap.yml
@@ -6,10 +6,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} eureka: client: springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/resources/bootstrap.yml
@@ -14,10 +14,10 @@ discovery: enabled: true service-id: config # 注册中心的服务名 profile: prod # 指定配置文件的环境 profile: ${ENV:dev} # 指定配置文件的环境 uri: http://${CONFIG_URL:localhost}:8193/ profiles: active: prod active: ${ENV:dev} servlet: multipart: max-file-size: 10MB