Merge branch 'dev_gy_0920' of http://182.92.166.109:3000/jihan/xinelu-api into dev_gy_0920

This commit is contained in:
mengkuiliang 2023-10-16 09:04:00 +08:00
commit 611379accf
48 changed files with 788 additions and 496 deletions

View File

@ -1,11 +1,8 @@
package com.xinelu.web.controller.applet;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.config.XinELuConfig;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.file.FileUploadUtils;
import com.xinelu.common.utils.file.MimeTypeUtils;
import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody;
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
@ -13,15 +10,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.List;
@ -53,16 +44,6 @@ public class ResidentPatientInfoController extends BaseController {
}
}
@ApiOperation("获取微信手机号")
@GetMapping("/getPhone/{code}")
public R<JSONObject> getPhone(@PathVariable String code) {
try {
return R.ok(residentPatientInfoService.getPhone(code));
} catch (Exception e) {
return R.fail(e.getMessage());
}
}
@ApiOperation("注册完善信息")
@PostMapping("")
public R<String> register(@Validated @RequestBody PatientInfoBody body) {
@ -128,10 +109,16 @@ public class ResidentPatientInfoController extends BaseController {
return R.ok(residentPatientInfoService.getCurrentResident(openid, cityCode));
}
@ApiOperation("是否已注册")
/*@ApiOperation("是否已注册")
@GetMapping(value = "/isRegistered/{code}")
public R<PatientInfo> isRegistered(@PathVariable("code") String code) {
return R.ok(residentPatientInfoService.isRegistered(code));
}*/
@ApiOperation("是否已注册")
@GetMapping(value = "/login/{loginCode}/{phoneCode}")
public AjaxResult isRegistered(@PathVariable("loginCode") String loginCode, @PathVariable("phoneCode") String phoneCode) throws Exception {
return AjaxResult.success(residentPatientInfoService.login(loginCode,phoneCode));
}
/**

View File

@ -84,6 +84,8 @@ xinelu:
right-eye-piture-url: /rightEyePitureUrl
#居民签约申请签字图片地址
resident-signature-url: /residentSignatureUrl
#阿尔兹海默症结果文件地址
alzheimer-file-url: /alzheimerFileUrl
# 开发环境配置
server:
@ -254,10 +256,10 @@ fd:
# 腾讯云音视频
trtc:
sdkappid: 1400236771
sdksecretkey: 83ab78d1a8513af6626d58cc2bacd7b28bfb2af06515fa02b0204129ebb53422
secretid: AKIDOBpP2ICALat0wP4lcIiAMtZ7XgUJ5vMO
secretkey: zxjJhGcx75lECyweHgphKYefWCkBPSHt
sdkappid: 1600006944
sdksecretkey: 6ddbc3e7e4aa128b52898df27a35f8f3d5acdca6f34ffa17b87ebc33e83314f1
secretid: AKIDjKo7GF2g9PQJ7KMBpGUTFrFZP7cw2upY
secretkey: c1HajkZCdrrhLsDRUL1XotpeUAkAOSM7
# 微信小程序参数配置信息
applet-chat-config:

View File

@ -101,6 +101,11 @@ public class XinELuConfig {
*/
public String rightEyePitureUrl;
/**
* 阿尔兹海默症筛查结果文件地址
*/
private String alzheimerFileUrl;
/**
* 修改会员App用户头像上传
*/
@ -653,4 +658,12 @@ public class XinELuConfig {
public void setRightEyePitureUrl(String rightEyePitureUrl) {
this.rightEyePitureUrl = rightEyePitureUrl;
}
public String getAlzheimerFileUrl() {
return alzheimerFileUrl;
}
public void setAlzheimerFileUrl(String alzheimerFileUrl) {
this.alzheimerFileUrl = alzheimerFileUrl;
}
}

View File

@ -283,6 +283,10 @@ public class Constants {
*/
public static final String RIGHT_EYE_PICTURE_URL = "rightEyePitureUrl";
/**
* 阿尔兹海默症结果文件地址
*/
public static final String ALZHEIMER_FILE_URL = "alzheimerFileUrl";
/**
* 护理站模板信息下载
*/

View File

@ -10,6 +10,12 @@ import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.uuid.Seq;
import com.xinelu.common.utils.uuid.UUID;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FilenameUtils;
import org.springframework.web.multipart.MultipartFile;
@ -352,4 +358,27 @@ public class FileUploadUtils {
return StringUtils.format("{}.{}",
FilenameUtils.getBaseName(file.getOriginalFilename()), getExtension(file));
}
/**
* 读取文件
*
* @param filePath 文件地址
* @param response 响应流
* @return void
* @author gaoyu
* @date 2022-01-05 11:43
*/
@SuppressWarnings("all")
public static void read(String filePath, HttpServletResponse response) {
File file = new File(filePath);
try (InputStream in = new BufferedInputStream(new FileInputStream(file));
OutputStream os = new BufferedOutputStream(response.getOutputStream())) {
byte[] buffer = new byte[in.available()];
in.read(buffer);
os.write(buffer);
os.flush();
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@ -29,6 +29,8 @@ public class MimeTypeUtils {
public static final String[] VIDEO_EXTENSION = {"mp4", "avi", "rmvb"};
public static final String[] FILE_EXTENSION = {"doc", "docx", "pdf"};
public static final String[] DEFAULT_ALLOWED_EXTENSION = {
// 图片
"bmp", "gif", "jpg", "jpeg", "png",

View File

@ -94,4 +94,6 @@ public interface ResidentPatientInfoMapper {
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
**/
PatientInfo getByCardNo(String cardNo);
int selectPatientInfoByPhone(String phone);
}

View File

@ -1,11 +1,9 @@
package com.xinelu.familydoctor.applet.service;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.entity.AppletPhoneVO;
import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody;
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
import com.xinelu.familydoctor.applet.pojo.query.PatientInfoQuery;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
@ -50,7 +48,7 @@ public interface IResidentPatientInfoService {
* @Param [code]
* @return java.lang.String
**/
JSONObject getPhone(String code) throws Exception;
AppletPhoneVO getPhone(String code) throws Exception;
/**
* @return java.lang.String
@ -122,5 +120,6 @@ public interface IResidentPatientInfoService {
* @Param [code]
* @return java.lang.Object
**/
PatientInfo isRegistered(String code);
//PatientInfo isRegistered(String code);
HashMap<String,String> login(String logincode,String phoneCode) throws Exception;
}

View File

@ -1,14 +1,12 @@
package com.xinelu.familydoctor.applet.service.impl;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.config.AppletChatConfig;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.entity.AppletPhoneVO;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.http.HttpService;
@ -19,10 +17,11 @@ import com.xinelu.familydoctor.applet.mapper.ResidentPatientInfoMapper;
import com.xinelu.familydoctor.applet.pojo.body.PatientInfoBody;
import com.xinelu.familydoctor.applet.pojo.entity.PatientInfo;
import com.xinelu.familydoctor.applet.service.IResidentPatientInfoService;
import com.xinelu.familydoctor.applet.utils.AppletAccessTokenUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -43,7 +42,10 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
private HttpService httpService;
@Resource
private AppletChatConfig appletChatConfig;
@Resource
private AppletAccessTokenUtils appletAccessTokenUtils;
@Resource
private RedisTemplate<String, Object> redisTemplate;
/**
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
* @Author mengkuiliang
@ -88,7 +90,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
if (!json.containsKey("openid")) {
throw new ServiceException(json.getString("errmsg"));
}
return json.getString("openid");
String openid = json.getString("openid");
return openid;
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
@ -102,11 +105,8 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
* @Param [code]
**/
@Override
public JSONObject getPhone(String code) {
try {
public AppletPhoneVO getPhone(String code) throws Exception {
JSONObject result;
// 获取token
String token_url = String.format("https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s", appletChatConfig.getAppletId(), appletChatConfig.getSecret());
SslUtils.ignoreSsl();
@ -120,25 +120,13 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
if (StringUtils.isEmpty(accessToken)) {
return null;
}
//获取手机号 https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/user-info/phone-number/getPhoneNumber.html
String url = "https://api.weixin.qq.com/wxa/business/getuserphonenumber" + "?access_token=" + accessToken;
JSONObject params = new JSONObject();
params.put("code", code);
SslUtils.ignoreSsl();
result = httpService.post(url, null, params);
if (result == null) {
return null;
}
log.info("获取小程序手机号 : {}", result.toJSONString());
if (result.getInteger("errcode") != 0) {
return null;
}
return result;
} catch (Exception e) {
e.printStackTrace();
}
return null;
return JSON.parseObject(result.toString(), AppletPhoneVO.class);
}
/**
@ -322,8 +310,36 @@ public class ResidentPatientInfoServiceImpl implements IResidentPatientInfoServi
* @Param [code]
* @return com.xinelu.familydoctor.applet.pojo.entity.PatientInfo
**/
@Override
/*@Override
public PatientInfo isRegistered(String code) {
return getCurrentResident(getOpenId(code), null);
}*/
@Override
public HashMap<String, String> login(String loginCode,String phoneCode) throws Exception {
HashMap<String, String> HashMap = new HashMap<>();
try {
SslUtils.ignoreSsl();
String params = "appid=" + appletChatConfig.getAppletId() + "&secret=" + appletChatConfig.getSecret() + "&js_code=" + loginCode + "&grant_type=" + appletChatConfig.getGrantType();
log.info("获取openID请求参数{}", params);
String result = HttpUtils.sendPost("https://api.weixin.qq.com/sns/jscode2session", params);
JSONObject json = JSONObject.parseObject(result);
// {"errcode":40029,"errmsg":"invalid code, rid: 650bf9c3-31a6c960-2b437029"}
log.info("获取openID响应结果{}", json.toJSONString());
if (!json.containsKey("openid")) {
throw new ServiceException(json.getString("errmsg"));
}
String openid = json.getString("openid");
HashMap.put("openid",openid);
} catch (Exception e) {
throw new ServiceException(e.getMessage());
}
String code;
AppletPhoneVO phone = getPhone(phoneCode);
String phoneNumber = phone.getPhoneInfo().getPhoneNumber();
HashMap.put("phone",phoneNumber);
code = residentPatientInfoMapper.selectPatientInfoByPhone(phoneNumber) == 0 ? "0" : "1";
HashMap.put("code",code);
return HashMap;
}
}

View File

@ -0,0 +1,98 @@
package com.xinelu.familydoctor.applet.utils;
import com.xinelu.common.config.AppletChatConfig;
import com.xinelu.common.config.NurseAppletChatConfig;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.entity.AppletAccessToken;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.AppletChatUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* @Description 获取小程序AccessToken公共方法
* @Author 纪寒
* @Date 2023-02-27 18:02:05
* @Version 1.0
*/
@Component
public class AppletAccessTokenUtils {
@Resource
private RedisTemplate<String, Object> redisTemplate;
@Resource
private AppletChatConfig appletChatConfig;
@Resource
private NurseAppletChatConfig nurseAppletChatConfig;
/**
* 返回成功状态码
*/
private static final int SUCCESS_CODE = 0;
/**
* 获取小程序AccessToken方法
*
* @return 小程序的AccessToken
*/
public String getAppletAccessToken() {
String accessToken;
String accessTokenKey = Constants.NURSE_STATION_APPLET_ACCESS_TOKEN + "accessToken";
//从Redis中取出accessToken
Object object = redisTemplate.opsForValue().get(accessTokenKey);
if (Objects.isNull(object)) {
//没有获取accessToken
AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(appletChatConfig.getAppletId(), appletChatConfig.getSecret());
if (Objects.isNull(appletAccessToken)) {
throw new ServiceException("获取微信小程序accessToken信息失败");
}
if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != SUCCESS_CODE) {
throw new ServiceException("获取微信小程序accessToken信息失败失败信息为" + appletAccessToken.getErrmsg(), 201);
}
if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
throw new ServiceException("accessToken信息为空");
}
//存入Redis中
redisTemplate.opsForValue().set(accessTokenKey, appletAccessToken.getAccessToken(), 3600, TimeUnit.SECONDS);
accessToken = appletAccessToken.getAccessToken();
} else {
accessToken = (String) object;
}
return accessToken;
}
/**
* 护理员小程序获取小程序AccessToken方法
*
* @return 小程序的AccessToken
*/
public String getPersonAppletAccessToken() {
String accessToken;
String accessTokenKey = Constants.NURSE_STATION_PERSON_APPLET_ACCESS_TOKEN + "accessToken";
//从Redis中取出accessToken
Object object = redisTemplate.opsForValue().get(accessTokenKey);
if (Objects.isNull(object)) {
//没有获取accessToken
AppletAccessToken appletAccessToken = AppletChatUtil.getAppletAccessToken(nurseAppletChatConfig.getAppletId(), nurseAppletChatConfig.getSecret());
if (Objects.isNull(appletAccessToken)) {
throw new ServiceException("获取微信小程序accessToken信息失败");
}
if (Objects.nonNull(appletAccessToken.getErrcode()) && appletAccessToken.getErrcode() != SUCCESS_CODE) {
throw new ServiceException("获取微信小程序accessToken信息失败失败信息为" + appletAccessToken.getErrmsg(), 201);
}
if (StringUtils.isBlank(appletAccessToken.getAccessToken())) {
throw new ServiceException("accessToken信息为空");
}
//存入Redis中
redisTemplate.opsForValue().set(accessTokenKey, appletAccessToken.getAccessToken(), 3600, TimeUnit.SECONDS);
accessToken = appletAccessToken.getAccessToken();
} else {
accessToken = (String) object;
}
return accessToken;
}
}

View File

@ -451,4 +451,12 @@
update patient_info set is_checked = #{isChecked} where patient_code = #{patientCode}
</update>
<!-- 获取注册详细信息 -->
<select id="selectPatientInfoByPhone" parameterType="String" resultType="java.lang.Integer">
select count(1) from patient_info
where phone = #{pnone}
and login_flag = '1'
</select>
</mapper>

View File

@ -112,7 +112,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage").anonymous()
.antMatchers("/login", "/register", "/captchaImage","/newapp/login/appLogin").anonymous()
// 静态资源可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()

View File

@ -2,16 +2,18 @@ package com.xinelu.applet.controller.appletscreeningrecord;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.annotation.RepeatSubmit;
import com.xinelu.common.config.XinELuConfig;
import com.xinelu.common.constant.ScreeningProjectConstants;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.DateUtils;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.file.FileUploadUtils;
import com.xinelu.common.utils.file.FileUtils;
import com.xinelu.manage.dto.screeningrecord.ScreeningApplyDTO;
import com.xinelu.manage.dto.screeningrecord.ScreeningRecordDTO;
import com.xinelu.manage.service.patientinfo.IPatientInfoService;
import com.xinelu.manage.service.screeningrecord.IScreeningRecordService;
import com.xinelu.manage.vo.screeningrecord.ScreeningRecordVo;
import io.swagger.annotations.Api;
@ -19,11 +21,13 @@ import io.swagger.annotations.ApiOperation;
import java.io.File;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
@ -41,9 +45,6 @@ public class AppletScreeningRecordController extends BaseController {
@Resource
private IScreeningRecordService screeningRecordService;
@Resource
private IPatientInfoService patientService;
@GetMapping("/record")
@ApiOperation(value = "获取筛查结果记录")
public TableDataInfo record(ScreeningRecordDTO query) {
@ -137,4 +138,18 @@ public class AppletScreeningRecordController extends BaseController {
JSONObject jsonObject = screeningRecordService.getInfo(assessRecordId);
return R.ok(jsonObject);
}
@ApiOperation("阿尔兹海默症结果预览")
@GetMapping("/fileview")
public void fileview(@RequestParam("filePath") String filePath, HttpServletResponse response) {
if (StringUtils.isNotEmpty(filePath)) {
String fileDir = XinELuConfig.getProfile() + filePath.replaceAll("/profile", "");
File file = new File(fileDir);
if (file.exists() && file.isFile()) {
FileUploadUtils.read(fileDir, response);
} else {
throw new ServiceException("未找到文件");
}
}
}
}

View File

@ -1,4 +1,33 @@
package com.xinelu.applet.controller.newapp;
import com.xinelu.applet.service.newapp.NewAppLoginService;
import com.xinelu.common.core.domain.AjaxResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@RestController
@RequestMapping("/newapp/login")
public class NewAppLoginController {
@Resource
private NewAppLoginService newAppLoginService;
/**
* 新app登录
* @param personAccount
* @param personPassword
* @return
*/
@PostMapping("/appLogin")
public AjaxResult login(@RequestParam("personAccount") String personAccount, @RequestParam("personPassword") String personPassword) {
if (StringUtils.isBlank(personAccount)) {
return AjaxResult.error("请输入账号!");
}
if (StringUtils.isBlank(personPassword)) {
return AjaxResult.error("请输入密码!");
}
return AjaxResult.success(newAppLoginService.login(personAccount, personPassword));
}
}

View File

@ -35,6 +35,22 @@ public class NurseAppLoginController extends BaseController {
@Resource
private NurseAppLoginService nurseAppLoginService;
/**
* 判断用户是否完善信息-微信小程序和APP共用
*
* @param patientId 用户id
* @return 结果
*/
@MobileRequestAuthorization
@GetMapping("/AppIdentification")
public AjaxResult getIdentification(Long patientId) {
if (Objects.isNull(patientId)) {
return AjaxResult.error("当前用户信息不存在,无法完善个人信息!");
}
return nurseAppLoginService.getIdentification(patientId);
}
/**
* 查询护理人列表信息会员小程序和App共用
*
@ -97,5 +113,4 @@ public class NurseAppLoginController extends BaseController {
List<OrderAndItemVO> appointmentOrderDetails = nurseAppLoginService.selectAppServiceOrderItem(patientId, orderStatus);
return getDataTable(appointmentOrderDetails);
}
}
}

View File

@ -0,0 +1,14 @@
package com.xinelu.applet.mapper.newapp;
import org.apache.ibatis.annotations.Param;
public interface NewAppLoginMapper {
/**
* 新app登录
* @param personAccount
* @param personPassword
* @return
*/
int login(@Param("personAccount") String personAccount, @Param("personPassword") String personPassword);
}

View File

@ -24,12 +24,10 @@ import com.xinelu.common.utils.StringUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.appointmentorder.AppointmentOrder;
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.sysarea.SysArea;
import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper;
import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper;
import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.sysarea.SysAreaMapper;
import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
@ -76,8 +74,6 @@ public class AppletLoginServiceImpl implements AppletLoginService {
private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper;
@Resource
private AppletAccessTokenUtil appletAccessTokenUtil;
@Resource
private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper;
/**
@ -444,19 +440,6 @@ public class AppletLoginServiceImpl implements AppletLoginService {
log.info("新增预约订单主表失败,失败原因:[{}]", appointmentOrder);
throw new ServiceException("预约护理信息失败,请联系管理员!");
}
//新增预约订单流程记录信息表
AppointmentOrderProcessRecord appointment = new AppointmentOrderProcessRecord();
appointment.setOperatePersonId(dto.getPatientId());
appointment.setAppointmentOrderId(appointmentOrder.getId());
appointment.setAppointmentOrderNo(orderNo);
appointment.setOperateTime(LocalDateTime.now());
appointment.setOperateType(OrderProcessOperateTypeEnum.PLACE_ORDER.getInfo());
appointment.setOperateDetails("预约订单下单操作");
appointment.setCreateTime(LocalDateTime.now());
int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointment);
if (count <= 0) {
throw new ServiceException("预约订单流程记录失败,请联系管理员!");
}
}
/**

View File

@ -0,0 +1,15 @@
package com.xinelu.applet.service.newapp;
import com.xinelu.common.core.domain.AjaxResult;
import org.springframework.stereotype.Service;
@Service
public interface NewAppLoginService {
/**
* 新app登录
* @param personAccount
* @param personPassword
* @return
*/
AjaxResult login(String personAccount, String personPassword);
}

View File

@ -0,0 +1,30 @@
package com.xinelu.applet.service.newapp.impl;
import com.xinelu.applet.mapper.newapp.NewAppLoginMapper;
import com.xinelu.applet.service.newapp.NewAppLoginService;
import com.xinelu.common.core.domain.AjaxResult;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Service
public class NewAppLoginServiceImpl implements NewAppLoginService {
@Resource
private NewAppLoginMapper newAppLoginMapper;
/**
* 新app登录
* @param personAccount
* @param personPassword
* @return
*/
@Override
public AjaxResult login(String personAccount, String personPassword) {
int count = newAppLoginMapper.login(personAccount, personPassword);
if (count>0){
return AjaxResult.success("登录成功!");
}else {
return AjaxResult.error("账号或密码错误!");
}
}
}

View File

@ -4,13 +4,10 @@ package com.xinelu.applet.service.nurseappletpersonworkorder.Impl;
import com.xinelu.applet.dto.nursepersonapplogin.OrderFallbackDTO;
import com.xinelu.applet.service.nurseappletpersonworkorder.NurseAppletPersonWorkOrderService;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.OrderProcessOperateTypeEnum;
import com.xinelu.common.enums.OrderStatusEnum;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord;
import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper;
import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper;
import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper;
import com.xinelu.manage.service.stationmessagepush.StationMessagePushService;
import com.xinelu.manage.vo.appointmentorder.AppointmentReceivingOrderVO;
import lombok.extern.slf4j.Slf4j;
@ -18,7 +15,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.Objects;
/**
@ -33,8 +29,6 @@ public class NurseAppletPersonWorkOrderServiceImpl implements NurseAppletPersonW
@Resource
private AppointmentOrderMapper appointmentOrderMapper;
@Resource
private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper;
@Resource
private StationMessagePushService stationMessagePushService;
@Resource
private AppointmentOrderDetailsMapper appointmentOrderDetailsMapper;
@ -56,18 +50,6 @@ public class NurseAppletPersonWorkOrderServiceImpl implements NurseAppletPersonW
if (update < 0) {
throw new ServiceException("接单失败,请联系管理员!");
}
AppointmentOrderProcessRecord appointmentOrderProcessRecord = new AppointmentOrderProcessRecord();
appointmentOrderProcessRecord.setAppointmentOrderNo(orderFallbackDTO.getAppointmentOrderNo());
appointmentOrderProcessRecord.setCreateTime(LocalDateTime.now());
appointmentOrderProcessRecord.setOperatePersonId(orderFallbackDTO.getStationPersonId());
appointmentOrderProcessRecord.setOperateTime(LocalDateTime.now());
appointmentOrderProcessRecord.setOperateType(OrderProcessOperateTypeEnum.RECEIVE_ORDER.getInfo());
appointmentOrderProcessRecord.setAppointmentOrderId(orderFallbackDTO.getAppointmentOrderId());
appointmentOrderProcessRecord.setOperateDetails("接单");
int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointmentOrderProcessRecord);
if (count <= 0) {
throw new ServiceException("增加预约订单流程记录失败,请联系管理员!");
}
//异步发送消息
stationMessagePushService.receivingOrdersOperationsPush(appointmentReceivingOrder);
return AjaxResult.success();

View File

@ -14,6 +14,14 @@ import java.util.List;
*/
public interface NurseAppLoginService {
/**
* 判断用户是否完善信息-微信小程序和APP共用
*
* @param patientId 用户id
* @return 结果
*/
AjaxResult getIdentification(Long patientId);
/**
* 查询护理人列表信息
*

View File

@ -1,67 +1,36 @@
package com.xinelu.applet.service.nurseapplogin.impl;
import com.xinelu.applet.dto.appletlogin.AppletUserInfoDTO;
import com.xinelu.applet.dto.appletlogin.StationItemInfoDTO;
import com.xinelu.applet.mapper.appletlogin.AppletLoginMapper;
import com.xinelu.applet.mapper.nurseapplogin.NurseAppLoginMapper;
import com.xinelu.applet.mapper.patientcenter.PatientCenterMapper;
import com.xinelu.applet.service.messagepush.MessagePushService;
import com.xinelu.applet.service.nurseapplogin.NurseAppLoginService;
import com.xinelu.applet.utils.AppointmentTimeUtil;
import com.xinelu.applet.vo.appletlogin.NurserStationItemConsumableVO;
import com.xinelu.applet.vo.appletlogin.NurserStationItemInfoVO;
import com.xinelu.applet.vo.nurseapplogin.AppLoginVO;
import com.xinelu.applet.vo.nurseapplogin.PatientAndDiseaseVO;
import com.xinelu.applet.vo.nursepersonapplogin.OrderAndItemVO;
import com.xinelu.applet.vo.specialdisease.WeekDaysVO;
import com.xinelu.common.config.AppletChatConfig;
import com.xinelu.common.config.XinELuConfig;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.*;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.enums.AppointmentTimeIntervalEnum;
import com.xinelu.common.enums.GooodsOrderStatusEnum;
import com.xinelu.common.utils.AgeUtil;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.common.utils.regex.RegexUtil;
import com.xinelu.manage.domain.coupon.Coupon;
import com.xinelu.manage.domain.goodsOrder.GoodsOrder;
import com.xinelu.manage.domain.patientcouponreceive.PatientCouponReceive;
import com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo;
import com.xinelu.manage.domain.patientinfo.PatientInfo;
import com.xinelu.manage.domain.patientintegralchange.PatientIntegralChange;
import com.xinelu.manage.domain.receiveAddressInfo.ReceiveAddressInfo;
import com.xinelu.manage.domain.subscribemessagerecord.SubscribeMessageRecord;
import com.xinelu.manage.domain.systemsettingsinfo.SystemSettingsInfo;
import com.xinelu.manage.mapper.coupon.CouponMapper;
import com.xinelu.manage.mapper.patientcouponreceive.PatientCouponReceiveMapper;
import com.xinelu.manage.mapper.patientdiseaseinfo.PatientDiseaseInfoMapper;
import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper;
import com.xinelu.manage.mapper.patientintegralchange.PatientIntegralChangeMapper;
import com.xinelu.manage.mapper.receiveAddressInfo.ReceiveAddressInfoMapper;
import com.xinelu.manage.mapper.subscribemessagerecord.SubscribeMessageRecordMapper;
import com.xinelu.manage.mapper.sysarea.SysAreaMapper;
import com.xinelu.manage.mapper.systemsettingsinfo.SystemSettingsInfoMapper;
import com.xinelu.manage.vo.patientcouponreceive.PatientCouponReceiveInfoVO;
import com.xinelu.manage.vo.patientinfo.PatientInfoVO;
import com.xinelu.manage.vo.sysarea.SysAreaVO;
import com.xinelu.system.domain.SysConfig;
import com.xinelu.system.mapper.SysConfigMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@ -83,6 +52,27 @@ public class NurseAppLoginServiceImpl implements NurseAppLoginService {
private AppointmentTimeUtil appointmentTimeUtil;
@Resource
private SysConfigMapper sysConfigMapper;
@Resource
private PatientInfoMapper patientInfoMapper;
/**
* 判断用户是否完善信息-微信小程序和APP共用
*
* @param patientId 用户id
* @return 结果
*/
@Override
public AjaxResult getIdentification(Long patientId) {
//判断当前用户信息是否存在
PatientInfoVO patientInfo = patientInfoMapper.getPatientInfoById(patientId);
if (Objects.isNull(patientInfo)) {
return AjaxResult.error("当前用户信息不存在,无法完善个人信息!");
}
AppLoginVO appLoginVO = new AppLoginVO();
appLoginVO.setLoginFlag(Objects.nonNull(patientInfo.getLoginFlag()) && patientInfo.getLoginFlag() == 1);
return AjaxResult.success(appLoginVO);
}
/**
* 查询护理人列表信息

View File

@ -7,7 +7,6 @@ import com.xinelu.applet.service.nursepersonapplogin.INursePersonAppLoginService
import com.xinelu.applet.vo.nursepersonapplogin.*;
import com.xinelu.common.config.XinELuConfig;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.OrderProcessOperateTypeEnum;
import com.xinelu.common.enums.OrderStatusEnum;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.AgeUtil;
@ -16,12 +15,10 @@ import com.xinelu.common.utils.file.MimeTypeUtils;
import com.xinelu.common.utils.regex.RegexUtil;
import com.xinelu.common.utils.sign.Md5Utils;
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord;
import com.xinelu.manage.domain.nursestationperson.NurseStationPerson;
import com.xinelu.manage.domain.nursestationpersonrevenue.NurseStationPersonRevenue;
import com.xinelu.manage.domain.patientdiseaseinfo.PatientDiseaseInfo;
import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper;
import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper;
import com.xinelu.manage.mapper.nursestation.NurseStationMapper;
import com.xinelu.manage.mapper.nursestationperson.NurseStationPersonMapper;
import com.xinelu.manage.mapper.nursestationpersonrevenue.NurseStationPersonRevenueMapper;
@ -71,8 +68,6 @@ public class NursePersonAppLoginServiceImpl implements INursePersonAppLoginServi
@Resource
private XinELuConfig xinYiLuConfig;
@Resource
private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper;
@Resource
private NurseStationPersonRevenueMapper nurseStationPersonRevenueMapper;
@Resource
private PatientDiseaseInfoMapper patientDiseaseInfoMapper;
@ -173,19 +168,6 @@ public class NursePersonAppLoginServiceImpl implements INursePersonAppLoginServi
if (update <= 0) {
throw new ServiceException("任务退回失败,请联系管理员!");
}
//流程记录
AppointmentOrderProcessRecord appointmentOrderProcessRecord = new AppointmentOrderProcessRecord();
appointmentOrderProcessRecord.setAppointmentOrderNo(orderFallbackDTO.getAppointmentOrderNo());
appointmentOrderProcessRecord.setCreateTime(LocalDateTime.now());
appointmentOrderProcessRecord.setOperatePersonId(orderFallbackDTO.getStationPersonId());
appointmentOrderProcessRecord.setOperateTime(LocalDateTime.now());
appointmentOrderProcessRecord.setOperateType(OrderProcessOperateTypeEnum.ACTIVE_BACK_ORDER.getInfo());
appointmentOrderProcessRecord.setOperateDetails(orderFallbackDTO.getTaskReturnReason());
appointmentOrderProcessRecord.setAppointmentOrderId(orderFallbackDTO.getAppointmentOrderId());
int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointmentOrderProcessRecord);
if (count <= 0) {
throw new ServiceException("预约订单流程记录失败,请联系管理员!");
}
//异步发送信息
stationMessagePushService.refusalOrdersOperationsPush(appointmentReceivingOrder);
return AjaxResult.success();
@ -227,19 +209,6 @@ public class NursePersonAppLoginServiceImpl implements INursePersonAppLoginServi
if (stationPersonRevenue <= 0) {
throw new ServiceException("新增护理员订单佣金收益记录失败,请联系管理员!");
}
//新增预约订单流程记录信息表
AppointmentOrderProcessRecord appointment = new AppointmentOrderProcessRecord();
appointment.setOperatePersonId(Objects.isNull(orderDetails.getNurseStationPersonId()) ? null : orderDetails.getNurseStationPersonId());
appointment.setAppointmentOrderId(Objects.isNull(orderDetails.getId()) ? null : orderDetails.getId());
appointment.setAppointmentOrderNo(StringUtils.isBlank(orderDetails.getOrderNo()) ? "" : orderDetails.getOrderNo());
appointment.setOperateTime(LocalDateTime.now());
appointment.setOperateType(OrderProcessOperateTypeEnum.FINISH_ORDER.getInfo());
appointment.setOperateDetails("预约订单任务完成操作");
appointment.setCreateTime(LocalDateTime.now());
int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointment);
if (count <= 0) {
throw new ServiceException("预约订单流程记录失败,请联系管理员!");
}
//更新护理员账户总金额
Long nurseStationPersonId = Objects.isNull(orderDetails.getNurseStationPersonId()) ? 0 : orderDetails.getNurseStationPersonId();
BigDecimal orderCommissionAmount = Objects.isNull(orderDetails.getOrderCommissionAmount()) ? BigDecimal.ZERO : orderDetails.getOrderCommissionAmount();

View File

@ -0,0 +1,45 @@
package com.xinelu.applet.vo.nurseapplogin;
import lombok.Data;
import java.io.Serializable;
/**
* 登录信息返回标识
*
* @author zhangheng
* @date 2022-10-12
*/
@Data
public class AppLoginVO implements Serializable {
private static final long serialVersionUID = 1820130502268738492L;
/**
* 返回提示信息
*/
private String message;
/**
* 登录标识标识
*/
private Boolean registerFlag;
/**
* 完善信息标识
*/
private Boolean loginFlag;
/**
* 用户id
*/
private Long patientId;
/**
* 用户姓名
*/
private String patientName;
/**
* 用户手机号
*/
private String phone;
}

View File

@ -153,4 +153,9 @@ public class PatientAndDiseaseVO implements Serializable {
*/
private String disablingReason;
/**
* 用户编号
*/
private String patientCode;
}

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.applet.mapper.newapp.NewAppLoginMapper">
<select id="login" resultType="int">
select
count(1)
from hospital_person_info
<where>
<if test="personAccount != null">
person_account = #{personAccount}
</if>
<if test="personPassword != null">
and person_password = #{personPassword}
</if>
</where>
</select>
</mapper>

View File

@ -23,6 +23,7 @@
<result property="birthDate" column="birth_date"/>
<result property="disablingCondition" column="disabling_condition"/>
<result property="disablingReason" column="disabling_reason"/>
<result property="patientCode" column="patient_code"/>
<collection property="patientDiseaseInfoList" javaType="java.util.List" resultMap="PatientDiseaseInfoResult"/>
</resultMap>
@ -79,6 +80,7 @@
pi.location_name,
pi.disabling_condition,
pi.disabling_reason,
pi.patient_code,
pdi.id patientDiseaseId,
pdi.disease_id,
pdi.disease_name,

View File

@ -9,7 +9,10 @@ import com.xinelu.common.custominterface.Update;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.hospitalinfo.HospitalInfo;
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
import com.xinelu.manage.service.hospitalinfo.IHospitalInfoService;
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
import com.xinelu.system.service.ISysRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
@ -39,6 +42,10 @@ import org.springframework.web.bind.annotation.RestController;
public class HospitalInfoController extends BaseController {
@Resource
private IHospitalInfoService hospitalInfoService;
@Resource
private IHospitalPersonInfoService hospitalPersonInfoService;
@Resource
private ISysRoleService roleService;
/**
* 查询医院信息管理列表
@ -56,9 +63,15 @@ public class HospitalInfoController extends BaseController {
* 查询医院信息管理列表
*/
@ApiOperation("查询医院信息管理列表")
@PreAuthorize("@ss.hasPermi('system:hospital:list')")
@GetMapping("/getList")
public AjaxResult getList(HospitalInfo hospitalInfo) {
// TODO 根据用户权限获取医院列表机构管理员只能看自己机构,超级管理员查看所有
if (!getLoginUser().getUser().isAdmin()) {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoService.selectHospitalPersonInfoById(getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) {
hospitalInfo.setId(hospitalPersonInfo.getHospitalId());
}
}
List<HospitalInfo> list = hospitalInfoService.selectHospitalInfoList(hospitalInfo);
return AjaxResult.success(list);
}

View File

@ -10,6 +10,7 @@ import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo;
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
import io.swagger.annotations.Api;
@ -108,6 +109,15 @@ public class HospitalPersonInfoController extends BaseController {
return hospitalPersonInfoService.updateHospitalPersonInfo(hospitalPersonInfo);
}
/**
* 修改健康咨询-科室人员信息
* @return
*/
@PostMapping("/update")
public AjaxResult update(@RequestBody HospitalPersonInfoDtoo hospitalPersonInfo) {
return AjaxResult.success(hospitalPersonInfoService.editHospitalPersonInfo(hospitalPersonInfo));
}
/**
* 删除健康咨询-科室人员信息
*/

View File

@ -3,7 +3,6 @@ package com.xinelu.manage.controller.screeningproject;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.R;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.uuid.IdUtils;
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
import com.xinelu.manage.domain.screeningproject.ScreeningProject;
@ -37,32 +36,44 @@ import org.springframework.web.bind.annotation.RestController;
public class ScreeningProjectController extends BaseController {
@Resource
private IScreeningProjectService projectService;
@Resource
private IHospitalPersonInfoService personInfoService;
@ApiOperation("服务项目分页列表")
@GetMapping("list")
public TableDataInfo list(ScreeningProject project) {
public TableDataInfo list(ScreeningProject project) throws Exception {
if (!getLoginUser().getUser().isAdmin()) {
HospitalPersonInfo personInfo = personInfoService.selectHospitalPersonInfoById(getLoginUser().getUser().getHospitalPersonId());
if (personInfo != null) {
project.setHospitalId(personInfo.getHospitalId());
} else {
throw new Exception("该账号未绑定医生账号");
}
}
startPage();
List<ScreeningProject> list = projectService.findList(project);
return getDataTable(list);
List<ScreeningProject> list = projectService.findList(project);
return getDataTable(list);
}
@ApiOperation("服务项目列表")
@GetMapping("getList")
public R<List<ScreeningProject>> getList(ScreeningProject project) {
List<ScreeningProject> list = projectService.findList(project);
return R.ok(list);
public R<List<ScreeningProject>> getList(ScreeningProject project) throws Exception {
// TODO 根据角色判断查看数据范围
if (!getLoginUser().getUser().isAdmin()) {
HospitalPersonInfo personInfo = personInfoService.selectHospitalPersonInfoById(getLoginUser().getUser().getHospitalPersonId());
if (personInfo != null) {
project.setHospitalId(personInfo.getHospitalId());
} else {
throw new Exception("该账号未绑定医生账号");
}
}
List<ScreeningProject> list = projectService.findList(project);
return R.ok(list);
}
@ApiOperation("新增服务项目")
@PostMapping("add")
public R<String> add(@RequestBody ScreeningProject project) {
// 根据当前登录用户获取医生主键
HospitalPersonInfo hospitalPersonInfo = personInfoService.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId());
project.setHospitalId(hospitalPersonInfo.getHospitalId());
project.setHospitalName(hospitalPersonInfo.getPersonName());
if (projectService.checkSameProjectName(project.getProjectName(), project.getHospitalId(), null)) {
return R.fail("" + project.getHospitalName() + "】已存在服务项目【" + project.getProjectName() + "】,不能重复添加");
}

View File

@ -7,9 +7,11 @@ import com.xinelu.common.core.domain.SelectVo;
import com.xinelu.common.core.domain.TimelineVo;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.utils.StringUtils;
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
import com.xinelu.manage.domain.screeningrecord.ScreeningRecord;
import com.xinelu.manage.dto.screeningrecord.ScreeningRecordDTO;
import com.xinelu.manage.dto.screeningrecord.ScreeningRecordSaveDTO;
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
import com.xinelu.manage.service.screeningrecord.IScreeningRecordService;
import com.xinelu.manage.vo.screeningrecord.ScreeningRecordVo;
import io.swagger.annotations.Api;
@ -40,9 +42,19 @@ public class ScreeningRecordController extends BaseController {
@Resource
private IScreeningRecordService screeningRecordService;
@Resource
private IHospitalPersonInfoService personInfoService;
@GetMapping("/screeningList")
@ApiOperation(value = "居民预约筛查列表")
public TableDataInfo screeningList(ScreeningRecordDTO query) {
public TableDataInfo screeningList(ScreeningRecordDTO query) throws Exception {
if (!getLoginUser().getUser().isAdmin()) {
HospitalPersonInfo personInfo = personInfoService.selectHospitalPersonInfoById(getLoginUser().getUser().getHospitalPersonId());
if (personInfo == null) {
throw new Exception("该账号未绑定医生账号");
}
query.setHospitalId(personInfo.getHospitalId());
}
startPage();
try {
return getDataTable(screeningRecordService.screeningList(query));

View File

@ -0,0 +1,144 @@
package com.xinelu.manage.dto.hospitalpersoninfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 健康咨询-科室人员信息对象 hospital_person_info
*
* @author xinyilu
* @date 2023-02-14
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "健康咨询-科室人员信息对象", description = "hospital_person_info")
public class HospitalPersonInfoDtoo extends BaseDomain implements Serializable {
private static final long serialVersionUID = 8750821883343940709L;
/**
* 主键id
*/
private Long id;
/**
* 所属医院id
*/
@ApiModelProperty(value = "所属医院id")
@Excel(name = "所属医院id")
private Long hospitalId;
/**
* 所属部门id
*/
@ApiModelProperty(value = "所属部门id")
@Excel(name = "所属部门id")
private Long departmentId;
/**
* 科室人员编码
*/
@ApiModelProperty(value = "科室人员编码")
@Excel(name = "科室人员编码")
private String personCode;
/**
* 科室人员名称
*/
@ApiModelProperty(value = "科室人员名称")
@Excel(name = "科室人员名称")
@Length(max = 50, message = "科室人员名称不能超过50位", groups = {Insert.class, Update.class})
private String personName;
/**
* 科室人员联系电话
*/
@ApiModelProperty(value = "科室人员联系电话")
@Excel(name = "科室人员联系电话")
private String personPhone;
/**
* 科室人员地址
*/
@ApiModelProperty(value = "科室人员地址")
@Excel(name = "科室人员地址")
@Length(max = 300, message = "科室人员地址不能超过300位", groups = {Insert.class, Update.class})
private String personAddress;
/**
* 身份证号
*/
@ApiModelProperty(value = "身份证号")
@Excel(name = "身份证号")
private String cardNo;
/**
* 人员职称主任医师CHIEF_PHYSICIAN副主任医师DEPUTY_CHIEF_PHYSICIAN主治医师ATTENDING_DOCTOR医师PHYSICIAN医士HEALER住院医师RESIDENT_PHYSICIAN
*/
@ApiModelProperty(value = "人员职称主任医师CHIEF_PHYSICIAN副主任医师DEPUTY_CHIEF_PHYSICIAN主治医师ATTENDING_DOCTOR医师PHYSICIAN医士HEALER住院医师RESIDENT_PHYSICIAN")
@Excel(name = "人员职称主任医师CHIEF_PHYSICIAN副主任医师DEPUTY_CHIEF_PHYSICIAN主治医师ATTENDING_DOCTOR医师PHYSICIAN医士HEALER住院医师RESIDENT_PHYSICIAN")
private String academicTitle;
/**
* 咨询费用
*/
@ApiModelProperty(value = "咨询费用")
@Excel(name = "咨询费用")
private BigDecimal consultingFee;
/**
* 个人简介
*/
@ApiModelProperty(value = "个人简介")
@Excel(name = "个人简介")
private String personIntroduce;
/**
* 显示顺序
*/
@ApiModelProperty(value = "显示顺序")
@Excel(name = "显示顺序")
private Integer personSort;
/**
* 科室人员头像地址
*/
private String personPictureUrl;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("hospitalId", getHospitalId())
.append("departmentId", getDepartmentId())
.append("personCode", getPersonCode())
.append("personName", getPersonName())
.append("personPhone", getPersonPhone())
.append("personAddress", getPersonAddress())
.append("cardNo", getCardNo())
.append("academicTitle", getAcademicTitle())
.append("consultingFee", getConsultingFee())
.append("personIntroduce", getPersonIntroduce())
.append("personSort", getPersonSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -1,72 +0,0 @@
package com.xinelu.manage.mapper.appointmentorderprocessrecord;
import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord;
import java.util.List;
/**
* 预约订单流程记录信息Mapper接口
*
* @author xinyilu
* @date 2023-03-29
*/
public interface AppointmentOrderProcessRecordMapper {
/**
* 查询预约订单流程记录信息
*
* @param id 预约订单流程记录信息主键
* @return 预约订单流程记录信息
*/
AppointmentOrderProcessRecord selectAppointmentOrderProcessRecordById(Long id);
/**
* 查询预约订单流程记录信息列表
*
* @param appointmentOrderProcessRecord 预约订单流程记录信息
* @return 预约订单流程记录信息集合
*/
List<AppointmentOrderProcessRecord> selectAppointmentOrderProcessRecordList(AppointmentOrderProcessRecord appointmentOrderProcessRecord);
/**
* 新增预约订单流程记录信息
*
* @param appointmentOrderProcessRecord 预约订单流程记录信息
* @return 结果
*/
int insertAppointmentOrderProcessRecord(AppointmentOrderProcessRecord appointmentOrderProcessRecord);
/**
* 修改预约订单流程记录信息
*
* @param appointmentOrderProcessRecord 预约订单流程记录信息
* @return 结果
*/
int updateAppointmentOrderProcessRecord(AppointmentOrderProcessRecord appointmentOrderProcessRecord);
/**
* 删除预约订单流程记录信息
*
* @param id 预约订单流程记录信息主键
* @return 结果
*/
int deleteAppointmentOrderProcessRecordById(Long id);
/**
* 批量删除预约订单流程记录信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteAppointmentOrderProcessRecordByIds(Long[] ids);
/**
* 批量新增预约订单流程记录信息
*
* @param appointmentOrderProcessRecordList 预约订单流程记录信息
* @return 结果
*/
int insertAppointmentOrderProcessRecordList(List<AppointmentOrderProcessRecord> appointmentOrderProcessRecordList);
}

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.mapper.hospitalpersoninfo;
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo;
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
import java.util.List;
import org.apache.ibatis.annotations.Param;
@ -53,6 +54,14 @@ public interface HospitalPersonInfoMapper {
*/
int updateHospitalPersonInfo(HospitalPersonInfo hospitalPersonInfo);
/**
* 修改健康咨询-科室人员信息
*
* @param hospitalPersonInfo 健康咨询-科室人员信息
* @return 结果
*/
int editHospitalPersonInfo(HospitalPersonInfoDtoo hospitalPersonInfo);
/**
* 删除健康咨询-科室人员信息
*

View File

@ -26,6 +26,6 @@ public interface ScreeningProjectMapper {
int updateByPrimaryKey(ScreeningProject record);
Integer checkSameName(@Param("projectName") String projectName, @Param("deptId") Long deptId, @Param("projectId") String projectId);
Integer checkSameName(@Param("projectName") String projectName, @Param("hospitalId") Long hospitalId, @Param("projectId") String projectId);
}

View File

@ -3,18 +3,15 @@ package com.xinelu.manage.service.appointmentorder.impl;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.AppointmentOrderTypeEnum;
import com.xinelu.common.enums.OrderProcessOperateTypeEnum;
import com.xinelu.common.enums.OrderStatusEnum;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.manage.domain.appointmentorder.AppointmentOrder;
import com.xinelu.manage.domain.appointmentorderconsumable.AppointmentOrderConsumable;
import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails;
import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord;
import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper;
import com.xinelu.manage.mapper.appointmentorderconsumable.AppointmentOrderConsumableMapper;
import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper;
import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper;
import com.xinelu.manage.service.appointmentorder.IAppointmentOrderService;
import com.xinelu.manage.service.stationmessagepush.StationMessagePushService;
import com.xinelu.manage.vo.appointmentorder.AppointmentOrderVO;
@ -47,8 +44,6 @@ public class AppointmentOrderServiceImpl implements IAppointmentOrderService {
private AppointmentOrderConsumableMapper appointmentOrderConsumableMapper;
@Resource
private StationMessagePushService stationMessagePushService;
@Resource
private AppointmentOrderProcessRecordMapper appointmentOrderProcessRecordMapper;
/**
* 查询预约订单信息
@ -183,19 +178,6 @@ public class AppointmentOrderServiceImpl implements IAppointmentOrderService {
if (updateAppointmentOrderStatus <= 0) {
throw new ServiceException("派单失败,请联系管理员!");
}
//记录订单流程信息
AppointmentOrderProcessRecord appointmentOrderProcessRecord = new AppointmentOrderProcessRecord();
appointmentOrderProcessRecord.setAppointmentOrderNo(appointmentOrder.getOrderNo());
appointmentOrderProcessRecord.setCreateTime(LocalDateTime.now());
appointmentOrderProcessRecord.setOperatePersonId(appointmentOrder.getNurseStationPersonId());
appointmentOrderProcessRecord.setOperateTime(LocalDateTime.now());
appointmentOrderProcessRecord.setOperateType(OrderProcessOperateTypeEnum.DISPATCH_ORDER.getInfo());
appointmentOrderProcessRecord.setAppointmentOrderId(appointmentOrders.getId());
appointmentOrderProcessRecord.setOperateDetails("派单");
int count = appointmentOrderProcessRecordMapper.insertAppointmentOrderProcessRecord(appointmentOrderProcessRecord);
if (count <= 0) {
throw new ServiceException("增加预约订单流程记录失败,请联系管理员!");
}
stationMessagePushService.waitReceiveMessagePush(appointmentOrder);
return AjaxResult.success();
}

View File

@ -3,6 +3,7 @@ package com.xinelu.manage.service.hospitalpersoninfo;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo;
import com.xinelu.manage.vo.hospitalpersoninfo.HospitalPersonInfoVO;
import java.util.List;
@ -69,4 +70,11 @@ public interface IHospitalPersonInfoService {
* @param pictureUrl 图片地址
**/
void deletePictureUrl(String pictureUrl);
/**
* 修改医生手机号和密码
* @param hospitalPersonInfo
* @return
*/
int editHospitalPersonInfo(HospitalPersonInfoDtoo hospitalPersonInfo);
}

View File

@ -11,6 +11,7 @@ import com.xinelu.common.utils.regex.RegexUtil;
import com.xinelu.manage.domain.hospitalpersoncertificate.HospitalPersonCertificate;
import com.xinelu.manage.domain.hospitalpersoninfo.HospitalPersonInfo;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDTO;
import com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo;
import com.xinelu.manage.mapper.hospitalpersoncertificate.HospitalPersonCertificateMapper;
import com.xinelu.manage.mapper.hospitalpersoninfo.HospitalPersonInfoMapper;
import com.xinelu.manage.service.hospitalpersoninfo.IHospitalPersonInfoService;
@ -196,10 +197,12 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
hospitalPersonCertificate.setUpdateBy(SecurityUtils.getUsername());
hospitalPersonCertificate.setCertificateCode(Constants.CERTIFICATE_CODE + generateSystemCodeUtil.generateSystemCode(Constants.CERTIFICATE_CODE));
}
int hospitalPersonCertificates = hospitalPersonCertificateMapper.insertHospitalPersonCertificateList(hospitalPersonInfo.getHospitalPersonCertificateList());
if (hospitalPersonCertificates <= 0) {
throw new ServiceException("修改科室人员资质证书信息失败,请联系管理员!");
}
if (CollectionUtils.isNotEmpty(hospitalPersonInfo.getHospitalPersonCertificateList())) {
int hospitalPersonCertificates = hospitalPersonCertificateMapper.insertHospitalPersonCertificateList(hospitalPersonInfo.getHospitalPersonCertificateList());
if (hospitalPersonCertificates <= 0) {
throw new ServiceException("修改科室人员资质证书信息失败,请联系管理员!");
}
}
//删除人员的头像
if (StringUtils.isNotBlank(personInfo.getPersonPictureUrl()) && StringUtils.isNotBlank(hospitalPersonInfo.getPersonPictureUrl()) && !personInfo.getPersonPictureUrl().equals(hospitalPersonInfo.getPersonPictureUrl())) {
this.deletePictureUrl(personInfo.getPersonPictureUrl());
@ -316,4 +319,14 @@ public class HospitalPersonInfoServiceImpl implements IHospitalPersonInfoService
}
}
}
/**
* 修改医生手机号和密码
* @param hospitalPersonInfo
* @return
*/
@Override
public int editHospitalPersonInfo(HospitalPersonInfoDtoo hospitalPersonInfo) {
return hospitalPersonInfoMapper.editHospitalPersonInfo(hospitalPersonInfo);
}
}

View File

@ -454,6 +454,18 @@ public class NurseStationServiceImpl implements INurseStationService {
case Constants.PERSON_CERTIFICATE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getPersonCertificateUrl();
break;
case Constants.PLATELET_PICTURE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getPlateletPitureUrl();
break;
case Constants.LEFT_EYE_PICTURE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getLeftEyePitureUrl();
break;
case Constants.RIGHT_EYE_PICTURE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getRightEyePitureUrl();
break;
case Constants.ALZHEIMER_FILE_URL:
uploadPathUrl = XinELuConfig.getProfile() + xinELuConfig.getAlzheimerFileUrl();
break;
default:
break;
}
@ -461,7 +473,13 @@ public class NurseStationServiceImpl implements INurseStationService {
return AjaxResult.success();
}
//上传
String pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
String pictureName = "";
if (StringUtils.isNotBlank(type) && StringUtils.equals(type, Constants.ALZHEIMER_FILE_URL)) {
pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.FILE_EXTENSION);
} else {
pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.IMAGE_EXTENSION);
}
if (StringUtils.isBlank(pictureName)) {
throw new ServiceException("图片上传失败,请联系管理员!");
}

View File

@ -21,11 +21,11 @@ public interface IScreeningProjectService {
/**
* 检验机构是否存在相同名称服务项目
* @param projectName 项目名称
* @param deptId 机构id
* @param hospitalId 机构id
* @param projectId 项目业务主键
* @return {@link boolean}
* @author gaoyu
* @date 2022-11-23 10:20
*/
boolean checkSameProjectName(String projectName, Long deptId, String projectId);
boolean checkSameProjectName(String projectName, Long hospitalId, String projectId);
}

View File

@ -32,12 +32,14 @@ public class ScreeningProjectServiceImpl implements IScreeningProjectService {
}
@Override public int insert(ScreeningProject project) {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) {
project.setHospitalId(hospitalPersonInfo.getHospitalId());
HospitalInfo hospital = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId());
if (hospital != null) {
project.setHospitalName(hospital.getHospitalName());
if (project.getHospitalId() == null) {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) {
project.setHospitalId(hospitalPersonInfo.getHospitalId());
HospitalInfo hospital = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId());
if (hospital != null) {
project.setHospitalName(hospital.getHospitalName());
}
}
}
return projectMapper.insertSelective(project);
@ -45,12 +47,14 @@ public class ScreeningProjectServiceImpl implements IScreeningProjectService {
@Override
public int update(ScreeningProject project) {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) {
project.setHospitalId(hospitalPersonInfo.getHospitalId());
HospitalInfo hospital = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId());
if (hospital != null) {
project.setHospitalName(hospital.getHospitalName());
if (project.getHospitalId() == null) {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) {
project.setHospitalId(hospitalPersonInfo.getHospitalId());
HospitalInfo hospital = hospitalInfoMapper.selectHospitalInfoById(hospitalPersonInfo.getHospitalId());
if (hospital != null) {
project.setHospitalName(hospital.getHospitalName());
}
}
}
return projectMapper.updateByPrimaryKey(project);
@ -60,7 +64,7 @@ public class ScreeningProjectServiceImpl implements IScreeningProjectService {
projectMapper.updateByPrimaryKeySelective(project);
}
@Override public boolean checkSameProjectName(String projectName, Long deptId, String projectId) {
return projectMapper.checkSameName(projectName, deptId, projectId) != null;
@Override public boolean checkSameProjectName(String projectName, Long hospitalId, String projectId) {
return projectMapper.checkSameName(projectName, hospitalId, projectId) != null;
}
}

View File

@ -61,12 +61,6 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
@Override
public List<ScreeningRecordVo> screeningList(ScreeningRecordDTO query) throws Exception {
HospitalPersonInfo hospitalPersonInfo = hospitalPersonInfoMapper.selectHospitalPersonInfoById(SecurityUtils.getLoginUser().getUser().getHospitalPersonId());
if (hospitalPersonInfo != null) {
query.setHospitalId(hospitalPersonInfo.getHospitalId());
} else {
throw new Exception("该账号未关联医生");
}
return screeningRecordMapper.screeningList(query);
}
@ -470,7 +464,7 @@ public class ScreeningRecordServiceImpl implements IScreeningRecordService {
String uploadPathUrl = XinELuConfig.getProfile() + url + "/";
String fileName = screeningId + ".jpg";
QrCodeUtils.createTxm(content, uploadPathUrl, fileName);
return uploadPathUrl + "/" + fileName;
return uploadPathUrl + fileName;
}
}

View File

@ -1,187 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper">
<resultMap type="AppointmentOrderProcessRecord" id="AppointmentOrderProcessRecordResult">
<result property="id" column="id"/>
<result property="operatePersonId" column="operate_person_id"/>
<result property="appointmentOrderId" column="appointment_order_id"/>
<result property="appointmentOrderNo" column="appointment_order_no"/>
<result property="operateTime" column="operate_time"/>
<result property="operateType" column="operate_type"/>
<result property="operateDetails" column="operate_details"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectAppointmentOrderProcessRecordVo">
select id,
operate_person_id,
appointment_order_id,
appointment_order_no,
operate_time,
operate_type,
operate_details,
create_by,
create_time,
update_by,
update_time
from appointment_order_process_record
</sql>
<select id="selectAppointmentOrderProcessRecordList" parameterType="AppointmentOrderProcessRecord"
resultMap="AppointmentOrderProcessRecordResult">
<include refid="selectAppointmentOrderProcessRecordVo"/>
<where>
<if test="operatePersonId != null ">
and operate_person_id = #{operatePersonId}
</if>
<if test="appointmentOrderId != null ">
and appointment_order_id = #{appointmentOrderId}
</if>
<if test="appointmentOrderNo != null and appointmentOrderNo != ''">
and appointment_order_no = #{appointmentOrderNo}
</if>
<if test="operateTime != null ">
and operate_time = #{operateTime}
</if>
<if test="operateType != null and operateType != ''">
and operate_type = #{operateType}
</if>
<if test="operateDetails != null and operateDetails != ''">
and operate_details = #{operateDetails}
</if>
</where>
</select>
<select id="selectAppointmentOrderProcessRecordById" parameterType="Long"
resultMap="AppointmentOrderProcessRecordResult">
<include refid="selectAppointmentOrderProcessRecordVo"/>
where id = #{id}
</select>
<insert id="insertAppointmentOrderProcessRecord" parameterType="AppointmentOrderProcessRecord"
useGeneratedKeys="true"
keyProperty="id">
insert into appointment_order_process_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="operatePersonId != null">operate_person_id,
</if>
<if test="appointmentOrderId != null">appointment_order_id,
</if>
<if test="appointmentOrderNo != null">appointment_order_no,
</if>
<if test="operateTime != null">operate_time,
</if>
<if test="operateType != null">operate_type,
</if>
<if test="operateDetails != null">operate_details,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="operatePersonId != null">#{operatePersonId},
</if>
<if test="appointmentOrderId != null">#{appointmentOrderId},
</if>
<if test="appointmentOrderNo != null">#{appointmentOrderNo},
</if>
<if test="operateTime != null">#{operateTime},
</if>
<if test="operateType != null">#{operateType},
</if>
<if test="operateDetails != null">#{operateDetails},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateAppointmentOrderProcessRecord" parameterType="AppointmentOrderProcessRecord">
update appointment_order_process_record
<trim prefix="SET" suffixOverrides=",">
<if test="operatePersonId != null">operate_person_id =
#{operatePersonId},
</if>
<if test="appointmentOrderId != null">appointment_order_id =
#{appointmentOrderId},
</if>
<if test="appointmentOrderNo != null">appointment_order_no =
#{appointmentOrderNo},
</if>
<if test="operateTime != null">operate_time =
#{operateTime},
</if>
<if test="operateType != null">operate_type =
#{operateType},
</if>
<if test="operateDetails != null">operate_details =
#{operateDetails},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteAppointmentOrderProcessRecordById" parameterType="Long">
delete
from appointment_order_process_record
where id = #{id}
</delete>
<delete id="deleteAppointmentOrderProcessRecordByIds" parameterType="String">
delete from appointment_order_process_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertAppointmentOrderProcessRecordList">
insert into appointment_order_process_record(
appointment_order_id,
appointment_order_no,
operate_time,
operate_type,
operate_details,
create_time
) values
<foreach item="appointmentOrderProcessRecordList" index="index" collection="list" separator=",">
(
#{appointmentOrderProcessRecordList.appointmentOrderId},
#{appointmentOrderProcessRecordList.appointmentOrderNo},
#{appointmentOrderProcessRecordList.operateTime},
#{appointmentOrderProcessRecordList.operateType},
#{appointmentOrderProcessRecordList.operateDetails},
#{appointmentOrderProcessRecordList.createTime}
)
</foreach>
</insert>
</mapper>

View File

@ -36,6 +36,9 @@
<select id="selectHospitalInfoList" parameterType="com.xinelu.manage.domain.hospitalinfo.HospitalInfo" resultMap="HospitalInfoResult">
<include refid="selectHospitalInfoVo"/>
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="hospitalName != null and hospitalName != ''">
and hospital_name like concat('%', #{hospitalName}, '%')
</if>

View File

@ -332,6 +332,57 @@
where id = #{id}
</update>
<update id="editHospitalPersonInfo" parameterType="com.xinelu.manage.dto.hospitalpersoninfo.HospitalPersonInfoDtoo">
update hospital_person_info
<trim prefix="SET" suffixOverrides=",">
<if test="hospitalId != null">hospital_id =
#{hospitalId},
</if>
<if test="departmentId != null">department_id =
#{departmentId},
</if>
<if test="personCode != null">person_code =
#{personCode},
</if>
<if test="personName != null">person_name =
#{personName},
</if>
person_phone = #{personPhone},
<if test="personAddress != null">person_address =
#{personAddress},
</if>
card_no = #{cardNo},
<if test="academicTitle != null">academic_title =
#{academicTitle},
</if>
<if test="consultingFee != null">consulting_fee =
#{consultingFee},
</if>
<if test="personIntroduce != null">person_introduce =
#{personIntroduce},
</if>
<if test="personSort != null">person_sort =
#{personSort},
</if>
<if test="personPictureUrl != null">person_picture_url =
#{personPictureUrl},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteHospitalPersonInfoById" parameterType="Long">
delete
from hospital_person_info

View File

@ -40,7 +40,7 @@
and project_name like concat( '%' ,#{projectName}, '%')
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId}
and (hospital_id = #{hospitalId} or hospital_id = 0)
</if>
<if test="projectType != null and projectType != ''">
and project_type = #{projectType}

View File

@ -174,10 +174,7 @@
and patient_name like concat(#{patientName}, '%')
</if>
<if test="identity != null and identity != ''">
and identity = #{identity}
</if>
<if test="address != null and address != ''">
and address like concat('%', #{address}, '%')
and `identity` = #{identity}
</if>
<if test="hospitalId != null and hospitalId != ''">
and hospital_id = #{hospitalId}
@ -214,8 +211,8 @@
</if>
</sql>
<select id="screeningList" resultType="com.xinelu.manage.vo.screeningrecord.ScreeningRecordVo">
select r.resident_name,r.gender,r.birthday,r.phone,r.`identity`
,r.manage_status,r.manage_time,d.screening_id,d.patient_id,d.project_id,d.project_name
select r.patient_name,r.sex as gender,r.birth_date as birthday,r.phone,r.card_no as `identity`
,d.screening_id,d.patient_id,d.project_id,d.project_name
,d.hospital_id,d.hospital_name,d.apply_start_time,d.apply_end_time,
d.diagnostic_result,d.attachment,d.attachment_two,
d.registration_date,d.registration_code, d.registration_barcode,d.screening_type,d.push_date,
@ -225,9 +222,9 @@
else '0' end as hasResult,
case when diagnostic_result is not null then '1'
else '0' end as hasDiagnose
from screening_record d left join patient_info r on d.patient_id = r.patient_id
from screening_record d left join patient_info r on d.patient_id = r.id
<where>
d.screening_status != '2' and r.del_flag = '0' and r.status = '0'
d.screening_status != '2' and r.del_flag = '0'
<if test="screeningStatus != null and screeningStatus != ''">
and d.screening_status = #{screeningStatus}
</if>
@ -235,7 +232,7 @@
and r.patient_name like concat(#{patientName}, '%')
</if>
<if test="identity != null and identity != ''">
and r.identity = #{identity}
and r.card_no = #{identity}
</if>
<if test="address != null and address != ''">
and r.address like concat('%', #{address}, '%')
@ -321,9 +318,8 @@
ssr.disease,ssr.hospital_id,IFNULL(ssr.hospital_name, '') as hospital_name,ssr.project_id, ssr.project_name,
ssr.apply_start_time,ssr.apply_end_time, ssr.screening_date,ssr.content,ssr.diagnostic_result,ssr.attachment,ssr.attachment_two,
ssr.doctor_id,IFNULL(ssr.doctor_name,'') as doctor_name,ssr.apply_barcode,ssr.registration_date,ssr.screening_type,ssr.push_date,ssr.assess_record_id,
ssr.remark,sf.suffix as fileType
ssr.remark,substring_index(ssr.attachment, '.', -1) as fileType
from screening_record ssr
LEFT JOIN sys_file sf ON sf.file_id=ssr.attachment
where 1=1
<include refid="where"></include>
order by screening_date desc