tangxiaobao
2021-08-16 11dfdae136ddd86047b601d488a66bfaabccd9e7
实有人口导入bug修改
5个文件已修改
51 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDrugExcelListen.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSwPatrolRecordApi.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityManagerApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDrugExcelListen.java
@@ -120,7 +120,7 @@
            log.info("开始导入吸毒人员数据");
            log.info("表格总数据:" + list.size());
            if (list.size() == 0) {
                throw new ServiceException("000", "导入数据为空!");
                throw new ServiceException("100", "导入数据为空!");
            }
            ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
            String key = Constants.DRUG_POPULATION_ERROR_LIST + communityId;
springcloud_k8s_panzhihuazhihuishequ/community_backstage/pom.xml
@@ -48,6 +48,11 @@
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>swagger-bootstrap-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>com.github.kmood</groupId>
            <artifactId>officeexport-java</artifactId>
            <version>1.0.1.6-RELEASE</version>
        </dependency>
    </dependencies>
    <build>
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSwPatrolRecordApi.java
@@ -6,6 +6,8 @@
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.kmood.datahandle.DocumentProducer;
import com.kmood.utils.FileUtils;
import com.panzhihua.common.constants.Constants;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.listen.ComMngPopulationServeExcelListen;
@@ -25,6 +27,7 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import sun.applet.Main;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -32,7 +35,10 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
/**
@@ -429,6 +435,39 @@
        }
    }
    @ApiOperation(value = "导出图片测试")
    @GetMapping("/export/picture")
    public static void testPictureOutModel () {
        try {
            Class<? extends Class> aClass = Main.class.getClass();
            ClassLoader classLoader = aClass.getClassLoader();
            if (classLoader == null){
                classLoader = ClassLoader.getSystemClassLoader();
            }
            String ActualModelPath = classLoader.getResource("model/").toURI().getPath();
            String xmlPath = classLoader.getResource("model").toURI().getPath();
            String ExportFilePath = classLoader.getResource(".").toURI().getPath() + "/picture.doc";
            HashMap<String, Object> map = new HashMap<>();
            //读取输出图片
            URL introUrl = classLoader.getResource("./picture/微信图片_20210805165019.jpg");
//            URL codeUrl = classLoader.getResource("./picture/exportTestPicture-code.png");
//            URL titleUrl = classLoader.getResource("./picture/exportTestPicture-title.png");
            String intro = Base64.getEncoder().encodeToString(FileUtils.readToBytesByFilepath(introUrl.toURI().getPath()));
            map.put("intro", intro);
//            String code = Base64.getEncoder().encodeToString(FileUtils.readToBytesByFilepath(codeUrl.toURI().getPath()));
//            map.put("code", code);
//            map.put("title", Base64.getEncoder().encodeToString(FileUtils.readToBytesByFilepath(titleUrl.toURI().getPath())));
            //编译输出
            DocumentProducer dp = new DocumentProducer(ActualModelPath);
//            String complie = dp.Complie(xmlPath, "picture.xml", true);
            dp.produce(map, ExportFilePath);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private List<List<String>> headDataFilling(){
        List<List<String>> list = new ArrayList<List<String>>();
        List<String> head0 = new ArrayList<String>();
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityManagerApi.java
@@ -663,7 +663,7 @@
                        }
                    }
                }
                return R.ok(url+_name);
                return R.ok(url+name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -4565,7 +4565,8 @@
            }
        } else {
            //新增
            Integer count = comMngUserTagDAO.selectCount(new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getTagName, comMngTagVO.getTagName()));
            Integer count = comMngUserTagDAO.selectCount(new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getTagName, comMngTagVO.getTagName())
            .eq(ComMngUserTagDO::getCommunityId, comMngTagVO.getCommunityId()));
            if (count > 0) {
                return R.fail("该标签已存在,标签名称重复");
            }