sucheng 1 год назад
Родитель
Сommit
b4474bfe23

+ 5 - 0
cx-safe-check/cx-save-check-common/pom.xml

@@ -26,6 +26,11 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-freemarker</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>easyexcel</artifactId>
+            <version>3.3.2</version>
+        </dependency>
     </dependencies>
 
 </project>

+ 7 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AspSafetyPerformanceAppraisalDao.java

@@ -0,0 +1,7 @@
+package com.rongwei.sfcommon.sys.dao;
+
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisal;
+import com.rongwei.rwcommon.base.BaseDao;
+
+public interface AspSafetyPerformanceAppraisalDao extends BaseDao<AspSafetyPerformanceAppraisal> {
+}

+ 8 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/dao/AspSafetyPerformanceAppraisalDetailDao.java

@@ -0,0 +1,8 @@
+package com.rongwei.sfcommon.sys.dao;
+
+
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisalDetail;
+import com.rongwei.rwcommon.base.BaseDao;
+
+public interface AspSafetyPerformanceAppraisalDetailDao extends BaseDao<AspSafetyPerformanceAppraisalDetail> {
+}

+ 7 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSafetyPerformanceAppraisalDetailService.java

@@ -0,0 +1,7 @@
+package com.rongwei.sfcommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisalDetail;
+
+public interface AspSafetyPerformanceAppraisalDetailService extends IService<AspSafetyPerformanceAppraisalDetail> {
+}

+ 10 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/AspSafetyPerformanceAppraisalService.java

@@ -0,0 +1,10 @@
+package com.rongwei.sfcommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisal;
+import com.rongwei.rwcommon.base.R;
+import org.springframework.web.multipart.MultipartFile;
+
+public interface AspSafetyPerformanceAppraisalService extends IService<AspSafetyPerformanceAppraisal> {
+    R importFile(MultipartFile file, String type);
+}

+ 18 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyPerformanceAppraisalDetailServiceImpl.java

@@ -0,0 +1,18 @@
+package com.rongwei.sfcommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisal;
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisalDetail;
+import com.rongwei.sfcommon.sys.dao.AspSafetyPerformanceAppraisalDao;
+import com.rongwei.sfcommon.sys.dao.AspSafetyPerformanceAppraisalDetailDao;
+import com.rongwei.sfcommon.sys.service.AspSafetyPerformanceAppraisalDetailService;
+import com.rongwei.sfcommon.sys.service.AspSafetyPerformanceAppraisalService;
+import org.springframework.stereotype.Service;
+
+/**
+ * AspCheckDiscoveryItemServiceImpl class
+ *
+ */
+@Service
+public class AspSafetyPerformanceAppraisalDetailServiceImpl extends ServiceImpl<AspSafetyPerformanceAppraisalDetailDao, AspSafetyPerformanceAppraisalDetail> implements AspSafetyPerformanceAppraisalDetailService {
+}

+ 559 - 0
cx-safe-check/cx-save-check-common/src/main/java/com/rongwei/sfcommon/sys/service/impl/AspSafetyPerformanceAppraisalServiceImpl.java

@@ -0,0 +1,559 @@
+package com.rongwei.sfcommon.sys.service.impl;
+
+import cn.hutool.core.date.DateTime;
+import cn.hutool.core.date.DateUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisal;
+import com.rongwe.scentity.domian.AspSafetyPerformanceAppraisalDetail;
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.rwcommon.utils.SecurityUtil;
+import com.rongwei.safecommon.utils.CXCommonUtils;
+import com.rongwei.sfcommon.sys.dao.AspSafetyPerformanceAppraisalDao;
+import com.rongwei.sfcommon.sys.service.AspSafetyPerformanceAppraisalDetailService;
+import com.rongwei.sfcommon.sys.service.AspSafetyPerformanceAppraisalService;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+
+@Service
+@Transactional
+public class AspSafetyPerformanceAppraisalServiceImpl extends ServiceImpl<AspSafetyPerformanceAppraisalDao, AspSafetyPerformanceAppraisal> implements AspSafetyPerformanceAppraisalService {
+    @Autowired
+    private AspSafetyPerformanceAppraisalDetailService aspSafetyPerformanceAppraisalDetailService;
+
+
+    @Override
+    public R importFile(MultipartFile file, String type) {
+        try {
+            Sheet sheet = new XSSFWorkbook(file.getInputStream()).getSheetAt(0);
+            int lastRowNum = sheet.getLastRowNum();
+            String fileName = file.getOriginalFilename().replace(".xlsx", "").replace(".xls", "");
+            //判断多行表头是否有问题
+            //跳过第0行,开始分析第1行
+            Row row1 = sheet.getRow(1);
+            String name1 = row1.getCell(0) == null ? "" : row1.getCell(0).toString().trim();
+            if (!name1.equals("车间名称")) {
+                return R.error("第2行,第1列,表头模板有误!");
+            }
+            String name2 = row1.getCell(1) == null ? "" : row1.getCell(1).toString().trim();
+            if (!name2.equals("车间人数")) {
+                return R.error("第2行,第2列,表头模板有误!");
+            }
+            String name3 = row1.getCell(2) == null ? "" : row1.getCell(2).toString().trim();
+            if (!name3.equals("集团公司安全监管(20分)")) {
+                return R.error("第2行,第3列,表头模板有误!");
+            }
+            String name4 = row1.getCell(8) == null ? "" : row1.getCell(8).toString().trim();
+            if (!name4.equals("公司内部安全监管(10分)")) {
+                return R.error("第2行,第9列,表头模板有误!");
+            }
+            String name5 = row1.getCell(14) == null ? "" : row1.getCell(14).toString().trim();
+            if (!name5.equals("车间自我安全管理(10分)")) {
+                return R.error("第2行,第15列,表头模板有误!");
+            }
+            String name6 = row1.getCell(17) == null ? "" : row1.getCell(17).toString().trim();
+            if (!name6.equals("工伤管理(50分)")) {
+                return R.error("第2行,第18列,表头模板有误!");
+            }
+            String name7 = row1.getCell(22) == null ? "" : row1.getCell(22).toString().trim();
+            if (!name7.equals("车间、部门安全工作配合情况")) {
+                return R.error("第2行,第23列,表头模板有误!");
+            }
+            String name8 = row1.getCell(26) == null ? "" : row1.getCell(26).toString().trim();
+            if (!name8.equals("扣分合计")) {
+                return R.error("第2行,第27列,表头模板有误!");
+            }
+            String name9 = row1.getCell(27) == null ? "" : row1.getCell(27).toString().trim();
+            if (!name9.equals("车间名称")) {
+                return R.error("第2行,第28列,表头模板有误!");
+            }
+            String name10 = row1.getCell(28) == null ? "" : row1.getCell(28).toString().trim();
+            if (!name10.equals("车间人数")) {
+                return R.error("第2行,第29列,表头模板有误!");
+            }
+            String name11 = row1.getCell(29) == null ? "" : row1.getCell(29).toString().trim();
+            if (!name11.equals("加分项")) {
+                return R.error("第2行,第29列,表头模板有误!");
+            }
+            String name12 = row1.getCell(35) == null ? "" : row1.getCell(35).toString().trim();
+            if (!name12.equals("加分合计")) {
+                return R.error("第2行,第36列,表头模板有误!");
+            }
+            String name13 = row1.getCell(36) == null ? "" : row1.getCell(36).toString().trim();
+            if (!name13.equals("综合得分情况")) {
+                return R.error("第2行,第37列,表头模板有误!");
+            }
+            //分析第2行
+            Row row2 = sheet.getRow(2);
+            String name14 = row2.getCell(2) == null ? "" : row2.getCell(2).toString().trim();
+            if (!name14.equals("第三方或执法检查")) {
+                return R.error("第3行,第3列,表头模板有误!");
+            }
+            String name15 = row2.getCell(3) == null ? "" : row2.getCell(3).toString().trim();
+            if (!name15.equals("集团月度检查隐患条数")) {
+                return R.error("第3行,第4列,表头模板有误!");
+            }
+            String name16 = row2.getCell(4) == null ? "" : row2.getCell(4).toString().trim();
+            if (!name16.equals("集团季度综合检查隐患条数")) {
+                return R.error("第3行,第5列,表头模板有误!");
+            }
+            String name17 = row2.getCell(5) == null ? "" : row2.getCell(5).toString().trim();
+            if (!name17.equals("监控/集团安环部现场检查隐患条数")) {
+                return R.error("第3行,第6列,表头模板有误!");
+            }
+            String name18 = row2.getCell(6) == null ? "" : row2.getCell(6).toString().trim();
+            if (!name18.equals("考试或提问不合格人数")) {
+                return R.error("第3行,第7列,表头模板有误!");
+            }
+            String name19 = row2.getCell(7) == null ? "" : row2.getCell(7).toString().trim();
+            if (!name19.equals("集团考核通报(50元/扣0.5分)")) {
+                return R.error("第3行,第8列,表头模板有误!");
+            }
+            String name20 = row2.getCell(8) == null ? "" : row2.getCell(8).toString().trim();
+            if (!name20.equals("月度安全检查")) {
+                return R.error("第3行,第9列,表头模板有误!");
+            }
+            String name21 = row2.getCell(9) == null ? "" : row2.getCell(9).toString().trim();
+            if (!name21.equals("安全部日常巡查条数")) {
+                return R.error("第3行,第10列,表头模板有误!");
+            }
+            String name22 = row2.getCell(10) == null ? "" : row2.getCell(10).toString().trim();
+            if (!name22.equals("复查整改率")) {
+                return R.error("第3行,第11列,表头模板有误!");
+            }
+            String name23 = row2.getCell(11) == null ? "" : row2.getCell(11).toString().trim();
+            if (!name23.equals("车间员工违章率(违章次数/车间总人数)")) {
+                return R.error("第3行,第12列,表头模板有误!");
+            }
+            String name24 = row2.getCell(13) == null ? "" : row2.getCell(13).toString().trim();
+            if (!name24.equals("公司考核通报(50元/扣0.5分)")) {
+                return R.error("第3行,第14列,表头模板有误!");
+            }
+            String name25 = row2.getCell(14) == null ? "" : row2.getCell(14).toString().trim();
+            if (!name25.equals("公司对车间提问合格率")) {
+                return R.error("第3行,第15列,表头模板有误!");
+            }
+            String name26 = row2.getCell(15) == null ? "" : row2.getCell(15).toString().trim();
+            if (!name26.equals("车间自查违章率")) {
+                return R.error("第3行,第16列,表头模板有误!");
+            }
+            String name27 = row2.getCell(16) == null ? "" : row2.getCell(16).toString().trim();
+            if (!name27.equals("车间级隐患排查条数")) {
+                return R.error("第3行,第17列,表头模板有误!");
+            }
+            String name28 = row2.getCell(17) == null ? "" : row2.getCell(17).toString().trim();
+            if (!name28.equals("安全事件或未遂事件起数")) {
+                return R.error("第3行,第18列,表头模板有误!");
+            }
+            String name29 = row2.getCell(18) == null ? "" : row2.getCell(18).toString().trim();
+            if (!name29.equals("费用(元)")) {
+                return R.error("第3行,第19列,表头模板有误!");
+            }
+            String name30 = row2.getCell(19) == null ? "" : row2.getCell(19).toString().trim();
+            if (!name30.equals("工伤事故起数")) {
+                return R.error("第3行,第20列,表头模板有误!");
+            }
+            String name31 = row2.getCell(20) == null ? "" : row2.getCell(20).toString().trim();
+            if (!name31.equals("费用(元)")) {
+                return R.error("第3行,第21列,表头模板有误!");
+            }
+            String name32 = row2.getCell(21) == null ? "" : row2.getCell(21).toString().trim();
+            if (!name32.equals("千人工伤率(‰)")) {
+                return R.error("第3行,第22列,表头模板有误!");
+            }
+            String name33 = row2.getCell(22) == null ? "" : row2.getCell(22).toString().trim();
+            if (!name33.equals("专项开展不到位、不及时、效果不佳情况")) {
+                return R.error("第3行,第23列,表头模板有误!");
+            }
+            String name34 = row2.getCell(24) == null ? "" : row2.getCell(24).toString().trim();
+            if (!name34.equals("车间、部门上交的资料质量差、标准低情况")) {
+                return R.error("第3行,第25列,表头模板有误!");
+            }
+            String name35 = row2.getCell(29) == null ? "" : row2.getCell(29).toString().trim();
+            if (!name35.equals("车间自行组织预防安全培训、活动等/次数")) {
+                return R.error("第3行,第30列,表头模板有误!");
+            }
+            String name36 = row2.getCell(31) == null ? "" : row2.getCell(31).toString().trim();
+            if (!name36.equals("迎接外部检查无隐患问题/次数")) {
+                return R.error("第3行,第32列,表头模板有误!");
+            }
+            String name37 = row2.getCell(33) == null ? "" : row2.getCell(33).toString().trim();
+            if (!name37.equals("车间、部门承接公司安全活动次数")) {
+                return R.error("第3行,第34列,表头模板有误!");
+            }
+            //分析第3行
+            Row row3 = sheet.getRow(3);
+            String name38 = row3.getCell(11) == null ? "" : row3.getCell(11).toString().trim();
+            if (!name38.equals("违章考核起数")) {
+                return R.error("第4行,第12列,表头模板有误!");
+            }
+            String name39 = row3.getCell(12) == null ? "" : row3.getCell(12).toString().trim();
+            if (!name39.equals("人员违章率")) {
+                return R.error("第4行,第13列,表头模板有误!");
+            }
+            //================表头分析结束================
+
+
+            //主表保存
+            AspSafetyPerformanceAppraisal main = new AspSafetyPerformanceAppraisal();
+            String id = SecurityUtil.getUUID();
+            SysUserVo currentUser = CXCommonUtils.getCurrentUser();
+            DateTime date = DateUtil.date();
+            main.setId(id);
+            main.setName(fileName);
+            main.setType(type);
+            main.setCreateusername(currentUser.getName());
+            main.setCreateuserid(currentUser.getId());
+            main.setModifyusername(currentUser.getName());
+            main.setModifyuserid(currentUser.getId());
+            main.setCreatedate(date);
+            main.setModifydate(date);
+            //获取当前用户的tenantId
+//            main.setTenantid(currentUser.getTenantid());
+            main.setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+            this.save(main);
+
+            List<AspSafetyPerformanceAppraisalDetail> res = new ArrayList<>();
+            for (int i = 4; i <= lastRowNum; i++) {
+                AspSafetyPerformanceAppraisalDetail detail = new AspSafetyPerformanceAppraisalDetail();
+                Row row = sheet.getRow(i);
+                if (ObjectUtil.isEmpty(row)) {
+                    continue;
+                }
+                //遍历所有数据,组装进入detail,最终进入res
+                //判断行数为奇数还是偶数
+                if (i % 2 == 0) {
+                    String departname = row.getCell(0) == null ? "" : row.getCell(0).toString().trim();
+                    String departpeople = row.getCell(1) == null ? "" : row.getCell(1).toString().trim();
+                    String otherinspection = row.getCell(2) == null ? "" : row.getCell(2).toString().trim();
+                    String monthlyinspection = row.getCell(3) == null ? "" : row.getCell(3).toString().trim();
+                    String quarterlyinspection = row.getCell(4) == null ? "" : row.getCell(4).toString().trim();
+                    String onstieinspection = row.getCell(5) == null ? "" : row.getCell(5).toString().trim();
+                    String faildpeople = row.getCell(6) == null ? "" : row.getCell(6).toString().trim();
+                    String assessmentreport = row.getCell(7) == null ? "" : row.getCell(7).toString().trim();
+                    String monthlysafetyinspection = row.getCell(8) == null ? "" : row.getCell(8).toString().trim();
+                    String dailyinspection = row.getCell(9) == null ? "" : row.getCell(9).toString().trim();
+                    String reviewrate = row.getCell(10) == null ? "" : row.getCell(10).toString().trim();
+                    String violationassessment = row.getCell(11) == null ? "" : row.getCell(11).toString().trim();
+                    String personnelviolationrate = row.getCell(12) == null ? "" : row.getCell(12).toString().trim();
+                    String commpanyassessmentreport = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
+                    String rateforworkshopquestion = row.getCell(14) == null ? "" : row.getCell(14).toString().trim();
+                    String workshopselfrate = row.getCell(15) == null ? "" : row.getCell(15).toString().trim();
+                    String numberofworkshoplevel = row.getCell(16) == null ? "" : row.getCell(16).toString().trim();
+                    String numberofsafetyincident = row.getCell(17) == null ? "" : row.getCell(17).toString().trim();
+                    String cost1 = row.getCell(18) == null ? "" : row.getCell(18).toString().trim();
+                    String numberofaccident = row.getCell(19) == null ? "" : row.getCell(19).toString().trim();
+                    String cost2 = row.getCell(20) == null ? "" : row.getCell(20).toString().trim();
+                    String thousandartificialinjuryrate = row.getCell(21) == null ? "" : row.getCell(21).toString().trim();
+                    String numberofspecialproject = row.getCell(22) == null ? "" : row.getCell(22).toString().trim();
+                    String numberofbadmatterials = row.getCell(24) == null ? "" : row.getCell(24).toString().trim();
+                    String totaldeductionpoints = row.getCell(26) == null ? "" : row.getCell(26).toString().trim();
+                    String trainingbyself = row.getCell(29) == null ? "" : row.getCell(29).toString().trim();
+                    String trainingbyout = row.getCell(31) == null ? "" : row.getCell(31).toString().trim();
+                    String trainingbycompany = row.getCell(33) == null ? "" : row.getCell(33).toString().trim();
+                    String totalbonuspoints = row.getCell(35) == null ? "" : row.getCell(35).toString().trim();
+                    String totalscore = row.getCell(36) == null ? "" : row.getCell(36).toString().trim();
+
+                    if (ObjectUtil.isEmpty(departname)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(departpeople)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(otherinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(monthlyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(quarterlyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(onstieinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(faildpeople)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(assessmentreport)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(monthlysafetyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(dailyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(reviewrate)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(violationassessment)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(personnelviolationrate)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(commpanyassessmentreport)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(rateforworkshopquestion)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(workshopselfrate)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofworkshoplevel)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofsafetyincident)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(cost1)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofaccident)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(cost2)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(thousandartificialinjuryrate)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofspecialproject)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofbadmatterials)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(totaldeductionpoints)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(trainingbyself)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(trainingbyout)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(trainingbycompany)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(totalbonuspoints)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(totalscore)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+
+                    detail.setDepartname(departname);
+                    detail.setDepartpeople(departpeople);
+                    detail.setOtherinspection(otherinspection);
+                    detail.setMonthlyinspection(monthlyinspection);
+                    detail.setQuarterlyinspection(quarterlyinspection);
+                    detail.setOnstieinspection(onstieinspection);
+                    detail.setFaildpeople(faildpeople);
+                    detail.setAssessmentreport(assessmentreport);
+                    detail.setMonthlysafetyinspection(monthlysafetyinspection);
+                    detail.setDailyinspection(dailyinspection);
+                    detail.setReviewrate(reviewrate);
+                    detail.setViolationassessment(violationassessment);
+                    detail.setPersonnelviolationrate(personnelviolationrate);
+//                    detail.setViolationscore(violationscore);
+                    detail.setCommpanyassessmentreport(commpanyassessmentreport);
+                    detail.setRateforworkshopquestion(rateforworkshopquestion);
+                    detail.setWorkshopselfrate(workshopselfrate);
+                    detail.setNumberofworkshoplevel(numberofworkshoplevel);
+                    detail.setNumberofsafetyincident(numberofsafetyincident);
+                    detail.setCost1(cost1);
+//                    detail.setScore1(score1);
+                    detail.setNumberofaccident(numberofaccident);
+                    detail.setCost2(cost2);
+//                    detail.setScore2(score2);
+                    detail.setThousandartificialinjuryrate(thousandartificialinjuryrate);
+                    detail.setNumberofspecialproject(numberofspecialproject);
+                    detail.setNumberofbadmatterials(numberofbadmatterials);
+                    detail.setTotaldeductionpoints(totaldeductionpoints);
+                    detail.setTrainingbyself(trainingbyself);
+                    detail.setTrainingbyout(trainingbyout);
+                    detail.setTrainingbycompany(trainingbycompany);
+                    detail.setTotalbonuspoints(totalbonuspoints);
+                    detail.setTotalscore(totalscore);
+                    detail.setType(((i / 2) - 1) + ".1");
+                    detail.setMainid(id);
+                    detail.setId(SecurityUtil.getUUID());
+
+                    detail.setCreateusername(currentUser.getName());
+                    detail.setCreateuserid(currentUser.getId());
+                    detail.setModifyusername(currentUser.getName());
+                    detail.setModifyuserid(currentUser.getId());
+                    detail.setCreatedate(date);
+                    detail.setModifydate(date);
+                    //获取当前用户的tenantId
+//                  detail.setTenantid(currentUser.getTenantid());
+                    detail.setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+
+                    res.add(detail);
+                } else {
+                    String otherinspection = row.getCell(2) == null ? "" : row.getCell(2).toString().trim();
+                    String monthlyinspection = row.getCell(3) == null ? "" : row.getCell(3).toString().trim();
+                    String quarterlyinspection = row.getCell(4) == null ? "" : row.getCell(4).toString().trim();
+                    String onstieinspection = row.getCell(5) == null ? "" : row.getCell(5).toString().trim();
+                    String faildpeople = row.getCell(6) == null ? "" : row.getCell(6).toString().trim();
+                    String assessmentreport = row.getCell(7) == null ? "" : row.getCell(7).toString().trim();
+                    String monthlysafetyinspection = row.getCell(8) == null ? "" : row.getCell(8).toString().trim();
+                    String dailyinspection = row.getCell(9) == null ? "" : row.getCell(9).toString().trim();
+                    String reviewrate = row.getCell(10) == null ? "" : row.getCell(10).toString().trim();
+                    String violationscore = row.getCell(11) == null ? "" : row.getCell(11).toString().trim();
+                    String commpanyassessmentreport = row.getCell(13) == null ? "" : row.getCell(13).toString().trim();
+                    String rateforworkshopquestion = row.getCell(14) == null ? "" : row.getCell(14).toString().trim();
+                    String workshopselfrate = row.getCell(15) == null ? "" : row.getCell(15).toString().trim();
+                    String numberofworkshoplevel = row.getCell(16) == null ? "" : row.getCell(16).toString().trim();
+                    String score1 = row.getCell(17) == null ? "" : row.getCell(17).toString().trim();
+                    String score2 = row.getCell(19) == null ? "" : row.getCell(19).toString().trim();
+                    String thousandartificialinjuryrate = row.getCell(21) == null ? "" : row.getCell(21).toString().trim();
+                    String numberofspecialproject = row.getCell(22) == null ? "" : row.getCell(22).toString().trim();
+                    String numberofbadmatterials = row.getCell(24) == null ? "" : row.getCell(24).toString().trim();
+//                    String totaldeductionpoints = row.getCell(26) == null ? "" : row.getCell(26).toString().trim();
+                    String trainingbyself = row.getCell(29) == null ? "" : row.getCell(29).toString().trim();
+                    String trainingbyout = row.getCell(31) == null ? "" : row.getCell(31).toString().trim();
+                    String trainingbycompany = row.getCell(33) == null ? "" : row.getCell(33).toString().trim();
+//                    String totalbonuspoints = row.getCell(35) == null ? "" : row.getCell(35).toString().trim();
+//                    String totalscore = row.getCell(36) == null ? "" : row.getCell(36).toString().trim();
+
+                    if (ObjectUtil.isEmpty(otherinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(monthlyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(quarterlyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(onstieinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(faildpeople)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(assessmentreport)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(monthlysafetyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(dailyinspection)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(reviewrate)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(violationscore)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(commpanyassessmentreport)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(rateforworkshopquestion)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(workshopselfrate)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofworkshoplevel)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(score1)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(score2)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(thousandartificialinjuryrate)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofspecialproject)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(numberofbadmatterials)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(trainingbyself)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(trainingbyout)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+                    if (ObjectUtil.isEmpty(trainingbycompany)) {
+                        return R.error("第" + (i + 1) + "行数据存在空值,请检查表格!");
+                    }
+
+
+//                    detail.setDepartname(departname);
+//                    detail.setDepartpeople(departpeople);
+                    detail.setOtherinspection(otherinspection);
+                    detail.setMonthlyinspection(monthlyinspection);
+                    detail.setQuarterlyinspection(quarterlyinspection);
+                    detail.setOnstieinspection(onstieinspection);
+                    detail.setFaildpeople(faildpeople);
+                    detail.setAssessmentreport(assessmentreport);
+                    detail.setMonthlysafetyinspection(monthlysafetyinspection);
+                    detail.setDailyinspection(dailyinspection);
+                    detail.setReviewrate(reviewrate);
+//                    detail.setViolationassessment(violationassessment);
+//                    detail.setPersonnelviolationrate(personnelviolationrate);
+                    detail.setViolationscore(violationscore);
+                    detail.setCommpanyassessmentreport(commpanyassessmentreport);
+                    detail.setRateforworkshopquestion(rateforworkshopquestion);
+                    detail.setWorkshopselfrate(workshopselfrate);
+                    detail.setNumberofworkshoplevel(numberofworkshoplevel);
+//                    detail.setNumberofsafetyincident(numberofsafetyincident);
+//                    detail.setCost1(cost1);
+                    detail.setScore1(score1);
+//                    detail.setNumberofaccident(numberofaccident);
+//                    detail.setCost2(cost2);
+                    detail.setScore2(score2);
+                    detail.setThousandartificialinjuryrate(thousandartificialinjuryrate);
+                    detail.setNumberofspecialproject(numberofspecialproject);
+                    detail.setNumberofbadmatterials(numberofbadmatterials);
+                    detail.setTrainingbyself(trainingbyself);
+                    detail.setTrainingbyout(trainingbyout);
+                    detail.setTrainingbycompany(trainingbycompany);
+                    detail.setType(((i / 2) - 1) + ".2");
+                    detail.setMainid(id);
+                    detail.setId(SecurityUtil.getUUID());
+
+                    detail.setCreateusername(currentUser.getName());
+                    detail.setCreateuserid(currentUser.getId());
+                    detail.setModifyusername(currentUser.getName());
+                    detail.setModifyuserid(currentUser.getId());
+                    detail.setCreatedate(date);
+                    detail.setModifydate(date);
+                    //获取当前用户的tenantId
+//                  detail.setTenantid(currentUser.getTenantid());
+                    detail.setTenantid(currentUser.getOrganizationDoList().get(0).getFullpid().split(",")[1]);
+
+                    res.add(detail);
+                }
+
+
+            }
+            if (res.size() > 0) {
+                aspSafetyPerformanceAppraisalDetailService.saveBatch(res);
+            }
+        } catch (IOException e) {
+            R.error("绩效考核导入异常");
+        }
+        return R.ok();
+    }
+}

+ 79 - 0
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSafetyPerformanceAppraisal.java

@@ -0,0 +1,79 @@
+package com.rongwe.scentity.domian;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * asp_safety_performance_appraisal
+ * @author 
+ */
+@Data
+public class AspSafetyPerformanceAppraisal implements Serializable {
+    /**
+     * 主键
+     */
+    private String id;
+
+    /**
+     * 租户ID
+     */
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     */
+    private String roption;
+
+    /**
+     * 是否删除Y/N
+     */
+    private String deleted;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 创建时间
+     */
+    private Date createdate;
+
+    /**
+     * 创建用户ID
+     */
+    private String createuserid;
+
+    /**
+     * 修改日期
+     */
+    private Date modifydate;
+
+    /**
+     * 修改用户ID
+     */
+    private String modifyuserid;
+
+    /**
+     * 创建人名称
+     */
+    private String createusername;
+
+    /**
+     * 修改人名称
+     */
+    private String modifyusername;
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 类型
+     */
+    private String type;
+
+    private static final long serialVersionUID = 1L;
+}

+ 244 - 0
cx-safe-check/cx-save-check-entity/src/main/java/com/rongwe/scentity/domian/AspSafetyPerformanceAppraisalDetail.java

@@ -0,0 +1,244 @@
+package com.rongwe.scentity.domian;
+
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * asp_safety_performance_appraisal_detail
+ * @author 
+ */
+@Data
+public class AspSafetyPerformanceAppraisalDetail implements Serializable {
+    /**
+     * 主键
+     */
+    private String id;
+
+    /**
+     * 租户ID
+     */
+    private String tenantid;
+
+    /**
+     * 扩展json格式配置
+     */
+    private String roption;
+
+    /**
+     * 是否删除Y/N
+     */
+    private String deleted;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 创建时间
+     */
+    private Date createdate;
+
+    /**
+     * 创建用户ID
+     */
+    private String createuserid;
+
+    /**
+     * 修改日期
+     */
+    private Date modifydate;
+
+    /**
+     * 修改用户ID
+     */
+    private String modifyuserid;
+
+    /**
+     * 创建人名称
+     */
+    private String createusername;
+
+    /**
+     * 修改人名称
+     */
+    private String modifyusername;
+
+    /**
+     * 主表ID
+     */
+    private String mainid;
+
+    /**
+     * 车间名称
+     */
+    private String departname;
+
+    /**
+     * 车间人数
+     */
+    private String departpeople;
+
+    /**
+     * 第三方或执法检查
+     */
+    private String otherinspection;
+
+    /**
+     * 集团月度检查隐患条数
+     */
+    private String monthlyinspection;
+
+    /**
+     * 集团季度综合检查隐患条数
+     */
+    private String quarterlyinspection;
+
+    /**
+     * 监控/集团安环部现场检查隐患条数
+     */
+    private String onstieinspection;
+
+    /**
+     * 考试或提问不合格人数
+     */
+    private String faildpeople;
+
+    /**
+     * 集团考核通报(50元/扣0.5分)
+     */
+    private String assessmentreport;
+
+    /**
+     * 月度安全检查
+     */
+    private String monthlysafetyinspection;
+
+    /**
+     * 安全部日常巡查条数
+     */
+    private String dailyinspection;
+
+    /**
+     * 复查整改率
+     */
+    private String reviewrate;
+
+    /**
+     * 违章考核起数
+     */
+    private String violationassessment;
+
+    /**
+     * 人员违章率
+     */
+    private String personnelviolationrate;
+
+    /**
+     * 车间员工违章扣分数
+     */
+    private String violationscore;
+
+    /**
+     * 公司考核通报(50元/扣0.5分)
+     */
+    private String commpanyassessmentreport;
+
+    /**
+     * 公司对车间提问合格率
+     */
+    private String rateforworkshopquestion;
+
+    /**
+     * 车间自查违章率
+     */
+    private String workshopselfrate;
+
+    /**
+     * 车间级隐患排查条数
+     */
+    private String numberofworkshoplevel;
+
+    /**
+     * 安全事件或未遂事件起数
+     */
+    private String numberofsafetyincident;
+
+    /**
+     * 费用(元)
+     */
+    private String cost1;
+
+    /**
+     * 工伤管理扣分数1
+     */
+    private String score1;
+
+    /**
+     * 工伤事故起数
+     */
+    private String numberofaccident;
+
+    /**
+     * 费用(元)
+     */
+    private String cost2;
+
+    /**
+     * 工伤管理扣分数2
+     */
+    private String score2;
+
+    /**
+     * 千人工伤率(‰)
+     */
+    private String thousandartificialinjuryrate;
+
+    /**
+     * 专项开展不到位、不及时、效果不佳情况
+     */
+    private String numberofspecialproject;
+
+    /**
+     * 车间、部门上交的资料质量差、标准低情况
+     */
+    private String numberofbadmatterials;
+
+    /**
+     * 扣分合计
+     */
+    private String totaldeductionpoints;
+
+    /**
+     * 车间自行组织预防安全培训、活动等/次数
+     */
+    private String trainingbyself;
+
+    /**
+     * 迎接外部检查无隐患问题/次数
+     */
+    private String trainingbyout;
+
+    /**
+     * 车间、部门承接公司安全活动次数
+     */
+    private String trainingbycompany;
+
+    /**
+     * 加分合计
+     */
+    private String totalbonuspoints;
+
+    /**
+     * 综合得分情况
+     */
+    private String totalscore;
+
+    /**
+     * 类型(用于排序和展示,1.1,1.2;2.1,2.2...,x.1代表导入表的明细,x.2代表导入表的分数明细,1.1和1.2两两不可分割)
+     */
+    private String type;
+
+    private static final long serialVersionUID = 1L;
+}

+ 38 - 0
cx-safe-check/cx-save-check-server/src/main/java/com/rongwei/savecheck/controller/AspSafetyPerformanceAppraisalController.java

@@ -0,0 +1,38 @@
+package com.rongwei.savecheck.controller;
+
+import com.rongwei.rwcommon.base.R;
+import com.rongwei.sfcommon.sys.service.AspSafetyPerformanceAppraisalService;
+import com.rongwei.sfcommon.sys.service.CheckItemsService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("aspSafetyPerformance")
+@Slf4j
+public class AspSafetyPerformanceAppraisalController {
+
+    @Autowired
+    private AspSafetyPerformanceAppraisalService aspSafetyPerformanceAppraisalService;
+
+    /**
+     * 导入安全绩效考核
+     *
+     * @return
+     */
+    @RequestMapping("/importFile")
+    @ResponseBody
+    public R importFile(@RequestParam MultipartFile file, HttpServletRequest request, @RequestParam String type) throws Exception {
+        if (file == null) {
+            return R.error("文件解析失败");
+        }
+        return aspSafetyPerformanceAppraisalService.importFile(file, type);
+    }
+
+}