|
@@ -6,6 +6,7 @@ import com.hjy.common.utils.CommomUtils;
|
|
|
import com.hjy.common.utils.PageUtils;
|
|
|
import com.hjy.module.domain.gether.CbGather;
|
|
|
import com.hjy.module.domain.gether.CbGatherFee;
|
|
|
+import com.hjy.module.domain.gether.CbGatherWarning;
|
|
|
import com.hjy.module.domain.norm.CbGive;
|
|
|
import com.hjy.module.domain.norm.CbNorm;
|
|
|
import com.hjy.module.domain.norm.CbNormFee;
|
|
@@ -18,6 +19,7 @@ import com.hjy.module.service.norm.ICbNormFeeService;
|
|
|
import com.hjy.module.service.norm.ICbNormService;
|
|
|
import com.hjy.module.vo.gather.CbGatherFeeVo;
|
|
|
import com.hjy.module.vo.gather.CbGatherVo;
|
|
|
+import com.hjy.module.vo.gather.CbGatherWarningVo;
|
|
|
import com.hjy.module.vo.norm.CbNormFeeVo;
|
|
|
import com.hjy.module.vo.norm.CbNormVo;
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
@@ -124,13 +126,27 @@ public class CbGatherServiceImpl extends ServiceImpl<CbGatherMapper, CbGather> i
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean saveEntity(CbGatherVo entity){
|
|
|
- this.baseMapper.insert(entity);
|
|
|
+ entity.setCollStatus("1");
|
|
|
+ this.baseMapper.updateById(entity);
|
|
|
gatherFeeService.saveBatch(CommomUtils.copyList(entity.getFeeLists(), CbGatherFee.class));
|
|
|
this.checkWraingData(entity); // 校验数据 生成预警信息
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 修改采集数据
|
|
|
+ * @param entity
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public boolean updateEntity(CbGatherVo entity){
|
|
|
+ this.baseMapper.updateById(entity);
|
|
|
+ gatherFeeService.updateBatchById(CommomUtils.copyList(entity.getFeeLists(), CbGatherFee.class));
|
|
|
+ this.checkWraingData(entity); // 校验数据 生成预警信息
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 校验数据 生成预警信息
|
|
|
* @param entity
|
|
|
*/
|
|
@@ -145,7 +161,12 @@ public class CbGatherServiceImpl extends ServiceImpl<CbGatherMapper, CbGather> i
|
|
|
BigDecimal msDtuValue = msValue.subtract(msValue.multiply(feeVo.getMsRetio())); // 下公差
|
|
|
if (!bjdtodtu(collValue,msDtoValue,msDtuValue)){
|
|
|
// 数据异常->产生预警信息
|
|
|
-
|
|
|
+ CbGatherWarningVo warningVo = new CbGatherWarningVo();
|
|
|
+ warningVo.setType(entity.getType());
|
|
|
+ warningVo.setGetherId(entity.getId());
|
|
|
+ warningVo.setGetherfeeId(feeVo.getId());
|
|
|
+ warningVo.setErrValue(collValue);
|
|
|
+ warningService.save(warningVo);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -158,7 +179,12 @@ public class CbGatherServiceImpl extends ServiceImpl<CbGatherMapper, CbGather> i
|
|
|
BigDecimal msDtuValue = msValue.subtract(msValue.multiply(feeVo.getMsRetio())); // 下公差
|
|
|
if (!bjdtodtu(collValue,msDtoValue,msDtuValue)){
|
|
|
// 数据异常->产生预警信息
|
|
|
-
|
|
|
+ CbGatherWarningVo warningVo = new CbGatherWarningVo();
|
|
|
+ warningVo.setType(entity.getType());
|
|
|
+ warningVo.setGetherId(entity.getId());
|
|
|
+ warningVo.setGetherfeeId(feeVo.getId());
|
|
|
+ warningVo.setErrValue(collValue);
|
|
|
+ warningService.save(warningVo);
|
|
|
}
|
|
|
}
|
|
|
}
|