Compare commits
3 Commits
8c12488b2d
...
1a0cc2ff19
| Author | SHA1 | Date |
|---|---|---|
|
|
1a0cc2ff19 | |
|
|
cc64cc5a47 | |
|
|
10e94a4784 |
|
|
@ -189,20 +189,20 @@ public class DataPermissionController extends ControllerBase {
|
|||
return ApiResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品线
|
||||
*/
|
||||
@GetMapping("getProductLines")
|
||||
public ApiResult<List<String>> getProductLines(@RequestParam Long id) {
|
||||
AdminPermissionRoleApiMap data = permissionRoleApiMapService.lambdaQuery()
|
||||
.select(AdminPermissionRoleApiMap::getProductLines)
|
||||
.eq(AdminPermissionRoleApiMap::getId, id)
|
||||
.one();
|
||||
if (Objects.isNull(data)) {
|
||||
return ApiResult.success(Collections.emptyList());
|
||||
}
|
||||
return ApiResult.success(StrUtil.split(data.getProductLines(), ","));
|
||||
}
|
||||
// /**
|
||||
// * 获取产品线
|
||||
// */
|
||||
// @GetMapping("getProductLines")
|
||||
// public ApiResult<List<String>> getProductLines(@RequestParam Long id) {
|
||||
// AdminPermissionRoleApiMap data = permissionRoleApiMapService.lambdaQuery()
|
||||
// .select(AdminPermissionRoleApiMap::getProductLines)
|
||||
// .eq(AdminPermissionRoleApiMap::getId, id)
|
||||
// .one();
|
||||
// if (Objects.isNull(data)) {
|
||||
// return ApiResult.success(Collections.emptyList());
|
||||
// }
|
||||
// return ApiResult.success(StrUtil.split(data.getProductLines(), ","));
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 设置产品线
|
||||
|
|
@ -216,20 +216,20 @@ public class DataPermissionController extends ControllerBase {
|
|||
// return ApiResult.success();
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取指定的用户
|
||||
*/
|
||||
@GetMapping("getUsers")
|
||||
public ApiResult<List<AdminUserSimpleVO>> getUsers(@RequestParam Long id) {
|
||||
AdminPermissionRoleApiMap data = permissionRoleApiMapService.lambdaQuery()
|
||||
.select(AdminPermissionRoleApiMap::getUsers)
|
||||
.eq(AdminPermissionRoleApiMap::getId, id)
|
||||
.one();
|
||||
if (Objects.isNull(data)) {
|
||||
return ApiResult.success(Collections.emptyList());
|
||||
}
|
||||
return ApiResult.success(adminUserService.getSimples(Arrays.stream(StrUtil.splitToInt(data.getUsers(), ",")).boxed().collect(Collectors.toList())));
|
||||
}
|
||||
// /**
|
||||
// * 获取指定的用户
|
||||
// */
|
||||
// @GetMapping("getUsers")
|
||||
// public ApiResult<List<AdminUserSimpleVO>> getUsers(@RequestParam Long id) {
|
||||
// AdminPermissionRoleApiMap data = permissionRoleApiMapService.lambdaQuery()
|
||||
// .select(AdminPermissionRoleApiMap::getUsers)
|
||||
// .eq(AdminPermissionRoleApiMap::getRoleId, id)
|
||||
// .one();
|
||||
// if (Objects.isNull(data)) {
|
||||
// return ApiResult.success(Collections.emptyList());
|
||||
// }
|
||||
// return ApiResult.success(adminUserService.getSimples(Arrays.stream(StrUtil.splitToInt(data.getUsers(), ",")).boxed().collect(Collectors.toList())));
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 设置指定的用户
|
||||
|
|
|
|||
|
|
@ -107,18 +107,32 @@ public class FormController extends ControllerBase {
|
|||
/**
|
||||
* 新增表单
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("add")
|
||||
public void add(@Valid @RequestBody FormAddRequest request) {
|
||||
VUtils.trueThrowBusinessError(permissionTableService.lambdaQuery()
|
||||
.eq(AdminPermissionTable::getTableName, request.getTableName())
|
||||
.exists()
|
||||
).throwMessage("表单已存在");
|
||||
permissionTableService.save(new AdminPermissionTable()
|
||||
AdminPermissionTable table=new AdminPermissionTable()
|
||||
.setTableName(request.getTableName())
|
||||
.setTableDesc(request.getTableDesc())
|
||||
.setRemark(request.getRemark())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
permissionTableService.save(table);
|
||||
List<DescVO> columns = tableInfoService.getTableColumnInfos(request.getTableName());
|
||||
permissionColumnService.saveBatch(
|
||||
columns.stream()
|
||||
.map(col -> new AdminPermissionColumn()
|
||||
.setTableId(table.getId())
|
||||
.setColName(col.getName())
|
||||
.setColCode(StrUtil.toCamelCase(col.getName()))
|
||||
.setColDesc(col.getDesc())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -248,7 +262,7 @@ public class FormController extends ControllerBase {
|
|||
permissionApiService.updateBatchById(
|
||||
items.stream().map(item -> new AdminPermissionApi()
|
||||
.setId(item.getId())
|
||||
.setApiName(item.getApiName())
|
||||
.setApiName(item.getFunctionName())
|
||||
.setUpdateBy(AdminUserUtil.getUserName())
|
||||
.setUpdateTime(LocalDateTime.now())
|
||||
).collect(Collectors.toList())
|
||||
|
|
@ -264,7 +278,7 @@ public class FormController extends ControllerBase {
|
|||
items1.stream().map(item -> new AdminPermissionApi()
|
||||
.setId(item.getId())
|
||||
.setApiId(item.getApiId())
|
||||
.setApiName(item.getApiName())
|
||||
.setApiName(item.getFunctionName())
|
||||
.setTableId(request.getTableId())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now())
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.nflg.mobilebroken.common.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PermissionRoleColumnMapDTO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 列名称
|
||||
*/
|
||||
private String colName;
|
||||
|
||||
/**
|
||||
* 列描述
|
||||
*/
|
||||
private String colDesc;
|
||||
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private boolean selected = false;
|
||||
|
||||
/**
|
||||
* 表单id
|
||||
*/
|
||||
private Long tableId;
|
||||
|
||||
/**
|
||||
* 表单名称
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
private String key;
|
||||
|
||||
public String getKey() {
|
||||
return tableId + "-" + tableName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package com.nflg.mobilebroken.common.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class RatioDirectEffectiveDTO {
|
||||
|
||||
/**
|
||||
* 机型id
|
||||
*/
|
||||
private Integer modelId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 标配系数
|
||||
*/
|
||||
private BigDecimal standardRatio;
|
||||
|
||||
/**
|
||||
* 选配系数
|
||||
*/
|
||||
private BigDecimal optionalRatio;
|
||||
|
||||
/**
|
||||
* 上级用户id
|
||||
*/
|
||||
private Integer parentUserId;
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@ public class FormApiSaveItemRequest {
|
|||
/**
|
||||
* 功能名称
|
||||
*/
|
||||
private String apiName;
|
||||
private String functionName;
|
||||
|
||||
/**
|
||||
* 表单列ID
|
||||
|
|
|
|||
|
|
@ -8,10 +8,21 @@ public class PermissionApiItemVO {
|
|||
private Long apiId;
|
||||
|
||||
/**
|
||||
* 功能名称
|
||||
* 服务名称
|
||||
*/
|
||||
private String moduleName;
|
||||
|
||||
/**
|
||||
*
|
||||
* 方法名称
|
||||
*/
|
||||
private String apiName;
|
||||
|
||||
/**
|
||||
* 功能名称
|
||||
*/
|
||||
private String functionName;
|
||||
|
||||
/**
|
||||
* 表单列ID
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Data
|
||||
public class PermissionRoleApiMapVO {
|
||||
|
|
@ -47,7 +52,34 @@ public class PermissionRoleApiMapVO {
|
|||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private Boolean selected=false;
|
||||
private Boolean selected = false;
|
||||
|
||||
@JsonIgnore
|
||||
private String users;
|
||||
|
||||
/**
|
||||
* 用户id列表
|
||||
*/
|
||||
private List<Integer> userIds;
|
||||
|
||||
public List<Integer> getUserIds() {
|
||||
return Arrays.stream(StrUtil.splitToInt(users, ',')).boxed().collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 产品线
|
||||
*/
|
||||
@JsonIgnore
|
||||
private String productLines;
|
||||
|
||||
/**
|
||||
* 产品线列表
|
||||
*/
|
||||
private List<String> productLineList;
|
||||
|
||||
public List<String> getProductLineList() {
|
||||
return StrUtil.split(productLines, ',');
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 创建人
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PermissionRoleColumnMapItemVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 列名称
|
||||
*/
|
||||
private String colName;
|
||||
|
||||
/**
|
||||
* 列描述
|
||||
*/
|
||||
private String colDesc;
|
||||
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private boolean selected = false;
|
||||
}
|
||||
|
|
@ -1,12 +1,14 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PermissionRoleColumnMapVO {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 表单id
|
||||
*/
|
||||
|
|
@ -18,17 +20,7 @@ public class PermissionRoleColumnMapVO {
|
|||
private String tableName;
|
||||
|
||||
/**
|
||||
* 列名称
|
||||
* 表单字段
|
||||
*/
|
||||
private String colName;
|
||||
|
||||
/**
|
||||
* 列描述
|
||||
*/
|
||||
private String colDesc;
|
||||
|
||||
/**
|
||||
* 是否选中
|
||||
*/
|
||||
private boolean selected = false;
|
||||
private List<PermissionRoleColumnMapItemVO> items;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 代理商配置系数
|
||||
* 代理商系数配置
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ratio/agent")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,119 @@
|
|||
package com.nflg.mobilebroken.quotation.controller.admin;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.nflg.mobilebroken.common.constant.Constant;
|
||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.RatioDirectEffectiveDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DynamicHeaderVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceVO;
|
||||
import com.nflg.mobilebroken.quotation.controller.ControllerBase;
|
||||
import com.nflg.mobilebroken.repository.entity.AdminUser;
|
||||
import com.nflg.mobilebroken.repository.entity.DictionaryItem;
|
||||
import com.nflg.mobilebroken.repository.entity.TBaseDepartment;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 直销系数配置
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/ratio/direct")
|
||||
public class RatioDirectController extends ControllerBase {
|
||||
|
||||
@Resource
|
||||
private IDictionaryItemService dictionaryItemService;
|
||||
|
||||
@Resource
|
||||
private IQuotationModelPriceService priceService;
|
||||
|
||||
@Resource
|
||||
private IAdminUserService adminUserService;
|
||||
|
||||
@Resource
|
||||
private ITBaseDepartmentService departmentService;
|
||||
|
||||
@Resource
|
||||
private IQuotationModelRatioDirectService ratioDirectService;
|
||||
|
||||
/**
|
||||
* 获取动态表头
|
||||
* @param userIds 用户id列表
|
||||
*/
|
||||
@GetMapping("/header")
|
||||
public ApiResult<List<DynamicHeaderVO>> getHeaders(@RequestBody @NotEmpty List<Integer> userIds) {
|
||||
List<AdminUser> users = adminUserService.lambdaQuery().in(AdminUser::getId, userIds).list();
|
||||
if (CollectionUtil.isEmpty(users)) {
|
||||
return ApiResult.success(Collections.emptyList());
|
||||
}
|
||||
List<DictionaryItem> categories = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_DIRECT_SALES_CATEGORY);
|
||||
List<TBaseDepartment> departments = departmentService.list();
|
||||
List<RatioDirectEffectiveDTO> ratioDirects=ratioDirectService.getEffectives();
|
||||
List<ModelPriceVO> prices = priceService.getAllModelPrice();
|
||||
return ApiResult.success(users.stream()
|
||||
.map(user -> new DynamicHeaderVO()
|
||||
.setProp(user.getId().toString())
|
||||
.setLabel(user.getUserName() + getDepartmentName(
|
||||
departments.stream()
|
||||
.filter(d -> d.getId().equals(user.getDepartmentId()))
|
||||
.findFirst()
|
||||
.orElse(null)
|
||||
)
|
||||
)
|
||||
.setChildren(
|
||||
new ArrayList<>() {
|
||||
{
|
||||
add(new DynamicHeaderVO()
|
||||
.setProp(user.getId() + "standardPrice")
|
||||
.setLabel("标配价" + getCategoryName(
|
||||
categories.stream()
|
||||
.filter(c -> c.getId().equals(user.getCategoryId()))
|
||||
.findFirst()
|
||||
.orElse(null)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
)
|
||||
)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
|
||||
private BigDecimal getUserStandardPrice(Integer userId,List<RatioDirectEffectiveDTO> ratioDirects,List<ModelPriceVO> prices){
|
||||
RatioDirectEffectiveDTO ratioDirect = ratioDirects.stream()
|
||||
.filter(r -> r.getUserId().equals(userId))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (Objects.isNull(ratioDirect)){
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
|
||||
private String getDepartmentName(TBaseDepartment department) {
|
||||
if (department == null) {
|
||||
return "";
|
||||
}
|
||||
return "(" + department.getDeptName() + ")";
|
||||
}
|
||||
|
||||
private String getCategoryName(DictionaryItem category) {
|
||||
if (category == null) {
|
||||
return "";
|
||||
}
|
||||
return "(" + category.getName() + ")";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("quotation_model_ratio_direct")
|
||||
public class QuotationModelRatioDirect implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 年份
|
||||
*/
|
||||
private String year;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private String version;
|
||||
|
||||
/**
|
||||
* 状态,0:草稿;1:已发布;2:已废弃
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 新增人id
|
||||
*/
|
||||
private Integer createById;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数-子项
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("quotation_model_ratio_direct_item")
|
||||
public class QuotationModelRatioDirectItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 系数id
|
||||
*/
|
||||
private Long ratioId;
|
||||
|
||||
/**
|
||||
* 机型id
|
||||
*/
|
||||
private Integer modelId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 标配系数
|
||||
*/
|
||||
private BigDecimal standardRatio;
|
||||
|
||||
/**
|
||||
* 选配系数
|
||||
*/
|
||||
private BigDecimal optionalRatio;
|
||||
|
||||
/**
|
||||
* 是否有效
|
||||
*/
|
||||
private Boolean enable;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.PermissionRoleColumnMapDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.PermissionRoleColumnMapVO;
|
||||
import com.nflg.mobilebroken.repository.entity.AdminPermissionRoleColumnMap;
|
||||
|
||||
|
|
@ -15,7 +16,7 @@ import java.util.List;
|
|||
*/
|
||||
public interface AdminPermissionRoleColumnMapMapper extends BaseMapper<AdminPermissionRoleColumnMap> {
|
||||
|
||||
List<PermissionRoleColumnMapVO> getList(Long id);
|
||||
List<PermissionRoleColumnMapDTO> getList(Long id);
|
||||
|
||||
List<PermissionRoleColumnMapVO> getColumns();
|
||||
List<PermissionRoleColumnMapDTO> getColumns();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioDirectItem;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数-子项 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface QuotationModelRatioDirectItemMapper extends BaseMapper<QuotationModelRatioDirectItem> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.nflg.mobilebroken.common.pojo.dto.RatioDirectEffectiveDTO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioDirect;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface QuotationModelRatioDirectMapper extends BaseMapper<QuotationModelRatioDirect> {
|
||||
|
||||
List<RatioDirectEffectiveDTO> getEffectives();
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioDirectItem;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数-子项 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface IQuotationModelRatioDirectItemService extends IService<QuotationModelRatioDirectItem> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.nflg.mobilebroken.common.pojo.dto.RatioDirectEffectiveDTO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioDirect;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface IQuotationModelRatioDirectService extends IService<QuotationModelRatioDirect> {
|
||||
|
||||
List<RatioDirectEffectiveDTO> getEffectives();
|
||||
}
|
||||
|
|
@ -1,15 +1,23 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.PermissionRoleColumnMapDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.PermissionRoleColumnMapItemVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.PermissionRoleColumnMapVO;
|
||||
import com.nflg.mobilebroken.repository.entity.AdminPermissionColumn;
|
||||
import com.nflg.mobilebroken.repository.entity.AdminPermissionRoleColumnMap;
|
||||
import com.nflg.mobilebroken.repository.mapper.AdminPermissionRoleColumnMapMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IAdminPermissionColumnService;
|
||||
import com.nflg.mobilebroken.repository.service.IAdminPermissionRoleColumnMapService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -23,15 +31,39 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
public class AdminPermissionRoleColumnMapServiceImpl extends ServiceImpl<AdminPermissionRoleColumnMapMapper, AdminPermissionRoleColumnMap> implements IAdminPermissionRoleColumnMapService {
|
||||
|
||||
@Resource
|
||||
private IAdminPermissionColumnService permissionColumnService;
|
||||
|
||||
@Override
|
||||
public List<PermissionRoleColumnMapVO> getList(Long id) {
|
||||
List<PermissionRoleColumnMapVO> all = baseMapper.getColumns();
|
||||
List<PermissionRoleColumnMapVO> datas = baseMapper.getList(id);
|
||||
List<PermissionRoleColumnMapDTO> all = baseMapper.getColumns();
|
||||
List<PermissionRoleColumnMapDTO> datas = baseMapper.getList(id);
|
||||
if (CollectionUtil.isEmpty(datas)) {
|
||||
return all;
|
||||
return convert(all);
|
||||
}
|
||||
List<AdminPermissionColumn> columns = permissionColumnService.list();
|
||||
// List<PermissionRoleColumnMapDTO> tmps = new ArrayList<>();
|
||||
// datas.forEach(data -> {
|
||||
// List<String> cols = StrUtil.split(data.getColName(), ",");
|
||||
// cols.forEach(col -> {
|
||||
// tmps.add(
|
||||
// new PermissionRoleColumnMapDTO()
|
||||
// .setId(data.getId())
|
||||
// .setTableId(data.getTableId())
|
||||
// .setTableName(data.getTableName())
|
||||
// .setColName(col)
|
||||
// .setColDesc(
|
||||
// columns.stream()
|
||||
// .filter(c -> Objects.equals(c.getTableId(), data.getTableId()) && Objects.equals(c.getColName(), col))
|
||||
// .findFirst()
|
||||
// .map(AdminPermissionColumn::getColDesc)
|
||||
// .orElse("")
|
||||
// )
|
||||
// );
|
||||
// });
|
||||
// });
|
||||
datas.forEach(data -> {
|
||||
List<PermissionRoleColumnMapVO> vos = all.stream()
|
||||
List<PermissionRoleColumnMapDTO> vos = all.stream()
|
||||
.filter(d -> Objects.equals(d.getTableId(), data.getTableId()))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(vos)) {
|
||||
|
|
@ -44,6 +76,22 @@ public class AdminPermissionRoleColumnMapServiceImpl extends ServiceImpl<AdminPe
|
|||
});
|
||||
}
|
||||
});
|
||||
return datas;
|
||||
return convert(all);
|
||||
}
|
||||
|
||||
private List<PermissionRoleColumnMapVO> convert(List<PermissionRoleColumnMapDTO> datas) {
|
||||
return datas.stream().collect(Collectors.groupingBy(PermissionRoleColumnMapDTO::getKey))
|
||||
.entrySet()
|
||||
.stream()
|
||||
.map(it -> new PermissionRoleColumnMapVO()
|
||||
.setTableId(Long.parseLong(StrUtil.split(it.getKey(), '-').get(0)))
|
||||
.setTableName(StrUtil.split(it.getKey(), '-').get(1))
|
||||
.setItems(it.getValue()
|
||||
.stream()
|
||||
.map(tt -> Convert.convert(PermissionRoleColumnMapItemVO.class, tt))
|
||||
.collect(Collectors.toList())
|
||||
)
|
||||
)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioDirectItem;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationModelRatioDirectItemMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IQuotationModelRatioDirectItemService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数-子项 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Service
|
||||
public class QuotationModelRatioDirectItemServiceImpl extends ServiceImpl<QuotationModelRatioDirectItemMapper, QuotationModelRatioDirectItem> implements IQuotationModelRatioDirectItemService {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.nflg.mobilebroken.common.pojo.dto.RatioDirectEffectiveDTO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioDirect;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationModelRatioDirectMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IQuotationModelRatioDirectService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-直销系数 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Service
|
||||
public class QuotationModelRatioDirectServiceImpl extends ServiceImpl<QuotationModelRatioDirectMapper, QuotationModelRatioDirect> implements IQuotationModelRatioDirectService {
|
||||
|
||||
@Override
|
||||
public List<RatioDirectEffectiveDTO> getEffectives() {
|
||||
return baseMapper.getEffectives();
|
||||
}
|
||||
}
|
||||
|
|
@ -3,10 +3,12 @@
|
|||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.AdminPermissionApiMapper">
|
||||
|
||||
<select id="getListVO" resultType="com.nflg.mobilebroken.common.pojo.vo.PermissionApiItemVO">
|
||||
SELECT api.id as 'api_id', api.api_name, col.id as 'col_id', col.col_name, col.col_desc
|
||||
SELECT api.id as 'api_id',aa.module_name, api.api_name as 'functionName',aa.name as 'apiName',col.id as 'col_id'
|
||||
, col.col_name, col.col_desc
|
||||
FROM admin_permission_api api
|
||||
INNER JOIN admin_permission_api_item item ON api.id = item.api_id
|
||||
INNER JOIN admin_permission_column col ON item.col_id = col.id
|
||||
INNER JOIN admin_api aa ON aa.id=api.api_id
|
||||
WHERE api.table_id = #{id}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.AdminPermissionRoleApiMapMapper">
|
||||
|
||||
<select id="getList" resultType="com.nflg.mobilebroken.common.pojo.vo.PermissionRoleApiMapVO">
|
||||
SELECT map.*, t.table_name,aa.module_name,api.api_name,true as 'selected'
|
||||
SELECT map.*, t.table_desc AS 'table_name',aa.module_name,api.api_name,true as 'selected'
|
||||
FROM admin_permission_role_api_map map
|
||||
INNER JOIN admin_permission_table t ON map.table_id = t.id
|
||||
INNER JOIN admin_permission_api api ON api.table_id = map.table_id
|
||||
|
|
|
|||
|
|
@ -2,14 +2,16 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.AdminPermissionRoleColumnMapMapper">
|
||||
|
||||
<select id="getList" resultType="com.nflg.mobilebroken.common.pojo.vo.PermissionRoleColumnMapVO">
|
||||
SELECT *
|
||||
FROM admin_permission_role_column_map
|
||||
where role_id = #{id}
|
||||
<select id="getList" resultType="com.nflg.mobilebroken.common.pojo.dto.PermissionRoleColumnMapDTO">
|
||||
SELECT aprcm.id,aprcm.col_name,aprcm.table_id,apt.table_desc as 'table_name'
|
||||
FROM admin_permission_role_column_map aprcm
|
||||
left join admin_permission_table apt on aprcm.table_id=apt.id
|
||||
where aprcm.role_id = #{id}
|
||||
</select>
|
||||
<select id="getColumns" resultType="com.nflg.mobilebroken.common.pojo.vo.PermissionRoleColumnMapVO">
|
||||
<select id="getColumns" resultType="com.nflg.mobilebroken.common.pojo.dto.PermissionRoleColumnMapDTO">
|
||||
SELECT c.table_id, t.table_desc as 'table_name', c.col_name, c.col_desc
|
||||
FROM admin_permission_table t
|
||||
INNER JOIN admin_permission_column c ON t.id = c.table_id
|
||||
INNER JOIN admin_permission_column c ON t.id = c.table_id
|
||||
order by c.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.QuotationModelRatioDirectItemMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.QuotationModelRatioDirectMapper">
|
||||
|
||||
<select id="getEffectives" resultType="com.nflg.mobilebroken.common.pojo.dto.RatioDirectEffectiveDTO">
|
||||
SELECT qmrdi.model_id,qmrdi.user_id,qmrdi.standard_ratio,qmrdi.optional_ratio,qmrd.create_by_id as 'parentUserId'
|
||||
FROM quotation_model_ratio_direct qmrd
|
||||
INNER JOIN quotation_model_ratio_direct_item qmrdi ON qmrdi.ratio_id=qmrd.id
|
||||
WHERE qmrd.status=1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -33,7 +33,7 @@ public class CodeGeneratorTest {
|
|||
, Paths.get(System.getProperty("user.dir")) + "/src/main/resources/mapper"))
|
||||
)
|
||||
.strategyConfig(builder -> {
|
||||
builder.addInclude("quotation_model_ratio_agent_item") //只生成指定表
|
||||
builder.addInclude("quotation_model_ratio_direct_item") //只生成指定表
|
||||
.entityBuilder()
|
||||
.enableLombok()
|
||||
.enableChainModel()
|
||||
|
|
|
|||
Loading…
Reference in New Issue