| | |
| | | // 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"}; |
| | |
| | | // 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"}; |
| | |
| | | // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); |
| | | // } |
| | | |
| | | |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngPopulationDisabilityExcelVO> voList = Lists.newArrayList(); |
| | |
| | | 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; |
| | |
| | | // 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"}; |
| | |
| | | // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); |
| | | // } |
| | | |
| | | |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngPopulationKeyExcelVO> voList = Lists.newArrayList(); |
| | |
| | | // 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"}; |
| | |
| | | // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); |
| | | // } |
| | | |
| | | |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngPopulationMajorExcelVO> voList = Lists.newArrayList(); |
| | |
| | | // 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"}; |
| | |
| | | // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); |
| | | // } |
| | | |
| | | |
| | | int index = 2; |
| | | try { |
| | | ArrayList<ComMngPopulationSentenceExcelVO> voList = Lists.newArrayList(); |
| | |
| | | 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; |
| | | |
| | |
| | | // 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"}; |
| | |
| | | <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> |
| | |
| | | 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; |
| | |
| | | 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.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; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | @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>(); |
| | |
| | | } |
| | | } |
| | | } |
| | | return R.ok(url+_name); |
| | | return R.ok(url+name); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | log.error("文件传输失败【{}】", e.getMessage()); |
| | |
| | | } |
| | | } 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("该标签已存在,标签名称重复"); |
| | | } |
| | |
| | | comMngUserTagDO.setTagName(comMngTagVO.getTagName()); |
| | | comMngUserTagDAO.updateById(comMngUserTagDO); |
| | | }else{ |
| | | int count = comMngUserTagDAO.selectCount(new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getTagName,comMngTagVO.getTagName())); |
| | | int count = comMngUserTagDAO.selectCount(new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getCommunityId,comMngTagVO.getCommunityId()).eq(ComMngUserTagDO::getTagName,comMngTagVO.getTagName())); |
| | | if(count>0){ |
| | | return R.fail("标签重复"); |
| | | } |