Merge branch 'jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' into dev_gy_0920
This commit is contained in:
commit
ff59eeb12c
@ -7,14 +7,19 @@ import com.xinelu.applet.utils.AppointmentTimeUtil;
|
||||
import com.xinelu.applet.vo.specialdisease.WeekDaysVO;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail;
|
||||
import com.xinelu.manage.service.scheduleplandetail.ISchedulePlanDetailService;
|
||||
import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -44,6 +49,9 @@ public class AppletSchedulePlanController extends BaseController {
|
||||
@ApiOperation("查询医生排班明细")
|
||||
@GetMapping("/getListByDoctor")
|
||||
public R<List<SchedulePlanVO>> getListByDoctor(SchedulePlanDTO plan) {
|
||||
if (plan.getDoctorId() == null) {
|
||||
return R.fail("请选择医生");
|
||||
}
|
||||
LocalDate nowTime = LocalDate.now();
|
||||
List<WeekDaysVO> weekDaysList = Lists.newArrayList();
|
||||
appointmentTimeUtil.setWeekDayAndWeekDate(nowTime, weekDaysList);
|
||||
@ -53,12 +61,37 @@ public class AppletSchedulePlanController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping("/updateStatus")
|
||||
@ApiOperation(value = "医生修改排班时间段的可预约状态")
|
||||
public R<String> updateStatus(@RequestBody SchedulePlanDetailDTO schedulePlanDetailDTO) {
|
||||
SchedulePlanDetail planDetail = new SchedulePlanDetail();
|
||||
planDetail.setId(schedulePlanDetailDTO.getSchedulePlanDetailId());
|
||||
planDetail.setStatus(schedulePlanDetailDTO.getStatus());
|
||||
int flag = schedulePlanDetailService.update(planDetail);
|
||||
@ApiOperation(value = "医生批量修改排班时间段的可预约状态")
|
||||
public R<String> batchUpdateStatus(@RequestBody SchedulePlanDetailDTO schedulePlanDetailDTO) {
|
||||
if (CollectionUtils.isEmpty(schedulePlanDetailDTO.getSchedulePlanDetailIds())) {
|
||||
return R.fail("请选择时间段");
|
||||
}
|
||||
int timeoutCount = 0;
|
||||
List<SchedulePlanDetail> planDetailList = new ArrayList<>();
|
||||
for (long planDetailId : schedulePlanDetailDTO.getSchedulePlanDetailIds()) {
|
||||
SchedulePlanDetail planDetail = schedulePlanDetailService.getById(planDetailId);
|
||||
if (planDetail != null) {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
// 判断当前时间段是否已有居民预约
|
||||
if (StringUtils.equals("1", planDetail.getApplyState()) && StringUtils.equals("0", schedulePlanDetailDTO.getStatus())) {
|
||||
return R.fail(planDetail.getScheduleStartTime().format(formatter) + "~" + planDetail.getScheduleEndTime().format(formatter) + "已有居民预约,请取消订单后再修改");
|
||||
}
|
||||
// 判断时间段是否已过
|
||||
if (planDetail.getScheduleDate().equals(LocalDate.now()) && planDetail.getScheduleStartTime().isBefore(LocalTime.now())) {
|
||||
timeoutCount++;
|
||||
}
|
||||
planDetail.setStatus(schedulePlanDetailDTO.getStatus());
|
||||
planDetailList.add(planDetail);
|
||||
}
|
||||
}
|
||||
|
||||
if (timeoutCount == schedulePlanDetailDTO.getSchedulePlanDetailIds().size()) {
|
||||
return R.fail("该时间段已过不可修改");
|
||||
}
|
||||
int flag = 0;
|
||||
if (CollectionUtils.isNotEmpty(planDetailList)) {
|
||||
flag = schedulePlanDetailService.batchUpdate(planDetailList);
|
||||
}
|
||||
return flag < 0 ? R.fail() : R.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,6 +10,8 @@ import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.custominterface.Insert;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -24,6 +26,7 @@ import java.util.Objects;
|
||||
* @Author zh
|
||||
* @Date 2023-03-07
|
||||
*/
|
||||
@Api(tags = "APP及小程序健康咨询接口")
|
||||
@RestController
|
||||
@RequestMapping("/nurseApp/healthConsultation")
|
||||
public class HealthConsultationController extends BaseController {
|
||||
@ -78,6 +81,7 @@ public class HealthConsultationController extends BaseController {
|
||||
* @param healthConsultationOrderDTO 健康咨询订单
|
||||
* @return 结果
|
||||
*/
|
||||
@ApiOperation(value = "手机App和微信小程序健康咨询确认订单方法")
|
||||
@MobileRequestAuthorization
|
||||
@RepeatSubmit
|
||||
@PostMapping("/addHealthConsultationOrder")
|
||||
|
||||
@ -2,6 +2,7 @@ package com.xinelu.applet.dto.scheduleplan;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
@ -13,8 +14,8 @@ import lombok.Data;
|
||||
@Data
|
||||
public class SchedulePlanDetailDTO {
|
||||
|
||||
@ApiModelProperty("医生排班计划明细表id")
|
||||
private Long schedulePlanDetailId;
|
||||
@ApiModelProperty("医生排班计划明细表id列表")
|
||||
private List<Long> schedulePlanDetailIds;
|
||||
|
||||
@ApiModelProperty("启用状态(0:可预约 1:不可预约)")
|
||||
private String status;
|
||||
|
||||
@ -8,6 +8,7 @@ import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail;
|
||||
import com.xinelu.manage.mapper.scheduleplandetail.SchedulePlanDetailMapper;
|
||||
import com.xinelu.manage.vo.scheduleplan.SchedulePlanVO;
|
||||
import com.xinelu.manage.vo.scheduleplandetail.SchedulePlanDetailVO;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
@ -36,22 +37,31 @@ public class AppletSchedulePlanServiceImpl implements IAppletSchedulePlanService
|
||||
SchedulePlanDetail query = new SchedulePlanDetail();
|
||||
query.setDoctorId(schedulePlan.getDoctorId());
|
||||
query.setScheduleDate(schedulePlan.getWeekdays().get(i).getHealthConsultationDate());
|
||||
query.setAfter(1);
|
||||
List<SchedulePlanDetail> detailList = planDetailMapper.getList(query);
|
||||
List<SchedulePlanDetailVO> morningList = new ArrayList<>();
|
||||
List<SchedulePlanDetailVO> afternoonList = new ArrayList<>();
|
||||
LocalDate scheduleDate = schedulePlan.getWeekdays().get(i).getHealthConsultationDate();
|
||||
if (CollectionUtils.isNotEmpty(detailList)) {
|
||||
detailList.forEach(detail -> {
|
||||
// 可预约状态
|
||||
boolean status = true;
|
||||
if (StringUtils.equals("1", detail.getStatus()) || StringUtils.equals("1", detail.getApplyState())) {
|
||||
status = false;
|
||||
}
|
||||
if (scheduleDate.isEqual(LocalDate.now()) && detail.getScheduleStartTime().isBefore(LocalTime.now())) {
|
||||
status = false;
|
||||
}
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
|
||||
if (StringUtils.equals("1", detail.getType())) {
|
||||
morningList.add(SchedulePlanDetailVO.builder().schedulePlanDetailId(detail.getId())
|
||||
.scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter))
|
||||
.status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0", detail.getApplyState())).build());
|
||||
.status(status).build());
|
||||
}
|
||||
if (StringUtils.equals("2", detail.getType())) {
|
||||
afternoonList.add(SchedulePlanDetailVO.builder().schedulePlanDetailId(detail.getId())
|
||||
.scheduleTimeSlot(detail.getScheduleStartTime().format(formatter) + "~" + detail.getScheduleEndTime().format(formatter))
|
||||
.status(StringUtils.equals("0", detail.getStatus()) && StringUtils.equals("0", detail.getApplyState())).build());
|
||||
.status(status).build());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -0,0 +1,138 @@
|
||||
package com.xinelu.manage.controller.appointmentorderdetails;
|
||||
|
||||
|
||||
import com.xinelu.common.annotation.Log;
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.enums.BusinessType;
|
||||
import com.xinelu.common.utils.poi.ExcelUtil;
|
||||
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
|
||||
import com.xinelu.manage.dto.appointmentorderdetails.AppointmentOrderDetailsDTO;
|
||||
import com.xinelu.manage.service.appointmentorderdetails.IAppointmentOrderDetailsService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 预约订单明细Controller
|
||||
*
|
||||
* @author 纪寒
|
||||
* @date 2022-09-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/appointmentOrderDetails")
|
||||
public class AppointmentOrderDetailsController extends BaseController {
|
||||
@Resource
|
||||
private IAppointmentOrderDetailsService appointmentOrderDetailsService;
|
||||
|
||||
/**
|
||||
* 查询预约订单明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointmentOrderDetails:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(AppointmentOrderDetails appointmentOrderDetails) {
|
||||
startPage();
|
||||
List<AppointmentOrderDetails> list = appointmentOrderDetailsService.selectAppointmentOrderDetailsList(appointmentOrderDetails);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出预约订单明细列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointmentOrderDetails:export')")
|
||||
@Log(title = "预约订单明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, AppointmentOrderDetails appointmentOrderDetails) {
|
||||
List<AppointmentOrderDetails> list = appointmentOrderDetailsService.selectAppointmentOrderDetailsList(appointmentOrderDetails);
|
||||
ExcelUtil<AppointmentOrderDetails> util = new ExcelUtil<>(AppointmentOrderDetails.class);
|
||||
util.exportExcel(response, list, "预约订单明细数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预约订单明细详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointmentOrderDetails:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
||||
return AjaxResult.success(appointmentOrderDetailsService.selectAppointmentOrderDetailsById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增预约订单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointmentOrderDetails:add')")
|
||||
@Log(title = "预约订单明细", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody AppointmentOrderDetails appointmentOrderDetails) {
|
||||
return toAjax(appointmentOrderDetailsService.insertAppointmentOrderDetails(appointmentOrderDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改预约订单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointmentOrderDetails:edit')")
|
||||
@Log(title = "预约订单明细", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody AppointmentOrderDetails appointmentOrderDetails) {
|
||||
return toAjax(appointmentOrderDetailsService.updateAppointmentOrderDetails(appointmentOrderDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑删除预约订单明细
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:appointmentOrderDetails:remove')")
|
||||
@Log(title = "预约订单明细", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return appointmentOrderDetailsService.updateAppointmentOrderDetailsByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取预约订单明细详细信息
|
||||
*/
|
||||
@GetMapping(value = "/detailed")
|
||||
public AjaxResult getAppointmentOrderDetailsByDetailed(String orderNo) {
|
||||
if (StringUtils.isEmpty(orderNo)) {
|
||||
return AjaxResult.error("订单编号不能为空");
|
||||
}
|
||||
return AjaxResult.success(appointmentOrderDetailsService.getAppointmentOrderDetailsByDetailed(orderNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单编号查询预约订单信息
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @return 信息
|
||||
*/
|
||||
@GetMapping("/getCancelOrderInfo")
|
||||
public AjaxResult getCancelAppointmentOrderInfo(String orderNo) {
|
||||
if (StringUtils.isBlank(orderNo)) {
|
||||
return AjaxResult.error("请选择预约订单信息!");
|
||||
}
|
||||
return appointmentOrderDetailsService.getCancelAppointmentOrderInfo(orderNo);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改陪诊陪护预约订单信息
|
||||
*
|
||||
* @param appointmentOrderDetailsDTO 订单信息
|
||||
* @return com.xinyilu.common.core.domain.AjaxResult
|
||||
*/
|
||||
@PostMapping("/updateAppointmentOrderInfo")
|
||||
public AjaxResult updateAppointmentOrderInfo(@RequestBody AppointmentOrderDetailsDTO appointmentOrderDetailsDTO) {
|
||||
if (Objects.isNull(appointmentOrderDetailsDTO)) {
|
||||
return AjaxResult.error("保存预约订单信息不能为空!");
|
||||
}
|
||||
if (Objects.isNull(appointmentOrderDetailsDTO.getAppointOrderId()) || Objects.isNull(appointmentOrderDetailsDTO.getAppointOrderDetailsId())) {
|
||||
return AjaxResult.error("保存预约订单信息id不能为空!");
|
||||
}
|
||||
return appointmentOrderDetailsService.updateAppointmentOrderInfo(appointmentOrderDetailsDTO);
|
||||
}
|
||||
}
|
||||
@ -18,7 +18,6 @@ import io.swagger.annotations.ApiOperation;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -45,7 +44,7 @@ public class HospitalPersonInfoController extends BaseController {
|
||||
* 查询健康咨询-科室人员信息分页列表
|
||||
*/
|
||||
@ApiOperation("查询健康咨询-科室人员信息分页列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:list')")
|
||||
//@PreAuthorize("@ss.hasPermi('system:hospitalPerson:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(HospitalPersonInfoVO hospitalPersonInfo) {
|
||||
startPage();
|
||||
@ -57,7 +56,7 @@ public class HospitalPersonInfoController extends BaseController {
|
||||
* 查询健康咨询-科室人员信息列表
|
||||
*/
|
||||
@ApiOperation("查询健康咨询-科室人员信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:list')")
|
||||
//@PreAuthorize("@ss.hasPermi('system:hospitalPerson:list')")
|
||||
@GetMapping("/getList")
|
||||
public AjaxResult getList(HospitalPersonInfoVO hospitalPersonInfo) {
|
||||
List<HospitalPersonInfo> list = hospitalPersonInfoService.getList(hospitalPersonInfo);
|
||||
@ -68,7 +67,7 @@ public class HospitalPersonInfoController extends BaseController {
|
||||
* 导出健康咨询-科室人员信息列表
|
||||
*/
|
||||
@ApiOperation("导出健康咨询-科室人员信息列表")
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:export')")
|
||||
//@PreAuthorize("@ss.hasPermi('system:hospitalPerson:export')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, HospitalPersonInfoVO hospitalPersonInfo) {
|
||||
@ -91,7 +90,7 @@ public class HospitalPersonInfoController extends BaseController {
|
||||
* 新增健康咨询-科室人员信息
|
||||
*/
|
||||
@ApiOperation("新增健康咨询-科室人员信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:add')")
|
||||
//@PreAuthorize("@ss.hasPermi('system:hospitalPerson:add')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@Validated(Insert.class) @RequestBody HospitalPersonInfoDTO hospitalPersonInfo) {
|
||||
@ -102,7 +101,7 @@ public class HospitalPersonInfoController extends BaseController {
|
||||
* 修改健康咨询-科室人员信息
|
||||
*/
|
||||
@ApiOperation("修改健康咨询-科室人员信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:edit')")
|
||||
//@PreAuthorize("@ss.hasPermi('system:hospitalPerson:edit')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@Validated(Update.class) @RequestBody HospitalPersonInfoDTO hospitalPersonInfo) {
|
||||
@ -122,7 +121,7 @@ public class HospitalPersonInfoController extends BaseController {
|
||||
* 删除健康咨询-科室人员信息
|
||||
*/
|
||||
@ApiOperation("删除健康咨询-科室人员信息")
|
||||
@PreAuthorize("@ss.hasPermi('system:hospitalPerson:remove')")
|
||||
//@PreAuthorize("@ss.hasPermi('system:hospitalPerson:remove')")
|
||||
@Log(title = "健康咨询-科室人员信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
|
||||
@ -0,0 +1,83 @@
|
||||
package com.xinelu.manage.dto.appointmentorderdetails;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* @author ljh
|
||||
* @date 2023/5/19 17:38
|
||||
*/
|
||||
@Data
|
||||
public class AppointmentOrderDetailsDTO implements Serializable {
|
||||
private static final long serialVersionUID = 6239480658926598422L;
|
||||
/**
|
||||
* 预约订单主表id
|
||||
*/
|
||||
private Long appointOrderId;
|
||||
|
||||
/**
|
||||
* 预约订单明细表id
|
||||
*/
|
||||
private Long appointOrderDetailsId;
|
||||
|
||||
/**
|
||||
* 护理人姓名,院内陪护订单使用
|
||||
*/
|
||||
private String caregiverName;
|
||||
|
||||
/**
|
||||
* 护理人电话,院内陪护订单使用
|
||||
*/
|
||||
private String caregiverPhone;
|
||||
|
||||
/**
|
||||
* 医院名称,院内陪护订单使用
|
||||
*/
|
||||
private String hospitalName;
|
||||
|
||||
/**
|
||||
* 科室名称,院内陪护订单使用
|
||||
*/
|
||||
private String departmentName;
|
||||
|
||||
/**
|
||||
* 病床号,院内陪护订单使用
|
||||
*/
|
||||
private String hospitalBedNumber;
|
||||
|
||||
/**
|
||||
* 陪护开始时间,院内陪护订单使用,格式:yyyy-MM-dd
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate companionStartDate;
|
||||
|
||||
/**
|
||||
* 陪护结束时间,院内陪护订单使用,格式:yyyy-MM-dd
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private LocalDate companionEndDate;
|
||||
|
||||
/**
|
||||
* 陪护天数,院内陪护订单使用
|
||||
*/
|
||||
private Integer companionDays;
|
||||
|
||||
/**
|
||||
* 订单填写人姓名,院内陪护订单使用
|
||||
*/
|
||||
private String orderWriteName;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
/**
|
||||
* 护理项目价格
|
||||
*/
|
||||
private BigDecimal nurseItemPrice;
|
||||
}
|
||||
@ -0,0 +1,90 @@
|
||||
package com.xinelu.manage.service.appointmentorderdetails;
|
||||
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
|
||||
import com.xinelu.manage.dto.appointmentorderdetails.AppointmentOrderDetailsDTO;
|
||||
import com.xinelu.manage.vo.appointmentorderdetails.AppointmentOrderDetailsVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预约订单明细Service接口
|
||||
*
|
||||
* @author 纪寒
|
||||
* @date 2022-09-05
|
||||
*/
|
||||
public interface IAppointmentOrderDetailsService {
|
||||
/**
|
||||
* 查询预约订单明细
|
||||
*
|
||||
* @param id 预约订单明细主键
|
||||
* @return 预约订单明细
|
||||
*/
|
||||
AppointmentOrderDetails selectAppointmentOrderDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询预约订单明细列表
|
||||
*
|
||||
* @param appointmentOrderDetails 预约订单明细
|
||||
* @return 预约订单明细集合
|
||||
*/
|
||||
List<AppointmentOrderDetails> selectAppointmentOrderDetailsList(AppointmentOrderDetails appointmentOrderDetails);
|
||||
|
||||
/**
|
||||
* 新增预约订单明细
|
||||
*
|
||||
* @param appointmentOrderDetails 预约订单明细
|
||||
* @return 结果
|
||||
*/
|
||||
int insertAppointmentOrderDetails(AppointmentOrderDetails appointmentOrderDetails);
|
||||
|
||||
/**
|
||||
* 修改预约订单明细
|
||||
*
|
||||
* @param appointmentOrderDetails 预约订单明细
|
||||
* @return 结果
|
||||
*/
|
||||
int updateAppointmentOrderDetails(AppointmentOrderDetails appointmentOrderDetails);
|
||||
|
||||
/**
|
||||
* 逻辑批量删除预约订单明细
|
||||
*
|
||||
* @param ids 需要删除的预约订单明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateAppointmentOrderDetailsByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除预约订单明细信息
|
||||
*
|
||||
* @param id 预约订单明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteAppointmentOrderDetailsById(Long id);
|
||||
|
||||
/**
|
||||
* 预约订单管理列表页面查看明细
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @return com.xinyilu.base.vo.appointmentorderdetails.AppointmentOrderDetailsVO
|
||||
**/
|
||||
AppointmentOrderDetailsVO getAppointmentOrderDetailsByDetailed(String orderNo);
|
||||
|
||||
|
||||
/**
|
||||
* 根据订单编号查询预约订单信息
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @return 信息
|
||||
*/
|
||||
AjaxResult getCancelAppointmentOrderInfo(String orderNo);
|
||||
|
||||
/**
|
||||
* 修改陪诊陪护预约订单信息
|
||||
*
|
||||
* @param appointmentOrderDetailsDTO 预约订单信息
|
||||
* @return 结果
|
||||
*/
|
||||
AjaxResult updateAppointmentOrderInfo(AppointmentOrderDetailsDTO appointmentOrderDetailsDTO);
|
||||
}
|
||||
@ -0,0 +1,219 @@
|
||||
package com.xinelu.manage.service.appointmentorderdetails.impl;
|
||||
|
||||
|
||||
import com.xinelu.common.core.domain.AjaxResult;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.bean.BeanUtils;
|
||||
import com.xinelu.common.utils.regex.RegexUtil;
|
||||
import com.xinelu.manage.domain.appointmentorder.AppointmentOrder;
|
||||
import com.xinelu.manage.domain.appointmentorderconsumable.AppointmentOrderConsumable;
|
||||
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
|
||||
import com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo;
|
||||
import com.xinelu.manage.dto.appointmentorderdetails.AppointmentOrderDetailsDTO;
|
||||
import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper;
|
||||
import com.xinelu.manage.mapper.appointmentorderconsumable.AppointmentOrderConsumableMapper;
|
||||
import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper;
|
||||
import com.xinelu.manage.mapper.patientdiseaseinfo.PatientDiseaseInfoMapper;
|
||||
import com.xinelu.manage.service.appointmentorderdetails.IAppointmentOrderDetailsService;
|
||||
import com.xinelu.manage.vo.appointmentorderdetails.AppointmentOrderDetailsVO;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 预约订单明细Service业务层处理
|
||||
*
|
||||
* @author 纪寒
|
||||
* @date 2022-09-05
|
||||
*/
|
||||
@Service
|
||||
public class AppointmentOrderDetailsServiceImpl implements IAppointmentOrderDetailsService {
|
||||
@Resource
|
||||
private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper;
|
||||
@Resource
|
||||
private AppointmentOrderConsumableMapper appointmentOrderConsumableMapper;
|
||||
@Resource
|
||||
private PatientDiseaseInfoMapper patientDiseaseInfoMapper;
|
||||
@Resource
|
||||
private AppointmentOrderMapper appointmentOrderMapper;
|
||||
@Resource
|
||||
private RegexUtil regexUtil;
|
||||
|
||||
/**
|
||||
* 查询预约订单明细
|
||||
*
|
||||
* @param id 预约订单明细主键
|
||||
* @return 预约订单明细
|
||||
*/
|
||||
@Override
|
||||
public AppointmentOrderDetails selectAppointmentOrderDetailsById(Long id) {
|
||||
return appointmentOrderDetailsMapper.selectAppointmentOrderDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询预约订单明细列表
|
||||
*
|
||||
* @param appointmentOrderDetails 预约订单明细
|
||||
* @return 预约订单明细
|
||||
*/
|
||||
@Override
|
||||
public List<AppointmentOrderDetails> selectAppointmentOrderDetailsList(AppointmentOrderDetails appointmentOrderDetails) {
|
||||
return appointmentOrderDetailsMapper.selectAppointmentOrderDetailsList(appointmentOrderDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增预约订单明细
|
||||
*
|
||||
* @param appointmentOrderDetails 预约订单明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertAppointmentOrderDetails(AppointmentOrderDetails appointmentOrderDetails) {
|
||||
appointmentOrderDetails.setCreateTime(LocalDateTime.now());
|
||||
return appointmentOrderDetailsMapper.insertAppointmentOrderDetails(appointmentOrderDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改预约订单明细
|
||||
*
|
||||
* @param appointmentOrderDetails 预约订单明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateAppointmentOrderDetails(AppointmentOrderDetails appointmentOrderDetails) {
|
||||
appointmentOrderDetails.setUpdateTime(LocalDateTime.now());
|
||||
return appointmentOrderDetailsMapper.updateAppointmentOrderDetails(appointmentOrderDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 逻辑批量删除预约订单明细
|
||||
*
|
||||
* @param ids 需要删除的预约订单明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateAppointmentOrderDetailsByIds(Long[] ids) {
|
||||
int appointmentOrderDetailsByIds = appointmentOrderDetailsMapper.updateAppointmentOrderDetailsByIds(ids);
|
||||
if (appointmentOrderDetailsByIds <= 0) {
|
||||
throw new ServiceException("删测试项目信息失败");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除预约订单明细信息
|
||||
*
|
||||
* @param id 预约订单明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteAppointmentOrderDetailsById(Long id) {
|
||||
return appointmentOrderDetailsMapper.deleteAppointmentOrderDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约订单管理列表页面查看明细
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @return com.xinyilu.base.vo.appointmentorderdetails.AppointmentOrderDetailsVO
|
||||
**/
|
||||
@Override
|
||||
public AppointmentOrderDetailsVO getAppointmentOrderDetailsByDetailed(String orderNo) {
|
||||
//根据订单编号查询预约订单管理列表页面查看明细
|
||||
AppointmentOrderDetailsVO appointmentOrderDetails = appointmentOrderDetailsMapper.getAppointmentOrderDetailsByDetailed(orderNo);
|
||||
if (Objects.isNull(appointmentOrderDetails)) {
|
||||
return null;
|
||||
}
|
||||
//健康状况
|
||||
List<PatientDiseaseInfo> patientDiseaseInfo = patientDiseaseInfoMapper.selectPatientDiseaseInfoByOrderNo(orderNo);
|
||||
if (CollectionUtils.isNotEmpty(patientDiseaseInfo)) {
|
||||
List<String> diseaseNameList = patientDiseaseInfo.stream().filter(Objects::nonNull).map(PatientDiseaseInfo::getDiseaseName).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
String diseaseName = String.join(",", diseaseNameList);
|
||||
appointmentOrderDetails.setDiseaseName(diseaseName);
|
||||
}
|
||||
//获取订单明细表id查询耗材包详情信息集合
|
||||
if (Objects.isNull(appointmentOrderDetails.getAppointOrderDetailsId())) {
|
||||
return appointmentOrderDetails;
|
||||
}
|
||||
List<AppointmentOrderConsumable> appointmentOrderConsumableList = appointmentOrderConsumableMapper.getByAppointOrderDetailsId(appointmentOrderDetails.getAppointOrderDetailsId());
|
||||
if (CollectionUtils.isEmpty(appointmentOrderConsumableList)) {
|
||||
return appointmentOrderDetails;
|
||||
}
|
||||
appointmentOrderDetails.setAppointmentOrderConsumableList(appointmentOrderConsumableList);
|
||||
return appointmentOrderDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单编号查询预约订单信息
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
* @return 信息
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getCancelAppointmentOrderInfo(String orderNo) {
|
||||
return AjaxResult.success(appointmentOrderDetailsMapper.getCancelAppointmentOrderInfo(orderNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改陪诊陪护预约订单信息
|
||||
*
|
||||
* @param appointmentOrderDetailsDTO 预约订单信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public AjaxResult updateAppointmentOrderInfo(AppointmentOrderDetailsDTO appointmentOrderDetailsDTO) {
|
||||
//判断时间数量是否符合
|
||||
if (Objects.nonNull(appointmentOrderDetailsDTO.getCompanionStartDate()) && Objects.nonNull(appointmentOrderDetailsDTO.getCompanionEndDate())) {
|
||||
if (appointmentOrderDetailsDTO.getCompanionStartDate().isBefore(LocalDate.now())) {
|
||||
return AjaxResult.error("时间错误,时间只能选择今天以及以后的时间!");
|
||||
}
|
||||
long companionDays = ChronoUnit.DAYS.between(appointmentOrderDetailsDTO.getCompanionStartDate(), appointmentOrderDetailsDTO.getCompanionEndDate()) + 1;
|
||||
if (Objects.nonNull(appointmentOrderDetailsDTO.getCompanionDays()) && appointmentOrderDetailsDTO.getCompanionDays() != companionDays) {
|
||||
return AjaxResult.error("数量与时间不符合,请重新调整时间!");
|
||||
}
|
||||
}
|
||||
//预约天数
|
||||
int companionDays = Objects.isNull(appointmentOrderDetailsDTO.getCompanionDays()) ? 0 : appointmentOrderDetailsDTO.getCompanionDays();
|
||||
//护理项目价格
|
||||
BigDecimal nurseItemPrice = Objects.isNull(appointmentOrderDetailsDTO.getNurseItemPrice()) ? BigDecimal.ZERO : appointmentOrderDetailsDTO.getNurseItemPrice();
|
||||
if (Objects.nonNull(appointmentOrderDetailsDTO.getTotalPrice()) && appointmentOrderDetailsDTO.getTotalPrice().compareTo(BigDecimal.valueOf(companionDays).multiply(nurseItemPrice)) != 0) {
|
||||
return AjaxResult.error("总价格与实际应付价格不符!");
|
||||
}
|
||||
//判断手机号
|
||||
if (StringUtils.isNotBlank(appointmentOrderDetailsDTO.getCaregiverPhone())) {
|
||||
boolean regexPhone = regexUtil.regexPhone(appointmentOrderDetailsDTO.getCaregiverPhone());
|
||||
if (BooleanUtils.isFalse(regexPhone)) {
|
||||
return AjaxResult.error("您输入的联系电话" + appointmentOrderDetailsDTO.getCaregiverPhone() + "不正确,请重新输入!");
|
||||
}
|
||||
}
|
||||
AppointmentOrder appointmentOrder = new AppointmentOrder();
|
||||
BeanUtils.copyProperties(appointmentOrderDetailsDTO, appointmentOrder);
|
||||
appointmentOrder.setId(appointmentOrderDetailsDTO.getAppointOrderId());
|
||||
appointmentOrder.setUpdateTime(LocalDateTime.now());
|
||||
int updateAppointmentOrder = appointmentOrderMapper.updateAppointmentOrder(appointmentOrder);
|
||||
if (updateAppointmentOrder <= 0) {
|
||||
throw new ServiceException("修改订单主表信息失败,请联系管理员!");
|
||||
}
|
||||
AppointmentOrderDetails appointmentOrderDetails = new AppointmentOrderDetails();
|
||||
BeanUtils.copyProperties(appointmentOrderDetailsDTO, appointmentOrderDetails);
|
||||
appointmentOrderDetails.setId(appointmentOrderDetailsDTO.getAppointOrderDetailsId());
|
||||
appointmentOrderDetails.setUpdateTime(LocalDateTime.now());
|
||||
int updateAppointmentOrderDetails = appointmentOrderDetailsMapper.updateAppointmentOrderDetails(appointmentOrderDetails);
|
||||
if (updateAppointmentOrderDetails <= 0) {
|
||||
throw new ServiceException("修改订单明细表信息失败,请联系管理员!");
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
@ -7,15 +7,12 @@ import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
|
||||
import com.xinelu.manage.dto.goodsorder.GoodsOrderDTO;
|
||||
import com.xinelu.manage.mapper.goodsOrder.GoodsOrderMapper;
|
||||
import com.xinelu.manage.service.goodsOrder.IGoodsOrderService;
|
||||
import com.xinelu.manage.vo.goodsorder.AppGoodsOrderVO;
|
||||
import com.xinelu.manage.vo.goodsorder.GoodsInfoOrderVO;
|
||||
import com.xinelu.manage.vo.goodsorder.GoodsOrderDetailsVO;
|
||||
import com.xinelu.manage.vo.goodsorder.GoodsOrderRefundVO;
|
||||
import com.xinelu.manage.vo.goodsorder.GoodsOrderVO;
|
||||
import com.xinelu.manage.vo.goodsorder.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
@ -137,18 +134,20 @@ public class GoodsOrderServiceImpl implements IGoodsOrderService {
|
||||
return goodsOrderMapper.getGoodsOrderRefund(goodsOrderId);
|
||||
}
|
||||
|
||||
@Override public List<AppGoodsOrderVO> getConsultationOrders(GoodsOrderDTO goodsOrderDTO) {
|
||||
return goodsOrderMapper.getConsultationOrders(goodsOrderDTO);
|
||||
}
|
||||
@Override
|
||||
public List<AppGoodsOrderVO> getConsultationOrders(GoodsOrderDTO goodsOrderDTO) {
|
||||
return goodsOrderMapper.getConsultationOrders(goodsOrderDTO);
|
||||
}
|
||||
|
||||
@Override public int updateStatus(GoodsOrderDTO goodsOrderDTO) {
|
||||
GoodsOrder goodsOrder = new GoodsOrder();
|
||||
goodsOrder.setId(goodsOrderDTO.getGoodsOrderId());
|
||||
goodsOrder.setOrderStatus(goodsOrderDTO.getOrderStatus());
|
||||
return goodsOrderMapper.updateGoodsOrder(goodsOrder);
|
||||
}
|
||||
@Override
|
||||
public int updateStatus(GoodsOrderDTO goodsOrderDTO) {
|
||||
GoodsOrder goodsOrder = new GoodsOrder();
|
||||
goodsOrder.setId(goodsOrderDTO.getGoodsOrderId());
|
||||
goodsOrder.setOrderStatus(goodsOrderDTO.getOrderStatus());
|
||||
return goodsOrderMapper.updateGoodsOrder(goodsOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 查询订单信息具体明细
|
||||
*
|
||||
* @param orderNo 订单编号
|
||||
|
||||
@ -15,4 +15,8 @@ public interface ISchedulePlanDetailService {
|
||||
List<SchedulePlanDetail> getList(SchedulePlanDetail planDetail);
|
||||
|
||||
int update(SchedulePlanDetail planDetail);
|
||||
|
||||
int batchUpdate(List<SchedulePlanDetail> planDetailList);
|
||||
|
||||
SchedulePlanDetail getById(Long id);
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import com.xinelu.manage.domain.scheduleplandetail.SchedulePlanDetail;
|
||||
import com.xinelu.manage.mapper.scheduleplandetail.SchedulePlanDetailMapper;
|
||||
import com.xinelu.manage.service.scheduleplandetail.ISchedulePlanDetailService;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -29,6 +30,18 @@ public class SchedulePlanDetailServiceImpl implements ISchedulePlanDetailService
|
||||
@Override public int update(SchedulePlanDetail planDetail) {
|
||||
return planDetailMapper.updateByPrimaryKeySelective(planDetail);
|
||||
}
|
||||
|
||||
@Override public int batchUpdate(List<SchedulePlanDetail> planDetailList) {
|
||||
AtomicInteger flag = new AtomicInteger();
|
||||
planDetailList.forEach(planDetail -> {
|
||||
flag.addAndGet(planDetailMapper.updateByPrimaryKeySelective(planDetail));
|
||||
});
|
||||
return flag.get();
|
||||
}
|
||||
|
||||
@Override public SchedulePlanDetail getById(Long id) {
|
||||
return planDetailMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -166,9 +166,8 @@
|
||||
LEFT JOIN patient_info pi ON pi.id = ao.patient_id
|
||||
LEFT JOIN nurse_station_person nsp ON nsp.id = ao.nurse_station_person_id
|
||||
<where>
|
||||
pi.del_flag = 0
|
||||
and ao.del_flag = 0
|
||||
and aod.del_flag = 0
|
||||
ao.del_flag = 0
|
||||
and aod.del_flag = 0
|
||||
<if test="orderNo != null and orderNo != ''">
|
||||
and ao.order_no = #{orderNo}
|
||||
</if>
|
||||
|
||||
@ -499,7 +499,6 @@
|
||||
</if>
|
||||
</where>
|
||||
and gr.del_flag = 0
|
||||
and god.del_flag = 0
|
||||
</select>
|
||||
|
||||
<select id="selectGoodsOrderDetailsByOrderNo"
|
||||
|
||||
@ -153,7 +153,7 @@
|
||||
and DATE_FORMAT(schedule_end_time, '%H%i') >= DATE_FORMAT(#{scheduleEndTime}, '%H%i')
|
||||
</if>
|
||||
<if test="after != null">
|
||||
and DATE_FORMAT(schedule_end_time, '%H%i') < DATE_FORMAT(now(), '%H%i')
|
||||
and DATE_FORMAT(schedule_start_time, '%H%i') > DATE_FORMAT(now(), '%H%i')
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=CHAR}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user