Commit e68e7c6f authored by 刘林's avatar 刘林

fix(jg):超设计使用年限功能开发

parent a74ad91d
This diff is collapsed.
......@@ -92,4 +92,18 @@ public class JgOverDesignServiceLifeDto extends BaseDto {
@ApiModelProperty(value = "创建时间")
private Date createDate;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "设备品种")
private String equDefine;
@ApiModelProperty(value = "设备代码")
private String equCode;
@ApiModelProperty(value = "使用登记编号")
private String useRegistrationCode;
}
......@@ -44,21 +44,9 @@ public class JgOverDesignServiceLifeEqDto extends BaseDto {
@ApiModelProperty(value = "安全评估报告")
private String safetyAssessmentReport;
@ApiModelProperty(value = "安全评估结果")
@ApiModelProperty(value = "安全措施")
private String safetyAssessmentResult;
@ApiModelProperty(value = "安全评估日期")
private Date safetyAssessmentDate;
@ApiModelProperty(value = "使用登记编号")
private String useRegistrationCode;
@ApiModelProperty(value = "设备种类")
private String equList;
@ApiModelProperty(value = "设备类别")
private String equCategory;
@ApiModelProperty(value = "设备品种")
private String equDefine;
}
......@@ -83,7 +83,7 @@ public class JgOverDesignServiceLifeEq extends BaseEntity {
private String safetyAssessmentReport;
/**
* 安全评估结果
* 安全措施
*/
@TableField("safety_assessment_result")
private String safetyAssessmentResult;
......
......@@ -27,7 +27,7 @@
ovds.promoter,
DATE_FORMAT(ovds.rec_date,'%Y-%m-%d') as recDate,
ovds.instance_id as instanceId,
GROUP_CONCAT(ovdseq.use_registration_code) as useRegistrationCode,
ovds.use_registration_code as useRegistrationCode,
ovds.next_execute_user_ids as nextExecuteUserIds,
ovds.create_user_id as createUserId,
ovds.next_task_id as nextTaskId,
......@@ -77,25 +77,19 @@
<if test="dto.useRegistrationCode != null and dto.useRegistrationCode != ''">
AND ovds.use_registration_code like concat('%',#{dto.useRegistrationCode},'%')
</if>
<if test="dto.supervisoryCode != null and dto.supervisoryCode != ''">
AND oi.SUPERVISORY_CODE like concat('%',#{dto.supervisoryCode},'%')
</if>
<if test="dto.receiveOrgCode != null and dto.receiveOrgCode != ''">
and (ovds.receive_company_code = #{dto.receiveOrgCode} or ovds.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
</if>
<if test="type == 'supervision'">
AND (ovds.receive_company_code = #{dto.unitCode} or ovds.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
AND (ovds.receive_company_code = #{dto.useUnitCreditCode} or ovds.transfer_to_user_ids like concat('%',#{currentUserId},'%'))
AND ovds.instance_id <![CDATA[<>]]> ''
</if>
<if test="type == 'company'">
AND ovds.use_unit_credit_code = #{dto.unitCode}
AND ovds.use_unit_credit_code = #{dto.useUnitCreditCode}
</if>
<if test="dto.applyNo != null and dto.applyNo != ''">
and ovds.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if test="dto.productName != null and dto.productName != ''">
and jri.PRODUCT_NAME like concat('%',#{dto.productName},'%')
</if>
</where>
order by
<if test="sort != null">
......
......@@ -2489,11 +2489,11 @@ public class CommonServiceImpl implements ICommonService {
formData.put("auditPassDate", new SimpleDateFormat("yyyy-MM-dd").format( manage.getAuditPassDate()));
formData.put("receiveCompanyOrgName", manage.getReceiveOrgName());
formData.put("applyNo", manage.getApplyNo());
formData.put("cruDate", DateUtils.convertDateToString(new Date(), DateUtils.CHN_DATE_PATTERN));
formDataList.add(formData);
});
}
}
formData.put("cruDate", DateUtils.convertDateToString(new Date(), DateUtils.CHN_DATE_PATTERN));
formDataList.add(formData);
return formDataList;
}
......
......@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
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.entity.TzsBaseEntity;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -20,12 +21,14 @@ import com.yeejoin.amos.boot.module.jg.api.enums.CompanyTypeEnum;
import com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeEqMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgOverDesignServiceLifeMapper;
import com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper;
import com.yeejoin.amos.boot.module.jg.api.service.IJgOverDesignServiceLifeService;
import com.yeejoin.amos.boot.module.jg.biz.config.LocalBadRequest;
import com.yeejoin.amos.boot.module.jg.biz.context.EquipUsedCheckStrategyContext;
import com.yeejoin.amos.boot.module.jg.biz.context.FlowingEquipRedisContext;
import com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient;
import com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService;
import com.yeejoin.amos.boot.module.jg.biz.service.ICompensateFlowDataOfRedis;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgInspectionDetectionInfo;
import com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo;
......@@ -49,6 +52,8 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -66,11 +71,12 @@ import static java.util.stream.Collectors.toList;
* @date 2025-03-06
*/
@Service
public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesignServiceLife,JgOverDesignServiceLife,JgOverDesignServiceLifeMapper> implements IJgOverDesignServiceLifeService {
public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesignServiceLife,JgOverDesignServiceLife,JgOverDesignServiceLifeMapper> implements IJgOverDesignServiceLifeService, ICompensateFlowDataOfRedis<JgOverDesignServiceLife> {
private static final String DEFINITION_KEY = "overDesignServiceLife";
public static final String SUBMIT_TYPE_FLOW = "1";
public static final String SUBMIT_DATA = "0";
private static final String TABLE_PAGE_ID = "overDesignServiceLife";
private final List<String> NOT_FLOWING_STATE = Arrays.asList("使用单位待提交", "一级受理已驳回", "使用单位已撤回", "已作废");
@Autowired
private CommonServiceImpl commonService;
......@@ -98,6 +104,10 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
private ICmWorkflowService workflowService;
@Autowired
private IdxBizJgDesignInfoServiceImpl idxBizJgDesignInfoServiceImpl;
@Autowired
private JgRegistrationHistoryMapper jgRegistrationHistoryMapper;
@Autowired
private JgUseRegistrationManageServiceImpl useRegistrationManageService;
/**
* 分页查询
......@@ -163,7 +173,7 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
overDesignDto.setPromoter(reginParams.getUserModel().getUserId());
List<String> registrationNoList = equipmentLists.stream()
.map(objectMap -> objectMap.get("useRegistrationCode"))
.map(objectMap -> objectMap.get("USE_ORG_CODE"))
.filter(Objects::nonNull)
.map(Object::toString)
.collect(Collectors.toList());
......@@ -685,4 +695,64 @@ public class JgOverDesignServiceLifeServiceImpl extends BaseService<JgOverDesign
.delDataForCheckEquipRepeatUsed(records, data.getUseUnitCreditCode());
}
}
public Map<String, Object> getDetail(Long sequenceNbr) {
Map<String, Object> resultDataMap = new HashMap<>();
JgOverDesignServiceLife overDesignServiceLife = this.getById(sequenceNbr);
this.doCompensate(overDesignServiceLife);
JSONArray historyData = commonService.queryHistoryDataObj(sequenceNbr);
if (ValidationUtil.equals(FlowStatusEnum.TO_BE_FINISHED.getName(), overDesignServiceLife.getStatus())) {
if (!ValidationUtil.isEmpty(historyData)) {
if (!ValidationUtil.isEmpty(overDesignServiceLife)) {
Map<String, Object> transferToMap = Bean.BeantoMap(overDesignServiceLife);
transferToMap.put("equipmentLists", JSONArray.parseArray(String.valueOf(historyData)));
transferToMap.put("receiveCompanyCode", overDesignServiceLife.getReceiveCompanyCode() + "_" + overDesignServiceLife.getReceiveOrgName());
transferToMap.put("receiveOrgCode", overDesignServiceLife.getReceiveCompanyCode() + "_" + overDesignServiceLife.getReceiveOrgName());
resultDataMap.putAll(transferToMap);
}
}
} else {
if (!ValidationUtil.isEmpty(overDesignServiceLife)) {
List<String> useRegistrationCodes = historyData.stream()
.map(obj -> ((JSONObject) obj).getString("USE_ORG_CODE"))
.collect(Collectors.toList());
List<JgUseRegistrationManage> registrationList = useRegistrationManageService.lambdaQuery()
.in(JgUseRegistrationManage::getUseRegistrationCode, useRegistrationCodes)
.list();
resultDataMap.putAll(Bean.BeantoMap(overDesignServiceLife));
resultDataMap.put("receiveCompanyCode", overDesignServiceLife.getReceiveCompanyCode() + "_" + overDesignServiceLife.getReceiveOrgName());
resultDataMap.put("receiveOrgCode", overDesignServiceLife.getReceiveCompanyCode() + "_" + overDesignServiceLife.getReceiveOrgName());
resultDataMap.put("sequenceNbrs", registrationList.stream()
.map(BaseEntity::getSequenceNbr)
.collect(Collectors.toList()));
resultDataMap.put("equipmentLists", JSONArray.parseArray(String.valueOf(historyData)));
}
}
commonService.convertStringToJsonobject(resultDataMap, new String[]{"otherAccessories"});
return resultDataMap;
}
@Override
public boolean beforeCheck(JgOverDesignServiceLife overDesignServiceLife) {
return overDesignServiceLife.getInstanceId() != null && !overDesignServiceLife.getStatus().equals(FlowStatusEnum.TO_BE_FINISHED.getName()) &&!overDesignServiceLife.getStatus().equals(FlowStatusEnum.TO_BE_DISCARD.getName());
}
@Override
public void compensate(JgOverDesignServiceLife overDesignServiceLife) {
commonService.saveExecuteFlowData2Redis(overDesignServiceLife.getInstanceId(), this.buildInstanceRuntimeData(overDesignServiceLife));
}
@Transactional(rollbackFor = Exception.class)
public Boolean delete(Long sequenceNbr) {
JgOverDesignServiceLife overDesignServiceLife = this.baseMapper.selectById(sequenceNbr);
commonServiceImpl.deleteTaskModel(String.valueOf(sequenceNbr), overDesignServiceLife.getInstanceId());
this.baseMapper.deleteById(sequenceNbr);
jgOverDesignServiceLifeEqService.remove(new LambdaQueryWrapper<JgOverDesignServiceLifeEq>()
.eq(JgOverDesignServiceLifeEq::getOverDesignId, sequenceNbr));
jgRegistrationHistoryService.remove(new LambdaQueryWrapper<JgRegistrationHistory>()
.eq(JgRegistrationHistory::getCurrentDocumentId, sequenceNbr));
return Boolean.TRUE;
}
}
\ No newline at end of file
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