修改设备

This commit is contained in:
huangzj
2023-09-12 11:28:12 +08:00
parent 38019f4f1f
commit 0e57b01326
10 changed files with 74 additions and 30 deletions

View File

@@ -11,7 +11,6 @@
<result column="dev_use" jdbcType="VARCHAR" property="devUse"/>
<result column="dev_type" jdbcType="VARCHAR" property="devType"/>
<result column="dev_model" jdbcType="VARCHAR" property="devModel"/>
<result column="program_version" jdbcType="VARCHAR" property="programVersion"/>
<result column="debug_person" jdbcType="VARCHAR" property="debugPerson"/>
<result column="producte_time" jdbcType="TIMESTAMP" property="producteTime"/>
<result column="check_time" jdbcType="TIMESTAMP" property="checkTime"/>

View File

@@ -42,6 +42,7 @@ import static java.util.Objects.isNull;
@Service
@RequiredArgsConstructor
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
private final CsDevModelRelationService csDevModelRelationService;
private final ICsLedgerService iCsLedgerService;
// private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
@@ -275,6 +276,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>();
queryWrap.eq("device_id",eid);
csTouristDataPOService.getBaseMapper().delete(queryWrap);
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,eid).set(CsDevModelRelationPO::getStatus,0).update();
return true;
}

View File

@@ -27,6 +27,7 @@ import com.njcn.csdevice.pojo.vo.DeviceManagerVO;
import com.njcn.csdevice.pojo.vo.ProjectEquipmentVO;
import com.njcn.csdevice.service.*;
import com.njcn.csdevice.util.QRCodeUtil;
import com.njcn.csdevice.utils.ExcelStyleUtil;
import com.njcn.db.constant.DbConstant;
import com.njcn.oss.constant.OssPath;
import com.njcn.oss.utils.FileStorageUtil;
@@ -99,7 +100,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPo);
csEquipmentDeliveryPo.setStatus ("1");
csEquipmentDeliveryPo.setRunStatus(1);
csEquipmentDeliveryPo.setProcess(1);
csEquipmentDeliveryPo.setProcess("1");
//生成二维码文件
String qr = this.createQr(csEquipmentDeliveryAddParm.getNdid());
@@ -128,6 +129,8 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
QueryWrapper<CsTouristDataPO> queryWrap = new QueryWrapper<>();
queryWrap.eq("device_id",id);
csTouristDataPOService.getBaseMapper().delete(queryWrap);
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update();
return update;
}
@@ -144,7 +147,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
public CsEquipmentDeliveryPO queryEquipmentPOByndid(String ndid) {
QueryWrapper<CsEquipmentDeliveryPO> wrapper = new QueryWrapper();
wrapper.eq ("ndid", ndid);
wrapper.eq("run_status",1);
// wrapper.eq("run_status",1);
CsEquipmentDeliveryPO csEquipmentDeliveryPO = this.baseMapper.selectOne (wrapper);
return csEquipmentDeliveryPO;
}
@@ -319,6 +322,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
}
@Override
@Transactional(rollbackFor = Exception.class)
public void importEquipment(MultipartFile file, HttpServletResponse response) {
ImportParams params = new ImportParams ( );
params.setHeadRows(1);
@@ -388,7 +392,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
csEquipmentDeliveryPO.setMac(path);
csEquipmentDeliveryPO.setRunStatus(1);
csEquipmentDeliveryPO.setStatus("1");
csEquipmentDeliveryPO.setProcess(1);
csEquipmentDeliveryPO.setProcess("1");
return csEquipmentDeliveryPO;
}).collect (Collectors.toList ( ));
this.saveOrUpdateBatch (collect, 500);
@@ -396,7 +400,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
if (!CollectionUtils.isEmpty (falseCollect)) {
ExportParams exportExcel = new ExportParams ("批量导入模板(请严格按照模板标准填入数据)", "非法设备信息");
Workbook workbook = ExcelExportUtil.exportExcel (exportExcel, DeviceExcelTemplete.IllegalityDeviceExcelTemplete.class, falseCollect);
PoiUtil.exportFileByWorkbook (workbook, "非法设备信息.xlsx", response);
ExcelStyleUtil.exportFileByWorkbook (workbook, "非法设备信息.xlsx", response);
}