Commit c2148f25 by 邹磊浩

修改代码

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