| | |
| | | YwPoint entity = baseMapper.selectById(form.getId()); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | if (form.getUnitId() != null) { |
| | | entity.setUnitId(Long.valueOf(form.getUnitId())); |
| | | }else { |
| | | entity.setUnitId(null); |
| | | } |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | baseMapper.updateById(entity); |
| | | baseMapper.myUpdateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | | |
| | |
| | | headers.add(PointHeaderConstant.ID); |
| | | headers.add(PointHeaderConstant.Point_Name); |
| | | headers.add(PointHeaderConstant.Serial_Number); |
| | | headers.add(PointHeaderConstant.Area); |
| | | headers.add(PointHeaderConstant.IP); |
| | | headers.add(PointHeaderConstant.Area); |
| | | headers.add(PointHeaderConstant.Unit); |
| | | headers.add(PointHeaderConstant.Province_Tag); |
| | | headers.add(PointHeaderConstant.Impotrant_Command_Image); |
| | | headers.add(PointHeaderConstant.Dept_Tag); |
| | |
| | | list.add(export.getId()); |
| | | list.add(export.getPointName()); |
| | | list.add(export.getSerialNumber()); |
| | | list.add(export.getArea()); |
| | | list.add(export.getPointIP()); |
| | | list.add(export.getArea()); |
| | | list.add(export.getUnitName()); |
| | | list.add(export.getProvinceTagString()); |
| | | list.add(export.getImportantCommandImageTagString()); |
| | | list.add(export.getDeptTagString()); |
| | |
| | | if (needUpdateUnit) { |
| | | if (Objects.nonNull(unitId)) { |
| | | point.setUnitId(Long.valueOf(unitId)); |
| | | } else { |
| | | point.setUnitId(null); |
| | | } |
| | | point.setStartTime(startTime); |
| | | point.setEndTime(endTime); |
| | |
| | | point.setSerialNumber(item.getSerialNumber()); |
| | | return point; |
| | | }).collect(Collectors.toList()); |
| | | this.waitAllFinishAndGetResult(pointList); |
| | | this.waitAllFinishAndGetResult(pointList, needUpdateUnit); |
| | | } |
| | | |
| | | @Override |
| | |
| | | //数据库里查不到excel里面的这个点位动态列,全为新增 |
| | | List<DynamicColumnVO> dynamicData = pointExport.getDynamicData(); |
| | | for (DynamicColumnVO excelData : dynamicData) { |
| | | if(excelData.getColumnValue()!=null) { |
| | | if (excelData.getColumnValue() != null) { |
| | | Integer dynamicId = dictionary.get(excelData.getLabelValue()); |
| | | DynamicColumnValue entity = new DynamicColumnValue(); |
| | | entity.setColumnValue(excelData.getColumnValue()); |
| | |
| | | } |
| | | //mybaits方法 |
| | | //插入 |
| | | if(!CollectionUtils.isEmpty(insertList)) dynamicColumnMapper.saveBatch(insertList); |
| | | if (!CollectionUtils.isEmpty(insertList)) dynamicColumnMapper.saveBatch(insertList); |
| | | //更新 |
| | | if(!CollectionUtils.isEmpty(updateList)) dynamicColumnMapper.updateBatch(updateList); |
| | | if (!CollectionUtils.isEmpty(updateList)) dynamicColumnMapper.updateBatch(updateList); |
| | | //删除 |
| | | if(!CollectionUtils.isEmpty(deleteList)) dynamicColumnMapper.deleteBatch(deleteList); |
| | | if (!CollectionUtils.isEmpty(deleteList)) dynamicColumnMapper.deleteBatch(deleteList); |
| | | } |
| | | |
| | | /** |
| | |
| | | return baseMapper.selectOne(new LambdaQueryWrapper<>(YwPoint.class).eq(YwPoint::getSerialNumber, serialNumber).eq(YwPoint::getDeleted, "0")); |
| | | } |
| | | |
| | | public void waitAllFinishAndGetResult(List<YwPoint> dataList) { |
| | | public void waitAllFinishAndGetResult(List<YwPoint> dataList, Boolean needUpdateUnit) { |
| | | Date startTime = new Date(); |
| | | this.baseMapper.updatePoint(dataList); |
| | | this.baseMapper.updatePoint(dataList, needUpdateUnit); |
| | | Date endTime = new Date(); |
| | | log.error("总共耗时:" + (endTime.getTime() - startTime.getTime())); |
| | | } |