Commit c2148f25 by 邹磊浩

修改代码

parent b3e310d5
......@@ -76,10 +76,10 @@ public class InsertTestOrderTask {
// 加入线程池并发执行
ExecutorService executorService = Executors.newFixedThreadPool(10);
for (Company company : companies) {
Employees employees = employeesMapper.selectOne(Wrappers.<Employees>lambdaQuery().eq(Employees::getCompanyId, company.getId()).last("limit 1"));
List<Employees> employees = employeesMapper.selectList(Wrappers.<Employees>lambdaQuery().eq(Employees::getCompanyId, company.getId()).last("limit 10"));
Employees element = getRandomElement(employees);
executorService.submit(() -> {
List<Hospital> hospitals = hospitalMapper.selectList(Wrappers.<Hospital>lambdaQuery().eq(Hospital::getCityId, company.getCityId()).last("limit 10"));
Hospital hospital = getRandomElement(hospitals);
for (Integer businessId : businessIds) {
//获取服务价格
List<Services> services = servicesMapper.selectList(Wrappers.<Services>lambdaQuery().eq(Services::getBid, businessId).eq(Services::getCityId, company.getCityId()));
......@@ -89,7 +89,11 @@ public class InsertTestOrderTask {
//接单人员
UserVsitor randomElement = getRandomElement(userVsitors);
for (Services service : services) {
Long orderId = saveTotalOrder(businessId, employees.getId(), company.getCityId().intValue(), company.getId(), service);
Long orderId = saveTotalOrder(businessId, element.getId(), company.getCityId().intValue(), company.getId(), service);
Integer status = RandomUtil.randomInt(0, 2);
List<Hospital> hospitals = hospitalMapper.selectList(Wrappers.<Hospital>lambdaQuery().eq(Hospital::getCityId, company.getCityId()).last("limit 50"));
Hospital hospital = getRandomElement(hospitals);
switch (businessId) {
case 0:
StoreOrder storeOrder = new StoreOrder();
......@@ -98,7 +102,7 @@ public class InsertTestOrderTask {
storeOrder.setGoodsId(storeId);
Integer addressId = RandomUtil.randomInt(1, 9);
storeOrder.setAddressId(addressId);
storeOrder.setStatus(2);
storeOrder.setStatus(status);
storeOrder.setLogistics("顺丰速运");
storeOrder.setLogisticsCode("SF" + RandomUtil.randomNumbers(16));
storeOrderMapper.insert(storeOrder);
......@@ -107,7 +111,7 @@ public class InsertTestOrderTask {
YypzOrder yypzOrder = new YypzOrder();
yypzOrder.setOrderId(orderId.intValue());
yypzOrder.setPhone(generateRandomPhoneNumber());
yypzOrder.setStatus(2);
yypzOrder.setStatus(status);
yypzOrder.setVisitTime(randomTime());
yypzOrder.setHid(hospital.getId());
yypzOrder.setVisitor(randomElement.getId());
......@@ -117,7 +121,7 @@ public class InsertTestOrderTask {
DbghOrder dbghOrder = new DbghOrder();
dbghOrder.setOrderId(orderId.intValue());
dbghOrder.setHid(hospital.getId());
dbghOrder.setStatus(2);
dbghOrder.setStatus(status);
dbghOrder.setVisitTime(randomTime());
dbghOrder.setVisitor(randomElement.getId());
dbghOrderMapper.insert(dbghOrder);
......@@ -125,7 +129,7 @@ public class InsertTestOrderTask {
case 3:
DbwzOrder dbwzOrder = new DbwzOrder();
dbwzOrder.setOrderId(orderId.intValue());
dbwzOrder.setStatus(2);
dbwzOrder.setStatus(status);
dbwzOrder.setVisitTime(randomTime());
dbwzOrder.setChiefComplaint("电话沟通");
dbwzOrder.setHistoryOfPresentIllness("电话沟通");
......@@ -141,7 +145,7 @@ public class InsertTestOrderTask {
ZyphOrder zyphOrder = new ZyphOrder();
zyphOrder.setOrderId(orderId.intValue());
zyphOrder.setHid(hospital.getId());
zyphOrder.setStatus(2);
zyphOrder.setStatus(status);
zyphOrder.setVisitor(randomElement.getId());
zyphOrder.setOverTime(randomTime());
zyphOrderMapper.insert(zyphOrder);
......@@ -152,15 +156,15 @@ public class InsertTestOrderTask {
dbmyOrder.setPhone(generateRandomPhoneNumber());
dbmyOrder.setAddress("***");
dbmyOrder.setAddressInfo("***");
dbmyOrder.setPzShr(employees.getName());
dbmyOrder.setPzShPhone(employees.getPhone());
dbmyOrder.setPzShr(element.getName());
dbmyOrder.setPzShPhone(element.getPhone());
dbmyOrderMapper.insert(dbmyOrder);
break;
case 6:
ZqghOrder zqghOrder = new ZqghOrder();
zqghOrder.setOrderId(orderId.intValue());
zqghOrder.setHid(hospital.getId());
zqghOrder.setStatus(2);
zqghOrder.setStatus(status);
zqghOrder.setOverTime(randomTime());
zqghOrder.setDoctorId(1);
zqghOrderMapper.insert(zqghOrder);
......@@ -203,8 +207,11 @@ public class InsertTestOrderTask {
Integer i = RandomUtil.randomInt(0, 1);
//创建主订单
TotalOrder totalOrder = new TotalOrder();
totalOrder.setStatus(2);
totalOrder.setSuborderStatus(2);
Random random = new Random();
Integer status = RandomUtil.randomInt(1, 3);
totalOrder.setStatus(status);
Integer suborderStatus = RandomUtil.randomInt(0, 3);
totalOrder.setSuborderStatus(suborderStatus);
totalOrder.setPayMoney(services.getPrice().doubleValue());
totalOrder.setIsSatisfaction(i);
totalOrder.setBusinessId(businessId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment