Compare commits
No commits in common. 'main' and 'liutao_branch' have entirely different histories.
main
...
liutao_bra
@ -1,122 +0,0 @@
|
|||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.common.enums;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum MoldBrandStatusEnum implements IntArrayValuable {
|
|
||||||
|
|
||||||
ON_MACHINE(0, "在机"),
|
|
||||||
STANDBY(1, "待用"),
|
|
||||||
REPAIRING(2, "维修"),
|
|
||||||
SCRAPPED(3, "报废"),
|
|
||||||
IN_STOCK(4, "在库");
|
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(MoldBrandStatusEnum::getStatus).toArray();
|
|
||||||
|
|
||||||
private final Integer status;
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.common.enums;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Getter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@AllArgsConstructor
|
|
||||||
public enum QrcodeBizTypeEnum {
|
|
||||||
|
|
||||||
PRODUCT("PRODUCTMATERIAL", "产品物料"),
|
|
||||||
EQUIPMENT("EQUIPMENT", "设备"),
|
|
||||||
DEVICE_LINE("DEVICE_LINE", "设备产线"),
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.common.handler;
|
|
||||||
|
|
||||||
|
|
||||||
public interface QrcodeBizHandler {
|
|
||||||
String getBizType();
|
|
||||||
boolean exists(Long id);
|
|
||||||
String buildDeepLink(Long id);
|
|
||||||
String buildH5Path(Long id);
|
|
||||||
}
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
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.util.Collection;
|
|
||||||
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<Long, String> selectQrcodeUrlMapByBizTypeAndIds(String bizType, Collection<Long> bizIds);
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.enums;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum ErpStockInStatusEnum implements IntArrayValuable {
|
|
||||||
|
|
||||||
WAIT_IN(0, "待入库"),
|
|
||||||
IN_STOCK(20, "已入库");
|
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpStockInStatusEnum::getStatus).toArray();
|
|
||||||
|
|
||||||
private final Integer status;
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,25 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.enums;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum ErpStockOutStatusEnum implements IntArrayValuable {
|
|
||||||
|
|
||||||
WAIT_OUT(0, "待出库"),
|
|
||||||
OUT_STOCK(20, "已出库");
|
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpStockOutStatusEnum::getStatus).toArray();
|
|
||||||
|
|
||||||
private final Integer status;
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,38 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.enums;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.core.IntArrayValuable;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum ErpStockOutUsageTypeEnum implements IntArrayValuable {
|
|
||||||
|
|
||||||
REPAIR_RECEIVE(1, "维修领用"),
|
|
||||||
MAINTENANCE_RECEIVE(2, "保养领用"),
|
|
||||||
OTHER_OUT(3, "其他出库");
|
|
||||||
|
|
||||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ErpStockOutUsageTypeEnum::getType).toArray();
|
|
||||||
|
|
||||||
private final Integer type;
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int[] array() {
|
|
||||||
return ARRAYS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getNameByType(Integer type) {
|
|
||||||
if (type == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
for (ErpStockOutUsageTypeEnum value : values()) {
|
|
||||||
if (value.getType().equals(type)) {
|
|
||||||
return value.getName();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.enums.stock;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum ErpStockCheckApproveActionEnum {
|
|
||||||
|
|
||||||
SUBMIT("SUBMIT"),
|
|
||||||
APPROVE("APPROVE"),
|
|
||||||
REJECT("REJECT");
|
|
||||||
|
|
||||||
private final String actionType;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.enums.stock;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum ErpStockInApproveActionEnum {
|
|
||||||
|
|
||||||
SUBMIT("SUBMIT"),
|
|
||||||
APPROVE("APPROVE"),
|
|
||||||
REJECT("REJECT"),
|
|
||||||
AUTO_APPROVE("AUTO_APPROVE");
|
|
||||||
|
|
||||||
private final String actionType;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.enums.stock;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@Getter
|
|
||||||
public enum ErpStockOutApproveActionEnum {
|
|
||||||
|
|
||||||
SUBMIT("SUBMIT"),
|
|
||||||
APPROVE("APPROVE"),
|
|
||||||
REJECT("REJECT"),
|
|
||||||
AUTO_APPROVE("AUTO_APPROVE");
|
|
||||||
|
|
||||||
private final String actionType;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,40 +0,0 @@
|
|||||||
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 "未知";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,106 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.mold;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
||||||
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldPressureNetRecordPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldPressureNetRecordRespVO;
|
|
||||||
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldPressureNetRecordSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldPressureNetRecordDO;
|
|
||||||
import cn.iocoder.yudao.module.erp.service.mold.MoldPressureNetRecordService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 子模具压网记录")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/erp/mold-pressure-net-record")
|
|
||||||
@Validated
|
|
||||||
public class MoldPressureNetRecordController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private MoldPressureNetRecordService moldPressureNetRecordService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建子模具压网记录")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:create')")
|
|
||||||
public CommonResult<Long> createMoldPressureNetRecord(@Valid @RequestBody MoldPressureNetRecordSaveReqVO createReqVO) {
|
|
||||||
return success(moldPressureNetRecordService.createMoldPressureNetRecord(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/batch-create")
|
|
||||||
@Operation(summary = "批量创建子模具压网记录")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:create')")
|
|
||||||
public CommonResult<Boolean> createMoldPressureNetRecordBatch(@Valid @RequestBody List<MoldPressureNetRecordSaveReqVO> createReqVOList) {
|
|
||||||
moldPressureNetRecordService.createBatchMoldPressureNetRecord(createReqVOList);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新子模具压网记录")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:update')")
|
|
||||||
public CommonResult<Boolean> updateMoldPressureNetRecord(@Valid @RequestBody MoldPressureNetRecordSaveReqVO updateReqVO) {
|
|
||||||
moldPressureNetRecordService.updateMoldPressureNetRecord(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除子模具压网记录")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:delete')")
|
|
||||||
public CommonResult<Boolean> deleteMoldPressureNetRecord(@RequestParam("id") Long id) {
|
|
||||||
moldPressureNetRecordService.deleteMoldPressureNetRecord(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得子模具压网记录")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
|
||||||
public CommonResult<MoldPressureNetRecordRespVO> getMoldPressureNetRecord(@RequestParam("id") Long id) {
|
|
||||||
MoldPressureNetRecordDO record = moldPressureNetRecordService.getMoldPressureNetRecord(id);
|
|
||||||
return success(BeanUtils.toBean(record, MoldPressureNetRecordRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得子模具压网记录分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
|
||||||
public CommonResult<PageResult<MoldPressureNetRecordRespVO>> getMoldPressureNetRecordPage(@Valid MoldPressureNetRecordPageReqVO pageReqVO) {
|
|
||||||
PageResult<MoldPressureNetRecordDO> pageResult = moldPressureNetRecordService.getMoldPressureNetRecordPage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, MoldPressureNetRecordRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
|
||||||
@Operation(summary = "导出子模具压网记录 Excel")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
|
||||||
public void exportMoldPressureNetRecordExcel(@Valid MoldPressureNetRecordPageReqVO pageReqVO,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
||||||
List<MoldPressureNetRecordDO> list = moldPressureNetRecordService.getMoldPressureNetRecordPage(pageReqVO).getList();
|
|
||||||
ExcelUtils.write(response, "子模具压网记录.xls", "数据", MoldPressureNetRecordRespVO.class,
|
|
||||||
BeanUtils.toBean(list, MoldPressureNetRecordRespVO.class));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.mold.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 模具型号分页 Response VO")
|
|
||||||
@Data
|
|
||||||
public class MoldBrandPageRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "分页结果", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
private PageResult<MoldBrandRespVO> pageResult;
|
|
||||||
|
|
||||||
@Schema(description = "全部数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
private Long allCount;
|
|
||||||
|
|
||||||
@Schema(description = "在机数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Long onMachineCount;
|
|
||||||
|
|
||||||
@Schema(description = "待用数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
|
|
||||||
private Long standbyCount;
|
|
||||||
|
|
||||||
@Schema(description = "在库数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "8")
|
|
||||||
private Long inStockCount;
|
|
||||||
|
|
||||||
@Schema(description = "维修数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
|
|
||||||
private Long repairingCount;
|
|
||||||
|
|
||||||
@Schema(description = "报废数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
|
||||||
private Long scrappedCount;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.mold.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 模具型号状态统计 Response VO")
|
|
||||||
@Data
|
|
||||||
public class MoldBrandStatusStatisticsRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "全部数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
private Long allCount;
|
|
||||||
|
|
||||||
@Schema(description = "在机数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
|
||||||
private Long onMachineCount;
|
|
||||||
|
|
||||||
@Schema(description = "待用数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
|
|
||||||
private Long standbyCount;
|
|
||||||
|
|
||||||
@Schema(description = "在库数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "8")
|
|
||||||
private Long inStockCount;
|
|
||||||
|
|
||||||
@Schema(description = "维修数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "5")
|
|
||||||
private Long repairingCount;
|
|
||||||
|
|
||||||
@Schema(description = "报废数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
|
||||||
private Long scrappedCount;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,42 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.mold.vo;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
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 MoldPressureNetRecordPageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "模具组ID", example = "1")
|
|
||||||
private Long moldBrandId;
|
|
||||||
|
|
||||||
@Schema(description = "模具组名称", example = "A组")
|
|
||||||
private String moldBrandName;
|
|
||||||
|
|
||||||
@Schema(description = "子模具ID", example = "1")
|
|
||||||
private Long moldId;
|
|
||||||
|
|
||||||
@Schema(description = "子模具名称", example = "子模具A")
|
|
||||||
private String moldName;
|
|
||||||
|
|
||||||
@Schema(description = "压网时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] pressureNetTime;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
}
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.mold.vo;
|
|
||||||
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
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 = "管理后台 - 子模具压网记录 Response VO")
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class MoldPressureNetRecordRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "ID", example = "1")
|
|
||||||
@ExcelProperty("ID")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "模具组ID", example = "1")
|
|
||||||
@ExcelProperty("模具组ID")
|
|
||||||
private Long moldBrandId;
|
|
||||||
|
|
||||||
@Schema(description = "模具组名称", example = "A组")
|
|
||||||
@ExcelProperty("模具组名称")
|
|
||||||
private String moldBrandName;
|
|
||||||
|
|
||||||
@Schema(description = "子模具ID", example = "1")
|
|
||||||
@ExcelProperty("子模具ID")
|
|
||||||
private Long moldId;
|
|
||||||
|
|
||||||
@Schema(description = "子模具名称", example = "子模具A")
|
|
||||||
@ExcelProperty("子模具名称")
|
|
||||||
private String moldName;
|
|
||||||
|
|
||||||
@Schema(description = "压网时间")
|
|
||||||
@ExcelProperty("压网时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime pressureNetTime;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "备注")
|
|
||||||
@ExcelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.mold.vo;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 子模具压网记录新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class MoldPressureNetRecordSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "ID", example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "模具组ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "模具组ID不能为空")
|
|
||||||
private Long moldBrandId;
|
|
||||||
|
|
||||||
@Schema(description = "模具组名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "A组")
|
|
||||||
private String moldBrandName;
|
|
||||||
|
|
||||||
@Schema(description = "子模具ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "子模具ID不能为空")
|
|
||||||
private Long moldId;
|
|
||||||
|
|
||||||
@Schema(description = "子模具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "子模具A")
|
|
||||||
private String moldName;
|
|
||||||
|
|
||||||
@Schema(description = "压网时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@NotNull(message = "压网时间不能为空")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
|
||||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
|
||||||
private LocalDateTime pressureNetTime;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "备注")
|
|
||||||
private String remark;
|
|
||||||
}
|
|
||||||
@ -1,108 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
||||||
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.packagingscheme.ErpPackagingSchemePageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.packagingscheme.ErpPackagingSchemeRespVO;
|
|
||||||
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.packagingscheme.ErpPackagingSchemeSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpPackagingSchemeDO;
|
|
||||||
import cn.iocoder.yudao.module.erp.service.product.ErpPackagingSchemeService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
|
||||||
|
|
||||||
@Tag(name = "管理后台 - ERP 包装方案")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/erp/packaging-scheme")
|
|
||||||
@Validated
|
|
||||||
public class ErpPackagingSchemeController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ErpPackagingSchemeService packagingSchemeService;
|
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建包装方案")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:packaging-scheme:create')")
|
|
||||||
public CommonResult<Long> createPackagingScheme(@Valid @RequestBody ErpPackagingSchemeSaveReqVO createReqVO) {
|
|
||||||
return success(packagingSchemeService.createPackagingScheme(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新包装方案")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:packaging-scheme:update')")
|
|
||||||
public CommonResult<Boolean> updatePackagingScheme(@Valid @RequestBody ErpPackagingSchemeSaveReqVO updateReqVO) {
|
|
||||||
packagingSchemeService.updatePackagingScheme(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除包装方案")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:packaging-scheme:delete')")
|
|
||||||
public CommonResult<Boolean> deletePackagingScheme(@RequestParam("id") Long id) {
|
|
||||||
packagingSchemeService.deletePackagingScheme(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/get")
|
|
||||||
@Operation(summary = "获得包装方案")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:packaging-scheme:query')")
|
|
||||||
public CommonResult<ErpPackagingSchemeRespVO> getPackagingScheme(@RequestParam("id") Long id) {
|
|
||||||
ErpPackagingSchemeDO scheme = packagingSchemeService.getPackagingScheme(id);
|
|
||||||
return success(BeanUtils.toBean(scheme, ErpPackagingSchemeRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得包装方案分页")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:packaging-scheme:query')")
|
|
||||||
public CommonResult<PageResult<ErpPackagingSchemeRespVO>> getPackagingSchemePage(@Valid ErpPackagingSchemePageReqVO pageReqVO) {
|
|
||||||
PageResult<ErpPackagingSchemeDO> pageResult = packagingSchemeService.getPackagingSchemePage(pageReqVO);
|
|
||||||
return success(BeanUtils.toBean(pageResult, ErpPackagingSchemeRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/simple-list")
|
|
||||||
@Operation(summary = "获得包装方案精简列表", description = "只包含已启用的包装方案")
|
|
||||||
public CommonResult<List<ErpPackagingSchemeRespVO>> getPackagingSchemeSimpleList() {
|
|
||||||
List<ErpPackagingSchemeDO> list = packagingSchemeService.getPackagingSchemeListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
|
||||||
return success(convertList(list, item -> BeanUtils.toBean(item, ErpPackagingSchemeRespVO.class)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
|
||||||
@Operation(summary = "导出包装方案 Excel")
|
|
||||||
@PreAuthorize("@ss.hasPermission('erp:packaging-scheme:export')")
|
|
||||||
@ApiAccessLog(operateType = EXPORT)
|
|
||||||
public void exportPackagingSchemeExcel(@Valid ErpPackagingSchemePageReqVO pageReqVO,
|
|
||||||
HttpServletResponse response) throws IOException {
|
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
|
||||||
List<ErpPackagingSchemeDO> list = packagingSchemeService.getPackagingSchemePage(pageReqVO).getList();
|
|
||||||
ExcelUtils.write(response, "包装方案.xls", "数据", ErpPackagingSchemeRespVO.class,
|
|
||||||
BeanUtils.toBean(list, ErpPackagingSchemeRespVO.class));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.category;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - ERP 产品分类树状 Response VO")
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ErpProductCategoryTreeRespVO extends ErpProductCategoryRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "子分类列表")
|
|
||||||
private List<ErpProductCategoryTreeRespVO> children;
|
|
||||||
|
|
||||||
@Schema(description = "是否叶子节点", example = "true")
|
|
||||||
private Boolean leaf = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.category;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - ERP 产品分类按类型分组 Response VO")
|
|
||||||
@Data
|
|
||||||
public class ErpProductCategoryTypeGroupRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "分类类型", example = "1")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "该类型下的树状分类列表")
|
|
||||||
private List<ErpProductCategoryTreeRespVO> children;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.packagingscheme;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
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 ErpPackagingSchemePageReqVO extends PageParam {
|
|
||||||
|
|
||||||
@Schema(description = "方案编码", example = "BZFA202501010001")
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
@Schema(description = "方案名称", example = "标准包装方案")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "状态", example = "0")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
|
||||||
private LocalDateTime[] createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.packagingscheme;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
|
||||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
|
||||||
import cn.iocoder.yudao.module.system.enums.DictTypeConstants;
|
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - ERP 包装方案 Response VO")
|
|
||||||
@Data
|
|
||||||
@ExcelIgnoreUnannotated
|
|
||||||
public class ErpPackagingSchemeRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "包装方案编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@ExcelProperty("编号")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "方案编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "BZFA202501010001")
|
|
||||||
@ExcelProperty("方案编码")
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
@Schema(description = "方案名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "标准包装方案")
|
|
||||||
@ExcelProperty("方案名称")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "每包数量(件)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
@ExcelProperty("每包数量(件)")
|
|
||||||
private BigDecimal packageQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "每托包数(包)", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
|
|
||||||
@ExcelProperty("每托包数(包)")
|
|
||||||
private BigDecimal palletPackageQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "每托总数量(件)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000")
|
|
||||||
@ExcelProperty("每托总数量(件)")
|
|
||||||
private BigDecimal palletTotalQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "默认包装")
|
|
||||||
@ExcelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
|
||||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
|
||||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
|
||||||
@ExcelProperty("创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.packagingscheme;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
|
||||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.validation.constraints.DecimalMin;
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - ERP 包装方案新增/修改 Request VO")
|
|
||||||
@Data
|
|
||||||
public class ErpPackagingSchemeSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "包装方案编号", example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "方案编码", example = "BZFA202501010001")
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
@Schema(description = "方案名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "标准包装方案")
|
|
||||||
@NotBlank(message = "方案名称不能为空")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "每包数量(件)", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
|
||||||
@NotNull(message = "每包数量不能为空")
|
|
||||||
@DecimalMin(value = "0", inclusive = false, message = "每包数量必须大于 0")
|
|
||||||
private BigDecimal packageQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "每托包数(包)", requiredMode = Schema.RequiredMode.REQUIRED, example = "20")
|
|
||||||
@NotNull(message = "每托包数不能为空")
|
|
||||||
@DecimalMin(value = "0", inclusive = false, message = "每托包数必须大于 0")
|
|
||||||
private BigDecimal palletPackageQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "每托总数量(件)", example = "2000")
|
|
||||||
private BigDecimal palletTotalQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "备注", example = "默认包装")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
|
||||||
@NotNull(message = "状态不能为空")
|
|
||||||
@InEnum(CommonStatusEnum.class)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
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 = "1")
|
|
||||||
private Integer categoryType;
|
|
||||||
|
|
||||||
@Schema(description = "产品编号", example = "11161")
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
@Schema(description = "产品规格", example = "红色")
|
|
||||||
private String standard;
|
|
||||||
|
|
||||||
@Schema(description = "产品 id 集合")
|
|
||||||
private List<Long> ids;
|
|
||||||
}
|
|
||||||
@ -1,33 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 产品关联包装方案 Response VO")
|
|
||||||
@Data
|
|
||||||
public class ProductPackagingSchemeRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "关联记录 ID", example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "包装方案 ID", example = "1")
|
|
||||||
private Long packagingSchemeId;
|
|
||||||
|
|
||||||
@Schema(description = "包装方案名称", example = "标准包装方案")
|
|
||||||
private String packagingSchemeName;
|
|
||||||
|
|
||||||
@Schema(description = "每包数量(件)", example = "100")
|
|
||||||
private BigDecimal packageQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "每托包数(包)", example = "20")
|
|
||||||
private BigDecimal palletPackageQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "每托总数量(件)", example = "2000")
|
|
||||||
private BigDecimal palletTotalQuantity;
|
|
||||||
|
|
||||||
@Schema(description = "是否默认方案", example = "1")
|
|
||||||
private Integer defaultStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 产品关联包装方案 Request VO")
|
|
||||||
@Data
|
|
||||||
public class ProductPackagingSchemeSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "包装方案 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "包装方案 ID 不能为空")
|
|
||||||
private Long packagingSchemeId;
|
|
||||||
|
|
||||||
@Schema(description = "是否默认方案", example = "1")
|
|
||||||
private Integer defaultStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,15 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 产品关联供应商 Response VO")
|
|
||||||
@Data
|
|
||||||
public class ProductSupplierRespVO {
|
|
||||||
|
|
||||||
@Schema(description = "关联记录 ID", example = "1")
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
@Schema(description = "供应商 ID", example = "1")
|
|
||||||
private Long supplierId;
|
|
||||||
|
|
||||||
@Schema(description = "供应商名称", example = "默认供应商")
|
|
||||||
private String supplierName;
|
|
||||||
|
|
||||||
@Schema(description = "是否默认供应商", example = "1")
|
|
||||||
private Integer defaultStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.erp.controller.admin.product.vo.product;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 产品关联供应商 Request VO")
|
|
||||||
@Data
|
|
||||||
public class ProductSupplierSaveReqVO {
|
|
||||||
|
|
||||||
@Schema(description = "供应商 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
|
||||||
@NotNull(message = "供应商 ID 不能为空")
|
|
||||||
private Long supplierId;
|
|
||||||
|
|
||||||
@Schema(description = "是否默认供应商", example = "1")
|
|
||||||
private Integer defaultStatus;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,96 +0,0 @@
|
|||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,30 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,95 +0,0 @@
|
|||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,39 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue