Forráskód Böngészése

Merge branch 'master' into prod

buzhanyi 1 éve
szülő
commit
4df5fc2ba7

+ 48 - 2
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseExpertController.java

@@ -1,7 +1,9 @@
 package com.ozs.web.controller.base;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ozs.base.domain.BaseExpert;
 import com.ozs.base.domain.BaseProfessional;
@@ -15,19 +17,23 @@ import com.ozs.common.core.controller.BaseController;
 import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.model.LoginUser;
 import com.ozs.common.enums.BusinessType;
+import com.ozs.common.exception.base.BaseException;
 import com.ozs.common.utils.PageUtils;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.common.utils.bean.BeanUtils;
 import com.ozs.common.utils.poi.ExcelUtil;
+import com.ozs.plan.doman.vo.responseVo.PlanYearsResponseVo;
 import com.ozs.system.domain.vo.SysRegionVO;
 import com.ozs.system.service.ISysDictDataService;
 import com.ozs.system.service.SysRegionService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.util.ObjectUtils;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -35,7 +41,12 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
 import javax.validation.constraints.NotEmpty;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.List;
@@ -47,6 +58,7 @@ import java.util.stream.Collectors;
  * @author sunhh
  */
 @Api(tags = "专家库管理")
+@Slf4j
 @RestController
 @RequestMapping("/base/expert")
 public class BaseExpertController extends BaseController {
@@ -61,7 +73,7 @@ public class BaseExpertController extends BaseController {
     private ISysDictDataService dictDataService;
 
 
-    @ApiOperation(value = "新增专家库" , notes = "必传 专家库名称")
+    @ApiOperation(value = "新增专家库", notes = "必传 专家库名称")
     @PostMapping("/insertExpert")
     @PreAuthorize("@ss.hasPermi('base:expert:insertExpert')")
     @Log(title = ModularConstans.expert, businessType = BusinessType.INSERT)
@@ -247,4 +259,38 @@ public class BaseExpertController extends BaseController {
         }
         return baseExpertService.selectExtractionExpert(baseExpertVo);
     }
+
+    @ApiOperation("模板下载")
+    @GetMapping("/downloaExcel")
+    public void downloadZip(HttpServletResponse response) {
+        List<BaseExpertVo> list = new ArrayList<BaseExpertVo>();
+        list.add(new BaseExpertVo("张先生", "法务专家", "男",
+                "2023-07-06", "15152223667", "安全工程03",
+                "科室一", "高级职称", "天津市/河东区", "050050101"
+        ));
+        list.add(new BaseExpertVo("李先生", "经济专家", "女",
+                "2023-07-06", "14448485656", "测试工程07",
+                "科室二", "中级职称", "山西省/阳泉市/平定县", "41133535035"
+        ));
+        InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/base_expert.xlsx");
+        OutputStream outputStream = null;
+        try {
+            response.setContentType("application/vnd.ms-excel");
+            response.setCharacterEncoding("utf-8");
+            // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
+            String fileName = URLEncoder.encode("专家信息(模板)", "UTF-8").replaceAll("\\+", "%20");
+            response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
+            outputStream = response.getOutputStream();
+            ExcelWriter excelWriter = EasyExcel.write(outputStream)
+                    .withTemplate(resourceAsStream).autoCloseStream(true).build();
+            WriteSheet writeSheet = EasyExcel.writerSheet().build();
+            excelWriter.fill(list, writeSheet);
+            excelWriter.finish();
+            outputStream.flush();
+            outputStream.close();
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            throw new BaseException("下载异常");
+        }
+    }
 }

+ 46 - 0
purchase-admin/src/main/java/com/ozs/web/controller/base/BaseSupplierController.java

@@ -1,5 +1,8 @@
 package com.ozs.web.controller.base;
 
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.write.metadata.WriteSheet;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -11,6 +14,7 @@ import com.ozs.common.core.domain.AjaxResult;
 import com.ozs.common.core.domain.model.LoginUser;
 import com.ozs.common.core.page.TableDataInfo;
 import com.ozs.common.enums.BusinessType;
+import com.ozs.common.exception.base.BaseException;
 import com.ozs.common.utils.StringUtils;
 import com.ozs.base.domain.BaseSupplier;
 import com.ozs.base.service.BaseSupplierService;
@@ -18,8 +22,10 @@ import com.ozs.common.utils.poi.ExcelUtil;
 import com.ozs.framework.web.service.TokenService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -27,6 +33,11 @@ import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URLEncoder;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 
@@ -36,6 +47,7 @@ import java.util.List;
  * @author sunhh
  */
 @Api(tags = "供应商管理")
+@Slf4j
 @RestController
 @RequestMapping("/base/supplier")
 public class BaseSupplierController extends BaseController {
@@ -144,4 +156,38 @@ public class BaseSupplierController extends BaseController {
         IPage<BaseSupplier> page = baseSupplierService.page(new Page<BaseSupplier>(baseSupplierVo.getPageNum(), baseSupplierVo.getPageSize()), lw);
         return success(page);
     }
+
+    @ApiOperation("模板下载")
+    @GetMapping("/downloaExcel")
+    public void downloadZip(HttpServletResponse response) {
+        List<BaseSupplierVo> list = new ArrayList<BaseSupplierVo>();
+        list.add(new BaseSupplierVo("河南移动", "张先生", "河南-张家口"
+                , "101019", "张老二", "1512626****",
+                "张**", "中国建设银行", "2525********", "是"
+        ));
+        list.add(new BaseSupplierVo("河北不动", "刘先生", "河北-林泉县",
+                "144030", "李老三", "1775959****",
+                "刘**", "中原银行", "3366*********", "否"
+        ));
+        InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/base_supplier.xlsx");
+        OutputStream outputStream = null;
+        try {
+            response.setContentType("application/vnd.ms-excel");
+            response.setCharacterEncoding("utf-8");
+            // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
+            String fileName = URLEncoder.encode("供应商信息(模板)", "UTF-8").replaceAll("\\+", "%20");
+            response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
+            outputStream = response.getOutputStream();
+            ExcelWriter excelWriter = EasyExcel.write(outputStream)
+                    .withTemplate(resourceAsStream).autoCloseStream(true).build();
+            WriteSheet writeSheet = EasyExcel.writerSheet().build();
+            excelWriter.fill(list, writeSheet);
+            excelWriter.finish();
+            outputStream.flush();
+            outputStream.close();
+        } catch (Exception e) {
+            log.error(e.getMessage());
+            throw new BaseException("下载异常");
+        }
+    }
 }

+ 0 - 300
purchase-admin/src/main/java/com/ozs/web/controller/statisticalAnalysis/StatisticalAnalysisController.java

@@ -1,300 +0,0 @@
-package com.ozs.web.controller.statisticalAnalysis;
-
-import com.ozs.common.annotation.Log;
-import com.ozs.common.constant.ModularConstans;
-import com.ozs.common.core.controller.BaseController;
-import com.ozs.common.core.domain.AjaxResult;
-import com.ozs.common.enums.BusinessType;
-import com.ozs.common.utils.StringUtils;
-import com.ozs.pm.doman.vo.requestVo.PmDemandReqVo;
-import com.ozs.pm.doman.vo.responseVo.StatisticalChartsResVo;
-import com.ozs.pm.service.IPmDemandService;
-import com.ozs.system.domain.SysFileInfo;
-import io.swagger.annotations.ApiOperation;
-import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
-import org.apache.poi.util.Units;
-import org.apache.poi.xwpf.usermodel.XWPFDocument;
-import org.apache.poi.xwpf.usermodel.XWPFParagraph;
-import org.apache.poi.xwpf.usermodel.XWPFRun;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 统计分析页面控制层
- *
- * @author buzhanyi
- */
-@RestController
-@RequestMapping("/statistical")
-public class StatisticalAnalysisController extends BaseController {
-
-    //@Resource
-    //private IPmDemandService pmDemandService;
-    //
-    //@ApiOperation(value = "项目类型情况统计")
-    //@PostMapping("/countByProjectType")
-    ////@PreAuthorize("@ss.hasPermi('statistical:countByProjectType')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult countByProjectType(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //按照项目属性统计所有的项目
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    List<StatisticalChartsResVo> resVos = pmDemandService.countByProjectType(pmDemandReqVo);
-    //    return AjaxResult.success(resVos);
-    //}
-    //
-    //@ApiOperation(value = "采购方式分布")
-    //@PostMapping("/countByPurchaseMode")
-    ////@PreAuthorize("@ss.hasPermi('statistical:countByPurchaseMode')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult countByPurchaseMode(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //按照采购方式统计所有的项目
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseMode(pmDemandReqVo);
-    //    return AjaxResult.success(resVos);
-    //}
-    //
-    //@ApiOperation(value = "需采转化情况统计")
-    //@PostMapping("/countByPurchaseChange")
-    ////@PreAuthorize("@ss.hasPermi('statistical:countByPurchaseChange')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult countByPurchaseChange(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //按照采购方式统计所有的项目
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    List<StatisticalChartsResVo> resVos = pmDemandService.countByPurchaseChange(pmDemandReqVo);
-    //    return AjaxResult.success(resVos);
-    //}
-    //
-    //@ApiOperation(value = "项目金额分布")
-    //@PostMapping("/countByEvaluation")
-    ////@PreAuthorize("@ss.hasPermi('statistical:countByEvaluation')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult countByEvaluation(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //按照概算金额统计所有的项目
-    //    //概算金额包括:100万以下采购任务、100至500万元采购任务、500至1000万元采购任务、1000至5000万元采购任务、5000至1亿元采购任务、1亿元及以上采购任务
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    List<StatisticalChartsResVo> resVos = pmDemandService.countByEvaluation(pmDemandReqVo);
-    //    return AjaxResult.success(resVos);
-    //}
-    //
-    //@ApiOperation(value = "执行滞后分析")
-    //@PostMapping("/countProjectExceed")
-    ////@PreAuthorize("@ss.hasPermi('statistical:countProjectExceed')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult countProjectExceed(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //执行滞后采购项目:本年度所有的逾期项目数
-    //    //预算金额:本年度所有逾期项目累加的预算金额
-    //    //滞后项目数量占比:指本年度逾期项目数量/本年度所有项目数量
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    return pmDemandService.countProjectExceed(pmDemandReqVo);
-    //}
-    //
-    //@ApiOperation(value = "滞后项目数量分析")
-    //@PostMapping("/exceedAnalysis")
-    ////@PreAuthorize("@ss.hasPermi('statistical:exceedAnalysis')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult exceedAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //统计不同时间维度的逾期项目
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
-    //        return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
-    //    }
-    //    return pmDemandService.exceedAnalysis(pmDemandReqVo);
-    //}
-    //
-    //@ApiOperation(value = "滞后项目时长分析")
-    //@PostMapping("/exceedMarketAnalysis")
-    ////@PreAuthorize("@ss.hasPermi('statistical:exceedMarketAnalysis')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult exceedMarketAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //按照滞后时长统计项目数量
-    //    //滞后时长包括:滞后1个月以内的采购任务、滞后1至3个月采购任务、滞后3至6个月采购任务、滞后6个月至1年采购任务、滞后1年以上采购任务
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    return pmDemandService.exceedMarketAnalysis(pmDemandReqVo);
-    //}
-    //
-    //@ApiOperation(value = "采购项目信息统计")
-    //@PostMapping("/purchaseProjectStatistical")
-    ////@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectStatistical')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult purchaseProjectStatistical(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    Map<String, Integer> map = pmDemandService.purchaseProjectStatistical(pmDemandReqVo);
-    //    return success(map);
-    //}
-    //
-    //@ApiOperation(value = "重大规划采购任务专项计划管理情况")
-    //@PostMapping("/countMajorProject")
-    ////@PreAuthorize("@ss.hasPermi('statistical:countMajorProject')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult countMajorProject(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    return pmDemandService.countMajorProject(pmDemandReqVo);
-    //}
-    //
-    //
-    //@ApiOperation(value = "任务数量趋势分析")
-    //@PostMapping("/taskQuantityAnalysis")
-    ////@PreAuthorize("@ss.hasPermi('statistical:taskQuantityAnalysis')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult taskQuantityAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //任务数量趋势分析:按照月、季度、年统计“项目属性”字段中“重大规划”属性的项目
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
-    //        return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
-    //    }
-    //    return pmDemandService.taskQuantityAnalysis(pmDemandReqVo);
-    //}
-    //
-    //@ApiOperation(value = "各阶段采购任务数量分布")
-    //@PostMapping("/countEveryStatusNum")
-    ////@PreAuthorize("@ss.hasPermi('statistical:countEveryStatusNum')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult countEveryStatusNum(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    //指项目进行到各个阶段的数量
-    //    //阶段包括:待选取代理、待上传招标文件、待发布公告、待开标、待发布中标公告、中标公式中
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    return pmDemandService.countEveryStatusNum(pmDemandReqVo);
-    //}
-    //
-    //@ApiOperation(value = "项目执行进度统计")
-    //@PostMapping("/purchaseProjectExecute")
-    ////@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectExecute')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult purchaseProjectExecute(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    List<StatisticalChartsResVo> resVos = pmDemandService.purchaseProjectExecute(pmDemandReqVo);
-    //    return success(resVos);
-    //}
-    //
-    //@ApiOperation(value = "已完成项目数量统计")
-    //@PostMapping("/purchaseProjectCompleteNumber")
-    ////@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectCompleteNumber')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult purchaseProjectCompleteNumber(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
-    //        return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
-    //    }
-    //    List<Map<String, Integer>> map = pmDemandService.purchaseProjectCompleteNumber(pmDemandReqVo);
-    //    return success(map);
-    //}
-    //
-    //@ApiOperation(value = "已完成采购任务数量")
-    //@PostMapping("/purchaseTaskFinish")
-    ////@PreAuthorize("@ss.hasPermi('statistical:purchaseTaskFinish')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult purchaseTaskFinish(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
-    //        return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
-    //    }
-    //    List<Map<String, Integer>> map = pmDemandService.purchaseTaskFinish(pmDemandReqVo);
-    //    return success(map);
-    //}
-    //
-    //@ApiOperation(value = "各阶段项目数量分布")
-    //@PostMapping("/purchaseProjectDistribution")
-    ////@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectDistribution')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult purchaseProjectDistribution(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    List<Map<String, String>> map = pmDemandService.purchaseProjectDistribution(pmDemandReqVo);
-    //    return success(map);
-    //}
-    //
-    //@ApiOperation(value = "采购项目--项目数量分析/预算金额(万元)")
-    //@PostMapping("/purchaseProjectNumberAnalysis")
-    ////@PreAuthorize("@ss.hasPermi('statistical:purchaseProjectNumberAnalysis')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult purchaseProjectNumberAnalysis(@RequestBody PmDemandReqVo pmDemandReqVo) {
-    //    // 需求单位可查看本单位及其下属单位的统计数据
-    //    if (StringUtils.isNull(pmDemandReqVo.getPurchaseDeptId())) {
-    //        return error("登录账号的单位 不能为空!");
-    //    }
-    //    if (StringUtils.isNull(pmDemandReqVo.getTimeType())) {
-    //        return error("统计时间类型不能为空, 1:年度,2:季度,3:月份!");
-    //    }
-    //    List<Map<String, String>> map = pmDemandService.purchaseProjectNumberAnalysis(pmDemandReqVo);
-    //    return success(map);
-    //}
-    //
-    //@ApiOperation(value = "生成分析报告")
-    //@PostMapping("/generateAnalysisReport")
-    ////@PreAuthorize("@ss.hasPermi('statistical:generateAnalysisReport')")
-    //@Log(title = ModularConstans.statisticalAnalysis, businessType = BusinessType.QUERY)
-    //public AjaxResult generateAnalysisReport(@RequestBody SysFileInfo file) {
-    //    //  创建一个document对象,相当于新建一个word文档(后缀名为.docx)。
-    //    XWPFDocument document = new XWPFDocument();
-    //    //        创建一个段落对象。
-    //    XWPFParagraph paragraph = document.createParagraph();
-    //    //        创建一个run。run具体是什么,我也不知道。但是run是这里面的最小单元了。
-    //    XWPFRun run = paragraph.createRun();
-    //    //        插入图片
-    //    //        创建一个输出流 即是该文档的保存位置
-    //    try {
-    //        //文件路径位置和文件名称
-    //        run.addPicture(new FileInputStream(file.getFileUrl()),
-    //                XWPFDocument.PICTURE_TYPE_PNG,
-    //                file.getFileName(),
-    //                Units.toEMU(400),
-    //                Units.toEMU(200));
-    //        //文件保存地址
-    //        OutputStream outputStream = new FileOutputStream(file.getFileMappingPath());
-    //        document.write(outputStream);
-    //        outputStream.close();
-    //        return AjaxResult.success("分析文档已生成");
-    //    } catch (IOException e) {
-    //        e.printStackTrace();
-    //    } catch (InvalidFormatException e) {
-    //        e.printStackTrace();
-    //    }
-    //    return AjaxResult.success("分析文档已生成");
-    //}
-
-
-}

BIN
purchase-admin/src/main/resources/template/base_expert.xlsx


BIN
purchase-admin/src/main/resources/template/base_supplier.xlsx


+ 16 - 0
purchase-system/src/main/java/com/ozs/base/domain/vo/BaseExpertVo.java

@@ -142,6 +142,22 @@ public class BaseExpertVo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
 
+    public BaseExpertVo() {
+    }
+
+    public BaseExpertVo(String expertName, String expertType, String expertGender, String expertDateBirth, String expertTel, String majorTypeName, String unitInformation, String professionalTitle, String localArea, String idNumber) {
+        this.expertName = expertName;
+        this.expertType = expertType;
+        this.expertGender = expertGender;
+        this.expertDateBirth = expertDateBirth;
+        this.expertTel = expertTel;
+        this.majorTypeName = majorTypeName;
+        this.unitInformation = unitInformation;
+        this.professionalTitle = professionalTitle;
+        this.localArea = localArea;
+        this.idNumber = idNumber;
+    }
+
     /**
      * 更新人
      */

+ 30 - 2
purchase-system/src/main/java/com/ozs/base/domain/vo/BaseSupplierVo.java

@@ -2,14 +2,13 @@ package com.ozs.base.domain.vo;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ozs.common.annotation.Excel;
-import com.ozs.common.vo.PageVo;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.util.Date;
 
 @Data
-public class BaseSupplierVo extends PageVo {
+public class BaseSupplierVo {
 
     @Excel(name = "单位名称")
     @ApiModelProperty("供应商名称")
@@ -67,4 +66,33 @@ public class BaseSupplierVo extends PageVo {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "修改时间")
     private Date updateTime;
+
+    /**
+     * 当前记录起始索引
+     */
+    @ApiModelProperty("页数")
+    private Long pageNum;
+    /**
+     * 每页显示记录数
+     */
+    @ApiModelProperty("页大小")
+    private Long pageSize;
+
+    public BaseSupplierVo() {
+    }
+
+    public BaseSupplierVo(String supplierName, String supplierResponsiblePerson, String supplierAddress, String postalCode,
+                          String projectPerson, String telephone, String bankAccountName, String bankOfDeposit,
+                          String bankAccountNumber, String supplierAdvancePurchase) {
+        this.supplierName = supplierName;
+        this.supplierResponsiblePerson = supplierResponsiblePerson;
+        this.supplierAddress = supplierAddress;
+        this.postalCode = postalCode;
+        this.projectPerson = projectPerson;
+        this.telephone = telephone;
+        this.bankAccountName = bankAccountName;
+        this.bankOfDeposit = bankOfDeposit;
+        this.bankAccountNumber = bankAccountNumber;
+        this.supplierAdvancePurchase = supplierAdvancePurchase;
+    }
 }

+ 18 - 15
purchase-system/src/main/java/com/ozs/base/service/impl/BaseExpertServiceImpl.java

@@ -214,7 +214,11 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                     expert.setStatus("0");
                 } else {
                     ++failureNum;
-                    failureMsg.append(failureNum + "、专家类型“" + expert.getExpertType() + "”不存在");
+                    failureMsg.append(failureNum + "、专家类型“" + expert.getExpertType() + "”不存在     <br/>");
+                }
+                if (expert.getIdNumber().length() > 18) {
+                    ++failureNum;
+                    failureMsg.append(failureNum + "、身份证号“" + expert.getIdNumber() + "”长度过长     <br/>");
                 }
                 //查询身份证号是否已使用
                 LambdaQueryWrapper<BaseExpert> baseExpertWrapper = new LambdaQueryWrapper<>();
@@ -223,7 +227,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                 //身份证号已存在的不可添加
                 if (!ObjectUtils.isEmpty(idNumberList)) {
                     ++failureNum;
-                    failureMsg.append(failureNum + "、身份证号“" + expert.getExpertType() + "”已被使用");
+                    failureMsg.append(failureNum + "、身份证号“" + expert.getIdNumber() + "”已被使用 <br/>");
                 }
                 //专业类型
                 LambdaQueryWrapper<BaseProfessional> wrapper = new LambdaQueryWrapper<>();
@@ -234,14 +238,14 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                     expert.setMajorType(list.get(0).getProfessionalCode());
                 } else {
                     ++failureNum;
-                    failureMsg.append(failureNum + "、专业类型“" + expert.getExpertType() + "”不存在");
+                    failureMsg.append(failureNum + "、专业类型“" + expert.getExpertType() + "”不存在     <br/>");
                 }
                 //职称
                 if (!StringUtils.isEmpty(professionalTitleMap.get(expert.getProfessionalTitle()))) {
                     expert.setProfessionalTitle(professionalTitleMap.get(expert.getProfessionalTitle()));
                 } else {
                     ++failureNum;
-                    failureMsg.append(failureNum + "、职称“" + expert.getProfessionalTitle() + "”不存在");
+                    failureMsg.append(failureNum + "、职称“" + expert.getProfessionalTitle() + "”不存在    <br/>");
                 }
                 if (StringUtils.isNotNull(expert.getUnitInformation())) {
                     List<BaseUnitInformation> baseUnitInformationList = baseExpertMapper.selectByUnitInformation(expert.getUnitInformation());
@@ -257,7 +261,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                 //地区
                 if (StringUtils.isEmpty(expert.getLocalArea()) || expert.getLocalArea().split("/").length < 2) {
                     ++failureNum;
-                    failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”不存在");
+                    failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”不存在    <br/>");
                 } else {
                     //大部分地区是三级
                     String[] localAreas = expert.getLocalArea().split("/");
@@ -267,7 +271,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                         List<SysRegionVO> sysRegionVO2 = sysRegionService.selectInfoByName(localAreas[2]);
                         if (ObjectUtils.isEmpty(sysRegionVO2) || ObjectUtils.isEmpty(sysRegionVO1) || ObjectUtils.isEmpty(sysRegionVO)) {
                             ++failureNum;
-                            failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”信息有误");
+                            failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”信息有误  <br/>");
                         } else {
                             //是否成立上下级关系
                             boolean isLea = false;
@@ -288,7 +292,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                             }
                             if (isLea == false) {
                                 ++failureNum;
-                                failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”非上下级关系");
+                                failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”非上下级关系    <br/>");
                             }
                         }
 
@@ -298,7 +302,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                         List<SysRegionVO> sysRegionVO1 = sysRegionService.selectInfoByName(localAreas[1]);
                         if (ObjectUtils.isEmpty(sysRegionVO1) || ObjectUtils.isEmpty(sysRegionVO)) {
                             ++failureNum;
-                            failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”信息有误");
+                            failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”信息有误  <br/>");
                         } else {
                             //是否成立上下级关系
                             boolean isLea = false;
@@ -314,7 +318,7 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                             }
                             if (isLea == false) {
                                 ++failureNum;
-                                failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”非上下级关系");
+                                failureMsg.append(failureNum + "、地区“" + expert.getLocalArea() + "”非上下级关系    <br/>");
                             }
                         }
                     }
@@ -325,19 +329,18 @@ public class BaseExpertServiceImpl extends ServiceImpl<BaseExpertMapper, BaseExp
                 expert.setUpdateTime(new Date());
                 baseExpertMapper.insert(expert);
                 successNum++;
-                successMsg.append(successNum + "、专家【" + expert.getExpertName() + "】导入成功!");
+                successMsg.append(successNum + "、专家【" + expert.getExpertName() + "】导入成功!    <br/>");
             } catch (Exception exc) {
-                failureNum++;
-                String msg = successNum + "、专家【" + expert.getExpertName() + "】导入失败";
-                failureMsg.append(msg + exc.getMessage());
+                String msg = "      **专家【" + expert.getExpertName() + "】导入失败 <br/>";
+                failureMsg.append(msg);
                 log.error(msg, exc);
             }
         }
         if (failureNum > 0) {
-            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:");
+            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:   <br/>");
             throw new ServiceException(failureMsg.toString());
         } else {
-            successMsg.insert(0, "导入成功!共 " + successNum + " 条。");
+            successMsg.insert(0, "导入成功!共 " + successNum + " 条。<br/>");
         }
         return successMsg.toString();
     }

+ 2 - 3
purchase-system/src/main/java/com/ozs/base/service/impl/BaseProfessionalServiceImpl.java

@@ -67,9 +67,8 @@ public class BaseProfessionalServiceImpl extends ServiceImpl<BaseProfessionalMap
                     // successMsg.append("<br/>" + successNum + "、专业名称 " + baseProfessional.getProfessionalName() + " 导入成功");
                 }
             } catch (Exception e) {
-                failureNum++;
                 String msg = "<br/>" + failureNum + "、专业名称 " + baseProfessional.getProfessionalName() + " 导入失败:";
-                failureMsg.append(msg + e.getMessage());
+                failureMsg.append(msg);
                 log.error(msg, e);
             }
         }
@@ -77,7 +76,7 @@ public class BaseProfessionalServiceImpl extends ServiceImpl<BaseProfessionalMap
             failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
             throw new ServiceException(failureMsg.toString());
         } else {
-            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条。");
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条。<br/>");
         }
         return successMsg.toString();
     }

+ 4 - 4
purchase-system/src/main/java/com/ozs/base/service/impl/BaseSupplierServiceImpl.java

@@ -83,7 +83,7 @@ public class BaseSupplierServiceImpl extends ServiceImpl<BaseSupplierMapper, Bas
             //供应商名称已存在的不可添加
             if (!ObjectUtils.isEmpty(supplierNameList)) {
                 ++failureNum;
-                failureMsg.append(failureNum + "、供应商名称“" + supplier.getSupplierName() + "”已被使用");
+                failureMsg.append(failureNum + "、供应商名称“" + supplier.getSupplierName() + "”已被使用  <br/>");
             }
             //是否预先采购
             supplier.setSupplierAdvancePurchase(supplier.getSupplierAdvancePurchase().equals("是") ? "1" : "0");
@@ -93,13 +93,13 @@ public class BaseSupplierServiceImpl extends ServiceImpl<BaseSupplierMapper, Bas
             supplier.setUpdateTime(new Date());
             baseSupplierMapper.insert(supplier);
             successNum++;
-            successMsg.append(successNum + "、供应商【" + supplier.getSupplierName() + "】导入成功!");
+            successMsg.append(successNum + "、供应商【" + supplier.getSupplierName() + "】导入成功!<br/>");
         }
         if (failureNum > 0) {
-            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:");
+            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:   <br/>");
             throw new ServiceException(failureMsg.toString());
         } else {
-            successMsg.insert(0, "导入成功!共 " + successNum + " 条。");
+            successMsg.insert(0, "导入成功!共 " + successNum + " 条。<br/>");
         }
         return successMsg.toString();
     }

+ 7 - 8
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanQuarterServiceImpl.java

@@ -348,7 +348,7 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
                         planQuarter.setPurchaseDeptId(String.valueOf(info.getDeptId()));
                     } else {
                         ++failureNum;
-                        failureMsg.append("*" + failureNum + "*采购单位“" + planQuarter.getPurchaseDeptName() + "”不存在");
+                        failureMsg.append("*" + failureNum + "*采购单位“" + planQuarter.getPurchaseDeptName() + "”不存在   <br/>");
                     }
                     planQuarter.setProjectType(projectTypesMap.get(planQuarter.getProjectType()));
                     planQuarter.setProjectStatus(ProjectStatus.PLANWAITCOMMIT.getCode());
@@ -371,23 +371,22 @@ public class PlanQuarterServiceImpl extends ServiceImpl<PlanQuarterMapper, PlanQ
                     planQuarter.setCreateTime(new Date());
                     planQuarterMapper.insertPlanQuarter(planQuarter);
                     successNum++;
-                    successMsg.append("*" + successNum + "、项目 " + planQuarter.getProjectName() + " 导入成功!");
+                    successMsg.append("*" + successNum + "、项目 " + planQuarter.getProjectName() + " 导入成功!<br/>");
                 } else {
                     failureNum++;
-                    failureMsg.append(failureNum + "*项目 " + planQuarter.getProjectName() + " 已存在!/n");
+                    failureMsg.append(failureNum + "*项目 " + planQuarter.getProjectName() + " 已存在!<br/>");
                 }
             } catch (Exception exc) {
-                failureNum++;
-                String msg = "*" + successNum + "*项目 " + planQuarter.getProjectName() + " 导入失败";
-                failureMsg.append(msg + exc.getMessage());
+                String msg = "      *" + successNum + "*项目 " + planQuarter.getProjectName() + " 导入失败  <br/>";
+                failureMsg.append(msg);
                 log.error(msg, exc);
             }
         }
         if (failureNum > 0) {
-            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:");
+            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:   <br/>");
             throw new ServiceException(failureMsg.toString());
         } else {
-            successMsg.insert(0, "导入成功!共 " + successNum + " 条。");
+            successMsg.insert(0, "导入成功!共 " + successNum + " 条。<br/>");
         }
         return successMsg.toString();
     }

+ 9 - 10
purchase-system/src/main/java/com/ozs/plan/service/impl/PlanYearsServiceImpl.java

@@ -388,7 +388,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                     ofYear.setPurchaseDeptId(String.valueOf(info.getDeptId()));
                 } else {
                     ++failureNum;
-                    failureMsg.append(failureNum + "、采购单位“" + ofYear.getPurchaseDeptName() + "”不存在");
+                    failureMsg.append(failureNum + "、采购单位“" + ofYear.getPurchaseDeptName() + "”不存在  <br/>");
                 }
                 //机关业务指导处是多选字段
                 StringBuilder zBuilder = new StringBuilder();
@@ -402,14 +402,14 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                                 zBuilder.append(infoTow.getId() + ",");
                             } else {
                                 ++failureNum;
-                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + s + "”不存在");
+                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + s + "”不存在   <br/>");
                             }
                         } else {
                             if (!ObjectUtils.isEmpty(infoTow)) {
                                 zBuilder.append(infoTow.getId());
                             } else {
                                 ++failureNum;
-                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + s + "”不存在");
+                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + s + "”不存在   <br/>");
                             }
                         }
                     }
@@ -426,7 +426,7 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                         zBuilder.append(infoTow.getId());
                     } else {
                         ++failureNum;
-                        failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofYear.getOrganDivision() + "”不存在");
+                        failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofYear.getOrganDivision() + "”不存在   <br/>");
                     }
                 }
                 ofYear.setOrganDivision(zBuilder.toString());
@@ -454,19 +454,18 @@ public class PlanYearsServiceImpl extends ServiceImpl<PlanYearsMapper, PlanYears
                 ofYear.setCreateTime(new Date());
                 planYearsMapper.insertPlanYears(ofYear);
                 successNum++;
-                successMsg.append(successNum + "、项目【" + ofYear.getProjectName() + "】导入成功!");
+                successMsg.append(successNum + "、项目【" + ofYear.getProjectName() + "】导入成功!<br/>");
             } catch (Exception exc) {
-                failureNum++;
-                String msg = successNum + "、项目【" + ofYear.getProjectName() + "】导入失败";
-                failureMsg.append(msg + exc.getMessage());
+                String msg = successNum + "、项目【" + ofYear.getProjectName() + "】导入失败 <br/>";
+                failureMsg.append(msg);
                 log.error(msg, exc);
             }
         }
         if (failureNum > 0) {
-            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:");
+            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:   <br/>");
             throw new ServiceException(failureMsg.toString());
         } else {
-            successMsg.insert(0, "导入成功!共 " + successNum + " 条。");
+            successMsg.insert(0, "导入成功!共 " + successNum + " 条。<br/>");
         }
         return successMsg.toString();
     }

+ 8 - 9
purchase-system/src/main/java/com/ozs/plan/service/impl/ProvisionalPlanServiceImpl.java

@@ -159,14 +159,14 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
                                 zBuilder.append(infoTow.getId() + ",");
                             } else {
                                 ++failureNum;
-                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofProvisionalPlan.getOrganDivision() + "”不存在");
+                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofProvisionalPlan.getOrganDivision() + "”不存在    <br/>");
                             }
                         } else {
                             if (!ObjectUtils.isEmpty(infoTow)) {
                                 zBuilder.append(infoTow.getId());
                             } else {
                                 ++failureNum;
-                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofProvisionalPlan.getOrganDivision() + "”不存在");
+                                failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofProvisionalPlan.getOrganDivision() + "”不存在    <br/>");
                             }
                         }
                     }
@@ -182,7 +182,7 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
                         zBuilder.append(infoTow.getId());
                     } else {
                         ++failureNum;
-                        failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofProvisionalPlan.getOrganDivision() + "”不存在");
+                        failureMsg.append(failureNum + "、机关业务指导处(科)“" + ofProvisionalPlan.getOrganDivision() + "”不存在    <br/>");
                     }
                 }
                 ofProvisionalPlan.setOrganDivision(zBuilder.toString());
@@ -210,20 +210,19 @@ public class ProvisionalPlanServiceImpl extends ServiceImpl<ProvisionalPlanMappe
                 if (!ObjectUtils.isEmpty(ofProvisionalPlan.getPurchaseDeptId()) && !ObjectUtils.isEmpty(ofProvisionalPlan.getOrganDivision())) {
                     provisionalPlanMapper.insert(ofProvisionalPlan);
                     successNum++;
-                    successMsg.append(successNum + "、项目 " + ofProvisionalPlan.getProjectName() + " 导入成功!");
+                    successMsg.append(successNum + "、项目 " + ofProvisionalPlan.getProjectName() + " 导入成功!<br/>");
                 }
             } catch (Exception exc) {
-                failureNum++;
-                String msg = successNum + "、项目 " + ofProvisionalPlan.getProjectName() + " 导入失败;";
-                failureMsg.append(msg + exc.getMessage());
+                String msg = successNum + "、项目 " + ofProvisionalPlan.getProjectName() + " 导入失败; <br/>";
+                failureMsg.append(msg);
                 log.error(msg, exc);
             }
         }
         if (failureNum > 0) {
-            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:");
+            failureMsg.insert(0, "导入失败!共 " + failureNum + " 条数据格式不正确:   <br/>");
             throw new ServiceException(failureMsg.toString());
         } else {
-            successMsg.insert(0, "导入成功!共 " + successNum + " 条。");
+            successMsg.insert(0, "导入成功!共 " + successNum + " 条。<br/>");
         }
         return successMsg.toString();
     }

+ 5 - 5
purchase-system/src/main/java/com/ozs/system/service/impl/SysUserServiceImpl.java

@@ -508,7 +508,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                 SysUser u = userMapper.selectUserByUserName(user.getUserName());
                 if(user.getUserName().equals(PurchaseConfig.getSname())){
                     failureNum++;
-                    failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
+                    failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在    <br/>");
                 }else {
                     if (StringUtils.isNull(u))
                     {
@@ -517,7 +517,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                         user.setCreateBy(operName);
                         this.insertUser(user);
                         successNum++;
-                        successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
+                        successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功<br/>");
                     }
                     else if (isUpdateSupport)
                     {
@@ -532,7 +532,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                     else
                     {
                         failureNum++;
-                        failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
+                        failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在    <br/>");
                     }
                 }
 
@@ -542,7 +542,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             {
                 failureNum++;
                 String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
-                failureMsg.append(msg + e.getMessage());
+                failureMsg.append(msg);
                 log.error(msg, e);
             }
         }
@@ -550,7 +550,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
             throw new ServiceException(failureMsg.toString());
         } else {
-            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
+            successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:<br/>");
         }
         return successMsg.toString();
     }