Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
d0cb4d6a62
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.syjiaer.clinic.server.common.enums;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ChargeSourceEnum {
|
||||||
|
CHARGE(0,"门诊收费");
|
||||||
|
private final Integer type;
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.syjiaer.clinic.server.common.enums;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum ChargeTypeEnum {
|
||||||
|
CHARGE(1,"收费"),
|
||||||
|
REFUND(0,"退费");
|
||||||
|
private final Integer chargeType;
|
||||||
|
private final String desc;
|
||||||
|
}
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
package com.syjiaer.clinic.server.common.enums;
|
|
||||||
|
|
||||||
public enum MedicalRecordDetailTypeEnum {
|
|
||||||
|
|
||||||
item(1,"服务项目"),
|
|
||||||
goods(2,"药品耗材");
|
|
||||||
|
|
||||||
private final Integer type;
|
|
||||||
private final String desc;
|
|
||||||
|
|
||||||
MedicalRecordDetailTypeEnum(final Integer type, final String desc) {
|
|
||||||
this.type = type;
|
|
||||||
this.desc = desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDesc() {
|
|
||||||
return desc;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -6,16 +6,16 @@ public enum RegistrationStatusEnum {
|
||||||
complete(3,"已诊"),
|
complete(3,"已诊"),
|
||||||
cancel(0,"取消");
|
cancel(0,"取消");
|
||||||
|
|
||||||
private final Integer type;
|
private final Integer status;
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
|
||||||
RegistrationStatusEnum(final Integer type, final String desc) {
|
RegistrationStatusEnum(final Integer status, final String desc) {
|
||||||
this.type = type;
|
this.status = status;
|
||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getType() {
|
public Integer getStatus() {
|
||||||
return type;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDesc() {
|
public String getDesc() {
|
||||||
|
|
@ -24,7 +24,7 @@ public enum RegistrationStatusEnum {
|
||||||
|
|
||||||
public static RegistrationStatusEnum getByType(Integer type) {
|
public static RegistrationStatusEnum getByType(Integer type) {
|
||||||
for (RegistrationStatusEnum goodsTypeEnum : RegistrationStatusEnum.values()) {
|
for (RegistrationStatusEnum goodsTypeEnum : RegistrationStatusEnum.values()) {
|
||||||
if (goodsTypeEnum.getType().equals(type)) {
|
if (goodsTypeEnum.getStatus().equals(type)) {
|
||||||
return goodsTypeEnum;
|
return goodsTypeEnum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@ package com.syjiaer.clinic.server.controller.charge;
|
||||||
import com.syjiaer.clinic.server.common.api.output.OM2206A;
|
import com.syjiaer.clinic.server.common.api.output.OM2206A;
|
||||||
import com.syjiaer.clinic.server.common.api.output.OM2207A;
|
import com.syjiaer.clinic.server.common.api.output.OM2207A;
|
||||||
import com.syjiaer.clinic.server.common.util.DateUtil;
|
import com.syjiaer.clinic.server.common.util.DateUtil;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.common.vo.Result;
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
import com.syjiaer.clinic.server.controller.BaseController;
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.charge.ChargeLog;
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeOrder;
|
import com.syjiaer.clinic.server.entity.charge.ChargeOrder;
|
||||||
import com.syjiaer.clinic.server.entity.charge.dto.ChargeQuery;
|
import com.syjiaer.clinic.server.entity.charge.dto.ChargeQuery;
|
||||||
import com.syjiaer.clinic.server.entity.charge.dto.ChargeSaveDto;
|
import com.syjiaer.clinic.server.entity.charge.dto.ChargeSaveDto;
|
||||||
|
|
@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -79,7 +82,7 @@ public class ChargeController extends BaseController {
|
||||||
* 每日收费报表
|
* 每日收费报表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/dailyChargingReport")
|
@RequestMapping("/dailyChargingReport")
|
||||||
public Result<Map<String, RetailOrderDailyChargingReportVo>> dailyChargingReport() {
|
public Result<List<RetailOrderDailyChargingReportVo>> dailyChargingReport() {
|
||||||
String startDateStr = parmsUtil.getString("startDate", "请选择开始时间");
|
String startDateStr = parmsUtil.getString("startDate", "请选择开始时间");
|
||||||
String endDateStr = parmsUtil.getString("endDate", "请选择结束时间");
|
String endDateStr = parmsUtil.getString("endDate", "请选择结束时间");
|
||||||
LocalDateTime startDateTime = DateUtil.getDateTime(startDateStr);
|
LocalDateTime startDateTime = DateUtil.getDateTime(startDateStr);
|
||||||
|
|
@ -89,4 +92,21 @@ public class ChargeController extends BaseController {
|
||||||
return success(chargeService.dailyChargingReport(startDateTime, endDateTime));
|
return success(chargeService.dailyChargingReport(startDateTime, endDateTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/getListByPatientId")
|
||||||
|
public Result<List<ChargeOrder>> getListByPatientId() {
|
||||||
|
Integer patientId = parmsUtil.getInteger("patientId");
|
||||||
|
return success(chargeService.getListByPatientId(patientId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/getChargeRecord")
|
||||||
|
public Result<Page<ChargeLog>> getChargeRecord() {
|
||||||
|
return success(chargeService.getChargeRecordPageList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
import com.syjiaer.clinic.server.controller.BaseController;
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.dto.ChargeQueueQuery;
|
import com.syjiaer.clinic.server.entity.diagnosis.dto.ChargeQueueQuery;
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.dto.MedicalRecordSaveDto;
|
import com.syjiaer.clinic.server.entity.diagnosis.dto.MedicalRecordSaveDto;
|
||||||
|
import com.syjiaer.clinic.server.entity.diagnosis.vo.ChargeQueueVo;
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.vo.MedicalRecordVo;
|
import com.syjiaer.clinic.server.entity.diagnosis.vo.MedicalRecordVo;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.vo.SeeDoctorInfoVo;
|
||||||
import com.syjiaer.clinic.server.service.diagnosis.MedicalRecordService;
|
import com.syjiaer.clinic.server.service.diagnosis.MedicalRecordService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -54,9 +56,26 @@ public class MedicalRecordController extends BaseController {
|
||||||
* 获取收费队列
|
* 获取收费队列
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/getChargeQueue")
|
@RequestMapping("/getChargeQueue")
|
||||||
public Result<Page<MedicalRecordVo>> getChargeQueue() {
|
public Result<Page<ChargeQueueVo>> getChargeQueue() {
|
||||||
ChargeQueueQuery query = parmsUtil.getObject("query", ChargeQueueQuery.class);
|
ChargeQueueQuery query = parmsUtil.getObject("query", ChargeQueueQuery.class);
|
||||||
|
|
||||||
return success( medicalRecordService.getChargeQueue(query));
|
return success( medicalRecordService.getChargeQueue(query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取就诊信息
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getSeeDockerInfo")
|
||||||
|
public Result<SeeDoctorInfoVo> getSeeDockerInfo() {
|
||||||
|
Integer regisId = parmsUtil.getInteger("regisId", "挂单id不能为空");
|
||||||
|
return success( medicalRecordService.getSeeDockerInfo(regisId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getByDiagnosisCode")
|
||||||
|
public Result<MedicalRecordVo> getByDiagnosisCode() {
|
||||||
|
String diagnosisCode = parmsUtil.getString("diagnosisCode", "诊断code不能为空");
|
||||||
|
return success( medicalRecordService.getByDiagnosisCode(diagnosisCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,11 @@ import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.common.vo.Result;
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
import com.syjiaer.clinic.server.controller.BaseController;
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.charge.dto.ChargeQuery;
|
||||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.dto.DockerSearchQuery;
|
||||||
import com.syjiaer.clinic.server.entity.organization.dto.OrganizationMemberSaveDto;
|
import com.syjiaer.clinic.server.entity.organization.dto.OrganizationMemberSaveDto;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.vo.MemberVo;
|
||||||
import com.syjiaer.clinic.server.service.organization.OrganizationMemberService;
|
import com.syjiaer.clinic.server.service.organization.OrganizationMemberService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -56,8 +59,9 @@ public class OrganizationMemberController extends BaseController {
|
||||||
return success(organizationMemberService.get(id));
|
return success(organizationMemberService.get(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/allDoctorList")
|
@RequestMapping("/search")
|
||||||
public Result<List<OrganizationMember>> allDoctorList() {
|
public Result<List<MemberVo>> allDoctorList() {
|
||||||
return success(organizationMemberService.doctorList());
|
DockerSearchQuery dockerSearchQuery = parmsUtil.getObject("query", DockerSearchQuery.class);
|
||||||
|
return success(organizationMemberService.doctorList(dockerSearchQuery));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.syjiaer.clinic.server.controller.patient;
|
||||||
|
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
|
import com.syjiaer.clinic.server.entity.vip.Vip;
|
||||||
|
import com.syjiaer.clinic.server.service.patient.PatientInfoService;
|
||||||
|
import com.syjiaer.clinic.server.service.vip.VipLevelConfigService;
|
||||||
|
import com.syjiaer.clinic.server.service.vip.VipService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 商品 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author NiuZiYuan
|
||||||
|
* @since 2025-02-21
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vip/vip")
|
||||||
|
public class PatientController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PatientInfoService patientInfoService;
|
||||||
|
|
||||||
|
@RequestMapping("/create")
|
||||||
|
public Result<Object> create() {
|
||||||
|
PatientInfo patientInfo = parmsUtil.getObject("vipInfo", PatientInfo.class);
|
||||||
|
patientInfoService.create(patientInfo);
|
||||||
|
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/update")
|
||||||
|
public Result<Object> update() {
|
||||||
|
PatientInfo patientInfo = parmsUtil.getObject("vipInfo", PatientInfo.class);
|
||||||
|
patientInfoService.update(patientInfo);
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/delete")
|
||||||
|
public Result<Integer> delete() {
|
||||||
|
int patientId = parmsUtil.getInteger("id", "ID不能为空");
|
||||||
|
return success(patientInfoService.removeById(patientId));
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/list")
|
||||||
|
public Result<Page<PatientInfo>> selectList() {
|
||||||
|
String keyword = parmsUtil.getString("keyword");
|
||||||
|
int page = parmsUtil.getInteger("page", "请输入页码");
|
||||||
|
int pageSize = parmsUtil.getInteger("pageSize", "请输入每页条数");
|
||||||
|
Page<PatientInfo> list = patientInfoService.pageList(keyword, page, pageSize);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/get")
|
||||||
|
public Result<PatientInfo> get() {
|
||||||
|
int id = parmsUtil.getInteger("id", "ID不能为空");
|
||||||
|
PatientInfo patientInfo = patientInfoService.getById(id);
|
||||||
|
return success(patientInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/search")
|
||||||
|
public Result<List<PatientInfo>> search() {
|
||||||
|
String keyword = parmsUtil.getString("keyword", "关键字不能为空");
|
||||||
|
List<PatientInfo> list = patientInfoService.search(keyword);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/changeLevel")
|
||||||
|
public Result<Object> changeLevel() {
|
||||||
|
int vipId = parmsUtil.getInteger("vipId", "会员ID不能为空");
|
||||||
|
int levelId = parmsUtil.getInteger("levelId", "等级id不能为空");
|
||||||
|
patientInfoService.changeLevel(vipId, levelId);
|
||||||
|
|
||||||
|
return success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,9 @@ import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
import com.syjiaer.clinic.server.controller.BaseController;
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationQuery;
|
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationQuery;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationSaveDto;
|
||||||
import com.syjiaer.clinic.server.entity.patient.vo.PatientAndRegistrationInfoVo;
|
import com.syjiaer.clinic.server.entity.patient.vo.PatientAndRegistrationInfoVo;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.vo.PatientRegistrationVo;
|
||||||
import com.syjiaer.clinic.server.service.patient.PatientInfoService;
|
import com.syjiaer.clinic.server.service.patient.PatientInfoService;
|
||||||
import com.syjiaer.clinic.server.service.patient.PatientRegistrationService;
|
import com.syjiaer.clinic.server.service.patient.PatientRegistrationService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -30,7 +32,7 @@ public class RegistrationController extends BaseController {
|
||||||
@RequestMapping("/add")
|
@RequestMapping("/add")
|
||||||
public Result<?> registration() {
|
public Result<?> registration() {
|
||||||
|
|
||||||
PatientRegistration registrationParam = parmsUtil.getObjectWithCheck("data", PatientRegistration.class);
|
RegistrationSaveDto registrationParam = parmsUtil.getObjectWithCheck("data", RegistrationSaveDto.class);
|
||||||
String mdtrtCertNo = parmsUtil.getString("mdtrtCertNo");
|
String mdtrtCertNo = parmsUtil.getString("mdtrtCertNo");
|
||||||
String mdtrtCertType = parmsUtil.getString("mdtrtCertType");
|
String mdtrtCertType = parmsUtil.getString("mdtrtCertType");
|
||||||
patientRegistrationService.registration(registrationParam,mdtrtCertType,mdtrtCertNo);
|
patientRegistrationService.registration(registrationParam,mdtrtCertType,mdtrtCertNo);
|
||||||
|
|
@ -84,12 +86,12 @@ public class RegistrationController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/getById")
|
@RequestMapping("/getById")
|
||||||
public Result<PatientRegistration> getById() {
|
public Result<PatientRegistrationVo> getById() {
|
||||||
Integer id = parmsUtil.getInteger("id");
|
Integer id = parmsUtil.getInteger("id");
|
||||||
if (id == null) {
|
if (id == null) {
|
||||||
throw new MessageException("id参数为空");
|
throw new MessageException("id参数为空");
|
||||||
}
|
}
|
||||||
PatientRegistration result = patientRegistrationService.getById(id);
|
PatientRegistrationVo result = patientRegistrationService.getById(id);
|
||||||
return success(result);
|
return success(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
import com.syjiaer.clinic.server.entity.goods.Goods;
|
import com.syjiaer.clinic.server.entity.goods.Goods;
|
||||||
import com.syjiaer.clinic.server.entity.statistics.PersonPayOverviewVo;
|
import com.syjiaer.clinic.server.entity.statistics.PersonPayOverviewVo;
|
||||||
import com.syjiaer.clinic.server.entity.statistics.RevenueOverviewVo;
|
import com.syjiaer.clinic.server.entity.statistics.RevenueOverviewVo;
|
||||||
|
import com.syjiaer.clinic.server.entity.statistics.SalePersonReportVo;
|
||||||
|
import com.syjiaer.clinic.server.entity.statistics.TipCountVo;
|
||||||
import com.syjiaer.clinic.server.service.goods.GoodsService;
|
import com.syjiaer.clinic.server.service.goods.GoodsService;
|
||||||
import com.syjiaer.clinic.server.service.inventory.InventoryService;
|
import com.syjiaer.clinic.server.service.inventory.InventoryService;
|
||||||
import com.syjiaer.clinic.server.service.statistics.StatisticsService;
|
import com.syjiaer.clinic.server.service.statistics.StatisticsService;
|
||||||
|
|
@ -14,11 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -49,6 +47,8 @@ public class StatisticsController extends BaseController {
|
||||||
public Result<List<Goods>> numberEarlyWarning() {
|
public Result<List<Goods>> numberEarlyWarning() {
|
||||||
QueryWrapper<Goods> goodsQuery = new QueryWrapper<>();
|
QueryWrapper<Goods> goodsQuery = new QueryWrapper<>();
|
||||||
goodsQuery.apply("inventory_whole_number <= inventory_warn_number");
|
goodsQuery.apply("inventory_whole_number <= inventory_warn_number");
|
||||||
|
goodsQuery.orderByAsc("inventory_whole_number","type");
|
||||||
|
goodsQuery.last("limit 20");
|
||||||
List<Goods> list = goodsService.list(goodsQuery);
|
List<Goods> list = goodsService.list(goodsQuery);
|
||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
@ -70,5 +70,21 @@ public class StatisticsController extends BaseController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/salePerson")
|
||||||
|
public Result<List<SalePersonReportVo>> salePerson() {
|
||||||
|
return success( statisticsService.salePersonReport());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取收费队列 就诊队列数量
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getTipCount")
|
||||||
|
public Result<TipCountVo> getChargeQueueCount() {
|
||||||
|
String begin = parmsUtil.getString("beginTime", "开始时间为空");
|
||||||
|
String end = parmsUtil.getString("endTime", "结束时间为空");
|
||||||
|
LocalDateTime beginTime = DateUtil.getDateTime(begin);
|
||||||
|
LocalDateTime endTime = DateUtil.getDateTime(end);
|
||||||
|
return success( statisticsService.getWaitCount(beginTime, endTime));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,77 +14,77 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
///**
|
||||||
* <p>
|
// * <p>
|
||||||
* 商品 前端控制器
|
// * 商品 前端控制器
|
||||||
* </p>
|
// * </p>
|
||||||
*
|
// *
|
||||||
* @author NiuZiYuan
|
// * @author NiuZiYuan
|
||||||
* @since 2025-02-21
|
// * @since 2025-02-21
|
||||||
*/
|
// */
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/vip/vip")
|
//@RequestMapping("/vip/vip")
|
||||||
public class VipController extends BaseController {
|
//public class VipController extends BaseController {
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
private VipService vipService;
|
// private VipService vipService;
|
||||||
@Autowired
|
// @Autowired
|
||||||
private VipLevelConfigService vipLevelConfigService;
|
// private VipLevelConfigService vipLevelConfigService;
|
||||||
|
//
|
||||||
@RequestMapping("/create")
|
// @RequestMapping("/create")
|
||||||
public Result<Object> create() {
|
// public Result<Object> create() {
|
||||||
Vip vip = parmsUtil.getObject("vipInfo", Vip.class);
|
// Vip vip = parmsUtil.getObject("vipInfo", Vip.class);
|
||||||
vipService.create(vip);
|
// vipService.create(vip);
|
||||||
|
//
|
||||||
return success();
|
// return success();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RequestMapping("/update")
|
// @RequestMapping("/update")
|
||||||
public Result<Object> update() {
|
// public Result<Object> update() {
|
||||||
Vip vip = parmsUtil.getObject("vipInfo", Vip.class);
|
// Vip vip = parmsUtil.getObject("vipInfo", Vip.class);
|
||||||
|
//
|
||||||
vipService.update(vip);
|
// vipService.update(vip);
|
||||||
|
//
|
||||||
return success();
|
// return success();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RequestMapping("/delete")
|
// @RequestMapping("/delete")
|
||||||
public Result<Integer> delete() {
|
// public Result<Integer> delete() {
|
||||||
int vipId = parmsUtil.getInteger("id", "ID不能为空");
|
// int vipId = parmsUtil.getInteger("id", "ID不能为空");
|
||||||
return success(vipService.removeById(vipId));
|
// return success(vipService.removeById(vipId));
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RequestMapping("/list")
|
// @RequestMapping("/list")
|
||||||
public Result<Page<Vip>> selectList() {
|
// public Result<Page<Vip>> selectList() {
|
||||||
String keyword = parmsUtil.getString("keyword");
|
// String keyword = parmsUtil.getString("keyword");
|
||||||
int page = parmsUtil.getInteger("page", "请输入页码");
|
// int page = parmsUtil.getInteger("page", "请输入页码");
|
||||||
int pageSize = parmsUtil.getInteger("pageSize", "请输入每页条数");
|
// int pageSize = parmsUtil.getInteger("pageSize", "请输入每页条数");
|
||||||
Page<Vip> list = vipService.pageList(keyword, page, pageSize);
|
// Page<Vip> list = vipService.pageList(keyword, page, pageSize);
|
||||||
return success(list);
|
// return success(list);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RequestMapping("/get")
|
// @RequestMapping("/get")
|
||||||
public Result<Vip> get() {
|
// public Result<Vip> get() {
|
||||||
int id = parmsUtil.getInteger("id", "ID不能为空");
|
// int id = parmsUtil.getInteger("id", "ID不能为空");
|
||||||
Vip vip = vipService.getById(id);
|
// Vip vip = vipService.getById(id);
|
||||||
return success(vip);
|
// return success(vip);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RequestMapping("/search")
|
// @RequestMapping("/search")
|
||||||
public Result<List<Vip>> search() {
|
// public Result<List<Vip>> search() {
|
||||||
String keyword = parmsUtil.getString("keyword", "关键字不能为空");
|
// String keyword = parmsUtil.getString("keyword", "关键字不能为空");
|
||||||
List<Vip> list = vipService.search(keyword);
|
// List<Vip> list = vipService.search(keyword);
|
||||||
return success(list);
|
// return success(list);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@RequestMapping("/changeLevel")
|
// @RequestMapping("/changeLevel")
|
||||||
public Result changeLevel() {
|
// public Result changeLevel() {
|
||||||
int vipId = parmsUtil.getInteger("vipId", "会员ID不能为空");
|
// int vipId = parmsUtil.getInteger("vipId", "会员ID不能为空");
|
||||||
int levelId = parmsUtil.getInteger("levelId", "等级id不能为空");
|
// int levelId = parmsUtil.getInteger("levelId", "等级id不能为空");
|
||||||
vipService.changeLevel(vipId, levelId);
|
// vipService.changeLevel(vipId, levelId);
|
||||||
|
//
|
||||||
return success();
|
// return success();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.common.vo.Result;
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
import com.syjiaer.clinic.server.controller.BaseController;
|
import com.syjiaer.clinic.server.controller.BaseController;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
import com.syjiaer.clinic.server.entity.vip.VipIntegralLog;
|
import com.syjiaer.clinic.server.entity.vip.VipIntegralLog;
|
||||||
import com.syjiaer.clinic.server.entity.vip.dto.VipIntegralLogQuery;
|
import com.syjiaer.clinic.server.entity.vip.dto.VipIntegralLogQuery;
|
||||||
|
import com.syjiaer.clinic.server.service.patient.PatientInfoService;
|
||||||
import com.syjiaer.clinic.server.service.vip.VipIntegralLogService;
|
import com.syjiaer.clinic.server.service.vip.VipIntegralLogService;
|
||||||
import com.syjiaer.clinic.server.service.vip.VipService;
|
import com.syjiaer.clinic.server.service.vip.VipService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -17,17 +19,17 @@ import java.util.List;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/vip/integral")
|
@RequestMapping("/vip/integral")
|
||||||
public class VipIntegralController extends BaseController {
|
public class VipIntegralController extends BaseController {
|
||||||
@Autowired
|
|
||||||
private VipService vipService;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VipIntegralLogService vipIntegralLogService;
|
private VipIntegralLogService vipIntegralLogService;
|
||||||
|
@Autowired
|
||||||
|
private PatientInfoService patientInfoService;
|
||||||
|
|
||||||
@RequestMapping("/add")
|
@RequestMapping("/add")
|
||||||
public Result add(){
|
public Result add(){
|
||||||
Integer vipId = parmsUtil.getInteger("vipId","请输入会员id");
|
Integer vipId = parmsUtil.getInteger("vipId","请输入会员id");
|
||||||
Integer Integral = parmsUtil.getInteger("integral","请输入积分");
|
Integer Integral = parmsUtil.getInteger("integral","请输入积分");
|
||||||
String remark = parmsUtil.getString("remark","请输入备注");
|
String remark = parmsUtil.getString("remark","请输入备注");
|
||||||
vipService.changeIntegral(vipId,Integral,remark);
|
patientInfoService.changeIntegral(vipId,Integral,remark);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import lombok.experimental.Accessors;
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author NiuZiYuan
|
* @author NiuZiYuan
|
||||||
* @since 2025-04-27
|
* @since 2025-04-29
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -73,4 +73,7 @@ public class ChargeOrder implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty("总成本")
|
@ApiModelProperty("总成本")
|
||||||
private BigDecimal totalCost;
|
private BigDecimal totalCost;
|
||||||
|
|
||||||
|
@ApiModelProperty("销售人id")
|
||||||
|
private Integer salePersonId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@ public class ChargeQuery {
|
||||||
private String patientName;
|
private String patientName;
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
private Integer patientId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.syjiaer.clinic.server.entity.charge.vo;
|
package com.syjiaer.clinic.server.entity.charge.vo;
|
||||||
|
|
||||||
|
import com.syjiaer.clinic.server.entity.charge.ChargeGoodsList;
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeItemList;
|
import com.syjiaer.clinic.server.entity.charge.ChargeItemList;
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.DiagnosisMedicalRecord;
|
import com.syjiaer.clinic.server.entity.diagnosis.DiagnosisMedicalRecord;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
|
|
@ -60,6 +61,6 @@ public class ChargeDetailVo {
|
||||||
@ApiModelProperty("诊疗服务")
|
@ApiModelProperty("诊疗服务")
|
||||||
private List<ChargeItemList> serviceDetail;
|
private List<ChargeItemList> serviceDetail;
|
||||||
@ApiModelProperty("药品耗材")
|
@ApiModelProperty("药品耗材")
|
||||||
private List<ChargeGoodsListVo> goodsDetail;
|
private List<ChargeGoodsList> goodsDetail;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,5 @@ public class ChargeQueueQuery {
|
||||||
private String patientName;
|
private String patientName;
|
||||||
private Integer pageNum;
|
private Integer pageNum;
|
||||||
private Integer pageSize;
|
private Integer pageSize;
|
||||||
|
private Integer status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
package com.syjiaer.clinic.server.entity.diagnosis.dto;
|
package com.syjiaer.clinic.server.entity.diagnosis.dto;
|
||||||
|
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.DiagnosisMedicalRecord;
|
import com.syjiaer.clinic.server.entity.diagnosis.DiagnosisMedicalRecord;
|
||||||
import com.syjiaer.clinic.server.entity.item.Item;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|
@ -19,7 +17,7 @@ public class MedicalRecordSaveDto {
|
||||||
private Integer patientId;
|
private Integer patientId;
|
||||||
|
|
||||||
@ApiModelProperty("接诊医生id")
|
@ApiModelProperty("接诊医生id")
|
||||||
private Integer dockerId;
|
private Integer doctorId;
|
||||||
|
|
||||||
@ApiModelProperty("挂单id")
|
@ApiModelProperty("挂单id")
|
||||||
private Integer registrationId;
|
private Integer registrationId;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.diagnosis.vo;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
@Data
|
||||||
|
public class ChargeQueueVo {
|
||||||
|
|
||||||
|
@ApiModelProperty("自增id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者id")
|
||||||
|
private Integer patientId;
|
||||||
|
|
||||||
|
@ApiModelProperty("诊断code")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂单id")
|
||||||
|
private Integer registrationId;
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
private Integer status;
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者名称")
|
||||||
|
private String patientName;
|
||||||
|
@ApiModelProperty("患者性别")
|
||||||
|
private Integer patientGender;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.organization.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DockerSearchQuery {
|
||||||
|
private String keyword;
|
||||||
|
private Integer role;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.organization.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
@Data
|
||||||
|
public class MemberVo {
|
||||||
|
@ApiModelProperty("自增主键")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("成员电话")
|
||||||
|
private String tel;
|
||||||
|
|
||||||
|
@ApiModelProperty("医保人员代码")
|
||||||
|
private String socialMemberCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("电子签名")
|
||||||
|
private String electronicSignature;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private String gender;
|
||||||
|
|
||||||
|
@ApiModelProperty("年龄")
|
||||||
|
private String age;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createDatetime;
|
||||||
|
|
||||||
|
@ApiModelProperty("身份证号")
|
||||||
|
private String idCardNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("所属科室")
|
||||||
|
private Integer sectionId;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
@ApiModelProperty("管理员id")
|
||||||
|
private Integer managerUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty("成员名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("角色")
|
||||||
|
private Integer role;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标记")
|
||||||
|
private Boolean delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("科室名称")
|
||||||
|
private String sectionName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -5,20 +5,21 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* 患者信息
|
* 患者信息
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author NiuZiYuan
|
* @author NiuZiYuan
|
||||||
* @since 2025-04-17
|
* @since 2025-04-30
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -40,12 +41,51 @@ public class PatientInfo implements Serializable {
|
||||||
@ApiModelProperty("手机号")
|
@ApiModelProperty("手机号")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@ApiModelProperty("身份证号")
|
@ApiModelProperty("证件号码")
|
||||||
private String certno;
|
private String certNo;
|
||||||
|
|
||||||
@ApiModelProperty("性别")
|
@ApiModelProperty("性别")
|
||||||
private String sex;
|
private Integer sex;
|
||||||
|
|
||||||
@ApiModelProperty("年龄")
|
@ApiModelProperty("年龄")
|
||||||
private Integer age;
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty("证件类型")
|
||||||
|
private String certType;
|
||||||
|
|
||||||
|
@ApiModelProperty("来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@ApiModelProperty("民族")
|
||||||
|
private String nation;
|
||||||
|
|
||||||
|
@ApiModelProperty("地区")
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
@ApiModelProperty("地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建日期")
|
||||||
|
private LocalDateTime createDatetime;
|
||||||
|
|
||||||
|
@ApiModelProperty("会员等级")
|
||||||
|
private Integer levelId;
|
||||||
|
|
||||||
|
@ApiModelProperty("经验值")
|
||||||
|
private Integer exp;
|
||||||
|
|
||||||
|
@ApiModelProperty("积分余额")
|
||||||
|
private Integer integralBalance;
|
||||||
|
|
||||||
|
@ApiModelProperty("0没绑医保 1已绑定")
|
||||||
|
private Integer isBindSocial;
|
||||||
|
|
||||||
|
@ApiModelProperty("余额")
|
||||||
|
private BigDecimal balance;
|
||||||
|
|
||||||
|
@ApiModelProperty("生日")
|
||||||
|
private LocalDate birthday;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import lombok.experimental.Accessors;
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author NiuZiYuan
|
* @author NiuZiYuan
|
||||||
* @since 2025-04-23
|
* @since 2025-04-30
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -48,7 +48,7 @@ public class PatientRegistration implements Serializable {
|
||||||
@ApiModelProperty("患者手机号")
|
@ApiModelProperty("患者手机号")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
@ApiModelProperty("就诊类型")
|
@ApiModelProperty("就诊类型 初诊 复诊")
|
||||||
private Short visitType;
|
private Short visitType;
|
||||||
|
|
||||||
@ApiModelProperty("挂号时间")
|
@ApiModelProperty("挂号时间")
|
||||||
|
|
@ -69,11 +69,11 @@ public class PatientRegistration implements Serializable {
|
||||||
@ApiModelProperty("逻辑删除")
|
@ApiModelProperty("逻辑删除")
|
||||||
private Integer delFlag;
|
private Integer delFlag;
|
||||||
|
|
||||||
@ApiModelProperty("挂号类型")
|
@ApiModelProperty("挂号类型 1普通挂号 2医保挂号")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty("性别")
|
@ApiModelProperty("1男 2女")
|
||||||
private String gender;
|
private Integer gender;
|
||||||
|
|
||||||
@ApiModelProperty("病人id")
|
@ApiModelProperty("病人id")
|
||||||
private Integer patientInfoId;
|
private Integer patientInfoId;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.patient.dto;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
@Data
|
||||||
|
public class RegistrationSaveDto {
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("科室id")
|
||||||
|
private Integer organizationSectionId;
|
||||||
|
|
||||||
|
@ApiModelProperty("医生id")
|
||||||
|
private Integer organizationDoctorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty("就诊类型")
|
||||||
|
private Short visitType;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号时间")
|
||||||
|
private LocalDateTime createDatetime;
|
||||||
|
|
||||||
|
@ApiModelProperty("推荐")
|
||||||
|
private String recommendations;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
@ApiModelProperty("预诊")
|
||||||
|
private String advanceDiagnosis;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号费")
|
||||||
|
private BigDecimal registrationMoney;
|
||||||
|
|
||||||
|
@ApiModelProperty("逻辑删除")
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
@ApiModelProperty("病人id")
|
||||||
|
private Integer patientInfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号状态 1候诊 2在诊 3已诊 0取消")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("人员编号")
|
||||||
|
private String psnNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("险种类型")
|
||||||
|
private String insutype;
|
||||||
|
|
||||||
|
@ApiModelProperty("就诊id 挂号后医保返会")
|
||||||
|
private String mdtrtId;
|
||||||
|
|
||||||
|
@ApiModelProperty("流水号")
|
||||||
|
private String fstNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("证件号码")
|
||||||
|
private String certNo;
|
||||||
|
@ApiModelProperty("证件类型")
|
||||||
|
private String certType;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.patient.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
@Data
|
||||||
|
public class PatientRegistrationVo {
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号id")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("科室id")
|
||||||
|
private Integer organizationSectionId;
|
||||||
|
|
||||||
|
@ApiModelProperty("医生id")
|
||||||
|
private Integer organizationDoctorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty("患者手机号")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty("就诊类型 初诊 复诊")
|
||||||
|
private Short visitType;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号时间")
|
||||||
|
private LocalDateTime createDatetime;
|
||||||
|
|
||||||
|
@ApiModelProperty("推荐")
|
||||||
|
private String recommendations;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String memo;
|
||||||
|
|
||||||
|
@ApiModelProperty("预诊")
|
||||||
|
private String advanceDiagnosis;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号费")
|
||||||
|
private BigDecimal registrationMoney;
|
||||||
|
|
||||||
|
@ApiModelProperty("逻辑删除")
|
||||||
|
private Integer delFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号类型 1普通挂号 2医保挂号")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("1男 2女")
|
||||||
|
private Integer gender;
|
||||||
|
|
||||||
|
@ApiModelProperty("病人id")
|
||||||
|
private Integer patientInfoId;
|
||||||
|
|
||||||
|
@ApiModelProperty("挂号状态 1候诊 2在诊 3已诊 0取消")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("人员编号")
|
||||||
|
private String psnNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("险种类型")
|
||||||
|
private String insutype;
|
||||||
|
|
||||||
|
@ApiModelProperty("就诊id 挂号后医保返会")
|
||||||
|
private String mdtrtId;
|
||||||
|
|
||||||
|
@ApiModelProperty("流水号")
|
||||||
|
private String fstNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("证件类型")
|
||||||
|
private String certType;
|
||||||
|
@ApiModelProperty("证件号码")
|
||||||
|
private String certNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.patient.vo;
|
||||||
|
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
@Data
|
||||||
|
public class SeeDoctorInfoVo {
|
||||||
|
//患者信息
|
||||||
|
private PatientInfo patientInfo;
|
||||||
|
//挂号医生id
|
||||||
|
private Integer dockerId;
|
||||||
|
//挂号医生姓名
|
||||||
|
private String dockerName;
|
||||||
|
//医生科室名称
|
||||||
|
private String sectionName;
|
||||||
|
//上一次接诊时间
|
||||||
|
private LocalDateTime lastSeeDoctorTime;
|
||||||
|
//就诊次数
|
||||||
|
private Integer seeDoctorCount;
|
||||||
|
//医保余额
|
||||||
|
private BigDecimal socialBalance;
|
||||||
|
}
|
||||||
|
|
@ -7,6 +7,7 @@ import java.math.BigDecimal;
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class PayTypeRevenue {
|
public class PayTypeRevenue {
|
||||||
|
private Integer payType;
|
||||||
private BigDecimal totalRevenue;
|
private BigDecimal totalRevenue;
|
||||||
private String name;
|
private String name;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,18 @@ import java.util.List;
|
||||||
public class RevenueOverviewVo {
|
public class RevenueOverviewVo {
|
||||||
//总营业额
|
//总营业额
|
||||||
private BigDecimal totalRevenue;
|
private BigDecimal totalRevenue;
|
||||||
//会员销售额
|
//医保销售额
|
||||||
private BigDecimal vipRevenue;
|
private BigDecimal socialRevenue;
|
||||||
//总完成单数
|
//总完成单数
|
||||||
private Long totalOrderCount;
|
private Long totalOrderCount;
|
||||||
//会员单数
|
//医保单数
|
||||||
private Long vipOrderCount;
|
private Long socialOrderCount;
|
||||||
|
|
||||||
private List<GoodsTypeRevenue> goodsTypeRevenue;
|
private List<GoodsTypeRevenue> goodsTypeRevenue;
|
||||||
|
|
||||||
private List<PayTypeRevenue> payTypeRevenue;
|
private List<PayTypeRevenue> payTypeRevenue;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.statistics;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class SalePersonReportVo {
|
||||||
|
private Integer salePersonId;
|
||||||
|
private String salePersonName;
|
||||||
|
private BigDecimal totalIncome;
|
||||||
|
private BigDecimal wechatIncome;
|
||||||
|
private BigDecimal aliPayIncome;
|
||||||
|
private BigDecimal cashIncome;
|
||||||
|
private BigDecimal otherIncome;
|
||||||
|
private BigDecimal socialIncome;
|
||||||
|
private Long count;
|
||||||
|
|
||||||
|
public SalePersonReportVo() {
|
||||||
|
this.totalIncome = BigDecimal.ZERO;
|
||||||
|
this.wechatIncome = BigDecimal.ZERO;
|
||||||
|
this.aliPayIncome = BigDecimal.ZERO;
|
||||||
|
this.cashIncome = BigDecimal.ZERO;
|
||||||
|
this.otherIncome = BigDecimal.ZERO;
|
||||||
|
this.socialIncome = BigDecimal.ZERO;
|
||||||
|
this.count = 0L;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.statistics;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TipCountVo {
|
||||||
|
//待诊断数量
|
||||||
|
private Long waitDiagnosisCount;
|
||||||
|
//在诊数量
|
||||||
|
private Long diagnosingCount;
|
||||||
|
//完诊数量
|
||||||
|
private Long completeDiaCount;
|
||||||
|
//已收费数量
|
||||||
|
private Long chargedCount;
|
||||||
|
//未收费数量
|
||||||
|
private Long unchargedCount;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,9 @@ import com.syjiaer.clinic.server.entity.charge.ChargeOrder;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|
@ -16,6 +19,7 @@ import org.apache.ibatis.annotations.Select;
|
||||||
public interface ChargeOrderMapper extends BaseMapper<ChargeOrder> {
|
public interface ChargeOrderMapper extends BaseMapper<ChargeOrder> {
|
||||||
@Select("select * from charge_order where code = #{code}")
|
@Select("select * from charge_order where code = #{code}")
|
||||||
ChargeOrder selectByCode(String code);
|
ChargeOrder selectByCode(String code);
|
||||||
|
@Select("SELECT sale_person_id,pay_type,\"sum\"(total_price) ,\"count\"(0) FROM \"public\".\"charge_order\" GROUP BY sale_person_id,pay_type")
|
||||||
|
List<Map<String, Object>> selectSaleReport();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
|
||||||
@Select("SELECT" +
|
@Select("SELECT" +
|
||||||
" inventory.*,goods.expiry_warn_days,goods.unit_price,EXTRACT(EPOCH FROM AGE(expiry_date, CURRENT_DATE)) / 86400 AS remaining_days" +
|
" inventory.*,goods.expiry_warn_days,goods.unit_price,EXTRACT(EPOCH FROM AGE(expiry_date, CURRENT_DATE)) / 86400 AS remaining_days" +
|
||||||
" FROM inventory LEFT JOIN goods ON inventory.good_id = goods.id" +
|
" FROM inventory LEFT JOIN goods ON inventory.good_id = goods.id" +
|
||||||
" WHERE CURRENT_DATE + INTERVAL '1 day' * goods.expiry_warn_days >= inventory.expiry_date AND inventory.whole_number !=0")
|
" WHERE CURRENT_DATE + INTERVAL '1 day' * goods.expiry_warn_days >= inventory.expiry_date AND inventory.whole_number !=0 ORDER BY inventory.expiry_date ASC LIMIT 20 ")
|
||||||
List<Map<String, Object>> selectExpiryWarn();
|
List<Map<String, Object>> selectExpiryWarn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,13 @@ package com.syjiaer.clinic.server.mapper.organization;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.dto.DockerSearchQuery;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.vo.MemberVo;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.apache.ibatis.annotations.Select;
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -16,5 +20,7 @@ import java.io.Serializable;
|
||||||
* @since 2025-04-11
|
* @since 2025-04-11
|
||||||
*/
|
*/
|
||||||
public interface OrganizationMemberMapper extends BaseMapper<OrganizationMember> {
|
public interface OrganizationMemberMapper extends BaseMapper<OrganizationMember> {
|
||||||
|
|
||||||
|
List<MemberVo> selectDetailByQuery(DockerSearchQuery query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,11 @@ import com.syjiaer.clinic.server.common.api.output.OM2207A;
|
||||||
import com.syjiaer.clinic.server.common.api.request.SocialRequest;
|
import com.syjiaer.clinic.server.common.api.request.SocialRequest;
|
||||||
import com.syjiaer.clinic.server.common.config.Config;
|
import com.syjiaer.clinic.server.common.config.Config;
|
||||||
import com.syjiaer.clinic.server.common.constants.Constants;
|
import com.syjiaer.clinic.server.common.constants.Constants;
|
||||||
import com.syjiaer.clinic.server.common.enums.InventorySocialTypeEnum;
|
import com.syjiaer.clinic.server.common.enums.*;
|
||||||
import com.syjiaer.clinic.server.common.enums.InventoryTypeEnum;
|
|
||||||
import com.syjiaer.clinic.server.common.enums.RetailOrderPayTypeEnum;
|
|
||||||
import com.syjiaer.clinic.server.common.enums.RetailOrderStatusEnum;
|
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import com.syjiaer.clinic.server.common.util.StringUtil;
|
import com.syjiaer.clinic.server.common.util.StringUtil;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeGoodsList;
|
import com.syjiaer.clinic.server.entity.charge.*;
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeItemList;
|
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeOrder;
|
|
||||||
import com.syjiaer.clinic.server.entity.charge.dto.ChargeQuery;
|
import com.syjiaer.clinic.server.entity.charge.dto.ChargeQuery;
|
||||||
import com.syjiaer.clinic.server.entity.charge.dto.ChargeSaveDto;
|
import com.syjiaer.clinic.server.entity.charge.dto.ChargeSaveDto;
|
||||||
import com.syjiaer.clinic.server.entity.charge.vo.ChargeDetailVo;
|
import com.syjiaer.clinic.server.entity.charge.vo.ChargeDetailVo;
|
||||||
|
|
@ -35,12 +30,12 @@ import com.syjiaer.clinic.server.entity.item.Item;
|
||||||
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
||||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
import com.syjiaer.clinic.server.entity.social.SocialDirectory;
|
import com.syjiaer.clinic.server.entity.social.SocialDirectory;
|
||||||
import com.syjiaer.clinic.server.entity.social.SocialItem;
|
import com.syjiaer.clinic.server.entity.social.SocialItem;
|
||||||
import com.syjiaer.clinic.server.mapper.charge.ChargeGoodsListMapper;
|
import com.syjiaer.clinic.server.entity.social.SocialUser;
|
||||||
import com.syjiaer.clinic.server.mapper.charge.ChargeItemListMapper;
|
import com.syjiaer.clinic.server.mapper.charge.*;
|
||||||
import com.syjiaer.clinic.server.mapper.charge.ChargeOrderMapper;
|
|
||||||
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMapper;
|
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMedicalGoodsListMapper;
|
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMedicalGoodsListMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMedicalItemListMapper;
|
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMedicalItemListMapper;
|
||||||
|
|
@ -54,6 +49,7 @@ import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.patient.PatientRegistrationMapper;
|
import com.syjiaer.clinic.server.mapper.patient.PatientRegistrationMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.social.SocialDirectoryMapper;
|
import com.syjiaer.clinic.server.mapper.social.SocialDirectoryMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.social.SocialItemMapper;
|
import com.syjiaer.clinic.server.mapper.social.SocialItemMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.social.SocialUserMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
import com.syjiaer.clinic.server.service.charge.vo.PaymentMethodVo;
|
import com.syjiaer.clinic.server.service.charge.vo.PaymentMethodVo;
|
||||||
import com.syjiaer.clinic.server.service.charge.vo.RetailOrderDailyChargingReportVo;
|
import com.syjiaer.clinic.server.service.charge.vo.RetailOrderDailyChargingReportVo;
|
||||||
|
|
@ -69,16 +65,19 @@ import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class ChargeService extends BaseService {
|
public class ChargeService extends BaseService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChargeOrderMapper chargeOrderMapper;
|
private ChargeOrderMapper chargeOrderMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private ChargeLogMapper chargeLogMapper;
|
||||||
|
@Autowired
|
||||||
|
private ChargeInventoryLogMapper chargeInventoryLogMapper;
|
||||||
|
@Autowired
|
||||||
|
private SocialUserMapper socialUserMapper;
|
||||||
|
@Autowired
|
||||||
private ChargeItemListMapper chargeItemListMapper;
|
private ChargeItemListMapper chargeItemListMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChargeGoodsListMapper chargeGoodsListMapper;
|
private ChargeGoodsListMapper chargeGoodsListMapper;
|
||||||
|
|
@ -129,7 +128,7 @@ public class ChargeService extends BaseService {
|
||||||
}
|
}
|
||||||
Diagnosis diagnosis = diagnosisMapper.selectById(dto.getId());
|
Diagnosis diagnosis = diagnosisMapper.selectById(dto.getId());
|
||||||
//清除该诊断的病例信息
|
//清除该诊断的病例信息
|
||||||
if (diagnosis != null){
|
if (diagnosis != null) {
|
||||||
String diaCode = diagnosis.getCode();
|
String diaCode = diagnosis.getCode();
|
||||||
diagnosisMedicalGoodsListMapper.delete(new QueryWrapper<DiagnosisMedicalGoodsList>().eq("diagnosis_code", diaCode));
|
diagnosisMedicalGoodsListMapper.delete(new QueryWrapper<DiagnosisMedicalGoodsList>().eq("diagnosis_code", diaCode));
|
||||||
diagnosisMedicalItemListMapper.delete(new QueryWrapper<DiagnosisMedicalItemList>().eq("diagnosis_code", diaCode));
|
diagnosisMedicalItemListMapper.delete(new QueryWrapper<DiagnosisMedicalItemList>().eq("diagnosis_code", diaCode));
|
||||||
|
|
@ -137,8 +136,8 @@ public class ChargeService extends BaseService {
|
||||||
DiagnosisMedicalRecord medicalRecord = new DiagnosisMedicalRecord();
|
DiagnosisMedicalRecord medicalRecord = new DiagnosisMedicalRecord();
|
||||||
BeanUtils.copyProperties(dto.getDiagnosisMedicalRecord(), medicalRecord);
|
BeanUtils.copyProperties(dto.getDiagnosisMedicalRecord(), medicalRecord);
|
||||||
diagnosisMedicalRecordMapper.updateById(medicalRecord);
|
diagnosisMedicalRecordMapper.updateById(medicalRecord);
|
||||||
List<DiagnosisMedicalItemList> mdItmeList= new ArrayList<>();
|
List<DiagnosisMedicalItemList> mdItmeList = new ArrayList<>();
|
||||||
for (ChargeItemListVo item : dto.getItemDetail()){
|
for (ChargeItemListVo item : dto.getItemDetail()) {
|
||||||
DiagnosisMedicalItemList itemDetail = new DiagnosisMedicalItemList();
|
DiagnosisMedicalItemList itemDetail = new DiagnosisMedicalItemList();
|
||||||
itemDetail.setItemId(item.getId());
|
itemDetail.setItemId(item.getId());
|
||||||
itemDetail.setDiagnosisCode(diaCode);
|
itemDetail.setDiagnosisCode(diaCode);
|
||||||
|
|
@ -150,8 +149,8 @@ public class ChargeService extends BaseService {
|
||||||
mdItmeList.add(itemDetail);
|
mdItmeList.add(itemDetail);
|
||||||
}
|
}
|
||||||
diagnosisMedicalItemListMapper.insert(mdItmeList);
|
diagnosisMedicalItemListMapper.insert(mdItmeList);
|
||||||
List<DiagnosisMedicalGoodsList> mdGoodsList= new ArrayList<>();
|
List<DiagnosisMedicalGoodsList> mdGoodsList = new ArrayList<>();
|
||||||
for (ChargeGoodsListVo goods : dto.getGoodsDetail()){
|
for (ChargeGoodsListVo goods : dto.getGoodsDetail()) {
|
||||||
DiagnosisMedicalGoodsList goodDetail = new DiagnosisMedicalGoodsList();
|
DiagnosisMedicalGoodsList goodDetail = new DiagnosisMedicalGoodsList();
|
||||||
goodDetail.setGoodsId(goods.getId());
|
goodDetail.setGoodsId(goods.getId());
|
||||||
goodDetail.setDiagnosisCode(diaCode);
|
goodDetail.setDiagnosisCode(diaCode);
|
||||||
|
|
@ -169,14 +168,14 @@ public class ChargeService extends BaseService {
|
||||||
|
|
||||||
QueryWrapper<ChargeOrder> listWrapper = new QueryWrapper<>();
|
QueryWrapper<ChargeOrder> listWrapper = new QueryWrapper<>();
|
||||||
listWrapper.eq("diagnosis_code", dto.getDiagnosisMedicalRecord().getDiagnosisCode());
|
listWrapper.eq("diagnosis_code", dto.getDiagnosisMedicalRecord().getDiagnosisCode());
|
||||||
listWrapper.eq("status",RetailOrderStatusEnum.FINISHED.getCode());
|
listWrapper.eq("status", RetailOrderStatusEnum.FINISHED.getCode());
|
||||||
List<ChargeOrder> dbList = chargeOrderMapper.selectList(listWrapper);
|
List<ChargeOrder> dbList = chargeOrderMapper.selectList(listWrapper);
|
||||||
if (!dbList.isEmpty()){
|
if (!dbList.isEmpty()) {
|
||||||
throw new MessageException("该诊断已完成收费");
|
throw new MessageException("该诊断已完成收费");
|
||||||
}
|
}
|
||||||
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("diagnosis_code", dto.getDiagnosisMedicalRecord().getDiagnosisCode());
|
queryWrapper.eq("diagnosis_code", dto.getDiagnosisMedicalRecord().getDiagnosisCode());
|
||||||
queryWrapper.eq("status",RetailOrderStatusEnum.UNFINISHED.getCode());
|
queryWrapper.eq("status", RetailOrderStatusEnum.UNFINISHED.getCode());
|
||||||
chargeOrderMapper.delete(queryWrapper);
|
chargeOrderMapper.delete(queryWrapper);
|
||||||
|
|
||||||
ManagerUser user = getManagerUser();
|
ManagerUser user = getManagerUser();
|
||||||
|
|
@ -202,7 +201,7 @@ public class ChargeService extends BaseService {
|
||||||
itemList.setCreateDate(nowLocalDate);
|
itemList.setCreateDate(nowLocalDate);
|
||||||
itemList.setCreateTime(nowLocalDateTime);
|
itemList.setCreateTime(nowLocalDateTime);
|
||||||
chargeServiceLists.add(itemList);
|
chargeServiceLists.add(itemList);
|
||||||
BigDecimal subPrice =service.getSelectedPrice().multiply(BigDecimal.valueOf(service.getSelectedNum()));
|
BigDecimal subPrice = service.getSelectedPrice().multiply(BigDecimal.valueOf(service.getSelectedNum()));
|
||||||
preTotalPrice = preTotalPrice.add(subPrice);
|
preTotalPrice = preTotalPrice.add(subPrice);
|
||||||
totalPrice = totalPrice.add(subPrice);
|
totalPrice = totalPrice.add(subPrice);
|
||||||
}
|
}
|
||||||
|
|
@ -248,6 +247,7 @@ public class ChargeService extends BaseService {
|
||||||
chargeOrder.setStatus(RetailOrderStatusEnum.UNFINISHED.getCode());
|
chargeOrder.setStatus(RetailOrderStatusEnum.UNFINISHED.getCode());
|
||||||
chargeOrder.setPatientId(dto.getPatientInfo().getId());
|
chargeOrder.setPatientId(dto.getPatientInfo().getId());
|
||||||
chargeOrder.setDiagnosisCode(dto.getDiagnosisMedicalRecord().getDiagnosisCode());
|
chargeOrder.setDiagnosisCode(dto.getDiagnosisMedicalRecord().getDiagnosisCode());
|
||||||
|
chargeOrder.setSalePersonId(dto.getPatientRegistration().getOrganizationDoctorId());
|
||||||
chargeOrderMapper.insert(chargeOrder);
|
chargeOrderMapper.insert(chargeOrder);
|
||||||
return chargeOrder;
|
return chargeOrder;
|
||||||
|
|
||||||
|
|
@ -265,16 +265,19 @@ public class ChargeService extends BaseService {
|
||||||
if (query.getPatientName() != null) {
|
if (query.getPatientName() != null) {
|
||||||
queryWrapper.like("patient_name", query.getPatientName());
|
queryWrapper.like("patient_name", query.getPatientName());
|
||||||
}
|
}
|
||||||
|
if (query.getPatientId() != null){
|
||||||
|
queryWrapper.eq("patient_id", query.getPatientId());
|
||||||
|
}
|
||||||
Page<ChargeOrder> orderPage = pageHelper(query.getPageNum(), query.getPageSize(), queryWrapper, chargeOrderMapper, "create_datetime", false);
|
Page<ChargeOrder> orderPage = pageHelper(query.getPageNum(), query.getPageSize(), queryWrapper, chargeOrderMapper, "create_datetime", false);
|
||||||
List<ChargeDetailVo> voList = new ArrayList<>();
|
List<ChargeDetailVo> voList = new ArrayList<>();
|
||||||
for (ChargeOrder chargeOrder : orderPage.getList()) {
|
for (ChargeOrder chargeOrder : orderPage.getList()) {
|
||||||
ChargeDetailVo detailVo = new ChargeDetailVo();
|
ChargeDetailVo detailVo = new ChargeDetailVo();
|
||||||
BeanUtils.copyProperties(chargeOrder, detailVo);
|
BeanUtils.copyProperties(chargeOrder, detailVo);
|
||||||
|
detailVo.setDiagnosisMedicalRecord(diagnosisMedicalRecordMapper.selectByDiagnosisCode(chargeOrder.getDiagnosisCode()));
|
||||||
detailVo.setPatientInfo(patientInfoMapper.selectById(chargeOrder.getPatientId()));
|
detailVo.setPatientInfo(patientInfoMapper.selectById(chargeOrder.getPatientId()));
|
||||||
detailVo.setServiceDetail(chargeItemListMapper.selectList(new QueryWrapper<ChargeItemList>()
|
detailVo.setServiceDetail(chargeItemListMapper.selectByCode(chargeOrder.getCode()));
|
||||||
.eq("charge_order_code", chargeOrder.getCode())));
|
|
||||||
|
|
||||||
detailVo.setGoodsDetail(chargeGoodsListMapper.selectDetailByCode(chargeOrder.getCode()));
|
detailVo.setGoodsDetail(chargeGoodsListMapper.selectByCode(chargeOrder.getCode()));
|
||||||
voList.add(detailVo);
|
voList.add(detailVo);
|
||||||
}
|
}
|
||||||
Page<ChargeDetailVo> resultPage = new Page<>();
|
Page<ChargeDetailVo> resultPage = new Page<>();
|
||||||
|
|
@ -284,7 +287,7 @@ public class ChargeService extends BaseService {
|
||||||
return resultPage;
|
return resultPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
// public ChargeOrder updateOrCreate(ChargeOrderDto dto) {
|
// public ChargeOrder updateOrCreate(ChargeOrderDto dto) {
|
||||||
// //创建患者
|
// //创建患者
|
||||||
// PatientInfo patientInfo = dto.getPatientInfo();
|
// PatientInfo patientInfo = dto.getPatientInfo();
|
||||||
|
|
@ -330,6 +333,8 @@ public class ChargeService extends BaseService {
|
||||||
updateOrder.setPayType(payType);
|
updateOrder.setPayType(payType);
|
||||||
updateOrder.setPayTime(LocalDateTime.now());
|
updateOrder.setPayTime(LocalDateTime.now());
|
||||||
chargeOrderMapper.updateById(updateOrder);
|
chargeOrderMapper.updateById(updateOrder);
|
||||||
|
|
||||||
|
order = chargeOrderMapper.selectById(id);
|
||||||
//扣除商品库存
|
//扣除商品库存
|
||||||
List<ChargeGoodsListVo> goodsLists = chargeGoodsListMapper.selectDetailByCode(order.getCode());
|
List<ChargeGoodsListVo> goodsLists = chargeGoodsListMapper.selectDetailByCode(order.getCode());
|
||||||
for (ChargeGoodsListVo goodsList : goodsLists) {
|
for (ChargeGoodsListVo goodsList : goodsLists) {
|
||||||
|
|
@ -347,7 +352,11 @@ public class ChargeService extends BaseService {
|
||||||
log.setSocialType(InventorySocialTypeEnum.INVENTORY_SURPLUS.getType());
|
log.setSocialType(InventorySocialTypeEnum.INVENTORY_SURPLUS.getType());
|
||||||
}
|
}
|
||||||
inventoryLogMapper.insert(logs);
|
inventoryLogMapper.insert(logs);
|
||||||
|
this.recordChargeInventoryLog(logs,order);
|
||||||
}
|
}
|
||||||
|
//记录收费日志
|
||||||
|
this.recordChargeLog(order, ChargeSourceEnum.CHARGE, ChargeTypeEnum.CHARGE);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,7 +380,7 @@ public class ChargeService extends BaseService {
|
||||||
im2205.setPsnNo(registration.getPsnNo());
|
im2205.setPsnNo(registration.getPsnNo());
|
||||||
im2205.setExpContent("");
|
im2205.setExpContent("");
|
||||||
socialRequest.call2205(im2205);
|
socialRequest.call2205(im2205);
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -437,7 +446,7 @@ public class ChargeService extends BaseService {
|
||||||
ChargeOrder order = chargeOrderMapper.selectByCode(changeOrderCode);
|
ChargeOrder order = chargeOrderMapper.selectByCode(changeOrderCode);
|
||||||
Diagnosis diagnosis = diagnosisMapper.selectByCode(order.getDiagnosisCode());
|
Diagnosis diagnosis = diagnosisMapper.selectByCode(order.getDiagnosisCode());
|
||||||
//预支付只需要卡号
|
//预支付只需要卡号
|
||||||
String cardNumber = mdtrtCertNo.substring(0,mdtrtCertNo.indexOf("|"));
|
String cardNumber = mdtrtCertNo.substring(0, mdtrtCertNo.indexOf("|"));
|
||||||
PatientRegistration registration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
PatientRegistration registration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
||||||
|
|
||||||
IM2206A im2206A = new IM2206A();
|
IM2206A im2206A = new IM2206A();
|
||||||
|
|
@ -483,7 +492,7 @@ public class ChargeService extends BaseService {
|
||||||
OM2207A om2207A = socialRequest.call2207A(im2207A);
|
OM2207A om2207A = socialRequest.call2207A(im2207A);
|
||||||
//完成订单
|
//完成订单
|
||||||
chargeService.completeOrder(order.getId(), RetailOrderPayTypeEnum.MEDICARE.getCode());
|
chargeService.completeOrder(order.getId(), RetailOrderPayTypeEnum.MEDICARE.getCode());
|
||||||
return om2207A;
|
return om2207A;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -494,8 +503,8 @@ public class ChargeService extends BaseService {
|
||||||
* @param endDateTime
|
* @param endDateTime
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Map<String, RetailOrderDailyChargingReportVo> dailyChargingReport(LocalDateTime startDateTime, LocalDateTime endDateTime) {
|
public List<RetailOrderDailyChargingReportVo> dailyChargingReport(LocalDateTime startDateTime, LocalDateTime endDateTime) {
|
||||||
Map<String, RetailOrderDailyChargingReportVo> result = new HashMap<>();
|
Map<String, RetailOrderDailyChargingReportVo> result = new TreeMap<>();
|
||||||
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.between("create_datetime", startDateTime, endDateTime)
|
queryWrapper.between("create_datetime", startDateTime, endDateTime)
|
||||||
.eq("status", RetailOrderStatusEnum.FINISHED.getCode())
|
.eq("status", RetailOrderStatusEnum.FINISHED.getCode())
|
||||||
|
|
@ -518,13 +527,21 @@ public class ChargeService extends BaseService {
|
||||||
}
|
}
|
||||||
result.put(dateKey, retailOrderDailyChargingReportVo);
|
result.put(dateKey, retailOrderDailyChargingReportVo);
|
||||||
}
|
}
|
||||||
|
List<RetailOrderDailyChargingReportVo> voList = new ArrayList<>();
|
||||||
result.forEach((key, value) -> {
|
result.forEach((key, value) -> {
|
||||||
BigDecimal grossMargin = value.getTotalMoney().subtract(value.getTotalCost());
|
BigDecimal grossMargin = value.getTotalMoney().subtract(value.getTotalCost());
|
||||||
value.setGrossMargin(grossMargin);
|
value.setGrossMargin(grossMargin);
|
||||||
value.setGrossProfitRate(String.format("%.2f%%", grossMargin.divide(value.getTotalMoney(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))));
|
BigDecimal divisor = value.getTotalMoney();
|
||||||
|
if (divisor.compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
// 处理除数为零的情况,例如抛出自定义异常或返回默认值
|
||||||
|
value.setGrossProfitRate("0.00%");
|
||||||
|
}else {
|
||||||
|
value.setGrossProfitRate(String.format("%.2f%%", grossMargin.divide(value.getTotalMoney(), 4, RoundingMode.HALF_UP).multiply(new BigDecimal("100"))));
|
||||||
|
}
|
||||||
|
value.setDate(LocalDate.parse(key));
|
||||||
|
voList.add(value);
|
||||||
});
|
});
|
||||||
return result;
|
return voList;
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取各支付方式支付的金额
|
//获取各支付方式支付的金额
|
||||||
|
|
@ -553,6 +570,98 @@ public class ChargeService extends BaseService {
|
||||||
public ChargeOrder getByCode(String code) {
|
public ChargeOrder getByCode(String code) {
|
||||||
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("code", code);
|
queryWrapper.eq("code", code);
|
||||||
return chargeOrderMapper.selectOne(queryWrapper);
|
return chargeOrderMapper.selectOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询患者消费记录
|
||||||
|
*
|
||||||
|
* @param patientId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<ChargeOrder> getListByPatientId(Integer patientId) {
|
||||||
|
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("patient_id", patientId);
|
||||||
|
return chargeOrderMapper.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收款 退款 记录
|
||||||
|
*/
|
||||||
|
public void recordChargeLog(ChargeOrder chargeOrder, ChargeSourceEnum sourceEnum, ChargeTypeEnum chargeType){
|
||||||
|
ChargeLog chargeLog = new ChargeLog();
|
||||||
|
String customer = null;
|
||||||
|
if (chargeOrder.getPatientId() != null){
|
||||||
|
PatientInfo patient = patientInfoMapper.selectById(chargeOrder.getPatientId());
|
||||||
|
customer = patient.getName();
|
||||||
|
}else if (chargeOrder.getSocialUserId() != null){
|
||||||
|
SocialUser socialUser = socialUserMapper.selectById(chargeOrder.getSocialUserId());
|
||||||
|
customer = socialUser.getPsnName();
|
||||||
|
}else {
|
||||||
|
customer = "-";
|
||||||
|
}
|
||||||
|
chargeLog.setSource(sourceEnum.getType());
|
||||||
|
chargeLog.setCustomer(customer);
|
||||||
|
chargeLog.setType(chargeType.getChargeType());
|
||||||
|
chargeLog.setOriginalPrice(chargeOrder.getPreTotalPrice());
|
||||||
|
chargeLog.setReceivable(chargeOrder.getTotalPrice());
|
||||||
|
chargeLog.setNetReceipts(chargeOrder.getTotalPrice());
|
||||||
|
chargeLog.setDiscount(chargeOrder.getTotalPrice().subtract(chargeOrder.getPreTotalPrice()));
|
||||||
|
chargeLog.setPayType(chargeOrder.getPayType());
|
||||||
|
if (chargeOrder.getSalePersonId() != null){
|
||||||
|
OrganizationMember organizationMember = organizationMemberMapper.selectById(chargeOrder.getSalePersonId());
|
||||||
|
chargeLog.setSalePersonName(organizationMember.getName());
|
||||||
|
chargeLog.setSalePersonId(chargeOrder.getSalePersonId());
|
||||||
|
}
|
||||||
|
chargeLog.setChargeTime(LocalDateTime.now());
|
||||||
|
chargeLog.setProjectCode(chargeOrder.getCode());
|
||||||
|
chargeLogMapper.insert(chargeLog);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 销售库存变更 日志
|
||||||
|
*/
|
||||||
|
public void recordChargeInventoryLog(List<InventoryLog> logs,ChargeOrder chargeOrder){
|
||||||
|
List<ChargeInventoryLog> chargeInventoryLogs = new ArrayList<>();
|
||||||
|
for (InventoryLog log : logs){
|
||||||
|
ChargeInventoryLog chargeInventoryLog = new ChargeInventoryLog();
|
||||||
|
chargeInventoryLog.setChargeOrderCode(chargeOrder.getCode());
|
||||||
|
chargeInventoryLog.setGoodsId(log.getGoodsId());
|
||||||
|
chargeInventoryLog.setInventoryId(log.getInventoryId());
|
||||||
|
chargeInventoryLog.setNumber(log.getChangeWholeNumber());
|
||||||
|
Goods dbGoods = goodsMapper.selectById(log.getGoodsId());
|
||||||
|
chargeInventoryLog.setTrdnFlag(false);
|
||||||
|
chargeInventoryLog.setUnit(dbGoods.getPackagingUnit());
|
||||||
|
chargeInventoryLog.setNumber(log.getChangeWholeNumber());
|
||||||
|
if (log.getChangeFragmentNumber() != 0 ){
|
||||||
|
chargeInventoryLog.setTrdnFlag(true);
|
||||||
|
chargeInventoryLog.setUnit(dbGoods.getMinPackagingUnit());
|
||||||
|
chargeInventoryLog.setNumber(log.getChangeWholeNumber()*dbGoods.getMinPackagingNumber()+log.getChangeFragmentNumber());
|
||||||
|
}
|
||||||
|
QueryWrapper<ChargeGoodsList> listWrapper = new QueryWrapper<>();
|
||||||
|
listWrapper.eq("charge_order_code",chargeOrder.getCode());
|
||||||
|
listWrapper.eq("goods_id",log.getGoodsId());
|
||||||
|
ChargeGoodsList chargeGoodsList = chargeGoodsListMapper.selectOne(listWrapper);
|
||||||
|
chargeInventoryLog.setFeedetlSn(chargeGoodsList.getFeedetlSn());
|
||||||
|
chargeInventoryLog.setCreateTime(LocalDateTime.now());
|
||||||
|
chargeInventoryLog.setGoodsType(chargeGoodsList.getType());
|
||||||
|
chargeInventoryLog.setUploadStatus(UploadStatusEnum.NoUpload.getStatus());
|
||||||
|
chargeInventoryLog.setType(ChargeTypeEnum.CHARGE.getChargeType());
|
||||||
|
|
||||||
|
chargeInventoryLogs.add(chargeInventoryLog);
|
||||||
|
|
||||||
|
}
|
||||||
|
chargeInventoryLogMapper.insert(chargeInventoryLogs);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取收费记录
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Page<ChargeLog> getChargeRecordPageList() {
|
||||||
|
QueryWrapper<ChargeLog> queryWrapper = new QueryWrapper<>();
|
||||||
|
Page<ChargeLog> page = pageHelper(1, 20, queryWrapper, chargeLogMapper, "charge_time", false);
|
||||||
|
return page;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import java.time.LocalDate;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class RetailOrderDailyChargingReportVo {
|
public class RetailOrderDailyChargingReportVo {
|
||||||
|
//日期
|
||||||
|
private LocalDate date;
|
||||||
//总金额
|
//总金额
|
||||||
private BigDecimal totalMoney;
|
private BigDecimal totalMoney;
|
||||||
//总成本
|
//总成本
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,12 @@ import com.syjiaer.clinic.server.common.enums.RegistrationStatusEnum;
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import com.syjiaer.clinic.server.common.util.StringUtil;
|
import com.syjiaer.clinic.server.common.util.StringUtil;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.entity.charge.vo.ChargeDetailVo;
|
|
||||||
import com.syjiaer.clinic.server.entity.charge.vo.ChargeGoodsListVo;
|
import com.syjiaer.clinic.server.entity.charge.vo.ChargeGoodsListVo;
|
||||||
import com.syjiaer.clinic.server.entity.charge.vo.ChargeItemListVo;
|
import com.syjiaer.clinic.server.entity.charge.vo.ChargeItemListVo;
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.Diagnosis;
|
import com.syjiaer.clinic.server.entity.diagnosis.Diagnosis;
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.dto.ChargeQueueQuery;
|
import com.syjiaer.clinic.server.entity.diagnosis.dto.ChargeQueueQuery;
|
||||||
import com.syjiaer.clinic.server.entity.diagnosis.dto.ItemRetailDto;
|
import com.syjiaer.clinic.server.entity.diagnosis.dto.ItemRetailDto;
|
||||||
|
import com.syjiaer.clinic.server.entity.diagnosis.vo.ChargeQueueVo;
|
||||||
import com.syjiaer.clinic.server.entity.goods.Goods;
|
import com.syjiaer.clinic.server.entity.goods.Goods;
|
||||||
import com.syjiaer.clinic.server.entity.item.Item;
|
import com.syjiaer.clinic.server.entity.item.Item;
|
||||||
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
||||||
|
|
@ -29,6 +29,7 @@ import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.vo.SeeDoctorInfoVo;
|
||||||
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMapper;
|
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
|
import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.item.ItemMapper;
|
import com.syjiaer.clinic.server.mapper.item.ItemMapper;
|
||||||
|
|
@ -78,39 +79,46 @@ public class MedicalRecordService extends BaseService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DiagnosisMapper diagnosisMapper;
|
private DiagnosisMapper diagnosisMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private PatientInfoMapper patientInfoMapper;
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 保存
|
* 保存
|
||||||
* @param saveDto 病历信息
|
* @param saveDto 病历信息
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(MedicalRecordSaveDto saveDto) {
|
public void save(MedicalRecordSaveDto saveDto) {
|
||||||
|
if (saveDto == null){
|
||||||
|
throw new MessageException("参数不能为空");
|
||||||
|
}
|
||||||
|
if (saveDto.getDiagnosisMedicalRecord().getDiagnosisDetail() == null){
|
||||||
|
throw new MessageException("请填写诊断详情");
|
||||||
|
}
|
||||||
//改变挂号单状态
|
//改变挂号单状态
|
||||||
PatientRegistration dbRegis = patientRegistrationMapper.selectById(saveDto.getRegistrationId());
|
PatientRegistration dbRegis = patientRegistrationMapper.selectById(saveDto.getRegistrationId());
|
||||||
if (dbRegis == null){
|
if (dbRegis == null) {
|
||||||
throw new MessageException("挂号单不存在");
|
throw new MessageException("挂号单不存在");
|
||||||
}
|
}
|
||||||
PatientRegistration updateRegis = new PatientRegistration();
|
PatientRegistration updateRegis = new PatientRegistration();
|
||||||
updateRegis.setId(dbRegis.getId());
|
updateRegis.setId(dbRegis.getId());
|
||||||
updateRegis.setStatus(RegistrationStatusEnum.complete.getType());
|
updateRegis.setStatus(RegistrationStatusEnum.complete.getStatus());
|
||||||
patientRegistrationMapper.updateById(updateRegis);
|
patientRegistrationMapper.updateById(updateRegis);
|
||||||
//诊断主表
|
//诊断主表
|
||||||
Diagnosis diagnosis = new Diagnosis();
|
Diagnosis diagnosis = new Diagnosis();
|
||||||
QueryWrapper<Diagnosis> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Diagnosis> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("registration_id", saveDto.getRegistrationId());
|
queryWrapper.eq("registration_id", saveDto.getRegistrationId());
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
Diagnosis dbDiagnosis = diagnosisMapper.selectOne(queryWrapper);
|
Diagnosis dbDiagnosis = diagnosisMapper.selectOne(queryWrapper);
|
||||||
if (dbDiagnosis!=null){
|
if (dbDiagnosis != null) {
|
||||||
diagnosis.setId(dbDiagnosis.getId());
|
diagnosis.setId(dbDiagnosis.getId());
|
||||||
}
|
}
|
||||||
String code = StringUtil.getCode("ZD");
|
String code = StringUtil.getCode("ZD");
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
BeanUtils.copyProperties(saveDto, diagnosis);
|
BeanUtils.copyProperties(saveDto, diagnosis);
|
||||||
diagnosis.setStatus(0);
|
diagnosis.setStatus(0);
|
||||||
if (diagnosis.getId() == null){
|
if (diagnosis.getId() == null) {
|
||||||
diagnosis.setCode(code);
|
diagnosis.setCode(code);
|
||||||
diagnosis.setCreateTime(now);
|
diagnosis.setCreateTime(now);
|
||||||
}else {
|
} else {
|
||||||
code = diagnosis.getCode();
|
code = diagnosis.getCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,8 +144,8 @@ public class MedicalRecordService extends BaseService {
|
||||||
itemDetail.setSocialCode(dbItem.getItemSocialCode());
|
itemDetail.setSocialCode(dbItem.getItemSocialCode());
|
||||||
itemDetail.setUnit(dbItem.getUnit());
|
itemDetail.setUnit(dbItem.getUnit());
|
||||||
itemDetail.setUnitPrice(dbItem.getUnitPrice());
|
itemDetail.setUnitPrice(dbItem.getUnitPrice());
|
||||||
if (item.getSelectedNum() == null ||item.getSelectedNum() <= 0){
|
if (item.getSelectedNum() == null || item.getSelectedNum() <= 0) {
|
||||||
throw new MessageException("["+item.getItemName()+"]数量为0");
|
throw new MessageException("[" + item.getItemName() + "]数量为0");
|
||||||
}
|
}
|
||||||
itemDetail.setNumber(item.getSelectedNum());
|
itemDetail.setNumber(item.getSelectedNum());
|
||||||
itemLists.add(itemDetail);
|
itemLists.add(itemDetail);
|
||||||
|
|
@ -156,8 +164,8 @@ public class MedicalRecordService extends BaseService {
|
||||||
goodsDetail.setUnit(goodsRetailDto.getSelectedUnit());
|
goodsDetail.setUnit(goodsRetailDto.getSelectedUnit());
|
||||||
goodsDetail.setUnitPrice(goodsRetailDto.getSelectedPrice());
|
goodsDetail.setUnitPrice(goodsRetailDto.getSelectedPrice());
|
||||||
goodsDetail.setNumber(goodsRetailDto.getSelectedNum());
|
goodsDetail.setNumber(goodsRetailDto.getSelectedNum());
|
||||||
if (goodsRetailDto.getSelectedNum() == null ||goodsRetailDto.getSelectedNum() <= 0){
|
if (goodsRetailDto.getSelectedNum() == null || goodsRetailDto.getSelectedNum() <= 0) {
|
||||||
throw new MessageException("["+goodsRetailDto.getName()+"]数量为0");
|
throw new MessageException("[" + goodsRetailDto.getName() + "]数量为0");
|
||||||
}
|
}
|
||||||
goodsLists.add(goodsDetail);
|
goodsLists.add(goodsDetail);
|
||||||
}
|
}
|
||||||
|
|
@ -168,6 +176,7 @@ public class MedicalRecordService extends BaseService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据患者的id查询病历
|
* 根据患者的id查询病历
|
||||||
|
*
|
||||||
* @param patientId
|
* @param patientId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -199,6 +208,7 @@ public class MedicalRecordService extends BaseService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据挂单号回显病历信息
|
* 根据挂单号回显病历信息
|
||||||
|
*
|
||||||
* @param regisId
|
* @param regisId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|
@ -226,18 +236,18 @@ public class MedicalRecordService extends BaseService {
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void uploadDiagnosis(String diagnosisCode){
|
public void uploadDiagnosis(String diagnosisCode) {
|
||||||
Diagnosis diagnosis = diagnosisMapper.selectByCode(diagnosisCode);
|
Diagnosis diagnosis = diagnosisMapper.selectByCode(diagnosisCode);
|
||||||
if (diagnosis == null){
|
if (diagnosis == null) {
|
||||||
throw new MessageException("诊断不存在");
|
throw new MessageException("诊断不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
DiagnosisMedicalRecord diagnosisMedicalRecord = diagnosisMedicalRecordMapper.selectByDiagnosisCode(diagnosisCode);
|
DiagnosisMedicalRecord diagnosisMedicalRecord = diagnosisMedicalRecordMapper.selectByDiagnosisCode(diagnosisCode);
|
||||||
if (diagnosisMedicalRecord == null){
|
if (diagnosisMedicalRecord == null) {
|
||||||
throw new MessageException("病历不存在");
|
throw new MessageException("病历不存在");
|
||||||
}
|
}
|
||||||
PatientRegistration patientRegistration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
PatientRegistration patientRegistration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
||||||
if (patientRegistration == null){
|
if (patientRegistration == null) {
|
||||||
throw new MessageException("挂号单不存在");
|
throw new MessageException("挂号单不存在");
|
||||||
}
|
}
|
||||||
OrganizationSection section = organizationSectionMapper.selectById(patientRegistration.getOrganizationSectionId());
|
OrganizationSection section = organizationSectionMapper.selectById(patientRegistration.getOrganizationSectionId());
|
||||||
|
|
@ -250,7 +260,7 @@ public class MedicalRecordService extends BaseService {
|
||||||
IM2203A.Mdtrtinfo mdtrtinfo = new IM2203A.Mdtrtinfo();
|
IM2203A.Mdtrtinfo mdtrtinfo = new IM2203A.Mdtrtinfo();
|
||||||
mdtrtinfo.setMdtrt_id(patientRegistration.getMdtrtId());
|
mdtrtinfo.setMdtrt_id(patientRegistration.getMdtrtId());
|
||||||
mdtrtinfo.setPsn_no(patientRegistration.getPsnNo());
|
mdtrtinfo.setPsn_no(patientRegistration.getPsnNo());
|
||||||
mdtrtinfo.setMed_type(config.get("social","medType"));
|
mdtrtinfo.setMed_type(config.get("social", "medType"));
|
||||||
mdtrtinfo.setBegntime(curTime);
|
mdtrtinfo.setBegntime(curTime);
|
||||||
IM2203A.ExpContent expContent = new IM2203A.ExpContent();
|
IM2203A.ExpContent expContent = new IM2203A.ExpContent();
|
||||||
expContent.setTrum_flag("0");
|
expContent.setTrum_flag("0");
|
||||||
|
|
@ -258,9 +268,9 @@ public class MedicalRecordService extends BaseService {
|
||||||
mdtrtinfo.setExp_content(expContent);
|
mdtrtinfo.setExp_content(expContent);
|
||||||
im2203A.setMdtrtinfo(mdtrtinfo);
|
im2203A.setMdtrtinfo(mdtrtinfo);
|
||||||
JSONArray jsonArray = JSONArray.parseArray(diagnosisMedicalRecord.getDiagnosisDetail());
|
JSONArray jsonArray = JSONArray.parseArray(diagnosisMedicalRecord.getDiagnosisDetail());
|
||||||
int i =0;
|
int i = 0;
|
||||||
List<IM2203A.Diseinfo> diagList = new ArrayList<>();
|
List<IM2203A.Diseinfo> diagList = new ArrayList<>();
|
||||||
for (Object object : jsonArray){
|
for (Object object : jsonArray) {
|
||||||
i++;
|
i++;
|
||||||
JSONObject json = (JSONObject) object;
|
JSONObject json = (JSONObject) object;
|
||||||
IM2203A.Diseinfo diag = new IM2203A.Diseinfo();
|
IM2203A.Diseinfo diag = new IM2203A.Diseinfo();
|
||||||
|
|
@ -281,25 +291,63 @@ public class MedicalRecordService extends BaseService {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
获取收费队列
|
|
||||||
*/
|
public Page<ChargeQueueVo> getChargeQueue(ChargeQueueQuery query) {
|
||||||
public Page<MedicalRecordVo> getChargeQueue(ChargeQueueQuery query) {
|
|
||||||
QueryWrapper<Diagnosis> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<Diagnosis> queryWrapper = new QueryWrapper<>();
|
||||||
|
if (query.getStatus() != null) {
|
||||||
|
queryWrapper.eq("status", query.getStatus());
|
||||||
|
}
|
||||||
|
Page<Diagnosis> diagnosisList = pageHelper(query.getPageNum(), query.getPageSize(), queryWrapper, diagnosisMapper, "create_time", false);
|
||||||
|
|
||||||
Page<Diagnosis> diagnosisList =pageHelper(query.getPageNum(), query.getPageSize(),queryWrapper,diagnosisMapper,"create_time", false);
|
List<ChargeQueueVo> list = new ArrayList<>();
|
||||||
|
for (Diagnosis diagnosis : diagnosisList.getList()) {
|
||||||
List<MedicalRecordVo> list = new ArrayList<>();
|
ChargeQueueVo vo = new ChargeQueueVo();
|
||||||
for (Diagnosis diagnosis : diagnosisList.getList()){
|
BeanUtils.copyProperties(diagnosis, vo);
|
||||||
MedicalRecordVo vo = new MedicalRecordVo();
|
PatientRegistration registration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
||||||
vo = getDetailByRegisId(diagnosis.getRegistrationId());
|
vo.setPatientId(registration.getPatientInfoId());
|
||||||
|
vo.setPatientName(registration.getName());
|
||||||
|
vo.setPatientGender(registration.getGender());
|
||||||
list.add(vo);
|
list.add(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
Page<MedicalRecordVo> page = new Page<>();
|
Page<ChargeQueueVo> page = new Page<>();
|
||||||
page.setList(list);
|
page.setList(list);
|
||||||
page.setTotal_page(diagnosisList.getTotal_page());
|
page.setTotal_page(diagnosisList.getTotal_page());
|
||||||
page.setTotal_count(diagnosisList.getTotal_count());
|
page.setTotal_count(diagnosisList.getTotal_count());
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SeeDoctorInfoVo getSeeDockerInfo(Integer regisId) {
|
||||||
|
|
||||||
|
PatientRegistration registration = patientRegistrationMapper.selectById(regisId);
|
||||||
|
if (registration == null) {
|
||||||
|
throw new MessageException("挂号单不存在");
|
||||||
|
}
|
||||||
|
SeeDoctorInfoVo vo = new SeeDoctorInfoVo();
|
||||||
|
vo.setPatientInfo(patientInfoMapper.selectById(registration.getPatientInfoId()));
|
||||||
|
|
||||||
|
OrganizationMember docker = organizationMemberMapper.selectById(registration.getOrganizationDoctorId());
|
||||||
|
vo.setDockerId(docker.getId());
|
||||||
|
vo.setDockerName(docker.getName());
|
||||||
|
if (docker.getSectionId() != null) {
|
||||||
|
OrganizationSection section = organizationSectionMapper.selectById(docker.getSectionId());
|
||||||
|
vo.setSectionName(section.getName());
|
||||||
|
}
|
||||||
|
QueryWrapper<Diagnosis> diagnosisQueryWrapper = new QueryWrapper<>();
|
||||||
|
diagnosisQueryWrapper.eq("patient_id", vo.getPatientInfo().getId());
|
||||||
|
diagnosisQueryWrapper.orderByDesc("create_time");
|
||||||
|
List<Diagnosis> diagnosisList = diagnosisMapper.selectList(diagnosisQueryWrapper);
|
||||||
|
if (!diagnosisList.isEmpty()) {
|
||||||
|
vo.setLastSeeDoctorTime(diagnosisList.get(0).getCreateTime());
|
||||||
|
vo.setSeeDoctorCount(diagnosisList.size());
|
||||||
|
}
|
||||||
|
vo.setSocialBalance(BigDecimal.ZERO);
|
||||||
|
return vo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MedicalRecordVo getByDiagnosisCode(String diagnosisCode) {
|
||||||
|
Diagnosis diagnosis = diagnosisMapper.selectByCode(diagnosisCode);
|
||||||
|
return getDetailByRegisId(diagnosis.getRegistrationId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,16 @@ package com.syjiaer.clinic.server.service.organization;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.api.annotations.IMField;
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import com.syjiaer.clinic.server.common.util.FileUtil;
|
import com.syjiaer.clinic.server.common.util.FileUtil;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.entity.charge.dto.ChargeQuery;
|
||||||
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
||||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.dto.DockerSearchQuery;
|
||||||
import com.syjiaer.clinic.server.entity.organization.dto.OrganizationMemberSaveDto;
|
import com.syjiaer.clinic.server.entity.organization.dto.OrganizationMemberSaveDto;
|
||||||
|
import com.syjiaer.clinic.server.entity.organization.vo.MemberVo;
|
||||||
import com.syjiaer.clinic.server.mapper.manager.ManagerUserMapper;
|
import com.syjiaer.clinic.server.mapper.manager.ManagerUserMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
|
|
@ -145,9 +149,10 @@ public class OrganizationMemberService extends BaseService {
|
||||||
/*
|
/*
|
||||||
* 获取医生列表
|
* 获取医生列表
|
||||||
*/
|
*/
|
||||||
public List<OrganizationMember> doctorList() {
|
public List<MemberVo> doctorList(DockerSearchQuery dockerSearchQuery) {
|
||||||
QueryWrapper<OrganizationMember> queryWrapper = new QueryWrapper<>();
|
if (dockerSearchQuery == null){
|
||||||
queryWrapper.eq("role", 1);
|
return new ArrayList<>();
|
||||||
return organizationMemberMapper.selectList(queryWrapper);
|
}
|
||||||
|
return organizationMemberMapper.selectDetailByQuery(dockerSearchQuery);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,273 @@
|
||||||
package com.syjiaer.clinic.server.service.patient;
|
package com.syjiaer.clinic.server.service.patient;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
|
import com.syjiaer.clinic.server.entity.vip.Vip;
|
||||||
|
import com.syjiaer.clinic.server.entity.vip.VipExpLog;
|
||||||
|
import com.syjiaer.clinic.server.entity.vip.VipIntegralLog;
|
||||||
|
import com.syjiaer.clinic.server.entity.vip.VipLevelConfig;
|
||||||
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.vip.VipExpLogMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.vip.VipIntegralLogMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.vip.VipLevelConfigMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
|
import com.syjiaer.clinic.server.service.vip.VipLevelConfigService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class PatientInfoService extends BaseService {
|
public class PatientInfoService extends BaseService {
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private PatientInfoService patientInfoService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private PatientInfoMapper patientInfoMapper;
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private VipLevelConfigMapper vipLevelConfigMapper;
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private VipLevelConfigService vipLevelConfigService;
|
||||||
|
@Autowired
|
||||||
|
private VipExpLogMapper vipExpLogMapper;
|
||||||
|
@Autowired
|
||||||
|
private VipIntegralLogMapper vipIntegralLogMapper;
|
||||||
|
|
||||||
|
public PatientInfo save(PatientInfo patientInfo){
|
||||||
|
patientInfo.setCreateDatetime(LocalDateTime.now());
|
||||||
|
if (patientInfo.getBirthday() != null) {
|
||||||
|
int currentYear = LocalDate.now().getYear();
|
||||||
|
int birthYear = patientInfo.getBirthday().getYear();
|
||||||
|
patientInfo.setAge(currentYear - birthYear);
|
||||||
|
}
|
||||||
|
VipLevelConfig level = vipLevelConfigService.getByExp(patientInfo.getExp());
|
||||||
|
if (level != null){
|
||||||
|
patientInfo.setLevelId(level.getLevelId());
|
||||||
|
}else {
|
||||||
|
patientInfo.setLevelId(0);
|
||||||
|
}
|
||||||
|
|
||||||
public void save(PatientInfo patientInfo){
|
|
||||||
QueryWrapper<PatientInfo> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<PatientInfo> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("phone", patientInfo.getPhone());
|
queryWrapper.eq("cert_no", patientInfo.getCertNo());
|
||||||
PatientInfo dbInfo = patientInfoMapper.selectOne(queryWrapper);
|
PatientInfo dbInfo = patientInfoMapper.selectOne(queryWrapper);
|
||||||
if (dbInfo != null){
|
if (dbInfo != null){
|
||||||
patientInfo.setId(dbInfo.getId());
|
patientInfo.setId(dbInfo.getId());
|
||||||
|
patientInfo.setExp(null);
|
||||||
|
patientInfo.setLevelId(null);
|
||||||
|
patientInfo.setIntegralBalance(null);
|
||||||
|
patientInfo.setBalance(null);
|
||||||
}
|
}
|
||||||
patientInfoMapper.insertOrUpdate(patientInfo);
|
patientInfoMapper.insertOrUpdate(patientInfo);
|
||||||
|
return patientInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 改变会员经验值
|
||||||
|
* @param patientId
|
||||||
|
* @param changeExp
|
||||||
|
* @param remark
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void changeExp(int patientId, int changeExp, String remark){
|
||||||
|
PatientInfo patientInfo = patientInfoMapper.selectById(patientId);
|
||||||
|
if(patientInfo==null){
|
||||||
|
throw new MessageException("会员不存在");
|
||||||
|
}
|
||||||
|
int start_exp = patientInfo.getExp();
|
||||||
|
int end_exp = start_exp + changeExp;
|
||||||
|
if(end_exp<0){
|
||||||
|
end_exp=0;
|
||||||
|
changeExp = -start_exp;
|
||||||
|
}
|
||||||
|
patientInfo.setExp(end_exp);
|
||||||
|
// 记录日志
|
||||||
|
VipExpLog vipExpLog = new VipExpLog();
|
||||||
|
vipExpLog.setStartExp(start_exp);
|
||||||
|
vipExpLog.setChangeExp(changeExp);
|
||||||
|
vipExpLog.setEndExp(end_exp);
|
||||||
|
vipExpLog.setVipId(patientId);
|
||||||
|
vipExpLog.setCreateDatetime(LocalDateTime.now());
|
||||||
|
vipExpLog.setRemark(remark);
|
||||||
|
//更新VIP等级
|
||||||
|
QueryWrapper<VipLevelConfig> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.orderByDesc("start_exp");
|
||||||
|
List<VipLevelConfig> vipLevelConfigs = vipLevelConfigMapper.selectList(queryWrapper);
|
||||||
|
for (VipLevelConfig vipLevelConfig : vipLevelConfigs) {
|
||||||
|
if(end_exp>=vipLevelConfig.getStartExp()){
|
||||||
|
patientInfo.setLevelId(vipLevelConfig.getLevelId());
|
||||||
|
System.out.println(vipLevelConfig.getLevelId());
|
||||||
|
System.out.println(end_exp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UpdateWrapper<PatientInfo> updateWrapper = new UpdateWrapper<>();
|
||||||
|
updateWrapper.eq("id",patientId);
|
||||||
|
updateWrapper.set("level_id",patientInfo.getLevelId());
|
||||||
|
updateWrapper.set("exp",patientInfo.getExp());
|
||||||
|
// 保存
|
||||||
|
patientInfoMapper.update(updateWrapper);
|
||||||
|
vipExpLogMapper.insert(vipExpLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 改变vip积分
|
||||||
|
* @param patientId
|
||||||
|
* @param addIntegral
|
||||||
|
* @param remark
|
||||||
|
*/
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void changeIntegral(int patientId, int addIntegral, String remark) {
|
||||||
|
PatientInfo patientInfo = patientInfoMapper.selectById(patientId);
|
||||||
|
if(patientInfo==null){
|
||||||
|
throw new MessageException("会员不存在");
|
||||||
|
}
|
||||||
|
Integer beforeIntegral = patientInfo.getIntegralBalance();
|
||||||
|
Integer finalIntegral = beforeIntegral + addIntegral;
|
||||||
|
PatientInfo updatePatient = new PatientInfo();
|
||||||
|
updatePatient.setId(patientId);
|
||||||
|
updatePatient.setIntegralBalance(finalIntegral);
|
||||||
|
patientInfoMapper.updateById(updatePatient);
|
||||||
|
//记录日志
|
||||||
|
VipIntegralLog vipIntegralLog = new VipIntegralLog();
|
||||||
|
vipIntegralLog.setBeforeIntegral(beforeIntegral);
|
||||||
|
vipIntegralLog.setAfterIntegral(finalIntegral);
|
||||||
|
vipIntegralLog.setChangeIntegral(addIntegral);
|
||||||
|
vipIntegralLog.setRemark(remark);
|
||||||
|
vipIntegralLog.setCreateTime(LocalDateTime.now());
|
||||||
|
vipIntegralLog.setVipId(patientId);
|
||||||
|
vipIntegralLogMapper.insert(vipIntegralLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新建vip
|
||||||
|
* @param patientInfo
|
||||||
|
*/
|
||||||
|
public void create(PatientInfo patientInfo) {
|
||||||
|
patientInfo.setCreateDatetime(LocalDateTime.now());
|
||||||
|
Integer exp = patientInfo.getExp();
|
||||||
|
if (patientInfo.getBirthday() != null) {
|
||||||
|
int currentYear = LocalDate.now().getYear();
|
||||||
|
int birthYear = patientInfo.getBirthday().getYear();
|
||||||
|
patientInfo.setAge(currentYear - birthYear);
|
||||||
|
}
|
||||||
|
patientInfo.setExp(0);
|
||||||
|
VipLevelConfig level = vipLevelConfigService.getByExp(patientInfo.getExp());
|
||||||
|
if (level != null){
|
||||||
|
patientInfo.setLevelId(level.getLevelId());
|
||||||
|
}else {
|
||||||
|
patientInfo.setLevelId(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
patientInfoMapper.insert(patientInfo);
|
||||||
|
if (exp != null && exp > 0){
|
||||||
|
patientInfoService.changeExp(patientInfo.getId(), exp, "会员创建");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新vip基本信息 经验值和积分不更新
|
||||||
|
* @param patientInfo
|
||||||
|
*/
|
||||||
|
public void update(PatientInfo patientInfo) {
|
||||||
|
patientInfo.setExp(null);
|
||||||
|
patientInfo.setLevelId(null);
|
||||||
|
patientInfoMapper.updateById(patientInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int removeById(int vipId) {
|
||||||
|
return patientInfoMapper.deleteById(vipId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* vip分页查询
|
||||||
|
* @param keyword
|
||||||
|
* @param pageNum
|
||||||
|
* @param pageSize
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public Page<PatientInfo> pageList(String keyword, int pageNum, int pageSize) {
|
||||||
|
QueryWrapper<PatientInfo> queryWrapper = new QueryWrapper<>();
|
||||||
|
if (keyword != null && !keyword.isEmpty()){
|
||||||
|
queryWrapper.like("name",keyword);
|
||||||
|
queryWrapper.or().like("phone",keyword);
|
||||||
|
queryWrapper.or().like("cert_no",keyword);
|
||||||
|
}
|
||||||
|
return pageHelper(pageNum, pageSize, queryWrapper, patientInfoMapper, "create_datetime", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PatientInfo getById(int id) {
|
||||||
|
return patientInfoMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据名称 手机号 身份证搜索vip
|
||||||
|
* @param keyword
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<PatientInfo> search(String keyword) {
|
||||||
|
QueryWrapper<PatientInfo> query = new QueryWrapper<>();
|
||||||
|
query.like("name", keyword);
|
||||||
|
query.or().like("phone", keyword);
|
||||||
|
query.or().like("cert_no", keyword);
|
||||||
|
return patientInfoMapper.selectList(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 改变vip等级
|
||||||
|
* @param patientId
|
||||||
|
* @param levelId
|
||||||
|
*/
|
||||||
|
public void changeLevel(int patientId, int levelId) {
|
||||||
|
QueryWrapper<VipLevelConfig> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("level_id", levelId);
|
||||||
|
VipLevelConfig levelConfig = vipLevelConfigMapper.selectOne(queryWrapper);
|
||||||
|
if (levelConfig == null) {
|
||||||
|
throw new MessageException("等级不存在");
|
||||||
|
}
|
||||||
|
PatientInfo patientInfo = patientInfoMapper.selectById(patientId);
|
||||||
|
int changeExp = levelConfig.getStartExp() - patientInfo.getExp();
|
||||||
|
patientInfoService.changeExp(patientId, changeExp, "会员等级修改");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新所有vip等级信息
|
||||||
|
*/
|
||||||
|
public void reFreshAllVipLevel() {
|
||||||
|
//更新所有vip的等级
|
||||||
|
QueryWrapper<PatientInfo> patientQuery = new QueryWrapper<>();
|
||||||
|
patientQuery.select("id,exp");
|
||||||
|
List<PatientInfo> patientList = patientInfoMapper.selectList(patientQuery);
|
||||||
|
Iterator<PatientInfo> iterator = patientList.iterator();
|
||||||
|
while (iterator.hasNext()) {
|
||||||
|
PatientInfo patientInfo = iterator.next();
|
||||||
|
VipLevelConfig levelConfig = vipLevelConfigService.getByExp(patientInfo.getExp());
|
||||||
|
if (levelConfig != null) {
|
||||||
|
patientInfo.setLevelId(levelConfig.getLevelId());
|
||||||
|
} else {
|
||||||
|
patientInfo.setLevelId(0);
|
||||||
|
}
|
||||||
|
patientInfo.setExp(null);
|
||||||
|
|
||||||
|
}
|
||||||
|
patientInfoMapper.updateById(patientList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,9 @@ import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationQuery;
|
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationQuery;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.dto.RegistrationSaveDto;
|
||||||
import com.syjiaer.clinic.server.entity.patient.vo.PatientAndRegistrationInfoVo;
|
import com.syjiaer.clinic.server.entity.patient.vo.PatientAndRegistrationInfoVo;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.vo.PatientRegistrationVo;
|
||||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationSectionMapper;
|
import com.syjiaer.clinic.server.mapper.organization.OrganizationSectionMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
||||||
|
|
@ -43,12 +45,14 @@ public class PatientRegistrationService extends BaseService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private PatientInfoMapper patientInfoMapper;
|
private PatientInfoMapper patientInfoMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private PatientInfoService patientInfoService;
|
||||||
|
@Autowired
|
||||||
private OrganizationMemberMapper organizationMemberMapper;
|
private OrganizationMemberMapper organizationMemberMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private OrganizationSectionMapper organizationSectionMapper;
|
private OrganizationSectionMapper organizationSectionMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@Lazy
|
@Lazy
|
||||||
private PatientRegistrationService patientRegistrationService;
|
private PatientRegistrationService patientRegistrationService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SocialRequest socialRequest;
|
private SocialRequest socialRequest;
|
||||||
|
|
||||||
|
|
@ -58,11 +62,18 @@ public class PatientRegistrationService extends BaseService {
|
||||||
* @param patientRegistrationParam 挂号信息
|
* @param patientRegistrationParam 挂号信息
|
||||||
*/
|
*/
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public PatientRegistration registration(PatientRegistration registrationParam,String mdtrtCertType, String mdtrtCertNo) {
|
public PatientRegistration registration(RegistrationSaveDto registrationParam, String mdtrtCertType, String mdtrtCertNo) {
|
||||||
//TODO 挂号和患者 记录身份证号非必填
|
|
||||||
if (registrationParam == null) {
|
if (registrationParam == null) {
|
||||||
throw new MessageException("data参数为空");
|
throw new MessageException("data参数为空");
|
||||||
}
|
}
|
||||||
|
if (registrationParam.getCertType() == null){
|
||||||
|
throw new MessageException("证件类型不能为空");
|
||||||
|
}
|
||||||
|
if (registrationParam.getCertNo() == null){
|
||||||
|
throw new MessageException("证件号码不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LocalDateTime now =LocalDateTime.now();
|
LocalDateTime now =LocalDateTime.now();
|
||||||
String fstNo = StringUtil.getCode("FSN");
|
String fstNo = StringUtil.getCode("FSN");
|
||||||
if (registrationParam.getPatientInfoId() == null){
|
if (registrationParam.getPatientInfoId() == null){
|
||||||
|
|
@ -73,17 +84,11 @@ public class PatientRegistrationService extends BaseService {
|
||||||
patientInfo.setPhone(registrationParam.getPhone());
|
patientInfo.setPhone(registrationParam.getPhone());
|
||||||
patientInfo.setSex(registrationParam.getGender());
|
patientInfo.setSex(registrationParam.getGender());
|
||||||
patientInfo.setAge(registrationParam.getAge());
|
patientInfo.setAge(registrationParam.getAge());
|
||||||
|
patientInfo.setCertType(registrationParam.getCertType());
|
||||||
|
patientInfo.setCertNo(registrationParam.getCertNo());
|
||||||
|
PatientInfo dbPatientInfo = patientInfoService.save(patientInfo);
|
||||||
|
|
||||||
QueryWrapper<PatientInfo> patientInfoQuery = new QueryWrapper<>();
|
registrationParam.setPatientInfoId(dbPatientInfo.getId());
|
||||||
patientInfoQuery.eq("phone", registrationParam.getPhone());
|
|
||||||
List<PatientInfo> patientInfoList = patientInfoMapper.selectList(patientInfoQuery);
|
|
||||||
if (patientInfoList.isEmpty()) {
|
|
||||||
patientInfoMapper.insert(patientInfo);
|
|
||||||
} else {
|
|
||||||
patientInfo.setId(patientInfoList.get(0).getId());
|
|
||||||
patientInfoMapper.updateById(patientInfo);
|
|
||||||
}
|
|
||||||
registrationParam.setPatientInfoId(patientInfo.getId());
|
|
||||||
}
|
}
|
||||||
PatientRegistration registration = new PatientRegistration();
|
PatientRegistration registration = new PatientRegistration();
|
||||||
BeanUtils.copyProperties(registrationParam, registration);
|
BeanUtils.copyProperties(registrationParam, registration);
|
||||||
|
|
@ -120,14 +125,11 @@ public class PatientRegistrationService extends BaseService {
|
||||||
regisWrapper.set("type",2);
|
regisWrapper.set("type",2);
|
||||||
regisWrapper.eq("id",registration.getId());
|
regisWrapper.eq("id",registration.getId());
|
||||||
patientRegistrationMapper.update(null,regisWrapper);
|
patientRegistrationMapper.update(null,regisWrapper);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return registration;
|
return registration;
|
||||||
|
|
||||||
}
|
}
|
||||||
public PatientRegistration regisByDockerAndPatient(OrganizationMember docker, PatientInfo patient, Short type, Integer status){
|
public PatientRegistration regisByDockerAndPatient(OrganizationMember docker, PatientInfo patient, Short type, Integer status){
|
||||||
PatientRegistration registration = new PatientRegistration();
|
RegistrationSaveDto registration = new RegistrationSaveDto();
|
||||||
//病人信息
|
//病人信息
|
||||||
registration.setPatientInfoId(patient.getId());
|
registration.setPatientInfoId(patient.getId());
|
||||||
registration.setName(patient.getName());
|
registration.setName(patient.getName());
|
||||||
|
|
@ -143,6 +145,8 @@ public class PatientRegistrationService extends BaseService {
|
||||||
registration.setCreateDatetime(LocalDateTime.now());
|
registration.setCreateDatetime(LocalDateTime.now());
|
||||||
registration.setRegistrationMoney(BigDecimal.valueOf(0));
|
registration.setRegistrationMoney(BigDecimal.valueOf(0));
|
||||||
registration.setDelFlag(0);
|
registration.setDelFlag(0);
|
||||||
|
|
||||||
|
|
||||||
return patientRegistrationService.registration(registration,null,null);
|
return patientRegistrationService.registration(registration,null,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -181,8 +185,19 @@ public class PatientRegistrationService extends BaseService {
|
||||||
* 根据id查询挂号信息
|
* 根据id查询挂号信息
|
||||||
* @param id 挂号id
|
* @param id 挂号id
|
||||||
*/
|
*/
|
||||||
public PatientRegistration getById(int id) {
|
public PatientRegistrationVo getById(int id) {
|
||||||
return patientRegistrationMapper.selectById(id);
|
PatientRegistrationVo registrationVo = new PatientRegistrationVo();
|
||||||
|
PatientRegistration registration = patientRegistrationMapper.selectById(id);
|
||||||
|
if (registration == null){
|
||||||
|
throw new MessageException("id不存在");
|
||||||
|
}
|
||||||
|
BeanUtils.copyProperties(registration, registrationVo);
|
||||||
|
PatientInfo patientInfo = patientInfoMapper.selectById(registration.getPatientInfoId());
|
||||||
|
if (patientInfo != null){
|
||||||
|
registrationVo.setCertNo(patientInfo.getCertNo());
|
||||||
|
registrationVo.setCertType(patientInfo.getCertType());
|
||||||
|
}
|
||||||
|
return registrationVo;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* 获取所有已删除挂号信息
|
* 获取所有已删除挂号信息
|
||||||
|
|
@ -292,10 +307,10 @@ public class PatientRegistrationService extends BaseService {
|
||||||
if (patientRegistration == null){
|
if (patientRegistration == null){
|
||||||
throw new MessageException("挂号单不存在");
|
throw new MessageException("挂号单不存在");
|
||||||
}
|
}
|
||||||
if (statusEnum.equals(RegistrationStatusEnum.waiting) && !patientRegistration.getStatus().equals(RegistrationStatusEnum.inProgress.getType())){
|
if (statusEnum.equals(RegistrationStatusEnum.waiting) && !patientRegistration.getStatus().equals(RegistrationStatusEnum.inProgress.getStatus())){
|
||||||
throw new MessageException("初始状态不对");
|
throw new MessageException("初始状态不对");
|
||||||
}
|
}
|
||||||
if (statusEnum.equals(RegistrationStatusEnum.cancel) && !patientRegistration.getStatus().equals(RegistrationStatusEnum.inProgress.getType())){
|
if (statusEnum.equals(RegistrationStatusEnum.cancel) && !patientRegistration.getStatus().equals(RegistrationStatusEnum.inProgress.getStatus())){
|
||||||
throw new MessageException("初始状态不对");
|
throw new MessageException("初始状态不对");
|
||||||
}
|
}
|
||||||
PatientRegistration updateRegistration = new PatientRegistration();
|
PatientRegistration updateRegistration = new PatientRegistration();
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,21 @@ package com.syjiaer.clinic.server.service.statistics;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.syjiaer.clinic.server.common.enums.GoodsTypeEnum;
|
import com.syjiaer.clinic.server.common.enums.GoodsTypeEnum;
|
||||||
|
import com.syjiaer.clinic.server.common.enums.RegistrationStatusEnum;
|
||||||
import com.syjiaer.clinic.server.common.enums.RetailOrderPayTypeEnum;
|
import com.syjiaer.clinic.server.common.enums.RetailOrderPayTypeEnum;
|
||||||
import com.syjiaer.clinic.server.common.enums.RetailOrderStatusEnum;
|
import com.syjiaer.clinic.server.common.enums.RetailOrderStatusEnum;
|
||||||
import com.syjiaer.clinic.server.common.util.DateUtil;
|
import com.syjiaer.clinic.server.common.util.DateUtil;
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeGoodsList;
|
import com.syjiaer.clinic.server.entity.charge.ChargeGoodsList;
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeItemList;
|
|
||||||
import com.syjiaer.clinic.server.entity.charge.ChargeOrder;
|
import com.syjiaer.clinic.server.entity.charge.ChargeOrder;
|
||||||
import com.syjiaer.clinic.server.entity.statistics.GoodsTypeRevenue;
|
import com.syjiaer.clinic.server.entity.diagnosis.Diagnosis;
|
||||||
import com.syjiaer.clinic.server.entity.statistics.PayTypeRevenue;
|
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||||
import com.syjiaer.clinic.server.entity.statistics.PersonPayOverviewVo;
|
import com.syjiaer.clinic.server.entity.patient.PatientRegistration;
|
||||||
import com.syjiaer.clinic.server.entity.statistics.RevenueOverviewVo;
|
import com.syjiaer.clinic.server.entity.statistics.*;
|
||||||
import com.syjiaer.clinic.server.mapper.charge.ChargeGoodsListMapper;
|
import com.syjiaer.clinic.server.mapper.charge.ChargeGoodsListMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.charge.ChargeOrderMapper;
|
import com.syjiaer.clinic.server.mapper.charge.ChargeOrderMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.patient.PatientRegistrationMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -29,6 +32,13 @@ public class StatisticsService extends BaseService {
|
||||||
private ChargeOrderMapper chargeOrderMapper;
|
private ChargeOrderMapper chargeOrderMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChargeGoodsListMapper chargeGoodsListMapper;
|
private ChargeGoodsListMapper chargeGoodsListMapper;
|
||||||
|
@Autowired
|
||||||
|
private OrganizationMemberMapper organizationMemberMapper;
|
||||||
|
@Autowired
|
||||||
|
private PatientRegistrationMapper patientRegistrationMapper;
|
||||||
|
@Autowired
|
||||||
|
private DiagnosisMapper diagnosisMapper;
|
||||||
|
|
||||||
public RevenueOverviewVo getRevenueOverview(LocalDateTime begin, LocalDateTime end) {
|
public RevenueOverviewVo getRevenueOverview(LocalDateTime begin, LocalDateTime end) {
|
||||||
RevenueOverviewVo overviewVo = new RevenueOverviewVo();
|
RevenueOverviewVo overviewVo = new RevenueOverviewVo();
|
||||||
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<ChargeOrder> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
@ -37,13 +47,21 @@ public class StatisticsService extends BaseService {
|
||||||
queryWrapper.le("pay_time", end);
|
queryWrapper.le("pay_time", end);
|
||||||
queryWrapper.eq("status", RetailOrderStatusEnum.FINISHED.getCode());
|
queryWrapper.eq("status", RetailOrderStatusEnum.FINISHED.getCode());
|
||||||
Map<String, Object> map = chargeOrderMapper.selectMaps(queryWrapper).get(0);
|
Map<String, Object> map = chargeOrderMapper.selectMaps(queryWrapper).get(0);
|
||||||
overviewVo.setTotalRevenue((BigDecimal) map.getOrDefault("total_revenue",new BigDecimal(0)));
|
overviewVo.setTotalRevenue((BigDecimal) map.getOrDefault("total_revenue", new BigDecimal(0)));
|
||||||
overviewVo.setTotalOrderCount((Long) map.getOrDefault("total_order_count",new BigDecimal(0)));
|
overviewVo.setTotalOrderCount((Long) map.getOrDefault("total_order_count", new BigDecimal(0)));
|
||||||
//
|
|
||||||
// queryWrapper.isNotNull("vip_id");
|
//医保概况数据
|
||||||
// Map<String, Object> vipMap = retailOrderService.getMap(queryWrapper);
|
QueryWrapper<ChargeOrder> socialQuery = new QueryWrapper<>();
|
||||||
// overviewVo.setVipRevenue((BigDecimal) vipMap.getOrDefault("total_revenue",new BigDecimal(0)));
|
socialQuery.select("sum(total_price) as total_revenue,count(*) as total_order_count");
|
||||||
// overviewVo.setVipOrderCount((Long) vipMap.getOrDefault("total_order_count",new BigDecimal(0)));
|
socialQuery.ge("pay_time", begin);
|
||||||
|
socialQuery.le("pay_time", end);
|
||||||
|
socialQuery.eq("pay_type", RetailOrderPayTypeEnum.MEDICARE.getCode());
|
||||||
|
socialQuery.eq("status", RetailOrderStatusEnum.FINISHED.getCode());
|
||||||
|
Map<String, Object> socialMap = chargeOrderMapper.selectMaps(socialQuery).get(0);
|
||||||
|
overviewVo.setSocialRevenue((BigDecimal) socialMap.getOrDefault("total_revenue", new BigDecimal(0)));
|
||||||
|
overviewVo.setSocialOrderCount((Long) socialMap.getOrDefault("total_order_count", new BigDecimal(0)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QueryWrapper<ChargeOrder> payTypeQuery = new QueryWrapper<>();
|
QueryWrapper<ChargeOrder> payTypeQuery = new QueryWrapper<>();
|
||||||
payTypeQuery.ge("pay_time", begin);
|
payTypeQuery.ge("pay_time", begin);
|
||||||
|
|
@ -58,8 +76,9 @@ public class StatisticsService extends BaseService {
|
||||||
List<PayTypeRevenue> payTypeRevenueList = new ArrayList<>();
|
List<PayTypeRevenue> payTypeRevenueList = new ArrayList<>();
|
||||||
for (Map<String, Object> payTypeMap : payTypeMaps) {
|
for (Map<String, Object> payTypeMap : payTypeMaps) {
|
||||||
PayTypeRevenue revenue = new PayTypeRevenue();
|
PayTypeRevenue revenue = new PayTypeRevenue();
|
||||||
|
revenue.setPayType((Integer) payTypeMap.get("pay_type"));
|
||||||
revenue.setName(RetailOrderPayTypeEnum.getByCode((Integer) payTypeMap.get("pay_type")).getDesc());
|
revenue.setName(RetailOrderPayTypeEnum.getByCode((Integer) payTypeMap.get("pay_type")).getDesc());
|
||||||
revenue.setTotalRevenue((BigDecimal) payTypeMap.getOrDefault("total_revenue",new BigDecimal(0)));
|
revenue.setTotalRevenue((BigDecimal) payTypeMap.getOrDefault("total_revenue", new BigDecimal(0)));
|
||||||
payTypeRevenueList.add(revenue);
|
payTypeRevenueList.add(revenue);
|
||||||
}
|
}
|
||||||
overviewVo.setPayTypeRevenue(payTypeRevenueList);
|
overviewVo.setPayTypeRevenue(payTypeRevenueList);
|
||||||
|
|
@ -70,8 +89,8 @@ public class StatisticsService extends BaseService {
|
||||||
retailListQuery.ge("create_time", begin);
|
retailListQuery.ge("create_time", begin);
|
||||||
retailListQuery.le("create_time", end);
|
retailListQuery.le("create_time", end);
|
||||||
List<Map<String, Object>> goodsTypeMaps = new ArrayList<>();
|
List<Map<String, Object>> goodsTypeMaps = new ArrayList<>();
|
||||||
if (!retailOrderCodes.isEmpty() ){
|
if (!retailOrderCodes.isEmpty()) {
|
||||||
retailListQuery.in("charge_order_code",retailOrderCodes);
|
retailListQuery.in("charge_order_code", retailOrderCodes);
|
||||||
goodsTypeMaps = chargeGoodsListMapper.selectMaps(retailListQuery);
|
goodsTypeMaps = chargeGoodsListMapper.selectMaps(retailListQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -80,13 +99,14 @@ public class StatisticsService extends BaseService {
|
||||||
for (Map<String, Object> goodsTypeMap : goodsTypeMaps) {
|
for (Map<String, Object> goodsTypeMap : goodsTypeMaps) {
|
||||||
GoodsTypeRevenue goodsTypeRevenue = new GoodsTypeRevenue();
|
GoodsTypeRevenue goodsTypeRevenue = new GoodsTypeRevenue();
|
||||||
goodsTypeRevenue.setName(GoodsTypeEnum.getByType((Integer) goodsTypeMap.get("type")).getDesc());
|
goodsTypeRevenue.setName(GoodsTypeEnum.getByType((Integer) goodsTypeMap.get("type")).getDesc());
|
||||||
goodsTypeRevenue.setTotalRevenue((BigDecimal) goodsTypeMap.getOrDefault("total_revenue",new BigDecimal(0)));
|
goodsTypeRevenue.setTotalRevenue((BigDecimal) goodsTypeMap.getOrDefault("total_revenue", new BigDecimal(0)));
|
||||||
goodsTypeRevenuesList.add(goodsTypeRevenue);
|
goodsTypeRevenuesList.add(goodsTypeRevenue);
|
||||||
}
|
}
|
||||||
overviewVo.setGoodsTypeRevenue(goodsTypeRevenuesList);
|
overviewVo.setGoodsTypeRevenue(goodsTypeRevenuesList);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return overviewVo;
|
return overviewVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -111,7 +131,7 @@ public class StatisticsService extends BaseService {
|
||||||
commonQuery.groupBy("create_date");
|
commonQuery.groupBy("create_date");
|
||||||
commonQuery.orderByAsc("create_date");
|
commonQuery.orderByAsc("create_date");
|
||||||
// commonQuery.isNull("vip_id");
|
// commonQuery.isNull("vip_id");
|
||||||
List<Map<String, Object>> commonMaps = chargeOrderMapper.selectMaps(commonQuery);
|
List<Map<String, Object>> commonMaps = chargeOrderMapper.selectMaps(commonQuery);
|
||||||
List<LocalDate> dateList = DateUtil.getDatesBetween(beginTime, endTime);
|
List<LocalDate> dateList = DateUtil.getDatesBetween(beginTime, endTime);
|
||||||
Map<Object, BigDecimal> tempMap = new TreeMap<>();
|
Map<Object, BigDecimal> tempMap = new TreeMap<>();
|
||||||
for (LocalDate date : dateList) {
|
for (LocalDate date : dateList) {
|
||||||
|
|
@ -130,4 +150,90 @@ public class StatisticsService extends BaseService {
|
||||||
return personPayOverview;
|
return personPayOverview;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SalePersonReportVo> salePersonReport() {
|
||||||
|
List<Map<String, Object>> maps = chargeOrderMapper.selectSaleReport();
|
||||||
|
Map<Integer, SalePersonReportVo> voMaps = new HashMap<>();
|
||||||
|
for (Map<String, Object> map : maps) {
|
||||||
|
Integer salePersonId = (Integer) map.get("sale_person_id");
|
||||||
|
SalePersonReportVo vo = voMaps.getOrDefault(salePersonId, new SalePersonReportVo());
|
||||||
|
vo.setSalePersonId(salePersonId);
|
||||||
|
if (salePersonId != null){
|
||||||
|
OrganizationMember organizationMember = organizationMemberMapper.selectById(salePersonId);
|
||||||
|
vo.setSalePersonName(organizationMember.getName());
|
||||||
|
}
|
||||||
|
vo.setTotalIncome(vo.getTotalIncome().add((BigDecimal) map.get("sum")));
|
||||||
|
vo.setCount(vo.getCount()+(Long) map.get("count"));
|
||||||
|
RetailOrderPayTypeEnum payType = RetailOrderPayTypeEnum.getByCode((Integer) map.get("pay_type"));
|
||||||
|
if (payType == null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
switch (payType) {
|
||||||
|
case WXPAY:
|
||||||
|
vo.setWechatIncome(vo.getWechatIncome().add((BigDecimal) map.get("sum")));
|
||||||
|
break;
|
||||||
|
case ALIPAY:
|
||||||
|
vo.setAliPayIncome(vo.getAliPayIncome().add((BigDecimal) map.get("sum")));
|
||||||
|
break;
|
||||||
|
case CASH:
|
||||||
|
vo.setCashIncome(vo.getCashIncome().add((BigDecimal) map.get("sum")));
|
||||||
|
break;
|
||||||
|
case OTHER:
|
||||||
|
vo.setOtherIncome(vo.getOtherIncome().add((BigDecimal) map.get("sum")));
|
||||||
|
break;
|
||||||
|
case MEDICARE:
|
||||||
|
vo.setSocialIncome(vo.getSocialIncome().add((BigDecimal) map.get("sum")));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
voMaps.put(salePersonId, vo);
|
||||||
|
}
|
||||||
|
List<SalePersonReportVo> result = voMaps.values().stream().toList();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TipCountVo getWaitCount(LocalDateTime beginTime, LocalDateTime endTime) {
|
||||||
|
TipCountVo tipCountVo = new TipCountVo();
|
||||||
|
RegistrationStatusEnum registrationStatusEnum = RegistrationStatusEnum.waiting;
|
||||||
|
QueryWrapper<PatientRegistration> registrationWrapper = new QueryWrapper<>();
|
||||||
|
registrationWrapper.lt("create_datetime", endTime);
|
||||||
|
registrationWrapper.ge("create_datetime", beginTime);
|
||||||
|
registrationWrapper.eq("status", registrationStatusEnum.getStatus());
|
||||||
|
registrationWrapper.eq("del_flag",0);
|
||||||
|
tipCountVo.setWaitDiagnosisCount(patientRegistrationMapper.selectCount(registrationWrapper));
|
||||||
|
|
||||||
|
registrationStatusEnum = RegistrationStatusEnum.inProgress;
|
||||||
|
registrationWrapper = new QueryWrapper<>();
|
||||||
|
registrationWrapper.lt("create_datetime", endTime);
|
||||||
|
registrationWrapper.ge("create_datetime", beginTime);
|
||||||
|
registrationWrapper.eq("status", registrationStatusEnum.getStatus());
|
||||||
|
registrationWrapper.eq("del_flag",0);
|
||||||
|
tipCountVo.setDiagnosingCount(patientRegistrationMapper.selectCount(registrationWrapper));
|
||||||
|
|
||||||
|
registrationStatusEnum = RegistrationStatusEnum.complete;
|
||||||
|
registrationWrapper = new QueryWrapper<>();
|
||||||
|
registrationWrapper.lt("create_datetime", endTime);
|
||||||
|
registrationWrapper.ge("create_datetime", beginTime);
|
||||||
|
registrationWrapper.eq("status", registrationStatusEnum.getStatus());
|
||||||
|
registrationWrapper.eq("del_flag",0);
|
||||||
|
tipCountVo.setCompleteDiaCount(patientRegistrationMapper.selectCount(registrationWrapper));
|
||||||
|
|
||||||
|
|
||||||
|
QueryWrapper<Diagnosis> diagnosisWrapper = new QueryWrapper<>();
|
||||||
|
diagnosisWrapper.lt("create_time", endTime);
|
||||||
|
diagnosisWrapper.ge("create_time", beginTime);
|
||||||
|
diagnosisWrapper.eq("status", 0);
|
||||||
|
tipCountVo.setUnchargedCount(diagnosisMapper.selectCount(diagnosisWrapper));
|
||||||
|
|
||||||
|
diagnosisWrapper = new QueryWrapper<>();
|
||||||
|
diagnosisWrapper.lt("create_time", endTime);
|
||||||
|
diagnosisWrapper.ge("create_time", beginTime);
|
||||||
|
diagnosisWrapper.eq("status", 1);
|
||||||
|
tipCountVo.setChargedCount(diagnosisMapper.selectCount(diagnosisWrapper));
|
||||||
|
|
||||||
|
return tipCountVo;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.syjiaer.clinic.server.common.constants.Constants;
|
import com.syjiaer.clinic.server.common.constants.Constants;
|
||||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
|
import com.syjiaer.clinic.server.entity.patient.PatientInfo;
|
||||||
import com.syjiaer.clinic.server.entity.vip.Vip;
|
import com.syjiaer.clinic.server.entity.vip.Vip;
|
||||||
import com.syjiaer.clinic.server.entity.vip.VipIntegralLog;
|
import com.syjiaer.clinic.server.entity.vip.VipIntegralLog;
|
||||||
import com.syjiaer.clinic.server.entity.vip.dto.VipIntegralLogQuery;
|
import com.syjiaer.clinic.server.entity.vip.dto.VipIntegralLogQuery;
|
||||||
|
import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.vip.VipIntegralLogMapper;
|
import com.syjiaer.clinic.server.mapper.vip.VipIntegralLogMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.vip.VipLevelConfigMapper;
|
import com.syjiaer.clinic.server.mapper.vip.VipLevelConfigMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.vip.VipMapper;
|
import com.syjiaer.clinic.server.mapper.vip.VipMapper;
|
||||||
|
|
@ -18,12 +20,10 @@ import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class VipIntegralLogService extends BaseService {
|
public class VipIntegralLogService extends BaseService {
|
||||||
@Autowired
|
|
||||||
private VipMapper vipMapper;
|
|
||||||
@Autowired
|
|
||||||
private VipLevelConfigMapper vipLevelConfigMapper;
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VipIntegralLogMapper vipIntegralLogMapper;
|
private VipIntegralLogMapper vipIntegralLogMapper;
|
||||||
|
@Autowired
|
||||||
|
private PatientInfoMapper patientInfoMapper;
|
||||||
|
|
||||||
public Page<VipIntegralLog> pageList(VipIntegralLogQuery query) {
|
public Page<VipIntegralLog> pageList(VipIntegralLogQuery query) {
|
||||||
if (query == null){
|
if (query == null){
|
||||||
|
|
@ -35,12 +35,12 @@ public class VipIntegralLogService extends BaseService {
|
||||||
if (query.getPageSize() == null || query.getPageSize() == 0){
|
if (query.getPageSize() == null || query.getPageSize() == 0){
|
||||||
query.setPageSize(Constants.DetailPageSize);
|
query.setPageSize(Constants.DetailPageSize);
|
||||||
}
|
}
|
||||||
Vip vip = null;
|
PatientInfo patientInfo = null;
|
||||||
if (query.getVipId() != null){
|
if (query.getVipId() != null){
|
||||||
vip = vipMapper.selectById(query.getVipId());
|
patientInfo = patientInfoMapper.selectById(query.getVipId());
|
||||||
}
|
}
|
||||||
if (vip == null){
|
if (patientInfo == null){
|
||||||
throw new MessageException("会员不存在");
|
throw new MessageException("患者不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
QueryWrapper<VipIntegralLog> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<VipIntegralLog> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.syjiaer.clinic.server.entity.vip.VipLevelConfig;
|
import com.syjiaer.clinic.server.entity.vip.VipLevelConfig;
|
||||||
import com.syjiaer.clinic.server.mapper.vip.VipLevelConfigMapper;
|
import com.syjiaer.clinic.server.mapper.vip.VipLevelConfigMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
|
import com.syjiaer.clinic.server.service.patient.PatientInfoService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -17,7 +19,7 @@ public class VipLevelConfigService extends BaseService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private VipLevelConfigMapper vipLevelConfigMapper;
|
private VipLevelConfigMapper vipLevelConfigMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VipService vipService;
|
private PatientInfoService patientInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据经验值获取会员等级
|
* 根据经验值获取会员等级
|
||||||
|
|
@ -102,14 +104,14 @@ public class VipLevelConfigService extends BaseService {
|
||||||
for (VipLevelConfig levelConfig : insertList){
|
for (VipLevelConfig levelConfig : insertList){
|
||||||
vipLevelConfigMapper.insert(levelConfig);
|
vipLevelConfigMapper.insert(levelConfig);
|
||||||
}
|
}
|
||||||
vipService.reFreshAllVipLevel();
|
patientInfoService.reFreshAllVipLevel();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer delete(int id) {
|
public Integer delete(int id) {
|
||||||
Integer count = vipLevelConfigMapper.deleteById(id);
|
Integer count = vipLevelConfigMapper.deleteById(id);
|
||||||
vipService.reFreshAllVipLevel();
|
patientInfoService.reFreshAllVipLevel();
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,4 +2,17 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper">
|
<mapper namespace="com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper">
|
||||||
|
|
||||||
|
<select id="selectDetailByQuery" resultType="com.syjiaer.clinic.server.entity.organization.vo.MemberVo">
|
||||||
|
SELECT om.*,os.name AS section_name
|
||||||
|
FROM organization_member AS om LEFT JOIN organization_section AS os ON om.section_id = os.id
|
||||||
|
<where>
|
||||||
|
<if test="keyword != null and keyword != ''">
|
||||||
|
(om.name LIKE concat('%', #{keyword}, '%')
|
||||||
|
or os.name LIKE concat('%', #{keyword}, '%'))
|
||||||
|
</if>
|
||||||
|
<if test="role != null">
|
||||||
|
And om.role = #{role}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
*
|
||||||
|
!.gitignore
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
package com.syjiaer.clinic.server;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.syjiaer.clinic.server.common.api.input.IM9001;
|
|
||||||
import com.syjiaer.clinic.server.common.api.request.SocialRequest;
|
|
||||||
import com.syjiaer.clinic.server.service.charge.ChargeService;
|
|
||||||
import com.syjiaer.clinic.server.service.diagnosis.MedicalRecordService;
|
|
||||||
import com.syjiaer.clinic.server.service.social.SocialDiagnoseService;
|
|
||||||
import com.syjiaer.clinic.server.service.social.SocialItemService;
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
class ServerApplicationTests {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MedicalRecordService medicalRecordService;
|
|
||||||
@Autowired
|
|
||||||
private SocialDiagnoseService socialDiagnoseService;
|
|
||||||
@Autowired
|
|
||||||
private SocialItemService socialItemService;
|
|
||||||
@Autowired
|
|
||||||
private ChargeService chargeService;
|
|
||||||
@Autowired
|
|
||||||
private SocialRequest socialRequest;
|
|
||||||
@Test
|
|
||||||
void contextLoads() {
|
|
||||||
// chargeService.uploadCostDetails("CO20250424130233778296");
|
|
||||||
// String meCode = "AD1537643";
|
|
||||||
// String medType = "03";
|
|
||||||
// String in = "310";
|
|
||||||
// chargeService.socialPrePay("CO20250424130233778296",medType,meCode,"310");
|
|
||||||
String meCode = "AD1537643|eZFLx0k4i8izV3NdLvOKRF16BQ6yCj3Cv+PS4dyDK/fy4l30EzRhIDFV5W0E+jZVkPFpsUkVVUU0WX+58IafhGQxzYO25uuEaZkwhDFyPF+RbV14gcURcjR7BjU8m+xWQV1jmrEygKcJ0fbjtdEZrjZRgjNtiz+KCqw5qeWlkvtfcI/pnYeD6Y0CI64KnBGFfMxd9n2pM2GnZp08tJRb/50KnDqwZY1tHLNmiCX0Cnk=";
|
|
||||||
chargeService.socialRealPay("CO20250424130233778296","03",meCode,"310");
|
|
||||||
|
|
||||||
}
|
|
||||||
@Test
|
|
||||||
void text(){
|
|
||||||
IM9001 im9001 = new IM9001();
|
|
||||||
im9001.setOpter_no("0");
|
|
||||||
im9001.setMac("00-FF-F2-10-61-2D");
|
|
||||||
im9001.setIp("10.42.131.10");
|
|
||||||
socialRequest.call9001(im9001);
|
|
||||||
}
|
|
||||||
@Test
|
|
||||||
void test(){
|
|
||||||
socialItemService.download("F002_20210915000001_A");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue