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) {
LinkedHashMap var2 = new LinkedHashMap();
var2.put("requestName", "用印-" + billNo);
var2.put("requestName", "公司用印申请(新版)-" + billNo);
var2.put("workflowId", workflowId);
var2.put("mainData", this.buildSealMainData(payload));
return var2;

View File

@@ -106,8 +106,8 @@ public class DeviceConfigBusinessRuleController extends AbstractFileUploadContro
@GetMapping("/page")
@Operation(summary = "获得设备-业务配置分页")
public CommonResult<PageResult<DeviceConfigBusinessRuleRespVO>> getDeviceConfigBusinessRulePage(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO) {
PageResult<DeviceConfigBusinessRuleDO> pageResult = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO);
return success(BeanUtils.toBean(pageResult, DeviceConfigBusinessRuleRespVO.class));
PageResult<DeviceConfigBusinessRuleRespVO> pageResult = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO);
return success(pageResult);
}
@GetMapping("/export-excel")
@@ -116,9 +116,9 @@ public class DeviceConfigBusinessRuleController extends AbstractFileUploadContro
@ApiAccessLog(operateType = EXPORT)
public void exportDeviceConfigBusinessRuleExcel(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO, HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<DeviceConfigBusinessRuleDO> list = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO).getList();
List<DeviceConfigBusinessRuleRespVO> list = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO).getList();
// 导出 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<DeviceConfigBusinessRuleDO> ruleList = deviceConfigBusinessRuleService.getByProductIdListAndBusinessDomain(productIdList, "");
DeviceConfigBusinessRulePageReqVO reqVO = new DeviceConfigBusinessRulePageReqVO();
reqVO.setProductIdList(productIdList);
reqVO.setPageNo(1);
reqVO.setPageSize(-1);
List<DeviceConfigBusinessRuleRespVO> ruleList = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(reqVO).getList();
for(DeviceProductDO product: list){
Long id = product.getId();
JSONObject jsonObject = jsonArray.getJSONObject(jsonArray.indexOf(product));
for(DeviceConfigBusinessRuleDO rule: ruleList){
for(DeviceConfigBusinessRuleRespVO rule: ruleList){
Long productId = rule.getProductId();
if(!Objects.equals(productId, id))
continue;
String businessDomain = rule.getBusinessDomain();
String key = businessDomain + "_on";
jsonObject.put(key, "1");
jsonObject.put(businessDomain + "_on", "1");
jsonObject.put(businessDomain + "_count", rule.getItemCount());
}
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 org.springframework.format.annotation.DateTimeFormat;
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;
@@ -61,4 +62,9 @@ public class DeviceConfigBusinessRulePageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
//========扩展字段=====
@Schema(description = "设备大类id列表")
List<Long> productIdList;
}

View File

@@ -79,4 +79,9 @@ public class DeviceConfigBusinessRuleRespVO {
@ExcelProperty("创建时间")
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.mybatis.core.query.LambdaQueryWrapperX;
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.DeviceConfigBusinessRuleRespVO;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessItemDO;
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO;
import org.apache.ibatis.annotations.Mapper;
@@ -15,9 +21,13 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DeviceConfigBusinessRuleMapper extends BaseMapperX<DeviceConfigBusinessRuleDO> {
default PageResult<DeviceConfigBusinessRuleDO> selectPage(DeviceConfigBusinessRulePageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceConfigBusinessRuleDO>()
.eqIfPresent(DeviceConfigBusinessRuleDO::getProductId, reqVO.getProductId())
default PageResult<DeviceConfigBusinessRuleRespVO> selectPage(DeviceConfigBusinessRulePageReqVO reqVO) {
MPJLambdaWrapperX<DeviceConfigBusinessRuleDO> wrapper = new MPJLambdaWrapperX<>();
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::getRequireFlag, reqVO.getRequireFlag())
.eqIfPresent(DeviceConfigBusinessRuleDO::getSubitemDomainType, reqVO.getSubitemDomainType())
@@ -32,8 +42,11 @@ public interface DeviceConfigBusinessRuleMapper extends BaseMapperX<DeviceConfig
.eqIfPresent(DeviceConfigBusinessRuleDO::getStandard, reqVO.getStandard())
.eqIfPresent(DeviceConfigBusinessRuleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
.eqIfPresent(DeviceConfigBusinessRuleDO::getRemark, reqVO.getRemark())
.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 分页查询
* @return 设备-业务配置分页
*/
PageResult<DeviceConfigBusinessRuleDO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO);
PageResult<DeviceConfigBusinessRuleRespVO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO);
}

View File

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