添加服务申请相关接口;
This commit is contained in:
parent
e42bc824da
commit
25a7771c03
@ -0,0 +1,70 @@
|
||||
package com.xinelu.web.controller.applet;
|
||||
|
||||
import com.xinelu.common.core.controller.BaseController;
|
||||
import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.common.core.page.TableDataInfo;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 居民小程序服务申请控制器
|
||||
* @Date 2023-10-07 007 11:30
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Api(tags = "服务申请控制器")
|
||||
@RestController
|
||||
@RequestMapping("/applet/service/apply")
|
||||
public class ResidentServiceApplyController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IResidentServiceAppletService residentServiceAppletService;
|
||||
|
||||
@ApiOperation("提交服务申请(批量)")
|
||||
@PostMapping("/save")
|
||||
public R<?> save(@RequestBody ResidentServiceApplyBody body) {
|
||||
if (body == null || body.getFormList() == null || body.getFormList().size() == 0) {
|
||||
return R.fail("请求参数不能为空");
|
||||
}
|
||||
residentServiceAppletService.insert(body);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("取消服务申请")
|
||||
@GetMapping("/cancel/{bookingNo}")
|
||||
public R<?> cancel(@PathVariable String bookingNo) {
|
||||
residentServiceAppletService.cancel(bookingNo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("服务申请列表")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo performanceBookingList(@RequestBody ApplyQuery query) {
|
||||
if (StringUtils.isBlank(query.getIdentity())) {
|
||||
throw new ServiceException("居民身份证号不能为空");
|
||||
}
|
||||
try {
|
||||
startPage();
|
||||
return getDataTable(residentServiceAppletService.findList(query));
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("服务申请详情")
|
||||
@GetMapping("/detail/{bookingNo}")
|
||||
public R<ResidentServiceApplyVo> performanceBookingDetail(@PathVariable String bookingNo) {
|
||||
return R.ok(residentServiceAppletService.detail(bookingNo));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.disease.web.controller.bussiness;
|
||||
|
||||
import com.disease.business.domain.entity.ServiceProject;
|
||||
import com.disease.business.service.IPerformanceSchemaService;
|
||||
import com.disease.business.service.IServiceProjectService;
|
||||
import com.disease.common.core.controller.BaseController;
|
||||
import com.disease.common.core.domain.R;
|
||||
import com.disease.common.core.page.TableDataInfo;
|
||||
import com.disease.common.utils.uuid.IdUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author gaoyu
|
||||
* @description 服务项目管理控制器
|
||||
* @date 2022-10-26 10:29
|
||||
*/
|
||||
@Api(tags = "服务项目管理控制器")
|
||||
@RestController
|
||||
@RequestMapping("/business/serviceProject")
|
||||
public class ServiceProjectController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private IServiceProjectService serviceProjectService;
|
||||
@Resource
|
||||
private IPerformanceSchemaService performanceSchemaService;
|
||||
|
||||
@ApiOperation("服务项目分页列表")
|
||||
@GetMapping("list")
|
||||
public TableDataInfo list(ServiceProject project) {
|
||||
startPage();
|
||||
List<ServiceProject> list = serviceProjectService.findList(project);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ApiOperation("新增服务项目")
|
||||
@PostMapping("add")
|
||||
public R<String> add(@RequestBody ServiceProject project) {
|
||||
if (serviceProjectService.checkSameProjectName(project.getProjectName(), project.getDeptId(), null)) {
|
||||
return R.fail("【" + project.getDeptName() + "】已存在服务项目【" + project.getProjectName() + "】,不能重复添加");
|
||||
}
|
||||
project.setProjectId(IdUtils.fastSimpleUUID());
|
||||
project.setCreateBy(getUsername());
|
||||
project.setCreateTime(new Date());
|
||||
project.setDelFlag("0");
|
||||
return serviceProjectService.insert(project) > 0 ? R.ok() : R.fail("保存失败");
|
||||
}
|
||||
|
||||
@ApiOperation("修改服务项目")
|
||||
@PostMapping("update")
|
||||
public R<?> update(@RequestBody ServiceProject project) {
|
||||
if (serviceProjectService.checkSameProjectName(project.getProjectName(), project.getDeptId(), project.getProjectId())) {
|
||||
return R.fail("【" + project.getDeptName() + "】已存在服务项目【" + project.getProjectName() + "】,不能重复添加");
|
||||
}
|
||||
project.setUpdateBy(getUsername());
|
||||
serviceProjectService.update(project);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("修改服务项目状态")
|
||||
@PostMapping("changeStatus")
|
||||
public R<?> changeStatus(@RequestBody ServiceProject project) {
|
||||
project.setUpdateBy(getUsername());
|
||||
serviceProjectService.update(project);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("逻辑删除服务项目")
|
||||
@PostMapping("delete/{projectId}")
|
||||
@ApiImplicitParam(name="projectId", value = "服务项目编号", required = true, dataTypeClass = String.class)
|
||||
public R<?> delete(@PathVariable String projectId) {
|
||||
ServiceProject project = new ServiceProject();
|
||||
project.setProjectId(projectId);
|
||||
project.setDelFlag("1");
|
||||
project.setUpdateBy(getUsername());
|
||||
serviceProjectService.delete(project);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("获取复诊服务项目列表")
|
||||
@GetMapping("/getList/{identity}")
|
||||
public R<List<ServiceProject>> getList(@PathVariable String identity) {
|
||||
try {
|
||||
return R.ok(performanceSchemaService.getFormList(identity));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,8 +6,10 @@ import com.xinelu.common.core.domain.R;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentRescindApplyVo;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentRescindApplyService;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentSignAppletService;
|
||||
import com.xinelu.manage.service.patientinfo.IPatientInfoService;
|
||||
import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
|
||||
@ -27,42 +29,49 @@ public class FDController {
|
||||
private IResidentRescindApplyService residentRescindApplyService;
|
||||
@Resource
|
||||
private IResidentSignAppletService residentSignAppletService;
|
||||
@Resource
|
||||
private IResidentServiceAppletService residentServiceAppletService;
|
||||
@Resource
|
||||
private IPatientInfoService patientInfoService;
|
||||
|
||||
@ApiOperation("服务申请列表")
|
||||
@PostMapping("/performanceBooking/list")
|
||||
public R<PageInfo<ResidentServiceApplyVo>> performanceBookingList(@RequestBody ApplyQuery query) {
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
// query.setBookingStatus("0");
|
||||
return R.ok(PageInfo.of(residentServiceAppletService.findList(query)));
|
||||
}
|
||||
@ApiOperation("服务申请详情")
|
||||
@GetMapping("/performanceBooking/detail/{bookingNo}")
|
||||
public R<ResidentServiceApplyVo> performanceBookingDetail(@PathVariable String bookingNo) {
|
||||
return R.ok(residentServiceAppletService.detail(bookingNo));
|
||||
}
|
||||
|
||||
// @ApiOperation("履约申请列表")
|
||||
// @PostMapping("/performanceBooking/list")
|
||||
// public R<PageInfo<PerformanceBookingVo>> performanceBookingList(@RequestBody ApplyQuery query) {
|
||||
// return R.ok(performanceBookingService.findByBody(query));
|
||||
// }
|
||||
// @ApiOperation("履约申请详情")
|
||||
// @GetMapping("/performanceBooking/detail/{bookingNo}")
|
||||
// public R<PerformanceBookingVo> performanceBookingDetail(@PathVariable String bookingNo) {
|
||||
// return R.ok(performanceBookingService.detail(bookingNo));
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("更新履约申请审批结果")
|
||||
// @PostMapping("/performanceBooking/approval")
|
||||
// public R<?> performanceBookingApproval(@RequestBody ApprovalBody body) {
|
||||
// if (body == null) {
|
||||
// return R.fail("请求参数不能为空");
|
||||
// }
|
||||
// performanceBookingService.updateFd(body);
|
||||
// return R.ok();
|
||||
// }
|
||||
//
|
||||
// @ApiOperation("更新履约完成时间")
|
||||
// @GetMapping("/performanceBooking/approval/complete/{bookingNo}")
|
||||
// public R<?> performanceBookingApprovalComplete(@PathVariable String bookingNo) {
|
||||
// performanceBookingService.updateComplete(bookingNo);
|
||||
// return R.ok();
|
||||
// }
|
||||
@ApiOperation("更新服务申请审批结果")
|
||||
@PostMapping("/performanceBooking/approval")
|
||||
public R<?> performanceBookingApproval(@RequestBody ApprovalBody body) {
|
||||
if (body == null) {
|
||||
return R.fail("请求参数不能为空");
|
||||
}
|
||||
residentServiceAppletService.updateFd(body);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("更新服务完成时间")
|
||||
@GetMapping("/performanceBooking/approval/complete/{bookingNo}")
|
||||
public R<?> performanceBookingApprovalComplete(@PathVariable String bookingNo) {
|
||||
residentServiceAppletService.updateComplete(bookingNo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ApiOperation("解约申请列表")
|
||||
@PostMapping("/rescindApply/list")
|
||||
public R<PageInfo<ResidentRescindApplyVo>> rescindApplyList(@RequestBody ApplyQuery query) {
|
||||
if(StringUtils.isBlank(query.getUserNo())) {
|
||||
return R.fail("医生编号不能为空");
|
||||
}
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
query.setBookingStatus("0");
|
||||
return R.ok(PageInfo.of(residentRescindApplyService.findList(query)));
|
||||
}
|
||||
@ApiOperation("解约申请详情")
|
||||
@ -84,7 +93,11 @@ public class FDController {
|
||||
@ApiOperation("签约申请列表")
|
||||
@PostMapping("/signBooking/list")
|
||||
public R<PageInfo<ResidentSignApplyVo>> signBookingList(@RequestBody ApplyQuery query) {
|
||||
if(StringUtils.isBlank(query.getUserNo())) {
|
||||
return R.fail("医生编号不能为空");
|
||||
}
|
||||
PageHelper.startPage(query.getPageNum(), query.getPageSize());
|
||||
query.setBookingStatus("0");
|
||||
return R.ok(PageInfo.of(residentSignAppletService.findList(query)));
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
package com.xinelu.familydoctor.applet.mapper;
|
||||
|
||||
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.ResidentServiceApplyEntity;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 服务申请Mapper
|
||||
* @Date 2023-10-07 007 11:38
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
public interface ResidentServiceApplyMapper {
|
||||
/**
|
||||
* 查询
|
||||
*
|
||||
* @param query:
|
||||
* @return List<FdSignBookingVo>
|
||||
* @author lixinying
|
||||
* @date 2022/11/21 16:00
|
||||
*/
|
||||
List<ResidentServiceApplyVo> findByBody(ApplyQuery query);
|
||||
|
||||
/**
|
||||
* 审批
|
||||
*
|
||||
* @param body:
|
||||
* @return Integer
|
||||
* @author lixinying
|
||||
* @date 2022/11/21 17:22
|
||||
*/
|
||||
Integer updateEx(ApprovalBody body);
|
||||
|
||||
/**
|
||||
* @return com.xinelu.mp.sign.pojo.vo.FdSignBookingVo
|
||||
* @Author mengkuiliang
|
||||
* @Description 查询未完成的服务申请
|
||||
* @Date 2022-11-22 10:58
|
||||
* @Param [identity]
|
||||
**/
|
||||
ResidentServiceApplyVo getServiceBookingByIdentity(String identity);
|
||||
|
||||
/**
|
||||
* @return com.xinelu.mp.sign.pojo.vo.FdSignBookingVo
|
||||
* @Author mengkuiliang
|
||||
* @Description 签约申请详情
|
||||
* @Date 2022-11-23 10:33
|
||||
* @Param [bookingNo]
|
||||
**/
|
||||
ResidentServiceApplyVo detail(String bookingNo);
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @Author mengkuiliang
|
||||
* @Description 取消签约申请
|
||||
* @Date 2022-11-23 14:44
|
||||
* @Param [bookingNo]
|
||||
**/
|
||||
void cancel(String bookingNo);
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @Author mengkuiliang
|
||||
* @Description 新增
|
||||
* @Date 2023-09-26 026 10:42
|
||||
* @Param [entity]
|
||||
**/
|
||||
void insert(ResidentServiceApplyEntity entity);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 更新服务完成时间
|
||||
* @Date 2022-11-29 14:22
|
||||
* @Param [applyNo]
|
||||
* @return void
|
||||
**/
|
||||
void updateComplete(String bookingNo);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 批量插入
|
||||
* @Date 2023-10-07 007 14:47
|
||||
* @Param [entity]
|
||||
* @return void
|
||||
**/
|
||||
void batchInsert(List<ResidentServiceApplyEntity> entity);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ public interface ResidentSignApplyMapper {
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 查询签约申请记录
|
||||
* @Description 查询未完成的签约申请
|
||||
* @Date 2022-11-22 10:58
|
||||
* @Param [identity]
|
||||
* @return com.xinelu.mp.sign.pojo.vo.FdSignBookingVo
|
||||
|
||||
@ -0,0 +1,99 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.body;
|
||||
|
||||
import com.xinelu.familydoctor.applet.pojo.dto.ResidentServiceFormApplyDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 居民服务申请请求对象
|
||||
* @Date 2023-10-07 007 11:44
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
@ApiModel("居民服务申请请求对象")
|
||||
public class ResidentServiceApplyBody {
|
||||
|
||||
/**
|
||||
* 居民编号
|
||||
*/
|
||||
@ApiModelProperty(value = "居民业务主键")
|
||||
private String patientId;
|
||||
|
||||
/**
|
||||
* 居民姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "居民姓名", required = true)
|
||||
private String residentName;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "居民身份证号", required = true)
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 预约服务方式1:家庭2:门诊3:电话99:其他
|
||||
*/
|
||||
@ApiModelProperty(value = "预约服务方式1:家庭2:门诊3:电话99:其他", required = true)
|
||||
private String serviceWay;
|
||||
|
||||
/**
|
||||
* 预约时间
|
||||
*/
|
||||
@ApiModelProperty(value = "预约时间", required = true)
|
||||
private Date bookingTime;
|
||||
|
||||
/**
|
||||
* 预约机构编号
|
||||
*/
|
||||
@ApiModelProperty(value = "预约机构编号", required = true)
|
||||
private String orgNo;
|
||||
|
||||
/**
|
||||
* 预约机构名称
|
||||
*/
|
||||
@ApiModelProperty(value = "预约机构名称", required = true)
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 预约团队编号
|
||||
*/
|
||||
@ApiModelProperty(value = "预约团队编号", required = true)
|
||||
private String teamNo;
|
||||
|
||||
/**
|
||||
* 预约团队名称
|
||||
*/
|
||||
@ApiModelProperty(value = "预约团队名称", required = true)
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 预约医生编号
|
||||
*/
|
||||
@ApiModelProperty(value = "预约医生编号", required = true)
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 预约医生姓名
|
||||
*/
|
||||
@ApiModelProperty(value = "预约医生姓名", required = true)
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 服务项集合
|
||||
*/
|
||||
List<ResidentServiceFormApplyDto> formList;
|
||||
|
||||
}
|
||||
@ -3,7 +3,6 @@ package com.xinelu.familydoctor.applet.pojo.body;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.dto;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 居民服务申请服务项对象
|
||||
* @Date 2023-10-07 007 13:33
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
public class ResidentServiceFormApplyDto {
|
||||
/**
|
||||
* 预约服务包编号
|
||||
*/
|
||||
@ApiModelProperty(value = "预约服务包编号", required = true)
|
||||
private String packageNo;
|
||||
|
||||
/**
|
||||
* 预约服务包名称
|
||||
*/
|
||||
@ApiModelProperty(value = "预约服务包名称", required = true)
|
||||
private String packageName;
|
||||
|
||||
/**
|
||||
* 预约服务项目编号
|
||||
*/
|
||||
@ApiModelProperty(value = "预约服务项目编号", required = true)
|
||||
private String formNo;
|
||||
|
||||
/**
|
||||
* 预约服务项目名称
|
||||
*/
|
||||
@ApiModelProperty(value = "预约服务项目名称", required = true)
|
||||
private String formName;
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 居民服务预约对象
|
||||
* @Date 2023-10-07 007 11:42
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Data
|
||||
public class ResidentServiceApplyEntity implements Serializable {
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务申请编号
|
||||
*/
|
||||
private String bookingNo;
|
||||
|
||||
/**
|
||||
* 居民编号
|
||||
*/
|
||||
private String patientId;
|
||||
|
||||
/**
|
||||
* 居民姓名
|
||||
*/
|
||||
private String residentName;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 预约服务包编号
|
||||
*/
|
||||
private String packageNo;
|
||||
|
||||
/**
|
||||
* 预约服务包名称
|
||||
*/
|
||||
private String packageName;
|
||||
|
||||
/**
|
||||
* 预约服务项目编号
|
||||
*/
|
||||
private String formNo;
|
||||
|
||||
/**
|
||||
* 预约服务项目名称
|
||||
*/
|
||||
private String formName;
|
||||
|
||||
/**
|
||||
* 预约服务方式1:家庭2:门诊3:电话99:其他
|
||||
*/
|
||||
private String serviceWay;
|
||||
|
||||
/**
|
||||
* 预约时间
|
||||
*/
|
||||
private Date bookingTime;
|
||||
|
||||
/**
|
||||
* 预约机构编号
|
||||
*/
|
||||
private String orgNo;
|
||||
|
||||
/**
|
||||
* 预约机构名称
|
||||
*/
|
||||
private String orgName;
|
||||
|
||||
/**
|
||||
* 预约团队编号
|
||||
*/
|
||||
private String teamNo;
|
||||
|
||||
/**
|
||||
* 预约团队名称
|
||||
*/
|
||||
private String teamName;
|
||||
|
||||
/**
|
||||
* 预约医生编号
|
||||
*/
|
||||
private String userNo;
|
||||
|
||||
/**
|
||||
* 预约医生姓名
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
private Date applyTime;
|
||||
|
||||
/**
|
||||
* 预约状态0:已申请1:已完成2:已取消
|
||||
*/
|
||||
private String bookingStatus;
|
||||
|
||||
/**
|
||||
* 取消时间
|
||||
*/
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
private Date completeTime;
|
||||
|
||||
/**
|
||||
* 审批状态0:待批准1:已同意2:已拒绝
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 拒绝理由
|
||||
*/
|
||||
private String refuseReason;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@ -0,0 +1,163 @@
|
||||
package com.xinelu.familydoctor.applet.pojo.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 居民服务申请展示类
|
||||
* @Date 2023-10-07 007 11:34
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@ApiModel("居民服务申请展示类")
|
||||
@Data
|
||||
public class ResidentServiceApplyVo {
|
||||
/**
|
||||
* 履约预约编号
|
||||
*/
|
||||
@ApiModelProperty("履约预约编号")
|
||||
private String bookingNo;
|
||||
|
||||
/**
|
||||
* 居民编号
|
||||
*/
|
||||
@ApiModelProperty(value = "居民业务主键")
|
||||
private String patientId;
|
||||
|
||||
/**
|
||||
* 居民身份证号
|
||||
*/
|
||||
@ApiModelProperty(value = "居民身份证号")
|
||||
private String identity;
|
||||
|
||||
/**
|
||||
* 居民姓名
|
||||
*/
|
||||
@ApiModelProperty("居民姓名")
|
||||
private String residentName;
|
||||
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
@ApiModelProperty("详细地址")
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
@ApiModelProperty(value = "手机号码")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 预约服务包编号
|
||||
*/
|
||||
@ApiModelProperty("预约服务包编号")
|
||||
private String packageNo;
|
||||
|
||||
/**
|
||||
* 预约服务包名称
|
||||
*/
|
||||
@ApiModelProperty("预约服务包名称")
|
||||
private String packageName;
|
||||
|
||||
/**
|
||||
* 预约服务项目编号
|
||||
*/
|
||||
@ApiModelProperty("预约服务项目编号")
|
||||
private String formNo;
|
||||
|
||||
/**
|
||||
* 预约服务项目名称
|
||||
*/
|
||||
@ApiModelProperty("预约服务项目名称")
|
||||
private String formName;
|
||||
|
||||
/**
|
||||
* 预约服务方式1:家庭2:门诊3:电话99:其他
|
||||
*/
|
||||
@ApiModelProperty("预约服务方式1:家庭2:门诊3:电话99:其他")
|
||||
private String serviceWay;
|
||||
|
||||
/**
|
||||
* 预约服务方式名称
|
||||
*/
|
||||
@ApiModelProperty("预约服务方式名称")
|
||||
private String serviceWayName;
|
||||
|
||||
/**
|
||||
* 预约时间
|
||||
*/
|
||||
@ApiModelProperty("预约时间")
|
||||
@JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date bookingTime;
|
||||
|
||||
/**
|
||||
* 申请时间
|
||||
*/
|
||||
@ApiModelProperty("申请时间")
|
||||
@JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date applyTime;
|
||||
|
||||
/**
|
||||
* 预约状态0:已申请1:已完成2:已取消
|
||||
*/
|
||||
@ApiModelProperty("预约状态0:已申请1:已完成2:已取消")
|
||||
private String bookingStatus;
|
||||
|
||||
/**
|
||||
* 取消时间
|
||||
*/
|
||||
@ApiModelProperty("取消时间")
|
||||
@JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
@ApiModelProperty("完成时间")
|
||||
@JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date completeTime;
|
||||
|
||||
/**
|
||||
* 审批状态0:待批准1:已同意2:已拒绝
|
||||
*/
|
||||
@ApiModelProperty("审批状态0:待批准1:已同意2:已拒绝")
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 拒绝理由
|
||||
*/
|
||||
@ApiModelProperty("拒绝理由")
|
||||
private String refuseReason;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
@ApiModelProperty("审批时间")
|
||||
@JsonFormat(pattern ="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 签约编号
|
||||
*/
|
||||
@ApiModelProperty("签约编号")
|
||||
private String signNo;
|
||||
|
||||
/**
|
||||
* 评价编号
|
||||
*/
|
||||
@ApiModelProperty("评价编号")
|
||||
private String evaluateNo;
|
||||
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package com.xinelu.familydoctor.applet.service;
|
||||
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/*
|
||||
* @Author mengkuiliang
|
||||
* @Description 居民服务申请Service
|
||||
* @Date 2023-10-07 007 11:37
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
public interface IResidentServiceAppletService {
|
||||
|
||||
/**
|
||||
* 新增签约预约
|
||||
* @author lixinying
|
||||
* @param body:
|
||||
* @return Integer
|
||||
* @date 2022/11/21 9:38
|
||||
*/
|
||||
void insert(ResidentServiceApplyBody body);
|
||||
/**
|
||||
* 取消
|
||||
* @author lixinying
|
||||
* @param bookingNo:
|
||||
* @return Integer
|
||||
* @date 2022/11/21 10:10
|
||||
*/
|
||||
Integer delete(String bookingNo);
|
||||
/**
|
||||
* fd查找
|
||||
* @author lixinying
|
||||
* @param query:
|
||||
* @return List<FdSignBookingVo>
|
||||
* @date 2022/11/21 16:02
|
||||
*/
|
||||
List<ResidentServiceApplyVo> findList(ApplyQuery query);
|
||||
|
||||
/**
|
||||
* 修改审批
|
||||
* @author lixinying
|
||||
* @param body:
|
||||
* @return Integer
|
||||
* @date 2022/11/21 17:07
|
||||
*/
|
||||
Integer updateFd(ApprovalBody body);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 查询签约申请记录
|
||||
* @Date 2022-11-22 10:56
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
ResidentServiceApplyVo getServiceBookingByIdentity(String identity);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 签约申请详情
|
||||
* @Date 2022-11-23 10:05
|
||||
* @Param [bookingNo]
|
||||
* @return java.lang.Object
|
||||
**/
|
||||
ResidentServiceApplyVo detail(String bookingNo);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 取消签约申请
|
||||
* @Date 2022-11-23 14:42
|
||||
* @Param [bookingNo]
|
||||
* @return void
|
||||
**/
|
||||
void cancel(String bookingNo);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 是否已申请签约
|
||||
* @Date 2022-11-30 9:48
|
||||
* @Param [identity]
|
||||
* @return java.lang.String
|
||||
**/
|
||||
Map<String, Object> checkServiceApply(String identity, String region);
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 更新履约完成时间
|
||||
* @Date 2022-11-29 14:21
|
||||
* @Param [body]
|
||||
* @return void
|
||||
**/
|
||||
void updateComplete(String bookingNo);
|
||||
|
||||
}
|
||||
@ -0,0 +1,247 @@
|
||||
package com.xinelu.familydoctor.applet.service.impl;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.xinelu.common.exception.ServiceException;
|
||||
import com.xinelu.common.utils.DateUtils;
|
||||
import com.xinelu.common.utils.StringUtils;
|
||||
import com.xinelu.common.utils.http.HttpService;
|
||||
import com.xinelu.common.utils.spring.SpringUtils;
|
||||
import com.xinelu.common.utils.uuid.IdUtils;
|
||||
import com.xinelu.familydoctor.applet.mapper.ResidentServiceApplyMapper;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ApprovalBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.body.ResidentServiceApplyBody;
|
||||
import com.xinelu.familydoctor.applet.pojo.dto.ResidentServiceFormApplyDto;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
|
||||
import com.xinelu.familydoctor.applet.pojo.entity.ResidentServiceApplyEntity;
|
||||
import com.xinelu.familydoctor.applet.pojo.query.ApplyQuery;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo;
|
||||
import com.xinelu.familydoctor.applet.pojo.vo.SignInfoDetailVo;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
|
||||
import com.xinelu.familydoctor.applet.service.IResidentServiceAppletService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 服务申请Impl
|
||||
* @Date 2023-10-07 007 11:38
|
||||
* @Param
|
||||
* @return
|
||||
**/
|
||||
@Service
|
||||
public class ResidentServiceApplyServiceImpl implements IResidentServiceAppletService {
|
||||
|
||||
@Resource
|
||||
private ResidentServiceApplyMapper residentServiceApplyMapper;
|
||||
@Resource
|
||||
private HttpService httpService;
|
||||
@Resource
|
||||
private IResidentPatientInfoService patientInfoService;
|
||||
|
||||
/**
|
||||
* 新增服务申请
|
||||
*
|
||||
* @param body :
|
||||
* @return Integer
|
||||
* @author lixinying
|
||||
* @date 2022/11/21 9:38
|
||||
*/
|
||||
@Override
|
||||
public void insert(ResidentServiceApplyBody body) {
|
||||
ApplyQuery applyQuery = new ApplyQuery();
|
||||
applyQuery.setIdentity(body.getIdentity());
|
||||
applyQuery.setBookingStatus("0");
|
||||
applyQuery.setApprovalStatus("0");
|
||||
List<ResidentServiceApplyVo> serviceBookingInfoVoList = residentServiceApplyMapper.findByBody(applyQuery);
|
||||
if (serviceBookingInfoVoList != null && serviceBookingInfoVoList.size() > 0) {
|
||||
throw new ServiceException("已经提交服务申请,不能重复提交");
|
||||
}
|
||||
ResidentServiceApplyEntity entity;
|
||||
PatientInfo patientInfo = null;
|
||||
if(StringUtils.isBlank(body.getPatientId())) {
|
||||
patientInfo = patientInfoService.getByCardNo(body.getIdentity());
|
||||
if (patientInfo == null) {
|
||||
throw new ServiceException("未查询到注册信息");
|
||||
}
|
||||
}
|
||||
|
||||
List<ResidentServiceApplyEntity> serviceApplyList = new ArrayList<>();
|
||||
for(ResidentServiceFormApplyDto form: body.getFormList()) {
|
||||
if(!StringUtils.isBlank(form.getFormNo())) {
|
||||
entity = new ResidentServiceApplyEntity();
|
||||
BeanUtils.copyProperties(body, entity);
|
||||
if(patientInfo != null) {
|
||||
entity.setPatientId(patientInfo.getPatientCode());
|
||||
}
|
||||
entity.setApplyTime(new Date());
|
||||
// 预约状态0:已申请1:已完成2:已取消
|
||||
entity.setBookingStatus("0");
|
||||
// 审批状态0:待批准 1:已同意 2:已拒绝
|
||||
entity.setApprovalStatus("0");
|
||||
entity.setBookingNo(IdUtils.simpleUUID());
|
||||
entity.setPackageNo(form.getPackageNo());
|
||||
entity.setPackageName(form.getPackageName());
|
||||
entity.setFormNo(form.getFormNo());
|
||||
entity.setFormName(form.getFormName());
|
||||
serviceApplyList.add(entity);
|
||||
}
|
||||
}
|
||||
if(serviceApplyList.size() == 0) {
|
||||
throw new ServiceException("服务项目不能为空");
|
||||
}
|
||||
residentServiceApplyMapper.batchInsert(serviceApplyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*
|
||||
* @param bookingNo :
|
||||
* @return Integer
|
||||
* @author lixinying
|
||||
* @date 2022/11/21 10:10
|
||||
*/
|
||||
@Override
|
||||
public Integer delete(String bookingNo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* fd查找
|
||||
*
|
||||
* @param query :
|
||||
* @return List<FdServiceBookingVo>
|
||||
* @author lixinying
|
||||
* @date 2022/11/21 16:02
|
||||
*/
|
||||
@Override
|
||||
public List<ResidentServiceApplyVo> findList(ApplyQuery query) {
|
||||
if (query.getStartDate() != null) {
|
||||
query.setStartDate(DateUtils.parseDate(DateUtils.parseDateToStr("yyyy-MM-dd 00:00:00", query.getStartDate())));
|
||||
}
|
||||
if (query.getEndDate() != null) {
|
||||
query.setEndDate(DateUtils.parseDate(DateUtils.parseDateToStr("yyyy-MM-dd 23:59:59", query.getEndDate())));
|
||||
}
|
||||
return residentServiceApplyMapper.findByBody(query);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改审批
|
||||
*
|
||||
* @param body :
|
||||
* @return Integer
|
||||
* @author lixinying
|
||||
* @date 2022/11/21 17:07
|
||||
*/
|
||||
@Override
|
||||
public Integer updateFd(ApprovalBody body) {
|
||||
return residentServiceApplyMapper.updateEx(body);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return com.xinelu.mp.sign.pojo.vo.FdServiceBookingVo
|
||||
* @Author mengkuiliang
|
||||
* @Description 查询未完成的服务申请
|
||||
* @Date 2022-11-22 10:57
|
||||
* @Param [identity]
|
||||
**/
|
||||
@Override
|
||||
public ResidentServiceApplyVo getServiceBookingByIdentity(String identity) {
|
||||
return residentServiceApplyMapper.getServiceBookingByIdentity(identity);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return com.xinelu.mp.sign.pojo.vo.FdServiceBookingVo
|
||||
* @Author mengkuiliang
|
||||
* @Description 服务申请详情
|
||||
* @Date 2022-11-23 10:33
|
||||
* @Param [bookingNo]
|
||||
**/
|
||||
@Override
|
||||
public ResidentServiceApplyVo detail(String bookingNo) {
|
||||
return residentServiceApplyMapper.detail(bookingNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @Author mengkuiliang
|
||||
* @Description 取消服务申请
|
||||
* @Date 2022-11-23 14:42
|
||||
* @Param [bookingNo]
|
||||
**/
|
||||
@Override
|
||||
public void cancel(String bookingNo) {
|
||||
ResidentServiceApplyVo residentServiceApplyVo = residentServiceApplyMapper.detail(bookingNo);
|
||||
if (residentServiceApplyVo == null) {
|
||||
throw new ServiceException("未查询到申请记录");
|
||||
}
|
||||
if (!StringUtils.isBlank(residentServiceApplyVo.getBookingStatus())) {
|
||||
if(residentServiceApplyVo.getBookingStatus().equals("1")) {
|
||||
throw new ServiceException("已完成,不能取消");
|
||||
} else if(residentServiceApplyVo.getBookingStatus().equals("2")) {
|
||||
throw new ServiceException("不能重复取消");
|
||||
}
|
||||
}
|
||||
if (!StringUtils.isBlank(residentServiceApplyVo.getApprovalStatus())) {
|
||||
if (residentServiceApplyVo.getApprovalStatus().equals("1")) {
|
||||
throw new ServiceException("已同意,不能取消");
|
||||
}
|
||||
if (residentServiceApplyVo.getApprovalStatus().equals("2")) {
|
||||
throw new ServiceException("已拒绝,不能取消");
|
||||
}
|
||||
}
|
||||
residentServiceApplyMapper.cancel(bookingNo);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Author mengkuiliang
|
||||
* @Description 是否已申请服务
|
||||
* @Date 2022-11-30 9:49
|
||||
* @Param [identity]
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Object> checkServiceApply(String identity, String region) {
|
||||
Map<String, Object> retMap = new HashMap<>();
|
||||
// 查询未完成的服务申请
|
||||
ResidentServiceApplyVo serviceBookingInfoVo = getServiceBookingByIdentity(identity);
|
||||
if (serviceBookingInfoVo != null) {
|
||||
retMap.put("code", 01);
|
||||
retMap.put("info", DateUtils.parseDateToStr("yyyy年MM月dd日", serviceBookingInfoVo.getBookingTime()) + "已申请" + serviceBookingInfoVo.getFormName() + "服务");
|
||||
return retMap;
|
||||
}
|
||||
// 查询服务信息
|
||||
String result = (String) httpService.get(SpringUtils.getFdUrl(region) + "/resident/signinfo/detail/" + identity, null, String.class);
|
||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||
if (!"1".equals(jsonObject.get("code"))) {
|
||||
throw new ServiceException(jsonObject.get("msg").toString());
|
||||
}
|
||||
// 已服务
|
||||
if (jsonObject.containsKey("data") && jsonObject.get("data") != null) {
|
||||
SignInfoDetailVo signInfoDetailVo = JSONObject.parseObject(jsonObject.getJSONObject("data").toJSONString(), SignInfoDetailVo.class);
|
||||
retMap.put("code", 02);
|
||||
retMap.put("info", DateUtils.parseDateToStr("yyyy年MM月dd日", signInfoDetailVo.getSignTime()) + "已在【" + signInfoDetailVo.getOrgName() + "】【" + signInfoDetailVo.getTeamName() + "】【" + signInfoDetailVo.getUserName() + "】服务");
|
||||
return retMap;
|
||||
}
|
||||
retMap.put("code", 0);
|
||||
retMap.put("info", "true");
|
||||
return retMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @Author mengkuiliang
|
||||
* @Description 更新服务完成时间
|
||||
* @Date 2022-11-29 14:21
|
||||
* @Param [body]
|
||||
**/
|
||||
@Override
|
||||
public void updateComplete(String bookingNo) {
|
||||
residentServiceApplyMapper.updateComplete(bookingNo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -129,7 +129,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
/**
|
||||
* @return com.xinelu.mp.sign.pojo.vo.FdSignBookingVo
|
||||
* @Author mengkuiliang
|
||||
* @Description 查询签约申请记录
|
||||
* @Description 查询未完成的签约申请
|
||||
* @Date 2022-11-22 10:57
|
||||
* @Param [identity]
|
||||
**/
|
||||
@ -186,7 +186,7 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
@Override
|
||||
public Map<String, Object> checkSignApply(String identity, String region) {
|
||||
Map<String, Object> retMap = new HashMap<>();
|
||||
// 签约申请
|
||||
// 查询未完成的签约申请
|
||||
ResidentSignApplyVo signBookingInfoVo = getSignBookingByIdentity(identity);
|
||||
if (signBookingInfoVo != null) {
|
||||
retMap.put("code", 01);
|
||||
@ -205,9 +205,10 @@ public class ResidentSignApplyServiceImpl implements IResidentSignAppletService
|
||||
retMap.put("code", 02);
|
||||
retMap.put("info", DateUtils.parseDateToStr("yyyy年MM月dd日", signInfoDetailVo.getSignTime()) + "已在【" + signInfoDetailVo.getOrgName() + "】【" + signInfoDetailVo.getTeamName() + "】【" + signInfoDetailVo.getUserName() + "】签约");
|
||||
return retMap;
|
||||
} else {
|
||||
retMap.put("code", 0);
|
||||
retMap.put("info", "未签约");
|
||||
}
|
||||
retMap.put("code", 0);
|
||||
retMap.put("info", "true");
|
||||
return retMap;
|
||||
}
|
||||
|
||||
|
||||
@ -84,9 +84,6 @@
|
||||
<if test="address != null and address != ''">
|
||||
and b.address like concat('%', #{address},'%')
|
||||
</if>
|
||||
<if test="dataScope != null and dataScope != ''">
|
||||
${dataScope}
|
||||
</if>
|
||||
order by p.apply_time desc
|
||||
</select>
|
||||
|
||||
|
||||
@ -0,0 +1,270 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xinelu.familydoctor.applet.mapper.ResidentServiceApplyMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.xinelu.familydoctor.applet.pojo.entity.ResidentServiceApplyEntity">
|
||||
<id property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="bookingNo" column="booking_no" jdbcType="VARCHAR"/>
|
||||
<result property="patientId" column="patient_id" jdbcType="VARCHAR"/>
|
||||
<result property="residentName" column="resident_name" jdbcType="VARCHAR"/>
|
||||
<result property="identity" column="identity" jdbcType="VARCHAR"/>
|
||||
<result property="packageNo" column="package_no" jdbcType="VARCHAR"/>
|
||||
<result property="packageName" column="package_name" jdbcType="VARCHAR"/>
|
||||
<result property="formNo" column="form_no" jdbcType="VARCHAR"/>
|
||||
<result property="formName" column="form_name" jdbcType="VARCHAR"/>
|
||||
<result property="serviceWay" column="service_way" jdbcType="VARCHAR"/>
|
||||
<result property="bookingTime" column="booking_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="orgNo" column="org_no" jdbcType="VARCHAR"/>
|
||||
<result property="orgName" column="org_name" jdbcType="VARCHAR"/>
|
||||
<result property="teamNo" column="team_no" jdbcType="VARCHAR"/>
|
||||
<result property="teamName" column="team_name" jdbcType="VARCHAR"/>
|
||||
<result property="userNo" column="user_no" jdbcType="VARCHAR"/>
|
||||
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
|
||||
<result property="applyTime" column="apply_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="bookingStatus" column="booking_status" jdbcType="VARCHAR"/>
|
||||
<result property="cancelTime" column="cancel_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="completeTime" column="complete_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="approvalStatus" column="approval_status" jdbcType="VARCHAR"/>
|
||||
<result property="refuseReason" column="refuse_reason" jdbcType="VARCHAR"/>
|
||||
<result property="approvalTime" column="approval_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="remark" column="remark" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,booking_no,patient_id,
|
||||
resident_name,identity,package_no,
|
||||
package_name,form_no,form_name,
|
||||
service_way,booking_time,org_no,
|
||||
org_name,team_no,team_name,
|
||||
user_no,user_name,apply_time,
|
||||
booking_status,cancel_time,complete_time,
|
||||
approval_status,refuse_reason,approval_time,
|
||||
remark
|
||||
</sql>
|
||||
|
||||
<sql id="Base_Column_List2">
|
||||
s.id,s.booking_no,s.patient_id,
|
||||
s.resident_name,s.identity,s.package_no,
|
||||
s.package_name,s.form_no,s.form_name,
|
||||
s.service_way,s.booking_time,s.org_no,
|
||||
s.org_name,s.team_no,s.team_name,
|
||||
s.user_no,s.user_name,s.apply_time,
|
||||
s.booking_status,s.cancel_time,s.complete_time,
|
||||
s.approval_status,s.refuse_reason,s.approval_time,
|
||||
s.remark
|
||||
</sql>
|
||||
|
||||
<sql id="Insert_Column_List">
|
||||
booking_no,patient_id,
|
||||
resident_name,identity,package_no,
|
||||
package_name,form_no,form_name,
|
||||
service_way,booking_time,org_no,
|
||||
org_name,team_no,team_name,
|
||||
user_no,user_name,apply_time,
|
||||
booking_status,cancel_time,complete_time,
|
||||
approval_status,refuse_reason,approval_time,
|
||||
remark
|
||||
</sql>
|
||||
|
||||
<!-- 新增 -->
|
||||
<insert id="insert">
|
||||
insert into resident_service_apply
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="bookingNo != null and bookingNo != ''">booking_no,
|
||||
</if>
|
||||
<if test="patientId != null and patientId != ''">patient_id,
|
||||
</if>
|
||||
<if test="residentName != null and residentName != ''">resident_name,
|
||||
</if>
|
||||
<if test="identity != null and identity != ''">identity,
|
||||
</if>
|
||||
<if test="packageNo != null">package_no,
|
||||
</if>
|
||||
<if test="packageName != null">package_name,
|
||||
</if>
|
||||
<if test="formNo != null">form_no,
|
||||
</if>
|
||||
<if test="formName != null">form_name,
|
||||
</if>
|
||||
<if test="orgNo != null and orgNo != ''">org_no,
|
||||
</if>
|
||||
<if test="orgName != null and orgName != ''">org_name,
|
||||
</if>
|
||||
<if test="teamNo != null and teamNo != ''">team_no,
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">team_name,
|
||||
</if>
|
||||
<if test="userNo != null and userNo != ''">user_no,
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">user_name,
|
||||
</if>
|
||||
<if test="bookingTime != null">booking_time,
|
||||
</if>
|
||||
<if test="applyTime != null">apply_time,
|
||||
</if>
|
||||
<if test="bookingStatus != null and bookingStatus != ''">booking_status,
|
||||
</if>
|
||||
<if test="cancelTime != null">cancel_time,
|
||||
</if>
|
||||
<if test="approvalStatus != null and approvalStatus != ''">approval_status,
|
||||
</if>
|
||||
<if test="refuseReason != null">refuse_reason,
|
||||
</if>
|
||||
<if test="approvalTime != null">approval_time,
|
||||
</if>
|
||||
<if test="remark != null">remark,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="bookingNo != null and bookingNo != ''">#{bookingNo},
|
||||
</if>
|
||||
<if test="patientId != null and patientId != ''">#{patientId},
|
||||
</if>
|
||||
<if test="residentName != null and residentName != ''">#{residentName},
|
||||
</if>
|
||||
<if test="identity != null and identity != ''">#{identity},
|
||||
</if>
|
||||
<if test="packagesNo != null">#{packagesNo},
|
||||
</if>
|
||||
<if test="packagesName != null">#{packagesName},
|
||||
</if>
|
||||
<if test="formNo != null">#{formNo},
|
||||
</if>
|
||||
<if test="formName != null">#{formName},
|
||||
</if>
|
||||
<if test="orgNo != null and orgNo != ''">#{orgNo},
|
||||
</if>
|
||||
<if test="orgName != null and orgName != ''">#{orgName},
|
||||
</if>
|
||||
<if test="teamNo != null and teamNo != ''">#{teamNo},
|
||||
</if>
|
||||
<if test="teamName != null and teamName != ''">#{teamName},
|
||||
</if>
|
||||
<if test="userNo != null and userNo != ''">#{userNo},
|
||||
</if>
|
||||
<if test="userName != null and userName != ''">#{userName},
|
||||
</if>
|
||||
<if test="bookingTime != null">#{bookingTime},
|
||||
</if>
|
||||
<if test="applyTime != null">#{applyTime},
|
||||
</if>
|
||||
<if test="bookingStatus != null and bookingStatus != ''">#{bookingStatus},
|
||||
</if>
|
||||
<if test="cancelTime != null">#{cancelTime},
|
||||
</if>
|
||||
<if test="approvalStatus != null and approvalStatus != ''">#{approvalStatus},
|
||||
</if>
|
||||
<if test="refuseReason != null">#{refuseReason},
|
||||
</if>
|
||||
<if test="approvalTime != null">#{approvalTime},
|
||||
</if>
|
||||
<if test="remark != null">#{remark},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<!-- 批量插入 -->
|
||||
<insert id="batchInsert">
|
||||
insert into resident_service_apply (<include refid="Insert_Column_List"></include>)
|
||||
values
|
||||
<foreach collection="list" separator="," item="item">
|
||||
(#{item.bookingNo}, #{item.patientId}, #{item.residentName}, #{item.identity},
|
||||
#{item.packageNo}, #{item.packageName}, #{item.formNo},
|
||||
#{item.formName}, #{item.serviceWay}, #{item.bookingTime}, #{item.orgNo},#{item.orgName},
|
||||
#{item.teamNo},#{item.teamName}, #{item.userNo}, #{item.userName},
|
||||
#{item.applyTime}, #{item.bookingStatus}, #{item.cancelTime},
|
||||
#{item.completeTime}, #{item.approvalStatus}, #{item.refuseReason},
|
||||
#{item.approvalTime},#{item.remark}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<!-- 取消服务申请 -->
|
||||
<update id="cancel">
|
||||
update resident_service_apply
|
||||
set booking_status = '2',
|
||||
cancel_time = now()
|
||||
where booking_no = #{bookingNo}
|
||||
</update>
|
||||
|
||||
<select id="findByBody" resultType="com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo">
|
||||
select <include refid="Base_Column_List2"></include>,p.address,p.phone
|
||||
from resident_service_apply s
|
||||
left join patient_info p on p.patient_code = s.patient_id
|
||||
where 1=1
|
||||
<if test="identity != null and identity != ''">
|
||||
and s.identity = #{identity}
|
||||
</if>
|
||||
<if test="residentName != null and residentName != ''">
|
||||
and s.resident_name like concat(#{residentName},'%')
|
||||
</if>
|
||||
<if test="orgNo != null and orgNo != ''">
|
||||
and s.org_no = #{orgNo}
|
||||
</if>
|
||||
<if test="teamNo != null and teamNo != ''">
|
||||
and s.team_no = #{teamNo}
|
||||
</if>
|
||||
<if test="userNo != null and userNo != ''">
|
||||
and s.user_no = #{userNo}
|
||||
</if>
|
||||
<if test="startDate != null">
|
||||
and s.booking_time >= #{startDate}
|
||||
</if>
|
||||
<if test="endDate != null">
|
||||
and s.booking_time <= #{endDate}
|
||||
</if>
|
||||
<if test="bookingStatus != null and bookingStatus != ''">
|
||||
and s.booking_status = #{bookingStatus}
|
||||
</if>
|
||||
<if test="approvalStatus != null and approvalStatus != ''">
|
||||
and s.approval_status = #{approvalStatus}
|
||||
</if>
|
||||
<if test="completed != null and completed != ''">
|
||||
<choose>
|
||||
<!-- 已完成 -->
|
||||
<when test="completed == 1">
|
||||
and (s.booking_status = '1' or s.approval_status in ('1','2'))
|
||||
</when>
|
||||
<!-- 未完成 -->
|
||||
<when test="completed == 2">
|
||||
and (s.booking_status = '0' and s.approval_status = '0')
|
||||
</when>
|
||||
<otherwise></otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
order by s.booking_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询未完成的服务申请 -->
|
||||
<select id="getServiceBookingByIdentity" resultType="com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo">
|
||||
select <include refid="Base_Column_List"></include> from resident_service_apply where identity = #{identity} and
|
||||
booking_status = '0' and approval_status ='0' order by booking_time desc limit 1
|
||||
</select>
|
||||
|
||||
<!-- 服务申请详情 -->
|
||||
<select id="detail" resultType="com.xinelu.familydoctor.applet.pojo.vo.ResidentServiceApplyVo">
|
||||
select <include refid="Base_Column_List"></include> from resident_service_apply where booking_no = #{bookingNo}
|
||||
</select>
|
||||
|
||||
<update id="updateEx">
|
||||
update resident_service_apply
|
||||
<set>
|
||||
<if test="approvalStatus != null and approvalStatus != ''">
|
||||
approval_status = #{approvalStatus},
|
||||
</if>
|
||||
<if test="refuseReason != null and refuseReason != ''">
|
||||
refuse_reason = #{refuseReason},
|
||||
</if>
|
||||
approval_time = now()
|
||||
</set>
|
||||
where booking_no = #{applyNo};
|
||||
</update>
|
||||
|
||||
<!-- 更新服务完成时间 -->
|
||||
<update id="updateComplete">
|
||||
update resident_service_apply set complete_time = now(),booking_status = '1' where booking_no = #{bookingNo}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@ -318,16 +318,14 @@
|
||||
<otherwise></otherwise>
|
||||
</choose>
|
||||
</if>
|
||||
<if test="dataScope != null and dataScope != ''">
|
||||
${dataScope}
|
||||
</if>
|
||||
order by p.apply_time desc
|
||||
</select>
|
||||
|
||||
<!-- 查询签约申请记录 -->
|
||||
<!-- 查询未完成的签约申请 -->
|
||||
<select id="getSignBookingByIdentity" resultType="com.xinelu.familydoctor.applet.pojo.vo.ResidentSignApplyVo">
|
||||
select <include refid="Base_Column_List"></include> from resident_sign_apply where identity = #{identity} and
|
||||
booking_status = '0' and approval_status in ('0','2') order by apply_time desc limit 1
|
||||
booking_status = '0' and approval_status = '0'
|
||||
order by apply_time desc limit 1
|
||||
</select>
|
||||
|
||||
<!-- 签约申请详情 -->
|
||||
|
||||
Loading…
Reference in New Issue
Block a user