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. 27
      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 com.hnac.hzims.operational.station.feign.IStationClient;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil; 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.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -40,6 +44,8 @@ import java.util.Map;
public class FdpListTableDataServiceImpl implements IFdpListTableDataService { public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
@Resource @Resource
private IStationClient stationClient; private IStationClient stationClient;
@Resource
private ISysClient sysClient;
@Value("${url.getNeoFaultPropertyList}") @Value("${url.getNeoFaultPropertyList}")
private String getNeoFaultPropertyList; private String getNeoFaultPropertyList;
@Value("${url.getNeoFaultTableData}") @Value("${url.getNeoFaultTableData}")
@ -57,18 +63,20 @@ public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
List<StationEntity> list = new ArrayList<>(); List<StationEntity> list = new ArrayList<>();
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() { 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())) { 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 (String s : res.getData()) {
for (StationEntity station : listAll.getData()) { for (StationEntity station : stationR.getData()) {
if (station.getCode().equals(s)) { if (station.getCode().equals(s)) {
list.add(station); list.add(station);
} }
} }
} }
} }
}
log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms"); log.info("fdp查询站点列表项:耗时:"+(System.currentTimeMillis()-endMillis)+"ms");
return R.data(list); 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(); R r = new R();
try { try {
R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables); R<BladeFlow> result = flowClient.startProcessInstanceContainNameByKey(dictValue, taskId, processName, variables);
r.setSuccess(result.isSuccess());
r.setCode(result.getCode()); r.setCode(result.getCode());
r.setMsg(result.getMsg()); r.setMsg(result.getMsg());
// 更新任务流程Id // 更新任务流程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())) { if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getIsWarehousing()) && 1==(operPhenomenonEntity.getIsWarehousing())) {
OperDefectEntity operDefectEntity = new OperDefectEntity(); OperDefectEntity operDefectEntity = new OperDefectEntity();
BeanUtil.copy(operPhenomenonEntity, operDefectEntity); BeanUtil.copy(operPhenomenonEntity, operDefectEntity);
operDefectEntity.setProcessInstanceId(operPhenomenonEntity.getHandleTaskId().toString()); if (ObjectUtil.isNotEmpty(operPhenomenonEntity.getHandleTaskId())){
operDefectEntity.setHandleTaskId(operPhenomenonEntity.getHandleTaskId());
}
if(ObjectUtil.isNotEmpty(operPhenomenonEntity.getCheckHours())){ if(ObjectUtil.isNotEmpty(operPhenomenonEntity.getCheckHours())){
operDefectEntity.setActHours(operPhenomenonEntity.getCheckHours()); operDefectEntity.setActHours(operPhenomenonEntity.getCheckHours());
} }

27
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)); return this.baseMapper.selectPage(Condition.getPage(query), Condition.getQueryWrapper(innerDangerEntity));
} }
@Transactional(rollbackFor = Exception.class) // @Transactional(rollbackFor = Exception.class)
@Override @Override
public R startHiddenDanger(InnerDangerVo hiddenDangerVo) { public R startHiddenDanger(InnerDangerVo hiddenDangerVo) {
InnerDangerEntity innerDangerEntity = new InnerDangerEntity(); String saved = saveEntity(JSONObject.toJSONString(hiddenDangerVo));
BeanUtil.copy(hiddenDangerVo, innerDangerEntity); R r = this.startProcess(saved, HIDDEN_DANGER_CHECK);
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);
return r; return r;
} }
@Override @Override
@Transactional
public String saveEntity(String entity) { 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())) { if (Func.isEmpty(innerDangerEntity.getCode())) {
innerDangerEntity.setCode(UUID.randomUUID().toString()); innerDangerEntity.setCode(UUID.randomUUID().toString());
} }
@ -114,7 +108,8 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
if (!save) { if (!save) {
throw new ServiceException("隐患保存失败,请稍后重试!"); throw new ServiceException("隐患保存失败,请稍后重试!");
} }
return JSON.toJSONString(innerDangerEntity); BeanUtil.copy(innerDangerEntity, hiddenDangerVo);
return JSON.toJSONString(hiddenDangerVo);
} }
@Override @Override
@ -134,15 +129,15 @@ public class InnerDangerFlowServiceImpl extends ServiceImpl<InnerDangerMapper, I
// 隐患处理名字 // 隐患处理名字
String userName = Optional.ofNullable(AuthUtil.getUserName()).orElse(""); 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); 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()) { if (!result.isSuccess()) {
innerDangerEntity.setIsNormal(false); innerDangerEntity.setIsNormal(false);
innerDangerEntity.setRemark(JSONObject.toJSONString(variable)); innerDangerEntity.setRemark(JSONObject.toJSONString(variable));
this.baseMapper.updateById(innerDangerEntity); this.baseMapper.updateById(innerDangerVo);
log.error("隐患处理流程开启失败,错误描述 : {}", result); log.error("隐患处理流程开启失败,错误描述 : {}", result);
R r=new R(); R r=new R();
r.setCode(result.getCode()); 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` ALTER TABLE `hzims_standard_ticket_info`
ADD COLUMN `em_code` varchar(255) NULL COMMENT '设备编号' , ADD COLUMN `em_code` varchar(255) NULL COMMENT '设备编号' ,
ADD COLUMN `em_name` 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