Commit 9f49edd1 by sdif

用户端代码提交

parent 4654bd31
......@@ -328,4 +328,6 @@ public class TotalOrderVo {
private Integer num;
private String intro;
private String pzRemark;
}
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.toolkit.Db;
import com.pz.common.core.page.TableDataInfo;
......@@ -166,6 +167,7 @@ public class DbghOrderServiceImpl implements IDbghOrderService, ISonOrderService
DbghOrder sonOrder = baseMapper.selectOne(Wrappers.<DbghOrder>lambdaQuery().eq(DbghOrder::getOrderId, totalId));
Objects.requireNonNull(sonOrder, "子订单不存在,请检查");
sonOrder.setStatus(target);
totalOrderMapper.update(null,new LambdaUpdateWrapper<TotalOrder>().set(TotalOrder::getSuborderStatus,target).eq(TotalOrder::getId,totalId));
return baseMapper.updateById(sonOrder) > 0;
}
......
......@@ -180,6 +180,7 @@ public class DbmyOrderServiceImpl implements IDbmyOrderService, ISonOrderService
DbmyOrder sonOrder = baseMapper.selectOne(Wrappers.<DbmyOrder>lambdaQuery().eq(DbmyOrder::getOrderId, totalId));
Objects.requireNonNull(sonOrder, "子订单不存在,请检查");
sonOrder.setStatus(target);
totalOrderMapper.update(null,new LambdaUpdateWrapper<TotalOrder>().set(TotalOrder::getSuborderStatus,target).eq(TotalOrder::getId,totalId));
return baseMapper.updateById(sonOrder) > 0;
}
......
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
......@@ -166,6 +167,7 @@ public class DbwzOrderServiceImpl implements IDbwzOrderService, ISonOrderService
DbwzOrder sonOrder = baseMapper.selectOne(Wrappers.<DbwzOrder>lambdaQuery().eq(DbwzOrder::getOrderId, totalId));
Objects.requireNonNull(sonOrder, "子订单不存在,请检查");
sonOrder.setStatus(target);
totalOrderMapper.update(null,new LambdaUpdateWrapper<TotalOrder>().set(TotalOrder::getSuborderStatus,target).eq(TotalOrder::getId,totalId));
return baseMapper.updateById(sonOrder) > 0;
}
......
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
......@@ -9,6 +10,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.pz.merchant.domain.vo.SonOrderVo;
import com.pz.merchant.service.ISonOrderService;
import com.pz.system.domain.DbwzOrder;
import com.pz.system.domain.TotalOrder;
import com.pz.system.domain.bo.OrderFinishedBo;
import com.pz.system.domain.vo.StoreAdminOrderVo;
import com.pz.system.mapper.CityMapper;
......@@ -22,10 +25,7 @@ import com.pz.system.domain.StoreOrder;
import com.pz.system.mapper.StoreOrderMapper;
import com.pz.system.service.IStoreOrderService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.Optional;
import java.util.*;
/**
* 商城订单Service业务层处理
......@@ -143,7 +143,11 @@ public class StoreOrderServiceImpl implements IStoreOrderService, ISonOrderServi
@Override
public boolean switchSonOrderStatus(Long totalId, Integer target) {
return false;
StoreOrder sonOrder = baseMapper.selectOne(Wrappers.<StoreOrder>lambdaQuery().eq(StoreOrder::getOrderId, totalId));
Objects.requireNonNull(sonOrder, "子订单不存在,请检查");
sonOrder.setStatus(target);
totalOrderMapper.update(null,new LambdaUpdateWrapper<TotalOrder>().set(TotalOrder::getSuborderStatus,target).eq(TotalOrder::getId,totalId));
return baseMapper.updateById(sonOrder) > 0;
}
}
......@@ -138,6 +138,9 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
Optional.ofNullable(employeesMapper.selectVoById(totalOrderVo.getEmId()))
.map(EmployeesVo::getUid)
.ifPresent(totalOrderVo::setEUserId);
Optional.ofNullable(employeesMapper.selectVoById(totalOrderVo.getEmId()))
.map(EmployeesVo::getName)
.ifPresent(totalOrderVo::setEmName);
if (totalOrderVo.getBusinessId() == 1) {// 预约陪诊
YypzOrder yypzOrder = yypzOrderMapper.selectOne(new LambdaQueryWrapper<YypzOrder>().eq(YypzOrder::getOrderId, totalOrderVo.getId()));
......@@ -152,6 +155,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setVisitTime(yypzOrder.getVisitTime());
totalOrderVo.setOverTime(yypzOrder.getOverTime());
totalOrderVo.setVoucher(yypzOrder.getVoucher());
totalOrderVo.setPzRemark(yypzOrder.getRemark());
} else if (totalOrderVo.getBusinessId() == 2) {// 代办挂号
......@@ -167,7 +171,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setVisitTime(dbghOrder.getVisitTime());
totalOrderVo.setOverTime(dbghOrder.getOverTime());
totalOrderVo.setVoucher(dbghOrder.getVoucher());
totalOrderVo.setPzRemark(dbghOrder.getRemark());
} else if (totalOrderVo.getBusinessId() == 3) {// 代办问诊
......@@ -190,7 +194,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setServiceRequirements(dbwzOrder.getServiceRequirements());
totalOrderVo.setOverTime(dbwzOrder.getOverTime());
totalOrderVo.setVoucher(dbwzOrder.getVoucher());
totalOrderVo.setPzRemark(dbwzOrder.getRemark());
} else if (totalOrderVo.getBusinessId() == 4) {// 住院陪护
......@@ -206,7 +210,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setPhsj(zyphOrder.getStartTime() + "-" + zyphOrder.getEndTime());
totalOrderVo.setOverTime(zyphOrder.getOverTime());
totalOrderVo.setVoucher(zyphOrder.getVoucher());
totalOrderVo.setPzRemark(zyphOrder.getRemark());
} else if (totalOrderVo.getBusinessId() == 5) {// 代办买药
DbmyOrder dbmyOrder = dbmyOrderMapper.selectOne(new LambdaQueryWrapper<DbmyOrder>().eq(DbmyOrder::getOrderId, totalOrderVo.getId()));
......@@ -225,6 +229,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setIsRefrigerate(dbmyOrder.getIsRefrigerate());
totalOrderVo.setOverTime(dbmyOrder.getOverTime());
totalOrderVo.setVoucher(dbmyOrder.getVoucher());
totalOrderVo.setPzRemark(dbmyOrder.getRemark());
} else if (totalOrderVo.getBusinessId() == 6) {// 诊前挂号
......@@ -239,6 +244,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setTimeOfAppointment(zqghOrder.getTimeOfAppointment());
totalOrderVo.setOverTime(zqghOrder.getOverTime());
totalOrderVo.setVoucher(zqghOrder.getVoucher());
totalOrderVo.setPzRemark(zqghOrder.getRemark());
} else if (totalOrderVo.getBusinessId() == 0) {// 商城订单
......@@ -254,16 +260,19 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
totalOrderVo.setStoreGoodsVo(storeGoods);
UserAddressVo userAddressVo = userAddressMapper.selectVoById(storeOrder.getAddressId());
totalOrderVo.setUserAddressVo(userAddressVo);
TotalOrderBo totalOrderBo = new TotalOrderBo();
totalOrderBo.setId(totalOrderVo.getId());
totalOrderBo.setPhone(userAddressVo.getPhone());
totalOrderBo.setLogisticsCode(storeOrder.getLogisticsCode());
totalOrderVo.setObject(selectLogisticsStatus(totalOrderBo));
if(StringUtils.isNotEmpty(storeOrder.getLogisticsCode())){
TotalOrderBo totalOrderBo = new TotalOrderBo();
totalOrderBo.setId(totalOrderVo.getId());
totalOrderBo.setPhone(userAddressVo.getPhone());
totalOrderBo.setLogisticsCode(storeOrder.getLogisticsCode());
totalOrderVo.setObject(selectLogisticsStatus(totalOrderBo));
}
totalOrderVo.setName(storeGoods.getTitle());
totalOrderVo.setNum(storeOrder.getNum());
totalOrderVo.setSmallCover(storeGoods.getSmallCover());
totalOrderVo.setPrice(storeGoods.getSalePrice());
totalOrderVo.setIntro(storeGoods.getIntro());
}
return totalOrderVo;
}
......@@ -379,6 +388,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
lqw.eq(StringUtils.isNotBlank(bo.getEvaluationContent()), TotalOrder::getEvaluationContent, bo.getEvaluationContent());
lqw.eq(StringUtils.isNotBlank(bo.getRefundReason()), TotalOrder::getRefundReason, bo.getRefundReason());
lqw.eq(StringUtils.isNotBlank(bo.getRefundAmount()), TotalOrder::getRefundAmount, bo.getRefundAmount());
lqw.orderByDesc(TotalOrder::getId);
return lqw;
}
......@@ -544,7 +554,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
TotalOrder totalOrder = BeanUtil.toBean(bo, TotalOrder.class);
totalOrder.setStatus(TotalOrderStatus.DONE.getCode());
return baseMapper.updateById(totalOrder) > 1;
return baseMapper.updateById(totalOrder) > 0;
}
@Override
......@@ -706,13 +716,13 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
if (!sonOrderFlag) {
throw new ServiceException("子订单状态修改出错");
}
if (totalOrder.getBusinessId() == 0) {// 商城订单
/*if (totalOrder.getBusinessId() == 0) {// 商城订单
storeOrderMapper.update(null, new LambdaUpdateWrapper<StoreOrder>()
.eq(StoreOrder::getOrderId, totalOrder.getId())
.set(StoreOrder::getStatus, ShopOrderStatus.BEING_REFUND.getCode()));
}
}*/
baseMapper.updateById(totalOrder);
return true;
}
......
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
......@@ -168,6 +169,7 @@ public class YypzOrderServiceImpl implements IYypzOrderService, ISonOrderService
YypzOrder sonOrder = baseMapper.selectOne(Wrappers.<YypzOrder>lambdaQuery().eq(YypzOrder::getOrderId, totalId));
Objects.requireNonNull(sonOrder, "子订单不存在,请检查");
sonOrder.setStatus(target);
totalOrderMapper.update(null,new LambdaUpdateWrapper<TotalOrder>().set(TotalOrder::getSuborderStatus,target).eq(TotalOrder::getId,totalId));
return baseMapper.updateById(sonOrder) > 0;
}
......
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
......@@ -38,6 +39,8 @@ public class ZqghOrderServiceImpl implements IZqghOrderService, ISonOrderService
private final ZqghOrderMapper baseMapper;
private final TotalOrderMapper totalOrderMapper;
/**
* 查询诊前挂号订单
*/
......@@ -174,6 +177,7 @@ public class ZqghOrderServiceImpl implements IZqghOrderService, ISonOrderService
ZqghOrder sonOrder = baseMapper.selectOne(Wrappers.<ZqghOrder>lambdaQuery().eq(ZqghOrder::getOrderId, totalId));
Objects.requireNonNull(sonOrder, "子订单不存在,请检查");
sonOrder.setStatus(target);
totalOrderMapper.update(null,new LambdaUpdateWrapper<TotalOrder>().set(TotalOrder::getSuborderStatus,target).eq(TotalOrder::getId,totalId));
return baseMapper.updateById(sonOrder) > 0;
}
......
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
......@@ -165,6 +166,7 @@ public class ZyphOrderServiceImpl implements IZyphOrderService, ISonOrderService
ZyphOrder sonOrder = baseMapper.selectOne(Wrappers.<ZyphOrder>lambdaQuery().eq(ZyphOrder::getOrderId, totalId));
Objects.requireNonNull(sonOrder, "子订单不存在,请检查");
sonOrder.setStatus(target);
totalOrderMapper.update(null,new LambdaUpdateWrapper<TotalOrder>().set(TotalOrder::getSuborderStatus,target).eq(TotalOrder::getId,totalId));
return baseMapper.updateById(sonOrder) > 0;
}
......
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