Merge branch 'test' of https://git.will-way.cn/zgty/zt-qms into test

This commit is contained in:
2025-11-27 18:23:45 +08:00
14 changed files with 259 additions and 44 deletions

View File

@@ -17,7 +17,8 @@ public interface QmsPermissionConstant {
String TARGET_TYPE_CUSTOM = "custom"; String TARGET_TYPE_CUSTOM = "custom";
//======================各业务模块权限常量============================= //======================各业务模块权限常量=============================
//报告发起权限
String REPORT_DOCUMENT_TYPE_START = "report_document_type_start"; String REPORT_DOCUMENT_TYPE_START = "report_document_type_start"; //报告发起权限
String SAMPLE_WAREHOUSE_ADMIN = "sample_warehouse_admin"; //样品库管理员
} }

View File

@@ -1,12 +1,16 @@
package com.zt.plat.module.qms.business.bus.controller.admin; package com.zt.plat.module.qms.business.bus.controller.admin;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchPageReqVO; import com.zt.plat.module.qms.business.bus.controller.vo.*;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchRespVO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO;
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessSampleDispatchSaveReqVO;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO; import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
import com.zt.plat.module.qms.business.bus.service.BusinessSampleDispatchDetailService;
import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService; import com.zt.plat.module.qms.business.bus.service.BusinessSubSampleService;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO;
import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationService;
import com.zt.plat.module.qms.enums.QmsCommonConstant; import com.zt.plat.module.qms.enums.QmsCommonConstant;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -46,7 +50,9 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
@Resource private BusinessSampleDispatchService businessSampleDispatchService; @Resource private BusinessSampleDispatchService businessSampleDispatchService;
@Resource private BusinessSampleDispatchDetailService businessSampleDispatchDetailService;
@Resource private BusinessSubSampleService businessSubSampleService; @Resource private BusinessSubSampleService businessSubSampleService;
@Resource private ConfigWarehouseLocationService configWarehouseLocationService;
@PostMapping("/createTempData") @PostMapping("/createTempData")
@Operation(summary = "创建临时数据") @Operation(summary = "创建临时数据")
@@ -68,7 +74,7 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
@PostMapping("/addOrRemoveSample") @PostMapping("/addOrRemoveSample")
@Operation(summary = "增加或移除样品") @Operation(summary = "增加或移除样品")
public CommonResult<Boolean> addOrRemoveSample(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) { public CommonResult<Boolean> addOrRemoveSample(@Valid @RequestBody BusinessSampleDispatchSaveReqVO updateReqVO) {
businessSampleDispatchService.addOrRemoveSample(updateReqVO); businessSampleDispatchService.addOrRemoveSample(updateReqVO, true);
return success(true); return success(true);
} }
@@ -77,10 +83,26 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
public CommonResult<Boolean> addBySampleReturnCode(@RequestBody JSONObject param) { public CommonResult<Boolean> addBySampleReturnCode(@RequestBody JSONObject param) {
String id = param.getString("id"); String id = param.getString("id");
String sampleReturnCode = param.getString("sampleReturnCode"); String sampleReturnCode = param.getString("sampleReturnCode");
String warehouseCode = param.getString("warehouseCode");
if(ObjectUtils.isEmpty(warehouseCode)){
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "请选择仓库,再扫描样品!");
}
BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleReturnCode(sampleReturnCode); BusinessSubSampleDO businessSubSampleDO = businessSubSampleService.getBySampleReturnCode(sampleReturnCode);
if(businessSubSampleDO == null) if(businessSubSampleDO == null)
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!"); return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到此样品!");
//判断样品状态 //判断样品状态、库位
// String sampleWarehouseCode = businessSubSampleDO.getWarehouseCode(); //todo 判断库位
ConfigWarehouseLocationPageReqVO warehouseReqVO = new ConfigWarehouseLocationPageReqVO();
warehouseReqVO.setId(businessSubSampleDO.getConfigWarehouseLocationInfomationId());
PageResult<ConfigWarehouseLocationRespVO> warehousePage = configWarehouseLocationService.getConfigWarehouseLocationPage(warehouseReqVO);
if(warehousePage.getTotal() == 0){
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "未查询到样品所在仓库,请检查样品码是否正确!");
}
ConfigWarehouseLocationRespVO warehouse = warehousePage.getList().get(0);
if(!warehouseCode.equals(warehouse.getWarehouseCode())){
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "此样品所在仓库为:"+warehouse.getWarehouseName()+",请检查样品码是否正确!");
}
String returnStatus = businessSubSampleDO.getReturnStatus(); String returnStatus = businessSubSampleDO.getReturnStatus();
if(!QmsCommonConstant.COMPLETED.equals(returnStatus)){ if(!QmsCommonConstant.COMPLETED.equals(returnStatus)){
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品状态为:"+returnStatus+",不能调拨!"); return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品状态为:"+returnStatus+",不能调拨!");
@@ -89,14 +111,19 @@ public class BusinessSampleDispatchController implements BusinessControllerMarke
if("1".equals(dispatchStatus)){ if("1".equals(dispatchStatus)){
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!"); return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "样品已被调拨:请归还后再调拨!");
} }
//todo 重复校验 BusinessSampleDispatchDetailPageReqVO reqVO = new BusinessSampleDispatchDetailPageReqVO();
reqVO.setParentId(Long.valueOf(id));
reqVO.setSampleReturnCode(sampleReturnCode);
PageResult<BusinessSampleDispatchDetailExtendRespVO> pageDetailList = businessSampleDispatchDetailService.getBusinessSampleDispatchDetailPage(reqVO);
if(pageDetailList.getTotal() > 0){
return CommonResult.error(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "次样品已添加,请勿重复添加!");
}
List<Long> sampleIds = new ArrayList<>(); List<Long> sampleIds = new ArrayList<>();
sampleIds.add(businessSubSampleDO.getId()); sampleIds.add(businessSubSampleDO.getId());
BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO(); BusinessSampleDispatchSaveReqVO updateReqVO = new BusinessSampleDispatchSaveReqVO();
updateReqVO.setId(Long.valueOf(id)); updateReqVO.setId(Long.valueOf(id));
updateReqVO.setAddSubSampleIds(sampleIds); updateReqVO.setAddSubSampleIds(sampleIds);
businessSampleDispatchService.addOrRemoveSample(updateReqVO); businessSampleDispatchService.addOrRemoveSample(updateReqVO, false);
return success(true); return success(true);
} }

View File

@@ -19,7 +19,7 @@ import com.zt.plat.framework.common.pojo.PageResult;
public interface BusinessSampleDispatchService { public interface BusinessSampleDispatchService {
//增加样品 //增加样品
void addOrRemoveSample(@Valid BusinessSampleDispatchSaveReqVO paramVo); void addOrRemoveSample(@Valid BusinessSampleDispatchSaveReqVO paramVo, boolean updateCancelFlag);
//发起流程 //发起流程
CommonResult<BusinessSampleDispatchRespVO> createProcessInstance(BusinessSampleDispatchSaveReqVO paramVo); CommonResult<BusinessSampleDispatchRespVO> createProcessInstance(BusinessSampleDispatchSaveReqVO paramVo);

View File

@@ -60,7 +60,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void addOrRemoveSample(BusinessSampleDispatchSaveReqVO paramVo) { public void addOrRemoveSample(BusinessSampleDispatchSaveReqVO paramVo, boolean updateCancelFlag) {
Long id = paramVo.getId(); Long id = paramVo.getId();
List<Long> addSubSampleIds = paramVo.getAddSubSampleIds(); List<Long> addSubSampleIds = paramVo.getAddSubSampleIds();
List<Long> removeDetailIds = paramVo.getRemoveDetailIds(); List<Long> removeDetailIds = paramVo.getRemoveDetailIds();
@@ -84,14 +84,13 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
} }
if(!insertList.isEmpty()){ if(!insertList.isEmpty()){
businessSampleDispatchDetailService.insertBatch(insertList); businessSampleDispatchDetailService.insertBatch(insertList);
if("-1".equals(entity.getCancelStatus())){ if(updateCancelFlag && "-1".equals(entity.getCancelStatus())){
//如果有新增,修改临时数据状态 //如果有新增,修改临时数据状态
entity.setCancelStatus("0"); entity.setCancelStatus("0");
businessSampleDispatchMapper.updateById(entity); businessSampleDispatchMapper.updateById(entity);
} }
} }
} }
} }
@Override @Override
@@ -161,6 +160,7 @@ public class BusinessSampleDispatchServiceImpl implements BusinessSampleDispatch
List<BusinessHandoverRecordSubDO> handoverRecordList = new ArrayList<>(); List<BusinessHandoverRecordSubDO> handoverRecordList = new ArrayList<>();
for (BusinessSampleDispatchDetailExtendRespVO detail : detailList) { for (BusinessSampleDispatchDetailExtendRespVO detail : detailList) {
BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO(); BusinessSampleDispatchDetailDO u = new BusinessSampleDispatchDetailDO();
u.setId(detail.getId());
u.setUseStatus("1"); u.setUseStatus("1");
u.setBorrowStatus("1"); u.setBorrowStatus("1");
u.setGivebackStatus("0"); u.setGivebackStatus("0");

View File

@@ -329,7 +329,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Integer execTakeOff(JSONObject reqVo) { public Integer execTakeOff(JSONObject reqVo) {
String actionWay = reqVo.getString("actionWay"); String actionWay = reqVo.getString("actionWay");
String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); String warehouseLocationCode = reqVo.getString("locationCode");
String sampleReturnCode = reqVo.getString("sampleReturnCodes"); String sampleReturnCode = reqVo.getString("sampleReturnCodes");
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
String loginUserName = SecurityFrameworkUtils.getLoginUserNickname(); String loginUserName = SecurityFrameworkUtils.getLoginUserNickname();
@@ -351,7 +351,7 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); ConfigWarehouseLocationDO locationDO = configWarehouseLocationService.getLocationByCode(warehouseLocationCode, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
if(locationDO == null) if(locationDO == null)
throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS); throw exception(CONFIG_WAREHOUSE_LOCATION_NOT_EXISTS);
queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, warehouseLocationCode); queryWrapper.eq(BusinessSubSampleDO::getConfigWarehouseLocationInfomationId, locationDO.getId());
}else{ }else{
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误"); throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "actionWay参数错误");
} }
@@ -418,8 +418,10 @@ public class BusinessSubSampleServiceImpl implements BusinessSubSampleService {
String warehouseLocationCode = reqVo.getString("warehouseLocationCode"); String warehouseLocationCode = reqVo.getString("warehouseLocationCode");
String sampleReturnCode = reqVo.getString("sampleReturnCode"); String sampleReturnCode = reqVo.getString("sampleReturnCode");
if(ObjectUtils.isEmpty(targetLocation)) if(ObjectUtils.isEmpty(targetLocation))
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少目标库位参数!"); throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "缺少“变更后库位参数!");
ConfigWarehouseLocationDO targetLocationDO = configWarehouseLocationService.getLocationByCode(targetLocation, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE); ConfigWarehouseLocationDO targetLocationDO = configWarehouseLocationService.getLocationByCode(targetLocation, QmsWarehouseLocationConstant.WAREHOUSE_TYPE_SAMPLE);
if(targetLocationDO == null)
throw exception0(BUSINESS_SUB_SAMPLE_NOT_EXISTS.getCode(), "“变更后库位”不存在,请检查编码是否正确!");
//查询要操作的样品 //查询要操作的样品
LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BusinessSubSampleDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BusinessSubSampleDO::getSampleFlowNodeKey, QmsCommonConstant.FLOW_SAMPLE_STORAGE); queryWrapper.eq(BusinessSubSampleDO::getSampleFlowNodeKey, QmsCommonConstant.FLOW_SAMPLE_STORAGE);

View File

@@ -1,8 +1,16 @@
package com.zt.plat.module.qms.business.config.controller.admin; package com.zt.plat.module.qms.business.config.controller.admin;
import com.zt.plat.framework.security.core.LoginUser;
import com.zt.plat.framework.security.core.util.SecurityFrameworkUtils;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigPermissionRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationSaveReqVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigPermissionDO;
import com.zt.plat.module.qms.business.config.service.ConfigPermissionService;
import com.zt.plat.module.qms.enums.QmsPermissionConstant;
import com.zt.plat.module.qms.enums.QmsWarehouseLocationConstant;
import com.zt.plat.module.system.api.permission.PermissionApi;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@@ -40,8 +48,16 @@ import com.zt.plat.module.qms.business.config.service.ConfigWarehouseLocationSer
public class ConfigWarehouseLocationController implements BusinessControllerMarker { public class ConfigWarehouseLocationController implements BusinessControllerMarker {
@Resource @Resource private ConfigWarehouseLocationService configWarehouseLocationService;
private ConfigWarehouseLocationService configWarehouseLocationService; @Resource private ConfigPermissionService configPermissionService;
@Resource private PermissionApi permissionApi;
@PostMapping("/save")
@Operation(summary = "创建存放位置")
// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:create')")
public CommonResult<ConfigWarehouseLocationRespVO> save(@Valid @RequestBody ConfigWarehouseLocationSaveReqVO createReqVO) {
return success(configWarehouseLocationService.save(createReqVO));
}
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建存放位置") @Operation(summary = "创建存放位置")
@@ -82,15 +98,35 @@ public class ConfigWarehouseLocationController implements BusinessControllerMark
// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')") // @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')")
public CommonResult<ConfigWarehouseLocationRespVO> getConfigWarehouseLocation(@RequestParam("id") Long id) { public CommonResult<ConfigWarehouseLocationRespVO> getConfigWarehouseLocation(@RequestParam("id") Long id) {
ConfigWarehouseLocationDO configWarehouseLocation = configWarehouseLocationService.getConfigWarehouseLocation(id); ConfigWarehouseLocationDO configWarehouseLocation = configWarehouseLocationService.getConfigWarehouseLocation(id);
return success(BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class)); List<ConfigPermissionDO> permissionList = configPermissionService.getPermissionList(id, QmsPermissionConstant.SAMPLE_WAREHOUSE_ADMIN, "");
List<ConfigPermissionRespVO> permissionRespVOList= BeanUtils.toBean(permissionList, ConfigPermissionRespVO.class);
ConfigWarehouseLocationRespVO vo = BeanUtils.toBean(configWarehouseLocation, ConfigWarehouseLocationRespVO.class);
vo.setPermissionList(permissionRespVOList);
return success(vo);
} }
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得存放位置分页") @Operation(summary = "获得存放位置分页")
// @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')") // @PreAuthorize("@ss.hasPermission('qms:config-warehouse-location:query')")
public CommonResult<PageResult<ConfigWarehouseLocationRespVO>> getConfigWarehouseLocationPage(@Valid ConfigWarehouseLocationPageReqVO pageReqVO) { public CommonResult<PageResult<ConfigWarehouseLocationRespVO>> getConfigWarehouseLocationPage(@Valid ConfigWarehouseLocationPageReqVO pageReqVO) {
PageResult<ConfigWarehouseLocationDO> pageResult = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO); PageResult<ConfigWarehouseLocationRespVO> pageResult = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ConfigWarehouseLocationRespVO.class)); return success(pageResult);
}
@GetMapping("/selectListWithPermission")
@Operation(summary = "安权限查询报告类型")
public CommonResult<List<ConfigWarehouseLocationRespVO>> selectListWithPermission(@Valid ConfigWarehouseLocationPageReqVO pageReqVO) {
pageReqVO.setPermissionFilterFlag("1");
pageReqVO.setSrcPermissionType(QmsPermissionConstant.SAMPLE_WAREHOUSE_ADMIN);
pageReqVO.setDataType(QmsWarehouseLocationConstant.DATA_TYPE_WAREHOUSE);
//查询权限
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Long userId = loginUser.getId();
CommonResult<Set<Long>> roleRet = permissionApi.getUserRoleIdListByUserId(userId);
Set<Long> roleIds = roleRet.getData();
pageReqVO.setRoleIds(roleIds);
List<ConfigWarehouseLocationDO> list = configWarehouseLocationService.selectListWithPermission(pageReqVO);
return success(BeanUtils.toBean(list, ConfigWarehouseLocationRespVO.class));
} }
@GetMapping("/export-excel") @GetMapping("/export-excel")
@@ -100,10 +136,9 @@ public class ConfigWarehouseLocationController implements BusinessControllerMark
public void exportConfigWarehouseLocationExcel(@Valid ConfigWarehouseLocationPageReqVO pageReqVO, public void exportConfigWarehouseLocationExcel(@Valid ConfigWarehouseLocationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ConfigWarehouseLocationDO> list = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO).getList(); List<ConfigWarehouseLocationRespVO> list = configWarehouseLocationService.getConfigWarehouseLocationPage(pageReqVO).getList();
// 导出 Excel // 导出 Excel
ExcelUtils.write(response, "存放位置.xls", "数据", ConfigWarehouseLocationRespVO.class, ExcelUtils.write(response, "存放位置.xls", "数据", ConfigWarehouseLocationRespVO.class, list);
BeanUtils.toBean(list, ConfigWarehouseLocationRespVO.class));
} }
} }

View File

@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.zt.plat.framework.common.pojo.PageParam; import com.zt.plat.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Set;
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@@ -13,6 +14,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
@Data @Data
public class ConfigWarehouseLocationPageReqVO extends PageParam { public class ConfigWarehouseLocationPageReqVO extends PageParam {
@Schema(description = "ID", example = "31498")
private Long id;
@Schema(description = "父ID", example = "31498") @Schema(description = "父ID", example = "31498")
private Long parentId; private Long parentId;
@@ -52,4 +56,14 @@ public class ConfigWarehouseLocationPageReqVO extends PageParam {
@Schema(description = "标签打印模板key") @Schema(description = "标签打印模板key")
private String printTemplate; private String printTemplate;
//===================扩展属性=====================
@Schema(description = "查询时进行权限过滤")
private String permissionFilterFlag;
@Schema(description = "查询用-权限角色")
private Set<Long> roleIds;
@Schema(description = "查询用-源权限类型")
private String srcPermissionType;
} }

View File

@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
import com.alibaba.excel.annotation.*; import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 存放位置 Response VO") @Schema(description = "管理后台 - 存放位置 Response VO")
@@ -66,4 +68,14 @@ public class ConfigWarehouseLocationRespVO {
@Schema(description = "标签打印模板key") @Schema(description = "标签打印模板key")
@ExcelProperty("标签打印模板key") @ExcelProperty("标签打印模板key")
private String printTemplate; private String printTemplate;
//===========扩展字段=======================
@Schema(description = "权限列表")
List<ConfigPermissionRespVO> permissionList;
@Schema(description = "仓库名称")
String warehouseName;
@Schema(description = "仓库编码")
String warehouseCode;
} }

View File

@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*; import lombok.*;
import jakarta.validation.constraints.*; import jakarta.validation.constraints.*;
import java.util.List;
@Schema(description = "管理后台 - 存放位置新增/修改 Request VO") @Schema(description = "管理后台 - 存放位置新增/修改 Request VO")
@Data @Data
public class ConfigWarehouseLocationSaveReqVO { public class ConfigWarehouseLocationSaveReqVO {
@@ -51,4 +53,7 @@ public class ConfigWarehouseLocationSaveReqVO {
@Schema(description = "标签打印模板key") @Schema(description = "标签打印模板key")
private String printTemplate; private String printTemplate;
//===========扩展字段=======================
@Schema(description = "权限列表")
List<ConfigPermissionSaveReqVO> permissionList;
} }

View File

@@ -3,9 +3,16 @@ package com.zt.plat.module.qms.business.config.dal.mapper;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleDispatchDetailDO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO; import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationPageReqVO;
import com.zt.plat.module.qms.business.config.controller.vo.ConfigWarehouseLocationRespVO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO; import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationDO;
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigWarehouseLocationParDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 存放位置 Mapper * 存放位置 Mapper
@@ -15,9 +22,16 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface ConfigWarehouseLocationMapper extends BaseMapperX<ConfigWarehouseLocationDO> { public interface ConfigWarehouseLocationMapper extends BaseMapperX<ConfigWarehouseLocationDO> {
default PageResult<ConfigWarehouseLocationDO> selectPage(ConfigWarehouseLocationPageReqVO reqVO) { default PageResult<ConfigWarehouseLocationRespVO> selectPage(ConfigWarehouseLocationPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigWarehouseLocationDO>()
MPJLambdaWrapperX<ConfigWarehouseLocationDO> wrapper = new MPJLambdaWrapperX<>();
//仓库
wrapper.leftJoin(ConfigWarehouseLocationParDO.class, ConfigWarehouseLocationParDO::getId, ConfigWarehouseLocationDO::getParentId);
wrapper.selectAll(ConfigWarehouseLocationDO.class)
.selectAs(ConfigWarehouseLocationParDO::getName, ConfigWarehouseLocationRespVO::getWarehouseName)
.selectAs(ConfigWarehouseLocationParDO::getCode, ConfigWarehouseLocationRespVO::getWarehouseCode)
.eqIfPresent(ConfigWarehouseLocationDO::getWarehouseType, reqVO.getWarehouseType()) .eqIfPresent(ConfigWarehouseLocationDO::getWarehouseType, reqVO.getWarehouseType())
.eqIfPresent(ConfigWarehouseLocationDO::getId, reqVO.getId())
.eqIfPresent(ConfigWarehouseLocationDO::getParentId, reqVO.getParentId()) .eqIfPresent(ConfigWarehouseLocationDO::getParentId, reqVO.getParentId())
.likeIfPresent(ConfigWarehouseLocationDO::getName, reqVO.getName()) .likeIfPresent(ConfigWarehouseLocationDO::getName, reqVO.getName())
.eqIfPresent(ConfigWarehouseLocationDO::getCode, reqVO.getCode()) .eqIfPresent(ConfigWarehouseLocationDO::getCode, reqVO.getCode())
@@ -29,7 +43,10 @@ public interface ConfigWarehouseLocationMapper extends BaseMapperX<ConfigWarehou
.eqIfPresent(ConfigWarehouseLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(ConfigWarehouseLocationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.betweenIfPresent(ConfigWarehouseLocationDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(ConfigWarehouseLocationDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ConfigWarehouseLocationDO::getRemark, reqVO.getRemark()) .eqIfPresent(ConfigWarehouseLocationDO::getRemark, reqVO.getRemark())
.orderByDesc(ConfigWarehouseLocationDO::getSortNo)); .orderByDesc(ConfigWarehouseLocationDO::getSortNo);
return selectJoinPage(reqVO, ConfigWarehouseLocationRespVO.class, wrapper);
} }
List<ConfigWarehouseLocationDO> selectListWithPermission(@Param("param") ConfigWarehouseLocationPageReqVO param);
} }

Some files were not shown because too many files have changed in this diff Show More