Commit c48e4a92 authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents 8fd5ad3f 4807d548
package com.yeejoin.amos.boot.module.jg.api.enums;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquimentEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
* 施工信息枚举
*
* @author Provence
* @version v1.0
* @date 2023/12/18 11:01
*/
@AllArgsConstructor
@Getter
public enum ConstructionEnum {
INSTALL("安装",6030),
RENOVATION("改造",6031),
REPAIR("修理",6032);
String name;
Integer code;
public static Map<Integer,String> getName=new HashMap<>();
public static Map<String,Integer> getCode=new HashMap<>();
static {
for (ConstructionEnum e : ConstructionEnum.values()){
getName.put(e.code, e.name);
getCode.put(e.name, e.code);
}
}
}
...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.jg.api.enums.ConstructionEnum;
import com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory; import com.yeejoin.amos.boot.module.jg.biz.dao.ESEquipmentCategory;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService;
import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgDesignInfoService; import com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgDesignInfoService;
...@@ -86,6 +87,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -86,6 +87,8 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
//设备信息表单id //设备信息表单id
private static final String EQUIPMENT_INFO_FORM_ID = "1734504628768239617"; private static final String EQUIPMENT_INFO_FORM_ID = "1734504628768239617";
private static final String EQUSTATE = "EQU_STATE"; private static final String EQUSTATE = "EQU_STATE";
private static final String CONSTRUCTIONTYPE = "CONSTRUCTION_TYPE";
/** /**
* levlel=company,是企业,如果不是都是监管单位, * levlel=company,是企业,如果不是都是监管单位,
* * 在接口中查询当前登录人所属单位是监管单位还是企业。 * * 在接口中查询当前登录人所属单位是监管单位还是企业。
...@@ -400,12 +403,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -400,12 +403,18 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
String code = object.getString("orgCode"); String code = object.getString("orgCode");
String companyCode = object.getString("companyCode").contains("_") ? String companyCode = object.getString("companyCode").contains("_") ?
object.getString("companyCode").split("_")[1] : object.getString("companyCode"); object.getString("companyCode").split("_")[1] : object.getString("companyCode");
String type = object.getString("companyType");
// 根据当前登录用户类型及管辖机构筛选条件添加对应参数 // 根据当前登录用户类型及管辖机构筛选条件添加对应参数
if (!ValidationUtil.isEmpty(level)) { if (!ValidationUtil.isEmpty(level)) {
if (LEVEL.equals(level)) { if (LEVEL.equals(level)) {
//企业 //企业
map.put("USE_UNIT_CREDIT_CODE", companyCode); if(!ValidationUtil.isEmpty(level) && ValidationUtil.equals(type,"使用单位")){
map.put("USE_UNIT_CREDIT_CODE", companyCode);
}else if(!ValidationUtil.isEmpty(level) && ValidationUtil.equals(type,"安装改造维修单位")){
map.put("USC_UNIT_CREDIT_CODE", companyCode);
}
if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) { if (!ObjectUtils.isEmpty(map.getString("ORG_BRANCH_CODE"))) {
BoolQueryBuilder query = QueryBuilders.boolQuery(); BoolQueryBuilder query = QueryBuilders.boolQuery();
String test = QueryParser.escape(map.getString("ORG_BRANCH_CODE")); String test = QueryParser.escape(map.getString("ORG_BRANCH_CODE"));
...@@ -478,6 +487,28 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -478,6 +487,28 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
pBuilder.must(QueryBuilders.matchPhraseQuery("USE_PLACE", "*" + param + "*")); pBuilder.must(QueryBuilders.matchPhraseQuery("USE_PLACE", "*" + param + "*"));
boolMust.must(pBuilder); boolMust.must(pBuilder);
} }
//设备状态
if (!ObjectUtils.isEmpty(map.getString("EQU_STATE"))) {
BoolQueryBuilder esBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape(map.getLong("EQU_STATE").toString());
esBuilder.must(QueryBuilders.matchQuery("EQU_STATE", param));
boolMust.must(esBuilder);
}
//使用单位
if (!ObjectUtils.isEmpty(map.getString("USE_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape(map.getString("USE_UNIT_CREDIT_CODE"));
uuccBuilder.must(QueryBuilders.matchPhraseQuery("USE_UNIT_CREDIT_CODE", param));
boolMust.must(uuccBuilder);
}
//安装改造维修单位
if (!ObjectUtils.isEmpty(map.getString("USC_UNIT_CREDIT_CODE"))) {
BoolQueryBuilder uuccBuilder = QueryBuilders.boolQuery();
String param = QueryParser.escape(map.getString("USC_UNIT_CREDIT_CODE"));
uuccBuilder.must(QueryBuilders.matchPhraseQuery("USC_UNIT_CREDIT_CODE", param));
boolMust.must(uuccBuilder);
}
builder.query(boolMust); builder.query(boolMust);
builder.sort("REC_DATE", SortOrder.DESC); builder.sort("REC_DATE", SortOrder.DESC);
...@@ -493,6 +524,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -493,6 +524,11 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
System.out.println(hit); System.out.println(hit);
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(hit); JSONObject jsonObject = (JSONObject) JSONObject.toJSON(hit);
JSONObject dto2 = jsonObject.getJSONObject("sourceAsMap"); JSONObject dto2 = jsonObject.getJSONObject("sourceAsMap");
if (!ValidationUtil.isEmpty(dto2.get(CONSTRUCTIONTYPE))) {
Integer integer = Integer.valueOf(dto2.get(CONSTRUCTIONTYPE).toString());
String status = ConstructionEnum.getName.get(integer);
dto2.put(CONSTRUCTIONTYPE, status);
}
list.add(dto2); list.add(dto2);
} }
totle = response.getInternalResponse().hits().getTotalHits().value; totle = response.getInternalResponse().hits().getTotalHits().value;
...@@ -522,6 +558,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste ...@@ -522,6 +558,7 @@ public class IdxBizJgRegisterInfoServiceImpl extends BaseService<IdxBizJgRegiste
object.put("level", company.getLevel()); object.put("level", company.getLevel());
object.put("orgCode", company.getOrgCode()); object.put("orgCode", company.getOrgCode());
object.put("companyCode", company.getCompanyCode()); object.put("companyCode", company.getCompanyCode());
object.put("companyType", company.getCompanyType());
objectList.add(object); objectList.add(object);
} }
} }
......
...@@ -67,9 +67,9 @@ import java.text.ParseException; ...@@ -67,9 +67,9 @@ import java.text.ParseException;
@Service @Service
public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationNoticeDto,JgInstallationNotice,JgInstallationNoticeMapper> implements IJgInstallationNoticeService { public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationNoticeDto,JgInstallationNotice,JgInstallationNoticeMapper> implements IJgInstallationNoticeService {
public static final String SUBMIT_TYPE_FLOW = "1"; private static final String SUBMIT_TYPE_FLOW = "1";
public static final String PROCESS_DEFINITION_KEY = "installationNotification"; private static final String PROCESS_DEFINITION_KEY = "installationNotification";
public static final String TABLE_PAGE_ID = "1734141426742095873"; private static final String TABLE_PAGE_ID = "1734141426742095873";
//西安行政区划code //西安行政区划code
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
res.inspection_end_date, res.inspection_result_summary, res.non_conformance, res.rectification, res.remark, res.inspection_end_date, res.inspection_result_summary, res.non_conformance, res.rectification, res.remark,
res.rec_user_id, res.rec_date, res.biz_type,res.equ_category, res.inspection_type, res.inspection_type_name, res.rec_user_id, res.rec_date, res.biz_type,res.equ_category, res.inspection_type, res.inspection_type_name,
res.application_date,use_unit_name, use_unit_credit_code, province_name, city_name, county_name, street_name, res.application_date,use_unit_name, use_unit_credit_code, province_name, city_name, county_name, street_name,
address, equ_code, use_inner_code, equ_list, tec1.name equ_list_name, ibjri.equ_category, tec.name address, equ_code, use_inner_code, ibjri.equ_list, tec1.name equ_list_name, ibjri.equ_category, tec.name
equ_category_name, use_org_code equ_category_name, use_org_code
from tz_jyjc_inspection_result res from tz_jyjc_inspection_result res
left join idx_biz_jg_other_info ibjoi on res.equip_unicode = ibjoi.supervisory_code left join idx_biz_jg_other_info ibjoi on res.equip_unicode = ibjoi.supervisory_code
......
...@@ -223,7 +223,7 @@ public class JyjcInspectionApplicationController extends BaseController { ...@@ -223,7 +223,7 @@ public class JyjcInspectionApplicationController extends BaseController {
* 撤回接口(监督检验、定(首)检、检测)-通用 * 撤回接口(监督检验、定(首)检、检测)-通用
* *
* *
* @param instanceId instanceId * @param sequenceNbr sequenceNbr
* @return {@link } * @return {@link }
* @author yangyang * @author yangyang
* @throws * @throws
...@@ -232,8 +232,8 @@ public class JyjcInspectionApplicationController extends BaseController { ...@@ -232,8 +232,8 @@ public class JyjcInspectionApplicationController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "撤回", notes = "撤回") @ApiOperation(httpMethod = "GET",value = "撤回", notes = "撤回")
@GetMapping(value = "/flow/rollback") @GetMapping(value = "/flow/rollback")
public void doRollbackFlow(@RequestParam("instanceId") String instanceId) { public void doRollbackFlow(@RequestParam("sequenceNbr") String sequenceNbr) {
jyjcInspectionApplicationServiceImpl.doRollback(instanceId); jyjcInspectionApplicationServiceImpl.doRollback(sequenceNbr);
} }
/** /**
* 查询指定设备种类的设备列表 * 查询指定设备种类的设备列表
......
...@@ -237,7 +237,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -237,7 +237,8 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
Long sequenceNbr = (Long) params.get("sequenceNbr"); Long sequenceNbr = (Long) params.get("sequenceNbr");
JyjcInspectionApplicationModel inspectionApplicationModel = this.queryBySeq(sequenceNbr); JyjcInspectionApplicationModel inspectionApplicationModel = this.queryBySeq(sequenceNbr);
List<JyjcInspectionApplicationEquipModel> applicationEquipModels = applicationEquipService.listApplicationEquipByApplicationSeq(sequenceNbr); List<JyjcInspectionApplicationEquipModel> applicationEquipModels = applicationEquipService.listApplicationEquipByApplicationSeq(sequenceNbr);
if (ValidationUtil.isEmpty(applicationEquipModels)) { if (inspectionApplicationModel == null || ValidationUtil.isEmpty(applicationEquipModels)) {
log.warn("JyjcInspectionApplicationModel Not Found!");
return; return;
} }
List<JyjcInspectionResult> resultModels = new ArrayList(applicationEquipModels.size()); List<JyjcInspectionResult> resultModels = new ArrayList(applicationEquipModels.size());
...@@ -249,6 +250,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -249,6 +250,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
resultModel.setApplicationUnitCode(inspectionApplicationModel.getApplicationUnitCode()); resultModel.setApplicationUnitCode(inspectionApplicationModel.getApplicationUnitCode());
resultModel.setResultStatus("未出"); resultModel.setResultStatus("未出");
resultModel.setApplicationDate(inspectionApplicationModel.getApplicationDate()); resultModel.setApplicationDate(inspectionApplicationModel.getApplicationDate());
resultModel.setResultType(inspectionApplicationModel.getResultType());
// 解析设备 // 解析设备
resultModel.setBizType(inspectionApplicationModel.getBizType()); resultModel.setBizType(inspectionApplicationModel.getBizType());
resultModel.setResultNo(codes.get(i)); resultModel.setResultNo(codes.get(i));
...@@ -309,17 +311,23 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec ...@@ -309,17 +311,23 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
/** /**
* 撤回流程办理单 * 撤回流程办理单
*/ */
public void doRollback(String instanceId) { public void doRollback(String sequenceNbr) {
JSONObject jsonObject;
JyjcInspectionApplicationModel inspectionApplicationModel = this.queryBySeq(Long.valueOf(sequenceNbr));
if (inspectionApplicationModel == null) {
log.warn("JyjcInspectionApplicationModel Not Found!sequenceNbr => " + sequenceNbr);
return;
}
try { try {
// 撤回流程 // 撤回流程
FeignClientResult feignClientResult = new FeignClientResult(); jsonObject = workflowHelper.rollBack(inspectionApplicationModel.getProcessInstanceId());
if (ObjectUtils.isEmpty(feignClientResult)) { if (ObjectUtils.isEmpty(jsonObject)) {
} }
updateModelByInstanceId(instanceId, MapBuilder.<String, Object>create().put("status", FlowStatusEnum.REJECTED.getCode() + "").build()); updateModelByInstanceId(inspectionApplicationModel.getProcessInstanceId(), MapBuilder.<String, Object>create().put("status", FlowStatusEnum.REJECTED.getCode() + "").build());
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("撤回工作流错误, => {}", instanceId, e); log.error("撤回工作流错误, => {}", inspectionApplicationModel.getProcessInstanceId(), e);
} }
} }
......
...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl; ...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.jyjc.biz.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
...@@ -18,13 +21,17 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttach ...@@ -18,13 +21,17 @@ import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultAttach
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultParamService;
import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService; import com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcInspectionResultService;
import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils; import com.yeejoin.amos.boot.module.jyjc.biz.utils.JsonUtils;
import com.yeejoin.amos.boot.module.ymt.api.entity.CategoryOtherInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum; import com.yeejoin.amos.boot.module.ymt.api.enums.EquipmentClassifityEnum;
import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.CategoryOtherInfoMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper; import com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper;
import com.yeejoin.amos.boot.module.ymt.api.mapper.InspectionDetectionInfoMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext; import org.typroject.tyboot.core.foundation.context.RequestContext;
...@@ -43,6 +50,9 @@ import java.util.stream.Collectors; ...@@ -43,6 +50,9 @@ import java.util.stream.Collectors;
@Service @Service
public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel, JyjcInspectionResult, JyjcInspectionResultMapper> implements IJyjcInspectionResultService { public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionResultModel, JyjcInspectionResult, JyjcInspectionResultMapper> implements IJyjcInspectionResultService {
private static final String JYJC_SUBMIT_FILE_PREFIX = "JYJC_";
private static final String JYJC_SUBMIT_KEY = "inspectResult";
@Autowired @Autowired
private IJyjcInspectionResultAttachmentService iJyjcInspectionResultAttachmentService; private IJyjcInspectionResultAttachmentService iJyjcInspectionResultAttachmentService;
...@@ -68,8 +78,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -68,8 +78,12 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
@Autowired @Autowired
CategoryOtherInfoMapper categoryOtherInfoMapper; CategoryOtherInfoMapper categoryOtherInfoMapper;
// @Autowired @Autowired
// InspectionDetectionInfoServiceImpl inspectionDetectionInfoService; InspectionDetectionInfoMapper inspectionDetectionInfoMapper;
@Autowired
private Sequence sequence;
/** /**
* 检验检测单位分页查询 * 检验检测单位分页查询
*/ */
...@@ -97,63 +111,97 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -97,63 +111,97 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
} }
@Transactional(rollbackFor = Exception.class)
public JyjcInspectionResultModel updateJyjcInspectionResult(Map<String, Map<String, Object>> tableModel) { public JyjcInspectionResultModel updateJyjcInspectionResult(Map<String, Map<String, Object>> tableModel) {
Map<String, Object> map = tableModel.get("inspectResult"); Map<String, Object> map = tableModel.get(JYJC_SUBMIT_KEY);
JyjcInspectionResultModel model = BeanUtil.mapToBean(map, JyjcInspectionResultModel.class, true); JyjcInspectionResultModel model = BeanUtil.mapToBean(map, JyjcInspectionResultModel.class, true);
// 更新结果主表
updateWithModel(model); updateWithModel(model);
// 更新附件表
List<JyjcInspectionResultAttachment> attachmentList = new ArrayList<>(); List<JyjcInspectionResultAttachment> attachmentList = new ArrayList<>();
LambdaQueryWrapper<JyjcInspectionResultAttachment> fileWrapper = new LambdaQueryWrapper<>();
Map<String, Object> fileMap = new HashMap<>();
map.forEach((k, v) -> { map.forEach((k, v) -> {
if (k.contains("JYJC_") && !ObjectUtils.isEmpty(map.get(k))) { if (k.contains(JYJC_SUBMIT_FILE_PREFIX) && !ObjectUtils.isEmpty(map.get(k))) {
JyjcInspectionResultAttachment attachment = new JyjcInspectionResultAttachment(); fileWrapper.eq(JyjcInspectionResultAttachment::getAttachmentType, k);
attachment.setResultSeq(model.getSequenceNbr()); fileWrapper.eq(JyjcInspectionResultAttachment::getResultSeq, model.getSequenceNbr());
attachment.setAttachmentUrl(JSON.toJSONString(map.get(k))); fileMap.put(k, map.get(k));
attachment.setAttachmentType(k); }
attachmentList.add(attachment); });
List<JyjcInspectionResultAttachment> fileList = attachmentService.list(fileWrapper);
fileMap.forEach((k, v) -> {
JyjcInspectionResultAttachment attachment = new JyjcInspectionResultAttachment();
attachment.setResultSeq(model.getSequenceNbr());
attachment.setAttachmentUrl(JSON.toJSONString(map.get(k)));
attachment.setAttachmentType(k);
// 新增时需要判断之前有就更新
if (!CollectionUtils.isEmpty(fileList)) {
List<JyjcInspectionResultAttachment> collect = fileList.stream().filter(obj -> k.equals(obj.getAttachmentType())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) {
JyjcInspectionResultAttachment jyjcInspectionResultAttachment = collect.get(0);
attachment.setSequenceNbr(jyjcInspectionResultAttachment.getSequenceNbr());
}
} }
attachmentList.add(attachment);
}); });
if (!CollectionUtils.isEmpty(attachmentList)) { if (!CollectionUtils.isEmpty(attachmentList)) {
attachmentService.saveBatch(attachmentList); attachmentService.saveOrUpdateBatch(attachmentList);
} }
// 更新参数表
if (!CollectionUtils.isEmpty(model.getResultParamModelMap())){ if (!CollectionUtils.isEmpty(model.getResultParamModelMap())){
LambdaQueryWrapper<JyjcInspectionResultParam> paramWrapper = new LambdaQueryWrapper<>();
paramWrapper.eq(JyjcInspectionResultParam::getResultSeq, model.getSequenceNbr());
List<JyjcInspectionResultParam> params = resultParamService.list(paramWrapper);
JyjcInspectionResultParam resultParam = new JyjcInspectionResultParam(); JyjcInspectionResultParam resultParam = new JyjcInspectionResultParam();
resultParam.setResultSeq(model.getSequenceNbr()); resultParam.setResultSeq(model.getSequenceNbr());
resultParam.setParamJson(JSON.toJSONString(model.getResultParamModelMap())); resultParam.setParamJson(JSON.toJSONString(model.getResultParamModelMap()));
resultParamService.save(resultParam); if (!CollectionUtils.isEmpty(params)) {
JyjcInspectionResultParam jyjcInspectionResultParam = params.get(0);
resultParam.setSequenceNbr(jyjcInspectionResultParam.getSequenceNbr());
}
resultParamService.saveOrUpdate(resultParam);
} }
// InspectionDetectionInfo info = new InspectionDetectionInfo(); //插入操作历史记录
// QueryWrapper<InspectionDetectionInfo> wrapper = new QueryWrapper<>(); InspectionDetectionInfo info = new InspectionDetectionInfo();
// wrapper.lambda().eq(InspectionDetectionInfo::getInspectReportNo,model.getResultNo()); QueryWrapper<InspectionDetectionInfo> wrapper = new QueryWrapper<>();
// List<InspectionDetectionInfo> list = inspectionDetectionInfoService.list(wrapper); wrapper.lambda().eq(InspectionDetectionInfo::getInspectReportNo, model.getResultNo());
// if(CollectionUtils.isEmpty(list)){ List<InspectionDetectionInfo> list = inspectionDetectionInfoMapper.selectList(wrapper);
// QueryWrapper<CategoryOtherInfo> queryWrapper = new QueryWrapper<>(); if (CollectionUtils.isEmpty(list)) {
// queryWrapper.lambda().eq(CategoryOtherInfo::getSupervisoryCode,model.getEquipUnicode()); QueryWrapper<CategoryOtherInfo> queryWrapper = new QueryWrapper<>();
// List<CategoryOtherInfo> otherInfos = categoryOtherInfoMapper.selectList(queryWrapper); queryWrapper.lambda().eq(CategoryOtherInfo::getSupervisoryCode, model.getEquipUnicode());
// if(!CollectionUtils.isEmpty(otherInfos)){ List<CategoryOtherInfo> otherInfos = categoryOtherInfoMapper.selectList(queryWrapper);
// info.setRecord(otherInfos.get(0).getRecord()); if (!CollectionUtils.isEmpty(otherInfos)) {
// } info.setRecord(otherInfos.get(0).getRecord());
// }else{ }
// info = list.get(0); extracted(model, info);
// } info.setSequenceNbr(sequence.nextId() + "");
// extracted(model, info); inspectionDetectionInfoMapper.insert(info);
// inspectionDetectionInfoService.save(info); } else {
info = list.get(0);
extracted(model, info);
inspectionDetectionInfoMapper.updateById(info);
}
return model; return model;
} }
// private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info) {
// info.setInspectType(model.getInspectionType()); private void extracted(JyjcInspectionResultModel model, InspectionDetectionInfo info) {
// info.setInspectOrgName(model.getInspectionUnitCode()); info.setInspectType(model.getInspectionType());
//// info.setInspectReport(JSON.toJSONString(model.getResultAttachmentModelList())); info.setInspectOrgName(model.getInspectionUnitCode());
// info.setInspectDate(model.getInspectionDate()); // info.setInspectReport(JSON.toJSONString(model.getResultAttachmentModelList()));
// info.setInspectConclusion(model.getInspectionConclusion()); info.setInspectDate(model.getInspectionDate());
// info.setProblemRemark(model.getNonConformance()); info.setInspectConclusion(model.getInspectionConclusion());
// info.setNextInspectDate(model.getNextInspectionDate()); info.setProblemRemark(model.getNonConformance());
// info.setSequenceCode(model.getEquipUnicode()); info.setNextInspectDate(model.getNextInspectionDate());
// info.setInspectOrgCode(model.getUseUnitCreditCode()); info.setSequenceCode(model.getEquipUnicode());
// info.setInspectReportNo(model.getResultNo()); info.setInspectOrgCode(model.getUseUnitCreditCode());
// } info.setInspectReportNo(model.getResultNo());
}
/** /**
* 列表查询 示例 * 列表查询 示例
*/ */
...@@ -195,7 +243,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR ...@@ -195,7 +243,7 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
} }
} }
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
resultMap.put("inspectResult", map); resultMap.put(JYJC_SUBMIT_KEY, map);
return resultMap; return resultMap;
} }
......
...@@ -99,10 +99,21 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -99,10 +99,21 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
@Transactional(rollbackFor = {Exception.class, BaseException.class}) @Transactional(rollbackFor = {Exception.class, BaseException.class})
public JyjcOpeningApplicationModel saveOrUpdateModel(JyjcOpeningApplicationModel model, Boolean enableStartFlow) { public JyjcOpeningApplicationModel saveOrUpdateModel(JyjcOpeningApplicationModel model, Boolean enableStartFlow) {
boolean isUpdate = false;
String instanceId = null;
try { try {
if (model.getSequenceNbr() != null) {
JyjcOpeningApplication entity = jyjcOpeningApplicationMapper.selectById(model.getSequenceNbr());
if (entity != null) {
instanceId = entity.getWorkflowProstanceId();
isUpdate = true;
}
}
if (enableStartFlow) { if (enableStartFlow) {
// 开启工作流 startProcess if (StringUtils.isBlank(instanceId)) {
String instanceId = startFlow("1"); // 未开启过工作流则进行开启 startProcess
instanceId = startFlow("1");
}
JSONObject dataObject = getTask(instanceId); JSONObject dataObject = getTask(instanceId);
JSONArray executorArray = dataObject.getJSONObject("nodeInfo").getJSONArray("executor"); JSONArray executorArray = dataObject.getJSONObject("nodeInfo").getJSONArray("executor");
if (!ValidationUtil.isEmpty(executorArray)) { if (!ValidationUtil.isEmpty(executorArray)) {
...@@ -113,7 +124,6 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -113,7 +124,6 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
model.setStatusName(FlowStatusEnum.SUBMITTED.getName()); model.setStatusName(FlowStatusEnum.SUBMITTED.getName());
model.setApplyTime(new Date()); model.setApplyTime(new Date());
model.setWorkflowActiveKey(dataObject.getString("taskDefinitionKey")); model.setWorkflowActiveKey(dataObject.getString("taskDefinitionKey"));
// model.setStatus(!ValidationUtil.isEmpty(dataObject) && !ValidationUtil.isEmpty(dataObject.get("status")) ? String.valueOf(dataObject.get("status")) : "");
model.setWorkflowProstanceId(instanceId); model.setWorkflowProstanceId(instanceId);
// 默认自动执行第一步 // 默认自动执行第一步
execueFlow(MapBuilder.<String, Object>create().put("op", "0").put("instanceId", instanceId).put("comments", "").build()); execueFlow(MapBuilder.<String, Object>create().put("op", "0").put("instanceId", instanceId).put("comments", "").build());
...@@ -121,7 +131,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -121,7 +131,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
model.setStatus(FlowStatusEnum.TO_BE_SUBMITTED.getCode() + ""); model.setStatus(FlowStatusEnum.TO_BE_SUBMITTED.getCode() + "");
model.setStatusName(FlowStatusEnum.TO_BE_SUBMITTED.getName()); model.setStatusName(FlowStatusEnum.TO_BE_SUBMITTED.getName());
} }
if (model.getSequenceNbr() == null) { if (!isUpdate) {
CompanyBo companyBo = commonserviceImpl.getReginParamsOfCurrentUser().getCompany(); CompanyBo companyBo = commonserviceImpl.getReginParamsOfCurrentUser().getCompany();
model.setUnitCode(companyBo.getCompanyCode()); model.setUnitCode(companyBo.getCompanyCode());
model.setUnitCodeName(companyBo.getCompanyName()); model.setUnitCodeName(companyBo.getCompanyName());
...@@ -388,7 +398,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp ...@@ -388,7 +398,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
} }
private JSONObject getTask(String instanceId) { private JSONObject getTask(String instanceId) {
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId); AjaxResult ajaxResult = Workflow.taskClient.getTaskNoAuth(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data"))); JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskId = dataObject.getString("id");// 工作流ID String taskId = dataObject.getString("id");// 工作流ID
FeignClientResult<JSONObject> nodeInfo = workflowFeignClient.getNodeInfotoken(RequestContext.getAppKey(), RequestContext.getProduct(), RequestContext.getToken(), taskId); FeignClientResult<JSONObject> nodeInfo = workflowFeignClient.getNodeInfotoken(RequestContext.getAppKey(), RequestContext.getProduct(), RequestContext.getToken(), taskId);
......
...@@ -44,7 +44,7 @@ public class WorkflowHelper { ...@@ -44,7 +44,7 @@ public class WorkflowHelper {
* @date 2023/12/15 16:17 * @date 2023/12/15 16:17
*/ */
public JSONObject getTask(String instanceId) { public JSONObject getTask(String instanceId) {
AjaxResult ajaxResult = Workflow.taskClient.getTask(instanceId); AjaxResult ajaxResult = Workflow.taskClient.getTaskNoAuth(instanceId);
JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data"))); JSONObject dataObject = JSON.parseObject(JSON.toJSONString(ajaxResult.get("data")));
String taskId = dataObject.getString("id");// 工作流ID String taskId = dataObject.getString("id");// 工作流ID
FeignClientResult<JSONObject> nodeInfo = workflowFeignClient.getNodeInfotoken(RequestContext.getAppKey(), RequestContext.getProduct(), RequestContext.getToken(), taskId); FeignClientResult<JSONObject> nodeInfo = workflowFeignClient.getNodeInfotoken(RequestContext.getAppKey(), RequestContext.getProduct(), RequestContext.getToken(), taskId);
...@@ -63,4 +63,8 @@ public class WorkflowHelper { ...@@ -63,4 +63,8 @@ public class WorkflowHelper {
} }
return null; return null;
} }
public JSONObject rollBack(String workflowProstanceId) {
return workflowFeignClient.rollBack(workflowProstanceId);
}
} }
package com.yeejoin.amos.boot.module.ymt.api.dto; package com.yeejoin.amos.boot.module.ymt.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
/** /**
* 安全追溯-检验检测信息表 * 安全追溯-检验检测信息表
...@@ -44,4 +45,13 @@ public class InspectionDetectionInfoModel extends BaseDto { ...@@ -44,4 +45,13 @@ public class InspectionDetectionInfoModel extends BaseDto {
private String sequenceCode; private String sequenceCode;
private String superviseCode; private String superviseCode;
@ApiModelProperty(value = "监管码")
private String record;
@ApiModelProperty(value = "检验机构统一信用代码")
private String inspectOrgCode;
@ApiModelProperty(value = "检验报告编号")
private String inspectReportNo;
} }
...@@ -2,12 +2,12 @@ package com.yeejoin.amos.boot.module.ymt.api.entity; ...@@ -2,12 +2,12 @@ package com.yeejoin.amos.boot.module.ymt.api.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import java.util.Date;
/** /**
* 安全追溯-检验检测信息表 * 安全追溯-检验检测信息表
* *
...@@ -94,5 +94,14 @@ public class InspectionDetectionInfo extends AbstractEquipBaseEntity { ...@@ -94,5 +94,14 @@ public class InspectionDetectionInfo extends AbstractEquipBaseEntity {
@TableField(value ="\"SEQUENCE_CODE\"") @TableField(value ="\"SEQUENCE_CODE\"")
private String sequenceCode; private String sequenceCode;
/**
* 检验机构统一信用代码
*/
@TableField(value ="\"INSPECT_ORG_CODE\"")
private String inspectOrgCode;
/**
* 检验报告编号
*/
@TableField(value ="\"INSPECT_REPORT_NO\"")
private String inspectReportNo;
} }
...@@ -90,7 +90,11 @@ ...@@ -90,7 +90,11 @@
FACTORY_NUM, FACTORY_NUM,
PRODUCE_UNIT_NAME, PRODUCE_UNIT_NAME,
INSPECT_REPORT, INSPECT_REPORT,
NEXT_INSPECT_DATE NEXT_INSPECT_DATE,
CONSTRUCTION_TYPE,
USC_UNIT_CREDIT_CODE,
USC_UNIT_NAME,
USC_DATE
from idx_biz_view_jg_all from idx_biz_view_jg_all
WHERE SEQUENCE_NBR = #{id} WHERE SEQUENCE_NBR = #{id}
</select> </select>
......
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