|
@@ -37,8 +37,8 @@ import java.util.*;
|
|
|
//@Api(value = "/api/app_equipment/index", tags = {"设备信息上传接口"})
|
|
|
@Api(value = "/indexController", tags = {"设备信息上传接口"})
|
|
|
@RestController
|
|
|
-//@RequestMapping("/api/app_equipment/index")
|
|
|
-@RequestMapping("/indexController")
|
|
|
+@RequestMapping("/api/app_equipment/index")
|
|
|
+//@RequestMapping("/indexController")
|
|
|
public class IndexController { ;
|
|
|
@Autowired
|
|
|
TAdminService adminService;
|
|
@@ -58,7 +58,7 @@ public class IndexController { ;
|
|
|
TPromoCodeService promoCodeService;
|
|
|
@ApiOperation(value = "心跳")
|
|
|
@PostMapping("/heart.htm")
|
|
|
- public String heart(@RequestBody EquipmentVo equipmentVo) {
|
|
|
+ public JsonMessage heart(@RequestBody EquipmentVo equipmentVo) {
|
|
|
|
|
|
String clientId = equipmentVo.getClientId();
|
|
|
Date lastUpdateTime = equipmentVo.getLastUpdateTime();
|
|
@@ -140,11 +140,11 @@ public class IndexController { ;
|
|
|
equipmentDesc.setStick(equipmentVo.getStick());
|
|
|
}
|
|
|
equipmentDescService.updateById(equipmentDesc);
|
|
|
-// return JsonMessage.success("心跳成功");
|
|
|
- return "心跳成功";
|
|
|
+ return JsonMessage.success("心跳成功");
|
|
|
+// return "心跳成功";
|
|
|
}
|
|
|
-// return JsonMessage.error("心跳失败");
|
|
|
- return "心跳失败";
|
|
|
+ return JsonMessage.error("心跳失败");
|
|
|
+// return "心跳失败";
|
|
|
}
|
|
|
/**
|
|
|
* 设备申请
|
|
@@ -155,7 +155,7 @@ public class IndexController { ;
|
|
|
*/
|
|
|
@ApiOperation(value = "设备申请")
|
|
|
@PostMapping("/initNew.htm")
|
|
|
- public String initNew(String clientId, String managerId, String gtClientId, String equimentType) {
|
|
|
+ public JsonMessage initNew(String clientId, String managerId, String gtClientId, String equimentType) {
|
|
|
String machineType = "0";
|
|
|
LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
|
|
|
query.eq(TEquipment::getClientId,clientId);
|
|
@@ -164,16 +164,17 @@ public class IndexController { ;
|
|
|
TEquipment equipment = list.get(0);
|
|
|
String managerId1 = equipment.getManagerId();
|
|
|
if(!managerId.equals(managerId1)){
|
|
|
- return "该设备未脱离";
|
|
|
+// return "该设备未脱离";
|
|
|
+ return JsonMessage.error("该设备已经初始化");
|
|
|
}else {
|
|
|
-// return JsonMessage.error("该设备已经初始化");
|
|
|
- return "该设备已经初始化";
|
|
|
+ return JsonMessage.error("该设备已经初始化");
|
|
|
+// return "该设备已经初始化";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(gtClientId)) {
|
|
|
-// return JsonMessage.error("设备不能为空");
|
|
|
- return "设备不能为空";
|
|
|
+ return JsonMessage.error("设备不能为空");
|
|
|
+// return "设备不能为空";
|
|
|
}
|
|
|
|
|
|
TEquipmentApply equipmentApply = new TEquipmentApply();
|
|
@@ -185,8 +186,8 @@ public class IndexController { ;
|
|
|
|
|
|
TAdmin admin = adminService.getById(adminId);
|
|
|
if (admin == null) {
|
|
|
-// return JsonMessage.error("找不到商家");
|
|
|
- return "找不到商家";
|
|
|
+ return JsonMessage.error("找不到商家");
|
|
|
+// return "找不到商家";
|
|
|
}
|
|
|
//所属商家
|
|
|
String username = admin.getUsername();
|
|
@@ -200,8 +201,8 @@ public class IndexController { ;
|
|
|
if(String.valueOf(adminId).equals("3")||String.valueOf(adminId).equals("31")||String.valueOf(adminId).equals("506")||String.valueOf(adminId).equals("1090")){
|
|
|
Long id = equipmentApply.getId();
|
|
|
agree(id);
|
|
|
-// return JsonMessage.success("设备申请成功");
|
|
|
- return "设备申请成功";
|
|
|
+ return JsonMessage.success("设备申请成功");
|
|
|
+// return "设备申请成功";
|
|
|
}
|
|
|
Date applyStartTime = admin.getApplyStartTime();
|
|
|
Date applyEndTime = admin.getApplyEndTime();
|
|
@@ -209,11 +210,11 @@ public class IndexController { ;
|
|
|
if(now.getTime()>applyStartTime.getTime()&&now.getTime()<applyEndTime.getTime()){
|
|
|
Long id = equipmentApply.getId();
|
|
|
agree(id);
|
|
|
-// return JsonMessage.success("设备申请成功");
|
|
|
- return "设备申请成功";
|
|
|
+ return JsonMessage.success("设备申请成功");
|
|
|
+// return "设备申请成功";
|
|
|
}
|
|
|
-// return JsonMessage.success("设备申请中,请耐心等待");
|
|
|
- return "设备申请中,请耐心等待";
|
|
|
+ return JsonMessage.success("设备申请中,请耐心等待");
|
|
|
+// return "设备申请中,请耐心等待";
|
|
|
|
|
|
}
|
|
|
|