Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
haungxing 4 months ago
parent
commit
2a029ebbbb
  1. 16
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java
  2. 1
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java
  3. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  4. 29
      hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java
  5. 9
      hzims-service/ticket/src/main/resources/db/3.0.0.sql

16
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

@ -14,10 +14,14 @@ import com.hnac.hzims.operational.station.entity.StationEntity;
import com.hnac.hzims.operational.station.feign.IStationClient;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.entity.Dept;
import org.springblade.system.feign.ISysClient;
import org.springblade.system.user.feign.IUserClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -40,6 +44,8 @@ import java.util.Map;
public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
@Resource
private IStationClient stationClient;
@Resource
private ISysClient sysClient;
@Value("${url.getNeoFaultPropertyList}")
private String getNeoFaultPropertyList;
@Value("${url.getNeoFaultTableData}")
@ -57,18 +63,20 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
List<StationEntity> list = new ArrayList<>();
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {
});
StationEntity condition = new StationEntity();
R<List<StationEntity>> stationR = stationClient.list(condition);
if (!stationR.isSuccess()||CollectionUtil.isEmpty(stationR.getData())){
return R.data(list);
}
if (res.isSuccess() && CollectionUtil.isNotEmpty(res.getData())) {
R<List<StationEntity>> listAll = stationClient.getListAll();
if (listAll.isSuccess() && ObjectUtil.isNotEmpty(listAll.getData())) {
for (String s : res.getData()) {
for (StationEntity station : listAll.getData()) {
for (StationEntity station : stationR.getData()) {
if (station.getCode().equals(s)) {
list.add(station);
}
}
}
}
}
log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms");
return R.data(list);
}

1
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java

@ -48,6 +48,7 @@ public abstract class ProcessAbstractService implements ProcessService {
R r = new R();
try {
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
r.setSuccess(result.isSuccess());
r.setCode(result.getCode());
r.setMsg(result.getMsg());
// 更新任务流程Id

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -373,7 +373,9 @@ public class DefectCheckServiceImpl extends ServiceImpl<OperPhenomenonMapper, Op
if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getIsWarehousing()) && 1==(operPhenomenonEntity.getIsWarehousing())) {
OperDefectEntity operDefectEntity = new OperDefectEntity();
BeanUtil.copy(operPhenomenonEntity, operDefectEntity);
operDefectEntity.setProcessInstanceId(operPhenomenonEntity.getHandleTaskId().toString());
if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getHandleTaskId())){
operDefectEntity.setHandleTaskId(operPhenomenonEntity.getHandleTaskId());
}
if(ObjectUtil.isNotEmpty(operPhenomenonEntity.getCheckHours())){
operDefectEntity.setActHours(operPhenomenonEntity.getCheckHours());
}

29
hzims-service/safeproduct/src/main/java/com/hnac/hzims/safeproduct/flow/service/impl/InnerDangerFlowServiceImpl.java

@ -69,24 +69,18 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
return this.baseMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(innerDangerEntity));
}
@Transactional(rollbackFor = Exception.class)
// @Transactional(rollbackFor = Exception.class)
@Override
public R startHiddenDanger(InnerDangerVo hiddenDangerVo) {
InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
BeanUtil.copy(hiddenDangerVo, innerDangerEntity);
saveEntity(JSONObject.toJSONString(innerDangerEntity));
InnerDangerEntity saveEntity = this.getOne(new LambdaQueryWrapper<InnerDangerEntity>() {{
eq(InnerDangerEntity::getCode, innerDangerEntity.getCode());
last("limit 1");
}});
BeanUtil.copy(saveEntity,hiddenDangerVo);
R r = this.startProcess(JSONObject.toJSONString(hiddenDangerVo), HIDDEN_DANGER_CHECK);
String saved = saveEntity(JSONObject.toJSONString(hiddenDangerVo));
R r = this.startProcess(saved, HIDDEN_DANGER_CHECK);
return r;
}
@Override
@Transactional
public String saveEntity(String entity) {
InnerDangerEntity innerDangerEntity= JSONObject.parseObject(entity, InnerDangerEntity.class);
InnerDangerVo hiddenDangerVo= JSONObject.parseObject(entity, InnerDangerVo.class);
InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
BeanUtil.copy(hiddenDangerVo, innerDangerEntity);
if (Func.isEmpty(innerDangerEntity.getCode())) {
innerDangerEntity.setCode(UUID.randomUUID().toString());
}
@ -114,7 +108,8 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
if (!save) {
throw new ServiceException("隐患保存失败,请稍后重试!");
}
return JSON.toJSONString(innerDangerEntity);
BeanUtil.copy(innerDangerEntity, hiddenDangerVo);
return JSON.toJSONString(hiddenDangerVo);
}
@Override
@ -128,21 +123,21 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
}
public R startProcess(String entity, String dictValue) {
InnerDangerVo innerDangerVo = JSONObject.parseObject(entity, InnerDangerVo.class);
InnerDangerVo innerDangerVo= JSONObject.parseObject(entity, InnerDangerVo.class);
InnerDangerEntity innerDangerEntity = new InnerDangerEntity();
BeanUtil.copy(innerDangerVo, innerDangerEntity);
// 隐患处理名字
String userName = Optional.ofNullable(AuthUtil.getUserName()).orElse("");
// 流程名称
String processName = "[" + userName + "] 发起 " + "【风险点:" + innerDangerVo.getRiskPointName() + "】隐患处理流程" + "——>" + innerDangerVo.getHiddenDangerName();
String processName = "[" + userName + "] 发起 " + "【风险点:" + innerDangerVo.getRiskPointName() + "】隐患处理流程" + "——>" + innerDangerEntity.getHiddenDangerName();
// 开启新的隐患处理流程
Map<String, Object> variable = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(innerDangerVo, DateUtil.PATTERN_DATETIME), Map.class);
R<BladeFlow> result = processClient.startProcessInstanceContainNameByKey(HIDDEN_DANGER_CHECK, innerDangerVo.getId().toString(), processName, variable);
R<BladeFlow> result = processClient.startProcessInstanceContainNameByKey(dictValue, innerDangerVo.getId().toString(), processName, variable);
// 流程开启失败
if (!result.isSuccess()) {
innerDangerEntity.setIsNormal(false);
innerDangerEntity.setRemark(JSONObject.toJSONString(variable));
this.baseMapper.updateById(innerDangerEntity);
this.baseMapper.updateById(innerDangerVo);
log.error("隐患处理流程开启失败,错误描述 : {}", result);
R r=new R();
r.setCode(result.getCode());

9
hzims-service/ticket/src/main/resources/db/3.0.0.sql

@ -11,3 +11,12 @@ ALTER TABLE `hzims_work_ticket_info`
ALTER TABLE `hzims_standard_ticket_info`
ADD COLUMN `em_code` varchar(255) NULL COMMENT '设备编号' ,
ADD COLUMN `em_name` varchar(255) NULL COMMENT '设备名称' ;
ALTER TABLE `hzims_oper_defect`
MODIFY COLUMN `TICKET_ID` varchar(255) NULL DEFAULT NULL COMMENT '工作票ID';
ALTER TABLE `hzims_oper_defect_statistics`
MODIFY COLUMN `TICKET_ID` varchar(255) NULL DEFAULT '' COMMENT '工作票ID' ;
ALTER TABLE `hzims_oper_appearance`
MODIFY COLUMN `TICKET_ID` varchar(255) NULL DEFAULT NULL COMMENT '工作票ID';

Loading…
Cancel
Save