Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
段飞宇 1 year ago
parent
commit
cda274601a
  1. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java
  2. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/OperDefectServiceImpl.java
  3. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java

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

@ -36,6 +36,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.lang3.math.NumberUtils;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil; 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.support.Kv; import org.springblade.core.tool.support.Kv;
@ -115,7 +116,8 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
throw new ServiceException("保存现象失败!"); throw new ServiceException("保存现象失败!");
} }
// 步骤2.开启缺陷流程 // 步骤2.开启缺陷流程
this.startDefectCheckV2(entity); OperPhenomenonEntity operPhenomenon = this.getOne(Condition.getQueryWrapper(entity));
this.startDefectCheckV2(operPhenomenon);
return entity; return entity;
} }

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

@ -159,10 +159,10 @@ public class OperDefectServiceImpl extends BaseServiceImpl<OperDefectMapper, Ope
queryWrapper.eq(OperDefectEntity::getExistDefectId, defectVO.getExistDefectId()); queryWrapper.eq(OperDefectEntity::getExistDefectId, defectVO.getExistDefectId());
} }
if (Func.isNotEmpty(defectVO.getConclusionTime())) { if (Func.isNotEmpty(defectVO.getConclusionTime())) {
queryWrapper.le(OperDefectEntity::getConclusionTime, defectVO.getConclusionTime()); queryWrapper.ge(OperDefectEntity::getConclusionTime, defectVO.getConclusionTime());
} }
if (Func.isNotEmpty(defectVO.getConclusionEndTime())) { if (Func.isNotEmpty(defectVO.getConclusionEndTime())) {
queryWrapper.ge(OperDefectEntity::getConclusionTime, defectVO.getConclusionEndTime()); queryWrapper.le(OperDefectEntity::getConclusionTime, defectVO.getConclusionEndTime());
} }
if (Func.isNotEmpty(defectVO.getConclusion())) { if (Func.isNotEmpty(defectVO.getConclusion())) {
queryWrapper.like(OperDefectEntity::getConclusion, defectVO.getConclusion()); queryWrapper.like(OperDefectEntity::getConclusion, defectVO.getConclusion());

12
hzims-service/operational/src/main/java/com/hnac/hzims/operational/util/TimeUtils.java

@ -1,6 +1,5 @@
package com.hnac.hzims.operational.util; package com.hnac.hzims.operational.util;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
public class TimeUtils { public class TimeUtils {
@ -17,11 +16,18 @@ public class TimeUtils {
*/ */
public static Long getDifferTime(Date endDate, Date nowDate) { public static Long getDifferTime(Date endDate, Date nowDate) {
// long nd = 1000 * 24 * 60 * 60L; // long nd = 1000 * 24 * 60 * 60L;
// 获得两个时间的毫秒时间差异
// long nh = 1000 * 60 * 60L;
// long diff = endDate.getTime() - nowDate.getTime();
// BigDecimal s=BigDecimal.valueOf(diff).divide(BigDecimal.valueOf(diff)).setScale(0, BigDecimal.ROUND_HALF_UP);
// Long hour=s.longValue();
// return hour;
long nd = 1000 * 24 * 60 * 60L;
long nh = 1000 * 60 * 60L; long nh = 1000 * 60 * 60L;
// 获得两个时间的毫秒时间差异 // 获得两个时间的毫秒时间差异
long diff = endDate.getTime() - nowDate.getTime(); long diff = endDate.getTime() - nowDate.getTime();
BigDecimal s=BigDecimal.valueOf(diff).divide(BigDecimal.valueOf(diff)).setScale(0, BigDecimal.ROUND_HALF_UP); // 计算差多少小时
Long hour=s.longValue(); long hour = diff % nd / nh;
return hour; return hour;
} }

Loading…
Cancel
Save