Commit 7c6ba532 by sdif

用户端代码提交

parent 7187501f
......@@ -14,6 +14,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotNull;
/**
......@@ -33,14 +34,16 @@ public class AppletCarouselController extends BaseController {
* 首页
*/
@GetMapping("/home")
public R<HomeVo> getHome() {
return R.ok(iCarouselService.selectHome(1));
public R<HomeVo> getHome(HttpServletRequest reques) {
return R.ok(iCarouselService.selectHome(Integer.parseInt(reques.getHeader("city_id"))));
}
/**
* 查询轮播图列表
*/
@GetMapping("/list")
public TableDataInfo<CarouselVo> list(CarouselBo bo, PageQuery pageQuery) {
public TableDataInfo<CarouselVo> list(CarouselBo bo, PageQuery pageQuery, HttpServletRequest reques) {
bo.setStatus(1);
bo.setCityId(Long.valueOf(reques.getHeader("city_id")));
return iCarouselService.queryPageList(bo, pageQuery);
}
......
......@@ -13,7 +13,10 @@ import java.util.Date;
*/
@Data
public class SonOrderVo {
/**
* 子订单id
*/
private Integer sonOrderId;
/**
* 就诊人员姓名
*/
......
......@@ -2,6 +2,7 @@ package com.pz.system.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pz.merchant.domain.vo.SonOrderVo;
import com.pz.system.domain.StoreOrder;
import com.pz.system.domain.bo.StoreOrderBo;
import com.pz.system.domain.vo.StoreAdminOrderVo;
......@@ -25,4 +26,12 @@ public interface StoreOrderMapper extends BaseMapperPlus<StoreOrderMapper, Store
* @return
*/
Page<StoreAdminOrderVo> findStoreAdminOrderVoPage(IPage<StoreOrder> iPage, @Param("bo") StoreOrderBo bo);
/**
* 根据主订单ID查询子订单相关信息
*
* @param totalId 主订单ID
* @return 子订单相关信息
*/
SonOrderVo selectSonOrderInfoByTotalId(Integer totalId);
}
......@@ -133,7 +133,9 @@ public class CarouselServiceImpl implements ICarouselService {
@Override
public HomeVo selectHome(Integer cityId) {
HomeVo homeVo = new HomeVo();
List<Notice> notices = noticeMapper.selectList();
List<Notice> notices = noticeMapper.selectList(
new LambdaQueryWrapper<Notice>().eq(Notice::getSite,1).eq(Notice::getCityId,cityId)
);
if(null != notices && notices.size() != 0){
homeVo.setNotice(notices.get(0).getInfo());
}
......@@ -142,7 +144,7 @@ public class CarouselServiceImpl implements ICarouselService {
Carousel::getSite,1
).eq(
Carousel::getStatus,1
)
).eq(Carousel::getCityId,cityId)
));
homeVo.setBusiness(businessMapper.selectList());
return homeVo;
......
package com.pz.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.lang.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.pz.common.core.page.TableDataInfo;
import com.pz.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.pz.common.utils.JsonUtils;
import com.pz.system.domain.Hospital;
import com.pz.system.mapper.HospitalMapper;
import lombok.RequiredArgsConstructor;
......@@ -88,18 +92,8 @@ public class DepartmentServiceImpl implements IDepartmentService {
@Override
public List<DepartmentVo> departmentByHospitalId(Integer hospitalId) {
Hospital hospital = hospitalMapper.selectById(hospitalId);
// 去除方括号
String numbers = hospital.getDepartments().substring(1, hospital.getDepartments().length() - 1);
// 使用逗号分割字符串
String[] numberArray = numbers.split(", ");
// 创建 List<Integer> 并将转换后的整数加入列表中
List<Integer> integerList = new ArrayList<>();
for (String num : numberArray) {
integerList.add(Integer.parseInt(num.trim()));
}
List<DepartmentVo> departments = baseMapper.selectVoList(new LambdaQueryWrapper<Department>().in(Department::getId, integerList));
List<Integer> ids = JsonUtils.parseArray(hospital.getDepartments(), Integer.class);
List<DepartmentVo> departments = baseMapper.selectVoList(new LambdaQueryWrapper<Department>().in(Department::getId, ids));
if (CollectionUtils.isNotEmpty(departments)) {
//查询所有菜单
List<DepartmentVo> allMenu = departments;
......
......@@ -138,7 +138,7 @@ public class StoreOrderServiceImpl implements IStoreOrderService, ISonOrderServi
@Override
public SonOrderVo getSonOrderSimpleDataByTotalId(Integer totalId) {
return null;
return baseMapper.selectSonOrderInfoByTotalId(totalId);
}
@Override
......
......@@ -121,6 +121,8 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
private final SysUserMapper sysUserMapper;
private final UserRefundMapper userRefundMapper;
@Override
public TotalOrderVo queryById(Long id) {
return baseMapper.selectVoById(id);
......@@ -478,8 +480,9 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
} else if (bo.getBusinessId() == 5) {// 代办买药
DbmyOrder dbmyOrder = BeanUtil.toBean(bo, DbmyOrder.class);
dbmyOrderMapper.insert(dbmyOrder);
dbmyOrder.setRemark("");
dbmyOrderMapper.insert(dbmyOrder);
} else if (bo.getBusinessId() == 6) {// 诊前挂号
ZqghOrder zqghOrder = BeanUtil.toBean(bo, ZqghOrder.class);
......@@ -520,7 +523,7 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
// 已接单、待服务状态下等待陪诊员开始服务或取消订单
TotalOrderBo totalOrderBo = new TotalOrderBo();
totalOrderBo.setId(totalOrder.getId());
if (totalOrder.getBusinessId() == 3 && totalOrder.getStatus() == 1) {
if (totalOrder.getBusinessId() == 3 && totalOrder.getStatus() == 1 && sonOrderSimpleDataByTotalId.getOrderStatus() == 1) {
totalOrderBo.setIsRefund(0);
return this.refundOrder(totalOrderBo);
......@@ -729,6 +732,14 @@ public class TotalOrderServiceImpl implements ITotalOrderService {
// 修改主订单退款理由
totalOrder.setRefundAmount(totalOrder.getPayMoney());
totalOrder.setRefundReason(bo.getRefundReason());
//添加退款审核记录
UserRefund userRefund = new UserRefund();
userRefund.setRefundNo(getOrderSn());
userRefund.setOrderId(totalOrder.getId().intValue());
userRefund.setBusinessId(totalOrder.getBusinessId());
userRefund.setSonOrderId(sonOrderSimpleDataByTotalId.getSonOrderId());
userRefund.setPhone(bo.getPhone());
userRefund.setStatus(0);
}
......
......@@ -56,7 +56,8 @@
dbgh_order.status as orderStatus,
sys_user.avatar,
hospital.name as hospital,
dbgh_order.visit_time
dbgh_order.visit_time,
dbgh_order.id as sonOrderId
from dbgh_order
left join user_vsitor as vsitor on vsitor.id = dbgh_order.visitor
left join sys_user on sys_user.user_id = vsitor.uid
......
......@@ -58,7 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectSonOrderInfoByTotalId" resultType="com.pz.merchant.domain.vo.SonOrderVo">
select dbmy_order.status as orderStatus,
sys_user.nick_name as userName,
sys_user.avatar
sys_user.avatar,
dbmy_order.id as sonOrderId
from dbmy_order
left join total_order on total_order.id = dbmy_order.order_id
left join sys_user on sys_user.user_id = total_order.uid
......
......@@ -59,7 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select vsitor.name as userName,
dbwz_order.status as orderStatus,
sys_user.avatar,
dbwz_order.visit_time
dbwz_order.visit_time,
dbwz_order.id as sonOrderId
from dbwz_order
left join user_vsitor as vsitor on vsitor.id = dbwz_order.visitor
left join sys_user on sys_user.user_id = vsitor.uid
......
......@@ -56,6 +56,9 @@
</if>
</where>
</select>
<select id="selectSonOrderInfoByTotalId" resultType="com.pz.merchant.domain.vo.SonOrderVo">
select s.id as sonOrderId store_order s where order_id = #{totalId}
</select>
</mapper>
......@@ -58,7 +58,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
yypz_order.status as orderStatus,
sys_user.avatar,
hospital.name as hospital,
yypz_order.visit_time
yypz_order.visit_time,
yypz_order.id as sonOrderId
from yypz_order
left join user_vsitor as vsitor on vsitor.id = yypz_order.visitor
left join sys_user on sys_user.user_id = vsitor.uid
......
......@@ -56,7 +56,8 @@
<select id="selectSonOrderInfoByTotalId" resultType="com.pz.merchant.domain.vo.SonOrderVo">
select user.nick_name as userName,
zqgh_order.status as orderStatus,
user.avatar
user.avatar,
zqgh_order.id as sonOrderId
from zqgh_order
left join total_order on total_order.id = zqgh_order.order_id
left join sys_user as user on user.user_id = total_order.uid
......
......@@ -62,7 +62,8 @@
zyph_order.status as orderStatus,
sys_user.avatar,
hospital.name as hospital,
zyph_order.start_day as visitTime
zyph_order.start_day as visitTime,
zyph_order.id as sonOrderId
from zyph_order
left join user_vsitor as vsitor on vsitor.id = zyph_order.visitor
left join sys_user on sys_user.user_id = vsitor.uid
......
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