fix:添加维修单告警等级,修复菜单权限问题,修复点检保养问题,添加点检记录list接口,添加产品分类字段

main
HuangHuiKang 3 weeks ago
parent b4c11c8d29
commit 80f4f07c83

@ -9,5 +9,6 @@ public interface DictTypeConstants {
String AUDIT_STATUS = "erp_audit_status"; // 审核状态
String STOCK_RECORD_BIZ_TYPE = "erp_stock_record_biz_type"; // 库存明细的业务类型
String PRODUCT_CATEGORY_TYPE = "erp_product_category_type"; // 产品分类类型
}

@ -10,7 +10,10 @@ public class ErpProductCategoryListReqVO {
@Schema(description = "分类名称", example = "芋艿")
private String name;
@Schema(description = "分类类型", example = "1")
private Integer type;
@Schema(description = "开启状态", example = "1")
private Integer status;
}
}

@ -2,12 +2,14 @@ package cn.iocoder.yudao.module.erp.controller.admin.product.vo.category;
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 static cn.iocoder.yudao.module.erp.enums.DictTypeConstants.PRODUCT_CATEGORY_TYPE;
import static cn.iocoder.yudao.module.system.enums.DictTypeConstants.COMMON_STATUS;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - ERP 产品分类 Response VO")
@ -35,13 +37,18 @@ public class ErpProductCategoryRespVO {
@ExcelProperty("分类排序")
private Integer sort;
@Schema(description = "分类类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "分类类型", converter = DictConvert.class)
@DictFormat(PRODUCT_CATEGORY_TYPE)
private Integer type;
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty(value = "开启状态", converter = DictConvert.class)
@DictFormat(DictTypeConstants.COMMON_STATUS)
@DictFormat(COMMON_STATUS)
private Integer status;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}
}

@ -29,8 +29,12 @@ public class ErpProductCategorySaveReqVO {
@NotNull(message = "分类排序不能为空")
private Integer sort;
@Schema(description = "分类类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "分类类型不能为空")
private Integer type;
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "开启状态不能为空")
private Integer status;
}
}

@ -20,6 +20,9 @@ public class ErpProductPageReqVO extends PageParam {
@Schema(description = "产品分类编号", example = "11161")
private Long categoryId;
@Schema(description = "产品分类类型", example = "1")
private Integer categoryType;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;

@ -44,6 +44,12 @@ public class ErpProductCategoryDO extends BaseDO {
*
*/
private Integer sort;
/**
*
*
* {@link cn.iocoder.yudao.module.erp.enums.DictTypeConstants#PRODUCT_CATEGORY_TYPE}
*/
private Integer type;
/**
*
*
@ -51,4 +57,4 @@ public class ErpProductCategoryDO extends BaseDO {
*/
private Integer status;
}
}

@ -19,6 +19,7 @@ public interface ErpProductCategoryMapper extends BaseMapperX<ErpProductCategory
default List<ErpProductCategoryDO> selectList(ErpProductCategoryListReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ErpProductCategoryDO>()
.likeIfPresent(ErpProductCategoryDO::getName, reqVO.getName())
.eqIfPresent(ErpProductCategoryDO::getType, reqVO.getType())
.eqIfPresent(ErpProductCategoryDO::getStatus, reqVO.getStatus())
.orderByDesc(ErpProductCategoryDO::getSort)
.orderByDesc(ErpProductCategoryDO::getId));
@ -36,4 +37,4 @@ public interface ErpProductCategoryMapper extends BaseMapperX<ErpProductCategory
return selectCount(ErpProductCategoryDO::getParentId, parentId);
}
}
}

@ -10,12 +10,11 @@ import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ErpProduc
import cn.iocoder.yudao.module.erp.controller.admin.product.vo.product.ProductRelationRespVO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.util.StringUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@ -34,15 +33,27 @@ public interface ErpProductMapper extends BaseMapperX<ErpProductDO> {
}
default PageResult<ErpProductDO> selectPage(ErpProductPageReqVO reqVO) {
List<Long> categoryIds = selectCategoryIdsByType(reqVO.getCategoryType());
return selectPage(reqVO, new LambdaQueryWrapperX<ErpProductDO>()
.likeIfPresent(ErpProductDO::getName, reqVO.getName())
.likeIfPresent(ErpProductDO::getBarCode, resolveCode(reqVO))
.eqIfPresent(ErpProductDO::getCategoryId, reqVO.getCategoryId())
.inIfPresent(ErpProductDO::getCategoryId, categoryIds)
.betweenIfPresent(ErpProductDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(ErpProductDO::getId));
}
default List<Long> selectCategoryIdsByType(Integer categoryType) {
if (categoryType == null) {
return null;
}
return selectCategoryIdListByType(categoryType);
}
@Select("SELECT id FROM erp_product_category WHERE type = #{categoryType}")
List<Long> selectCategoryIdListByType(@Param("categoryType") Integer categoryType);
default List<ErpProductDO> selectList(ErpProductListReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<ErpProductDO>()
.inIfPresent(ErpProductDO::getId, reqVO.getIds())

@ -98,7 +98,7 @@ public class DeviceLedgerSaveReqVO {
private Integer dataCollectionCapacity;
@Schema(description = "出厂日期")
private LocalDateTime outgoingTime;
private LocalDate outgoingTime;
@Schema(description = "序列号")
private String sn;

@ -54,6 +54,9 @@ public class DvRepairPageReqVO extends PageParam {
@Schema(description = "维修结果")
private String repairResult;
@Schema(description = "故障等级 1-一般 2-严重 3-紧急", example = "1")
private Integer faultLevel;
@Schema(description = "维修人员")
private String acceptedBy;
@ -73,4 +76,4 @@ public class DvRepairPageReqVO extends PageParam {
@Schema(description = "ids集合导出用")
private String ids;
}
}

@ -97,6 +97,9 @@ public class DvRepairRespVO {
@Schema(description = "故障描述")
private String faultDescription;
@Schema(description = "故障等级 1-一般 2-严重 3-紧急", example = "1")
private Integer faultLevel;
@Schema(description = "故障图片,多个用逗号分隔")
private String faultImages;

@ -63,6 +63,9 @@ public class DvRepairSaveReqVO {
@Schema(description = "故障描述")
private String faultDescription;
@Schema(description = "故障等级 1-一般 2-严重 3-紧急", example = "1")
private Integer faultLevel;
@Schema(description = "故障图片,多个用逗号分隔")
private String faultImages;

@ -79,6 +79,15 @@ public class TicketResultsController {
return success(BeanUtils.toBean(pageResult, TicketResultsRespVO.class));
}
@GetMapping("/list")
@Operation(summary = "获得工单检验结果分列表")
@PreAuthorize("@ss.hasPermission('mes:ticket-results:query')")
public CommonResult<List<TicketResultsRespVO>> getTicketResultsList(@Valid TicketResultsPageReqVO pageReqVO) {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<TicketResultsDO> list = ticketResultsService.getTicketResultsPage(pageReqVO).getList();
return success(BeanUtils.toBean(list, TicketResultsRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出工单检验结果 Excel")
@PreAuthorize("@ss.hasPermission('mes:ticket-results:export')")
@ -101,4 +110,4 @@ public class TicketResultsController {
return success(true);
}
}
}

@ -214,7 +214,7 @@ public class DeviceLedgerDO extends BaseDO {
/**
*
*/
private LocalDateTime outgoingTime;
private LocalDate outgoingTime;
/**
*

@ -97,6 +97,12 @@ public class DvRepairDO extends BaseDO {
*
*/
private String faultDescription;
/**
*
*
* 1- 2- 3-
*/
private Integer faultLevel;
/**
*
*/

@ -26,6 +26,7 @@ public interface DeviceLedgerMapper extends BaseMapperX<DeviceLedgerDO> {
deviceLedgerDOLambdaQueryWrapperX
.likeIfPresent(DeviceLedgerDO::getDeviceCode, reqVO.getDeviceCode())
.likeIfPresent(DeviceLedgerDO::getDeviceName, reqVO.getDeviceName())
.likeIfPresent(DeviceLedgerDO::getSn, reqVO.getSn())
.eqIfPresent(DeviceLedgerDO::getDeviceStatus, reqVO.getDeviceStatus())
.eqIfPresent(DeviceLedgerDO::getDeviceBrand, reqVO.getDeviceBrand())
.eqIfPresent(DeviceLedgerDO::getDeviceModel, reqVO.getDeviceModel())

@ -1,10 +1,9 @@
package cn.iocoder.yudao.module.mes.dal.mysql.subjectplan;
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.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.mes.dal.dataobject.subjectplan.SubjectPlanDO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.mes.controller.admin.subjectplan.vo.*;
@ -24,12 +23,9 @@ public interface SubjectPlanMapper extends BaseMapperX<SubjectPlanDO> {
.orderByDesc(SubjectPlanDO::getId));
}
/**
*
*
* @param planId ID
*/
@Delete("DELETE FROM besure.mes_subject_plan WHERE plan_id = #{planId}")
void deleteByPlanId(Long planId);
default void deleteByPlanId(Long planId) {
delete(new LambdaQueryWrapperX<SubjectPlanDO>()
.eq(SubjectPlanDO::getPlanId, planId));
}
}
}

@ -141,7 +141,7 @@ public class PermissionServiceImpl implements PermissionService {
allEntries = true) // allEntries 清空所有缓存,主要一次更新涉及到的 menuIds 较多,反倒批量会更快
})
public void assignRoleMenu(Long roleId, Set<Long> menuIds) {
validateMenuClientType(menuIds);
// validateMenuClientType(menuIds);
// 获得角色拥有菜单编号
Set<Long> dbMenuIds = convertSet(roleMenuMapper.selectListByRoleId(roleId), RoleMenuDO::getMenuId);
// 计算新增和删除的菜单编号

Loading…
Cancel
Save