|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.szwl.constant.ResponseCodesEnum;
|
|
|
import com.szwl.model.bean.TEquipmentDTO;
|
|
|
import com.szwl.model.bo.R;
|
|
|
import com.szwl.model.bo.ResponseModel;
|
|
@@ -58,12 +59,18 @@ public class TEquipmentApplyController {
|
|
|
|
|
|
@ApiOperation(value = "查找机器审核列表")
|
|
|
@GetMapping("/pageTEquipmentApply")
|
|
|
- public ResponseModel<IPage<?>> pageTEquipmentApply(String adminId, String clientId, String userName,String managerId,String type, long current, long size ) {
|
|
|
+ public ResponseModel<IPage<?>> pageTEquipmentApply(String adminId, String clientId, String userName,String managerId,String statusType, long current, long size ) {
|
|
|
|
|
|
LambdaQueryWrapper<TEquipmentApply> query = Wrappers.lambdaQuery();
|
|
|
if(StringUtils.isNotEmpty(clientId)){
|
|
|
query.like(TEquipmentApply::getClientId,clientId);
|
|
|
}
|
|
|
+ if(StringUtils.isNotEmpty(adminId)){
|
|
|
+ TAdmin admin = adminService.getById(adminId);
|
|
|
+ if(admin.getType()>1){
|
|
|
+ query.eq(TEquipmentApply::getAdminId,adminId);
|
|
|
+ }
|
|
|
+ }
|
|
|
if(StringUtils.isNotEmpty(userName)){
|
|
|
LambdaQueryWrapper<TAdmin> adminQuery = Wrappers.lambdaQuery();
|
|
|
adminQuery.eq(TAdmin::getUsername,userName);
|
|
@@ -72,8 +79,8 @@ public class TEquipmentApplyController {
|
|
|
query.eq(TEquipmentApply::getAdminId,list.get(0).getId());
|
|
|
}
|
|
|
}
|
|
|
- if(StringUtils.isNotEmpty(type)){
|
|
|
- query.eq(TEquipmentApply::getStatusType,type);
|
|
|
+ if(StringUtils.isNotEmpty(statusType)){
|
|
|
+ query.eq(TEquipmentApply::getStatusType,statusType);
|
|
|
}
|
|
|
if(StringUtils.isNotEmpty(managerId)){
|
|
|
query.like(TEquipmentApply::getManagerId,managerId);
|
|
@@ -105,7 +112,14 @@ public class TEquipmentApplyController {
|
|
|
Integer type = equipmentApply.getType();
|
|
|
String gtClientId = equipmentApply.getGtClientId();
|
|
|
String equimentType = equipmentApply.getEquimentType();
|
|
|
-
|
|
|
+ String clientId1 = equipmentApply.getClientId();
|
|
|
+ //判断是否已经生成
|
|
|
+ LambdaQueryWrapper<TEquipment> query3 = Wrappers.lambdaQuery();
|
|
|
+ query3.eq(TEquipment::getClientId,clientId1);
|
|
|
+ List<TEquipment> list3 = equipmentService.list(query3);
|
|
|
+ if(list3.size()>0){
|
|
|
+ return R.fail(ResponseCodesEnum.A0001,"已生成机器");
|
|
|
+ }
|
|
|
String old = "";
|
|
|
// ArrayList<Filter> filters = new ArrayList<>();
|
|
|
// filters.add(Filter.eq("clientId", clientId + "xxx"));
|
|
@@ -239,7 +253,7 @@ public class TEquipmentApplyController {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- return R.ok();
|
|
|
+ return R.ok(null,"审核成功");
|
|
|
}
|
|
|
|
|
|
/**
|