|
@@ -195,7 +195,7 @@ public class TEquipmentController {
|
|
|
if (StringUtils.isNotEmpty(clientId)) {
|
|
|
query.like(TEquipment::getClientId, clientId);
|
|
|
}
|
|
|
- if (StringUtils.isNotEmpty(adminName) && !"admin".equals(adminName)) {
|
|
|
+ if (StringUtils.isNotEmpty(adminName) && !"sysMgtAcc".equals(adminName)) {
|
|
|
LambdaQueryWrapper<TAdmin> adminQuery = Wrappers.lambdaQuery();
|
|
|
adminQuery.eq(TAdmin::getUsername, adminName);
|
|
|
List<TAdmin> list = tAdminService.list(adminQuery);
|
|
@@ -428,18 +428,14 @@ public class TEquipmentController {
|
|
|
@ApiOperation(value = "adminId查找设备")
|
|
|
@GetMapping("/listEquipment")
|
|
|
public ResponseModel<?> listEquipment(String adminId) {
|
|
|
- UserDetailBO userDetailBO = Optional.ofNullable(tokenManager.getLoginUserDetails())
|
|
|
- .orElseThrow(() -> new BizException(ResponseCodesEnum.L0001));
|
|
|
- String authId = userDetailBO.getId().toString();
|
|
|
-
|
|
|
LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
|
|
|
- TAdmin admin = tAdminService.getById(authId);
|
|
|
+ TAdmin admin = tAdminService.getById(adminId);
|
|
|
Integer type = admin.getType();
|
|
|
if (type < 2) {
|
|
|
query.eq(TEquipment::getAdminId, 238);
|
|
|
}
|
|
|
if (type == 2) {
|
|
|
- query.eq(TEquipment::getAdminId, authId);
|
|
|
+ query.eq(TEquipment::getAdminId, adminId);
|
|
|
}
|
|
|
|
|
|
if (type == 3) {
|
|
@@ -632,7 +628,7 @@ public class TEquipmentController {
|
|
|
|
|
|
List<TAdminDTO> resultList = new ArrayList<>();
|
|
|
|
|
|
- if ("admin".equals(param.getUsername())) { // 管理员查所有商家
|
|
|
+ if ("sysMgtAcc".equals(param.getUsername())) { // 管理员查所有商家
|
|
|
List<TAdmin> adminList = tAdminService.list();
|
|
|
List<TEquipment> equipmentList = tEquipmentService.list();
|
|
|
List<TAlarmRecord> alarmRecordList = tAlarmRecordService.list();
|
|
@@ -907,16 +903,10 @@ public class TEquipmentController {
|
|
|
@ApiOperation(value = "获取机器数量")
|
|
|
@PostMapping("/getMachineNum")
|
|
|
public ResponseModel<?> getMachineNum(@RequestBody StatisticsParam param) {
|
|
|
- UserDetailBO userDetailBO = Optional.ofNullable(tokenManager.getLoginUserDetails())
|
|
|
- .orElseThrow(() -> new BizException(ResponseCodesEnum.L0001));
|
|
|
-
|
|
|
String machineTotalNum;
|
|
|
String machineUseNum;
|
|
|
String equipmentId = param.getEquipmentId();
|
|
|
-
|
|
|
- String paramAdminId = userDetailBO.getId().toString();
|
|
|
-// String paramAdminId = param.getAdminId();
|
|
|
-
|
|
|
+ String paramAdminId = param.getAdminId();
|
|
|
TAdmin admin = tAdminService.getById(paramAdminId);
|
|
|
Integer type = admin.getType();
|
|
|
if (type < 2) {
|
|
@@ -1197,7 +1187,7 @@ public class TEquipmentController {
|
|
|
Long id = Long.valueOf(equipmentId);
|
|
|
TEquipment equipment = tEquipmentService.getById(id);
|
|
|
if (equipment == null) {
|
|
|
- return R.fail(F0002,"设备不存在");
|
|
|
+ return R.fail(F0002, "设备不存在");
|
|
|
}
|
|
|
tEquipmentService.sentMessage(equipment.getClientId(), PushUtils.buildJson("machineReset", "machineReset").toString());
|
|
|
return R.ok();
|
|
@@ -1248,7 +1238,7 @@ public class TEquipmentController {
|
|
|
@PostMapping("/getEquipmentListByProvince")
|
|
|
public ResponseEntity<?> getEquipmentListByProvince(@RequestBody TAdmin param) {
|
|
|
List<TAdminDTO> resultList = new ArrayList<>();
|
|
|
- if ("admin".equals(param.getUsername())) { // 管理员查所有商家
|
|
|
+ if ("sysMgtAcc".equals(param.getUsername())) { // 管理员查所有商家
|
|
|
//获取有多少个省份
|
|
|
List<TArea> list1 = tAreaService.getProvinceList();
|
|
|
Map<Long, String> map1 = new HashMap<>();
|
|
@@ -1593,8 +1583,8 @@ public class TEquipmentController {
|
|
|
* 下载日志
|
|
|
*
|
|
|
* @param equipmentId 设备id
|
|
|
- * @param day 日期
|
|
|
- * @param response 响应
|
|
|
+ * @param day 日期
|
|
|
+ * @param response 响应
|
|
|
*/
|
|
|
@ApiOperation(value = "下载日志")
|
|
|
@GetMapping("/downloadLog")
|