|
@@ -1163,26 +1163,20 @@ public class IndexController { ;
|
|
|
* @param
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping(value = "/updateParamNew.htm/{code}/{clientId}", produces = "text/html;charset=utf-8")
|
|
|
+ @RequestMapping(value = "/updateParamNew", method = RequestMethod.POST)
|
|
|
+// @PostMapping(value = "/updateParamNew", produces = "text/html;charset=utf-8")
|
|
|
@ResponseBody
|
|
|
- public String updateParamNew(@PathVariable Integer code, @PathVariable String clientId, @RequestBody List<CommonParamVo> commonParamVos) {
|
|
|
+ public String updateParamNew(Integer code, String clientId, @RequestBody List<CommonParamVo> commonParamVos) {
|
|
|
LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
|
|
|
query.eq(TEquipment::getClientId,clientId);
|
|
|
List<TEquipment> list = equipmentService.list(query);
|
|
|
TEquipment equipment = list.get(0);
|
|
|
if (equipment == null) {
|
|
|
-// return JsonMessage.error("设备不存在");
|
|
|
return "设备不存在";
|
|
|
}
|
|
|
if(commonParamVos.size()<=0){
|
|
|
-// return JsonMessage.error("参数为空");
|
|
|
return "参数为空";
|
|
|
}
|
|
|
-// ArrayList<Filter> filters = new ArrayList<>();
|
|
|
-// filters.add(Filter.eq("status", code));
|
|
|
-// filters.add(Filter.eq("clientId", clientId));
|
|
|
-// filters.add(Filter.eq("equipmentId", equipment.getId()));
|
|
|
-// List<Parameters> list = parametersService.findList(null, filters, null);
|
|
|
LambdaQueryWrapper<TParameters> queryParameters = Wrappers.lambdaQuery();
|
|
|
queryParameters.eq(TParameters::getClientId,clientId);
|
|
|
queryParameters.eq(TParameters::getStatus,code);
|
|
@@ -1696,5 +1690,33 @@ public class IndexController { ;
|
|
|
public String getYouHuiPrice(String clientId){
|
|
|
return "5";
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改商品名称
|
|
|
+ *
|
|
|
+ * @param clientId 设备个推Id
|
|
|
+ * @param
|
|
|
+ * @return
|
|
|
+ * @Param
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/updateProductName.htm", method = RequestMethod.POST)
|
|
|
+ @ResponseBody
|
|
|
+ public String updateProductName(String clientId, Long productId,String oldProductName, String newProductName) {
|
|
|
+ LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
|
|
|
+ query.eq(TEquipment::getClientId,clientId);
|
|
|
+ List<TEquipment> list = equipmentService.list(query);
|
|
|
+ if(list.size()>0){
|
|
|
+ TEquipment equipment = list.get(0);
|
|
|
+ if (equipment != null&&equipment.getId()!=null) {
|
|
|
+ TProduct product = productService.getById(productId);
|
|
|
+ product.setName(oldProductName);
|
|
|
+ product.setProductName(newProductName);
|
|
|
+ productService.updateById(product);
|
|
|
+ return "修改成功success!";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return "更新失败error";
|
|
|
+ }
|
|
|
}
|
|
|
|