Commit b42b58aa authored by suhuiguang's avatar suhuiguang

fix(大编辑):自测联调修改

1.2级详情增加单位类型区分单位还是监管预留口,前端按照不同登录人类型判断字段的显示隐藏
parent 7cdf15f4
...@@ -64,11 +64,11 @@ public class BizDataChangeController extends BaseController { ...@@ -64,11 +64,11 @@ public class BizDataChangeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/v2/{bizType}/sub-detail") @GetMapping(value = "/v2/{bizType}/sub-detail")
@ApiOperation(value = "编辑二级页面详情查询--通用", httpMethod = "GET") @ApiOperation(value = "编辑二级页面详情查询--通用", httpMethod = "GET")
public ResponseModel<Map<String, ?>> getSubDetailV2(@ApiParam(value = "设备或者装置唯一标识") @RequestParam String bizId, public ResponseModel<Map<String, Object>> getSubDetailV2(@ApiParam(value = "设备或者装置唯一标识") @RequestParam String bizId,
@ApiParam(value = "单据编号,装置时需要") @RequestParam(required = false) String applyNo, @ApiParam(value = "单据编号,装置时需要") @RequestParam(required = false) String applyNo,
@ApiParam(value = "详情类型:设备、装置") @RequestParam DetailType type, @ApiParam(value = "详情类型:设备、装置") @RequestParam DetailType type,
@ApiParam(value = "业务类型") @PathVariable String bizType) { @ApiParam(value = "业务类型") @PathVariable String bizType) {
return ResponseHelper.buildResponse(bizDataChangeService.querySubDetail(applyNo, bizId, bizType, type)); return ResponseHelper.buildResponse(bizDataChangeService.querySubDetail(applyNo, bizId, bizType, type, getSelectedOrgInfo()));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams; ...@@ -6,6 +6,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jg.api.dto.RequestChangeData; import com.yeejoin.amos.boot.module.jg.api.dto.RequestChangeData;
import com.yeejoin.amos.boot.module.jg.biz.context.BizDataHandleStrategyContext; import com.yeejoin.amos.boot.module.jg.biz.context.BizDataHandleStrategyContext;
import com.yeejoin.amos.boot.module.jg.biz.controller.BizDataChangeController; import com.yeejoin.amos.boot.module.jg.biz.controller.BizDataChangeController;
import com.yeejoin.amos.boot.module.jg.biz.edit.decorator.CompanyDecorator;
import com.yeejoin.amos.boot.module.jg.biz.edit.decorator.PlainDecorator;
import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.strategy.IBizDataChangeHandleStrategy; import com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.strategy.IBizDataChangeHandleStrategy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -23,7 +25,7 @@ public class BizDataChangeServiceImpl { ...@@ -23,7 +25,7 @@ public class BizDataChangeServiceImpl {
* @param bizType 业务类型 * @param bizType 业务类型
* @param modelType 处理器类型 * @param modelType 处理器类型
* @param changeData 变化后的数据 * @param changeData 变化后的数据
* @param selectedOrgInfo 登录人信息 * @param selectedOrgInfo 登录人信息
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(String bizId, public void save(String bizId,
...@@ -39,13 +41,16 @@ public class BizDataChangeServiceImpl { ...@@ -39,13 +41,16 @@ public class BizDataChangeServiceImpl {
return handleStrategy.getDetail(applyNo, type, searchParams); return handleStrategy.getDetail(applyNo, type, searchParams);
} }
public Map<String, ?> querySubDetail(String applyNo, String bizId, String bizType, BizDataChangeController.DetailType type) { public Map<String, Object> querySubDetail(String applyNo, String bizId, String bizType, BizDataChangeController.DetailType type, ReginParams selectedOrgInfo) {
IBizDataChangeHandleStrategy handleStrategy = BizDataHandleStrategyContext.getStrategy(bizType); IBizDataChangeHandleStrategy handleStrategy = BizDataHandleStrategyContext.getStrategy(bizType);
return handleStrategy.getSubDetail(applyNo, bizId, type); // 装饰器模式增强结果
CompanyDecorator companyDecorator = new CompanyDecorator(new PlainDecorator<>(), selectedOrgInfo);
return companyDecorator.process(handleStrategy.getSubDetail(applyNo, bizId, type));
} }
public IPage<?> getChangeLogPage(String bizId, String bizType, int current, int size) { public IPage<?> getChangeLogPage(String bizId, String bizType, int current, int size) {
IBizDataChangeHandleStrategy handleStrategy = BizDataHandleStrategyContext.getStrategy(bizType); IBizDataChangeHandleStrategy handleStrategy = BizDataHandleStrategyContext.getStrategy(bizType);
return handleStrategy.getChangeLogs(bizId, current, size); return handleStrategy.getChangeLogs(bizId, current, size);
} }
} }
package com.yeejoin.amos.boot.module.jg.biz.edit.decorator;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.Map;
public class CompanyDecorator extends ResultDecorator<Map<String, Object>> {
private final ReginParams reginParams;
public CompanyDecorator(ResultProcessor<Map<String, Object>> processor, ReginParams reginParams) {
super(processor);
this.reginParams = reginParams;
}
@Override
public Map<String, Object> process(Map<String, Object> stringMap) {
processor.process(stringMap);
if (reginParams.getCompany().getLevel().equals(BaseController.COMPANY_TYPE_COMPANY)) {
stringMap.put("companyType", BaseController.COMPANY_TYPE_COMPANY);
} else {
stringMap.put("companyType", BaseController.COMPANY_TYPE_SUPERVISION);
}
return stringMap;
}
}
package com.yeejoin.amos.boot.module.jg.biz.edit.decorator;
import org.springframework.stereotype.Component;
import java.util.Collections;
import java.util.Map;
@Component
public class PlainDecorator<T> implements ResultProcessor<T>{
@Override
public T process(T t) {
return t;
}
}
package com.yeejoin.amos.boot.module.jg.biz.edit.decorator;
public abstract class ResultDecorator<T> implements ResultProcessor<T> {
protected ResultProcessor<T> processor;
public ResultDecorator(ResultProcessor<T> processor) {
this.processor = processor;
}
}
package com.yeejoin.amos.boot.module.jg.biz.edit.decorator;
public interface ResultProcessor<T> {
T process(T t);
}
...@@ -16,15 +16,11 @@ import java.util.List; ...@@ -16,15 +16,11 @@ import java.util.List;
@EventPublisherMapping @EventPublisherMapping
public class BaseBizDataChangeEvent extends ApplicationEvent { public class BaseBizDataChangeEvent extends ApplicationEvent {
private List<FieldChangeMeta> data; private final List<FieldChangeMeta> data;
private RequestContextModel requestContext; private final RequestContextModel requestContext;
public BaseBizDataChangeEvent(Object source) { private final BizRelationDataDto bizRelationData;
super(source);
}
private BizRelationDataDto bizRelationData;
public BaseBizDataChangeEvent(Object source, BizRelationDataDto bizRelationData, List<FieldChangeMeta> data, RequestContextModel requestContext) { public BaseBizDataChangeEvent(Object source, BizRelationDataDto bizRelationData, List<FieldChangeMeta> data, RequestContextModel requestContext) {
super(source); super(source);
......
...@@ -85,7 +85,7 @@ public abstract class DefaultBizDataChangeHandler<U extends BaseBizDataChangeEve ...@@ -85,7 +85,7 @@ public abstract class DefaultBizDataChangeHandler<U extends BaseBizDataChangeEve
} }
@Override @Override
public Map<String, ?> getSubDetail(String applyNo, String bizId, BizDataChangeController.DetailType type) { public Map<String, Object> getSubDetail(String applyNo, String bizId, BizDataChangeController.DetailType type) {
CommonEquipDataProcessService service = applicationContext.getBean(CommonEquipDataProcessService.class); CommonEquipDataProcessService service = applicationContext.getBean(CommonEquipDataProcessService.class);
switch (type) { switch (type) {
case equip: case equip:
......
...@@ -26,7 +26,7 @@ public interface IBizDataChangeHandleStrategy { ...@@ -26,7 +26,7 @@ public interface IBizDataChangeHandleStrategy {
* @param type 编辑的资源的类型:设备、装置 * @param type 编辑的资源的类型:设备、装置
* @return 变更信息详情 * @return 变更信息详情
*/ */
Map<String, ?> getSubDetail(String applyNo, String bizId, BizDataChangeController.DetailType type); Map<String, Object> getSubDetail(String applyNo, String bizId, BizDataChangeController.DetailType type);
/** /**
* 获取变更信息详情-一级详情 * 获取变更信息详情-一级详情
......
...@@ -707,7 +707,7 @@ public class CommonEquipDataProcessService { ...@@ -707,7 +707,7 @@ public class CommonEquipDataProcessService {
} }
public Map<String, ?> getEquipDetailByRecord(String record) { public Map<String, Object> getEquipDetailByRecord(String record) {
Map<String, Object> re = new HashMap<>(); Map<String, Object> re = new HashMap<>();
IdxBizJgRegisterInfo registerInfo = jgUseRegistrationService.getIdxBizJgRegisterInfoService().getOne(new LambdaQueryWrapper<IdxBizJgRegisterInfo>().eq(IdxBizJgRegisterInfo::getRecord, record)); IdxBizJgRegisterInfo registerInfo = jgUseRegistrationService.getIdxBizJgRegisterInfoService().getOne(new LambdaQueryWrapper<IdxBizJgRegisterInfo>().eq(IdxBizJgRegisterInfo::getRecord, record));
IdxBizJgFactoryInfo factoryInfo = jgFactoryInfoMapper.selectOne(new LambdaQueryWrapper<IdxBizJgFactoryInfo>().eq(IdxBizJgFactoryInfo::getRecord, record)); IdxBizJgFactoryInfo factoryInfo = jgFactoryInfoMapper.selectOne(new LambdaQueryWrapper<IdxBizJgFactoryInfo>().eq(IdxBizJgFactoryInfo::getRecord, record));
...@@ -854,7 +854,7 @@ public class CommonEquipDataProcessService { ...@@ -854,7 +854,7 @@ public class CommonEquipDataProcessService {
return result; return result;
} }
public Map<String, ?> getProjectContraptionBySeq(String projectContraptionId, Set<String> records) { public Map<String, Object> getProjectContraptionBySeq(String projectContraptionId, Set<String> records) {
IdxBizJgProjectContraption projectContraption = idxBizJgProjectContraptionServiceImpl.getById(projectContraptionId); IdxBizJgProjectContraption projectContraption = idxBizJgProjectContraptionServiceImpl.getById(projectContraptionId);
Map<String, Object> re = BeanUtil.beanToMap(projectContraption); Map<String, Object> re = BeanUtil.beanToMap(projectContraption);
this.convertStringToJsonObject(re, IdxBizJgProjectContraptionServiceImpl.getJsonFieldsCamel()); this.convertStringToJsonObject(re, IdxBizJgProjectContraptionServiceImpl.getJsonFieldsCamel());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment