Browse Source

1.微信小程序查询商品分仓问题修改
2.租户复制角色,菜单接口修改

纪新园 3 weeks ago
parent
commit
aef4d0bc28

+ 7 - 4
blade-service-api/blade-system-api/src/main/java/org/springblade/system/entity/Role.java

@@ -16,10 +16,7 @@
  */
 package org.springblade.system.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.*;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModel;
@@ -86,5 +83,11 @@ public class Role implements Serializable {
 	@ApiModelProperty(value = "是否已删除")
 	private Integer isDeleted;
 
+	/**
+	 * 临时id
+	 */
+	@TableField(exist = false)
+	private Long srcId;
+
 
 }

+ 4 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchServiceImpl.java

@@ -1187,7 +1187,10 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 		BladeUser bladeUser = AuthUtil.getUser();
 		WxAppGoodsParamsVo wxAppGoodsParamsVo = WxParamUtil.parseWxAppGoodsParamsVoByProductLaunch(productLaunch, bladeUser, corpsDesc, iSysClient);
 		PageHelper.startPage(query.getCurrent(), query.getSize());
-		List<PjProductLaunch> pjProductLaunchList = productLaunchMapper.selectWxAppIndexPageList(wxAppGoodsParamsVo);
+		List<PjProductLaunch> pjProductLaunchList = new ArrayList<>();
+		if (ObjectUtils.isNotNull(wxAppGoodsParamsVo.getGoodsIds()) && !wxAppGoodsParamsVo.getGoodsIds().isEmpty()){
+			pjProductLaunchList = productLaunchMapper.selectWxAppIndexPageList(wxAppGoodsParamsVo);
+		}
 		if (!org.springframework.util.CollectionUtils.isEmpty(pjProductLaunchList)) {
 			List<Long> ids = pjProductLaunchList.stream().map(PjProductLaunch::getId).collect(Collectors.toList());
  			List<Long> brandIds = pjProductLaunchList.stream().map(PjProductLaunch::getBrandId).distinct().collect(Collectors.toList());

+ 18 - 1
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java

@@ -225,12 +225,29 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
 			// 角色
 			List<Role> roleLinkedList = new ArrayList<>();
 			List<Role> roleList = roleService.selectList(tenantId);
+			List<RoleMenu> roleMenus = roleMenuService.list(new LambdaQueryWrapper<RoleMenu>()
+				.in(RoleMenu::getRoleId,roleList.stream().map(Role::getId).collect(Collectors.toList())));
 			for (Role item : roleList) {
+				item.setSrcId(item.getId());
 				item.setId(null);
 				item.setTenantId(tenantIdCopy);
 				roleLinkedList.add(item);
 			}
-			roleService.saveBatch(roleLinkedList);
+			if (!roleLinkedList.isEmpty()){
+				roleService.saveBatch(roleLinkedList);
+				List<RoleMenu> menuList = new ArrayList<>();
+				for (RoleMenu item : roleMenus){
+					Role role = roleLinkedList.stream().filter(e-> e.getSrcId().equals(item.getRoleId())).findFirst().orElse(null);
+					if (role != null){
+						item.setRoleId(role.getId());
+						item.setId(null);
+						menuList.add(item);
+					}
+				}
+				if (!menuList.isEmpty()){
+					roleMenuService.saveBatch(menuList);
+				}
+			}
 		} else if (type.contains("3")) {
 			// 审批流程
 			List<LosAuditPaths> losAuditPaths = new ArrayList<>();