feat(dms): 添加设备管理和工单相关控制器和服务的计数功能

- 在多个控制器中添加了获取计数的 API 接口
- 在对应的服务实现类中实现了计数方法
- 更新了服务接口,增加了计数相关的方法定义
- 优化了查询封装,使用 MPJLambdaWrapper 进行条件构建
master
zangch@mesnac.com 3 months ago
parent 17f773d22c
commit 7c73699037

@ -104,6 +104,14 @@ public class BaseAlarmInfoController extends BaseController {
return toAjax(baseAlarmInfoService.deleteWithValidByIds(List.of(alarmInfoIds), true));
}
/**
*
*/
@GetMapping("/count")
public R<Long> count(BaseAlarmInfoBo bo) {
return R.ok(baseAlarmInfoService.count(bo));
}
/**
*

@ -104,6 +104,14 @@ public class DmsBaseDeviceDebuggingController extends BaseController {
return toAjax(dmsBaseDeviceDebuggingService.deleteWithValidByIds(List.of(deviceDebuggingIds), true));
}
/**
*
*/
@GetMapping("/count")
public R<Long> count(DmsBaseDeviceDebuggingBo bo) {
return R.ok(dmsBaseDeviceDebuggingService.count(bo));
}
/**
*

@ -105,6 +105,14 @@ public class DmsBaseDeviceInstallController extends BaseController {
return toAjax(dmsBaseDeviceInstallService.deleteWithValidByIds(List.of(deviceInstallIds), true));
}
/**
*
*/
@GetMapping("/count")
public R<Long> count(DmsBaseDeviceInstallBo bo) {
return R.ok(dmsBaseDeviceInstallService.count(bo));
}
/**
*

@ -104,6 +104,14 @@ public class DmsBaseDevicePurchaseController extends BaseController {
return toAjax(dmsBaseDevicePurchaseService.deleteWithValidByIds(List.of(devicePurchaseIds), true));
}
/**
*
*/
@GetMapping("/count")
public R<Long> count(DmsBaseDevicePurchaseBo bo) {
return R.ok(dmsBaseDevicePurchaseService.count(bo));
}
/**
*

@ -106,6 +106,14 @@ public class DmsBillsFaultInstanceController extends BaseController {
return toAjax(dmsBillsFaultInstanceService.deleteWithValidByIds(List.of(repairInstanceIds), true));
}
/**
*
*/
@GetMapping("/count")
public R<Long> count(DmsBillsFaultInstanceBo bo) {
return R.ok(dmsBillsFaultInstanceService.count(bo));
}
/**
*

@ -104,6 +104,14 @@ public class DmsBillsInspectInstanceController extends BaseController {
return toAjax(dmsBillsInspectInstanceService.deleteWithValidByIds(List.of(inspectInstanceIds), true));
}
/**
*
*/
@GetMapping("/count")
public R<Long> count(DmsBillsInspectInstanceBo bo) {
return R.ok(dmsBillsInspectInstanceService.count(bo));
}
/**
*

@ -105,6 +105,14 @@ public class DmsBillsMaintInstanceController extends BaseController {
return toAjax(dmsBillsMaintInstanceService.deleteWithValidByIds(List.of(maintInstanceIds), true));
}
/**
*
*/
@GetMapping("/count")
public R<Long> count(DmsBillsMaintInstanceBo bo) {
return R.ok(dmsBillsMaintInstanceService.count(bo));
}
/**
*

@ -42,6 +42,8 @@ public interface IBaseAlarmInfoService {
*/
List<BaseAlarmInfoVo> queryList(BaseAlarmInfoBo bo);
Long count(BaseAlarmInfoBo bo);
/**
*
*

@ -42,6 +42,8 @@ public interface IDmsBaseDeviceDebuggingService {
*/
List<DmsBaseDeviceDebuggingVo> queryList(DmsBaseDeviceDebuggingBo bo);
Long count(DmsBaseDeviceDebuggingBo bo);
/**
*
*

@ -42,6 +42,8 @@ public interface IDmsBaseDeviceInstallService {
*/
List<DmsBaseDeviceInstallVo> queryList(DmsBaseDeviceInstallBo bo);
Long count(DmsBaseDeviceInstallBo bo);
/**
*
*

@ -42,6 +42,8 @@ public interface IDmsBaseDevicePurchaseService {
*/
List<DmsBaseDevicePurchaseVo> queryList(DmsBaseDevicePurchaseBo bo);
Long count(DmsBaseDevicePurchaseBo bo);
/**
*
*

@ -46,6 +46,8 @@ public interface IDmsBillsFaultInstanceService {
*/
List<DmsBillsFaultInstanceVo> queryList(DmsBillsFaultInstanceBo bo);
Long count(DmsBillsFaultInstanceBo bo);
/**
*
*

@ -44,6 +44,8 @@ public interface IDmsBillsInspectInstanceService {
*/
List<DmsBillsInspectInstanceVo> queryList(DmsBillsInspectInstanceBo bo);
Long count(DmsBillsInspectInstanceBo bo);
/**
*
*

@ -42,6 +42,8 @@ public interface IDmsBillsMaintInstanceService {
*/
List<DmsBillsMaintInstanceVo> queryList(DmsBillsMaintInstanceBo bo);
Long count(DmsBillsMaintInstanceBo bo);
/**
*
*

@ -74,6 +74,12 @@ public class BaseAlarmInfoServiceImpl implements IBaseAlarmInfoService {
return baseMapper.selectVoList(lqw);
}
@Override
public Long count(BaseAlarmInfoBo bo) {
MPJLambdaWrapper<BaseAlarmInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectCount(lqw);
}
private MPJLambdaWrapper<BaseAlarmInfo> buildQueryWrapper(BaseAlarmInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<BaseAlarmInfo> lqw = JoinWrappers.lambda(BaseAlarmInfo.class)

@ -70,6 +70,12 @@ public class DmsBaseDeviceDebuggingServiceImpl implements IDmsBaseDeviceDebuggin
return baseMapper.selectVoList(lqw);
}
@Override
public Long count(DmsBaseDeviceDebuggingBo bo) {
MPJLambdaWrapper<DmsBaseDeviceDebugging> lqw = buildQueryWrapper(bo);
return baseMapper.selectCount(lqw);
}
private MPJLambdaWrapper<DmsBaseDeviceDebugging> buildQueryWrapper(DmsBaseDeviceDebuggingBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<DmsBaseDeviceDebugging> lqw = JoinWrappers.lambda(DmsBaseDeviceDebugging.class)

@ -76,6 +76,12 @@ public class DmsBaseDeviceInstallServiceImpl implements IDmsBaseDeviceInstallSer
return baseMapper.selectVoList(lqw);
}
@Override
public Long count(DmsBaseDeviceInstallBo bo) {
MPJLambdaWrapper<DmsBaseDeviceInstall> lqw = buildQueryWrapper(bo);
return baseMapper.selectCount(lqw);
}
private MPJLambdaWrapper<DmsBaseDeviceInstall> buildQueryWrapper(DmsBaseDeviceInstallBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<DmsBaseDeviceInstall> lqw = JoinWrappers.lambda(DmsBaseDeviceInstall.class)

@ -72,6 +72,12 @@ public class DmsBaseDevicePurchaseServiceImpl implements IDmsBaseDevicePurchaseS
return baseMapper.selectVoList(lqw);
}
@Override
public Long count(DmsBaseDevicePurchaseBo bo) {
MPJLambdaWrapper<DmsBaseDevicePurchase> lqw = buildQueryWrapper(bo);
return baseMapper.selectCount(lqw);
}
private MPJLambdaWrapper<DmsBaseDevicePurchase> buildQueryWrapper(DmsBaseDevicePurchaseBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<DmsBaseDevicePurchase> lqw = JoinWrappers.lambda(DmsBaseDevicePurchase.class)

@ -116,6 +116,12 @@ public class DmsBillsFaultInstanceServiceImpl implements IDmsBillsFaultInstanceS
return baseMapper.selectVoList(lqw);
}
@Override
public Long count(DmsBillsFaultInstanceBo bo) {
MPJLambdaWrapper<DmsBillsFaultInstance> lqw = buildQueryWrapper(bo);
return baseMapper.selectCount(lqw);
}
private MPJLambdaWrapper<DmsBillsFaultInstance> buildQueryWrapper(DmsBillsFaultInstanceBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<DmsBillsFaultInstance> lqw = JoinWrappers.lambda(DmsBillsFaultInstance.class)

@ -91,6 +91,12 @@ public class DmsBillsInspectInstanceServiceImpl implements IDmsBillsInspectInsta
return baseMapper.selectVoList(lqw);
}
@Override
public Long count(DmsBillsInspectInstanceBo bo) {
MPJLambdaWrapper<DmsBillsInspectInstance> lqw = buildQueryWrapper(bo);
return baseMapper.selectCount(lqw);
}
private MPJLambdaWrapper<DmsBillsInspectInstance> buildQueryWrapper(DmsBillsInspectInstanceBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<DmsBillsInspectInstance> lqw = JoinWrappers.lambda(DmsBillsInspectInstance.class)

@ -109,6 +109,12 @@ public class DmsBillsMaintInstanceServiceImpl implements IDmsBillsMaintInstanceS
return baseMapper.selectVoList(lqw);
}
@Override
public Long count(DmsBillsMaintInstanceBo bo) {
MPJLambdaWrapper<DmsBillsMaintInstance> lqw = buildQueryWrapper(bo);
return baseMapper.selectCount(lqw);
}
private MPJLambdaWrapper<DmsBillsMaintInstance> buildQueryWrapper(DmsBillsMaintInstanceBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<DmsBillsMaintInstance> lqw = JoinWrappers.lambda(DmsBillsMaintInstance.class)

@ -38,11 +38,11 @@ public class DmsMaintStanceExecutor {
String tenantId = (String) paramMap.get("tenantId");
String user = (String) paramMap.get("userId");
Long userId = Long.parseLong(user);
log.info("开始执行设备保养实例生成任务,计划编码:{}租户ID{}用户ID{}", planCode, tenantId, userId);
R<Integer> instance = dmsBillsMaintInstanceService.insertDmsBillsMaintInstance(planCode, tenantId, userId);
// 检查业务调用结果
if (instance.getCode() == 200) {
log.info("设备保养实例生成成功,计划编码:{},结果:{}", planCode, instance.getData());

Loading…
Cancel
Save