Compare commits
76 Commits
liutao_bra
...
main
| Author | SHA1 | Date |
|---|---|---|
|
|
3984fbe953 | 4 days ago |
|
|
ab4d198ee2 | 5 days ago |
|
|
8546d1e67e | 5 days ago |
|
|
8fcf74187b | 6 days ago |
|
|
4b08408511 | 7 days ago |
|
|
13183a6a2a | 1 week ago |
|
|
1ea54b1f57 | 1 week ago |
|
|
a7863b39b5 | 1 week ago |
|
|
dbc47aa249 | 1 week ago |
|
|
0af3e8757f | 1 week ago |
|
|
9585c9eb96 | 1 week ago |
|
|
719cfb797e | 1 week ago |
|
|
b85e6e7360 | 2 weeks ago |
|
|
380a4a3bd1 | 2 weeks ago |
|
|
5c1055b821 | 2 weeks ago |
|
|
000aa526e8 | 2 weeks ago |
|
|
4dc54fcbc8 | 2 weeks ago |
|
|
5ca9c9112a | 2 weeks ago |
|
|
999dd4f12e | 3 weeks ago |
|
|
c40230913f | 3 weeks ago |
|
|
b84682b9f4 | 3 weeks ago |
|
|
564726280b | 3 weeks ago |
|
|
a9a910ed8f | 3 weeks ago |
|
|
77320d3da3 | 3 weeks ago |
|
|
b67ff2879c | 4 weeks ago |
|
|
fcc3cf46c0 | 4 weeks ago |
|
|
ec455718f1 | 4 weeks ago |
|
|
c2ec3f0dbf | 4 weeks ago |
|
|
00f5b71f27 | 4 weeks ago |
|
|
d85744aba4 | 4 weeks ago |
|
|
728121dd77 | 4 weeks ago |
|
|
15dc437e4e | 4 weeks ago |
|
|
09a2c8458c | 4 weeks ago |
|
|
e6197fd60a | 4 weeks ago |
|
|
92feeb7f84 | 1 month ago |
|
|
a8fb7cd262 | 1 month ago |
|
|
ead8061756 | 1 month ago |
|
|
6923984f8f | 1 month ago |
|
|
29567d00af | 1 month ago |
|
|
b31e3ede4f | 1 month ago |
|
|
a6031a0c30 | 1 month ago |
|
|
f804a95f24 | 1 month ago |
|
|
6d651523c3 | 1 month ago |
|
|
a1db78fd3d | 1 month ago |
|
|
c2bde1b2b9 | 1 month ago |
|
|
7616b34052 | 1 month ago |
|
|
6185639d4a | 1 month ago |
|
|
90e5cd0654 | 1 month ago |
|
|
0e54bd9035 | 1 month ago |
|
|
dee985829f | 1 month ago |
|
|
6030506c8b | 1 month ago |
|
|
5dd2d7fa59 | 1 month ago |
|
|
4935872568 | 1 month ago |
|
|
75408b486b | 1 month ago |
|
|
5ab15ccca2 | 1 month ago |
|
|
50a0b97572 | 1 month ago |
|
|
d4d3ad4f57 | 1 month ago |
|
|
f5be8bc03a | 1 month ago |
|
|
b19632ab32 | 1 month ago |
|
|
c465299f08 | 1 month ago |
|
|
1a389d8df3 | 1 month ago |
|
|
bf213b6da5 | 1 month ago |
|
|
70936e690d | 1 month ago |
|
|
bc85d4e924 | 1 month ago |
|
|
24f11f4deb | 1 month ago |
|
|
e99d6e36c0 | 1 month ago |
|
|
a86d70c0a6 | 1 month ago |
|
|
5b7456c50a | 1 month ago |
|
|
977a16e6c9 | 2 months ago |
|
|
bc9159c1ac | 2 months ago |
|
|
04cc023b4f | 2 months ago |
|
|
835fa5b271 | 2 months ago |
|
|
1b90a076fe | 2 months ago |
|
|
0bbac34d67 | 2 months ago |
|
|
9c46da356f | 2 months ago |
|
|
00681c954e | 2 months ago |
@ -0,0 +1,122 @@
|
|||||||
|
package cn.iocoder.yudao.module.common.controller.admin.qrcoderecord;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.common.controller.admin.qrcoderecord.vo.QrcodeRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.common.controller.admin.qrcoderecord.vo.QrcodeRecordRespVO;
|
||||||
|
import cn.iocoder.yudao.module.common.controller.admin.qrcoderecord.vo.QrcodeRecordSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.common.dal.dataobject.qrcoderecord.QrcodeRecordDO;
|
||||||
|
import cn.iocoder.yudao.module.common.service.qrcordrecord.QrcodeRecordService;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 通用二维码记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qrcode/record")
|
||||||
|
@Validated
|
||||||
|
public class QrcodeRecordController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private QrcodeRecordService qrcodeRecordService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建通用二维码记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qrcode:record:create')")
|
||||||
|
public CommonResult<Long> createRecord(@Valid @RequestBody QrcodeRecordSaveReqVO createReqVO) {
|
||||||
|
return success(qrcodeRecordService.createRecord(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新通用二维码记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qrcode:record:update')")
|
||||||
|
public CommonResult<Boolean> updateRecord(@Valid @RequestBody QrcodeRecordSaveReqVO updateReqVO) {
|
||||||
|
qrcodeRecordService.updateRecord(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除通用二维码记录")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('qrcode:record:delete')")
|
||||||
|
public CommonResult<Boolean> deleteRecord(@RequestParam("id") Long id) {
|
||||||
|
qrcodeRecordService.deleteRecord(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得通用二维码记录")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qrcode:record:query')")
|
||||||
|
public CommonResult<QrcodeRecordRespVO> getRecord(@RequestParam("id") Long id) {
|
||||||
|
QrcodeRecordDO record = qrcodeRecordService.getRecord(id);
|
||||||
|
return success(BeanUtils.toBean(record, QrcodeRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得通用二维码记录分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qrcode:record:query')")
|
||||||
|
public CommonResult<PageResult<QrcodeRecordRespVO>> getRecordPage(@Valid QrcodeRecordPageReqVO pageReqVO) {
|
||||||
|
PageResult<QrcodeRecordDO> pageResult = qrcodeRecordService.getRecordPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, QrcodeRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出通用二维码记录 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('qrcode:record:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportRecordExcel(@Valid QrcodeRecordPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<QrcodeRecordDO> list = qrcodeRecordService.getRecordPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "通用二维码记录.xls", "数据", QrcodeRecordRespVO.class,
|
||||||
|
BeanUtils.toBean(list, QrcodeRecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO 扫二维码拉起app端,仍需app拉起连接地址。
|
||||||
|
// @GetMapping(value = "/scan", produces = "text/html;charset=UTF-8")
|
||||||
|
// @Operation(summary = "扫二维码拉起app端 ")
|
||||||
|
// @PermitAll
|
||||||
|
// public void scan(@RequestParam("type") String type,
|
||||||
|
// @RequestParam("id") Long id,
|
||||||
|
// @RequestParam(required=false) String code,
|
||||||
|
// HttpServletResponse response) throws IOException {
|
||||||
|
// String html = qrcodeRecordService.buildScanTransitHtml(type, id,code);
|
||||||
|
// response.setContentType("text/html;charset=UTF-8");
|
||||||
|
// response.getWriter().write(html);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/scan/resolve-id")
|
||||||
|
@Operation(summary = "扫二维码返回对应id ")
|
||||||
|
@PermitAll
|
||||||
|
public CommonResult<Map<String, Object>> resolveId(@RequestParam String type,
|
||||||
|
@RequestParam Long id,
|
||||||
|
@RequestParam String code) {
|
||||||
|
return success(qrcodeRecordService.resolveScanBizId(type, id, code));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.common.dal.mysql.qrcoderecord;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.common.controller.admin.qrcoderecord.vo.QrcodeRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.common.dal.dataobject.qrcoderecord.QrcodeRecordDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用二维码记录 Mapper
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface QrcodeRecordMapper extends BaseMapperX<QrcodeRecordDO> {
|
||||||
|
|
||||||
|
default PageResult<QrcodeRecordDO> selectPage(QrcodeRecordPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<QrcodeRecordDO>()
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getBizType, reqVO.getBizType())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getBizId, reqVO.getBizId())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getBizCode, reqVO.getBizCode())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getQrScene, reqVO.getQrScene())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getQrContent, reqVO.getQrContent())
|
||||||
|
.likeIfPresent(QrcodeRecordDO::getFileName, reqVO.getFileName())
|
||||||
|
.likeIfPresent(QrcodeRecordDO::getBucketName, reqVO.getBucketName())
|
||||||
|
.likeIfPresent(QrcodeRecordDO::getObjectName, reqVO.getObjectName())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getQrcodeFileUrl, reqVO.getQrcodeFileUrl())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getMimeType, reqVO.getMimeType())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getFileSize, reqVO.getFileSize())
|
||||||
|
.eqIfPresent(QrcodeRecordDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(QrcodeRecordDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(QrcodeRecordDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum CodeTypeEnum {
|
||||||
|
|
||||||
|
QR("QR", "二维码"),
|
||||||
|
BARCODE("BARCODE", "条形码");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDesc() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CodeTypeEnum fromBarcodeType(Integer barcodeType) {
|
||||||
|
if (barcodeType == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return Integer.valueOf(1).equals(barcodeType) ? BARCODE : QR;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
package cn.iocoder.yudao.module.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum QrcodeBizTypeEnum {
|
||||||
|
|
||||||
|
PRODUCT("PRODUCTMATERIAL", "产品物料"),
|
||||||
|
EQUIPMENT("EQUIPMENT", "设备"),
|
||||||
|
KEY_PART("KEY_PART", "关键件"),
|
||||||
|
MOLD("MOLD", "模具"),
|
||||||
|
SPARE("SPARE", "备件");
|
||||||
|
|
||||||
|
private final String code;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
public static QrcodeBizTypeEnum of(String code) {
|
||||||
|
for (QrcodeBizTypeEnum item : values()) {
|
||||||
|
if (item.code.equalsIgnoreCase(code)) {
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
package cn.iocoder.yudao.module.common.handler;
|
||||||
|
|
||||||
|
|
||||||
|
public interface QrcodeBizHandler {
|
||||||
|
String getBizType();
|
||||||
|
boolean exists(Long id);
|
||||||
|
String buildDeepLink(Long id);
|
||||||
|
String buildH5Path(Long id);
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package cn.iocoder.yudao.module.common.service.qrcordrecord;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.common.controller.admin.qrcoderecord.vo.QrcodeRecordPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.common.controller.admin.qrcoderecord.vo.QrcodeRecordSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.common.dal.dataobject.qrcoderecord.QrcodeRecordDO;
|
||||||
|
import cn.iocoder.yudao.module.common.enums.CodeTypeEnum;
|
||||||
|
import cn.iocoder.yudao.module.common.enums.QrcodeBizTypeEnum;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用二维码记录 Service 接口
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
public interface QrcodeRecordService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建通用二维码记录
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createRecord(@Valid QrcodeRecordSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新通用二维码记录
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateRecord(@Valid QrcodeRecordSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除通用二维码记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteRecord(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得通用二维码记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 通用二维码记录
|
||||||
|
*/
|
||||||
|
QrcodeRecordDO getRecord(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得通用二维码记录分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 通用二维码记录分页
|
||||||
|
*/
|
||||||
|
PageResult<QrcodeRecordDO> getRecordPage(QrcodeRecordPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
|
||||||
|
void generateOrRefresh(QrcodeBizTypeEnum bizType, Long bizId, String bizCode, String scene) throws UnsupportedEncodingException;
|
||||||
|
|
||||||
|
void generateOrRefreshBarcode(QrcodeBizTypeEnum bizType, Long bizId, String bizCode, String scene) throws UnsupportedEncodingException;
|
||||||
|
|
||||||
|
String buildScanTransitHtml(String type, Long id,String code);
|
||||||
|
|
||||||
|
String selectQrcodeUrlByIdAndCode(String code, Long id, String code1);
|
||||||
|
|
||||||
|
Map<String, Object> resolveScanBizId(String type, Long id, String code);
|
||||||
|
|
||||||
|
void deleteByBiz(QrcodeBizTypeEnum bizType, Long bizId);
|
||||||
|
|
||||||
|
void regenerateByCodeType(QrcodeBizTypeEnum bizType, Long bizId, String bizCode, String scene, String codeType)
|
||||||
|
throws UnsupportedEncodingException;
|
||||||
|
|
||||||
|
void generateOrRefresh(
|
||||||
|
QrcodeBizTypeEnum bizType,
|
||||||
|
Long bizId,
|
||||||
|
String bizCode,
|
||||||
|
String scene,
|
||||||
|
CodeTypeEnum codeType
|
||||||
|
) throws UnsupportedEncodingException;
|
||||||
|
}
|
||||||
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.autocode.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 条形码/二维码类型枚举
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ErpBarcodeTypeEnum {
|
||||||
|
|
||||||
|
BARCODE(1, "条形码"),
|
||||||
|
QRCODE(2, "二维码"),
|
||||||
|
BOTH(3, "条形码+二维码");
|
||||||
|
|
||||||
|
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpBarcodeTypeEnum::getType).toArray();
|
||||||
|
|
||||||
|
private final Integer type;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型获取描述
|
||||||
|
*/
|
||||||
|
public static String getDescByType(Integer type) {
|
||||||
|
if (type == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (ErpBarcodeTypeEnum value : values()) {
|
||||||
|
if (value.getType().equals(type)) {
|
||||||
|
return value.getDesc();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "未知";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 产品列表 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ErpProductListReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "产品名称", example = "零件A")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "产品分类编号", example = "11161")
|
||||||
|
private Long categoryId;
|
||||||
|
|
||||||
|
@Schema(description = "产品编号", example = "11161")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "产品规格", example = "红色")
|
||||||
|
private String standard;
|
||||||
|
|
||||||
|
@Schema(description = "产品 id 集合")
|
||||||
|
private List<Long> ids;
|
||||||
|
}
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProductRelationRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "ID", example = "1")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "名称", example = "设备A")
|
||||||
|
private String name;
|
||||||
|
}
|
||||||
@ -0,0 +1,96 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productdevicerel;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productdevicerel.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productdevicerel.ProductDeviceRelDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.productdevicerel.ProductDeviceRelService;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 产品-设备关联")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/erp/product-device-rel")
|
||||||
|
@Validated
|
||||||
|
public class ProductDeviceRelController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProductDeviceRelService productDeviceRelService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建产品-设备关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-device-rel:create')")
|
||||||
|
public CommonResult<Long> createProductDeviceRel(@Valid @RequestBody ProductDeviceRelSaveReqVO createReqVO) {
|
||||||
|
return success(productDeviceRelService.createProductDeviceRel(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新产品-设备关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-device-rel:update')")
|
||||||
|
public CommonResult<Boolean> updateProductDeviceRel(@Valid @RequestBody ProductDeviceRelSaveReqVO updateReqVO) {
|
||||||
|
productDeviceRelService.updateProductDeviceRel(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除产品-设备关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-device-rel:delete')")
|
||||||
|
public CommonResult<Boolean> deleteProductDeviceRel(@RequestParam("id") Long id) {
|
||||||
|
productDeviceRelService.deleteProductDeviceRel(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得产品-设备关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-device-rel:query')")
|
||||||
|
public CommonResult<ProductDeviceRelRespVO> getProductDeviceRel(@RequestParam("id") Long id) {
|
||||||
|
ProductDeviceRelDO productDeviceRel = productDeviceRelService.getProductDeviceRel(id);
|
||||||
|
return success(BeanUtils.toBean(productDeviceRel, ProductDeviceRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得产品-设备关联分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-device-rel:query')")
|
||||||
|
public CommonResult<PageResult<ProductDeviceRelRespVO>> getProductDeviceRelPage(@Valid ProductDeviceRelPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProductDeviceRelDO> pageResult = productDeviceRelService.getProductDeviceRelPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ProductDeviceRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出产品-设备关联 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-device-rel:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportProductDeviceRelExcel(@Valid ProductDeviceRelPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ProductDeviceRelDO> list = productDeviceRelService.getProductDeviceRelPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "产品-设备关联.xls", "数据", ProductDeviceRelRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ProductDeviceRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productdevicerel.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 产品-设备关联分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ProductDeviceRelPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "产品ID", example = "18574")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "设备ID", example = "21075")
|
||||||
|
private Long deviceId;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productdevicerel.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 产品-设备关联 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ProductDeviceRelRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28748")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18574")
|
||||||
|
@ExcelProperty("产品ID")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21075")
|
||||||
|
@ExcelProperty("设备ID")
|
||||||
|
private Long deviceId;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@ExcelProperty("排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productdevicerel.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 产品-设备关联新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ProductDeviceRelSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "28748")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18574")
|
||||||
|
@NotNull(message = "产品ID不能为空")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "21075")
|
||||||
|
@NotNull(message = "设备ID不能为空")
|
||||||
|
private Long deviceId;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productmoldrel;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import javax.servlet.http.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productmoldrel.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productmoldrel.ProductMoldRelDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.productmoldrel.ProductMoldRelService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 产品-模具关联")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/erp/product-mold-rel")
|
||||||
|
@Validated
|
||||||
|
public class ProductMoldRelController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProductMoldRelService productMoldRelService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建产品-模具关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-mold-rel:create')")
|
||||||
|
public CommonResult<Long> createProductMoldRel(@Valid @RequestBody ProductMoldRelSaveReqVO createReqVO) {
|
||||||
|
return success(productMoldRelService.createProductMoldRel(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新产品-模具关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-mold-rel:update')")
|
||||||
|
public CommonResult<Boolean> updateProductMoldRel(@Valid @RequestBody ProductMoldRelSaveReqVO updateReqVO) {
|
||||||
|
productMoldRelService.updateProductMoldRel(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除产品-模具关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-mold-rel:delete')")
|
||||||
|
public CommonResult<Boolean> deleteProductMoldRel(@RequestParam("id") Long id) {
|
||||||
|
productMoldRelService.deleteProductMoldRel(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得产品-模具关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-mold-rel:query')")
|
||||||
|
public CommonResult<ProductMoldRelRespVO> getProductMoldRel(@RequestParam("id") Long id) {
|
||||||
|
ProductMoldRelDO productMoldRel = productMoldRelService.getProductMoldRel(id);
|
||||||
|
return success(BeanUtils.toBean(productMoldRel, ProductMoldRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得产品-模具关联分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-mold-rel:query')")
|
||||||
|
public CommonResult<PageResult<ProductMoldRelRespVO>> getProductMoldRelPage(@Valid ProductMoldRelPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProductMoldRelDO> pageResult = productMoldRelService.getProductMoldRelPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ProductMoldRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出产品-模具关联 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:product-mold-rel:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportProductMoldRelExcel(@Valid ProductMoldRelPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ProductMoldRelDO> list = productMoldRelService.getProductMoldRelPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "产品-模具关联.xls", "数据", ProductMoldRelRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ProductMoldRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productmoldrel.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 产品-模具关联分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ProductMoldRelPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "产品ID", example = "30420")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "模具ID", example = "243")
|
||||||
|
private Long moldId;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productmoldrel.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 产品-模具关联 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ProductMoldRelRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11772")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30420")
|
||||||
|
@ExcelProperty("产品ID")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "模具ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "243")
|
||||||
|
@ExcelProperty("模具ID")
|
||||||
|
private Long moldId;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
@ExcelProperty("排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.productmoldrel.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 产品-模具关联新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ProductMoldRelSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11772")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "30420")
|
||||||
|
@NotNull(message = "产品ID不能为空")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "模具ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "243")
|
||||||
|
@NotNull(message = "模具ID不能为空")
|
||||||
|
private Long moldId;
|
||||||
|
|
||||||
|
@Schema(description = "排序")
|
||||||
|
private Integer sort;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "随便")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.warehouse.ErpWarehouseRespVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpWarehouseDO;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.warehousearea.WarehouseAreaService;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP 库区信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/erp/warehouse-area")
|
||||||
|
@Validated
|
||||||
|
public class WarehouseAreaController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WarehouseAreaService warehouseAreaService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建ERP 库区信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:create')")
|
||||||
|
public CommonResult<Long> createWarehouseArea(@Valid @RequestBody WarehouseAreaSaveReqVO createReqVO) {
|
||||||
|
return success(warehouseAreaService.createWarehouseArea(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新ERP 库区信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:update')")
|
||||||
|
public CommonResult<Boolean> updateWarehouseArea(@Valid @RequestBody WarehouseAreaSaveReqVO updateReqVO) {
|
||||||
|
warehouseAreaService.updateWarehouseArea(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除ERP 库区信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWarehouseArea(@RequestParam("id") Long id) {
|
||||||
|
warehouseAreaService.deleteWarehouseArea(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得ERP 库区信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:query')")
|
||||||
|
public CommonResult<WarehouseAreaRespVO> getWarehouseArea(@RequestParam("id") Long id) {
|
||||||
|
WarehouseAreaDO warehouseArea = warehouseAreaService.getWarehouseArea(id);
|
||||||
|
return success(BeanUtils.toBean(warehouseArea, WarehouseAreaRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得ERP 库区信息分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:query')")
|
||||||
|
public CommonResult<PageResult<WarehouseAreaRespVO>> getWarehouseAreaPage(@Valid WarehouseAreaPageReqVO pageReqVO) {
|
||||||
|
PageResult<WarehouseAreaDO> pageResult = warehouseAreaService.getWarehouseAreaPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, WarehouseAreaRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/simple-list")
|
||||||
|
@Operation(summary = "获得库区精简列表", description = "只包含被开启的仓库库区,主要用于前端的下拉选项")
|
||||||
|
public CommonResult<List<WarehouseAreaRespVO>> getWarehouseSimpleList(@RequestParam(value = "warehouseId", required = false) Long warehouseId) {
|
||||||
|
List<WarehouseAreaDO> list = warehouseAreaService.getWarehouseListByStatusAndWarehouseId(CommonStatusEnum.ENABLE.getStatus(), warehouseId);
|
||||||
|
return success(convertList(list, area -> new WarehouseAreaRespVO()
|
||||||
|
.setId(area.getId())
|
||||||
|
.setWarehouseId(area.getWarehouseId())
|
||||||
|
.setAreaCode(area.getAreaCode())
|
||||||
|
.setAreaName(area.getAreaName())
|
||||||
|
.setStatus(area.getStatus())));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出ERP 库区信息 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportWarehouseAreaExcel(@Valid WarehouseAreaPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<WarehouseAreaDO> list = warehouseAreaService.getWarehouseAreaPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "ERP 库区信息.xls", "数据", WarehouseAreaRespVO.class,
|
||||||
|
BeanUtils.toBean(list, WarehouseAreaRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 库区信息分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WarehouseAreaPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "所属仓库id", example = "19404")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "库区编码")
|
||||||
|
private String areaCode;
|
||||||
|
|
||||||
|
@Schema(description = "库区名称", example = "赵六")
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
@Schema(description = "面积(平方米)")
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
|
||||||
|
@Schema(description = "库区描述", example = "你说的对")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "开启状态", example = "2")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 库区信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WarehouseAreaRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1157")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "所属仓库id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19404")
|
||||||
|
@ExcelProperty("所属仓库id")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("库区编码")
|
||||||
|
private String areaCode;
|
||||||
|
|
||||||
|
@Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||||
|
@ExcelProperty("库区名称")
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
@Schema(description = "面积(平方米)")
|
||||||
|
@ExcelProperty("面积(平方米)")
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
|
||||||
|
@Schema(description = "库区描述", example = "你说的对")
|
||||||
|
@ExcelProperty("库区描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("开启状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 库区信息新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class WarehouseAreaSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1157")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "所属仓库id", example = "19404")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
// @NotEmpty(message = "库区编码不能为空")
|
||||||
|
private String areaCode;
|
||||||
|
|
||||||
|
@Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "A区")
|
||||||
|
@NotEmpty(message = "库区名称不能为空")
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
@Schema(description = "面积(平方米)")
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
|
||||||
|
@Schema(description = "库区描述", example = "常温区")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotNull(message = "开启状态不能为空")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.service.warehouselocation.WarehouseLocationService;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - ERP 库位信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/erp/warehouse-location")
|
||||||
|
@Validated
|
||||||
|
public class WarehouseLocationController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WarehouseLocationService warehouseLocationService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建ERP 库位信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:create')")
|
||||||
|
public CommonResult<Long> createWarehouseLocation(@Valid @RequestBody WarehouseLocationSaveReqVO createReqVO) {
|
||||||
|
return success(warehouseLocationService.createWarehouseLocation(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新ERP 库位信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:update')")
|
||||||
|
public CommonResult<Boolean> updateWarehouseLocation(@Valid @RequestBody WarehouseLocationSaveReqVO updateReqVO) {
|
||||||
|
warehouseLocationService.updateWarehouseLocation(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除ERP 库位信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:delete')")
|
||||||
|
public CommonResult<Boolean> deleteWarehouseLocation(@RequestParam("id") Long id) {
|
||||||
|
warehouseLocationService.deleteWarehouseLocation(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得ERP 库位信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:query')")
|
||||||
|
public CommonResult<WarehouseLocationRespVO> getWarehouseLocation(@RequestParam("id") Long id) {
|
||||||
|
WarehouseLocationDO warehouseLocation = warehouseLocationService.getWarehouseLocation(id);
|
||||||
|
return success(BeanUtils.toBean(warehouseLocation, WarehouseLocationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得ERP 库位信息分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:query')")
|
||||||
|
public CommonResult<PageResult<WarehouseLocationRespVO>> getWarehouseLocationPage(@Valid WarehouseLocationPageReqVO pageReqVO) {
|
||||||
|
PageResult<WarehouseLocationDO> pageResult = warehouseLocationService.getWarehouseLocationPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, WarehouseLocationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/simple-list")
|
||||||
|
@Operation(summary = "获得ERP 库位信息精简列表", description = "只包含已启用的库位,主要用于前端下拉选项")
|
||||||
|
public CommonResult<List<WarehouseLocationRespVO>> getWarehouseLocationSimpleList() {
|
||||||
|
List<WarehouseLocationDO> list = warehouseLocationService.getWarehouseLocationListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||||
|
return success(convertList(list, item -> new WarehouseLocationRespVO()
|
||||||
|
.setId(item.getId())
|
||||||
|
.setWarehouseId(item.getWarehouseId())
|
||||||
|
.setAreaId(item.getAreaId())
|
||||||
|
.setCode(item.getCode())
|
||||||
|
.setName(item.getName())
|
||||||
|
.setStatus(item.getStatus())));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出ERP 库位信息 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportWarehouseLocationExcel(@Valid WarehouseLocationPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<WarehouseLocationDO> list = warehouseLocationService.getWarehouseLocationPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "ERP 库位信息.xls", "数据", WarehouseLocationRespVO.class,
|
||||||
|
BeanUtils.toBean(list, WarehouseLocationRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 库位信息分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class WarehouseLocationPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "所属仓库ID", example = "19287")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "所属库区ID", example = "513")
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "库位名称", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "面积")
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
|
||||||
|
@Schema(description = "最大载重量")
|
||||||
|
private BigDecimal maxLoadWeight;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置X")
|
||||||
|
private Integer positionX;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置Y")
|
||||||
|
private Integer positionY;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置Z")
|
||||||
|
private Integer positionZ;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许产品混放")
|
||||||
|
private Boolean allowProductMix;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许批次混放")
|
||||||
|
private Boolean allowBatchMix;
|
||||||
|
|
||||||
|
@Schema(description = "开启状态", example = "1")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 库位信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class WarehouseLocationRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7300")
|
||||||
|
@ExcelProperty("id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "所属仓库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19287")
|
||||||
|
@ExcelProperty("所属仓库ID")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "所属库区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "513")
|
||||||
|
@ExcelProperty("所属库区ID")
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("库位编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||||
|
@ExcelProperty("库位名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "面积")
|
||||||
|
@ExcelProperty("面积")
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
|
||||||
|
@Schema(description = "最大载重量")
|
||||||
|
@ExcelProperty("最大载重量")
|
||||||
|
private BigDecimal maxLoadWeight;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置X")
|
||||||
|
@ExcelProperty("库位位置X")
|
||||||
|
private Integer positionX;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置Y")
|
||||||
|
@ExcelProperty("库位位置Y")
|
||||||
|
private Integer positionY;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置Z")
|
||||||
|
@ExcelProperty("库位位置Z")
|
||||||
|
private Integer positionZ;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许产品混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否允许产品混放")
|
||||||
|
private Boolean allowProductMix;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许批次混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否允许批次混放")
|
||||||
|
private Boolean allowBatchMix;
|
||||||
|
|
||||||
|
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@ExcelProperty("开启状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - ERP 库位信息新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class WarehouseLocationSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7300")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "所属仓库ID", example = "19287")
|
||||||
|
private Long warehouseId;
|
||||||
|
|
||||||
|
@Schema(description = "所属库区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "513")
|
||||||
|
@NotNull(message = "所属库区ID不能为空")
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
|
@Schema(description = "库位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
// @NotEmpty(message = "库位编码不能为空")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "A-01-01")
|
||||||
|
@NotEmpty(message = "库位名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "面积")
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
|
||||||
|
@Schema(description = "最大载重量")
|
||||||
|
private BigDecimal maxLoadWeight;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置X")
|
||||||
|
private Integer positionX;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置Y")
|
||||||
|
private Integer positionY;
|
||||||
|
|
||||||
|
@Schema(description = "库位位置Z")
|
||||||
|
private Integer positionZ;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许产品混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "是否允许产品混放不能为空")
|
||||||
|
private Boolean allowProductMix;
|
||||||
|
|
||||||
|
@Schema(description = "是否允许批次混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "是否允许批次混放不能为空")
|
||||||
|
private Boolean allowBatchMix;
|
||||||
|
|
||||||
|
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotNull(message = "开启状态不能为空")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.productdevicerel;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-设备关联 DO
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@TableName("erp_product_device_rel")
|
||||||
|
@KeySequence("erp_product_device_rel_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ProductDeviceRelDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 设备ID
|
||||||
|
*/
|
||||||
|
private Long deviceId;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.productmoldrel;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-模具关联 DO
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@TableName("erp_product_mold_rel")
|
||||||
|
@KeySequence("erp_product_mold_rel_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ProductMoldRelDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 产品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 模具ID
|
||||||
|
*/
|
||||||
|
private Long moldId;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 库区信息 DO
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@TableName("erp_warehouse_area")
|
||||||
|
@KeySequence("erp_warehouse_area_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WarehouseAreaDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 所属仓库id
|
||||||
|
*/
|
||||||
|
private Long warehouseId;
|
||||||
|
/**
|
||||||
|
* 库区编码
|
||||||
|
*/
|
||||||
|
private String areaCode;
|
||||||
|
/**
|
||||||
|
* 库区名称
|
||||||
|
*/
|
||||||
|
private String areaName;
|
||||||
|
/**
|
||||||
|
* 面积(平方米)
|
||||||
|
*/
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
/**
|
||||||
|
* 库区描述
|
||||||
|
*/
|
||||||
|
private String description;
|
||||||
|
/**
|
||||||
|
* 开启状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,81 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 库位信息 DO
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@TableName("erp_warehouse_location")
|
||||||
|
@KeySequence("erp_warehouse_location_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class WarehouseLocationDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 所属仓库ID
|
||||||
|
*/
|
||||||
|
private Long warehouseId;
|
||||||
|
/**
|
||||||
|
* 所属库区ID
|
||||||
|
*/
|
||||||
|
private Long areaId;
|
||||||
|
/**
|
||||||
|
* 库位编码
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 库位名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 面积
|
||||||
|
*/
|
||||||
|
private BigDecimal areaSize;
|
||||||
|
/**
|
||||||
|
* 最大载重量
|
||||||
|
*/
|
||||||
|
private BigDecimal maxLoadWeight;
|
||||||
|
/**
|
||||||
|
* 库位位置X
|
||||||
|
*/
|
||||||
|
private Integer positionX;
|
||||||
|
/**
|
||||||
|
* 库位位置Y
|
||||||
|
*/
|
||||||
|
private Integer positionY;
|
||||||
|
/**
|
||||||
|
* 库位位置Z
|
||||||
|
*/
|
||||||
|
private Integer positionZ;
|
||||||
|
/**
|
||||||
|
* 是否允许产品混放
|
||||||
|
*/
|
||||||
|
private Boolean allowProductMix;
|
||||||
|
/**
|
||||||
|
* 是否允许批次混放
|
||||||
|
*/
|
||||||
|
private Boolean allowBatchMix;
|
||||||
|
/**
|
||||||
|
* 开启状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.productdevicerel;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productdevicerel.ProductDeviceRelDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productdevicerel.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-设备关联 Mapper
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ProductDeviceRelMapper extends BaseMapperX<ProductDeviceRelDO> {
|
||||||
|
|
||||||
|
default PageResult<ProductDeviceRelDO> selectPage(ProductDeviceRelPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ProductDeviceRelDO>()
|
||||||
|
.eqIfPresent(ProductDeviceRelDO::getProductId, reqVO.getProductId())
|
||||||
|
.eqIfPresent(ProductDeviceRelDO::getDeviceId, reqVO.getDeviceId())
|
||||||
|
.eqIfPresent(ProductDeviceRelDO::getSort, reqVO.getSort())
|
||||||
|
.eqIfPresent(ProductDeviceRelDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(ProductDeviceRelDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(ProductDeviceRelDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.productmoldrel;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productmoldrel.ProductMoldRelDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productmoldrel.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-模具关联 Mapper
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ProductMoldRelMapper extends BaseMapperX<ProductMoldRelDO> {
|
||||||
|
|
||||||
|
default PageResult<ProductMoldRelDO> selectPage(ProductMoldRelPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ProductMoldRelDO>()
|
||||||
|
.eqIfPresent(ProductMoldRelDO::getProductId, reqVO.getProductId())
|
||||||
|
.eqIfPresent(ProductMoldRelDO::getMoldId, reqVO.getMoldId())
|
||||||
|
.eqIfPresent(ProductMoldRelDO::getSort, reqVO.getSort())
|
||||||
|
.eqIfPresent(ProductMoldRelDO::getRemark, reqVO.getRemark())
|
||||||
|
.betweenIfPresent(ProductMoldRelDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(ProductMoldRelDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,53 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.warehousearea;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 库区信息 Mapper
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface WarehouseAreaMapper extends BaseMapperX<WarehouseAreaDO> {
|
||||||
|
|
||||||
|
default PageResult<WarehouseAreaDO> selectPage(WarehouseAreaPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseAreaDO>()
|
||||||
|
.eqIfPresent(WarehouseAreaDO::getWarehouseId, reqVO.getWarehouseId())
|
||||||
|
.eqIfPresent(WarehouseAreaDO::getAreaCode, reqVO.getAreaCode())
|
||||||
|
.likeIfPresent(WarehouseAreaDO::getAreaName, reqVO.getAreaName())
|
||||||
|
.eqIfPresent(WarehouseAreaDO::getAreaSize, reqVO.getAreaSize())
|
||||||
|
.eqIfPresent(WarehouseAreaDO::getDescription, reqVO.getDescription())
|
||||||
|
.eqIfPresent(WarehouseAreaDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(WarehouseAreaDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(WarehouseAreaDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
default WarehouseAreaDO selectByNo(String no) {
|
||||||
|
return selectOne(WarehouseAreaDO::getAreaCode, no);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<WarehouseAreaDO> selectListByStatus(Integer status) {
|
||||||
|
return selectList(WarehouseAreaDO::getStatus, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<WarehouseAreaDO> selectListByWarehouseId(Long warehouseId) {
|
||||||
|
return selectList(WarehouseAreaDO::getWarehouseId, warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void deleteByWarehouseId(Long warehouseId) {
|
||||||
|
delete(WarehouseAreaDO::getWarehouseId, warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
default Long selectCountByWarehouseId(Long warehouseId) {
|
||||||
|
return selectCount(WarehouseAreaDO::getWarehouseId, warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.dal.mysql.warehouselocation;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 库位信息 Mapper
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface WarehouseLocationMapper extends BaseMapperX<WarehouseLocationDO> {
|
||||||
|
|
||||||
|
default PageResult<WarehouseLocationDO> selectPage(WarehouseLocationPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseLocationDO>()
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getWarehouseId, reqVO.getWarehouseId())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getAreaId, reqVO.getAreaId())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getCode, reqVO.getCode())
|
||||||
|
.likeIfPresent(WarehouseLocationDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getAreaSize, reqVO.getAreaSize())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getMaxLoadWeight, reqVO.getMaxLoadWeight())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getPositionX, reqVO.getPositionX())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getPositionY, reqVO.getPositionY())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getPositionZ, reqVO.getPositionZ())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getAllowProductMix, reqVO.getAllowProductMix())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getAllowBatchMix, reqVO.getAllowBatchMix())
|
||||||
|
.eqIfPresent(WarehouseLocationDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(WarehouseLocationDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(WarehouseLocationDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
default WarehouseLocationDO selectByNo(String no) {
|
||||||
|
return selectOne(WarehouseLocationDO::getCode, no);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<WarehouseLocationDO> selectListByWarehouseId(Long warehouseId) {
|
||||||
|
return selectList(WarehouseLocationDO::getWarehouseId, warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
default void deleteByWarehouseId(Long warehouseId) {
|
||||||
|
delete(WarehouseLocationDO::getWarehouseId, warehouseId);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<WarehouseLocationDO> selectListByStatus(Integer status) {
|
||||||
|
return selectList(WarehouseLocationDO::getStatus, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
default List<WarehouseLocationDO> selectListByAreaId(Long areaId) {
|
||||||
|
return selectList(WarehouseLocationDO::getAreaId, areaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
default Long selectCountByWarehouseId(Long warehouseId) {
|
||||||
|
return selectCount(WarehouseLocationDO::getWarehouseId, warehouseId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.handler;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.common.dal.mysql.mold.MoldMapper;
|
||||||
|
import cn.iocoder.yudao.module.common.enums.QrcodeBizTypeEnum;
|
||||||
|
import cn.iocoder.yudao.module.common.handler.QrcodeBizHandler;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.product.ErpProductMapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class ProductQrcodeBizHandler implements QrcodeBizHandler {
|
||||||
|
@Resource
|
||||||
|
private ErpProductMapper productMapper;
|
||||||
|
|
||||||
|
public String getBizType() {
|
||||||
|
return QrcodeBizTypeEnum.PRODUCT.getCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean exists(Long id) { return productMapper.selectById(id) != null; }
|
||||||
|
|
||||||
|
public String buildDeepLink(Long id) {
|
||||||
|
// return "besure://mold/detail?id=" + id;
|
||||||
|
//TODO 替换成app连接
|
||||||
|
return "https://www.baidu.com";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String buildH5Path(Long id) {
|
||||||
|
// return "/h5/mold/view?id=" + id;
|
||||||
|
//TODO 替换成app连接不存在页面
|
||||||
|
return "https://baike.baidu.com/item/%E6%98%9F%E5%BA%A7/8072715?fr=aladdin";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.productdevicerel;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productdevicerel.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productdevicerel.ProductDeviceRelDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-设备关联 Service 接口
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
public interface ProductDeviceRelService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建产品-设备关联
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createProductDeviceRel(@Valid ProductDeviceRelSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新产品-设备关联
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateProductDeviceRel(@Valid ProductDeviceRelSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除产品-设备关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteProductDeviceRel(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得产品-设备关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 产品-设备关联
|
||||||
|
*/
|
||||||
|
ProductDeviceRelDO getProductDeviceRel(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得产品-设备关联分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 产品-设备关联分页
|
||||||
|
*/
|
||||||
|
PageResult<ProductDeviceRelDO> getProductDeviceRelPage(ProductDeviceRelPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.productdevicerel;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productdevicerel.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productdevicerel.ProductDeviceRelDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.productdevicerel.ProductDeviceRelMapper;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-设备关联 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ProductDeviceRelServiceImpl implements ProductDeviceRelService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProductDeviceRelMapper productDeviceRelMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createProductDeviceRel(ProductDeviceRelSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ProductDeviceRelDO productDeviceRel = BeanUtils.toBean(createReqVO, ProductDeviceRelDO.class);
|
||||||
|
productDeviceRelMapper.insert(productDeviceRel);
|
||||||
|
// 返回
|
||||||
|
return productDeviceRel.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProductDeviceRel(ProductDeviceRelSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateProductDeviceRelExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ProductDeviceRelDO updateObj = BeanUtils.toBean(updateReqVO, ProductDeviceRelDO.class);
|
||||||
|
productDeviceRelMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProductDeviceRel(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateProductDeviceRelExists(id);
|
||||||
|
// 删除
|
||||||
|
productDeviceRelMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateProductDeviceRelExists(Long id) {
|
||||||
|
if (productDeviceRelMapper.selectById(id) == null) {
|
||||||
|
throw exception(PRODUCT_DEVICE_REL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductDeviceRelDO getProductDeviceRel(Long id) {
|
||||||
|
return productDeviceRelMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProductDeviceRelDO> getProductDeviceRelPage(ProductDeviceRelPageReqVO pageReqVO) {
|
||||||
|
return productDeviceRelMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,55 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.productmoldrel;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productmoldrel.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productmoldrel.ProductMoldRelDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-模具关联 Service 接口
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
public interface ProductMoldRelService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建产品-模具关联
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createProductMoldRel(@Valid ProductMoldRelSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新产品-模具关联
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateProductMoldRel(@Valid ProductMoldRelSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除产品-模具关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteProductMoldRel(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得产品-模具关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 产品-模具关联
|
||||||
|
*/
|
||||||
|
ProductMoldRelDO getProductMoldRel(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得产品-模具关联分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 产品-模具关联分页
|
||||||
|
*/
|
||||||
|
PageResult<ProductMoldRelDO> getProductMoldRelPage(ProductMoldRelPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.productmoldrel;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.productmoldrel.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.productmoldrel.ProductMoldRelDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.productmoldrel.ProductMoldRelMapper;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品-模具关联 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ProductMoldRelServiceImpl implements ProductMoldRelService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProductMoldRelMapper productMoldRelMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createProductMoldRel(ProductMoldRelSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ProductMoldRelDO productMoldRel = BeanUtils.toBean(createReqVO, ProductMoldRelDO.class);
|
||||||
|
productMoldRelMapper.insert(productMoldRel);
|
||||||
|
// 返回
|
||||||
|
return productMoldRel.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProductMoldRel(ProductMoldRelSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateProductMoldRelExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ProductMoldRelDO updateObj = BeanUtils.toBean(updateReqVO, ProductMoldRelDO.class);
|
||||||
|
productMoldRelMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProductMoldRel(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateProductMoldRelExists(id);
|
||||||
|
// 删除
|
||||||
|
productMoldRelMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateProductMoldRelExists(Long id) {
|
||||||
|
if (productMoldRelMapper.selectById(id) == null) {
|
||||||
|
throw exception(PRODUCT_MOLD_REL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductMoldRelDO getProductMoldRel(Long id) {
|
||||||
|
return productMoldRelMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProductMoldRelDO> getProductMoldRelPage(ProductMoldRelPageReqVO pageReqVO) {
|
||||||
|
return productMoldRelMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.warehousearea;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 库区信息 Service 接口
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
public interface WarehouseAreaService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建ERP 库区信息
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createWarehouseArea(@Valid WarehouseAreaSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新ERP 库区信息
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateWarehouseArea(@Valid WarehouseAreaSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除ERP 库区信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteWarehouseArea(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP 库区信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return ERP 库区信息
|
||||||
|
*/
|
||||||
|
WarehouseAreaDO getWarehouseArea(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP 库区信息分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return ERP 库区信息分页
|
||||||
|
*/
|
||||||
|
PageResult<WarehouseAreaDO> getWarehouseAreaPage(WarehouseAreaPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
List<WarehouseAreaDO> getWarehouseListByStatus(Integer status);
|
||||||
|
|
||||||
|
List<WarehouseAreaDO> getWarehouseListByStatusAndWarehouseId(Integer status, Long warehouseId);
|
||||||
|
}
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.warehousearea;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.autocode.util.AutoCodeUtil;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.WarehouseAreaPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.WarehouseAreaSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.warehousearea.WarehouseAreaMapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.warehouselocation.WarehouseLocationMapper;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_CODE_EXISTS;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_DELETE_FAIL_EXISTS_LOCATION;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_NOT_EXISTS;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class WarehouseAreaServiceImpl implements WarehouseAreaService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WarehouseAreaMapper warehouseAreaMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WarehouseLocationMapper warehouseLocationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AutoCodeUtil autoCodeUtil;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createWarehouseArea(WarehouseAreaSaveReqVO createReqVO) {
|
||||||
|
WarehouseAreaDO warehouseArea = BeanUtils.toBean(createReqVO, WarehouseAreaDO.class);
|
||||||
|
if (StringUtils.isEmpty(warehouseArea.getAreaCode())) {
|
||||||
|
warehouseArea.setAreaCode(autoCodeUtil.genSerialCode("RESERVOIR_AREA_GENERATE", null));
|
||||||
|
} else if (warehouseAreaMapper.selectByNo(warehouseArea.getAreaCode()) != null) {
|
||||||
|
throw exception(WAREHOUSE_AREA_CODE_EXISTS);
|
||||||
|
}
|
||||||
|
warehouseAreaMapper.insert(warehouseArea);
|
||||||
|
return warehouseArea.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWarehouseArea(WarehouseAreaSaveReqVO updateReqVO) {
|
||||||
|
validateWarehouseAreaExists(updateReqVO.getId());
|
||||||
|
warehouseAreaMapper.updateById(BeanUtils.toBean(updateReqVO, WarehouseAreaDO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteWarehouseArea(Long id) {
|
||||||
|
validateWarehouseAreaExists(id);
|
||||||
|
if (!warehouseLocationMapper.selectListByAreaId(id).isEmpty()) {
|
||||||
|
throw exception(WAREHOUSE_AREA_DELETE_FAIL_EXISTS_LOCATION);
|
||||||
|
}
|
||||||
|
warehouseAreaMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateWarehouseAreaExists(Long id) {
|
||||||
|
if (warehouseAreaMapper.selectById(id) == null) {
|
||||||
|
throw exception(WAREHOUSE_AREA_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WarehouseAreaDO getWarehouseArea(Long id) {
|
||||||
|
return warehouseAreaMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<WarehouseAreaDO> getWarehouseAreaPage(WarehouseAreaPageReqVO pageReqVO) {
|
||||||
|
return warehouseAreaMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WarehouseAreaDO> getWarehouseListByStatus(Integer status) {
|
||||||
|
return warehouseAreaMapper.selectListByStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WarehouseAreaDO> getWarehouseListByStatusAndWarehouseId(Integer status, Long warehouseId) {
|
||||||
|
List<WarehouseAreaDO> list = warehouseAreaMapper.selectListByStatus(status);
|
||||||
|
if (warehouseId == null) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
List<WarehouseAreaDO> result = new ArrayList<>();
|
||||||
|
for (WarehouseAreaDO item : list) {
|
||||||
|
if (warehouseId.equals(item.getWarehouseId())) {
|
||||||
|
result.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.warehouselocation;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP 库位信息 Service 接口
|
||||||
|
*
|
||||||
|
* @author 必硕智能
|
||||||
|
*/
|
||||||
|
public interface WarehouseLocationService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建ERP 库位信息
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createWarehouseLocation(@Valid WarehouseLocationSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新ERP 库位信息
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateWarehouseLocation(@Valid WarehouseLocationSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除ERP 库位信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteWarehouseLocation(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP 库位信息
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return ERP 库位信息
|
||||||
|
*/
|
||||||
|
WarehouseLocationDO getWarehouseLocation(Long id);
|
||||||
|
|
||||||
|
List<WarehouseLocationDO> getWarehouseLocationListByStatus(Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得ERP 库位信息分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return ERP 库位信息分页
|
||||||
|
*/
|
||||||
|
PageResult<WarehouseLocationDO> getWarehouseLocationPage(WarehouseLocationPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,95 @@
|
|||||||
|
package cn.iocoder.yudao.module.erp.service.warehouselocation;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.autocode.util.AutoCodeUtil;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.WarehouseLocationPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.WarehouseLocationSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.warehousearea.WarehouseAreaMapper;
|
||||||
|
import cn.iocoder.yudao.module.erp.dal.mysql.warehouselocation.WarehouseLocationMapper;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_NOT_EXISTS;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_LOCATION_CODE_EXISTS;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_LOCATION_NOT_EXISTS;
|
||||||
|
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_LOCATION_WAREHOUSE_AREA_NOT_MATCH;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class WarehouseLocationServiceImpl implements WarehouseLocationService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WarehouseLocationMapper warehouseLocationMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WarehouseAreaMapper warehouseAreaMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AutoCodeUtil autoCodeUtil;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createWarehouseLocation(WarehouseLocationSaveReqVO createReqVO) {
|
||||||
|
validateWarehouseAreaMatch(createReqVO.getWarehouseId(), createReqVO.getAreaId());
|
||||||
|
WarehouseLocationDO warehouseLocation = BeanUtils.toBean(createReqVO, WarehouseLocationDO.class);
|
||||||
|
if (StringUtils.isEmpty(warehouseLocation.getCode())) {
|
||||||
|
warehouseLocation.setCode(autoCodeUtil.genSerialCode("RESERVOIR_AREA_GENERATE", null));
|
||||||
|
} else if (warehouseLocationMapper.selectByNo(warehouseLocation.getCode()) != null) {
|
||||||
|
throw exception(WAREHOUSE_LOCATION_CODE_EXISTS);
|
||||||
|
}
|
||||||
|
warehouseLocationMapper.insert(warehouseLocation);
|
||||||
|
return warehouseLocation.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateWarehouseLocation(WarehouseLocationSaveReqVO updateReqVO) {
|
||||||
|
validateWarehouseLocationExists(updateReqVO.getId());
|
||||||
|
validateWarehouseAreaMatch(updateReqVO.getWarehouseId(), updateReqVO.getAreaId());
|
||||||
|
warehouseLocationMapper.updateById(BeanUtils.toBean(updateReqVO, WarehouseLocationDO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteWarehouseLocation(Long id) {
|
||||||
|
validateWarehouseLocationExists(id);
|
||||||
|
warehouseLocationMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateWarehouseLocationExists(Long id) {
|
||||||
|
if (warehouseLocationMapper.selectById(id) == null) {
|
||||||
|
throw exception(WAREHOUSE_LOCATION_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateWarehouseAreaMatch(Long warehouseId, Long areaId) {
|
||||||
|
WarehouseAreaDO area = warehouseAreaMapper.selectById(areaId);
|
||||||
|
if (area == null) {
|
||||||
|
throw exception(WAREHOUSE_AREA_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
if (warehouseId == null || !warehouseId.equals(area.getWarehouseId())) {
|
||||||
|
throw exception(WAREHOUSE_LOCATION_WAREHOUSE_AREA_NOT_MATCH);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WarehouseLocationDO getWarehouseLocation(Long id) {
|
||||||
|
return warehouseLocationMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<WarehouseLocationDO> getWarehouseLocationListByStatus(Integer status) {
|
||||||
|
return warehouseLocationMapper.selectListByStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<WarehouseLocationDO> getWarehouseLocationPage(WarehouseLocationPageReqVO pageReqVO) {
|
||||||
|
return warehouseLocationMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue