Browse Source

接口修改

李天标 3 years ago
parent
commit
4f450ba691

+ 4 - 4
src/main/java/com/szwl/controller/TEquipmentController.java

@@ -164,12 +164,12 @@ public class TEquipmentController {
     //查找设备
     @ApiOperation(value = "ClientId查找设备")
     @GetMapping("/findEquipmentByClientId")
-    public ResponseModel<IPage<TEquipment>> findEquipmentByClientId(String  clientId) {
+    public ResponseModel<TEquipment> findEquipmentByClientId(String  clientId) {
         LambdaQueryWrapper<TEquipment> query = Wrappers.lambdaQuery();
         query.eq(TEquipment::getClientId,clientId);
-        Page<TEquipment> page = new Page<>(0, 10, true);
-        IPage<TEquipment> iPage = tEquipmentService.page(page, query);
-        return R.ok(iPage);
+        List<TEquipment> list = tEquipmentService.list(query);
+        TEquipment equipment = list.get(0);
+        return R.ok(equipment);
     }
     /**
      * 更新

+ 4 - 4
src/main/java/com/szwl/controller/TJoinpayMchController.java

@@ -111,12 +111,12 @@ public class TJoinpayMchController {
 
     @ApiOperation(value = "获取提现信息")
     @GetMapping("/getMch")
-    public ResponseModel<IPage<TJoinpayMch>> getMch(String id) {
+    public ResponseModel<TJoinpayMch> getMch(String id) {
         LambdaQueryWrapper<TJoinpayMch> query = Wrappers.lambdaQuery();
         query.eq(TJoinpayMch::getAdminId,Long.valueOf(id));
-        Page<TJoinpayMch> page = new Page<>(0, 10, true);
-        IPage<TJoinpayMch> iPage = tJoinpayMchService.page(page, query);
-        return R.ok(iPage);
+        List<TJoinpayMch> list = tJoinpayMchService.list(query);
+        TJoinpayMch tJoinpayMch = list.get(0);
+        return R.ok(tJoinpayMch);
     }
 
     private ResponseModel<?> createCheckMch(TJoinpayMch mch, TJoinpayMch tJoinpayMch) {

+ 4 - 4
src/main/java/com/szwl/controller/TProductController.java

@@ -145,13 +145,13 @@ public class TProductController {
 
     @ApiOperation(value = "获取商品")
     @GetMapping("/getTProduct")
-    public ResponseModel<IPage<TProduct>> getTProduct(String  code,String equipmentId) {
+    public ResponseModel<TProduct> getTProduct(String  code,String equipmentId) {
         LambdaQueryWrapper<TProduct> query = Wrappers.lambdaQuery();
         query.eq(TProduct::getProductName,code);
         query.eq(TProduct::getEquipmentId,Long.valueOf(equipmentId));
-        Page<TProduct> page = new Page<>(0, 10, true);
-        IPage<TProduct> iPage = tProductService.page(page, query);
-        return R.ok(iPage);
+        List<TProduct> list = tProductService.list(query);
+        TProduct tProduct = list.get(0);
+        return R.ok(tProduct);
     }
 }
 

+ 4 - 4
src/main/java/com/szwl/controller/TProportionController.java

@@ -254,12 +254,12 @@ public class TProportionController {
 
     @ApiOperation(value = "获取机器分销信息")
     @GetMapping("/getProportion")
-    public ResponseModel<IPage<TProportion>> getProportion( String equipmentId) {
+    public ResponseModel<TProportion> getProportion( String equipmentId) {
         LambdaQueryWrapper<TProportion> query = Wrappers.lambdaQuery();
         query.eq(TProportion::getEquipmentId,Long.valueOf(equipmentId));
-        Page<TProportion> page = new Page<>(0, 10, true);
-        IPage<TProportion> iPage = tProportionService.page(page, query);
-        return R.ok(iPage);
+        List<TProportion> list = tProportionService.list(query);
+        TProportion tProportion = list.get(0);
+        return R.ok(tProportion);
     }
 }
 

+ 21 - 5
src/main/java/com/szwl/controller/TShandeMchController.java

@@ -12,11 +12,7 @@ import com.szwl.service.TShandeMchService;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.math.BigDecimal;
 import java.util.Date;
@@ -142,5 +138,25 @@ public class TShandeMchController {
             return R.ok();
         }
     }
+
+
+    @ApiOperation(value = "查找杉德收款账户信息")
+    @GetMapping("/getShandeMch")
+    public ResponseModel<TShandeMch> getShandeMch(String  adminId) {
+        LambdaQueryWrapper<TShandeMch> query = Wrappers.lambdaQuery();
+        query.eq(TShandeMch::getAdminId,adminId);
+        List<TShandeMch> list = tShandeMchService.list(query);
+        TShandeMch shandeMch = list.get(0);
+        return R.ok(shandeMch);
+    }
+
+    @ApiOperation(value = "ClientId查找设备")
+    @GetMapping("/updateShandeMch")
+    public void updateShandeMch(@RequestBody TShandeMch shandeMch) {
+        if(shandeMch!=null){
+            shandeMch.setModifyDate(new Date());
+            tShandeMchService.updateById(shandeMch);
+        }
+    }
 }