Commit e0dcc9ed authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register_to_0715' of…

Merge branch 'develop_tzs_register_to_0715' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register_to_0715 # Conflicts: # amos-boot-system-tzs/amos-boot-module-statistics/amos-boot-module-statistics-biz/src/main/java/com/yeejoin/amos/boot/module/statistcs/biz/service/impl/DPSubServiceImpl.java
parents 661d1d11 6ff47bb4
......@@ -166,6 +166,9 @@ public class JgReformNoticeDto extends BaseDto {
@ApiModelProperty(value = "设备类别名称")
private String equCategoryName;
@ApiModelProperty(value = "工程装置名称")
private String projectContraption;
/* ---------------- -------------- */
@ApiModelProperty (value = "告知设备列表")
......
......@@ -360,4 +360,10 @@ public class JgMaintainNotice extends BaseEntity {
*/
@TableField("receive_company_org_code")
private String receiveCompanyOrgCode;
/**
* 工程装置
*/
@TableField("project_contraption")
private String projectContraption;
}
......@@ -177,6 +177,12 @@ public class JgReformNotice extends BaseEntity {
private String constructionManagerId;
/**
* 工程装置名称
*/
@TableField("project_contraption")
private String projectContraption;
/**
* 施工负责人手机
*/
@TableField("construction_manager_phone")
......
......@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
......
......@@ -33,7 +33,7 @@ public interface IJgMaintainNoticeService extends IService<JgMaintainNotice> {
* @param noticeDto 维修告知
* @param op 操作类型
*/
JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op);
JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op, ReginParams reginParams);
/**
* 分页查询
......
......@@ -25,6 +25,8 @@
tjtn.create_user_id as createUserId,
tjtn.next_execute_user_ids as nextExecuteUserIds,
tjtn.next_task_id AS nextTaskId,
tjtn.equ_category AS equCategory,
tjtn.equ_list AS equList,
DATE_FORMAT(tjtn.notice_date,'%Y-%m-%d') AS noticeDate,
DATE_FORMAT(tjtn.handle_date,'%Y-%m-%d') AS handleDate,
DATE_FORMAT(tjtn.plan_date,'%Y-%m-%d') AS planDate
......@@ -125,7 +127,7 @@
tjtn.plan_date AS installStartDate,
tjtn.construction_manager AS installLeaderName,
tjtn.construction_manager_phone AS installLeaderPhone,
tjtn.inform_number AS informNumber,
re.inform_number AS informNumber,
re.equ_id as equId,
ri.EQU_CODE AS equRegisterCode,
ri.PRODUCT_NAME AS productName,
......@@ -176,7 +178,6 @@
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
WHERE
tjtn.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
<select id="queryForFlowingEquipList" resultType="com.yeejoin.amos.boot.module.jg.api.dto.CompanyEquipCountDto">
select
......
......@@ -11,7 +11,6 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jdk.nashorn.api.scripting.JSObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
......@@ -70,7 +69,8 @@ public class JgMaintainNoticeController extends BaseController {
Object o1 = ((LinkedHashMap<?, ?>) model.get(TABLE_PAGE_ID)).get("powerOfAttorneyList");
maintainInfo.setConstructionContractList((List<Map<String, Object>>) o);
maintainInfo.setPowerOfAttorneyList((List<Map<String, Object>>) o1);
return ResponseHelper.buildResponse(iJgMaintainNoticeService.updateMaintainNotice(submitType, maintainInfo, op));
ReginParams reginParams = getSelectedOrgInfo();
return ResponseHelper.buildResponse(iJgMaintainNoticeService.updateMaintainNotice(submitType, maintainInfo, op,reginParams));
}
/**
......
......@@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.ImmutableMap;
import com.yeejoin.amos.boot.biz.common.bo.CompanyBo;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.common.api.enums.ReginStepEnum;
......@@ -67,8 +66,8 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static com.yeejoin.amos.boot.module.jg.biz.service.impl.JgUseRegistrationServiceImpl.getAuditPassedDate;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
/**
* 移装变更登记登记服务实现类
......@@ -589,12 +588,10 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
//移装变更详情
JgChangeRegistrationTransfer transfer = this.getById(sequenceNbr);
//查询设备详情
//String equipId = jgChangeRegistrationTransferEqMapper.getEquipIdByEquipTransferId(sequenceNbr);
JgRegistrationHistory historyData = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, transfer.getApplyNo()));
if (ValidationUtil.equals(FlowStatusEnum.TO_BE_FINISHED.getName(), transfer.getStatus())) {
// 执行完成时查询历史表
JgRegistrationHistory historyData = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, transfer.getApplyNo()));
if (!ValidationUtil.isEmpty(historyData)) {
Map<String, Object> newPosition = JSON.parseObject(historyData.getChangeData(), Map.class);
resultDataMap.putAll(newPosition);
......@@ -606,15 +603,17 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
}
} else {
// 非执行完成状态显示最新设备信息
//Map<String, Object> equipDetailMap = idxBizJgRegisterInfoService.getDetailFieldCamelCaseByRecord(equipId);
//resultDataMap.putAll(equipDetailMap);
Map<String, Object> changeData = JSON.parseObject(historyData.getChangeData(), Map.class);
List<String> ids = ((List<?>) changeData.get("registrationList")).stream()
.map(obj -> ((JSONObject) obj).getString("sequenceNbr"))
.collect(Collectors.toList());
List<JgUseRegistrationManage> newRegistrationList = useRegistrationManageService.lambdaQuery()
.in(BaseEntity::getSequenceNbr, ids)
.list();
if (!ValidationUtil.isEmpty(transfer)) {
Map<String, Object> transferToMap = Bean.BeantoMap(transfer);
resultDataMap.putAll(transferToMap);
}
JgRegistrationHistory historyData = jgRegistrationHistoryMapper.selectOne(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, transfer.getApplyNo()));
Map<String, Object> changeData = JSON.parseObject(historyData.getChangeData(), Map.class);
// 省市区街道字段等业务字段
resultDataMap.put("transferProvince", changeData.get("transferProvince"));
resultDataMap.put("transferCity", changeData.get("transferCity"));
......@@ -631,7 +630,7 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
resultDataMap.put("transferUseInfo", changeData.get("transferUseInfo"));
//resultDataMap.put("useInnerCode", equipDetailMap.get("equCode"));
resultDataMap.put("receiveCompanyCode", transfer.getReceiveCompanyCode() + "_" + transfer.getReceiveOrgName());
resultDataMap.put("registrationList", changeData.get("registrationList"));
resultDataMap.put("registrationList", newRegistrationList);
}
String transferSafetyManager = Optional.ofNullable(resultDataMap.get("transferSafetyManager")).orElse("").toString();
if (StringUtil.isNotEmpty(transferSafetyManager)) {
......@@ -955,19 +954,32 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
private void updateUseRegistrationManage(JgChangeRegistrationTransfer transfer, JgRegistrationHistory historyData, String useRegistrationCode, boolean isUpdateRegistrationCode) {
JSONObject historyJson = JSON.parseObject(historyData.getChangeData());
List<Map<String, Object>> registrationList = (List<Map<String, Object>>) historyJson.get("registrationList");
List<String> ids = registrationList.stream().map(v -> JSON.parseObject(v.toString()).getString("sequenceNbr")).collect(Collectors.toList());
List<JgUseRegistrationManage> list = useRegistrationManageService.lambdaQuery().in(BaseEntity::getSequenceNbr, ids).list();
for (JgUseRegistrationManage registrationManage : list) {
List<JgUseRegistrationManage> registrationList = useRegistrationManageService.lambdaQuery()
.in(BaseEntity::getSequenceNbr,
((List<?>) historyJson.get("registrationList")).stream()
.map(obj -> ((JSONObject) obj).getString("sequenceNbr"))
.collect(Collectors.toList())
).list();
registrationList.forEach(registrationManage -> {
registrationManage.setReceiveOrgName(transfer.getReceiveOrgName());
registrationManage.setReceiveCompanyCode(transfer.getReceiveOrgCode());
registrationManage.setAuditPassDate(transfer.getAuditPassDate());
registrationManage.setAuditPassDate(new Date());
registrationManage.setEquUseAddress(transfer.getFullAddress());
if (isUpdateRegistrationCode) {
registrationManage.setUseRegistrationCode(useRegistrationCode);
}
}
useRegistrationManageService.updateBatchById(list);
registrationManage.setCertificateStatus("已登记");
});
List<JSONObject> updatedRegistrationList = registrationList.stream()
.map(registrationManage -> {
JSONObject jsonObject = (JSONObject) JSON.toJSON(registrationManage);
jsonObject.put("auditPassDate", new SimpleDateFormat("yyyy-MM-dd").format(registrationManage.getAuditPassDate()));
return jsonObject;
})
.collect(Collectors.toList());
useRegistrationManageService.updateBatchById(registrationList);
historyJson.put("registrationList", updatedRegistrationList);
historyData.setChangeData(JSONObject.toJSONString(historyJson));
}
/**
......@@ -1368,12 +1380,12 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
/**
* 新增代办任务
*/
private void createToDoTask(List<WorkflowResultDto> sorkflows, JgChangeRegistrationTransfer transfer, String submitType) {
if (!ValidationUtil.isEmpty(sorkflows)) {
private void createToDoTask(List<WorkflowResultDto> workflows, JgChangeRegistrationTransfer transfer, String submitType) {
if (!ValidationUtil.isEmpty(workflows)) {
List<TaskModelDto> toDoTasklist = new ArrayList<>();
for (WorkflowResultDto sorkflow : sorkflows) {
for (WorkflowResultDto workflow : workflows) {
TaskModelDto toDoTask = new TaskModelDto();
toDoTask.setTaskName(sorkflow.getTaskName());
toDoTask.setTaskName(workflow.getTaskName());
toDoTask.setFlowCreateDate(transfer.getCreateDate());
toDoTask.setTaskCode(transfer.getApplyNo());
toDoTask.setTaskContent(this.getSummaryInfo(transfer));
......@@ -1381,13 +1393,13 @@ public class JgChangeRegistrationTransferServiceImpl extends BaseService<JgChang
toDoTask.setTaskType(BusinessTypeEnum.JG_CHANGE_REGISTRATION.getCode());
toDoTask.setTaskTypeLabel(BusinessTypeEnum.JG_CHANGE_REGISTRATION.getName());
toDoTask.setRelationId(transfer.getInstanceId());
toDoTask.setExecuteUserIds(sorkflow.getNextExecutorUserIds());
toDoTask.setExecuteUserIds(workflow.getNextExecutorUserIds());
FlowStatusEnum flowStatusEnum = this.getTaskStatus(submitType);
toDoTask.setTaskStatus(flowStatusEnum.getCode());
toDoTask.setTaskStatusLabel(flowStatusEnum.getName());
toDoTask.setFlowStatus(commonService.getDictionaryCodeByName(transfer.getStatus()));
toDoTask.setFlowStatusLabel(transfer.getStatus());
toDoTask.setFlowCode(sorkflow.getNextTaskId());
toDoTask.setFlowCode(workflow.getNextTaskId());
toDoTask.setStartUserId(transfer.getCreateUserId());
toDoTask.setStartUser(transfer.getCreateUserName());
toDoTask.setStartUserCompanyName(transfer.getCreateUserCompanyName());
......
......@@ -517,7 +517,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
private void checkForRepeatUsedEquip(JSONObject map, CompanyBo company) {
if (!ObjectUtils.isEmpty(map.get("submit"))) {
// 流程中或已完成
EquipUsedCheckStrategyContext.getUsedStrategy("useRegister").equipRepeatUsedCheck(map.get("equipId").toString(), company.getCompanyCode());
EquipUsedCheckStrategyContext.getUsedStrategy(PROCESS_DEFINITION_KEY).equipRepeatUsedCheck(map.get("equipId").toString(), company.getCompanyCode());
}
}
......
......@@ -285,7 +285,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
@Override
@SuppressWarnings({"rawtypes", "Duplicates"})
@Transactional
public JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op) {
public JgMaintainNoticeDto updateMaintainNotice(String submitType, JgMaintainNoticeDto noticeDto, String op, ReginParams reginParams) {
try {
if (Objects.isNull(noticeDto) || StringUtils.isEmpty(submitType)) {
......@@ -293,8 +293,19 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
}
// 字段转换
this.convertField(noticeDto);
// 获取告知设备列表
List<Map<String, Object>> deviceList = noticeDto.getDeviceList();
if (CollectionUtils.isEmpty(deviceList)) {
throw new BadRequest("请选择设备");
}
// 提交时对设备状态进行校验(处理并发问题,一个未被使用的设备同时被多个使用这打开,同时提交发起申请)
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
this.repeatUsedEquipCheck(deviceList, reginParams.getCompany().getCompanyCode());
}
JgMaintainNotice notice = jgMaintainNoticeMapper.selectById(noticeDto.getSequenceNbr());
this.checkRepeatUsed(submitType, notice);
// submitType=1为流程提交否则仅为保存业务数据
if (SUBMIT_TYPE_FLOW.equals(submitType)) {
ProcessTaskDTO processTaskDTO = new ProcessTaskDTO();
......@@ -395,6 +406,20 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
BeanUtils.copyProperties(noticeDto, bean);
jgMaintainNoticeMapper.updateById(bean);
}
LambdaQueryWrapper<JgMaintainNoticeEq> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(JgMaintainNoticeEq::getEquipTransferId, noticeDto.getSequenceNbr());
jgMaintainNoticeEqMapper.delete(lambdaQueryWrapper);
List<JgMaintainNoticeEq> equipList = new ArrayList<>();
deviceList.forEach(obj -> {
JgMaintainNoticeEq jgRelationEquip = new JgMaintainNoticeEq();
jgRelationEquip.setEquId(String.valueOf(obj.get("SEQUENCE_NBR")));
jgRelationEquip.setEquipTransferId(noticeDto.getSequenceNbr().toString());
jgRelationEquip.setEquCode(ObjectUtils.isEmpty(obj.get("EQU_CODE"))?null:String.valueOf(obj.get("EQU_CODE")));
jgRelationEquip.setEquListCode(String.valueOf(obj.get("EQU_LIST_CODE")));
jgRelationEquip.setEquCategoryCode(String.valueOf(obj.get("EQU_CATEGORY_CODE")));
equipList.add(jgRelationEquip);
});
jgMaintainNoticeEqMapper.insertBatchSomeColumn(equipList);
return noticeDto;
} catch (BadRequest | LocalBadRequest e) {
log.error(e.getMessage(), e);
......
......@@ -289,26 +289,24 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if (Objects.isNull(sequenceNbr)) {
throw new IllegalArgumentException("参数不能为空");
}
JgTransferNotice jgTransferNotice = this.getById(sequenceNbr);
List<Map<String, Object>> informationList = jgTransferNoticeMapper.queryEquipInformation(sequenceNbr);
if (Objects.isNull(jgTransferNotice) || CollectionUtils.isEmpty(informationList)) {
JgTransferNotice notice = this.getById(sequenceNbr);
HashMap<String, Object> map = new HashMap<>();
ArrayList<Map<String, Object>> maps = new ArrayList<>();
List<Map<String, Object>> informationList = this.getBaseMapper().queryEquipInformation(notice.getSequenceNbr());
if (CollectionUtils.isEmpty(informationList)) {
throw new IllegalArgumentException("移装告知单不存在");
}
Map<String, Object> placeholders = jgInstallationNoticeService.fullFillTemplateObj(informationList, BusinessTypeEnum.JG_ADVICE_REMOVAL.getName().substring(0, 2));
for (Map<String, Object> objectMap : informationList) {
List<Map<String, Object>> temp = new ArrayList<>();
temp.add(objectMap);
Map<String, Object> placeholders = jgInstallationNoticeService.fullFillTemplateObj(temp, BusinessTypeEnum.JG_ADVICE_REMOVAL.getName().substring(0, 2));
maps.add(placeholders);
}
String tempFileName = "移装告知单_" + System.currentTimeMillis() + "_temp";
// String url = WordTemplateUtils.templateToPdf(tempFileName, "installation-notification-report.ftl", placeholders);
//
// // 更新到数据库
// jgTransferNotice.setNoticeReportUrl(url);
// this.updateById(jgTransferNotice);
WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", placeholders, response);
map.put("equipBasicInfoList", maps);
WordTemplateUtils.templateToPdfDownload(tempFileName, "installation-notification-report.ftl", map, response);
}
/**
* 更新移装告知
*
......@@ -547,7 +545,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
BeanUtils.copyProperties(obj, taskMessageDto);
dto.setModel(taskMessageDto);
//摘要 按原有规则组装
dto.setTaskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", obj.getEquList(), StringUtils.isEmpty(obj.getSupervisoryCode()) ? "" : obj.getSupervisoryCode(), obj.getApplyNo()));
dto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", obj.getEquList(), obj.getApplyNo()));
//申请单号
dto.setTaskCode(obj.getApplyNo());
//业务类型枚举code值
......@@ -640,7 +638,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
taskModelDto.setStartDate(item.getCreateDate());
taskModelDto.setNextExecuteUser(item.getNextExecuteIds());
taskModelDto.setTaskContent(String.format("来自%s【%s】的业务办理,【申请单号:%s】", item.getEquList(), StringUtils.isEmpty(item.getSupervisoryCode()) ? "" : item.getSupervisoryCode(), item.getApplyNo()));
taskModelDto.setTaskContent(String.format("来自%s的业务办理,【申请单号:%s】", item.getEquList(), item.getApplyNo()));
TaskMessageDto taskMessageDto = new TaskMessageDto();
BeanUtils.copyProperties(item, taskMessageDto);
taskModelDto.setModel(taskMessageDto);
......
......@@ -21,7 +21,7 @@ public class UseRegisterEquipUsedCheckImpl extends BaseEquipUsedCheckService {
private RedissonClient redissonClient;
private String bizType = "useRegister";
private String bizType = "useRegistration";
private JgUseRegistrationMapper useRegistrationMapper;
......
......@@ -14,7 +14,17 @@
"useCode": "{useUnitCode}"
}
},
"resultConvert": ""
"resultConvert": "",
"dictionaryFieldKeys": [
{
"fieldKey": "industrySupervisor",
"dictionaryType": "HYZGBM"
},
{
"fieldKey": "registeredOrganCode",
"dictionaryType": "DJJG"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......@@ -35,7 +49,21 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "DEVICE_LEVEL",
"dictionaryType": "GLJB"
},
{
"fieldKey": "FUEL_TYPE",
"dictionaryType": "GLZL"
},
{
"fieldKey": "NAME_OF_PRESSURE_PARTS",
"dictionaryType": "GLBJMC"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......@@ -35,7 +49,25 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "QP_LOSSLESS",
"dictionaryType": "RQJCFF"
},
{
"fieldKey": "RQJCFF",
"dictionaryType": "RQJCFF"
},
{
"fieldKey": "MAIN_STRUCTURE_TYPE",
"dictionaryType": "RQJG"
},
{
"fieldKey": "CHECK_LOSSLESS",
"dictionaryType": "RQJCFF"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......@@ -35,7 +49,21 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "CONTROL_MODE",
"dictionaryType": "KZFS"
},
{
"fieldKey": "EXPLOSIONPROOF_GRADE",
"dictionaryType": "FBDJ"
},
{
"fieldKey": "JACKING_TYPE",
"dictionaryType": "DSXS"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......@@ -35,7 +49,17 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "WORK_LEVEL",
"dictionaryType": "GZJB"
},
{
"fieldKey": "select_bq8h7v9tj1",
"dictionaryType": "FBDJ"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......@@ -35,7 +49,13 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "PROTECT_GRADE",
"dictionaryType": "FBDJ"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......@@ -35,7 +49,13 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "GDLB",
"dictionaryType": "GDLB"
}
]
}
},
{
......
......@@ -17,7 +17,21 @@
"responseSuccess": "data.result.equipInfo"
}
},
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"]
"paramFieldKeys": ["EQU_LIST","EQU_CATEGORY","EQU_DEFINE"],
"dictionaryFieldKeys": [
{
"fieldKey": "IMPORTED",
"dictionaryType": "BOOLEN"
},
{
"fieldKey": "USE_PLACE",
"dictionaryType": "ADDRESS"
},
{
"fieldKey": "INSPECT_CONCLUSION",
"dictionaryType": "JYJL"
}
]
}
},
{
......@@ -35,7 +49,13 @@
"ruleData": {
"responseSuccess": "data.result.equipParams"
}
}
},
"dictionaryFieldKeys": [
{
"fieldKey": "CARRIER_LINE",
"dictionaryType": "YZS"
}
]
}
},
{
......
package com.yeejoin.amos.boot.module.statistcs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.entity.DataDictionary;
import com.yeejoin.amos.boot.biz.common.service.impl.DataDictionaryServiceImpl;
import com.yeejoin.amos.boot.biz.common.utils.JsonValueUtils;
import com.yeejoin.amos.boot.biz.common.utils.RestTemplateUtils;
import com.yeejoin.amos.boot.biz.common.utils.StringUtils;
......@@ -12,7 +15,6 @@ import com.yeejoin.amos.feign.morphic.model.FormSceneModel;
import jdk.nashorn.api.scripting.ScriptObjectMirror;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
......@@ -47,6 +49,9 @@ public class DPSubServiceImpl {
@Autowired
private RestTemplate restTemplate;
@Autowired
DataDictionaryServiceImpl iDataDictionaryService;
public JSONObject commonQuery(String template, @RequestBody Map<String, Object> param) {
JSONObject result = new JSONObject();
String templateJson = DpSubUtils.getFileContent(template + ".json");
......@@ -378,11 +383,25 @@ public class DPSubServiceImpl {
Object value = apiResult.get(fieldKey);
Object paramFieldKeys = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.paramFieldKeys");
Object dictionaryFieldKeys = JsonValueUtils.getValueByKey(tab, "dataConfig", "dataConfig.dictionaryFieldKeys");
JSONObject param = tab.getJSONObject("param");
jsonObject.put("type", "text");
jsonObject.put("value", value);
if (!ValidationUtil.isEmpty(paramFieldKeys) && ((JSONArray) paramFieldKeys).contains(fieldKey)) {
jsonObject.put("value", param.getString(fieldKey));
} else if (!ValidationUtil.isEmpty(dictionaryFieldKeys) && ((JSONArray) dictionaryFieldKeys).stream().anyMatch(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey")))) {
((JSONArray) dictionaryFieldKeys).stream().filter(map -> fieldKey.equals(((JSONObject) map).getString("fieldKey"))).findFirst().ifPresent(y -> {
JSONObject yObj = (JSONObject) y;
String dictionaryType = yObj.getString("dictionaryType");
try {
List<DataDictionary> dataDictionaryList = iDataDictionaryService.getByType(dictionaryType);
dataDictionaryList.stream().filter(dataDictionary -> dataDictionary.getCode().equals(value)).findFirst().ifPresent(map -> {
jsonObject.put("value", map.getName());
});
} catch (Exception e) {
throw new RuntimeException(e);
}
});
} else {
if ("upload".equals(xObj.getString("componentKey"))) {
JSONArray attachmentUploadDatas = matinfo.getJSONArray("datas");
......
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