fix:设备业务配置接口增加配置标识

This commit is contained in:
FCL
2026-03-27 11:47:20 +08:00
parent eaeba54835
commit c0b670b822
8 changed files with 43 additions and 16 deletions

View File

@@ -276,7 +276,7 @@ public class ReportDocumentAssistService {
private Map<String, Object> buildCreatePayload(String billNo, String workflowId, JSONObject payload) { private Map<String, Object> buildCreatePayload(String billNo, String workflowId, JSONObject payload) {
LinkedHashMap var2 = new LinkedHashMap(); LinkedHashMap var2 = new LinkedHashMap();
var2.put("requestName", "用印-" + billNo); var2.put("requestName", "公司用印申请(新版)-" + billNo);
var2.put("workflowId", workflowId); var2.put("workflowId", workflowId);
var2.put("mainData", this.buildSealMainData(payload)); var2.put("mainData", this.buildSealMainData(payload));
return var2; return var2;

View File

@@ -106,8 +106,8 @@ public class DeviceConfigBusinessRuleController extends AbstractFileUploadContro
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得设备-业务配置分页") @Operation(summary = "获得设备-业务配置分页")
public CommonResult<PageResult<DeviceConfigBusinessRuleRespVO>> getDeviceConfigBusinessRulePage(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO) { public CommonResult<PageResult<DeviceConfigBusinessRuleRespVO>> getDeviceConfigBusinessRulePage(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO) {
PageResult<DeviceConfigBusinessRuleDO> pageResult = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO); PageResult<DeviceConfigBusinessRuleRespVO> pageResult = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, DeviceConfigBusinessRuleRespVO.class)); return success(pageResult);
} }
@GetMapping("/export-excel") @GetMapping("/export-excel")
@@ -116,9 +116,9 @@ public class DeviceConfigBusinessRuleController extends AbstractFileUploadContro
@ApiAccessLog(operateType = EXPORT) @ApiAccessLog(operateType = EXPORT)
public void exportDeviceConfigBusinessRuleExcel(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO, HttpServletResponse response) throws IOException { public void exportDeviceConfigBusinessRuleExcel(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO, HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<DeviceConfigBusinessRuleDO> list = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO).getList(); List<DeviceConfigBusinessRuleRespVO> list = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO).getList();
// 导出 Excel // 导出 Excel
ExcelUtils.write(response, "设备-业务配置.xls", "数据", DeviceConfigBusinessRuleRespVO.class, BeanUtils.toBean(list, DeviceConfigBusinessRuleRespVO.class)); ExcelUtils.write(response, "设备-业务配置.xls", "数据", DeviceConfigBusinessRuleRespVO.class, list);
} }
} }

View File

@@ -94,18 +94,21 @@ public class DeviceProductController extends AbstractFileUploadController implem
} }
List<Long> productIdList = list.stream().filter(item -> item.getNodeType().equals(DataTypeConstant.DATA_TYPE_DATA)).map(DeviceProductDO::getId).toList(); List<Long> productIdList = list.stream().filter(item -> item.getNodeType().equals(DataTypeConstant.DATA_TYPE_DATA)).map(DeviceProductDO::getId).toList();
DeviceConfigBusinessRulePageReqVO reqVO = new DeviceConfigBusinessRulePageReqVO();
List<DeviceConfigBusinessRuleDO> ruleList = deviceConfigBusinessRuleService.getByProductIdListAndBusinessDomain(productIdList, ""); reqVO.setProductIdList(productIdList);
reqVO.setPageNo(1);
reqVO.setPageSize(-1);
List<DeviceConfigBusinessRuleRespVO> ruleList = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(reqVO).getList();
for(DeviceProductDO product: list){ for(DeviceProductDO product: list){
Long id = product.getId(); Long id = product.getId();
JSONObject jsonObject = jsonArray.getJSONObject(jsonArray.indexOf(product)); JSONObject jsonObject = jsonArray.getJSONObject(jsonArray.indexOf(product));
for(DeviceConfigBusinessRuleDO rule: ruleList){ for(DeviceConfigBusinessRuleRespVO rule: ruleList){
Long productId = rule.getProductId(); Long productId = rule.getProductId();
if(!Objects.equals(productId, id)) if(!Objects.equals(productId, id))
continue; continue;
String businessDomain = rule.getBusinessDomain(); String businessDomain = rule.getBusinessDomain();
String key = businessDomain + "_on"; jsonObject.put(businessDomain + "_on", "1");
jsonObject.put(key, "1"); jsonObject.put(businessDomain + "_count", rule.getItemCount());
} }
jsonArray.set(jsonArray.indexOf(product), jsonObject); jsonArray.set(jsonArray.indexOf(product), jsonObject);
} }

View File

@@ -5,6 +5,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.List;
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;
@@ -61,4 +62,9 @@ public class DeviceConfigBusinessRulePageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
//========扩展字段=====
@Schema(description = "设备大类id列表")
List<Long> productIdList;
} }

View File

@@ -79,4 +79,9 @@ public class DeviceConfigBusinessRuleRespVO {
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
//====================扩展字段============
@Schema(description = "配置项数量")
@ExcelProperty("配置项数量")
private Long itemCount;
} }

View File

@@ -3,7 +3,13 @@ package com.zt.plat.module.qms.resource.device.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.reportdoc.controller.vo.ReportDocumentMainRespVO;
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentDataDO;
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRulePageReqVO; import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRulePageReqVO;
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleRespVO;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessItemDO;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO; import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@@ -15,9 +21,13 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface DeviceConfigBusinessRuleMapper extends BaseMapperX<DeviceConfigBusinessRuleDO> { public interface DeviceConfigBusinessRuleMapper extends BaseMapperX<DeviceConfigBusinessRuleDO> {
default PageResult<DeviceConfigBusinessRuleDO> selectPage(DeviceConfigBusinessRulePageReqVO reqVO) { default PageResult<DeviceConfigBusinessRuleRespVO> selectPage(DeviceConfigBusinessRulePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceConfigBusinessRuleDO>() MPJLambdaWrapperX<DeviceConfigBusinessRuleDO> wrapper = new MPJLambdaWrapperX<>();
.eqIfPresent(DeviceConfigBusinessRuleDO::getProductId, reqVO.getProductId()) wrapper.selectAll(DeviceConfigBusinessRuleDO.class);
wrapper.selectSub(DeviceConfigBusinessItemDO.class, s->
s.selectCount(DeviceConfigBusinessItemDO::getRuleId).eq(DeviceConfigBusinessItemDO::getRuleId, DeviceConfigBusinessRuleDO::getId), DeviceConfigBusinessRuleRespVO::getItemCount);
wrapper.eqIfPresent(DeviceConfigBusinessRuleDO::getProductId, reqVO.getProductId())
.inIfPresent(DeviceConfigBusinessRuleDO::getProductId, reqVO.getProductIdList())
.eqIfPresent(DeviceConfigBusinessRuleDO::getBusinessDomain, reqVO.getBusinessDomain()) .eqIfPresent(DeviceConfigBusinessRuleDO::getBusinessDomain, reqVO.getBusinessDomain())
.eqIfPresent(DeviceConfigBusinessRuleDO::getRequireFlag, reqVO.getRequireFlag()) .eqIfPresent(DeviceConfigBusinessRuleDO::getRequireFlag, reqVO.getRequireFlag())
.eqIfPresent(DeviceConfigBusinessRuleDO::getSubitemDomainType, reqVO.getSubitemDomainType()) .eqIfPresent(DeviceConfigBusinessRuleDO::getSubitemDomainType, reqVO.getSubitemDomainType())
@@ -32,8 +42,11 @@ public interface DeviceConfigBusinessRuleMapper extends BaseMapperX<DeviceConfig
.eqIfPresent(DeviceConfigBusinessRuleDO::getStandard, reqVO.getStandard()) .eqIfPresent(DeviceConfigBusinessRuleDO::getStandard, reqVO.getStandard())
.eqIfPresent(DeviceConfigBusinessRuleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode()) .eqIfPresent(DeviceConfigBusinessRuleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(DeviceConfigBusinessRuleDO::getRemark, reqVO.getRemark()) .eqIfPresent(DeviceConfigBusinessRuleDO::getRemark, reqVO.getRemark())
.betweenIfPresent(DeviceConfigBusinessRuleDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(DeviceConfigBusinessRuleDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(DeviceConfigBusinessRuleDO::getId)); .orderByDesc(DeviceConfigBusinessRuleDO::getId);
// return selectPage(reqVO, new LambdaQueryWrapperX<DeviceConfigBusinessRuleDO>()
return selectJoinPage(reqVO, DeviceConfigBusinessRuleRespVO.class, wrapper);
} }
} }

View File

@@ -66,6 +66,6 @@ public interface DeviceConfigBusinessRuleService {
* @param pageReqVO 分页查询 * @param pageReqVO 分页查询
* @return 设备-业务配置分页 * @return 设备-业务配置分页
*/ */
PageResult<DeviceConfigBusinessRuleDO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO); PageResult<DeviceConfigBusinessRuleRespVO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO);
} }

View File

@@ -149,7 +149,7 @@ public class DeviceConfigBusinessRuleServiceImpl implements DeviceConfigBusiness
} }
@Override @Override
public PageResult<DeviceConfigBusinessRuleDO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO) { public PageResult<DeviceConfigBusinessRuleRespVO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO) {
return deviceConfigBusinessRuleMapper.selectPage(pageReqVO); return deviceConfigBusinessRuleMapper.selectPage(pageReqVO);
} }