huanghongfa
2021-08-16 ac0f1610e21b5326d4c7c263aa5cf410d9e2465c
Merge remote-tracking branch 'origin/test' into test
16个文件已修改
129 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCorrectExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCultExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDisabilityExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDrugExcelListen.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationKeyExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationLowSecurityExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationMajorExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationRehabilitationExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationSentenceExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationVeteransExcelListen.java 1 ●●●● 补丁 | 查看 | 原始文档 | 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 85 ●●●●● 补丁 | 查看 | 原始文档 | 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/service_user/src/main/java/com/panzhihua/service_user/service/impl/SysUserInputServiceImpl.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCorrectExcelListen.java
@@ -128,7 +128,6 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                String[] parsePatterns = new String[]{"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"};
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCultExcelListen.java
@@ -118,6 +118,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                String[] parsePatterns = new String[]{"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"};
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDisabilityExcelListen.java
@@ -119,6 +119,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                ArrayList<ComMngPopulationDisabilityExcelVO> voList = Lists.newArrayList();
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;
@@ -131,6 +131,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                String[] parsePatterns = new String[]{"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"};
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationKeyExcelListen.java
@@ -127,6 +127,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                ArrayList<ComMngPopulationKeyExcelVO> voList = Lists.newArrayList();
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationLowSecurityExcelListen.java
@@ -120,6 +120,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                String[] parsePatterns = new String[]{"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d", "yyyy/MM", "yyyy/M", "yyyy-M", "yyyy-MM"};
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationMajorExcelListen.java
@@ -127,6 +127,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                ArrayList<ComMngPopulationMajorExcelVO> voList = Lists.newArrayList();
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationRehabilitationExcelListen.java
@@ -128,6 +128,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                String[] parsePatterns = new String[]{"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"};
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationSentenceExcelListen.java
@@ -129,6 +129,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                ArrayList<ComMngPopulationSentenceExcelVO> voList = Lists.newArrayList();
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -116,6 +116,9 @@
            R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY);
            log.info("开始导入人口数据");
            log.info("表格总数据:" + list.size());
            if (list.size() == 0) {
                throw new ServiceException("000", "导入数据为空!");
            }
            ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
            String key = Constants.POPULATION_ERROR_LIST + communityId;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationVeteransExcelListen.java
@@ -118,6 +118,7 @@
//            dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue()));
//        }
            int index = 2;
            try {
                String[] parsePatterns = new String[]{"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"};
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;
@@ -18,6 +20,9 @@
import com.panzhihua.common.service.partybuilding.PartyBuildingService;
import com.panzhihua.common.utlis.SFTPUtil;
import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.Version;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@@ -25,14 +30,22 @@
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;
import java.io.*;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.*;
import java.io.File;
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 +442,74 @@
        }
    }
    @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();
        }
    }
    @ApiOperation(value = "导出图片测试")
    @PostMapping("/export/picture")
    public void test(@RequestParam(value = "id") Long id){
        Long communityId = this.getLoginUserInfo().getCommunityId();
        Map<String,Object> dataMap = new HashMap<String, Object>();
        try {
            ComSwSafetyWorkRecordVO comSwSafetyWorkRecordVO = JSONObject.parseObject(JSONObject.toJSONString(communityService.detailSafetyWorkRecord(id, communityId).getData()),ComSwSafetyWorkRecordVO.class);
            //日期
            dataMap.put("date", new SimpleDateFormat("yyyy-MM-dd").format(comSwSafetyWorkRecordVO.getPatrolTime()));
            Configuration configuration = new Configuration(new Version("2.3.0"));
            configuration.setDefaultEncoding("utf-8");
            /**
             * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是
             * 指定ftl文件所在目录的路径,而不是ftl文件的路径
             */
            //指定路径的第一种方式(根据某个类的相对路径指定)
//                configuration.setClassForTemplateLoading(this.getClass(), "");
            //指定路径的第二种方式,我的路径是C:/a.ftl
            configuration.setDirectoryForTemplateLoading(new File("c:/"));
            //输出文档路径及名称
            File outFile = new File("D:/报销信息导出.doc");
            //以utf-8的编码读取ftl文件
            Template template = configuration.getTemplate("报告.ftl", "utf-8");
            Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"), 10240);
            template.process(dataMap, out);
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private List<List<String>> headDataFilling(){
        List<List<String>> list = new ArrayList<List<String>>();
        List<String> head0 = new ArrayList<String>();
@@ -438,9 +519,9 @@
        List<String> head2 = new ArrayList<String>();
        head2.add("值班人员联系电话(多个用\"、\"隔开,请安姓名顺序)");
        List<String> head3 = new ArrayList<String>();
        head3.add("值班领导(多个用\"、\"隔开)");
        head3.add("值班领导");
        List<String> head4 = new ArrayList<String>();
        head4.add("值班领导联系电话(多个用\"、\"隔开,请安姓名顺序)");
        head4.add("值班领导联系电话");
        List<String> head5 = new ArrayList<String>();
        head5.add("");
        list.add(head0);
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("该标签已存在,标签名称重复");
            }
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/SysUserInputServiceImpl.java
@@ -355,16 +355,17 @@
            comMngUserTagDO.setTagName(comMngTagVO.getTagName());
            comMngUserTagDAO.updateById(comMngUserTagDO);
        }else{
            int count = comMngUserTagDAO.selectCount(new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getTagName,comMngTagVO.getTagName()));
            if(count>0){
               return R.fail("标签重复");
            ComMngUserTagDO comMngUserTagDO = comMngUserTagDAO.selectOne(new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getCommunityId,comMngTagVO.getCommunityId()).eq(ComMngUserTagDO::getTagName,comMngTagVO.getTagName()));
            if(comMngUserTagDO != null){
                if (comMngUserTagDO.getCommunityId().equals(comMngTagVO.getCommunityId()))
                return R.fail("标签重复");
            }
            ComMngUserTagDO comMngUserTagDO = new ComMngUserTagDO();
            comMngUserTagDO.setTagName(comMngTagVO.getTagName());
            comMngUserTagDO.setCommunityId(comMngTagVO.getCommunityId());
            comMngUserTagDO.setSysFlag(0);
            comMngUserTagDO.setCreateAt(new Date());
            comMngUserTagDAO.insert(comMngUserTagDO);
            ComMngUserTagDO comMngUserTagDO1 = new ComMngUserTagDO();
            comMngUserTagDO1.setTagName(comMngTagVO.getTagName());
            comMngUserTagDO1.setCommunityId(comMngTagVO.getCommunityId());
            comMngUserTagDO1.setSysFlag(0);
            comMngUserTagDO1.setCreateAt(new Date());
            comMngUserTagDAO.insert(comMngUserTagDO1);
        }
        return R.ok();
    }