|
@@ -13,12 +13,15 @@ import com.ruoyi.framework.config.RuoYiConfig;
|
|
|
import com.ruoyi.project.common.domain.DataEntity;
|
|
|
import com.ruoyi.project.common.domain.TCommonfile;
|
|
|
import com.ruoyi.project.common.service.ITCommonfileService;
|
|
|
+import com.ruoyi.project.process.controller.export.PermanentMoc;
|
|
|
import com.ruoyi.project.process.controller.vo.*;
|
|
|
import com.ruoyi.project.process.mapper.TMocMapper;
|
|
|
import com.ruoyi.project.system.domain.SysDept;
|
|
|
import com.ruoyi.project.system.domain.SysDictData;
|
|
|
+import com.ruoyi.project.system.domain.SysUser;
|
|
|
import com.ruoyi.project.system.service.ISysDeptService;
|
|
|
import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
|
+import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import com.ruoyi.project.training.domain.TTraining;
|
|
|
import com.ruoyi.project.training.service.ITTrainingService;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
@@ -51,6 +54,9 @@ public class TMocController extends BaseController
|
|
|
@Autowired
|
|
|
private ITMocService tMocService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService userService;
|
|
|
+
|
|
|
@Autowired
|
|
|
private ISysDictTypeService iSysDictTypeService;
|
|
|
|
|
@@ -66,6 +72,239 @@ public class TMocController extends BaseController
|
|
|
@Autowired
|
|
|
private ITCommonfileService commonfileService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 导出永久MOC
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('process:moc:export')")
|
|
|
+ @GetMapping("/exportpermanent")
|
|
|
+ public AjaxResult exportPermanentMoc(TMoc tMoc)
|
|
|
+ {
|
|
|
+ // 当前用户归属部门
|
|
|
+ Long deptId = userService.selectUserById(getUserId()).getDeptId();
|
|
|
+ // 查询条件
|
|
|
+ // 1. 数据归属部门=当前用户归属部门
|
|
|
+ tMoc.setDeptId(deptId);
|
|
|
+ // 2. 时效性=永久
|
|
|
+ tMoc.setTimeliness("1");
|
|
|
+ // 查询总表数据
|
|
|
+ List<TMoc> mocList = tMocService.selectTMocList(tMoc);
|
|
|
+ // 永久MOC数据
|
|
|
+ List<PermanentMoc> permanentMocList = new ArrayList<PermanentMoc>();
|
|
|
+ //字典查询
|
|
|
+ List<SysDictData> mocAreaDict = iSysDictTypeService.selectDictDataByType("MOC_AREA");
|
|
|
+ List<SysDictData> mocTypeDict = iSysDictTypeService.selectDictDataByType("MOC_TYPE");
|
|
|
+ List<SysDictData> mcDetailDict = iSysDictTypeService.selectDictDataByType("MC_DETAIL");
|
|
|
+ List<SysDictData> yesNoEnDict = iSysDictTypeService.selectDictDataByType("YES_NO_EN");
|
|
|
+ // 遍历总表数据,插入永久MOC表
|
|
|
+ for (TMoc moc : mocList) {
|
|
|
+ PermanentMoc permanentMoc = new PermanentMoc();
|
|
|
+ permanentMoc.setMocNo(moc.getMocNo());
|
|
|
+ permanentMoc.setCompanyMocNo(moc.getCompanyMocNo());
|
|
|
+ permanentMoc.setProjectNo(moc.getProjectNo());
|
|
|
+ for (SysDictData sysDictData : mocAreaDict) {
|
|
|
+ System.out.println("sysDictData.getDictValue():" + sysDictData.getDictValue());
|
|
|
+ System.out.println("permanentMoc.getArea():" + permanentMoc.getArea());
|
|
|
+ System.out.println("比对结果:" + sysDictData.getDictValue().equals(permanentMoc.getArea()));
|
|
|
+ if (sysDictData.getDictValue().equals(moc.getArea())) {
|
|
|
+ permanentMoc.setArea(sysDictData.getDictLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ permanentMoc.setTitle(moc.getTitle());
|
|
|
+ for (SysDictData sysDictData : mocTypeDict) {
|
|
|
+ if (sysDictData.getDictValue().equals(moc.getMocType())) {
|
|
|
+ permanentMoc.setMocType(sysDictData.getDictLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ permanentMoc.setOwner(moc.getOwner());
|
|
|
+ permanentMoc.setApproveTime(moc.getApproveTime());
|
|
|
+ permanentMoc.setMcTime(moc.getMcTime());
|
|
|
+ for (SysDictData sysDictData : mcDetailDict) {
|
|
|
+ if (sysDictData.getDictValue().equals(moc.getMcDetail())) {
|
|
|
+ permanentMoc.setMcDetail(sysDictData.getDictLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ permanentMoc.setRemarks(moc.getRemarks());
|
|
|
+ permanentMoc.setRiskLevel(moc.getRiskLevel());
|
|
|
+ permanentMoc.setEhsCheck(moc.getEhsCheck());
|
|
|
+ permanentMoc.setTraining(moc.getTraining());
|
|
|
+ for (SysDictData sysDictData : yesNoEnDict) {
|
|
|
+ if (sysDictData.getDictValue().equals(moc.getSopUpdate())) {
|
|
|
+ permanentMoc.setSopUpdate(sysDictData.getDictLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (SysDictData sysDictData : yesNoEnDict) {
|
|
|
+ if (sysDictData.getDictValue().equals(moc.getPidMaster())) {
|
|
|
+ permanentMoc.setPidMaster(sysDictData.getDictLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (SysDictData sysDictData : yesNoEnDict) {
|
|
|
+ if (sysDictData.getDictValue().equals(moc.getDocUpdate())) {
|
|
|
+ permanentMoc.setDocUpdate(sysDictData.getDictLabel());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ permanentMoc.setPssr(moc.getPssr());
|
|
|
+ permanentMoc.setPssrNo(moc.getPssrNo());
|
|
|
+ permanentMocList.add(permanentMoc);
|
|
|
+ }
|
|
|
+ ExcelUtil<PermanentMoc> util = new ExcelUtil<PermanentMoc>(PermanentMoc.class);
|
|
|
+ return util.exportExcel(permanentMocList, "永久MOC");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量导入MOC管理
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('process:moc:add')")
|
|
|
+ @PostMapping("/importData")
|
|
|
+ public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException
|
|
|
+ {
|
|
|
+ //获取操作人员ID
|
|
|
+ Long userId = getUserId();
|
|
|
+ //报错行数统计
|
|
|
+ List<Integer> failRow =new ArrayList<Integer>();
|
|
|
+ Workbook workbook = ExcelUtils.getWorkBook(file);
|
|
|
+ Sheet sheet = workbook.getSheetAt(0);
|
|
|
+ List<TMoc> list = new ArrayList<TMoc>();
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ //字典查询
|
|
|
+ List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
|
|
|
+ List<SysDictData> state = iSysDictTypeService.selectDictDataByType("MOC_STATE");
|
|
|
+ List<SysDictData> change = iSysDictTypeService.selectDictDataByType("MOC_CHANGE");
|
|
|
+ List<SysDictData> risklevel = iSysDictTypeService.selectDictDataByType("MOC_RISKLEVEL");
|
|
|
+ List<SysDictData> area = iSysDictTypeService.selectDictDataByType("MOC_AREA");
|
|
|
+ List<SysDictData> temporarystate = iSysDictTypeService.selectDictDataByType("MOC_TEMPORARYSTATE");
|
|
|
+ List<SysDictData> yesno = iSysDictTypeService.selectDictDataByType("YES_NO");
|
|
|
+ //部门查询
|
|
|
+ List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
|
|
|
+ int rowNum = sheet.getPhysicalNumberOfRows();
|
|
|
+ int failNumber = 0;
|
|
|
+ for (int i = 1; i < rowNum; i++) {
|
|
|
+ try {
|
|
|
+ logger.info("读取行数:" + i);
|
|
|
+ Row row = sheet.getRow(i);
|
|
|
+ int cellNum = row.getPhysicalNumberOfCells();
|
|
|
+ TMoc entity = new TMoc();
|
|
|
+ for (int j = 0; j < cellNum; j++) {
|
|
|
+ Cell cell = row.getCell(j);
|
|
|
+ // cell.setCellType(CellType.STRING);
|
|
|
+ String cellValue = ExcelUtils.getCellValue(cell);
|
|
|
+ logger.info("cellValue:" + cellValue);
|
|
|
+ if (j == 0) {
|
|
|
+ for (SysDictData p : plant) {
|
|
|
+ if (p.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setPlantCode(p.getDictValue());//装置名称
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 1) {
|
|
|
+ entity.setMocNo(cellValue);//MOC编号
|
|
|
+ } else if (j == 2) {
|
|
|
+ for (SysDictData a : area) {
|
|
|
+ if (a.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setArea(a.getDictValue());//区域
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 3) {
|
|
|
+ entity.setTitle(cellValue);//标题
|
|
|
+ } else if (j == 4) {
|
|
|
+ entity.setOwner(cellValue);//负责人
|
|
|
+ } else if (j == 5) {
|
|
|
+ if (cellValue.length() > 3) {
|
|
|
+ entity.setApproveTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//申请时间
|
|
|
+ }
|
|
|
+ } else if (j == 6) {
|
|
|
+ if (cellValue.length() > 3) {
|
|
|
+ entity.setEndtime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//完成时间
|
|
|
+ }
|
|
|
+ } else if (j == 7) {
|
|
|
+ for (SysDictData s : state) {
|
|
|
+ if (s.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setTrueState(s.getDictValue());//实施情况
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 8) {
|
|
|
+ for (SysDictData c : change) {
|
|
|
+ if (c.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setChangeNature(c.getDictValue());//变更性质
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 9) {
|
|
|
+ if (cellValue.length() > 3) {
|
|
|
+ entity.setOverTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//到期时间
|
|
|
+ }
|
|
|
+ } else if (j == 10) {
|
|
|
+ for (SysDictData t : temporarystate) {
|
|
|
+ if (t.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setTemporaryState(t.getDictValue());//临时moc状态
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 11) {
|
|
|
+ entity.setRemarks(cellValue);//备注
|
|
|
+ } else if (j == 12) {
|
|
|
+ for (SysDictData r : risklevel) {
|
|
|
+ if (r.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setRiskLevel(r.getDictValue());//风险等级
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 13) {
|
|
|
+ if (cellValue.length() > 3) {
|
|
|
+ entity.setEhsCheck(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//EHS审查
|
|
|
+ }
|
|
|
+ } else if (j == 14) {
|
|
|
+ if (cellValue.length() > 3) {
|
|
|
+ entity.setTraining(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//培训
|
|
|
+ }
|
|
|
+ } else if (j == 15) {
|
|
|
+ if (cellValue.length() > 3) {
|
|
|
+ entity.setPssr(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//PSSR
|
|
|
+ }
|
|
|
+ } else if (j == 16) {
|
|
|
+ for (SysDictData y : yesno) {
|
|
|
+ if (y.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setSopUpdate(y.getDictValue());//SOP更新
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 17) {
|
|
|
+ for (SysDictData y : yesno) {
|
|
|
+ if (y.getDictLabel().equals(cellValue.trim())) {
|
|
|
+ entity.setPidMaster(y.getDictValue());//PID更新
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (j == 18) {
|
|
|
+ for (SysDept d : dept) {
|
|
|
+ if (d.getDeptName().equals(cellValue.trim())) {
|
|
|
+ entity.setDeptId(d.getDeptId());//部门编号
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ entity.setCreaterCode(userId.toString());
|
|
|
+ logger.info("entity:" + entity);
|
|
|
+ list.add(entity);
|
|
|
+ }catch (Exception e){
|
|
|
+ failNumber++;
|
|
|
+ failRow.add(i+1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ int successNumber = 0;
|
|
|
+ int failNum = 0;
|
|
|
+ for (TMoc t : list
|
|
|
+ ) {
|
|
|
+ failNum++;
|
|
|
+ try {
|
|
|
+ tMocService.insertTMoc(t);
|
|
|
+ successNumber++;
|
|
|
+ }catch (Exception e){
|
|
|
+ failNumber++;
|
|
|
+ logger.info("e:" + e);
|
|
|
+ failRow.add(failNum+1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ logger.info("list:" + JSON.toJSONString(list));
|
|
|
+ logger.info("successNumber:" +String.valueOf(successNumber));
|
|
|
+ logger.info("failNumber:" +String.valueOf(failNumber));
|
|
|
+ logger.info("failRow:" +String.valueOf(failRow));
|
|
|
+ return AjaxResult.success(String.valueOf(successNumber), failRow);
|
|
|
+ }
|
|
|
+
|
|
|
// 堵漏日期统计
|
|
|
@GetMapping("/sealDateData")
|
|
|
public List<DataEntity> sealDateData(SealDateVO sealDateVO)
|
|
@@ -439,18 +678,7 @@ public class TMocController extends BaseController
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
- /**
|
|
|
- * 导出MOC管理列表
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('process:moc:export')")
|
|
|
- @Log(title = "MOC管理", businessType = BusinessType.EXPORT)
|
|
|
- @GetMapping("/export")
|
|
|
- public AjaxResult export(TMoc tMoc)
|
|
|
- {
|
|
|
- List<TMoc> list = tMocService.selectTMocList(tMoc);
|
|
|
- ExcelUtil<TMoc> util = new ExcelUtil<TMoc>(TMoc.class);
|
|
|
- return util.exportExcel(list, "moc");
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取MOC管理详细信息
|
|
@@ -522,160 +750,4 @@ public class TMocController extends BaseController
|
|
|
{
|
|
|
return toAjax(tMocService.deleteTMocByIds(ids));
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 批量导入MOC管理
|
|
|
- */
|
|
|
- @PreAuthorize("@ss.hasPermi('process:moc:add')")
|
|
|
- @Log(title = "MOC管理", businessType = BusinessType.INSERT)
|
|
|
- @PostMapping("/importData")
|
|
|
- public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException
|
|
|
- {
|
|
|
- //获取操作人员ID
|
|
|
- Long userId = getUserId();
|
|
|
- //报错行数统计
|
|
|
- List<Integer> failRow =new ArrayList<Integer>();
|
|
|
- Workbook workbook = ExcelUtils.getWorkBook(file);
|
|
|
- Sheet sheet = workbook.getSheetAt(0);
|
|
|
- List<TMoc> list = new ArrayList<TMoc>();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- //字典查询
|
|
|
- List<SysDictData> plant = iSysDictTypeService.selectDictDataByType("PLANT_DIVIDE");
|
|
|
- List<SysDictData> state = iSysDictTypeService.selectDictDataByType("MOC_STATE");
|
|
|
- List<SysDictData> change = iSysDictTypeService.selectDictDataByType("MOC_CHANGE");
|
|
|
- List<SysDictData> risklevel = iSysDictTypeService.selectDictDataByType("MOC_RISKLEVEL");
|
|
|
- List<SysDictData> area = iSysDictTypeService.selectDictDataByType("MOC_AREA");
|
|
|
- List<SysDictData> temporarystate = iSysDictTypeService.selectDictDataByType("MOC_TEMPORARYSTATE");
|
|
|
- List<SysDictData> yesno = iSysDictTypeService.selectDictDataByType("YES_NO");
|
|
|
- //部门查询
|
|
|
- List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
|
|
|
- int rowNum = sheet.getPhysicalNumberOfRows();
|
|
|
- int failNumber = 0;
|
|
|
- for (int i = 1; i < rowNum; i++) {
|
|
|
- try {
|
|
|
- logger.info("读取行数:" + i);
|
|
|
- Row row = sheet.getRow(i);
|
|
|
- int cellNum = row.getPhysicalNumberOfCells();
|
|
|
- TMoc entity = new TMoc();
|
|
|
- for (int j = 0; j < cellNum; j++) {
|
|
|
- Cell cell = row.getCell(j);
|
|
|
- // cell.setCellType(CellType.STRING);
|
|
|
- String cellValue = ExcelUtils.getCellValue(cell);
|
|
|
- logger.info("cellValue:" + cellValue);
|
|
|
- if (j == 0) {
|
|
|
- for (SysDictData p : plant) {
|
|
|
- if (p.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setPlantCode(p.getDictValue());//装置名称
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 1) {
|
|
|
- entity.setMocNo(cellValue);//MOC编号
|
|
|
- } else if (j == 2) {
|
|
|
- for (SysDictData a : area) {
|
|
|
- if (a.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setArea(a.getDictValue());//区域
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 3) {
|
|
|
- entity.setTitle(cellValue);//标题
|
|
|
- } else if (j == 4) {
|
|
|
- entity.setOwner(cellValue);//负责人
|
|
|
- } else if (j == 5) {
|
|
|
- if (cellValue.length() > 3) {
|
|
|
- entity.setApproveTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//申请时间
|
|
|
- }
|
|
|
- } else if (j == 6) {
|
|
|
- if (cellValue.length() > 3) {
|
|
|
- entity.setEndtime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//完成时间
|
|
|
- }
|
|
|
- } else if (j == 7) {
|
|
|
- for (SysDictData s : state) {
|
|
|
- if (s.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setTrueState(s.getDictValue());//实施情况
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 8) {
|
|
|
- for (SysDictData c : change) {
|
|
|
- if (c.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setChangeNature(c.getDictValue());//变更性质
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 9) {
|
|
|
- if (cellValue.length() > 3) {
|
|
|
- entity.setOverTime(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//到期时间
|
|
|
- }
|
|
|
- } else if (j == 10) {
|
|
|
- for (SysDictData t : temporarystate) {
|
|
|
- if (t.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setTemporaryState(t.getDictValue());//临时moc状态
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 11) {
|
|
|
- entity.setRemarks(cellValue);//备注
|
|
|
- } else if (j == 12) {
|
|
|
- for (SysDictData r : risklevel) {
|
|
|
- if (r.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setRiskLevel(r.getDictValue());//风险等级
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 13) {
|
|
|
- if (cellValue.length() > 3) {
|
|
|
- entity.setEhsCheck(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//EHS审查
|
|
|
- }
|
|
|
- } else if (j == 14) {
|
|
|
- if (cellValue.length() > 3) {
|
|
|
- entity.setTraining(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//培训
|
|
|
- }
|
|
|
- } else if (j == 15) {
|
|
|
- if (cellValue.length() > 3) {
|
|
|
- entity.setPssr(new SimpleDateFormat(DateUtils.getDateFormat(cellValue)).parse(cellValue));//PSSR
|
|
|
- }
|
|
|
- } else if (j == 16) {
|
|
|
- for (SysDictData y : yesno) {
|
|
|
- if (y.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setSopUpdate(y.getDictValue());//SOP更新
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 17) {
|
|
|
- for (SysDictData y : yesno) {
|
|
|
- if (y.getDictLabel().equals(cellValue.trim())) {
|
|
|
- entity.setPidMaster(y.getDictValue());//PID更新
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (j == 18) {
|
|
|
- for (SysDept d : dept) {
|
|
|
- if (d.getDeptName().equals(cellValue.trim())) {
|
|
|
- entity.setDeptId(d.getDeptId());//部门编号
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- entity.setCreaterCode(userId.toString());
|
|
|
- logger.info("entity:" + entity);
|
|
|
- list.add(entity);
|
|
|
- }catch (Exception e){
|
|
|
- failNumber++;
|
|
|
- failRow.add(i+1);
|
|
|
- }
|
|
|
- }
|
|
|
- int successNumber = 0;
|
|
|
- int failNum = 0;
|
|
|
- for (TMoc t : list
|
|
|
- ) {
|
|
|
- failNum++;
|
|
|
- try {
|
|
|
- tMocService.insertTMoc(t);
|
|
|
- successNumber++;
|
|
|
- }catch (Exception e){
|
|
|
- failNumber++;
|
|
|
- logger.info("e:" + e);
|
|
|
- failRow.add(failNum+1);
|
|
|
- }
|
|
|
- }
|
|
|
- logger.info("list:" + JSON.toJSONString(list));
|
|
|
- logger.info("successNumber:" +String.valueOf(successNumber));
|
|
|
- logger.info("failNumber:" +String.valueOf(failNumber));
|
|
|
- logger.info("failRow:" +String.valueOf(failRow));
|
|
|
- return AjaxResult.success(String.valueOf(successNumber), failRow);
|
|
|
- }
|
|
|
}
|