parent
21808c876d
commit
2a719a45b4
12 changed files with 971 additions and 1 deletions
@ -0,0 +1,46 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.pojo.dto; |
||||
|
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.desk.basic.pojo.entity.BsAssignEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 分派规则维护 数据传输对象实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BsAssignDTO extends BsAssignEntity { |
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
||||
@ -0,0 +1,138 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.pojo.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
import java.io.Serial; |
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* 分派规则维护 实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
@Data |
||||
@TableName("BS_ASSIGN") |
||||
@Schema(description = "BsAssign对象") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BsAssignEntity extends TenantEntity { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 工艺名称 |
||||
*/ |
||||
@Schema(description = "工艺名称") |
||||
private String craftAbility; |
||||
/** |
||||
* 工艺id |
||||
*/ |
||||
@Schema(description = "工艺id") |
||||
private Long craftAbilityId; |
||||
/** |
||||
* 零件号 |
||||
*/ |
||||
@Schema(description = "零件号") |
||||
private String partCode; |
||||
/** |
||||
* 生产标识 |
||||
*/ |
||||
@Schema(description = "生产标识") |
||||
private String prodMark; |
||||
/** |
||||
* 生产标识id |
||||
*/ |
||||
@Schema(description = "生产标识id") |
||||
private BigDecimal prodMarkId; |
||||
/** |
||||
* 单面积上限 |
||||
*/ |
||||
@Schema(description = "单面积上限") |
||||
private BigDecimal upArea; |
||||
/** |
||||
* 单面积下限 |
||||
*/ |
||||
@Schema(description = "单面积下限") |
||||
private BigDecimal lowArea; |
||||
/** |
||||
* 单批面积上限 |
||||
*/ |
||||
@Schema(description = "单批面积上限") |
||||
private BigDecimal singleUpArea; |
||||
/** |
||||
* 单批面积下限 |
||||
*/ |
||||
@Schema(description = "单批面积下限") |
||||
private BigDecimal singleDownArea; |
||||
/** |
||||
* 限制类型 |
||||
*/ |
||||
@Schema(description = "限制类型") |
||||
private String limitType; |
||||
/** |
||||
* 指定类型 |
||||
*/ |
||||
@Schema(description = "指定类型") |
||||
private String pointType; |
||||
/** |
||||
* 外协厂商id |
||||
*/ |
||||
@Schema(description = "外协厂商id") |
||||
private Long oemId; |
||||
/** |
||||
* 外协厂商 |
||||
*/ |
||||
@Schema(description = "外协厂商") |
||||
private String oemName; |
||||
/** |
||||
* 作业中心id |
||||
*/ |
||||
@Schema(description = "作业中心id") |
||||
private Long centerId; |
||||
/** |
||||
* 作业中心名称 |
||||
*/ |
||||
@Schema(description = "作业中心名称") |
||||
private String centerName; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@Schema(description = "备注") |
||||
private String remark; |
||||
/** |
||||
* |
||||
*/ |
||||
@Schema(description = "") |
||||
private Long sort; |
||||
|
||||
} |
||||
@ -0,0 +1,46 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.pojo.vo; |
||||
|
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.desk.basic.pojo.entity.BsAssignEntity; |
||||
|
||||
import java.io.Serial; |
||||
|
||||
/** |
||||
* 分派规则维护 视图实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BsAssignVO extends BsAssignEntity { |
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
||||
@ -0,0 +1,244 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import jakarta.servlet.http.HttpServletResponse; |
||||
import jakarta.validation.Valid; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.excel.util.ExcelUtil; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.secure.BladeUser; |
||||
import org.springblade.core.secure.annotation.IsAdmin; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.core.tool.utils.DateUtil; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.desk.basic.excel.BsAssignExcel; |
||||
import org.springblade.desk.basic.excel.CoatingThicknessExcel; |
||||
import org.springblade.desk.basic.pojo.entity.*; |
||||
import org.springblade.desk.basic.pojo.vo.BsAssignVO; |
||||
import org.springblade.desk.basic.service.IBsAssignService; |
||||
import org.springblade.desk.basic.service.ICraftAbilityService; |
||||
import org.springblade.desk.basic.service.IOemService; |
||||
import org.springblade.desk.basic.service.IWorkCenterService; |
||||
import org.springblade.desk.basic.util.ExcelExtUtil; |
||||
import org.springblade.desk.basic.wrapper.BsAssignWrapper; |
||||
import org.springblade.scheduling.pojo.entity.CraftAbilityEntity; |
||||
import org.springblade.system.cache.DictCache; |
||||
import org.springframework.core.io.Resource; |
||||
import org.springframework.http.ResponseEntity; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
/** |
||||
* 分派规则维护 控制器 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/bsAssign") |
||||
@Tag(name = "分派规则维护", description = "分派规则维护接口") |
||||
public class BsAssignController extends BladeController { |
||||
|
||||
private final IBsAssignService bsAssignService; |
||||
private final ICraftAbilityService craftAbilityService; |
||||
private final IOemService service; |
||||
@jakarta.annotation.Resource |
||||
private IWorkCenterService centerService; |
||||
/** |
||||
* 分派规则维护 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@Operation(summary = "详情", description = "传入bsAssign") |
||||
public R<BsAssignVO> detail(BsAssignEntity bsAssign) { |
||||
BsAssignEntity detail = bsAssignService.getOne(Condition.getQueryWrapper(bsAssign)); |
||||
return R.data(BsAssignWrapper.build().entityVO(detail)); |
||||
} |
||||
/** |
||||
* 分派规则维护 分页 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@Operation(summary = "分页", description = "传入bsAssign") |
||||
public R<IPage<BsAssignVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> bsAssign, Query query) { |
||||
IPage<BsAssignEntity> pages = bsAssignService.page(Condition.getPage(query), Condition.getQueryWrapper(bsAssign, BsAssignEntity.class)); |
||||
return R.data(BsAssignWrapper.build().pageVO(pages)); |
||||
} |
||||
|
||||
/** |
||||
* 分派规则维护 自定义分页 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@Operation(summary = "分页", description = "传入bsAssign") |
||||
public R<IPage<BsAssignVO>> page(BsAssignVO bsAssign, Query query) { |
||||
IPage<BsAssignVO> pages = bsAssignService.selectBsAssignPage(Condition.getPage(query), bsAssign); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 分派规则维护 新增 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@Operation(summary = "新增", description = "传入bsAssign") |
||||
public R save(@Valid @RequestBody BsAssignEntity bsAssign) { |
||||
return R.status(bsAssignService.save(bsAssign)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* [分派规则维护] |
||||
*/ |
||||
@PostMapping("/saveBat") |
||||
@ApiOperationSupport(order = 31) |
||||
@Operation(summary = "新增批量", description = "BsAssignEntity List") |
||||
public R saveBat(@Valid @RequestBody List<BsAssignEntity> addList) { |
||||
// addList.forEach(one -> {
|
||||
// one.setId(null);
|
||||
// });
|
||||
return R.status(bsAssignService.saveOrUpdateBatch(addList)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 分派规则维护 修改 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@Operation(summary = "修改", description = "传入bsAssign") |
||||
public R update(@Valid @RequestBody BsAssignEntity bsAssign) { |
||||
return R.status(bsAssignService.updateById(bsAssign)); |
||||
} |
||||
|
||||
/** |
||||
* 分派规则维护 新增或修改 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@Operation(summary = "新增或修改", description = "传入bsAssign") |
||||
public R submit(@Valid @RequestBody BsAssignEntity bsAssign) { |
||||
return R.status(bsAssignService.saveOrUpdate(bsAssign)); |
||||
} |
||||
|
||||
/** |
||||
* 分派规则维护 删除 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@Operation(summary = "逻辑删除", description = "传入ids") |
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(bsAssignService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
*/ |
||||
@IsAdmin |
||||
@GetMapping("/export-bsAssign") |
||||
@ApiOperationSupport(order = 9) |
||||
@Operation(summary = "导出数据", description = "传入bsAssign") |
||||
public void exportBsAssign(@Parameter(hidden = true) @RequestParam Map<String, Object> bsAssign, BladeUser bladeUser, HttpServletResponse response) { |
||||
QueryWrapper<BsAssignEntity> queryWrapper = Condition.getQueryWrapper(bsAssign, BsAssignEntity.class); |
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(BsAssign::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(BsAssignEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<BsAssignExcel> list = bsAssignService.exportBsAssign(queryWrapper); |
||||
ExcelUtil.export(response, "分派规则维护数据" + DateUtil.time(), "分派规则维护数据表", list, BsAssignExcel.class); |
||||
} |
||||
|
||||
@GetMapping("/downloadExcelTemplate") |
||||
@ApiOperationSupport(order = 71) |
||||
@Operation(summary = "下载Excel模板", description = "") |
||||
public ResponseEntity<Resource> downloadExcelTemplate() { |
||||
return ExcelExtUtil.downloadXlsTemplate( |
||||
"Excel/QA/分派规则维护.xls", |
||||
"导入模版-分派规则维护.xls"); |
||||
} |
||||
|
||||
@PostMapping("/importExcel") |
||||
@ApiOperationSupport(order = 72) |
||||
@Operation(summary = "导入Excel", description = "MultipartFile") |
||||
public R importExcel(@RequestParam("file") MultipartFile file) { |
||||
List<BsAssignEntity> noticeList = new ArrayList<>(); |
||||
List<BsAssignExcel> list = ExcelUtil.read(file, BsAssignExcel.class); |
||||
list.forEach(noticeExcel -> { |
||||
|
||||
BsAssignEntity notice = BeanUtil.copy(noticeExcel, BsAssignEntity.class); |
||||
|
||||
//工艺能力
|
||||
QueryWrapper<CraftAbilityEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("CA_NAME",noticeExcel.getCraftAbility()); |
||||
List<CraftAbilityEntity> crafs = craftAbilityService.list(queryWrapper); |
||||
if(null != crafs && crafs.size() > 0){ |
||||
notice.setCraftAbilityId(crafs.get(0).getId()); |
||||
} |
||||
|
||||
|
||||
//外协厂商
|
||||
QueryWrapper<Oem> queryWrapperoem = new QueryWrapper<>(); |
||||
queryWrapperoem.eq("OC_NAME",noticeExcel.getOemName()); |
||||
List<Oem> oems = service.list(queryWrapperoem); |
||||
if(null != oems && oems.size() > 0){ |
||||
notice.setOemId(oems.get(0).getId()); |
||||
} |
||||
|
||||
//作业中心
|
||||
QueryWrapper<WorkCenter> queryWrappercenter = new QueryWrapper<>(); |
||||
queryWrappercenter.eq("WC_NAME",noticeExcel.getOemName()); |
||||
List<WorkCenter> centers = centerService.list(queryWrappercenter); |
||||
if(null != centers && centers.size() > 0){ |
||||
notice.setCenterId(oems.get(0).getId()); |
||||
} |
||||
|
||||
//指定类型
|
||||
String category = DictCache.getKey("AssignPoint", noticeExcel.getPointTypeName()); |
||||
notice.setPointType(category); |
||||
//限制类型
|
||||
String categorylimit = DictCache.getKey("AssignLimit", noticeExcel.getLimitTypeName()); |
||||
notice.setLimitType(categorylimit); |
||||
noticeList.add(notice); |
||||
}); |
||||
return R.data(bsAssignService.saveBatch(noticeList)); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,172 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.excel; |
||||
|
||||
|
||||
import lombok.Data; |
||||
|
||||
import java.math.BigDecimal; |
||||
import java.util.Date; |
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import java.io.Serializable; |
||||
import java.io.Serial; |
||||
|
||||
|
||||
/** |
||||
* 分派规则维护 Excel实体类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(18) |
||||
public class BsAssignExcel implements Serializable { |
||||
|
||||
@Serial |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("") |
||||
private BigDecimal id; |
||||
/** |
||||
* 工艺名称 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("工艺能力") |
||||
private String craftAbility; |
||||
/** |
||||
* 工艺id |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("工艺id") |
||||
private BigDecimal craftAbilityId; |
||||
/** |
||||
* 零件号 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("零件号") |
||||
private String partCode; |
||||
/** |
||||
* 生产标识 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("生产标识") |
||||
private String prodMark; |
||||
/** |
||||
* 生产标识id |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("生产标识id") |
||||
private BigDecimal prodMarkId; |
||||
/** |
||||
* 单面积上限 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("单面积上限") |
||||
private BigDecimal upArea; |
||||
/** |
||||
* 单面积下限 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("单面积下限") |
||||
private BigDecimal lowArea; |
||||
/** |
||||
* 单批面积上限 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("单批面积上限") |
||||
private BigDecimal singleUpArea; |
||||
/** |
||||
* 单批面积下限 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("单批面积下限") |
||||
private BigDecimal singleDownArea; |
||||
/** |
||||
* 限制类型 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("限制类型") |
||||
// private String limitType;
|
||||
private String limitTypeName; |
||||
/** |
||||
* 指定类型 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("指定类型") |
||||
private String pointTypeName; |
||||
/** |
||||
* 外协厂商id |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("外协厂商id") |
||||
private Short oemId; |
||||
/** |
||||
* 外协厂商 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("外协厂商") |
||||
private String oemName; |
||||
/** |
||||
* 作业中心id |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("作业中心id") |
||||
private Short centerId; |
||||
/** |
||||
* 作业中心名称 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("作业中心") |
||||
private String centerName; |
||||
/** |
||||
* 备注 |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("备注") |
||||
private String remark; |
||||
/** |
||||
* |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("") |
||||
private Long isDeleted; |
||||
/** |
||||
* |
||||
*/ |
||||
@ColumnWidth(20) |
||||
@ExcelProperty("") |
||||
private Long sort; |
||||
|
||||
} |
||||
@ -0,0 +1,43 @@ |
||||
<?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="org.springblade.desk.basic.mapper.BsAssignMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="bsAssignResultMap" type="org.springblade.desk.basic.pojo.entity.BsAssignEntity"> |
||||
<result column="ID" property="id"/> |
||||
<result column="CRAFT_ABILITY" property="craftAbility"/> |
||||
<result column="CRAFT_ABILITY_ID" property="craftAbilityId"/> |
||||
<result column="PART_CODE" property="partCode"/> |
||||
<result column="PROD_MARK" property="prodMark"/> |
||||
<result column="PROD_MARK_ID" property="prodMarkId"/> |
||||
<result column="UP_AREA" property="upArea"/> |
||||
<result column="LOW_AREA" property="lowArea"/> |
||||
<result column="SINGLE_UP_AREA" property="singleUpArea"/> |
||||
<result column="SINGLE_DOWN_AREA" property="singleDownArea"/> |
||||
<result column="LIMIT_TYPE" property="limitType"/> |
||||
<result column="POINT_TYPE" property="pointType"/> |
||||
<result column="OEM_ID" property="oemId"/> |
||||
<result column="OEM_NAME" property="oemName"/> |
||||
<result column="CENTER_ID" property="centerId"/> |
||||
<result column="CENTER_NAME" property="centerName"/> |
||||
<result column="REMARK" property="remark"/> |
||||
<result column="CREATE_USER" property="createUser"/> |
||||
<result column="CREATE_TIME" property="createTime"/> |
||||
<result column="CREATE_DEPT" property="createDept"/> |
||||
<result column="UPDATE_USER" property="updateUser"/> |
||||
<result column="UPDATE_TIME" property="updateTime"/> |
||||
<result column="IS_DELETED" property="isDeleted"/> |
||||
<result column="SORT" property="sort"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectBsAssignPage" resultMap="bsAssignResultMap"> |
||||
select * from BS_ASSIGN where is_deleted = 0 |
||||
</select> |
||||
|
||||
|
||||
<select id="exportBsAssign" resultType="org.springblade.desk.basic.excel.BsAssignExcel"> |
||||
SELECT * FROM BS_ASSIGN ${ew.customSqlSegment} |
||||
</select> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,65 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.springblade.desk.basic.excel.BsAssignExcel; |
||||
import org.springblade.desk.basic.pojo.entity.BsAssignEntity; |
||||
import org.springblade.desk.basic.pojo.vo.BsAssignVO; |
||||
|
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 分派规则维护 Mapper 接口 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
public interface BsAssignMapper extends BaseMapper<BsAssignEntity> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param bsAssign 查询参数 |
||||
* @return List<BsAssignVO> |
||||
*/ |
||||
List<BsAssignVO> selectBsAssignPage(IPage page, BsAssignVO bsAssign); |
||||
|
||||
|
||||
/** |
||||
* 获取导出数据 |
||||
* |
||||
* @param queryWrapper 查询条件 |
||||
* @return List<BsAssignExcel> |
||||
*/ |
||||
List<BsAssignExcel> exportBsAssign(@Param("ew") Wrapper<BsAssignEntity> queryWrapper); |
||||
|
||||
} |
||||
@ -0,0 +1,63 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.desk.basic.excel.BsAssignExcel; |
||||
import org.springblade.desk.basic.pojo.entity.BsAssignEntity; |
||||
import org.springblade.desk.basic.pojo.vo.BsAssignVO; |
||||
|
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 分派规则维护 服务类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
public interface IBsAssignService extends BaseService<BsAssignEntity> { |
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page 分页参数 |
||||
* @param bsAssign 查询参数 |
||||
* @return IPage<BsAssignVO> |
||||
*/ |
||||
IPage<BsAssignVO> selectBsAssignPage(IPage<BsAssignVO> page, BsAssignVO bsAssign); |
||||
|
||||
|
||||
/** |
||||
* 导出数据 |
||||
* |
||||
* @param queryWrapper 查询条件 |
||||
* @return List<BsAssignExcel> |
||||
*/ |
||||
List<BsAssignExcel> exportBsAssign(Wrapper<BsAssignEntity> queryWrapper); |
||||
|
||||
} |
||||
@ -0,0 +1,64 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springblade.desk.basic.excel.BsAssignExcel; |
||||
import org.springblade.desk.basic.mapper.BsAssignMapper; |
||||
import org.springblade.desk.basic.pojo.entity.BsAssignEntity; |
||||
import org.springblade.desk.basic.pojo.vo.BsAssignVO; |
||||
import org.springblade.desk.basic.service.IBsAssignService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 分派规则维护 服务实现类 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
@Service |
||||
public class BsAssignServiceImpl extends BaseServiceImpl<BsAssignMapper, BsAssignEntity> implements IBsAssignService { |
||||
|
||||
@Override |
||||
public IPage<BsAssignVO> selectBsAssignPage(IPage<BsAssignVO> page, BsAssignVO bsAssign) { |
||||
return page.setRecords(baseMapper.selectBsAssignPage(page, bsAssign)); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public List<BsAssignExcel> exportBsAssign(Wrapper<BsAssignEntity> queryWrapper) { |
||||
List<BsAssignExcel> bsAssignList = baseMapper.exportBsAssign(queryWrapper); |
||||
//bsAssignList.forEach(bsAssign -> {
|
||||
// bsAssign.setTypeName(DictCache.getValue(DictEnum.YES_NO, BsAssign.getType()));
|
||||
//});
|
||||
return bsAssignList; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,60 @@ |
||||
/** |
||||
* BladeX Commercial License Agreement |
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p> |
||||
* Use of this software is governed by the Commercial License Agreement |
||||
* obtained after purchasing a license from BladeX. |
||||
* <p> |
||||
* 1. This software is for development use only under a valid license |
||||
* from BladeX. |
||||
* <p> |
||||
* 2. Redistribution of this software's source code to any third party |
||||
* without a commercial license is strictly prohibited. |
||||
* <p> |
||||
* 3. Licensees may copyright their own code but cannot use segments |
||||
* from this software for such purposes. Copyright of this software |
||||
* remains with BladeX. |
||||
* <p> |
||||
* Using this software signifies agreement to this License, and the software |
||||
* must not be used for illegal purposes. |
||||
* <p> |
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is |
||||
* not liable for any claims arising from secondary or illegal development. |
||||
* <p> |
||||
* Author: Chill Zhuang (bladejava@qq.com) |
||||
*/ |
||||
package org.springblade.desk.basic.wrapper; |
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.desk.basic.pojo.entity.BsAssignEntity; |
||||
import org.springblade.desk.basic.pojo.vo.BsAssignVO; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
/** |
||||
* 分派规则维护 包装类,返回视图层所需的字段 |
||||
* |
||||
* @author BladeX |
||||
* @since 2026-02-27 |
||||
*/ |
||||
public class BsAssignWrapper extends BaseEntityWrapper<BsAssignEntity, BsAssignVO> { |
||||
|
||||
public static BsAssignWrapper build() { |
||||
return new BsAssignWrapper(); |
||||
} |
||||
|
||||
@Override |
||||
public BsAssignVO entityVO(BsAssignEntity bsAssign) { |
||||
BsAssignVO bsAssignVO = Objects.requireNonNull(BeanUtil.copyProperties(bsAssign, BsAssignVO.class)); |
||||
|
||||
//User createUser = UserCache.getUser(bsAssign.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(bsAssign.getUpdateUser());
|
||||
//bsAssignVO.setCreateUserName(createUser.getName());
|
||||
//bsAssignVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return bsAssignVO; |
||||
} |
||||
|
||||
|
||||
} |
||||
Binary file not shown.
Loading…
Reference in new issue