|
@@ -11,6 +11,8 @@ import com.szwl.model.bean.EquipmentVo;
|
|
|
import com.szwl.model.bean.ProductVo;
|
|
|
import com.szwl.model.bo.JsonMessage;
|
|
|
import com.szwl.model.bo.JsonUtils;
|
|
|
+import com.szwl.model.bo.R;
|
|
|
+import com.szwl.model.bo.ResponseModel;
|
|
|
import com.szwl.model.entity.*;
|
|
|
import com.szwl.model.utils.AdminUtils;
|
|
|
import com.szwl.model.utils.PushUtils;
|
|
@@ -32,9 +34,11 @@ import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
-@Api(value = "/api/app_equipment/index", tags = {"设备信息上传接口"})
|
|
|
+//@Api(value = "/api/app_equipment/index", tags = {"设备信息上传接口"})
|
|
|
+@Api(value = "/indexController", tags = {"设备信息上传接口"})
|
|
|
@RestController
|
|
|
-@RequestMapping("/api/app_equipment/index")
|
|
|
+//@RequestMapping("/api/app_equipment/index")
|
|
|
+@RequestMapping("/indexController")
|
|
|
public class IndexController { ;
|
|
|
@Autowired
|
|
|
TAdminService adminService;
|
|
@@ -54,7 +58,7 @@ public class IndexController { ;
|
|
|
TPromoCodeService promoCodeService;
|
|
|
@ApiOperation(value = "心跳")
|
|
|
@PostMapping("/heart.htm")
|
|
|
- public JsonMessage heart(@RequestBody EquipmentVo equipmentVo) {
|
|
|
+ public String heart(@RequestBody EquipmentVo equipmentVo) {
|
|
|
|
|
|
String clientId = equipmentVo.getClientId();
|
|
|
Date lastUpdateTime = equipmentVo.getLastUpdateTime();
|
|
@@ -136,9 +140,11 @@ public class IndexController { ;
|
|
|
equipmentDesc.setStick(equipmentVo.getStick());
|
|
|
}
|
|
|
equipmentDescService.updateById(equipmentDesc);
|
|
|
- return JsonMessage.success("心跳成功");
|
|
|
+// return JsonMessage.success("心跳成功");
|
|
|
+ return "心跳成功";
|
|
|
}
|
|
|
- return JsonMessage.error("心跳失败");
|
|
|
+// return JsonMessage.error("心跳失败");
|
|
|
+ return "心跳失败";
|
|
|
}
|
|
|
/**
|
|
|
* 设备申请
|
|
@@ -148,10 +154,8 @@ public class IndexController { ;
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "设备申请")
|
|
|
-// @PostMapping("/init3")
|
|
|
@PostMapping("/initNew.htm")
|
|
|
-// public JsonMessage initNew(String clientId, String managerId, String gtClientId,String equimentType,String machineType) {
|
|
|
- public JsonMessage initNew(String clientId, String managerId, String gtClientId,String equimentType) {
|
|
|
+ public String initNew(String clientId, String managerId, String gtClientId, String equimentType) {
|
|
|
String machineType = "0";
|
|
|
LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
|
|
|
query.eq(TEquipment::getClientId,clientId);
|
|
@@ -160,14 +164,16 @@ public class IndexController { ;
|
|
|
TEquipment equipment = list.get(0);
|
|
|
String managerId1 = equipment.getManagerId();
|
|
|
if(!managerId.equals(managerId1)){
|
|
|
- return JsonMessage.error("该设备未脱离");
|
|
|
+ return "该设备未脱离";
|
|
|
}else {
|
|
|
- return JsonMessage.error("该设备已经初始化");
|
|
|
+// return JsonMessage.error("该设备已经初始化");
|
|
|
+ return "该设备已经初始化";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isEmpty(gtClientId)) {
|
|
|
- return JsonMessage.error("设备不能为空");
|
|
|
+// return JsonMessage.error("设备不能为空");
|
|
|
+ return "设备不能为空";
|
|
|
}
|
|
|
|
|
|
TEquipmentApply equipmentApply = new TEquipmentApply();
|
|
@@ -179,7 +185,8 @@ public class IndexController { ;
|
|
|
|
|
|
TAdmin admin = adminService.getById(adminId);
|
|
|
if (admin == null) {
|
|
|
- return JsonMessage.error("找不到商家");
|
|
|
+// return JsonMessage.error("找不到商家");
|
|
|
+ return "找不到商家";
|
|
|
}
|
|
|
//所属商家
|
|
|
String username = admin.getUsername();
|
|
@@ -193,7 +200,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 JsonMessage.success("设备申请成功");
|
|
|
+ return "设备申请成功";
|
|
|
}
|
|
|
Date applyStartTime = admin.getApplyStartTime();
|
|
|
Date applyEndTime = admin.getApplyEndTime();
|
|
@@ -201,9 +209,11 @@ public class IndexController { ;
|
|
|
if(now.getTime()>applyStartTime.getTime()&&now.getTime()<applyEndTime.getTime()){
|
|
|
Long id = equipmentApply.getId();
|
|
|
agree(id);
|
|
|
- return JsonMessage.success("设备申请成功");
|
|
|
+// return JsonMessage.success("设备申请成功");
|
|
|
+ return "设备申请成功";
|
|
|
}
|
|
|
- return JsonMessage.success("设备申请中,请耐心等待");
|
|
|
+// return JsonMessage.success("设备申请中,请耐心等待");
|
|
|
+ return "设备申请中,请耐心等待";
|
|
|
|
|
|
}
|
|
|
|
|
@@ -406,6 +416,8 @@ public class IndexController { ;
|
|
|
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
TProduct product = new TProduct();
|
|
|
+ product.setCreateDate(new Date());
|
|
|
+ product.setModifyDate(new Date());
|
|
|
product.setEquipmentId(id);
|
|
|
String[] split = str[i].split("-");
|
|
|
product.setProductName(split[0]);
|
|
@@ -421,6 +433,8 @@ public class IndexController { ;
|
|
|
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
TProduct product = new TProduct();
|
|
|
+ product.setCreateDate(new Date());
|
|
|
+ product.setModifyDate(new Date());
|
|
|
product.setEquipmentId(id);
|
|
|
String[] split = str[i].split("-");
|
|
|
product.setProductName(split[0]);
|
|
@@ -439,6 +453,8 @@ public class IndexController { ;
|
|
|
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
TProduct product = new TProduct();
|
|
|
+ product.setCreateDate(new Date());
|
|
|
+ product.setModifyDate(new Date());
|
|
|
product.setEquipmentId(id);
|
|
|
String[] split = str[i].split("-");
|
|
|
product.setProductName(split[0]);
|
|
@@ -455,6 +471,8 @@ public class IndexController { ;
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
TProduct product = new TProduct();
|
|
|
product.setEquipmentId(id);
|
|
|
+ product.setCreateDate(new Date());
|
|
|
+ product.setModifyDate(new Date());
|
|
|
String[] split = str[i].split("-");
|
|
|
product.setProductName(split[0]);
|
|
|
product.setNo(split[1]);
|
|
@@ -469,6 +487,8 @@ public class IndexController { ;
|
|
|
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
TProduct product = new TProduct();
|
|
|
+ product.setCreateDate(new Date());
|
|
|
+ product.setModifyDate(new Date());
|
|
|
product.setEquipmentId(id);
|
|
|
String[] split = str[i].split("-");
|
|
|
product.setProductName(split[0]);
|
|
@@ -485,6 +505,8 @@ public class IndexController { ;
|
|
|
"夏日倾城-A20", "雪花飞舞-A26", "豆蔻年华-A23", "花样年华-A29"};
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
TProduct product = new TProduct();
|
|
|
+ product.setCreateDate(new Date());
|
|
|
+ product.setModifyDate(new Date());
|
|
|
product.setEquipmentId(id);
|
|
|
String[] split = str[i].split("-");
|
|
|
product.setProductName(split[0]);
|