plp
kkk-ops 1 month ago
parent 3d4a8fb65c
commit 100331b455

@ -61,6 +61,9 @@ public class MoldPageReqVO extends PageParam {
@Schema(description = "id集合导出用") @Schema(description = "id集合导出用")
private String ids; private String ids;
@Schema(description = "status集合")
private List<Long> statuss;
@Schema(description = "附件地址") @Schema(description = "附件地址")
private String fileUrl; private String fileUrl;

@ -24,7 +24,7 @@ public interface MoldMapper extends BaseMapperX<MoldDO> {
default PageResult<MoldDO> selectPage(MoldPageReqVO reqVO) { default PageResult<MoldDO> selectPage(MoldPageReqVO reqVO) {
LambdaQueryWrapperX<MoldDO> wrapper = new LambdaQueryWrapperX<>(); LambdaQueryWrapperX<MoldDO> wrapper = new LambdaQueryWrapperX<>();
wrapper wrapper
.eqIfPresent(MoldDO::getCode, reqVO.getCode()) .likeIfPresent(MoldDO::getCode, reqVO.getCode())
.likeIfPresent(MoldDO::getName, reqVO.getName()) .likeIfPresent(MoldDO::getName, reqVO.getName())
.eqIfPresent(MoldDO::getUnitId, reqVO.getUnitId()) .eqIfPresent(MoldDO::getUnitId, reqVO.getUnitId())
.eqIfPresent(MoldDO::getMachineId, reqVO.getMachineId()) .eqIfPresent(MoldDO::getMachineId, reqVO.getMachineId())
@ -48,6 +48,9 @@ public interface MoldMapper extends BaseMapperX<MoldDO> {
wrapper.in(MoldDO::getId, idList); wrapper.in(MoldDO::getId, idList);
} }
if (reqVO.getStatuss() != null && !reqVO.getStatuss().isEmpty()) {
wrapper.in(MoldDO::getStatus, reqVO.getStatuss());
}
return selectPage(reqVO, wrapper); return selectPage(reqVO, wrapper);
} }

@ -103,4 +103,13 @@ public class MoldController {
List<MoldDO> doList = moldService.getInTransitMoldAllList(); List<MoldDO> doList = moldService.getInTransitMoldAllList();
return success(doList); return success(doList);
} }
@GetMapping("/getMoldListByStatus")
@Operation(summary = "根据状态获得模具列表")
@Parameter(name = "id", description = "设备id", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('mes:mold-operate:query')")
public CommonResult<List<MoldDO>> getMoldListByStatus(@RequestParam("status") Long status) {
List<MoldDO> moldDO = moldService.getMoldListByStatus(status);
return success(moldDO);
}
} }

@ -87,6 +87,7 @@ public interface MoldBrandService {
* @return * @return
*/ */
PageResult<MoldRespVO> getMoldPage(MoldPageReqVO pageReqVO); PageResult<MoldRespVO> getMoldPage(MoldPageReqVO pageReqVO);
List<MoldDO> getMoldList(); List<MoldDO> getMoldList();
/** /**

@ -100,4 +100,6 @@ public interface MoldService {
List<MoldRespVO> buildMoldVOList(List<MoldDO> list); List<MoldRespVO> buildMoldVOList(List<MoldDO> list);
List<MoldDO> getInTransitMoldAllList(); List<MoldDO> getInTransitMoldAllList();
List<MoldDO> getMoldListByStatus(Long status);
} }

@ -129,4 +129,11 @@ public class MoldServiceImpl implements MoldService {
public List<MoldDO> getInTransitMoldAllList() { public List<MoldDO> getInTransitMoldAllList() {
return moldMapper.selectList(Wrappers.<MoldDO>lambdaQuery().eq(MoldDO::getStatus,3)); return moldMapper.selectList(Wrappers.<MoldDO>lambdaQuery().eq(MoldDO::getStatus,3));
} }
@Override
public List<MoldDO> getMoldListByStatus(Long status) {
LambdaQueryWrapperX<MoldDO> queryWrapper = new LambdaQueryWrapperX<MoldDO>()
.eqIfPresent(MoldDO::getStatus, status);
return moldMapper.selectList(queryWrapper);
}
} }

@ -51,6 +51,7 @@ public class DeviceController {
private JobService jobService; private JobService jobService;
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建物联设备") @Operation(summary = "创建物联设备")
@PreAuthorize("@ss.hasPermission('iot:device:create')") @PreAuthorize("@ss.hasPermission('iot:device:create')")
@ -120,6 +121,40 @@ public class DeviceController {
return success(list); return success(list);
} }
@GetMapping("/noUsedlist")
@Operation(summary = "获得未关联设备台账列表")
@PreAuthorize("@ss.hasPermission('mes:device-ledger:query')")
public CommonResult<List<DeviceRespVO>> getDeviceLedgerListByNoUsed() {
DevicePageReqVO pageReqVO = new DevicePageReqVO();
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<DeviceRespVO> list = deviceService.getDevicePage(pageReqVO).getList();
List<Long> ids = deviceService.deviceLedgerList();
List<DeviceRespVO> filteredList = list.stream()
.filter(device -> !ids.contains(device.getId()))
.collect(Collectors.toList());
return success(filteredList);
}
@GetMapping("/noUsedlist2")
@Operation(summary = "获得未关联设备台账列表")
@PreAuthorize("@ss.hasPermission('mes:device-ledger:query')")
public CommonResult<List<DeviceRespVO>> getDeviceLedgerList2ByNoUsed(@RequestParam("id") Long id) {
DevicePageReqVO pageReqVO = new DevicePageReqVO();
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<DeviceRespVO> list = deviceService.getDevicePage(pageReqVO).getList();
List<Long> ids = deviceService.deviceLedgerList();
List<DeviceRespVO> filteredList = list.stream()
.filter(device -> {
if (id != null && id.equals(device.getId())) {
return true;
}
return !ids.contains(device.getId());
})
.collect(Collectors.toList());
return success(filteredList);
}
@PostMapping("/connect") @PostMapping("/connect")
@Operation(summary = "连接") @Operation(summary = "连接")
// @PreAuthorize("@ss.hasPermission('iot:device:create')") // @PreAuthorize("@ss.hasPermission('iot:device:create')")

@ -99,6 +99,8 @@ public interface DeviceMapper extends BaseMapperX<DeviceDO> {
String lineDeviceLedgerPage(@Param("id") Long id); String lineDeviceLedgerPage(@Param("id") Long id);
List<Long> deviceLedgerList();
List<LineDeviceRespVO> lineDeviceList(@Param("pageReqVO") LineDeviceRequestVO pageReqVO); List<LineDeviceRespVO> lineDeviceList(@Param("pageReqVO") LineDeviceRequestVO pageReqVO);

@ -138,4 +138,6 @@ public interface DeviceService {
List<Map<String, Object>> getMultiDeviceAttributes(String deviceIds); List<Map<String, Object>> getMultiDeviceAttributes(String deviceIds);
List<DeviceContactModelDO> getDeviceAttributeList(Long deviceId); List<DeviceContactModelDO> getDeviceAttributeList(Long deviceId);
List<Long> deviceLedgerList();
} }

@ -626,7 +626,14 @@ public class DeviceServiceImpl implements DeviceService {
if(latestDeviceData != null) { if(latestDeviceData != null) {
lineDeviceRespVO.setCollectionTime((String) latestDeviceData.get("timestamp")); lineDeviceRespVO.setCollectionTime((String) latestDeviceData.get("timestamp"));
} }
lineDeviceRespVO.setLineName(deviceMapper.lineDeviceLedgerPage(record.getId())); String line = deviceMapper.lineDeviceLedgerPage(record.getId());
if (line != null) {
lineDeviceRespVO.setLineName(line);
lineDeviceRespVO.setLineNode(line);
} else {
lineDeviceRespVO.setLineName("-");
lineDeviceRespVO.setLineNode("-");
}
list.add(lineDeviceRespVO); list.add(lineDeviceRespVO);
} }
if (list.isEmpty()) { if (list.isEmpty()) {
@ -1003,4 +1010,10 @@ public class DeviceServiceImpl implements DeviceService {
.eq(DeviceContactModelDO::getDeviceId,deviceId) .eq(DeviceContactModelDO::getDeviceId,deviceId)
.orderByDesc(DeviceContactModelDO::getId)); .orderByDesc(DeviceContactModelDO::getId));
} }
@Override
public List<Long> deviceLedgerList() {
return deviceMapper.deviceLedgerList();
}
} }

@ -62,10 +62,19 @@
SELECT mo.workshop SELECT mo.workshop
FROM mes_device_ledger mo FROM mes_device_ledger mo
WHERE mo.deleted = 0 WHERE mo.deleted = 0
and dv_id = #{id} and mo.dv_id = #{id}
LIMIT 1 LIMIT 1
</select> </select>
<select id="deviceLedgerList" resultType="java.lang.Long">
SELECT mo.dv_id
FROM mes_device_ledger mo
WHERE mo.deleted = 0
AND mo.dv_id IS NOT NULL
AND mo.dv_id != 0
</select>
<select id="getDeviceOperationalStatus" <select id="getDeviceOperationalStatus"
resultType="cn.iocoder.yudao.module.iot.controller.admin.device.vo.DeviceOperationStatusRespVO"> resultType="cn.iocoder.yudao.module.iot.controller.admin.device.vo.DeviceOperationStatusRespVO">
SELECT SELECT

@ -166,7 +166,18 @@ public class DeviceLedgerController {
public CommonResult<List<DeviceLedgerDO>> getDeviceLedgerListByNoUsed() { public CommonResult<List<DeviceLedgerDO>> getDeviceLedgerListByNoUsed() {
List<DeviceLedgerDO> deviceLedgerDOList = deviceLedgerService.getDeviceLedgerList(); List<DeviceLedgerDO> deviceLedgerDOList = deviceLedgerService.getDeviceLedgerList();
deviceLedgerDOList.removeIf(device -> deviceLedgerDOList.removeIf(device ->
device.getWorkshop() != null device.getWorkshop() != null && !device.getWorkshop().trim().isEmpty()
);
return success(deviceLedgerDOList);
}
@GetMapping("/noUsedlist2")
@Operation(summary = "获得未关联设备台账列表")
@PreAuthorize("@ss.hasPermission('mes:device-ledger:query')")
public CommonResult<List<DeviceLedgerDO>> getDeviceLedgerList2ByNoUsed(@RequestParam("id") Long id) {
List<DeviceLedgerDO> deviceLedgerDOList = deviceLedgerService.getDeviceLedgerList();
deviceLedgerDOList.removeIf(device ->
device.getWorkshop() != null && !device.getWorkshop().trim().isEmpty() && !Objects.equals(device.getId(), id)
); );
return success(deviceLedgerDOList); return success(deviceLedgerDOList);
} }

@ -56,5 +56,4 @@ public interface MoldOperateService {
List<MoldDO> getLowerMoldList(Long id); List<MoldDO> getLowerMoldList(Long id);
} }

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.mes.service.moldoperate; package cn.iocoder.yudao.module.mes.service.moldoperate;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.common.dal.dataobject.mold.MoldDO; import cn.iocoder.yudao.module.common.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.common.dal.mysql.mold.MoldMapper; import cn.iocoder.yudao.module.common.dal.mysql.mold.MoldMapper;
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO; import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO;
@ -171,4 +172,5 @@ public class MoldOperateServiceImpl implements MoldOperateService {
return moldDOList; return moldDOList;
} }
} }
Loading…
Cancel
Save