Browse Source

add: 给前端的测试分支;

master1
龚宝雄 6 months ago
parent
commit
6dd22fcddc
  1. 5
      nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java
  2. 41
      nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java
  3. 22
      nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

5
nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java

@ -41,6 +41,11 @@ public class OnlineUserDto {
*/ */
private String nickName; private String nickName;
/**
* 用户姓名
*/
private String person_name;
/** /**
* 岗位 * 岗位
*/ */

41
nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java

@ -86,19 +86,29 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
*/ */
@Override @Override
public List<HomeBillCounts> getBillsCount() { public List<HomeBillCounts> getBillsCount() {
List<HomeBillCounts> allCounts =easOutInBillMapper.getBillsCount(); Long receiptCount = 0L;
HomeBillCounts allocations =new HomeBillCounts(); Long allocationCount = 0L;
Long allocation =allocationBillMapper.getAllocationCount(""); List<HomeBillCounts> allCounts = easOutInBillMapper.getBillsCount();
allocations.setCounts(allocation.toString()); HomeBillCounts allocations = new HomeBillCounts();
allocations.setName(EasBillTypeEnum.DBQR.getName()); HomeBillCounts receipts = new HomeBillCounts();
allocations.setDjlx(EasBillTypeEnum.DBQR.getCode());
allocations.setYwlx(EasBillTypeEnum.DB.getCode());
HomeBillCounts receipts =new HomeBillCounts();
Long receipt = receiptBillMapper.receiptCounts();
receipts.setCounts(receipt.toString());
receipts.setName(EasBillTypeEnum.SHDJ.getName()); receipts.setName(EasBillTypeEnum.SHDJ.getName());
receipts.setDjlx(EasBillTypeEnum.SHDJ.getCode()); receipts.setDjlx(EasBillTypeEnum.SHDJ.getCode());
receipts.setYwlx(EasBillTypeEnum.SH.getCode()); receipts.setYwlx(EasBillTypeEnum.SH.getCode());
allocations.setName(EasBillTypeEnum.DBQR.getName());
allocations.setDjlx(EasBillTypeEnum.DBQR.getCode());
allocations.setYwlx(EasBillTypeEnum.DB.getCode());
receipts.setCounts(receiptCount.toString());
allocations.setCounts(allocationCount.toString());
try {
//receiptCount = receiptBillMapper.receiptCounts();
//allocationCount = allocationBillMapper.getAllocationCount("");
//receipts.setCounts(receiptCount.toString());
//allocations.setCounts(allocationCount.toString());
} catch (Exception e) {
allCounts.add(allocations);
allCounts.add(receipts);
return allCounts;
}
allCounts.add(allocations); allCounts.add(allocations);
allCounts.add(receipts); allCounts.add(receipts);
return allCounts; return allCounts;
@ -159,10 +169,6 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
} }
/** /**
* 根据条件查询 * 根据条件查询
* *
@ -564,7 +570,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
} else { } else {
SrmMsgDto srmMsgDto; SrmMsgDto srmMsgDto;
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue); String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
srmMsgDto = wmsToSrmService.sendWebPostData(billJson,1); srmMsgDto = wmsToSrmService.sendWebPostData(billJson, 1);
if (srmMsgDto != null) { if (srmMsgDto != null) {
if ("false".equals(srmMsgDto.getSuccess())) { if ("false".equals(srmMsgDto.getSuccess())) {
throw new BadRequestException(srmMsgDto.getMessage()); throw new BadRequestException(srmMsgDto.getMessage());
@ -605,7 +611,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
for (EasOutInBillDto bill : bills) { for (EasOutInBillDto bill : bills) {
try { try {
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue); String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue);
wmsToSrmService.sendWebPostData(billJson,1); wmsToSrmService.sendWebPostData(billJson, 1);
updateBills(bill); updateBills(bill);
} catch (Exception e) { } catch (Exception e) {
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString());
@ -620,9 +626,6 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas
} }
/** /**
* 多选删除 * 多选删除
* *

22
nlsso-server/src/main/java/org/nl/wms/schedule/EasBillSchedule.java

@ -12,6 +12,7 @@ import org.apache.commons.lang3.StringUtils;
import org.nl.common.utils.CodeUtil; import org.nl.common.utils.CodeUtil;
import org.nl.common.websocket.SendHomeWebSocketServer; import org.nl.common.websocket.SendHomeWebSocketServer;
import org.nl.config.IdUtil; import org.nl.config.IdUtil;
import org.nl.system.service.user.dao.SysUser;
import org.nl.wms.database.eas.dao.EasOutInBillDetail; import org.nl.wms.database.eas.dao.EasOutInBillDetail;
import org.nl.wms.database.eas.dao.HomeBillCounts; import org.nl.wms.database.eas.dao.HomeBillCounts;
import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper; import org.nl.wms.database.eas.dao.mapper.EasOutInBillDetailMapper;
@ -28,7 +29,9 @@ import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.ParseException;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@ -77,7 +80,24 @@ public class EasBillSchedule {
} }
@Async("taskExecutor")
//@Scheduled(cron = "0/120 * * * * *")
public void insertUsers(List<SysUser> existingUsers, List<SysUser> newUsers) {
Set<String> ids = existingUsers.stream().map(SysUser::getUsername).collect(Collectors.toSet());
// 过滤出需要插入的新用户,并设置默认属性
List<SysUser> insertUsers = newUsers.stream()
.filter(user -> !ids.contains(user.getUsername()))
.peek(user -> {
user.setIs_used(true); // 设置默认启用
user.setCreate_time(new Date()); // 设置创建时间
})
.collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(insertUsers)) {
// 批量插入新用户
//this.saveBatch(insertUsers);
}
}
/** /**
* 定时清空单据 * 定时清空单据
@ -113,7 +133,7 @@ public class EasBillSchedule {
SendHomeWebSocketServer.getWebSocketSet(); SendHomeWebSocketServer.getWebSocketSet();
if (webSocketSet.size() > 0) { if (webSocketSet.size() > 0) {
webSocketSet.forEach(c -> { webSocketSet.forEach(c -> {
c.sendDataToClient(easOutInBillService.getBillsCount()); // c.sendDataToClient(easOutInBillService.getBillsCount());
}); });
} }
//stopWatch.stop(); //stopWatch.stop();

Loading…
Cancel
Save