|
@@ -249,6 +249,7 @@ public class NewFrontApi {
|
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
//获取登录账号信息
|
|
|
User user = userService.getInfo();
|
|
|
+ Integer enterpriseId1 =0;
|
|
|
if (null != user.getIsAllOrders()) {
|
|
|
if (3 == user.getIsEnterpriseUser() && 1 == user.getIsAllOrders()) {
|
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
@@ -256,6 +257,10 @@ public class NewFrontApi {
|
|
|
UserBypassAccount one = userBypassAccountService.getOne(queryWrapper3);
|
|
|
Integer enterpriseId = one.getEnterpriseId();
|
|
|
id = String.valueOf(enterpriseId);
|
|
|
+
|
|
|
+ UserEnterprise userEnterprise = userEnterpriseService.getById(id);
|
|
|
+ enterpriseId1 = userEnterprise.getUserId();
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -274,6 +279,9 @@ public class NewFrontApi {
|
|
|
List<Integer> ids = list.stream()
|
|
|
.map(UserBypassAccount::getUserId)
|
|
|
.collect(Collectors.toList());
|
|
|
+ ids.add(enterpriseId1);
|
|
|
+
|
|
|
+
|
|
|
|
|
|
return CommonResult.success(CommonPage.restPage(frontOrderService.list2(isRemit, status, pageRequest, ids,
|
|
|
Integer.valueOf(id), department
|
|
@@ -344,17 +352,17 @@ public class NewFrontApi {
|
|
|
String image = aaaService.getImage(getwxacodeRequest);
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
JSONObject jsonObject1 = new JSONObject();
|
|
|
- if (StringUtils.isNotBlank(image)){
|
|
|
+ if (StringUtils.isNotBlank(image)) {
|
|
|
String image1 = image.substring(0, image.indexOf("shareId"));
|
|
|
- String str2 = image.substring(image1.length()+7, image.length());
|
|
|
- jsonObject.put("shareId",str2);
|
|
|
- jsonObject1.put("data",jsonObject);
|
|
|
- jsonObject1.put("message",image1);
|
|
|
- jsonObject1.put("code",200);
|
|
|
- }else{
|
|
|
- jsonObject1.put("data",null);
|
|
|
- jsonObject1.put("message","请求失败");
|
|
|
- jsonObject1.put("code",500);
|
|
|
+ String str2 = image.substring(image1.length() + 7, image.length());
|
|
|
+ jsonObject.put("shareId", str2);
|
|
|
+ jsonObject1.put("data", jsonObject);
|
|
|
+ jsonObject1.put("message", image1);
|
|
|
+ jsonObject1.put("code", 200);
|
|
|
+ } else {
|
|
|
+ jsonObject1.put("data", null);
|
|
|
+ jsonObject1.put("message", "请求失败");
|
|
|
+ jsonObject1.put("code", 500);
|
|
|
|
|
|
}
|
|
|
return jsonObject1;
|
|
@@ -362,13 +370,24 @@ public class NewFrontApi {
|
|
|
|
|
|
@ApiOperation(value = "获取购物车信息(分享完购物车后用的)ids 为购物车表id")
|
|
|
@RequestMapping(value = "/getwxacode1", method = RequestMethod.GET)
|
|
|
- public CommonResult<List<CartMerchantResponse>> getwxacode1(@RequestParam(name = "jsonIds") String jsonIds) {
|
|
|
+ public CommonResult<?> getwxacode1(@RequestParam(name = "jsonIds") String jsonIds) {
|
|
|
try {
|
|
|
// List<Integer> ids = Arrays.stream(jsonIds.split(","))
|
|
|
// .map(Integer::parseInt)
|
|
|
// .collect(Collectors.toList());
|
|
|
List<CartMerchantResponse> list2 = cartService.getList2(jsonIds);
|
|
|
- return CommonResult.success(list2);
|
|
|
+ Integer isInvalid=0;
|
|
|
+ for (CartMerchantResponse cartMerchantResponse : list2) {
|
|
|
+ isInvalid = cartMerchantResponse.getIsInvalid();
|
|
|
+ if(1==isInvalid){
|
|
|
+ isInvalid=1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ CartShareMerchantResponse cartShareMerchantResponse = new CartShareMerchantResponse();
|
|
|
+ cartShareMerchantResponse.setCartInfoList(list2);
|
|
|
+ cartShareMerchantResponse.setIsInvalid(isInvalid);
|
|
|
+
|
|
|
+ return CommonResult.success(cartShareMerchantResponse);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
return CommonResult.failed();
|
|
@@ -514,7 +533,7 @@ public class NewFrontApi {
|
|
|
public CommonResult<?> departUser(@RequestParam(name = "departmentId", required = false) String departmentId,
|
|
|
@RequestParam(name = "organizationId", required = false) String organizationId
|
|
|
) {
|
|
|
- List<UserBypassAccount> list=null;
|
|
|
+ List<UserBypassAccount> list = new ArrayList<>();
|
|
|
if (StringUtils.isNotBlank(organizationId)) {
|
|
|
LambdaQueryWrapper<UserEnterprise> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(UserEnterprise::getOrganizationId, organizationId);
|
|
@@ -522,8 +541,8 @@ public class NewFrontApi {
|
|
|
Integer id = userEnterprise.getId();
|
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper2 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper2.eq(UserBypassAccount::getEnterpriseId, id);
|
|
|
- queryWrapper2.eq(UserBypassAccount::getIsDelete,0 );
|
|
|
- list = userBypassAccountService.list(queryWrapper2);
|
|
|
+ queryWrapper2.eq(UserBypassAccount::getIsDelete, 0);
|
|
|
+ list = userBypassAccountService.list(queryWrapper2);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(departmentId)) {
|
|
|
String[] split = departmentId.split(",");
|
|
@@ -540,8 +559,12 @@ public class NewFrontApi {
|
|
|
LambdaQueryWrapper<UserBypassAccount> queryWrapper3 = new LambdaQueryWrapper<>();
|
|
|
queryWrapper3.eq(UserBypassAccount::getEnterpriseId, id2);
|
|
|
queryWrapper3.eq(UserBypassAccount::getDepartment, name);
|
|
|
- queryWrapper3.eq(UserBypassAccount::getIsDelete,0 );
|
|
|
- list = userBypassAccountService.list(queryWrapper3);
|
|
|
+ queryWrapper3.eq(UserBypassAccount::getIsDelete, 0);
|
|
|
+ List<UserBypassAccount> list1 = userBypassAccountService.list(queryWrapper3);
|
|
|
+ for (UserBypassAccount userBypassAccount : list1) {
|
|
|
+ list.add(userBypassAccount);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
return CommonResult.success(list);
|