fix: Device

This commit is contained in:
2023-12-06 18:36:03 +08:00
parent 4d339161b7
commit 26e2863587
37 changed files with 281 additions and 466 deletions

View File

@@ -43,7 +43,6 @@ import java.util.*;
@AllArgsConstructor
public class AddressServiceImpl extends CommonServiceImpl<AddressMapper, Address> implements AddressService {
// private final RedisUtils redisUtils;
private final AddressMapper sysInterfaceMethodsAddressMapper;

View File

@@ -45,7 +45,6 @@ public class DeviceDriverConfigController {
@GetMapping
@Log("查询设备")
@ApiOperation("查询设备")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson) {
return null;
}

View File

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
* https://blog.csdn.net/moneyshi/article/details/82978073
*/
public enum DriverTypeEnum {
//
ORDINARY_SITE(1, "standard_ordinary_site", "普通站点", "conveyor"),
INSPECT_SITE(2, "standard_inspect_site", "检测站点", "conveyor"),

View File

@@ -34,7 +34,6 @@ public class ItemProtocol {
public int getOpcIntegerValue(String protocol) {
Integer value = this.driver.getIntegeregerValue(protocol);
if (value == null) {
// log.error("读取错误!");
} else {
return value;
}

View File

@@ -89,19 +89,27 @@ public class Device implements Serializable {
@TableField(exist = false)
private String opc_plc_code;
/* 粉桶号 */
/**
* 粉桶号
*/
@TableField(exist = false)
private String barrels_code;
/* 配合批号 */
/**
* 配合批号
*/
@TableField(exist = false)
private String cooperate_code;
/* 粉种名称 */
/**
* 粉种名称
*/
@TableField(exist = false)
private String powder_name;
/* 粉桶状态 */
/**
* 粉桶状态
*/
@TableField(exist = false)
private String barrels_status;

View File

@@ -3,6 +3,7 @@ package org.nl.acs.device.enums;
import cn.hutool.core.util.StrUtil;
public enum DeviceType {
//
conveyor("输送机-Conveyor", 1),
station("固定货台-Station", 2),
stacker("堆垛机-Stacker", 3),

View File

@@ -1,6 +1,7 @@
package org.nl.acs.device.enums;
public enum ErrorType {
//
AGV_ERROR("agv_error_type","AGV错误类型"),
CONVEYOR_ERROR("conveyor_error_type","输送机错误类型"),
STACKER_ERROR("stacker_error_type","堆垛机错误类型"),

View File

@@ -30,7 +30,6 @@ public class DeviceAssignedController {
@GetMapping
@Log("查询设备任务分配信息")
@ApiOperation("查询设备任务分配信息")
//@PreAuthorize("@el.check('deviceAssigned:list')")
public ResponseEntity query(DeviceAssignedQueryParam query, Pageable pageable) {
return new ResponseEntity<>(deviceAssignedService.queryAll(query, pageable), HttpStatus.OK);
}
@@ -38,7 +37,6 @@ public class DeviceAssignedController {
@PostMapping
@Log("新增设备任务分配信息")
@ApiOperation("新增设备任务分配信息")
//@PreAuthorize("@el.check('deviceAssigned:add')")
public ResponseEntity create(@Validated @RequestBody DeviceAssignedDto resources) {
return new ResponseEntity<>(deviceAssignedService.insert(resources), HttpStatus.CREATED);
}
@@ -46,7 +44,6 @@ public class DeviceAssignedController {
@PutMapping
@Log("修改设备任务分配信息")
@ApiOperation("修改设备任务分配信息")
//@PreAuthorize("@el.check('deviceAssigned:edit')")
public ResponseEntity update(@Validated @RequestBody DeviceAssignedDto resources) {
deviceAssignedService.updateById(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@@ -55,19 +52,10 @@ public class DeviceAssignedController {
@DeleteMapping
@Log("删除设备任务分配信息")
@ApiOperation("删除设备任务分配信息")
//@PreAuthorize("@el.check('deviceAssigned:del')")
public ResponseEntity delete(@RequestBody Set<String> ids) {
deviceAssignedService.removeByIds(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
/*
@Log("导出设备任务分配信息")
@ApiOperation("导出设备任务分配信息")
@GetMapping(value = "/download")
//@PreAuthorize("@el.check('deviceAssigned:list')")
public void download(HttpServletResponse response, DeviceAssignedQueryParam query) throws IOException {
deviceAssignedService.download(deviceAssignedService.queryAll(query), response);
}*/
}

View File

@@ -55,7 +55,6 @@ public class DeviceController {
@GetMapping
@Log("查询设备")
@ApiOperation("查询设备")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(deviceService.queryAll(whereJson, page), HttpStatus.OK);
}
@@ -63,7 +62,6 @@ public class DeviceController {
@GetMapping("/protocol")
@Log("查询设备协议")
@ApiOperation("查询设备协议")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> protocol(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(deviceService.queryDeviceProtocol(whereJson, page), HttpStatus.OK);
}
@@ -71,7 +69,6 @@ public class DeviceController {
@Log("导出设备协议")
@ApiOperation("导出设备协议")
@GetMapping(value = "/protocol/download")
//@PreAuthorize("@el.check('device:list')")
public void downDeviceDBload(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
deviceService.downDeviceDBload(deviceService.queryDeviceProtocol(whereJson), response);
}
@@ -79,7 +76,6 @@ public class DeviceController {
@Log("导出设备协议")
@ApiOperation("导出设备协议CSV")
@GetMapping(value = "/protocol/downloadCSV")
//@PreAuthorize("@el.check('device:list')")
public void downDeviceDBloadCSV(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
deviceService.downDeviceDBloadCSV(deviceService.queryDeviceProtocol(whereJson), response);
}
@@ -87,7 +83,6 @@ public class DeviceController {
@PostMapping
@Log("新增设备")
@ApiOperation("新增设备")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> create(@Validated @RequestBody DeviceDto dto) {
deviceService.create(dto);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -96,7 +91,6 @@ public class DeviceController {
@PutMapping
@Log("修改设备")
@ApiOperation("修改设备")
//@PreAuthorize("@el.check('device:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody DeviceDto dto) {
deviceService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@@ -104,7 +98,6 @@ public class DeviceController {
@Log("删除设备")
@ApiOperation("删除设备")
//@PreAuthorize("@el.check('device:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
@@ -115,7 +108,6 @@ public class DeviceController {
@Log("导出设备")
@ApiOperation("导出设备")
@GetMapping(value = "/download")
//@PreAuthorize("@el.check('device:list')")
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
deviceService.download(deviceService.queryAll(whereJson), response);
}
@@ -123,7 +115,6 @@ public class DeviceController {
@GetMapping("/selectList")
@Log("下拉选设备")
@ApiOperation("下拉选设备")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectList() {
return new ResponseEntity<>(deviceService.selectList(), HttpStatus.OK);
}
@@ -131,7 +122,6 @@ public class DeviceController {
@GetMapping("/region/{region}")
@Log("根据区域查询设备")
@ApiOperation("根据区域查询设备")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectList(@PathVariable String region) {
return new ResponseEntity<>(deviceService.selectDeviceListByRegion(region), HttpStatus.OK);
}
@@ -139,7 +129,6 @@ public class DeviceController {
@GetMapping("/selectListOne")
@Log("查询区域一设备")
@ApiOperation("查询区域一设备")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectListOne() {
return new ResponseEntity<>(deviceService.selectDeviceListOne(), HttpStatus.OK);
}
@@ -147,7 +136,6 @@ public class DeviceController {
@GetMapping("/selectListTwo")
@Log("查询区域二设备")
@ApiOperation("查询区域二设备")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectListTwo() {
return new ResponseEntity<>(deviceService.selectDeviceListTwo(), HttpStatus.OK);
}
@@ -155,7 +143,6 @@ public class DeviceController {
@GetMapping("/selectListThree")
@Log("查询区域三设备")
@ApiOperation("查询区域三设备")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectListThree() {
return new ResponseEntity<>(deviceService.selectDeviceListThree(), HttpStatus.OK);
}
@@ -163,7 +150,6 @@ public class DeviceController {
@GetMapping("/type/{type}")
@Log("根据设备类型查询已配置设备")
@ApiOperation("根据类型查询设备")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectListByType(@PathVariable String type) {
return new ResponseEntity<>(deviceService.selectDeviceListByType(type), HttpStatus.OK);
}
@@ -171,7 +157,6 @@ public class DeviceController {
@GetMapping("/selectDeviceDevicerInfo/{status}")
@Log("根据状态查询设备信息")
@ApiOperation("根据区域查询设备信息")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectDeviceDevicerInfo(@PathVariable String status) {
return new ResponseEntity<>(deviceService.selectDeviceDevicerInfo(status), HttpStatus.OK);
}
@@ -179,7 +164,6 @@ public class DeviceController {
@PostMapping("/callAgv")
@Log("呼叫请求")
@ApiOperation("呼叫请求")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> callAgv(@RequestBody JSONObject json) {
deviceService.callAgv(json);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -188,7 +172,6 @@ public class DeviceController {
@PostMapping("/addMaterial")
@Log("添加物料信息")
@ApiOperation("添加物料信息")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> addMaterial(@RequestBody JSONObject json) {
deviceService.addMaterial(json);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -197,7 +180,6 @@ public class DeviceController {
@PostMapping("/changeDeviceStatus")
@Log("改变设备状态")
@ApiOperation("改变设备状态")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> changeDeviceStatus(@RequestBody JSONObject json) {
deviceService.changeDeviceStatus(json);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -206,7 +188,6 @@ public class DeviceController {
@PostMapping("/changeFenceStatus")
@Log("改变电子围栏状态")
@ApiOperation("改变电子围栏状态")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> changeFenceStatus(@RequestBody JSONObject json) {
deviceService.changeFenceStatus(json);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -215,7 +196,6 @@ public class DeviceController {
@PostMapping("/responseAgv")
@Log("响应请求")
@ApiOperation("响应请求")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> responseAgv(@RequestBody JSONObject json) {
deviceService.responseAgv(json);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -224,7 +204,6 @@ public class DeviceController {
@PostMapping("/autoCreateTask")
@Log("自动创建接任务")
@ApiOperation("自动创建接任务")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> autoCreateTask(@RequestBody JSONObject json) {
deviceService.autoCreateTask(json);
@@ -234,7 +213,6 @@ public class DeviceController {
@PostMapping("/cleanTask")
@Log("清除设备状态为空位")
@ApiOperation("清除设备状态为空位")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> cleanTask(@RequestBody JSONObject json) {
deviceService.cleanTask(json);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -243,7 +221,6 @@ public class DeviceController {
@PostMapping("/cleanMaterial")
@Log("清除设备物料信息")
@ApiOperation("清除设备物料信息")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> cleanMaterial(@RequestBody JSONObject json) {
deviceService.cleanMaterial(json);
return new ResponseEntity<>(HttpStatus.CREATED);
@@ -252,7 +229,6 @@ public class DeviceController {
@GetMapping("/selectDriverCodeList/{device_code}")
@Log("下拉选设备驱动")
@ApiOperation("下拉选设备驱动")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectDriverCodeList(@PathVariable String device_code) {
DeviceDto device = deviceService.findByCode(device_code);
JSONArray ja = deviceService.selectDriverCodeList(device_code);
@@ -328,7 +304,6 @@ public class DeviceController {
@GetMapping("/selectConveyorList")
@Log("下拉选输送设备")
@ApiOperation("下拉选输送设备")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> selectConveyorList() {
return new ResponseEntity<>(deviceService.selectConveyorList(), HttpStatus.OK);
}
@@ -365,7 +340,6 @@ public class DeviceController {
@Log("导出设备db")
@ApiOperation("导出设备")
@PostMapping(value = "/downloadProtocolConfig")
//@PreAuthorize("@el.check('device:list')")
public void downloadProtocolConfig(HttpServletResponse response, @RequestBody JSONObject whereJson) throws IOException {
deviceService.downloadProtocolConfig(whereJson, response);
}
@@ -373,7 +347,6 @@ public class DeviceController {
@GetMapping("/getAllDriverCodeList")
@Log("协议配置下拉选设备驱动")
@ApiOperation("协议配置下拉选设备驱动")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> getAllDriverCodeList() {
return new ResponseEntity<>(DriverTypeEnum.getList(), HttpStatus.OK);
}
@@ -381,7 +354,6 @@ public class DeviceController {
@Log("导出Smart设备协议CSV")
@ApiOperation("导出Smart设备协议CSV")
@GetMapping(value = "/protocol/downloadSmartCSV")
//@PreAuthorize("@el.check('device:list')")
public void downDeviceDBloadOumulongCSV(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
deviceService.downDeviceDBloadSmartCSV(deviceService.queryDeviceProtocol(whereJson), response);
}
@@ -389,7 +361,6 @@ public class DeviceController {
@Log("导出FX5U设备协议CSV")
@ApiOperation("导出FX5U设备协议CSV")
@GetMapping(value = "/protocol/downloadFX5UCSV")
//@PreAuthorize("@el.check('device:list')")
public void downDeviceDBloadFX5UCSV(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
deviceService.downDeviceDBloadFX5UCSV(deviceService.queryDeviceProtocol(whereJson), response);
}

View File

@@ -29,7 +29,6 @@ public class DeviceDbitemController {
@GetMapping
@Log("查询设备DB项")
@ApiOperation("查询设备DB项")
//@PreAuthorize("@el.check('deviceDbitem:list')")
public ResponseEntity query(DeviceDbitemQueryParam query, Pageable pageable) {
return new ResponseEntity<>(deviceDbitemService.queryAll(query, pageable), HttpStatus.OK);
}
@@ -37,7 +36,6 @@ public class DeviceDbitemController {
@PostMapping
@Log("新增设备DB项")
@ApiOperation("新增设备DB项")
//@PreAuthorize("@el.check('deviceDbitem:add')")
public ResponseEntity create(@Validated @RequestBody DeviceDbitemDto resources) {
return new ResponseEntity<>(deviceDbitemService.insert(resources), HttpStatus.CREATED);
}
@@ -45,7 +43,6 @@ public class DeviceDbitemController {
@PutMapping
@Log("修改设备DB项")
@ApiOperation("修改设备DB项")
//@PreAuthorize("@el.check('deviceDbitem:edit')")
public ResponseEntity update(@Validated @RequestBody DeviceDbitemDto resources) {
deviceDbitemService.updateById(resources);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
@@ -54,7 +51,6 @@ public class DeviceDbitemController {
@DeleteMapping
@Log("删除设备DB项")
@ApiOperation("删除设备DB项")
//@PreAuthorize("@el.check('deviceDbitem:del')")
public ResponseEntity delete(@RequestBody Set<String> ids) {
deviceDbitemService.removeByIds(ids);
return new ResponseEntity<>(HttpStatus.OK);

View File

@@ -38,19 +38,46 @@ public interface DeviceAssignedService extends CommonService<DeviceAssigned> {
*/
List<DeviceAssignedDto> queryAll(DeviceAssignedQueryParam query);
/**
* 根据id获取DeviceAssigned
* @param id
* @return
*/
DeviceAssigned getById(String id);
/**
* 根据id获取DeviceAssignedDto
* @param id
* @return
*/
DeviceAssignedDto findById(String id);
/**
* 插入一条新数据。
* 插入
* @param resources
* @return
*/
int insert(DeviceAssignedDto resources);
/**
* 更新
* @param resources
* @return
*/
int updateById(DeviceAssignedDto resources);
/**
* 删除
* @param id
* @return
*/
int removeById(String id);
/**
* 批量删除
* @param ids
* @return
*/
int removeByIds(Set<String> ids);
/**
@@ -104,8 +131,7 @@ public interface DeviceAssignedService extends CommonService<DeviceAssigned> {
/**
* 编辑
*
* @param dto /
* @param whereJson
*/
void update(Map whereJson);
@@ -125,5 +151,11 @@ public interface DeviceAssignedService extends CommonService<DeviceAssigned> {
*/
void download(List<DeviceAssignedDto> dtos, HttpServletResponse response) throws IOException;
/**
* queryAssignedBydevice
* @param device_code
* @param task_nextdeice_code
* @return
*/
List<DeviceAssignedDto> queryAssignedBydevice(String device_code, String task_nextdeice_code);
}

View File

@@ -35,26 +35,47 @@ public interface DeviceDbitemService extends CommonService<DeviceDbitem> {
*/
List<DeviceDbitemDto> queryAll(DeviceDbitemQueryParam query);
/**
* 根据id获取DeviceDbitem
* @param id
* @return
*/
DeviceDbitem getById(String id);
/**
* 根据id获取DeviceDbitemDto
* @param id
* @return
*/
DeviceDbitemDto findById(String id);
/**
* 插入一条新数据。
* 插入
* @param resources
* @return
*/
int insert(DeviceDbitemDto resources);
/**
* 更新
* @param resources
* @return
*/
int updateById(DeviceDbitemDto resources);
/**
* 删除
* @param id
* @return
*/
int removeById(String id);
/**
* 批量删除
* @param ids
* @return
*/
int removeByIds(Set<String> ids);
/**
* 导出数据
* @param all 待导出的数据
* @param response /
* @throws IOException /
*/
// void download(List<DeviceDbitemDto> all, HttpServletResponse response) throws IOException;
}

View File

@@ -7,15 +7,43 @@ import org.nl.acs.device_driver.DeviceDriverDefination;
import java.util.List;
public interface DeviceDriverDefinationAppService {
/**
* 获取设备编码
* @return
*/
List<String> getDeviceDriverCodes();
/**
* 获取DeviceDriverDefination
* @param driverCode
* @return
*/
DeviceDriverDefination getDeviceDriverDefination(String driverCode);
/**
* 获取DeviceDriverDefinations
* @return
*/
List<DeviceDriverDefination> getDeviceDriverDefinations();
/**
* 根据DeviceType获取DeviceDriverDefinations
* @param var1
* @return
*/
List<DeviceDriverDefination> getDeviceDriverDefinations(DeviceType var1);
/**
* 是否有路由
* @param var1
* @return
*/
boolean isRoute(Class<? extends DeviceDriver> var1);
/**
* 是否有opc
* @param var1
* @return
*/
boolean isOpc(Class<? extends DeviceDriver> var1);
}

View File

@@ -37,20 +37,45 @@ public interface DeviceErpmappingService extends CommonService<DeviceErpmapping>
* @return List<DeviceErpmappingDto>
*/
List<AcsDeviceErpmappingDto> queryAll(DeviceErpmappingQueryParam query);
/**
* 根据id获取Dto
* @param id
* @return
*/
DeviceErpmapping getById(String id);
/**
* 根据id获取类
* @param id
* @return
*/
AcsDeviceErpmappingDto findById(String id);
/**
* 插入一条新数据。
* 插入
* @param resources
* @return
*/
int insert(AcsDeviceErpmappingDto resources);
/**
* 更新
* @param resources
* @return
*/
int updateById(AcsDeviceErpmappingDto resources);
/**
* 删除
* @param id
* @return
*/
int removeById(String id);
/**
* 批量删除
* @param ids
* @return
*/
int removeByIds(Set<String> ids);
/**

View File

@@ -36,20 +36,42 @@ public interface DeviceExtraService extends CommonService<DeviceExtra> {
* @return List<DeviceExtraDto>
*/
List<DeviceExtraDto> queryAll(DeviceExtraQueryParam query);
/**
* 根据id获取类
* @param id
* @return
*/
DeviceExtra getById(String id);
/**
* 根据id获取Dto
* @param id
* @return
*/
DeviceExtraDto findById(String id);
/**
* 插入一条新数据。
* 插入
* @param resources
* @return
*/
int insert(DeviceExtraDto resources);
/**
* 更新
* @param resources
* @return
*/
int updateById(DeviceExtraDto resources);
/**
* 删除
* @param id
* @return
*/
int removeById(String id);
/**
* 批量删除
* @param ids
* @return
*/
int removeByIds(Set<String> ids);
/**

View File

@@ -34,20 +34,42 @@ public interface DeviceRunpointService extends CommonService<DeviceRunpoint> {
* @return List<DeviceRunpointDto>
*/
List<DeviceRunpointDto> queryAll(DeviceRunpointQueryParam query);
/**
* 根据id获取类
* @param id
* @return
*/
DeviceRunpoint getById(String id);
/**
* 根据id获取Dto
* @param id
* @return
*/
DeviceRunpointDto findById(String id);
/**
* 插入一条新数据。
* 插入
* @param resources
* @return
*/
int insert(DeviceRunpointDto resources);
/**
* 更新
* @param resources
* @return
*/
int updateById(DeviceRunpointDto resources);
/**
* 删除
* @param id
* @return
*/
int removeById(String id);
/**
* 批量删除
* @param ids
* @return
*/
int removeByIds(Set<String> ids);
/**

View File

@@ -42,29 +42,45 @@ public interface DeviceService extends CommonService<Device> {
* @return List<DeviceDto>
*/
List<DeviceDto> queryAll(DeviceQueryParam query);
/**
* 根据id获取类
* @param id
* @return
*/
Device getById(String id);
/**
* 根据id获取Dto
* @param id
* @return
*/
DeviceDto findById(String id);
/**
* 插入一条新数据。
* 插入
* @param resources
* @return
*/
int insert(DeviceDto resources);
/**
* 更新
* @param resources
* @return
*/
int updateById(DeviceDto resources);
/**
* 删除
* @param id
* @return
*/
int removeById(String id);
/**
* 批量删除
* @param ids
* @return
*/
int removeByIds(Set<String> ids);
/**
* 导出数据
* @param all 待导出的数据
* @param response /
* @throws IOException /
*/
// void download(List<DeviceDto> all, HttpServletResponse response) throws IOException;
/**
* 查询数据分页

View File

@@ -34,27 +34,43 @@ public interface DeviceisonlineService extends CommonService<Deviceisonline> {
* @return List<DeviceisonlineDto>
*/
List<DeviceisonlineDto> queryAll(DeviceisonlineQueryParam query);
/**
* 根据id获取类
* @param id
* @return
*/
Deviceisonline getById(String id);
/**
* 根据id获取Dto
* @param id
* @return
*/
DeviceisonlineDto findById(String id);
/**
* 插入一条新数据。
* 插入
* @param resources
* @return
*/
int insert(DeviceisonlineDto resources);
/**
* 更新
* @param resources
* @return
*/
int updateById(DeviceisonlineDto resources);
/**
* 删除
* @param id
* @return
*/
int removeById(String id);
/**
* 批量删除
* @param ids
* @return
*/
int removeByIds(Set<String> ids);
/**
* 导出数据
* @param all 待导出的数据
* @param response /
* @throws IOException /
*/
// void download(List<DeviceisonlineDto> all, HttpServletResponse response) throws IOException;
}

View File

@@ -40,11 +40,9 @@ import java.util.*;
*/
@Service
@AllArgsConstructor
// @CacheConfig(cacheNames = DeviceAssignedService.CACHE_KEY)
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedMapper, DeviceAssigned> implements DeviceAssignedService {
// private final RedisUtils redisUtils;
private final DeviceAssignedMapper deviceAssignedMapper;
@Override
@@ -65,7 +63,6 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
}
@Override
// @Cacheable(key = "'id:' + #p0")
public DeviceAssignedDto findById(String id) {
return ConvertUtil.convert(getById(id), DeviceAssignedDto.class);
}
@@ -82,14 +79,12 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
public int updateById(DeviceAssignedDto resources) {
DeviceAssigned entity = ConvertUtil.convert(resources, DeviceAssigned.class);
int ret = deviceAssignedMapper.updateById(entity);
// delCaches(resources.id);
return ret;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int removeByIds(Set<String> ids) {
// delCaches(ids);
return deviceAssignedMapper.deleteBatchIds(ids);
}
@@ -101,38 +96,8 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
return this.removeByIds(set);
}
/*
private void delCaches(String id) {
redisUtils.delByKey(CACHE_KEY + "::id:", id);
}
private void delCaches(Set<String> ids) {
for (String id: ids) {
delCaches(id);
}
}*/
/*
@Override
public void download(List<DeviceAssignedDto> all, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (DeviceAssignedDto deviceAssigned : all) {
Map<String,Object> map = new LinkedHashMap<>();
map.put("设备编码", deviceAssigned.getDeviceCode());
map.put("指令终点", deviceAssigned.getInstNextdeviceCode());
map.put("任务终点", deviceAssigned.getTaskNextdeviceCode());
map.put("参数", deviceAssigned.getParam());
map.put("备注", deviceAssigned.getRemark());
map.put("是否启用", deviceAssigned.getIsActive());
map.put("是否删除", deviceAssigned.getIsDelete());
map.put("创建者", deviceAssigned.getCreateBy());
map.put("创建时间", deviceAssigned.getCreateTime());
map.put("修改者", deviceAssigned.getUpdateBy());
map.put("修改时间", deviceAssigned.getUpdateTime());
list.add(map);
}
FileUtil.downloadExcel(list, response);
}*/
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
@@ -151,21 +116,6 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
return ConvertUtil.convertList(list, DeviceAssignedDto.class);
}
// @Override
// public DeviceAssignedDto findById(String assigned_id) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_assigned");
// JSONObject json = wo.query("assigned_id ='" + assigned_id + "'").uniqueResult(0);
// final DeviceAssignedDto obj = json.toJavaObject(DeviceAssignedDto.class);
// return obj;
// }
// @Override
// public DeviceAssignedDto findByCode(String code) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_assigned");
// JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
// final DeviceAssignedDto obj = json.toJavaObject(DeviceAssignedDto.class);
// return obj;
// }
@Override
@Transactional(rollbackFor = Exception.class)
@@ -266,20 +216,6 @@ public class DeviceAssignedServiceImpl extends CommonServiceImpl<DeviceAssignedM
@Override
public List<DeviceAssignedDto> queryAssignedBydevice(String device_code, String task_nextdeice_code) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_assigned");
// JSONArray arr = wo.query("device_code ='" + device_code + "' and task_nextDevice_code= '" + task_nextdeice_code + "'").getResultJSONArray(0);
// List<DeviceAssignedDto> list = new ArrayList();
// for (int i = 0; i < arr.size(); i++) {
// JSONObject jo = arr.getJSONObject(i);
// DeviceAssignedDto dto = new DeviceAssignedDto();
// dto.setAssigned_id(jo.getString("assigned_id"));
// dto.setDevice_code(jo.getString("device_code"));
// dto.setInst_nextdevice_code(jo.getString("inst_nextdevice_code"));
// dto.setTask_nextdevice_code(jo.getString("task_nextdevice_code"));
// dto.setParam(jo.getString("param"));
// list.add(dto);
// }
// return list;
List<DeviceAssigned> list = new LambdaQueryChainWrapper<>(deviceAssignedMapper)
.eq(DeviceAssigned::getDevice_code, device_code)

View File

@@ -15,10 +15,6 @@ import org.nl.acs.device.service.mapper.DeviceDbitemMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import java.util.*;
@@ -29,11 +25,9 @@ import java.util.*;
*/
@Service
@AllArgsConstructor
// @CacheConfig(cacheNames = DeviceDbitemService.CACHE_KEY)
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class DeviceDbitemServiceImpl extends CommonServiceImpl<DeviceDbitemMapper, DeviceDbitem> implements DeviceDbitemService {
// private final RedisUtils redisUtils;
private final DeviceDbitemMapper deviceDbitemMapper;
@Override
@@ -54,7 +48,6 @@ public class DeviceDbitemServiceImpl extends CommonServiceImpl<DeviceDbitemMappe
}
@Override
// @Cacheable(key = "'id:' + #p0")
public DeviceDbitemDto findById(String id) {
return ConvertUtil.convert(getById(id), DeviceDbitemDto.class);
}

View File

@@ -28,10 +28,6 @@ import org.nl.config.language.LangProcess;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;
@@ -127,23 +123,6 @@ public class DeviceErpmappingServiceImpl extends CommonServiceImpl<DeviceErpmapp
return ConvertUtil.convertList(list, AcsDeviceErpmappingDto.class);
}
// @Override
// public AcsDeviceErpmappingDto findById(String device_id) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_erpmapping");
// JSONObject json = wo.query("device_id ='" + device_id + "'").uniqueResult(0);
//
// final AcsDeviceErpmappingDto obj = json.toJavaObject(AcsDeviceErpmappingDto.class);
// return obj;
// }
// @Override
// public AcsDeviceErpmappingDto findByCode(String code) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_erpmapping");
// JSONObject json = wo.query("code ='" + code + "'").uniqueResult(0);
// final AcsDeviceErpmappingDto obj = json.toJavaObject(AcsDeviceErpmappingDto.class);
// return obj;
// }
@Override
@Transactional(rollbackFor = Exception.class)
public void create(AcsDeviceErpmappingDto dto) {
@@ -151,13 +130,9 @@ public class DeviceErpmappingServiceImpl extends CommonServiceImpl<DeviceErpmapp
if (StrUtil.isEmpty(device_code)) {
throw new BadRequestException("设备编号不能为空!");
}
// JSONObject device = WQLObject.getWQLObject("acs_device").query("device_code = '" + device_code + "'").uniqueResult(0);
Device device = new LambdaQueryChainWrapper<>(deviceMapper)
.eq(Device::getDevice_code, device_code)
.one();
// JSONObject device = JSONObject.parseObject(JSON.toJSONString(device));
//判断该设备是否已经插入映射表
// JSONObject map = WQLObject.getWQLObject("acs_device_erpMapping").query("device_id = '" + device.getString("device_id") + "'").uniqueResult(0);
DeviceErpmapping map = new LambdaQueryChainWrapper<>(deviceErpmappingMapper)
.eq(DeviceErpmapping::getDevice_id, device.getDevice_id())
.one();
@@ -180,10 +155,6 @@ public class DeviceErpmappingServiceImpl extends CommonServiceImpl<DeviceErpmapp
if (entity == null) {
throw new BadRequestException(LangProcess.msg("error_sysAuth"));
}
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
DeviceErpmapping deviceErpmapping = ConvertUtil.convert(dto, DeviceErpmapping.class);
deviceErpmappingMapper.updateById(deviceErpmapping);
}

View File

@@ -102,43 +102,6 @@ public class DeviceExtraServiceImpl extends CommonServiceImpl<DeviceExtraMapper,
return this.removeByIds(set);
}
/*
private void delCaches(String id) {
redisUtils.delByKey(CACHE_KEY + "::id:", id);
}
private void delCaches(Set<String> ids) {
for (String id: ids) {
delCaches(id);
}
}*/
/*
@Override
public void download(List<DeviceExtraDto> all, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (DeviceExtraDto deviceExtra : all) {
Map<String,Object> map = new LinkedHashMap<>();
map.put("字段编码", deviceExtra.getExtraCode());
map.put("字段名字", deviceExtra.getExtraName());
map.put("字段值", deviceExtra.getExtraValue());
map.put("扩展值类型", deviceExtra.getValueType());
map.put("扩展字段类型", deviceExtra.getFiledType());
map.put("顺序号", deviceExtra.getOrderSeq());
map.put("设备标识", deviceExtra.getDeviceId());
map.put("设备编码", deviceExtra.getDeviceCode());
map.put("备注", deviceExtra.getRemark());
map.put("是否启用", deviceExtra.getIsActive());
map.put("是否删除", deviceExtra.getIsDelete());
map.put("创建者", deviceExtra.getCreateBy());
map.put("创建时间", deviceExtra.getCreateTime());
map.put("修改者", deviceExtra.getUpdateBy());
map.put("修改时间", deviceExtra.getUpdateTime());
list.add(map);
}
FileUtil.downloadExcel(list, response);
}*/
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
@@ -157,21 +120,6 @@ public class DeviceExtraServiceImpl extends CommonServiceImpl<DeviceExtraMapper,
return ConvertUtil.convertList(list, DeviceExtraDto.class);
}
// @Override
// public DeviceExtraDto findById(String extra_id) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_extra");
// JSONObject json = wo.query("extra_id ='" + extra_id + "'").uniqueResult(0);
// final DeviceExtraDto obj = json.toJavaObject(DeviceExtraDto.class);
// return obj;
// }
// @Override
// public DeviceExtraDto findByCode(String code) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_extra");
// JSONObject json = wo.query("extra_code ='" + code + "'").uniqueResult(0);
// final DeviceExtraDto obj = json.toJavaObject(DeviceExtraDto.class);
// return obj;
// }
@Override
@Transactional(rollbackFor = Exception.class)
@@ -219,7 +167,6 @@ public class DeviceExtraServiceImpl extends CommonServiceImpl<DeviceExtraMapper,
public void deleteAllByDeviceIds(String[] deviceIds) {
LambdaQueryWrapper<DeviceExtra> wrapper = new LambdaQueryWrapper<>();
for (String device_id : deviceIds) {
// wrapper.in(DeviceExtra::getFiled_type,"02","03");
wrapper.eq(DeviceExtra::getDevice_id, device_id);
deviceExtraMapper.delete(wrapper);
}

View File

@@ -15,10 +15,6 @@ import org.nl.acs.device.service.mapper.DeviceRunpointMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import java.util.*;

View File

@@ -18,6 +18,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.map.ListOrderedMap;
import org.nl.acs.auto.initial.ApplicationAutoInitial;
import org.nl.acs.common.base.CommonFinalParam;
import org.nl.acs.device.device_driver.standard_inspect.ItemDto;
import org.nl.acs.device.domain.Device;
import org.nl.acs.device.domain.DeviceExtra;
@@ -27,10 +28,6 @@ import org.nl.acs.device.domain.DeviceRunpoint;
import org.nl.acs.device.service.mapper.DeviceRunpointMapper;
import org.nl.acs.route.domain.RouteLine;
import org.nl.acs.route.service.mapper.RouteLineMapper;
//import org.nl.acs.stage.domain.Stage;
//import org.nl.acs.stage.domain.StageActor;
//import org.nl.acs.stage.service.mapper.StageActorMapper;
//import org.nl.acs.stage.service.mapper.StageMapper;
import org.nl.acs.storage_cell.domain.StorageCell;
import org.nl.acs.storage_cell.service.mapper.StorageCellMapper;
import org.nl.acs.utils.ConvertUtil;
@@ -81,10 +78,6 @@ import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import org.springframework.web.multipart.MultipartFile;
@@ -143,7 +136,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
}
@Override
// @Cacheable(key = "'id:' + #p0")
public DeviceDto findById(String id) {
return ConvertUtil.convert(getById(id), DeviceDto.class);
}
@@ -179,47 +171,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
return this.removeByIds(set);
}
/*
private void delCaches(String id) {
redisUtils.delByKey(CACHE_KEY + "::id:", id);
}
private void delCaches(Set<String> ids) {
for (String id: ids) {
delCaches(id);
}
}*/
/*
@Override
public void download(List<DeviceDto> all, HttpServletResponse response) throws IOException {
List<Map<String, Object>> list = new ArrayList<>();
for (DeviceDto device : all) {
Map<String,Object> map = new LinkedHashMap<>();
map.put("设备编码", device.getDeviceCode());
map.put("设备名字", device.getDeviceName());
map.put("设备类型", device.getDeviceType());
map.put("所属区域", device.getRegion());
map.put("生产厂家", device.getManufacturer());
map.put("生产厂家电话", device.getManufacturerPhone());
map.put("是否配置", device.getIsConfig());
map.put("opcServer标识", device.getOpcServerId());
map.put("opcPlc标识", device.getOpcPlcId());
map.put("是否为路由设备", device.getIsRoute());
map.put("设备驱动类型", device.getDriverCode());
map.put("备注", device.getRemark());
map.put("是否启用", device.getIsActive());
map.put("顺序号", device.getSeqNum());
map.put("是否删除", device.getIsDelete());
map.put("创建者", device.getCreateBy());
map.put("创建时间", device.getCreateTime());
map.put("修改者", device.getUpdateBy());
map.put("修改时间", device.getUpdateTime());
map.put("地址号", device.getAddress());
list.add(map);
}
FileUtil.downloadExcel(list, response);
}*/
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
@@ -268,13 +219,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
return ConvertUtil.convertList(deviceList, DeviceDto.class);
}
// @Override
// public DeviceDto findById(String device_id) {
// WQLObject wo = WQLObject.getWQLObject("acs_device");
// JSONObject json = wo.query("device_id ='" + device_id + "'").uniqueResult(0);
// final DeviceDto obj = json.toJavaObject(DeviceDto.class);
// return obj;
// }
@Override
public DeviceDto findByCode(String code) {
@@ -287,9 +232,10 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
@Override
@Transactional(rollbackFor = Exception.class)
public void create(DeviceDto dto) {
CommonFinalParam commonFinalParam = new CommonFinalParam();
String device_code = dto.getDevice_code();
DeviceDto deviceDto = this.findByCode(device_code);
if (deviceDto != null && deviceDto.getIs_delete().equals("0")) {
if (deviceDto != null && commonFinalParam.getDELETE().equals(deviceDto.getIs_delete())) {
throw new BadRequestException(LangProcess.msg("error_checkExist", device_code));
}
@@ -314,10 +260,10 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
if (entity == null) {
throw new BadRequestException(LangProcess.msg("error_sysAuth"));
}
CommonFinalParam commonFinalParam = new CommonFinalParam();
String device_code = dto.getDevice_code();
DeviceDto deviceDto = this.findByCode(device_code);
if (deviceDto != null && deviceDto.getIs_delete().equals("0")
if (deviceDto != null && commonFinalParam.getDELETE().equals(deviceDto.getIs_delete())
&& !deviceDto.getDevice_id().equals(dto.getDevice_id())) {
throw new BadRequestException(LangProcess.msg("error_checkExist", device_code));
}
@@ -335,14 +281,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteAll(String[] ids) {
// WQLObject wo = WQLObject.getWQLObject("acs_device");
// WQLObject storageTab = WQLObject.getWQLObject("acs_storage_cell");
// //路由路线表【acs_route_line】
// WQLObject routeLineTab = WQLObject.getWQLObject("acs_route_line");
// //路由路线表【stage_actor】
// WQLObject stageActorTab = WQLObject.getWQLObject("stage_actor");
for (String device_id : ids) {
// JSONObject deviceJson = wo.query("device_id = '" + device_id + "'").uniqueResult(0);
Device deviceJson = new LambdaQueryChainWrapper<>(deviceMapper)
.eq(Device::getDevice_id, device_id)
.one();
@@ -351,7 +290,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
}
String device_code = deviceJson.getDevice_code();
log.debug("删除设备时候判断路由是否存在,如果存在,则不允许删除设备!");
// JSONObject json = routeLineTab.query("device_code = '" + device_code + "' or next_device_code = '" + device_code + "'").uniqueResult(0);
RouteLine json = new LambdaQueryChainWrapper<>(routeLineMapper)
.eq(RouteLine::getDevice_code, device_code)
.or().eq(RouteLine::getNext_device_code, device_code)
@@ -360,24 +298,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
throw new BadRequestException(LangProcess.msg("device_checkRoute", device_code));
}
log.debug("删除舞台里面的设备!");
// Map<String, String> map = new HashMap<>();
// map.put("device_id", "");
// map.put("device_code", "");
// map.put("device_name", "");
// stageActorTab.update(map, "device_code = '" + device_code + "'");
// stageActorMapper.lambdaUpdate().eq(StageActor::getDevice_code,device_code)
// .set(StageActor::getDevice_code,"")
// .set(StageActor::getDevice_name,"")
// .update();
log.debug("根据设备编码查询在缓存里面的舞台数据,并删除掉!");
// JSONArray jsonArr = WQL.getWO("QStage_01").addParam("flag", "1").addParam("device_code", device_code).process().getResultJSONArray(0);
// List<Stage> stageList = stageMapper.selectByDeviceCode(device_code);
// for (int i = 0; i < stageList.size(); i++) {
// String stage_code = stageList.get(i).getStage_code();
// redisUtils.del("stage:mst:" + stage_code);
// redisUtils.del("stage:dtl:" + stage_code);
// }
log.debug("删除缓存里面的设备!");
Device deviceByCode = deviceAppService.findDeviceByCode(device_code);
List<Device> allDevice = deviceAppService.findAllDevice();
@@ -390,27 +311,22 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
}
// allDevice.remove(deviceByCode);
log.info("设备删除成功!");
if (deviceByCode != null) {
if (StrUtil.equals("storage", deviceByCode.getDeviceDriverDefination().getFitDeviceTypes().get(0).name())) {
// storageTab.delete("substring_index( storage_code,'-',1)= '" + device_code + "'");
storageCellMapper.deleteByStorageCode(device_code);
} else {
// JSONObject data = storageTab.query("storage_code ='" + device_code + "'").uniqueResult(0);
StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper)
.eq(StorageCell::getStorage_code, device_code)
.one();
if (storageCell != null) {
// storageTab.delete("storage_code = '" + device_code + "'");
Map<String, Object> map = new HashMap<>();
map.put("storage_code", device_code);
storageCellMapper.deleteByMap(map);
}
}
}
// wo.delete("device_id = '" + device_id + "'");
Map<String, Object> map = new HashMap<>();
map.put("device_id", device_id);
deviceMapper.deleteByMap(map);
@@ -497,7 +413,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
@Override
public JSONArray selectConveyorList() {
//设备基础信息表【acs_device】
// JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND device_type = 'conveyor'").getResultJSONArray(0);
List<Device> deviceList = new LambdaQueryChainWrapper<>(deviceMapper)
.apply("is_delete= '0' AND is_active= '1' AND device_type = 'conveyor'")
.list();
@@ -623,14 +538,11 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
@Override
public JSONArray selectDeviceListTwo() {
//设备基础信息表【acs_device】
// JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region = '2'", "seq_num").getResultJSONArray(0);
List<Device> deviceList = new LambdaQueryChainWrapper<>(deviceMapper)
.apply("is_delete= '0' AND is_active= '1' AND region = '2'")
.orderByAsc(Device::getSeq_num)
.list();
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(deviceList));
//acs_device_extra
// WQLObject extraTab = WQLObject.getWQLObject("acs_device_extra");
JSONArray result = new JSONArray();
for (int i = 0; i < arr.size(); i++) {
JSONObject obj = arr.getJSONObject(i);
@@ -647,7 +559,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial());
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark());
}
// JSONArray extraArr = extraTab.query("device_id = '" + obj.getString("device_id") + "'").getResultJSONArray(0);
List<DeviceExtra> deviceExtraList = new LambdaQueryChainWrapper<>(deviceExtraMapper)
.eq(DeviceExtra::getDevice_id, obj.getString("device_id"))
.list();
@@ -681,14 +592,12 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
@Override
public JSONArray selectDeviceListThree() {
//设备基础信息表【acs_device】
// JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' AND region = '3'", "seq_num").getResultJSONArray(0);
List<Device> deviceList = new LambdaQueryChainWrapper<>(deviceMapper)
.apply("is_delete= '0' AND is_active= '1' AND region = '3'")
.orderByAsc(Device::getSeq_num)
.list();
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(deviceList));
//acs_device_extra
// WQLObject extraTab = WQLObject.getWQLObject("acs_device_extra");
JSONArray result = new JSONArray();
for (int i = 0; i < arr.size(); i++) {
JSONObject obj = arr.getJSONObject(i);
@@ -705,7 +614,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
json.put("material_type", standardOrdinarySiteDeviceDriver.getMaterial());
json.put("remark", standardOrdinarySiteDeviceDriver.getRemark());
}
// JSONArray extraArr = extraTab.query("device_id = '" + obj.getString("device_id") + "'").getResultJSONArray(0);
List<DeviceExtra> deviceExtraList = new LambdaQueryChainWrapper<>(deviceExtraMapper)
.eq(DeviceExtra::getDevice_id, obj.getString("device_id"))
.list();
@@ -742,7 +650,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
JSONArray deviceInfo = new JSONArray();
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
// JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' and region != '' and is_config= 'true' ").getResultJSONArray(0);
List<Device> deviceList = new LambdaQueryChainWrapper<>(deviceMapper)
.apply("is_delete= '0' AND is_active= '1' and region != '' and is_config= 'true' ")
.list();
@@ -750,7 +657,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
JSONArray result = new JSONArray();
// status=2 代表查询请求的设备 =3代表查询相应的设备
if (status.equals("2")) {
if ("2".equals(status)) {
for (int i = 0; i < arr.size(); i++) {
JSONObject devicejo = new JSONObject();
JSONObject obj = arr.getJSONObject(i);
@@ -772,7 +679,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
}
}
}
} else if (status.equals("3")) {
} else if ("3".equals(status)) {
for (int i = 0; i < arr.size(); i++) {
JSONObject devicejo = new JSONObject();
JSONObject obj = arr.getJSONObject(i);
@@ -815,28 +722,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
}
}
}
// for(int i=0; i<result.size(); i++) {
// JSONObject jo = (JSONObject) result.get(i);
// JSONObject devicejo = new JSONObject();
// String device_id = jo.getString("device_id");
// String device_code = jo.getString("device_code");
// String device_name = jo.getString("device_name");
// Device device = appService.findDeviceByCode(device_code);
// if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) {
// standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver();
// int branchProtocol = standardOrdinarySiteDeviceDriver.getBranchProtocol();
// devicejo.put("device_code",device_code);
// devicejo.put("branchProtocol",branchProtocol);
// devicejo.put("qty",standardOrdinarySiteDeviceDriver.getQty());
// devicejo.put("material",standardOrdinarySiteDeviceDriver.getMaterial());
// devicejo.put("status",standardOrdinarySiteDeviceDriver.isRequireSucess());
//
// deviceInfo.add(devicejo);
// }
// }
return deviceInfo;
}
@@ -873,7 +758,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
dto.setDriver_code(parentForm.getString("driver_code"));
dto.setOpc_plc_id(opc_plc_id);
dto.setOpc_server_id(opc_server_id);
//dto.setIs_config("true");
if (StrUtil.isEmpty(address)) {
dto.setAddress("0");
} else {
@@ -895,10 +779,8 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
//判断是否存在并开启站点管理
if (form.containsKey("station_manager")) {
// WQLObject wo = WQLObject.getWQLObject("acs_device_runpoint");
if ("true".equals(form.get("station_manager").toString())) {
//判断数据库记录是否存在 不存在则新增 存在则修改
// JSONObject json = wo.query("device_id ='" + device_id + "'").uniqueResult(0);
DeviceRunpoint deviceRunpoint = new LambdaQueryChainWrapper<>(deviceRunpointMapper)
.eq(DeviceRunpoint::getDevice_id, device_id)
.one();
@@ -932,8 +814,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
if (data1 != null) {
//处理读的DB字段
//设备扩展表【acs_device_extra】
// WQLObject wo = WQLObject.getWQLObject("acs_device_extra");
// wo.delete("device_id = '" + device_id + "' and filed_type = '02'");
LambdaQueryWrapper<DeviceExtra> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DeviceExtra::getDevice_id, device_id);
wrapper.eq(DeviceExtra::getFiled_type, "02");
@@ -953,7 +833,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
param.put("device_code", device_code);
param.put("create_by", SecurityUtils.getCurrentUsername());
param.put("create_time", DateUtil.now());
// wo.insert(param);
DeviceExtra entity = ConvertUtil.convert(param, DeviceExtra.class);
deviceExtraMapper.insert(entity);
}
@@ -981,13 +860,11 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
param.put("device_code", device_code);
param.put("create_by", SecurityUtils.getCurrentUsername());
param.put("create_time", DateUtil.now());
// wo.insert(param);
DeviceExtra entity = ConvertUtil.convert(param, DeviceExtra.class);
deviceExtraMapper.insert(entity);
}
}
// WQLObject wo = WQLObject.getWQLObject("acs_storage_cell");
if (StrUtil.equals(device_type, "storage")) {
int x = form.getInteger("x");
int maxY = form.getInteger("maxY");
@@ -996,7 +873,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
int minZ = form.getInteger("minZ");
for (int i = minY; i <= maxY; i++) {
for (int j = minZ; j <= maxZ; j++) {
// JSONObject json = wo.query("storage_code='" + device_code + "-" + formatNum(i) + "-" + formatNum(j) + "'").uniqueResult(0);
StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper)
.eq(StorageCell::getStorage_code, device_code + "-" + formatNum(i) + "-" + formatNum(j))
.one();
@@ -1008,10 +885,8 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
celldto.setX(formatNum(x));
celldto.setY(formatNum(i));
celldto.setZ(formatNum(j));
//celldto.setAddress(Integer.parseInt(CodeUtil.getNewCode("NDCADDRESS_NO")));
celldto.setCreate_by("init");
celldto.setCreate_time(SecurityUtils.getCurrentUsername());
// wo.insert((JSONObject) JSONObject.toJSON(celldto));
StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class);
storageCellMapper.insert(entity);
}
@@ -1022,7 +897,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
if (StrUtil.equals(driver_code, "standard_emptypallet_site") && form.containsKey("max_emptypalletnum")) {
int num = form.getInteger("max_emptypalletnum");
for (int i = 1; i < num + 1; i++) {
// JSONObject json = wo.query("storage_code ='" + device_code + "." + i + "'").uniqueResult(0);
StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper)
.eq(StorageCell::getStorage_code, device_code + "." + i)
.one();
@@ -1037,13 +911,11 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
celldto.setAddress(Integer.parseInt(CodeUtil.getNewCode("NDCADDRESS_NO")));
celldto.setCreate_by("init");
celldto.setCreate_time(SecurityUtils.getCurrentUsername());
// wo.insert((JSONObject) JSONObject.toJSON(celldto));
StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class);
storageCellMapper.insert(entity);
}
}
} else {
// JSONObject json = wo.query("storage_code ='" + device_code + "'").uniqueResult(0);
StorageCell storageCell = new LambdaQueryChainWrapper<>(storageCellMapper)
.eq(StorageCell::getStorage_code, device_code)
.one();
@@ -1058,7 +930,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
celldto.setAddress(Integer.parseInt(CodeUtil.getNewCode("NDCADDRESS_NO")));
celldto.setCreate_by("init");
celldto.setCreate_time(SecurityUtils.getCurrentUsername());
// wo.insert((JSONObject) JSONObject.toJSON(celldto));
StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class);
storageCellMapper.insert(entity);
}
@@ -1141,13 +1012,10 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
standardOrdinarySiteDeviceDriver.setBatch("");
device.setBatch("");
}
// WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
// JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0);
DeviceRunpoint deviceRunpoint = new LambdaQueryChainWrapper<>(deviceRunpointMapper)
.eq(DeviceRunpoint::getDevice_code, device_code)
.one();
if (!ObjectUtil.isEmpty(deviceRunpoint)) {
// DeviceRunpointDto obj = json.toJavaObject(DeviceRunpointDto.class);
deviceRunpoint.setHasgoods(hasGoodStatus);
deviceRunpoint.setMaterial_type(material_type);
deviceRunpoint.setBatch(batch);
@@ -1157,8 +1025,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
device.setQuantity(quantity);
device.setBatch(batch);
device.setIslock(islock);
// JSONObject updatejson = (JSONObject) JSONObject.toJSON(obj);
// runpointwo.update(updatejson, "device_code = '" + device_code + "'");
LambdaQueryWrapper<DeviceRunpoint> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(DeviceRunpoint::getDevice_code, device_code);
deviceRunpointMapper.delete(wrapper);
@@ -1381,7 +1247,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
}
// JSONArray arr = WQLObject.getWQLObject("acs_device_extra").query("filed_type ='01' and device_id = '" + device_id + "'").getResultJSONArray(0);
List<DeviceExtra> deviceExtraList = new LambdaQueryChainWrapper<>(deviceExtraMapper)
.eq(DeviceExtra::getDevice_id, device_id)
.eq(DeviceExtra::getFiled_type, "01")
@@ -1436,7 +1301,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
//判断是否配置过
if (json.getBoolean("is_config")) {
//设备扩展表【acs_device_extra】
// JSONArray rs = WQLObject.getWQLObject("acs_device_extra").query("filed_type='02' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0);
List<DeviceExtra> dList = new LambdaQueryChainWrapper<>(deviceExtraMapper)
.eq(DeviceExtra::getDevice_id, device_id)
.eq(DeviceExtra::getFiled_type, "02")
@@ -1453,7 +1317,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
JSONObject readableItemJson = new JSONObject();
readableItemJson.put("code", itemDto.getCode());
readableItemJson.put("name", itemDto.getName());
// readableItemJson.put("db",itemDto.getDb());
readableItemJsons.add(readableItemJson);
}
for (int i = 0; i < rs.size(); i++) {
@@ -1490,7 +1353,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
r_arry.add(readableItemJson);
}
}
// JSONArray ws = WQLObject.getWQLObject("acs_device_extra").query("filed_type='03' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0);
List<DeviceExtra> wsList = new LambdaQueryChainWrapper<>(deviceExtraMapper)
.eq(DeviceExtra::getDevice_id, device_id)
.eq(DeviceExtra::getFiled_type, "03")
@@ -1506,7 +1368,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
JSONObject writeableItemJson = new JSONObject();
writeableItemJson.put("code", itemDto.getCode());
writeableItemJson.put("name", itemDto.getName());
//writeableItemJson.put("db",itemDto.getDb());
writeableItemJsons.add(writeableItemJson);
}
for (int i = 0; i < ws.size(); i++) {
@@ -1739,8 +1600,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
@Override
public JSONArray selectDeviceListByType(String type) {
// JSONArray arr = WQLObject.getWQLObject("acs_device").query("is_delete= '0' AND is_active= '1' and device_type = '" + type + "' AND is_config = 'true'", "device_code").getResultJSONArray(0);
// return arr;
List<Device> deviceList = new LambdaQueryChainWrapper<>(deviceMapper)
.eq(Device::getIs_delete, "0")
.eq(Device::getIs_active, "1")
@@ -1754,18 +1614,11 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
@Override
public JSONObject queryStorageExtra(String device_code) {
// JSONObject device = WQLObject.getWQLObject("acs_device").query("device_code = '" + device_code + "'").uniqueResult(0);
Device device = new LambdaQueryChainWrapper<>(deviceMapper)
.eq(Device::getDevice_code, device_code)
.one();
String device_id = device.getDevice_id();
// WQLObject wo = WQLObject.getWQLObject("acs_device_extra");
JSONObject jo = new JSONObject();
// jo.put("maxY", wo.query("device_id = '" + device_id + "' AND extra_code = 'maxY'").uniqueResult(0).getString("extra_value"));
// jo.put("minY", wo.query("device_id = '" + device_id + "' AND extra_code = 'minY'").uniqueResult(0).getString("extra_value"));
// jo.put("maxZ", wo.query("device_id = '" + device_id + "' AND extra_code = 'maxZ'").uniqueResult(0).getString("extra_value"));
// jo.put("minZ", wo.query("device_id = '" + device_id + "' AND extra_code = 'minZ'").uniqueResult(0).getString("extra_value"));
// jo.put("tunnel", wo.query("device_id = '" + device_id + "' AND extra_code = 'tunnel'").uniqueResult(0).getString("extra_value"));
jo.put("maxY", new LambdaQueryChainWrapper<>(deviceExtraMapper).eq(DeviceExtra::getDevice_id, device_id).eq(DeviceExtra::getExtra_code, "maxY").one().getExtra_value());
jo.put("minY", new LambdaQueryChainWrapper<>(deviceExtraMapper).eq(DeviceExtra::getDevice_id, device_id).eq(DeviceExtra::getExtra_code, "minY").one().getExtra_value());
jo.put("maxZ", new LambdaQueryChainWrapper<>(deviceExtraMapper).eq(DeviceExtra::getDevice_id, device_id).eq(DeviceExtra::getExtra_code, "maxZ").one().getExtra_value());
@@ -1881,7 +1734,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
int numberSize = Integer.parseInt(form.getString("device_number"));
List<Map<String, Object>> list = new LinkedList<>();
if (type.equals("db")) {
if ("db".equals(type)) {
for (int i = 0; i < numberSize; i++) {
int dbInterval = db_interval * i;
Integer deviceCode = device_code + i;
@@ -1913,7 +1766,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
String db = rs.getString("db");
String name = rs.getString("name");
if (i > 0) {
if (name.equals("心跳")) {
if ("心跳".equals(name)) {
continue;
}
}
@@ -1954,7 +1807,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
}
}
}
} else if (type.equals("v")) {
} else if ("v".equals(type)) {
for (int i = 0; i < numberSize; i++) {
int dbInterval = db_interval * i;
Integer deviceCode = device_code + i;
@@ -1979,11 +1832,10 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
String db = rs.getString("db");
String name = rs.getString("name");
if (i > 0) {
if (name.equals("心跳")) {
if ("心跳".equals(name)) {
continue;
}
}
//String[] dbs = db.split("\\.");
String startDB = db.substring(0, 2);
String endDB = db.substring(2, db.length());
Integer endDBEnd = Integer.parseInt(endDB);
@@ -2077,9 +1929,9 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
//西门子200
if (!datatype.contains(".")) {
String[] split = datatype.split("");
if (split[1].equals("W")) {
if ("W".equals(split[1])) {
datatype = "Word";
} else if (split[1].equals("D")) {
} else if ("D".equals(split[1])) {
datatype = "DWord";
}
} else {
@@ -2122,7 +1974,7 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
//FX5U
if (!datatype.contains(".")) {
String[] split = datatype.split("");
if (split[1].equals("D")) {
if ("D".equals(split[1])) {
datatype = "Long";
}
} else {
@@ -2160,7 +2012,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
} catch (Exception e) {
e.printStackTrace();
}
// WQLObject wo = WQLObject.getWQLObject("acs_device");
// 调用用 hutool 方法读取数据 默认调用第一个sheet
ExcelReader excelReader = ExcelUtil.getReader(inputStream);
@@ -2208,7 +2059,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
param.put("update_time", now);
param.put("region", region);
// wo.insert(param);
Device entity = ConvertUtil.convert(param, Device.class);
deviceMapper.insert(entity);
}
@@ -2228,7 +2078,6 @@ public class DeviceServiceImpl extends CommonServiceImpl<DeviceMapper, Device> i
JSONObject ws = wss.getJSONObject(j - 1);
String db = ws.getString("db");
String name = ws.getString("name");
//String[] dbs = db.split("\\.");
String startDB = db.substring(0, 2);
String endDB = db.substring(2, db.length());
Integer endDBEnd = Integer.parseInt(endDB);

View File

@@ -15,10 +15,6 @@ import org.nl.acs.device.service.mapper.DeviceisonlineMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import java.util.*;

View File

@@ -35,13 +35,28 @@ public interface DeviceExtraMapper extends CommonMapper<DeviceExtra> {
/**
* 设备协议分页查询
* @param page
* @param queryWrapper
* @param <P>
* @return
*/
@Select(wrapperDeviceProtocolSql)
<P extends IPage<DeviceExtra>> P queryDeviceProtocolPage(P page, @Param("ew") Wrapper<DeviceExtra> queryWrapper);
/**
* 获取扩展类
* @param queryWrapper
* @return
*/
@Select(wrapperDeviceProtocolSql)
List<DeviceExtra> selectDeviceProtocolList(@Param("ew") Wrapper<DeviceExtra> queryWrapper);
/**
* 根据id、code获取扩展类
* @param device_id
* @param extra_code
* @return
*/
@Select("select * from lzhl_two_acs.acs_device_extra where device_id=#{device_id} and extra_code=#{extra_code} order by create_time desc")
DeviceExtra findByDeviceId(@Param("device_id") String device_id, @Param("extra_code") String extra_code);
}

View File

@@ -65,10 +65,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;

View File

@@ -15,10 +15,6 @@ import org.nl.acs.labeling_template.service.mapper.LabelingTemplateMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import java.util.*;

View File

@@ -34,7 +34,6 @@ public class OpcController {
@GetMapping
@Log("查询opc")
@ApiOperation("查询opc")
//@PreAuthorize("@el.check('opc:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(opcService.queryAll(whereJson, page), HttpStatus.OK);
}

View File

@@ -30,10 +30,6 @@ import org.nl.config.language.LangProcess;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;

View File

@@ -15,10 +15,6 @@ import org.nl.acs.produceshiftorder.service.mapper.ProduceshiftorderMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import java.util.*;

View File

@@ -15,10 +15,6 @@ import org.nl.acs.produceshiftorderdetail.service.mapper.Produceshiftorderdetail
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import java.util.*;

View File

@@ -34,7 +34,6 @@ public class RouteLineController {
@GetMapping
@Log("查询路由路线")
@ApiOperation("查询路由路线")
//@PreAuthorize("@el.check('routeLine:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(routeLineService.queryAll(whereJson, page), HttpStatus.OK);
}

View File

@@ -33,7 +33,6 @@ public class RouteLocController {
@GetMapping
@Log("查询路由坐标")
@ApiOperation("查询路由坐标")
//@PreAuthorize("@el.check('routeLoc:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(routeLocService.queryAll(whereJson, page), HttpStatus.OK);
}

View File

@@ -33,7 +33,6 @@ public class RoutePlanController {
@GetMapping
@Log("查询路由方案")
@ApiOperation("查询路由方案")
//@PreAuthorize("@el.check('routePlan:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(routePlanService.queryAll(whereJson, page), HttpStatus.OK);
}

View File

@@ -36,12 +36,7 @@ public class TaskController {
@GetMapping
@Log("查询任务")
@ApiOperation("查询任务")
//@PreAuthorize("@el.check('task:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
// return new ResponseEntity<>(taskService.queryAllByCache(whereJson, page), HttpStatus.OK);
/*if(ObjectUtil.isEmpty(whereJson.get("status"))) {
whereJson.put("status", "1");
}*/
return new ResponseEntity<>(taskService.queryAll(whereJson, page), HttpStatus.OK);
}

View File

@@ -67,10 +67,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;
import javax.servlet.http.HttpServletResponse;