|
@@ -189,10 +189,23 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
|
|
if (importResult.getList().size() < 1){
|
|
if (importResult.getList().size() < 1){
|
|
return Result.error("读取Excel失败,数据不能为空,请重新检查数据并导入。");
|
|
return Result.error("读取Excel失败,数据不能为空,请重新检查数据并导入。");
|
|
}
|
|
}
|
|
- importResult.getList().forEach(importVo -> {
|
|
|
|
|
|
+
|
|
|
|
+ for (AccountImportVo importVo : importResult.getList()) {
|
|
BeanUtils.copyProperties(importVo,settlementInfo);
|
|
BeanUtils.copyProperties(importVo,settlementInfo);
|
|
- settlementInfoMapper.insert(settlementInfo);
|
|
|
|
- });
|
|
|
|
|
|
+ //根据账户id 查看
|
|
|
|
+ CtopCwjsSettlementInfo cwjs = settlementInfoMapper.getSettlementByAccountId(importVo.getAccountId());
|
|
|
|
+ if (Check.isNull(cwjs)){
|
|
|
|
+ // BeanUtils.copyProperties(importVo,settlementInfo);
|
|
|
|
+ settlementInfoMapper.insert(settlementInfo);
|
|
|
|
+ }else {
|
|
|
|
+ settlementInfo.setId(cwjs.getId());
|
|
|
|
+ settlementInfoMapper.updateById(settlementInfo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|