Merge branch 'main' into hhk

plp
HuangHuiKang 3 weeks ago
commit e30f19360c

@ -70,7 +70,7 @@ public class MoldBrandRespVO {
@ColumnWidth(20)
private LocalDateTime createTime;
@Schema(description = "工序", example = "你说的对")
@Schema(description = "工序", example = "reya")
@ExcelProperty(value = "工序", converter = DictConvert.class)
@DictFormat("mes_org_type")
private String orgType;

@ -28,7 +28,7 @@ public class MoldBrandSaveReqVO {
private String moldType;
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
@NotNull(message = "产品ID不能为空")
// @NotNull(message = "产品ID不能为空")
private Long productId;
@Schema(description = "预期寿命(小时)")
@ -40,8 +40,8 @@ public class MoldBrandSaveReqVO {
@Schema(description = "维保周期")
private BigDecimal maintainTime;
@Schema(description = "模具系数", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "模具系数不能为空")
@Schema(description = "模数", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "模数不能为空")
private Long moldSize;
@Schema(description = "备注", example = "你说的对")

@ -72,9 +72,12 @@ public class MoldRespVO {
private LocalDateTime createTime;
@Schema(description = "型号id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15258")
@ExcelProperty("型号id")
private Long brandId;
@Schema(description = "型号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15258")
@ExcelProperty("型号")
private String brandName;
@Schema(description = "附件地址")
@ExcelProperty("附件地址")
private String fileUrl;

@ -8,15 +8,19 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
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.MoldRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProductRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInSaveReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.StockInTypeEnum;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.purchase.ErpSupplierDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInItemDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockOutItemDO;
import cn.iocoder.yudao.module.erp.service.mold.MoldService;
import cn.iocoder.yudao.module.erp.service.product.ErpProductService;
import cn.iocoder.yudao.module.erp.service.purchase.ErpSupplierService;
import cn.iocoder.yudao.module.erp.service.stock.ErpStockInService;
@ -38,6 +42,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -59,6 +64,9 @@ public class ErpStockInController {
@Resource
private ErpSupplierService supplierService;
@Resource
private MoldService moldService;
@Resource
private AdminUserApi adminUserApi;
@ -105,15 +113,28 @@ public class ErpStockInController {
return success(null);
}
List<ErpStockInItemDO> stockInItemList = stockInService.getStockInItemListByInId(id);
Map<Long, ErpProductRespVO> productMap = productService.getProductVOMap(
convertSet(stockInItemList, ErpStockInItemDO::getProductId));
return success(BeanUtils.toBean(stockIn, ErpStockInRespVO.class, stockInVO ->
stockInVO.setItems(BeanUtils.toBean(stockInItemList, ErpStockInRespVO.Item.class, item -> {
ErpStockDO stock = stockService.getStock(item.getProductId(), item.getWarehouseId());
item.setStockCount(stock != null ? stock.getCount() : BigDecimal.ZERO);
MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()));
}))));
if (Objects.equals(stockIn.getInType(), "模具入库")) {
Map<Long, MoldRespVO> moldMap = moldService.getMoldVOMap(
convertSet(stockInItemList, ErpStockInItemDO::getProductId));
return success(BeanUtils.toBean(stockIn, ErpStockInRespVO.class, stockInVO ->
stockInVO.setItems(BeanUtils.toBean(stockInItemList, ErpStockInRespVO.Item.class, item -> {
ErpStockDO stock = stockService.getStock(item.getProductId(), item.getWarehouseId());
item.setStockCount(stock != null ? stock.getCount() : BigDecimal.ZERO);
MapUtils.findAndThen(moldMap, item.getProductId(), mold -> item.setProductName(mold.getName())
.setProductBarCode(mold.getCode()).setProductUnitName(mold.getUnitName()));
}))));
} else {
Map<Long, ErpProductRespVO> productMap = productService.getProductVOMap(
convertSet(stockInItemList, ErpStockInItemDO::getProductId));
return success(BeanUtils.toBean(stockIn, ErpStockInRespVO.class, stockInVO ->
stockInVO.setItems(BeanUtils.toBean(stockInItemList, ErpStockInRespVO.Item.class, item -> {
ErpStockDO stock = stockService.getStock(item.getProductId(), item.getWarehouseId());
item.setStockCount(stock != null ? stock.getCount() : BigDecimal.ZERO);
MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()));
}))));
}
}
@GetMapping("/page")
@ -161,12 +182,24 @@ public class ErpStockInController {
// 1.4 管理员信息
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
convertSet(pageResult.getList(), stockIn -> Long.parseLong(stockIn.getCreator())));
// 1.7 模具信息
Map<Long, MoldRespVO> moldMap = moldService.getMoldVOMap(
convertSet(stockInItemList, ErpStockInItemDO::getProductId));
// 2. 开始拼接
return BeanUtils.toBean(pageResult, ErpStockInRespVO.class, stockIn -> {
stockIn.setItems(BeanUtils.toBean(stockInItemMap.get(stockIn.getId()), ErpStockInRespVO.Item.class,
item -> MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()))));
stockIn.setProductNames(CollUtil.join(stockIn.getItems(), "", ErpStockInRespVO.Item::getProductName));
if (Objects.equals(stockIn.getInType(), "模具入库")) {
stockIn.setItems(BeanUtils.toBean(stockInItemMap.get(stockIn.getId()), ErpStockInRespVO.Item.class,
item -> MapUtils.findAndThen(moldMap, item.getProductId(), mold -> item.setProductName(mold.getName())
.setProductBarCode(mold.getCode()).setProductUnitName(mold.getUnitName()))));
stockIn.setProductNames(CollUtil.join(stockIn.getItems(), "", ErpStockInRespVO.Item::getProductName));
} else {
stockIn.setItems(BeanUtils.toBean(stockInItemMap.get(stockIn.getId()), ErpStockInRespVO.Item.class,
item -> MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()))));
stockIn.setProductNames(CollUtil.join(stockIn.getItems(), "", ErpStockInRespVO.Item::getProductName));
}
MapUtils.findAndThen(supplierMap, stockIn.getSupplierId(), supplier -> stockIn.setSupplierName(supplier.getName()));
MapUtils.findAndThen(userMap, Long.parseLong(stockIn.getCreator()), user -> stockIn.setCreatorName(user.getNickname()));
});

@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
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.MoldRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProductRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutRespVO;
@ -15,8 +16,10 @@ import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutSave
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.StockOutTypeEnum;
import cn.iocoder.yudao.module.erp.dal.dataobject.sale.ErpCustomerDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInItemDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockOutDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockOutItemDO;
import cn.iocoder.yudao.module.erp.service.mold.MoldService;
import cn.iocoder.yudao.module.erp.service.product.ErpProductService;
import cn.iocoder.yudao.module.erp.service.sale.ErpCustomerService;
import cn.iocoder.yudao.module.erp.service.stock.ErpStockOutService;
@ -38,6 +41,7 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@ -59,6 +63,9 @@ public class ErpStockOutController {
@Resource
private ErpCustomerService customerService;
@Resource
private MoldService moldService;
@Resource
private AdminUserApi adminUserApi;
@ -105,15 +112,28 @@ public class ErpStockOutController {
return success(null);
}
List<ErpStockOutItemDO> stockOutItemList = stockOutService.getStockOutItemListByOutId(id);
Map<Long, ErpProductRespVO> productMap = productService.getProductVOMap(
convertSet(stockOutItemList, ErpStockOutItemDO::getProductId));
return success(BeanUtils.toBean(stockOut, ErpStockOutRespVO.class, stockOutVO ->
stockOutVO.setItems(BeanUtils.toBean(stockOutItemList, ErpStockOutRespVO.Item.class, item -> {
ErpStockDO stock = stockService.getStock(item.getProductId(), item.getWarehouseId());
item.setStockCount(stock != null ? stock.getCount() : BigDecimal.ZERO);
MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()));
}))));
if (Objects.equals(stockOut.getOutType(), "模具出库")) {
Map<Long, MoldRespVO> moldMap = moldService.getMoldVOMap(
convertSet(stockOutItemList, ErpStockOutItemDO::getProductId));
return success(BeanUtils.toBean(stockOut, ErpStockOutRespVO.class, stockOutVO ->
stockOutVO.setItems(BeanUtils.toBean(stockOutItemList, ErpStockOutRespVO.Item.class, item -> {
ErpStockDO stock = stockService.getStock(item.getProductId(), item.getWarehouseId());
item.setStockCount(stock != null ? stock.getCount() : BigDecimal.ZERO);
MapUtils.findAndThen(moldMap, item.getProductId(), mold -> item.setProductName(mold.getName())
.setProductBarCode(mold.getCode()).setProductUnitName(mold.getUnitName()));
}))));
} else {
Map<Long, ErpProductRespVO> productMap = productService.getProductVOMap(
convertSet(stockOutItemList, ErpStockOutItemDO::getProductId));
return success(BeanUtils.toBean(stockOut, ErpStockOutRespVO.class, stockOutVO ->
stockOutVO.setItems(BeanUtils.toBean(stockOutItemList, ErpStockOutRespVO.Item.class, item -> {
ErpStockDO stock = stockService.getStock(item.getProductId(), item.getWarehouseId());
item.setStockCount(stock != null ? stock.getCount() : BigDecimal.ZERO);
MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()));
}))));
}
}
@GetMapping("/page")
@ -157,19 +177,29 @@ public class ErpStockOutController {
// 1.3 客户信息
Map<Long, ErpCustomerDO> customerMap = customerService.getCustomerMap(
convertSet(pageResult.getList(), ErpStockOutDO::getCustomerId));
// 1.4 管理员信息
// 1.5 管理员信息
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
convertSet(pageResult.getList(), stockOut -> Long.parseLong(stockOut.getCreator())));
// 1.4 领料员信息
// 1.6 领料员信息
Map<Long, AdminUserRespDTO> responserMap = adminUserApi.getUserMap(
convertSet(pageResult.getList(), ErpStockOutDO::getResponserId));
// 1.7 模具信息
Map<Long, MoldRespVO> moldMap = moldService.getMoldVOMap(
convertSet(stockOutItemList, ErpStockOutItemDO::getProductId));
// 2. 开始拼接
return BeanUtils.toBean(pageResult, ErpStockOutRespVO.class, stockOut -> {
stockOut.setItems(BeanUtils.toBean(stockOutItemMap.get(stockOut.getId()), ErpStockOutRespVO.Item.class,
item -> MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()))));
stockOut.setProductNames(CollUtil.join(stockOut.getItems(), "", ErpStockOutRespVO.Item::getProductName));
if (Objects.equals(stockOut.getOutType(), "模具出库")) {
stockOut.setItems(BeanUtils.toBean(stockOutItemMap.get(stockOut.getId()), ErpStockOutRespVO.Item.class,
item -> MapUtils.findAndThen(moldMap, item.getProductId(), mold -> item.setProductName(mold.getName())
.setProductBarCode(mold.getCode()).setProductUnitName(mold.getUnitName()))));
stockOut.setProductNames(CollUtil.join(stockOut.getItems(), "", ErpStockOutRespVO.Item::getProductName));
} else {
stockOut.setItems(BeanUtils.toBean(stockOutItemMap.get(stockOut.getId()), ErpStockOutRespVO.Item.class,
item -> MapUtils.findAndThen(productMap, item.getProductId(), product -> item.setProductName(product.getName())
.setProductBarCode(product.getBarCode()).setProductUnitName(product.getUnitName()))));
stockOut.setProductNames(CollUtil.join(stockOut.getItems(), "", ErpStockOutRespVO.Item::getProductName));
}
MapUtils.findAndThen(customerMap, stockOut.getCustomerId(), supplier -> stockOut.setCustomerName(supplier.getName()));
MapUtils.findAndThen(userMap, Long.parseLong(stockOut.getCreator()), user -> stockOut.setCreatorName(user.getNickname()));
MapUtils.findAndThen(responserMap, stockOut.getResponserId(), user -> stockOut.setResponserName(user.getNickname()));

@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.*;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandProductDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductCategoryDO;
import javax.validation.Valid;
import java.util.Collection;
@ -15,6 +16,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
/**
* Service
*
@ -149,4 +152,24 @@ public interface MoldBrandService {
MoldBrandProductDO getMoldBrandProduct(Long id);
List<MoldDO> getAllList();
/**
*
*
* @param ids
* @return
*/
List<MoldBrandDO> getMoldBrandList(Collection<Long> ids);
/**
* Map
*
* @param ids
* @return Map
*/
default Map<Long, MoldBrandDO> getMoldBrandMap(Collection<Long> ids) {
if(ids.isEmpty())return new HashMap<>();
return convertMap(getMoldBrandList(ids), MoldBrandDO::getId);
}
}

@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.*;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandProductDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductCategoryDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductUnitDO;
import cn.iocoder.yudao.module.erp.dal.mysql.mold.MoldBrandMapper;
@ -238,4 +239,9 @@ public class MoldBrandServiceImpl implements MoldBrandService {
public List<MoldDO> getAllList() {
return moldMapper.selectList();
}
@Override
public List<MoldBrandDO> getMoldBrandList(Collection<Long> ids) {
return moldBrandMapper.selectBatchIds(ids);
}
}

@ -4,8 +4,11 @@ import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldSaveReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProductRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import javax.validation.Valid;
import java.util.Collection;
@ -13,6 +16,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
/**
* Service
*
@ -64,4 +69,33 @@ public interface MoldService {
}
return CollectionUtils.convertMap(getList(ids), MoldDO::getId);
}
/**
*
*
* @param ids
* @return
*/
List<MoldDO> validMoldList(Collection<Long> ids);
/**
* VO
*
* @param ids
* @return VO
*/
List<MoldRespVO> getMoldVOList(Collection<Long> ids);
/**
* VO Map
*
* @param ids
* @return VO Map
*/
default Map<Long, MoldRespVO> getMoldVOMap(Collection<Long> ids) {
if(ids.isEmpty())return new HashMap<>();
return convertMap(getMoldVOList(ids), MoldRespVO::getId);
}
List<MoldRespVO> buildMoldVOList(List<MoldDO> list);
}

@ -1,6 +1,14 @@
package cn.iocoder.yudao.module.erp.service.mold;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProductRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductCategoryDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductUnitDO;
import cn.iocoder.yudao.module.erp.service.product.ErpProductUnitService;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
@ -17,6 +25,8 @@ import cn.iocoder.yudao.module.erp.dal.mysql.mold.MoldMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.*;
/**
@ -31,6 +41,12 @@ public class MoldServiceImpl implements MoldService {
@Resource
private MoldMapper moldMapper;
@Resource
private MoldBrandService moldBrandService;
@Resource
private ErpProductUnitService productUnitService;
@Override
public Long createMold(MoldSaveReqVO createReqVO) {
// 插入
@ -76,4 +92,49 @@ public class MoldServiceImpl implements MoldService {
public List<MoldDO> getList(Collection<Long> ids) {
return moldMapper.selectBatchIds(ids);
}
@Override
public List<MoldDO> validMoldList(Collection<Long> ids) {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<MoldDO> list = moldMapper.selectBatchIds(ids);
Map<Long, MoldDO> moldMap = convertMap(list, MoldDO::getId);
for (Long id : ids) {
MoldDO mold = moldMap.get(id);
if (moldMap.get(id) == null) {
throw exception(PRODUCT_NOT_EXISTS);
}
if (CommonStatusEnum.isDisable(mold.getStatus())) {
throw exception(PRODUCT_NOT_ENABLE, mold.getName());
}
}
return list;
}
@Override
public List<MoldRespVO> getMoldVOList(Collection<Long> ids) {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<MoldDO> list = moldMapper.selectBatchIds(ids);
return buildMoldVOList(list);
}
@Override
public List<MoldRespVO> buildMoldVOList(List<MoldDO> list) {
if (CollUtil.isEmpty(list)) {
return Collections.emptyList();
}
Map<Long, MoldBrandDO> brandMap = moldBrandService.getMoldBrandMap(
convertSet(list, MoldDO::getBrandId));
Map<Long, ErpProductUnitDO> unitMap = productUnitService.getProductUnitMap(
convertSet(list, MoldDO::getUnitId));
return BeanUtils.toBean(list, MoldRespVO.class, product -> {
MapUtils.findAndThen(brandMap, product.getBrandId(),
category -> product.setBrandName(category.getName()));
MapUtils.findAndThen(unitMap, product.getUnitId(),
unit -> product.setUnitName(unit.getName()));
});
}
}

@ -6,6 +6,8 @@ import cn.iocoder.yudao.framework.common.util.number.MoneyUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInSaveReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutSaveReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInItemDO;
@ -14,6 +16,7 @@ import cn.iocoder.yudao.module.erp.dal.mysql.stock.ErpStockInMapper;
import cn.iocoder.yudao.module.erp.dal.redis.no.ErpNoRedisDAO;
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
import cn.iocoder.yudao.module.erp.enums.stock.ErpStockRecordBizTypeEnum;
import cn.iocoder.yudao.module.erp.service.mold.MoldService;
import cn.iocoder.yudao.module.erp.service.product.ErpProductService;
import cn.iocoder.yudao.module.erp.service.purchase.ErpSupplierService;
import cn.iocoder.yudao.module.erp.service.stock.bo.ErpStockRecordCreateReqBO;
@ -23,10 +26,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
@ -53,6 +53,8 @@ public class ErpStockInServiceImpl implements ErpStockInService {
@Resource
private ErpProductService productService;
@Resource
private MoldService moldService;
@Resource
private ErpWarehouseService warehouseService;
@Resource
private ErpSupplierService supplierService;
@ -63,7 +65,7 @@ public class ErpStockInServiceImpl implements ErpStockInService {
@Transactional(rollbackFor = Exception.class)
public Long createStockIn(ErpStockInSaveReqVO createReqVO) {
// 1.1 校验入库项的有效性
List<ErpStockInItemDO> stockInItems = validateStockInItems(createReqVO.getItems());
List<ErpStockInItemDO> stockInItems = validateStockInItems(createReqVO.getItems(),createReqVO.getInType());
// 1.2 校验供应商
//supplierService.validateSupplier(createReqVO.getSupplierId());
// 1.3 生成入库单号,并校验唯一性
@ -95,7 +97,7 @@ public class ErpStockInServiceImpl implements ErpStockInService {
// 1.2 校验供应商
//supplierService.validateSupplier(updateReqVO.getSupplierId());
// 1.3 校验入库项的有效性
List<ErpStockInItemDO> stockInItems = validateStockInItems(updateReqVO.getItems());
List<ErpStockInItemDO> stockInItems = validateStockInItems(updateReqVO.getItems(),updateReqVO.getInType());
// 2.1 更新入库单
ErpStockInDO updateObj = BeanUtils.toBean(updateReqVO, ErpStockInDO.class, in -> in
@ -130,25 +132,48 @@ public class ErpStockInServiceImpl implements ErpStockInService {
: ErpStockRecordBizTypeEnum.OTHER_IN_CANCEL.getType();
stockInItems.forEach(stockInItem -> {
BigDecimal count = approve ? stockInItem.getCount() : stockInItem.getCount().negate();
ErpProductDO productDO = productService.getProduct(stockInItem.getProductId());
stockRecordService.createStockRecord(new ErpStockRecordCreateReqBO(
stockInItem.getProductId(),productDO.getCategoryId(), stockInItem.getWarehouseId(), count,
bizType, stockInItem.getInId(), stockInItem.getId(), stockIn.getNo(), stockIn.getInTime()));
if (Objects.equals(stockIn.getInType(), "模具入库")) {
MoldDO moldDO = moldService.getMold(stockInItem.getProductId());
stockRecordService.createStockRecord(new ErpStockRecordCreateReqBO(
stockInItem.getProductId(),moldDO.getBrandId(), stockInItem.getWarehouseId(), count,
bizType, stockInItem.getInId(), stockInItem.getId(), stockIn.getNo(), stockIn.getInTime()));
} else {
ErpProductDO productDO = productService.getProduct(stockInItem.getProductId());
stockRecordService.createStockRecord(new ErpStockRecordCreateReqBO(
stockInItem.getProductId(),productDO.getCategoryId(), stockInItem.getWarehouseId(), count,
bizType, stockInItem.getInId(), stockInItem.getId(), stockIn.getNo(), stockIn.getInTime()));
}
});
}
private List<ErpStockInItemDO> validateStockInItems(List<ErpStockInSaveReqVO.Item> list) {
// 1.1 校验产品存在
List<ErpProductDO> productList = productService.validProductList(
convertSet(list, ErpStockInSaveReqVO.Item::getProductId));
Map<Long, ErpProductDO> productMap = convertMap(productList, ErpProductDO::getId);
// 1.2 校验仓库存在
warehouseService.validWarehouseList(convertSet(
list, ErpStockInSaveReqVO.Item::getWarehouseId));
// 2. 转化为 ErpStockInItemDO 列表
return convertList(list, o -> BeanUtils.toBean(o, ErpStockInItemDO.class, item -> item
.setProductUnitId(productMap.get(item.getProductId()).getUnitId())
.setTotalPrice(MoneyUtils.priceMultiply(item.getProductPrice(), item.getCount()))));
private List<ErpStockInItemDO> validateStockInItems(List<ErpStockInSaveReqVO.Item> list,String outType) {
if (Objects.equals(outType, "模具入库")) {
// 1.1 校验模具存在
List<MoldDO> moldList = moldService.validMoldList(
convertSet(list, ErpStockInSaveReqVO.Item::getProductId));
Map<Long, MoldDO> moldMap = convertMap(moldList, MoldDO::getId);
// 1.2 校验仓库存在
warehouseService.validWarehouseList(convertSet(
list, ErpStockInSaveReqVO.Item::getWarehouseId));
// 2. 转化为 ErpStockInItemDO 列表
return convertList(list, o -> BeanUtils.toBean(o, ErpStockInItemDO.class, item -> item
.setProductUnitId(moldMap.get(item.getProductId()).getUnitId())
.setTotalPrice(MoneyUtils.priceMultiply(item.getProductPrice(), item.getCount()))));
} else {
// 1.1 校验产品存在
List<ErpProductDO> productList = productService.validProductList(
convertSet(list, ErpStockInSaveReqVO.Item::getProductId));
Map<Long, ErpProductDO> productMap = convertMap(productList, ErpProductDO::getId);
// 1.2 校验仓库存在
warehouseService.validWarehouseList(convertSet(
list, ErpStockInSaveReqVO.Item::getWarehouseId));
// 2. 转化为 ErpStockInItemDO 列表
return convertList(list, o -> BeanUtils.toBean(o, ErpStockInItemDO.class, item -> item
.setProductUnitId(productMap.get(item.getProductId()).getUnitId())
.setTotalPrice(MoneyUtils.priceMultiply(item.getProductPrice(), item.getCount()))));
}
}
private void updateStockInItemList(Long id, List<ErpStockInItemDO> newList) {

@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.util.number.MoneyUtils;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutPageReqVO;
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.out.ErpStockOutSaveReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockOutDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockOutItemDO;
@ -14,6 +15,7 @@ import cn.iocoder.yudao.module.erp.dal.mysql.stock.ErpStockOutMapper;
import cn.iocoder.yudao.module.erp.dal.redis.no.ErpNoRedisDAO;
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
import cn.iocoder.yudao.module.erp.enums.stock.ErpStockRecordBizTypeEnum;
import cn.iocoder.yudao.module.erp.service.mold.MoldService;
import cn.iocoder.yudao.module.erp.service.product.ErpProductService;
import cn.iocoder.yudao.module.erp.service.sale.ErpCustomerService;
import cn.iocoder.yudao.module.erp.service.stock.bo.ErpStockRecordCreateReqBO;
@ -24,10 +26,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.*;
@ -55,6 +54,9 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
@Resource
private ErpProductService productService;
@Resource
private MoldService moldService;
@Resource
private ErpWarehouseService warehouseService;
@Resource
@ -67,7 +69,7 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
@Transactional(rollbackFor = Exception.class)
public Long createStockOut(ErpStockOutSaveReqVO createReqVO) {
// 1.1 校验出库项的有效性
List<ErpStockOutItemDO> stockOutItems = validateStockOutItems(createReqVO.getItems());
List<ErpStockOutItemDO> stockOutItems = validateStockOutItems(createReqVO.getItems(),createReqVO.getOutType());
// 1.2 校验客户
//customerService.validateCustomer(createReqVO.getCustomerId());
// 1.3 生成出库单号,并校验唯一性
@ -99,7 +101,7 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
// 1.2 校验客户
customerService.validateCustomer(updateReqVO.getCustomerId());
// 1.3 校验出库项的有效性
List<ErpStockOutItemDO> stockOutItems = validateStockOutItems(updateReqVO.getItems());
List<ErpStockOutItemDO> stockOutItems = validateStockOutItems(updateReqVO.getItems(),updateReqVO.getOutType());
// 2.1 更新出库单
ErpStockOutDO updateObj = BeanUtils.toBean(updateReqVO, ErpStockOutDO.class, in -> in
@ -134,24 +136,46 @@ public class ErpStockOutServiceImpl implements ErpStockOutService {
: ErpStockRecordBizTypeEnum.OTHER_OUT_CANCEL.getType();
stockOutItems.forEach(stockOutItem -> {
BigDecimal count = approve ? stockOutItem.getCount().negate() : stockOutItem.getCount();
ErpProductDO productDO = productService.getProduct(stockOutItem.getProductId());
stockRecordService.createStockRecord(new ErpStockRecordCreateReqBO(
stockOutItem.getProductId(),productDO.getCategoryId(), stockOutItem.getWarehouseId(), count,
bizType, stockOutItem.getOutId(), stockOutItem.getId(), stockOut.getNo(),stockOut.getOutTime()));
});
if (Objects.equals(stockOut.getOutType(), "模具出库")) {
MoldDO moldDO = moldService.getMold(stockOutItem.getProductId());
stockRecordService.createStockRecord(new ErpStockRecordCreateReqBO(
stockOutItem.getProductId(),moldDO.getBrandId(), stockOutItem.getWarehouseId(), count,
bizType, stockOutItem.getOutId(), stockOutItem.getId(), stockOut.getNo(),stockOut.getOutTime()));
} else {
ErpProductDO productDO = productService.getProduct(stockOutItem.getProductId());
stockRecordService.createStockRecord(new ErpStockRecordCreateReqBO(
stockOutItem.getProductId(),productDO.getCategoryId(), stockOutItem.getWarehouseId(), count,
bizType, stockOutItem.getOutId(), stockOutItem.getId(), stockOut.getNo(),stockOut.getOutTime()));
}
});
}
private List<ErpStockOutItemDO> validateStockOutItems(List<ErpStockOutSaveReqVO.Item> list) {
// 1.1 校验产品存在
List<ErpProductDO> productList = productService.validProductList(
convertSet(list, ErpStockOutSaveReqVO.Item::getProductId));
Map<Long, ErpProductDO> productMap = convertMap(productList, ErpProductDO::getId);
// 1.2 校验仓库存在
warehouseService.validWarehouseList(convertSet(list, ErpStockOutSaveReqVO.Item::getWarehouseId));
// 2. 转化为 ErpStockOutItemDO 列表
return convertList(list, o -> BeanUtils.toBean(o, ErpStockOutItemDO.class, item -> item
.setProductUnitId(productMap.get(item.getProductId()).getUnitId())
.setTotalPrice(MoneyUtils.priceMultiply(item.getProductPrice(), item.getCount()))));
private List<ErpStockOutItemDO> validateStockOutItems(List<ErpStockOutSaveReqVO.Item> list,String outType) {
if (Objects.equals(outType, "模具出库")) {
// 1.1 校验模具存在
List<MoldDO> moldList = moldService.validMoldList(
convertSet(list, ErpStockOutSaveReqVO.Item::getProductId));
Map<Long, MoldDO> moldMap = convertMap(moldList, MoldDO::getId);
// 1.2 校验仓库存在
warehouseService.validWarehouseList(convertSet(list, ErpStockOutSaveReqVO.Item::getWarehouseId));
// 2. 转化为 ErpStockOutItemDO 列表
return convertList(list, o -> BeanUtils.toBean(o, ErpStockOutItemDO.class, item -> item
.setProductUnitId(moldMap.get(item.getProductId()).getUnitId())
.setTotalPrice(MoneyUtils.priceMultiply(item.getProductPrice(), item.getCount()))));
} else {
// 1.1 校验产品存在
List<ErpProductDO> productList = productService.validProductList(
convertSet(list, ErpStockOutSaveReqVO.Item::getProductId));
Map<Long, ErpProductDO> productMap = convertMap(productList, ErpProductDO::getId);
// 1.2 校验仓库存在
warehouseService.validWarehouseList(convertSet(list, ErpStockOutSaveReqVO.Item::getWarehouseId));
// 2. 转化为 ErpStockOutItemDO 列表
return convertList(list, o -> BeanUtils.toBean(o, ErpStockOutItemDO.class, item -> item
.setProductUnitId(productMap.get(item.getProductId()).getUnitId())
.setTotalPrice(MoneyUtils.priceMultiply(item.getProductPrice(), item.getCount()))));
}
}
private void updateStockOutItemList(Long id, List<ErpStockOutItemDO> newList) {

@ -93,6 +93,8 @@ public interface ErrorCodeConstants {
ErrorCode MOLD_RECORD_NOT_EXISTS = new ErrorCode(5_0087, "模具维保不存在");
ErrorCode MOLD_GET_NOT_EXISTS = new ErrorCode(5_0087, "领模申请不存在");
ErrorCode MOLD_RETURN_NOT_EXISTS = new ErrorCode(5_0087, "模具入库不存在");
ErrorCode MOLD_OPERATE_NOT_EXISTS = new ErrorCode(5_0087, "模具上下模不存在");
ErrorCode DV_CHECK_NOT_EXISTS = new ErrorCode(5_0087, "维保计划不存在");

@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.dvrepair.DvRepairLineDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.ticketresults.TicketResultsDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
@ -125,6 +126,9 @@ public class DeviceLedgerRespVO extends BaseDO {
@Schema(description = "备件列表")
private List<ErpProductDO> beijianList;
@Schema(description = "模具列表")
private List<MoldDO> moldList;
@Schema(description = "附件地址")
@ExcelProperty("附件地址")
private String fileUrl;
@ -134,4 +138,7 @@ public class DeviceLedgerRespVO extends BaseDO {
@Schema(description = "备件id")
private String beijianId;
@Schema(description = "模具id")
private String moldId;
}

@ -70,6 +70,9 @@ public class DeviceLedgerSaveReqVO {
@Schema(description = "关键件ids集合")
private String componentId;
@Schema(description = "关键ids集合")
@Schema(description = "ids集合")
private String beijianId;
@Schema(description = "模具ids集合")
private String moldId;
}

@ -0,0 +1,163 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldoperate;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldRespVO;
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldSaveReqVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInItemDO;
import cn.iocoder.yudao.module.erp.service.mold.MoldService;
import cn.iocoder.yudao.module.mes.controller.admin.deviceledger.vo.DeviceLedgerRespVO;
import cn.iocoder.yudao.module.mes.controller.admin.deviceledger.vo.DeviceLedgerSaveReqVO;
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO;
import cn.iocoder.yudao.module.mes.service.deviceledger.DeviceLedgerService;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
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 static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
import cn.iocoder.yudao.module.mes.controller.admin.moldoperate.vo.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.moldoperate.MoldOperateDO;
import cn.iocoder.yudao.module.mes.service.moldoperate.MoldOperateService;
@Tag(name = "管理后台 - 模具上下模")
@RestController
@RequestMapping("/mes/mold-operate")
@Validated
public class MoldOperateController {
@Resource
private MoldOperateService moldOperateService;
@Resource
private AdminUserApi adminUserApi;
@Resource
private MoldService moldService;
@Resource
private DeviceLedgerService deviceLedgerService;
@PostMapping("/create")
@Operation(summary = "创建模具上下模")
@PreAuthorize("@ss.hasPermission('mes:mold-operate:create')")
public CommonResult<Long> createMoldOperate(@Valid @RequestBody MoldOperateSaveReqVO createReqVO) {
if (Objects.equals(createReqVO.getOperateType(), "1")) {
MoldDO moldDO = moldService.getMold(createReqVO.getMoldId());
moldDO.setMachineId(createReqVO.getDeviceId());
moldDO.setStatus(0); // 在机 0 在库 1
moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class));
DeviceLedgerDO deviceLedger = deviceLedgerService.getDeviceLedger(createReqVO.getDeviceId());
deviceLedger.setMoldId(Long.toString(createReqVO.getMoldId()));
deviceLedgerService.updateDeviceLedger(BeanUtils.toBean(deviceLedger, DeviceLedgerSaveReqVO.class));
} else {
DeviceLedgerDO deviceLedger = deviceLedgerService.getDeviceLedger(createReqVO.getDeviceId());
createReqVO.setMoldId(Long.parseLong(deviceLedger.getMoldId()));
MoldDO moldDO = moldService.getMold(Long.parseLong(deviceLedger.getMoldId()));
moldDO.setMachineId(0L);
moldDO.setStatus(3); // 在机 0 在库 1
moldService.updateMold(BeanUtils.toBean(moldDO, MoldSaveReqVO.class));
deviceLedger.setMoldId("0");
deviceLedgerService.updateDeviceLedger(BeanUtils.toBean(deviceLedger, DeviceLedgerSaveReqVO.class));
}
return success(moldOperateService.createMoldOperate(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新模具上下模")
@PreAuthorize("@ss.hasPermission('mes:mold-operate:update')")
public CommonResult<Boolean> updateMoldOperate(@Valid @RequestBody MoldOperateSaveReqVO updateReqVO) {
moldOperateService.updateMoldOperate(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除模具上下模")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('mes:mold-operate:delete')")
public CommonResult<Boolean> deleteMoldOperate(@RequestParam("id") Long id) {
moldOperateService.deleteMoldOperate(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得模具上下模")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('mes:mold-operate:query')")
public CommonResult<MoldOperateRespVO> getMoldOperate(@RequestParam("id") Long id) {
MoldOperateDO moldOperate = moldOperateService.getMoldOperate(id);
return success(BeanUtils.toBean(moldOperate, MoldOperateRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得模具上下模分页")
@PreAuthorize("@ss.hasPermission('mes:mold-operate:query')")
public CommonResult<PageResult<MoldOperateRespVO>> getMoldOperatePage(@Valid MoldOperatePageReqVO pageReqVO) {
PageResult<MoldOperateDO> pageResult = moldOperateService.getMoldOperatePage(pageReqVO);
// 管理员信息
Map<Long, AdminUserRespDTO> userMap = adminUserApi.getUserMap(
convertSet(pageResult.getList(), admin -> Long.parseLong(admin.getCreator())));
// 模具信息
Map<Long, MoldRespVO> moldMap = moldService.getMoldVOMap(
convertSet(pageResult.getList(), MoldOperateDO::getMoldId));
// 设备台账
Map<Long, DeviceLedgerRespVO> deviceLedgerMap = deviceLedgerService.getDeviceLedgerVOMap(
convertSet(pageResult.getList(), MoldOperateDO::getDeviceId));
return success(BeanUtils.toBean(pageResult, MoldOperateRespVO.class,moldOperate -> {
MapUtils.findAndThen(userMap, Long.parseLong(moldOperate.getCreator()), user -> moldOperate.setCreatorName(user.getNickname()));
MapUtils.findAndThen(moldMap, moldOperate.getMoldId(), mold -> moldOperate.setMoldName(mold.getName()));
MapUtils.findAndThen(deviceLedgerMap, moldOperate.getDeviceId(), deviceLedger -> moldOperate.setDeviceName(deviceLedger.getDeviceName()));
}));
}
@GetMapping("/export-excel")
@Operation(summary = "导出模具上下模 Excel")
@PreAuthorize("@ss.hasPermission('mes:mold-operate:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMoldOperateExcel(@Valid MoldOperatePageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MoldOperateDO> list = moldOperateService.getMoldOperatePage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "模具上下模.xls", "数据", MoldOperateRespVO.class,
BeanUtils.toBean(list, MoldOperateRespVO.class));
}
@GetMapping("/get-mold")
@Operation(summary = "获得设备是否有模具")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('mes:mold-operate:query')")
public CommonResult<Boolean> getDeviceLedgerLMold(@RequestParam("id") Long id) {
DeviceLedgerDO deviceLedgerDO = deviceLedgerService.getDeviceLedger(id);
if (deviceLedgerDO.getMoldId() != null && !deviceLedgerDO.getMoldId().isEmpty() && Integer.parseInt(deviceLedgerDO.getMoldId()) != 0) {
return success(true);
} else {
return success(false);
}
}
}

@ -0,0 +1,43 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldoperate.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 MoldOperatePageReqVO extends PageParam {
@Schema(description = "操作类型", example = "2")
private String operateType;
@Schema(description = "关联模具id", example = "23041")
private Long moldId;
@Schema(description = "关联模具名称", example = "5057")
private String moldName;
@Schema(description = "关联设备id", example = "5057")
private Long deviceId;
@Schema(description = "关联设备名称", example = "5057")
private String deviceName;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "创建人", example = "随便")
private String Creator;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

@ -0,0 +1,50 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldoperate.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 MoldOperateRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16323")
@ExcelProperty("ID")
private Long id;
@Schema(description = "操作类型", example = "2")
@ExcelProperty("操作类型")
private String operateType;
@Schema(description = "关联模具id", requiredMode = Schema.RequiredMode.REQUIRED, example = "23041")
private Long moldId;
@Schema(description = "关联模具", example = "5057")
@ExcelProperty("关联模具")
private String moldName;
@Schema(description = "关联设备id", example = "5057")
private Long deviceId;
@Schema(description = "关联设备", example = "5057")
@ExcelProperty("关联设备")
private String deviceName;
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "创建人", example = "芋道")
private String creator;
@Schema(description = "创建人名称", example = "芋道")
private String creatorName;
}

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldoperate.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 MoldOperateSaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16323")
private Long id;
@Schema(description = "操作类型", example = "2")
private String operateType;
@Schema(description = "关联模具id", example = "23041")
private Long moldId;
@Schema(description = "关联设备id", example = "5057")
private Long deviceId;
@Schema(description = "备注", example = "随便")
private String remark;
}

@ -42,16 +42,16 @@ public class MoldRepairRespVO {
private String moldName;
@Schema(description = "品牌")
@ExcelProperty("品牌")
// @ExcelProperty("品牌")
private String moldBrand;
@Schema(description = "规格型号")
@ExcelProperty("规格型号")
// @ExcelProperty("规格型号")
private String moldSpec;
@Schema(description = "模具类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1622")
// @ExcelProperty(value = "模具类型", converter = DictConvert.class)
@DictFormat("mes_machine_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
// @DictFormat("mes_machine_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private Long moldTypeId;
@Schema(description = "报修日期")

@ -0,0 +1,133 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems;
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
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 java.util.stream.Collectors;
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.mes.controller.admin.moldrepairtems.vo.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.moldrepairtems.MoldRepairTemsDO;
import cn.iocoder.yudao.module.mes.service.moldrepairtems.MoldRepairTemsService;
@Tag(name = "管理后台 - 维修项目")
@RestController
@RequestMapping("/mes/mold-repair-tems")
@Validated
public class MoldRepairTemsController {
@Resource
private MoldRepairTemsService moldrepairTemsService;
@PostMapping("/create")
@Operation(summary = "创建维修项目")
@PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:create')")
public CommonResult<Long> createMoldRepairTems(@Valid @RequestBody MoldRepairTemsSaveReqVO createReqVO) {
return success(moldrepairTemsService.createMoldRepairTems(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新维修项目")
@PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:update')")
public CommonResult<Boolean> updateMoldRepairTems(@Valid @RequestBody MoldRepairTemsSaveReqVO updateReqVO) {
moldrepairTemsService.updateMoldRepairTems(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除维修项目")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:delete')")
public CommonResult<Boolean> deleteMoldRepairTems(@RequestParam("ids") String ids) {
List<Long> idList = Arrays.stream(ids.split(","))
.map(String::trim) // 去除可能存在的空格
.map(Long::valueOf)
.collect(Collectors.toList());
moldrepairTemsService.deleteMoldRepairTems(idList);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得维修项目")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:query')")
public CommonResult<MoldRepairTemsRespVO> getMoldRepairTems(@RequestParam("id") Long id) {
MoldRepairTemsDO moldrepairTems = moldrepairTemsService.getMoldRepairTems(id);
return success(BeanUtils.toBean(moldrepairTems, MoldRepairTemsRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得维修项目分页")
@PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:query')")
public CommonResult<PageResult<MoldRepairTemsRespVO>> getMoldRepairTemsPage(@Valid MoldRepairTemsPageReqVO pageReqVO) {
PageResult<MoldRepairTemsRespVO> pageResult = moldrepairTemsService.getMoldRepairTemsPage(pageReqVO);
return success(pageResult);
}
@GetMapping("/export-excel")
@Operation(summary = "导出维修项目 Excel")
@PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportMoldRepairTemsExcel(@Valid MoldRepairTemsPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MoldRepairTemsRespVO> list = moldrepairTemsService.getMoldRepairTemsPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "维修项目.xls", "数据", MoldRepairTemsRespVO.class,list);
}
// @GetMapping("/getMoldOrComponent")
// @Operation(summary = "获得设备/关键件")
// @Parameter(name = "moldType", description = "moldType 1-设备 2-关键件", required = true, example = "1024")
// @PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:query')")
// public CommonResult<List<MoldRepairTemsRespVO>> getMoldOrComponent(@RequestParam("moldType") Integer moldType) {
// return success( moldrepairTemsService.getMoldOrComponent(moldType));
// }
//
// @GetMapping("/getMoldOrComponentList")
// @Operation(summary = "获得设备/关键件列表")
//// @Parameter(name = "moldType", description = "moldType 1-设备 2-关键件", required = true, example = "1024")
// @PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:query')")
// public CommonResult<List<MoldRepairTemsRespVO>> getMoldOrComponentList(
// @Parameter(name = "moldId", description = "设备Id", required = true, example = "123")
// @RequestParam("moldId") Long moldId,
// @Parameter(name = "componentId", description = "关键件Id", required = false, example = "123")
// @RequestParam(value = "componentId",required = false) Long componentId) {
// return success(moldrepairTemsService.getMoldOrComponentList(moldId,componentId));
// }
//
//
// @GetMapping("/getComponentList")
// @Operation(summary = "获得设备关键件")
// @Parameter(name = "moldId", description = "moldId设备Id", required = true, example = "1024")
// @PreAuthorize("@ss.hasPermission('mes:mold-repair-tems:query')")
// public CommonResult<List<CriticalComponentDO>> getComponentList(@RequestParam("moldId") Long moldId) {
// return success( moldrepairTemsService.getComponentList(moldId));
// }
}

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo;
import com.alibaba.excel.annotation.ExcelProperty;
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 MoldRepairTemsPageReqVO extends PageParam {
@Schema(description = "项目编码")
private String subjectCode;
@Schema(description = "项目名称", example = "芋艿")
private String subjectName;
@Schema(description = "模具类型", example = "1")
private Integer moldBrand;
@Schema(description = "模具id", example = "11632")
private Long moldId;
@Schema(description = "关键件id", example = "29557")
private Long componentId;
@Schema(description = "检验方式")
private String inspectionMethod;
@Schema(description = "值类型", example = "1")
private String valueType;
@Schema(description = "判定基准")
private String judgmentCriteria;
@Schema(description = "是否启用")
private Boolean isEnable;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "项目内容")
private String projectContent;
@Schema(description = "id集合导出用")
private String ids;
}

@ -0,0 +1,81 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
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 MoldRepairTemsRespVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15428")
// @ExcelProperty("ID")
private Long id;
@Schema(description = "项目编码", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("维修编码")
private String subjectCode;
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@ExcelProperty("维修名称")
private String subjectName;
@Schema(description = "模具类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer moldBrand;
@Schema(description = "模具类型名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
// @ExcelProperty("模具类型名称")
private String moldBrandName;
@Schema(description = "模具id", example = "11632")
// @ExcelProperty("模具id")
private Long moldId;
@Schema(description = "关键件id", example = "29557")
// @ExcelProperty("关键件id")
private Long componentId;
@Schema(description = "检验方式")
// @ExcelProperty("检验方式")
private String inspectionMethod;
@Schema(description = "值类型", example = "1")
// @ExcelProperty("值类型")
private String valueType;
@Schema(description = "判定基准")
// @ExcelProperty("判定基准")
private String judgmentCriteria;
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否启用")
private Boolean isEnable;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
@ColumnWidth(20)
private LocalDateTime createTime;
@Schema(description = "模具名称")
@ExcelProperty("模具名称")
private String moldName;
@Schema(description = "关键件名称")
// @ExcelProperty("关键件名称")
private String componentName;
@Schema(description = "创建人名称")
@ExcelProperty("创建人名称")
private String creatorName;
@Schema(description = "项目内容")
@ExcelProperty("维修内容")
private String projectContent;
}

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 维修项目新增/修改 Request VO")
@Data
public class MoldRepairTemsSaveReqVO {
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15428")
private Long id;
@Schema(description = "项目编码", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "项目编码不能为空")
private String subjectCode;
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
@NotEmpty(message = "项目名称不能为空")
private String subjectName;
@Schema(description = "模具类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
// @NotNull(message = "模具类型不能为空")
private Integer moldBrand;
@Schema(description = "模具id", example = "11632")
private Long moldId;
@Schema(description = "关键件id", example = "29557")
private Long componentId;
@Schema(description = "检验方式")
private String inspectionMethod;
@Schema(description = "值类型", example = "1")
private String valueType;
@Schema(description = "判定基准")
private String judgmentCriteria;
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "是否启用不能为空")
private Boolean isEnable;
@Schema(description = "模具名称")
@ExcelProperty("模具名称")
private String moldName;
@Schema(description = "关键件名称")
@ExcelProperty("关键件名称")
private String componentName;
@Schema(description = "创建人名称")
@ExcelProperty("创建人名称")
private String creatorName;
@Schema(description = "项目内容")
@ExcelProperty("项目内容")
private String projectContent;
}

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductCategoryDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
@ -146,4 +147,15 @@ public class DeviceLedgerDO extends BaseDO {
@TableField(exist = false)
private List<ErpProductDO> beijianList;
/**
* id
*/
private String moldId;
/**
*
*/
@TableField(exist = false)
private List<MoldDO> moldList;
}

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.mes.dal.dataobject.moldoperate;
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("mes_mold_operate")
@KeySequence("mes_mold_operate_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MoldOperateDO extends BaseDO {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private String operateType;
/**
* id
*/
private Long moldId;
/**
* id
*/
private Long deviceId;
/**
*
*/
private String remark;
}

@ -0,0 +1,72 @@
package cn.iocoder.yudao.module.mes.dal.dataobject.moldrepairtems;
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("mes_mold_repair_tems")
@KeySequence("mes_mold_repair_tems_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MoldRepairTemsDO extends BaseDO {
/**
* ID
*/
@TableId
private Long id;
/**
*
*/
private String subjectCode;
/**
*
*/
private String subjectName;
/**
*
*/
private Integer moldBrand;
/**
* id
*/
private Long moldId;
/**
* id
*/
private Long componentId;
/**
*
*/
private String inspectionMethod;
/**
*
*/
private String valueType;
/**
*
*/
private String judgmentCriteria;
/**
*
*/
private Boolean isEnable;
/**
*
*/
private String projectContent;
}

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.mes.dal.mysql.moldoperate;
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.mes.dal.dataobject.moldoperate.MoldOperateDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mes.controller.admin.moldoperate.vo.*;
/**
* Mapper
*
* @author
*/
@Mapper
public interface MoldOperateMapper extends BaseMapperX<MoldOperateDO> {
default PageResult<MoldOperateDO> selectPage(MoldOperatePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MoldOperateDO>()
.eqIfPresent(MoldOperateDO::getOperateType, reqVO.getOperateType())
.eqIfPresent(MoldOperateDO::getMoldId, reqVO.getMoldId())
.eqIfPresent(MoldOperateDO::getDeviceId, reqVO.getDeviceId())
.eqIfPresent(MoldOperateDO::getRemark, reqVO.getRemark())
.betweenIfPresent(MoldOperateDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MoldOperateDO::getId));
}
}

@ -0,0 +1,42 @@
package cn.iocoder.yudao.module.mes.dal.mysql.moldrepairtems;
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.mes.dal.dataobject.moldrepairtems.MoldRepairTemsDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo.*;
import org.apache.ibatis.annotations.Param;
/**
* Mapper
*
* @author
*/
@Mapper
public interface MoldRepairTemsMapper extends BaseMapperX<MoldRepairTemsDO> {
default PageResult<MoldRepairTemsDO> selectPage(MoldRepairTemsPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MoldRepairTemsDO>()
.eqIfPresent(MoldRepairTemsDO::getSubjectCode, reqVO.getSubjectCode())
.likeIfPresent(MoldRepairTemsDO::getSubjectName, reqVO.getSubjectName())
.eqIfPresent(MoldRepairTemsDO::getMoldBrand, reqVO.getMoldBrand())
.eqIfPresent(MoldRepairTemsDO::getMoldId, reqVO.getMoldId())
.eqIfPresent(MoldRepairTemsDO::getComponentId, reqVO.getComponentId())
.eqIfPresent(MoldRepairTemsDO::getInspectionMethod, reqVO.getInspectionMethod())
.eqIfPresent(MoldRepairTemsDO::getValueType, reqVO.getValueType())
.eqIfPresent(MoldRepairTemsDO::getJudgmentCriteria, reqVO.getJudgmentCriteria())
.eqIfPresent(MoldRepairTemsDO::getIsEnable, reqVO.getIsEnable())
.betweenIfPresent(MoldRepairTemsDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MoldRepairTemsDO::getId));
}
IPage<MoldRepairTemsRespVO> getMoldRepairTemsPage(Page<MoldRepairTemsRespVO> page, @Param("pageReqVO") MoldRepairTemsPageReqVO pageReqVO);
List<MoldRepairTemsRespVO> getMoldRepairTemsList( @Param("pageReqVO") MoldRepairTemsPageReqVO pageReqVO);
}

@ -2,10 +2,15 @@ package cn.iocoder.yudao.module.mes.service.deviceledger;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.mes.controller.admin.deviceledger.vo.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
/**
* Service
*
@ -52,4 +57,23 @@ public interface DeviceLedgerService {
PageResult<DeviceLedgerDO> getDeviceLedgerPage(DeviceLedgerPageReqVO pageReqVO);
List<DeviceLedgerDO> getDeviceLedgerList();
/**
* VO
*
* @param ids
* @return VO
*/
List<DeviceLedgerRespVO> getDeviceLedgerVOList(Collection<Long> ids);
/**
* VO Map
*
* @param ids
* @return VO Map
*/
default Map<Long, DeviceLedgerRespVO> getDeviceLedgerVOMap(Collection<Long> ids) {
if(ids.isEmpty())return new HashMap<>();
return convertMap(getDeviceLedgerVOList(ids), DeviceLedgerRespVO::getId);
}
}

@ -1,8 +1,14 @@
package cn.iocoder.yudao.module.mes.service.deviceledger;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
import cn.iocoder.yudao.module.erp.controller.admin.mold.vo.MoldRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductUnitDO;
import cn.iocoder.yudao.module.erp.dal.mysql.mold.MoldMapper;
import cn.iocoder.yudao.module.erp.dal.mysql.product.ErpProductMapper;
import cn.iocoder.yudao.module.iot.dal.dataobject.devicemodel.DeviceModelDO;
import cn.iocoder.yudao.module.mes.controller.admin.ticketmanagement.enums.PlanTypeEnum;
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.dvrepair.DvRepairDO;
@ -32,7 +38,6 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.mes.dal.mysql.deviceledger.DeviceLedgerMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.DEVICE_MODEL_CODE_EXISTS;
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
/**
@ -63,6 +68,9 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
@Resource
private ErpProductMapper productMapper;
@Resource
private MoldMapper moldMapper;
@Override
public Long createDeviceLedger(DeviceLedgerSaveReqVO createReqVO) {
@ -177,6 +185,23 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
deviceLedgerDO.setComponentList(componentList);
}
//模具列表
List<MoldDO> moldList = new ArrayList<>();
if (StringUtils.isNotBlank(deviceLedgerDO.getMoldId())) {
// 将逗号分隔的字符串转换为Long类型的List
List<Long> idList = Arrays.stream(deviceLedgerDO.getMoldId().split(","))
.map(String::trim) // 去除可能存在的空格
.map(Long::valueOf)
.collect(Collectors.toList());
for (Long moldId : idList) {
MoldDO moldDO = moldMapper.selectById(moldId);
if(moldDO!=null){
moldList.add(moldDO);
}
}
deviceLedgerDO.setMoldList(moldList);
}
//备件列表
List<ErpProductDO> beijianList = new ArrayList<>();
if (StringUtils.isNotBlank(deviceLedgerDO.getBeijianId())) {
@ -207,4 +232,14 @@ public class DeviceLedgerServiceImpl implements DeviceLedgerService {
return deviceLedgerMapper.selectList();
}
@Override
public List<DeviceLedgerRespVO> getDeviceLedgerVOList(Collection<Long> ids) {
if (CollUtil.isEmpty(ids)) {
return Collections.emptyList();
}
List<DeviceLedgerDO> list = deviceLedgerMapper.selectBatchIds(ids);
return BeanUtils.toBean(list, DeviceLedgerRespVO.class);
}
}

@ -0,0 +1,55 @@
package cn.iocoder.yudao.module.mes.service.moldoperate;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.mes.controller.admin.moldoperate.vo.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.moldoperate.MoldOperateDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* Service
*
* @author
*/
public interface MoldOperateService {
/**
*
*
* @param createReqVO
* @return
*/
Long createMoldOperate(@Valid MoldOperateSaveReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateMoldOperate(@Valid MoldOperateSaveReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteMoldOperate(Long id);
/**
*
*
* @param id
* @return
*/
MoldOperateDO getMoldOperate(Long id);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<MoldOperateDO> getMoldOperatePage(MoldOperatePageReqVO pageReqVO);
}

@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.mes.service.moldoperate;
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.mes.controller.admin.moldoperate.vo.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.moldoperate.MoldOperateDO;
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.mes.dal.mysql.moldoperate.MoldOperateMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class MoldOperateServiceImpl implements MoldOperateService {
@Resource
private MoldOperateMapper moldOperateMapper;
@Override
public Long createMoldOperate(MoldOperateSaveReqVO createReqVO) {
// 插入
MoldOperateDO moldOperate = BeanUtils.toBean(createReqVO, MoldOperateDO.class);
moldOperateMapper.insert(moldOperate);
// 返回
return moldOperate.getId();
}
@Override
public void updateMoldOperate(MoldOperateSaveReqVO updateReqVO) {
// 校验存在
validateMoldOperateExists(updateReqVO.getId());
// 更新
MoldOperateDO updateObj = BeanUtils.toBean(updateReqVO, MoldOperateDO.class);
moldOperateMapper.updateById(updateObj);
}
@Override
public void deleteMoldOperate(Long id) {
// 校验存在
validateMoldOperateExists(id);
// 删除
moldOperateMapper.deleteById(id);
}
private void validateMoldOperateExists(Long id) {
if (moldOperateMapper.selectById(id) == null) {
throw exception(MOLD_OPERATE_NOT_EXISTS);
}
}
@Override
public MoldOperateDO getMoldOperate(Long id) {
return moldOperateMapper.selectById(id);
}
@Override
public PageResult<MoldOperateDO> getMoldOperatePage(MoldOperatePageReqVO pageReqVO) {
return moldOperateMapper.selectPage(pageReqVO);
}
}

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.mes.service.moldrepairtems;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.moldrepairtems.MoldRepairTemsDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* Service
*
* @author
*/
public interface MoldRepairTemsService {
/**
*
*
* @param createReqVO
* @return
*/
Long createMoldRepairTems(@Valid MoldRepairTemsSaveReqVO createReqVO);
/**
*
*
* @param updateReqVO
*/
void updateMoldRepairTems(@Valid MoldRepairTemsSaveReqVO updateReqVO);
/**
*
*
* @param id
*/
void deleteMoldRepairTems( List<Long> idList);
/**
*
*
* @param id
* @return
*/
MoldRepairTemsDO getMoldRepairTems(Long id);
/**
*
*
* @param pageReqVO
* @return
*/
PageResult<MoldRepairTemsRespVO> getMoldRepairTemsPage(MoldRepairTemsPageReqVO pageReqVO);
// List<MoldRepairTemsRespVO> getMoldOrComponent(Integer moldBrand);
// List<MoldRepairTemsRespVO> getMoldOrComponentList(Long moldId, Long componentId);
// List<CriticalComponentDO> getComponentList(Long moldId);
}

@ -0,0 +1,160 @@
package cn.iocoder.yudao.module.mes.service.moldrepairtems;
//import cn.iocoder.yudao.module.iot.controller.admin.mold.vo.LineMoldRespVO;
//import cn.iocoder.yudao.module.iot.dal.dataobject.moldmodel.MoldModelDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.mold.MoldBrandDO;
import cn.iocoder.yudao.module.mes.dal.mysql.criticalcomponent.CriticalComponentMapper;
import cn.iocoder.yudao.module.erp.dal.mysql.mold.MoldMapper;
import cn.iocoder.yudao.module.mes.service.moldrepairtems.MoldRepairTemsService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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 java.util.stream.Collectors;
import cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo.*;
import cn.iocoder.yudao.module.mes.dal.dataobject.moldrepairtems.MoldRepairTemsDO;
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.mes.dal.mysql.moldrepairtems.MoldRepairTemsMapper;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.iot.enums.ErrorCodeConstants.DEVICE_MODEL_CODE_EXISTS;
import static cn.iocoder.yudao.module.mes.enums.ErrorCodeConstants.*;
/**
* Service
*
* @author
*/
@Service
@Validated
public class MoldRepairTemsServiceImpl implements MoldRepairTemsService {
@Resource
private MoldRepairTemsMapper moldrepairTemsMapper;
@Resource
private MoldMapper moldMapper;
@Resource
private CriticalComponentMapper criticalComponentMapper;
@Override
public Long createMoldRepairTems(MoldRepairTemsSaveReqVO createReqVO) {
//编码重复判断
Long count = moldrepairTemsMapper.selectCount(new LambdaQueryWrapper<MoldRepairTemsDO>()
.eq(MoldRepairTemsDO::getSubjectCode, createReqVO.getSubjectCode())
);
if (count > 0) {
throw exception(REPAIR_TEMS_CODE_EXISTS);
}
// 插入
MoldRepairTemsDO moldrepairTems = BeanUtils.toBean(createReqVO, MoldRepairTemsDO.class);
moldrepairTemsMapper.insert(moldrepairTems);
// 返回
return moldrepairTems.getId();
}
@Override
public void updateMoldRepairTems(MoldRepairTemsSaveReqVO updateReqVO) {
// 校验存在
validateMoldRepairTemsExists(updateReqVO.getId());
//编码重复判断
Long count = moldrepairTemsMapper.selectCount(new LambdaQueryWrapper<MoldRepairTemsDO>()
.eq(MoldRepairTemsDO::getSubjectCode, updateReqVO.getSubjectCode())
.ne(MoldRepairTemsDO::getId, updateReqVO.getId())
);
if (count > 0) {
throw exception(REPAIR_TEMS_CODE_EXISTS);
}
// 更新
MoldRepairTemsDO updateObj = BeanUtils.toBean(updateReqVO, MoldRepairTemsDO.class);
moldrepairTemsMapper.updateById(updateObj);
}
@Override
public void deleteMoldRepairTems( List<Long> idList) {
for (Long id : idList) {
// 校验存在
validateMoldRepairTemsExists(id);
}
// 删除
moldrepairTemsMapper.deleteByIds(idList);
}
private void validateMoldRepairTemsExists(Long id) {
if (moldrepairTemsMapper.selectById(id) == null) {
throw exception(REPAIR_TEMS_NOT_EXISTS);
}
}
@Override
public MoldRepairTemsDO getMoldRepairTems(Long id) {
return moldrepairTemsMapper.selectById(id);
}
@Override
public PageResult<MoldRepairTemsRespVO> getMoldRepairTemsPage(MoldRepairTemsPageReqVO pageReqVO) {
Page<MoldRepairTemsRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
IPage<MoldRepairTemsRespVO> moldrepairTemsDOIPage = moldrepairTemsMapper.getMoldRepairTemsPage(page,pageReqVO);
PageResult<MoldRepairTemsRespVO> moldrepairTemsDOPageResult = new PageResult<>(moldrepairTemsDOIPage.getRecords(), moldrepairTemsDOIPage.getTotal());
return moldrepairTemsDOPageResult;
}
// @Override
// public List<MoldRepairTemsRespVO> getMoldOrComponent(Integer moldBrand) {
// return moldrepairTemsMapper.getMoldRepairTemsList(new MoldRepairTemsPageReqVO().setMoldBrand(moldBrand));
// }
// @Override
// public List<MoldRepairTemsRespVO> getMoldOrComponentList(Long moldId, Long componentId) {
// return moldrepairTemsMapper.getMoldRepairTemsList(new MoldRepairTemsPageReqVO().setMoldId(moldId).setComponentId(componentId));
// }
// @Override
// public List<CriticalComponentDO> getComponentList(Long moldId) {
//
// MoldDO moldDO = moldMapper.selectById(moldId);
// if(moldDO == null ){
// throw exception(DEVICE_LEDGER_NOT_EXISTS);
// }
//
// if (StringUtils.isBlank(moldDO.getComponentId())){
// return new ArrayList<>();
// }
//
// List<CriticalComponentDO> criticalComponentDOS= new ArrayList<>();
// List<Long> idList = Arrays.stream(moldDO.getComponentId().split(","))
// .map(String::trim) // 去除可能存在的空格
// .map(Long::valueOf)
// .collect(Collectors.toList());
//
// for (Long id : idList) {
// CriticalComponentDO criticalComponentDO = criticalComponentMapper.selectById(id);
// if (criticalComponentDO !=null){
// criticalComponentDOS.add(criticalComponentDO);
// }
// }
//
// return criticalComponentDOS;
// }
}

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.mes.dal.mysql.moldoperate.MoldOperateMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.mes.dal.mysql.moldrepairtems.MoldRepairTemsMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getMoldRepairTemsPage"
resultType="cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo.MoldRepairTemsRespVO">
SELECT
mrt.id,
mrt.subject_code,
mrt.subject_name,
mrt.mold_id,
mrt.is_enable,
mrt.creator,
mrt.create_time,
mrt.updater,
mrt.update_time,
mrt.deleted,
mrt.tenant_id,
mrt.project_content,
mml.name as moldName, <!-- device_name 改为 mold_name别名对应修改 -->
CONCAT('(', su.username, ')', su.nickname) as creatorName
FROM besure.mes_mold_repair_tems mrt
left join besure.erp_mold mml on mml.id = mrt.mold_id <!-- device_ledger 改为 mold_ledger关联字段改为 mold_id -->
left join besure.system_users su on su.id = mrt.creator
WHERE 1=1
AND mrt.deleted = 0
<if test="pageReqVO.subjectCode != null and pageReqVO.subjectCode != ''">
AND mrt.subject_code = #{pageReqVO.subjectCode}
</if>
<if test="pageReqVO.subjectName != null and pageReqVO.subjectName != ''">
AND mrt.subject_name LIKE CONCAT('%', #{pageReqVO.subjectName}, '%')
</if>
<if test="pageReqVO.moldId != null"> <!-- deviceId 改为 moldId -->
AND mrt.mold_id = #{pageReqVO.moldId}
</if>
<if test="pageReqVO.inspectionMethod != null and pageReqVO.inspectionMethod != ''">
AND mrt.inspection_method = #{pageReqVO.inspectionMethod}
</if>
<if test="pageReqVO.valueType != null and pageReqVO.valueType != ''">
AND mrt.value_type = #{pageReqVO.valueType}
</if>
<if test="pageReqVO.judgmentCriteria != null and pageReqVO.judgmentCriteria != ''">
AND mrt.judgment_criteria = #{pageReqVO.judgmentCriteria}
</if>
<if test="pageReqVO.isEnable != null">
AND mrt.is_enable = #{pageReqVO.isEnable}
</if>
<if test="pageReqVO.projectContent != null and pageReqVO.projectContent != ''">
AND mrt.project_content LIKE CONCAT('%', #{pageReqVO.projectContent}, '%')
</if>
<!-- 添加 ids 过滤条件 -->
<if test="pageReqVO.ids != null and pageReqVO.ids != ''">
AND FIND_IN_SET(mrt.id, #{pageReqVO.ids})
</if>
</select>
<select id="getMoldRepairTemsList"
resultType="cn.iocoder.yudao.module.mes.controller.admin.moldrepairtems.vo.MoldRepairTemsRespVO">
SELECT
mrt.id,
mrt.subject_code,
mrt.subject_name,
mrt.mold_id,
mrt.is_enable,
mrt.creator,
mrt.create_time,
mrt.updater,
mrt.update_time,
mrt.deleted,
mrt.tenant_id,
mml.name as moldName, <!-- device_name 改为 mold_name别名对应修改 -->
CONCAT('(', su.username, ')', su.nickname) as creatorName
FROM besure.mes_mold_repair_tems mrt
left join besure.erp_mold mml on mml.id = mrt.mold_id <!-- device_ledger 改为 mold_ledger关联字段改为 mold_id -->
left join besure.system_users su on su.id = mrt.creator
WHERE mrt.deleted = 0
<if test="pageReqVO.subjectCode != null and pageReqVO.subjectCode != ''">
AND mrt.subject_code = #{pageReqVO.subjectCode}
</if>
<if test="pageReqVO.subjectName != null and pageReqVO.subjectName != ''">
AND mrt.subject_name LIKE CONCAT('%', #{pageReqVO.subjectName}, '%')
</if>
<if test="pageReqVO.moldId != null"> <!-- deviceId 改为 moldId -->
AND mrt.mold_id = #{pageReqVO.moldId}
</if>
<if test="pageReqVO.inspectionMethod != null and pageReqVO.inspectionMethod != ''">
AND mrt.inspection_method = #{pageReqVO.inspectionMethod}
</if>
<if test="pageReqVO.valueType != null and pageReqVO.valueType != ''">
AND mrt.value_type = #{pageReqVO.valueType}
</if>
<if test="pageReqVO.judgmentCriteria != null and pageReqVO.judgmentCriteria != ''">
AND mrt.judgment_criteria = #{pageReqVO.judgmentCriteria}
</if>
<if test="pageReqVO.isEnable != null">
AND mrt.is_enable = #{pageReqVO.isEnable}
</if>
<if test="pageReqVO.projectContent != null and pageReqVO.projectContent != ''">
AND mrt.project_content LIKE CONCAT('%', #{pageReqVO.projectContent}, '%')
</if>
<!-- 添加 ids 过滤条件 -->
<if test="pageReqVO.ids != null and pageReqVO.ids != ''">
AND FIND_IN_SET(mrt.id, #{pageReqVO.ids})
</if>
</select>
</mapper>

@ -88,7 +88,7 @@ spring:
# Quartz 配置项,对应 QuartzProperties 配置类
spring:
quartz:
auto-startup: false # 本地开发环境,尽量不要开启 Job
auto-startup: true # 本地开发环境,尽量不要开启 Job
scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName
job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。
wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true

Loading…
Cancel
Save