|
|
|
@ -1,10 +1,13 @@ |
|
|
|
|
package org.jeecg.modules.fieldx.service.impl; |
|
|
|
|
|
|
|
|
|
import org.jeecg.common.system.vo.LoginUser; |
|
|
|
|
import org.jeecg.modules.fieldx.controller.FieldxController; |
|
|
|
|
import org.jeecg.modules.fieldx.entity.Fieldx; |
|
|
|
|
import org.jeecg.modules.fieldx.entity.Fieldx222; |
|
|
|
|
import org.jeecg.modules.fieldx.mapper.FieldxMapper; |
|
|
|
|
import org.jeecg.modules.fieldx.service.IFieldxService; |
|
|
|
|
import org.jeecg.modules.tablex.entity.Tablex; |
|
|
|
|
import org.jeecg.modules.tablex.service.ITablexService; |
|
|
|
|
import org.jeecg.modules.tablex.ws.WebSocketUtils; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -20,10 +23,16 @@ import java.util.Map; |
|
|
|
|
* @Date: 2023-04-10 |
|
|
|
|
* @Version: V1.0 |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service |
|
|
|
|
public class FieldxServiceImpl extends ServiceImpl<FieldxMapper, Fieldx> implements IFieldxService { |
|
|
|
|
@Autowired |
|
|
|
|
private WebSocketUtils webSocketUtils; |
|
|
|
|
@Autowired |
|
|
|
|
FieldxController fieldxController; |
|
|
|
|
@Autowired |
|
|
|
|
private ITablexService tablexService; |
|
|
|
|
@Override |
|
|
|
|
public void saveSingleBatch(List<Fieldx> fieldxList, LoginUser loginUser, Map<String, String> message) { |
|
|
|
|
for (int i = 0; i < fieldxList.size(); i++){ |
|
|
|
@ -31,6 +40,9 @@ public class FieldxServiceImpl extends ServiceImpl<FieldxMapper, Fieldx> impleme |
|
|
|
|
Thread.sleep(500L); |
|
|
|
|
message.put("uploaded", String.valueOf(i + 1)); |
|
|
|
|
this.save(fieldxList.get(i)); |
|
|
|
|
Tablex tablex = tablexService.getById(fieldxList.get(i).getTableId()); |
|
|
|
|
tablexService.updateVersion(fieldxList.get(i).getTableId(), tablex.getVerison() + 1); |
|
|
|
|
tablexService.updateSql(fieldxList.get(i).getTableId(), fieldxController.createSql(fieldxList.get(i).getTableId())); |
|
|
|
|
webSocketUtils.sendMessage(loginUser.getId(), message); |
|
|
|
|
} catch (InterruptedException e) { |
|
|
|
|
log.error(e.getMessage(), e); |
|
|
|
|