自助开单界面,登录修改
This commit is contained in:
parent
5505e1d0c2
commit
35cd338a6c
@ -21,6 +21,10 @@ public class SysLoginParam {
|
||||
* 登录的医疗机构
|
||||
*/
|
||||
private String loginYLJG;
|
||||
/**
|
||||
* 登录的医疗机构名称
|
||||
*/
|
||||
private String loginYLJGName;
|
||||
/**
|
||||
* 默认仪器
|
||||
*/
|
||||
|
||||
@ -9,5 +9,6 @@ import lombok.NoArgsConstructor;
|
||||
@NoArgsConstructor
|
||||
public class LoginParam {
|
||||
private String loginYLJG;
|
||||
private String loginYLJGName;
|
||||
private String localid;
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import com.transitPlatForm.common.core.domain.entity.reg.RegApply;
|
||||
|
||||
public interface RegApplyMapper {
|
||||
void insert(RegApply regApply);
|
||||
RegApply queryOne(RegApply regApply);
|
||||
RegApply queryOne(String applyid);
|
||||
void update(RegApply regApply);
|
||||
void delete(String applyid);
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ public class CommonUtil {
|
||||
*/
|
||||
public synchronized String getMaxNo(String seqid) {
|
||||
RegSeq seqOne = regSeqMapper.getSeqOne(seqid);
|
||||
if (seqOne != null) return "";
|
||||
if (seqOne == null) return "";
|
||||
long maxno = seqOne.getMaxno() + 1;
|
||||
seqOne.setMaxno(maxno);
|
||||
regSeqMapper.update(seqOne);
|
||||
|
||||
@ -3,49 +3,88 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.transitPlatForm.interfaceCommon.mapper.RegApplyMapper">
|
||||
<insert id="insert">
|
||||
insert into reg_apply(PatId, PatCardType, PatCardNo, PatType, RegNo, PatName, PatSex, PatAge, AgeUnit,
|
||||
PatAgeShow, PatBirthday, PatIdentity, Phone, Address, PatFeeType, DepartCode,
|
||||
DepartName, AreaCode, AreaName, PatBed, DiagnosisCode, DiagnosisName, ReciNumber,
|
||||
DoctorCode, DoctorName, OrderTime, ExecDeptCode, ExecDeptName, SrcHospCode, SrcHospName,
|
||||
Amount, ChargeState, PatInvoiceNum, UserCode, UserName, DataSource, applyid, Status)
|
||||
values (#{PatId},
|
||||
#{PatCardType},
|
||||
#{PatCardNo},
|
||||
#{PatType},
|
||||
#{RegNo},
|
||||
#{PatName},
|
||||
#{PatSex},
|
||||
#{PatAge},
|
||||
#{AgeUnit},
|
||||
#{PatAgeShow},
|
||||
#{PatBirthday},
|
||||
#{PatIdentity},
|
||||
#{Phone},
|
||||
#{Address},
|
||||
#{PatFeeType},
|
||||
#{DepartCode},
|
||||
#{DepartName},
|
||||
#{AreaCode},
|
||||
#{AreaName},
|
||||
#{PatBed},
|
||||
#{DiagnosisCode},
|
||||
#{DiagnosisName},
|
||||
#{ReciNumber},
|
||||
#{DoctorCode},
|
||||
#{DoctorName},
|
||||
#{OrderTime},
|
||||
#{ExecDeptCode},
|
||||
#{ExecDeptName},
|
||||
#{SrcHospCode},
|
||||
#{SrcHospName},
|
||||
#{Amount},
|
||||
#{ChargeState},
|
||||
#{PatInvoiceNum},
|
||||
#{UserCode},
|
||||
#{UserName},
|
||||
#{DataSource},
|
||||
#{applyid},
|
||||
#{Status})
|
||||
insert into reg_apply(
|
||||
<if test="PatId != null and PatId !=''">PatId,</if>
|
||||
<if test="PatCardType != null and PatCardType !=''">PatCardType,</if>
|
||||
<if test="PatCardNo != null and PatCardNo !=''">PatCardNo,</if>
|
||||
<if test="PatType != null and PatType !=''">PatType,</if>
|
||||
<if test="RegNo != null and RegNo !=''">RegNo,</if>
|
||||
<if test="PatName != null and PatName !=''">PatName,</if>
|
||||
<if test="PatSex != null and PatSex !=''">PatSex,</if>
|
||||
<if test="PatAge != null and PatAge !=''">PatAge,</if>
|
||||
<if test="AgeUnit != null and AgeUnit !=''">AgeUnit,</if>
|
||||
<if test="PatAgeShow != null and PatAgeShow !=''">PatAgeShow,</if>
|
||||
<if test="PatBirthday != null">PatBirthday,</if>
|
||||
<if test="PatIdentity != null and PatIdentity !=''">PatIdentity,</if>
|
||||
<if test="Phone != null and Phone !=''">Phone,</if>
|
||||
<if test="Address != null and Address !=''">Address,</if>
|
||||
<if test="PatFeeType != null and PatFeeType !=''">PatFeeType,</if>
|
||||
<if test="DepartCode != null and DepartCode !=''">DepartCode,</if>
|
||||
<if test="DepartName != null and DepartName !=''">DepartName,</if>
|
||||
<if test="AreaCode != null and AreaCode !=''">AreaCode,</if>
|
||||
<if test="AreaName != null and AreaName !=''">AreaName,</if>
|
||||
<if test="PatBed != null and PatBed !=''">PatBed,</if>
|
||||
<if test="DiagnosisCode != null and DiagnosisCode !=''">DiagnosisCode,</if>
|
||||
<if test="DiagnosisName != null and DiagnosisName !=''">DiagnosisName,</if>
|
||||
<if test="ReciNumber != null and ReciNumber !=''">ReciNumber,</if>
|
||||
<if test="DoctorCode != null and DoctorCode !=''">DoctorCode,</if>
|
||||
<if test="DoctorName != null and DoctorName !=''">DoctorName,</if>
|
||||
<if test="OrderTime != null">OrderTime,</if>
|
||||
<if test="ExecDeptCode != null and ExecDeptCode !=''">ExecDeptCode,</if>
|
||||
<if test="ExecDeptName != null and ExecDeptName !=''">ExecDeptName,</if>
|
||||
<if test="SrcHospCode != null and SrcHospCode !=''">SrcHospCode,</if>
|
||||
<if test="SrcHospName != null and SrcHospName !=''">SrcHospName,</if>
|
||||
<if test="Amount != null">Amount,</if>
|
||||
<if test="ChargeState != null and ChargeState !=''">ChargeState,</if>
|
||||
<if test="PatInvoiceNum != null and PatInvoiceNum !=''">PatInvoiceNum,</if>
|
||||
<if test="UserCode != null and UserCode !=''">UserCode,</if>
|
||||
<if test="UserName != null and UserName !=''">UserName,</if>
|
||||
<if test="DataSource != null and DataSource !=''">DataSource,</if>
|
||||
<if test="applyid != null and applyid !=''">applyid,</if>
|
||||
<if test="Status != null and Status !=''">Status,</if>
|
||||
create_by,create_time
|
||||
)
|
||||
values (
|
||||
<if test="PatId != null and PatId != ''">#{PatId},</if>
|
||||
<if test="PatCardType != null and PatCardType !=''">#{PatCardType},</if>
|
||||
<if test="PatCardNo != null and PatCardNo !=''">#{PatCardNo},</if>
|
||||
<if test="PatType != null and PatType !=''">#{PatType},</if>
|
||||
<if test="RegNo != null and RegNo !=''">#{RegNo},</if>
|
||||
<if test="PatName != null and PatName !=''">#{PatName},</if>
|
||||
<if test="PatSex != null and PatSex !=''">#{PatSex},</if>
|
||||
<if test="PatAge != null and PatAge !=''">#{PatAge},</if>
|
||||
<if test="AgeUnit != null and AgeUnit !=''">#{AgeUnit},</if>
|
||||
<if test="PatAgeShow != null and PatAgeShow !=''">#{PatAgeShow},</if>
|
||||
<if test="PatBirthday != null">#{PatBirthday},</if>
|
||||
<if test="PatIdentity != null and PatIdentity !=''">#{PatIdentity},</if>
|
||||
<if test="Phone != null and Phone !=''">#{Phone},</if>
|
||||
<if test="Address != null and Address !=''">#{Address},</if>
|
||||
<if test="PatFeeType != null and PatFeeType !=''">#{PatFeeType},</if>
|
||||
<if test="DepartCode != null and DepartCode !=''">#{DepartCode},</if>
|
||||
<if test="DepartName != null and DepartName !=''">#{DepartName},</if>
|
||||
<if test="AreaCode != null and AreaCode !=''">#{AreaCode},</if>
|
||||
<if test="AreaName != null and AreaName !=''">#{AreaName},</if>
|
||||
<if test="PatBed != null and PatBed !=''">#{PatBed},</if>
|
||||
<if test="DiagnosisCode != null and DiagnosisCode !=''">#{DiagnosisCode},</if>
|
||||
<if test="DiagnosisName != null and DiagnosisName !=''">#{DiagnosisName},</if>
|
||||
<if test="ReciNumber != null and ReciNumber !=''">#{ReciNumber},</if>
|
||||
<if test="DoctorCode != null and DoctorCode !=''">#{DoctorCode},</if>
|
||||
<if test="DoctorName != null and DoctorName !=''">#{DoctorName},</if>
|
||||
<if test="OrderTime != null">#{OrderTime},</if>
|
||||
<if test="ExecDeptCode != null and ExecDeptCode !=''">#{ExecDeptCode},</if>
|
||||
<if test="ExecDeptName != null and ExecDeptName !=''">#{ExecDeptName},</if>
|
||||
<if test="SrcHospCode != null and SrcHospCode !=''">#{SrcHospCode},</if>
|
||||
<if test="SrcHospName != null and SrcHospName !=''">#{SrcHospName},</if>
|
||||
<if test="Amount != null">#{Amount},</if>
|
||||
<if test="ChargeState != null and ChargeState !=''">#{ChargeState},</if>
|
||||
<if test="PatInvoiceNum != null and PatInvoiceNum !=''">#{PatInvoiceNum},</if>
|
||||
<if test="UserCode != null and UserCode !=''">#{UserCode},</if>
|
||||
<if test="UserName != null and UserName !=''">#{UserName},</if>
|
||||
<if test="DataSource != null and DataSource !=''">#{DataSource},</if>
|
||||
<if test="applyid != null and applyid !=''">#{applyid},</if>
|
||||
<if test="Status != null and Status !=''">#{Status},</if>
|
||||
#{create_by},#{create_time}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="queryOne" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApply">
|
||||
@ -88,7 +127,6 @@
|
||||
<if test="ExecDeptName != null and ExecDeptName != ''">ExecDeptName = #{ExecDeptName},</if>
|
||||
<if test="SrcHospCode != null and SrcHospCode != ''">SrcHospCode = #{SrcHospCode},</if>
|
||||
<if test="SrcHospName != null and SrcHospName != ''">SrcHospName = #{SrcHospName},</if>
|
||||
<if test="SrcHospName != null and SrcHospName != ''">SrcHospName = #{SrcHospName},</if>
|
||||
<if test="Amount != null">Amount = #{Amount},</if>
|
||||
<if test="ChargeState != null and ChargeState != ''">ChargeState = #{ChargeState},</if>
|
||||
<if test="PatInvoiceNum != null and PatInvoiceNum != ''">PatInvoiceNum = #{PatInvoiceNum},</if>
|
||||
|
||||
@ -10,8 +10,10 @@ import com.transitPlatForm.common.core.domain.entity.SysLoginParam;
|
||||
import com.transitPlatForm.common.core.domain.entity.SysUser;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegHospital;
|
||||
import com.transitPlatForm.common.core.domain.model.LoginBody;
|
||||
import com.transitPlatForm.common.core.domain.model.LoginParam;
|
||||
import com.transitPlatForm.common.core.domain.model.LoginUser;
|
||||
import com.transitPlatForm.common.core.redis.RedisCache;
|
||||
import com.transitPlatForm.common.exception.GlobalException;
|
||||
import com.transitPlatForm.common.exception.ServiceException;
|
||||
import com.transitPlatForm.common.exception.user.*;
|
||||
import com.transitPlatForm.common.utils.DateUtils;
|
||||
@ -68,13 +70,13 @@ public class SysLoginService {
|
||||
@Autowired
|
||||
RegHospitalMapper regHospitalMapper;
|
||||
|
||||
public Map<String, Object> getLocalconfig(String smac,String ip){
|
||||
String configvalue=commonUtil.getLocalconfig(smac);
|
||||
if(configvalue==null&&!"127.0.0.1".equals(ip)&&ip!=null) {
|
||||
configvalue=commonUtil.getLocalconfigByIP(ip);
|
||||
public Map<String, Object> getLocalconfig(String smac, String ip) {
|
||||
String configvalue = commonUtil.getLocalconfig(smac);
|
||||
if (configvalue == null && !"127.0.0.1".equals(ip) && ip != null) {
|
||||
configvalue = commonUtil.getLocalconfigByIP(ip);
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if(configvalue!=null) {
|
||||
if (configvalue != null) {
|
||||
map = JSON.parseObject(configvalue, Map.class);
|
||||
// if(map!=null) {
|
||||
// String yq=map.get("defaultinstr").toString();
|
||||
@ -86,29 +88,33 @@ public class SysLoginService {
|
||||
}
|
||||
return map;
|
||||
}
|
||||
public Map<String,String> getOEM(){
|
||||
Map<String,String> oem=new HashMap<>();
|
||||
oem.put("compay",ruoyiConfig.getCompay());
|
||||
oem.put("version",ruoyiConfig.getVersion());
|
||||
oem.put("phone",ruoyiConfig.getPhone());
|
||||
oem.put("Email",ruoyiConfig.getEmail());
|
||||
oem.put("appname",ruoyiConfig.getName());
|
||||
oem.put("copyrightyear",ruoyiConfig.getCopyrightYear());
|
||||
|
||||
public Map<String, String> getOEM() {
|
||||
Map<String, String> oem = new HashMap<>();
|
||||
oem.put("compay", ruoyiConfig.getCompay());
|
||||
oem.put("version", ruoyiConfig.getVersion());
|
||||
oem.put("phone", ruoyiConfig.getPhone());
|
||||
oem.put("Email", ruoyiConfig.getEmail());
|
||||
oem.put("appname", ruoyiConfig.getName());
|
||||
oem.put("copyrightyear", ruoyiConfig.getCopyrightYear());
|
||||
return oem;
|
||||
}
|
||||
public Object gethospList(){
|
||||
|
||||
public Object gethospList() {
|
||||
List<RegHospital> regHospitalList = regHospitalMapper.selectHospitalAll();
|
||||
List<Map<String, Object>> comDictlist0 = new ArrayList<>();
|
||||
for (RegHospital regHospital : regHospitalList) {
|
||||
Map<String, Object> map= new HashMap<>();
|
||||
map.put("id",regHospital.getHospitalId());
|
||||
map.put("name",regHospital.getHospitalName());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("id", regHospital.getHospitalId());
|
||||
map.put("name", regHospital.getHospitalName());
|
||||
comDictlist0.add(map);
|
||||
}
|
||||
return comDictlist0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录验证
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
public String login(LoginBody loginBody) {
|
||||
@ -117,20 +123,24 @@ public class SysLoginService {
|
||||
String code = "";
|
||||
String uuid = "";
|
||||
String loginYLJG = "";
|
||||
String loginYLJGName = "";
|
||||
String localid = "";
|
||||
try{
|
||||
LoginParam loginParam = null;
|
||||
try {
|
||||
code = loginBody.getCode();
|
||||
uuid = loginBody.getUuid();
|
||||
loginParam = loginBody.getLoginParam();
|
||||
loginYLJG = loginBody.getLoginParam().getLoginYLJG(); //登录的医疗机构
|
||||
localid=loginBody.getLoginParam().getLocalid();
|
||||
}catch (Exception e){
|
||||
loginYLJGName = loginBody.getLoginParam().getLoginYLJGName(); //登录的医疗机构名称
|
||||
localid = loginBody.getLoginParam().getLocalid();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("获取登录信息失败:",e);
|
||||
log.error("获取登录信息失败:", e);
|
||||
}
|
||||
// 验证码校验
|
||||
validateCaptcha(username, code, uuid);
|
||||
// 登录前置校验
|
||||
loginPreCheck(username, password);
|
||||
loginPreCheck(username, password,loginParam);
|
||||
// 用户验证
|
||||
Authentication authentication = null;
|
||||
try {
|
||||
@ -152,10 +162,11 @@ public class SysLoginService {
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||
recordLoginInfo(loginUser.getUserId());
|
||||
//设置登录的参数到缓存
|
||||
//设置登录的参数到缓存
|
||||
SysLoginParam sysLoginParam = new SysLoginParam();
|
||||
sysLoginParam.setLoginYLJG(loginYLJG);
|
||||
sysLoginParam.setLocalid(localid);
|
||||
sysLoginParam.setLoginYLJGName(loginYLJGName);
|
||||
// Map<String, Object> map=getLocalconfig(localid,IpUtils.getIpAddr());
|
||||
// if(map!=null) {
|
||||
// Object value =map.get("defaultinstr");
|
||||
@ -200,7 +211,7 @@ public class SysLoginService {
|
||||
* @param username 用户名
|
||||
* @param password 用户密码
|
||||
*/
|
||||
public void loginPreCheck(String username, String password) {
|
||||
public void loginPreCheck(String username, String password,LoginParam loginParam) {
|
||||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
|
||||
@ -224,6 +235,16 @@ public class SysLoginService {
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("login.blocked")));
|
||||
throw new BlackListException();
|
||||
}
|
||||
|
||||
//判断用户名是否在登录的医疗机构中
|
||||
SysUser sysUser = userService.selectUserByUserName(username);
|
||||
if (sysUser == null) throw new UserNotExistsException();
|
||||
//管理员不判断
|
||||
if (!username.equals("admin")){
|
||||
if(!sysUser.getYljg().equals(loginParam.getLoginYLJG())) throw new GlobalException("医疗机构代码:"+loginParam.getLoginYLJG()+"不存在该用户!"+username+","+sysUser.getNickName());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -249,17 +270,17 @@ public class SysLoginService {
|
||||
* @return 结果
|
||||
*/
|
||||
public String loginAnonymous(String username, String password, String code, String uuid) {
|
||||
if(username == null || username.equals("")) throw new UserNotExistsException();
|
||||
if (username == null || username.equals("")) throw new UserNotExistsException();
|
||||
LoginUser loginUser = new LoginUser();
|
||||
int random = new Random().nextInt(1000);
|
||||
loginUser.setUserId((long) (random+8000)); //先用随机数代替
|
||||
loginUser.setUserId((long) (random + 8000)); //先用随机数代替
|
||||
SysUser sysUser = userMapper.selectUserByUserName(username);
|
||||
if (sysUser == null) {
|
||||
sysUser = new SysUser();
|
||||
long userId = 0L;
|
||||
try{
|
||||
try {
|
||||
userId = Long.parseLong(username);
|
||||
}catch (Exception e){
|
||||
} catch (Exception e) {
|
||||
userId = random;
|
||||
}
|
||||
sysUser.setUserId(userId);
|
||||
|
||||
@ -54,7 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
u.vshisuser, u.vshisuser1, u.vshisuser2, u.yljg, u.sn, u.snid, u.signCert,
|
||||
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
|
||||
from sys_user u
|
||||
|
||||
@ -46,6 +46,11 @@ public class RegRequestInfoController extends BaseController {
|
||||
@ApiOperation("保存申请单信息")
|
||||
@PostMapping("/saveReqInfo")
|
||||
public Result saveReqInfo(@RequestBody ReqApplyInfoDTO reqApplyInfoDTO){
|
||||
//设置操作员和登录机构
|
||||
reqApplyInfoDTO.getRegApply().setUserCode(getUsername());
|
||||
reqApplyInfoDTO.getRegApply().setUserName(getLoginUser().getUser().getNickName());
|
||||
reqApplyInfoDTO.getRegApply().setSrcHospCode(getLoginUser().getSysLoginParam().getLoginYLJG());
|
||||
reqApplyInfoDTO.getRegApply().setSrcHospName(getLoginUser().getSysLoginParam().getLoginYLJGName());
|
||||
return regRequestInfoService.saveReqInfo(reqApplyInfoDTO);
|
||||
}
|
||||
|
||||
|
||||
@ -2,8 +2,9 @@ package com.transitPlatForm.transitPF.mapper;
|
||||
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegApply;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegApplyDetail;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegItem;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -14,4 +15,6 @@ public interface RegRequestInfoMapper {
|
||||
List<RegApplyDetail> queryReqDetail(String applyId);
|
||||
|
||||
List<Map<String,Object>> getItemInfo();
|
||||
|
||||
List<RegTransitSampleDetail> existSQD(@Param("applyId") String applyId, @Param("applyDetailId") String applyDetailId);
|
||||
}
|
||||
|
||||
@ -2,15 +2,13 @@ package com.transitPlatForm.transitPF.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.transitPlatForm.common.core.domain.Result;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegApply;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegApplyDetail;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSample;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail;
|
||||
import com.transitPlatForm.common.core.domain.entity.reg.*;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.CommonMapper;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.RegApplyDetailMapper;
|
||||
import com.transitPlatForm.interfaceCommon.mapper.RegApplyMapper;
|
||||
import com.transitPlatForm.interfaceCommon.utils.CommonUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.LisUtil;
|
||||
import com.transitPlatForm.interfaceCommon.utils.LoginConfigParamUtil;
|
||||
import com.transitPlatForm.transitPF.mapper.RegRequestInfoMapper;
|
||||
import com.transitPlatForm.transitPF.mapper.RegTransitSampleMapper;
|
||||
import com.transitPlatForm.transitPF.pojo.DTO.RegRequestInfoDTO;
|
||||
@ -86,31 +84,31 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
String status = regApply.getStatus();
|
||||
if(status == null) status = "";
|
||||
//修改数据
|
||||
if(status.equals("")){
|
||||
if(!status.equals("")){
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).updateApply(regApply,regApplyDetailList);
|
||||
}else{
|
||||
//申请单号
|
||||
String applyId = "PT"+regApply.getSrcHospCode()+DateUtil.format(commonUtil.getCurrentTime(),"yyyyMMdd")+commonUtil.getNextSeq_pro("applyno",4);
|
||||
regApply.setApplyid(applyId);
|
||||
regApply.setStatus("1");
|
||||
regApply.setCreate_by(regApply.getUserCode());
|
||||
regApply.setCreate_time(commonUtil.getCurrentTime());
|
||||
regApply.setOrderTime(commonUtil.getCurrentTime());
|
||||
|
||||
//病人生日
|
||||
Date birthDayFromAge = LisUtil.getBirthDayFromAge(Integer.parseInt(regApply.getPatAge()), regApply.getAgeUnit());
|
||||
regApply.setPatBirthday(birthDayFromAge);
|
||||
|
||||
for (RegApplyDetail regApplyDetail : regApplyDetailList) {
|
||||
regApplyDetail.setApplyid(applyId);
|
||||
}
|
||||
|
||||
//保存申请单信息
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).saveReqInfo(regApply,regApplyDetailList);
|
||||
}
|
||||
|
||||
//申请单号
|
||||
String applyId = "PT"+regApply.getSrcHospCode()+DateUtil.format(commonUtil.getCurrentTime(),"yyyyMMdd")+commonUtil.getNextSeq_pro("applyno",4);
|
||||
regApply.setApplyid(applyId);
|
||||
regApply.setStatus("1");
|
||||
regApply.setCreate_by(regApply.getUserCode());
|
||||
regApply.setCreate_time(commonUtil.getCurrentTime());
|
||||
|
||||
|
||||
for (RegApplyDetail regApplyDetail : regApplyDetailList) {
|
||||
regApplyDetail.setApplyid(applyId);
|
||||
}
|
||||
|
||||
//保存申请单信息
|
||||
applicationContext.getBean(RegRequestInfoServiceImpl.class).saveReqInfo(regApply,regApplyDetailList);
|
||||
|
||||
//生成条码信息
|
||||
regApply = regApplyMapper.queryOne(regApply);
|
||||
RegApplyDetail regApplyDetail = new RegApplyDetail();
|
||||
regApplyDetail.setApplyid(regApply.getApplyid());
|
||||
regApplyDetailList = regApplyDetailMapper.queryList(regApplyDetail);
|
||||
Result result = createBarcode(regApply, regApplyDetailList);
|
||||
Result result = createBarcode(regApply.getApplyid());
|
||||
if(!result.getCode().equals("0")) return result;
|
||||
|
||||
return new Result("0","保存成功!");
|
||||
@ -125,21 +123,36 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
}
|
||||
|
||||
|
||||
public Result createBarcode(RegApply regApply,List<RegApplyDetail> regApplyDetailList){
|
||||
/**
|
||||
* 产生条码信息
|
||||
* @param applyId
|
||||
* @return
|
||||
*/
|
||||
public Result createBarcode(String applyId){
|
||||
String ls_nopriceitems = "";
|
||||
|
||||
RegApply regApply = regApplyMapper.queryOne(applyId);
|
||||
if(regApply == null) return new Result("0","没有找到申请单信息!");
|
||||
RegApplyDetail regApplyDetail1 = new RegApplyDetail();
|
||||
regApplyDetail1.setApplyid(applyId);
|
||||
List<RegApplyDetail> regApplyDetailList = regApplyDetailMapper.queryList(regApplyDetail1);
|
||||
if(regApplyDetailList.size() <= 0) return new Result("0","没有找到申请单明细信息!");
|
||||
|
||||
List<RegTransitSample> regTransitSampleList = new ArrayList<>();
|
||||
List<RegTransitSampleDetail> regTransitSampleDetailList = new ArrayList<>();
|
||||
List<Map<String,Object>> reqSqdInfoList = new ArrayList<>();
|
||||
|
||||
|
||||
|
||||
//获取项目的对照信息列表
|
||||
List<Map<String, Object>> feeClassList = commonMapper.getFeeClassList();
|
||||
for (RegApplyDetail regApplyDetail : regApplyDetailList) {
|
||||
|
||||
String orderItemCode = regApplyDetail.getOrderItemCode();
|
||||
String orderItemName = regApplyDetail.getOrderItemName();
|
||||
|
||||
//判断申请单是否已经产生条码
|
||||
List<RegTransitSampleDetail> regItemList = regRequestInfoMapper.existSQD(regApplyDetail.getApplyid(), String.valueOf(regApplyDetail.getUid()));
|
||||
if(regItemList.size() > 0) continue;
|
||||
|
||||
//判断是否对照
|
||||
Map<String, Object> feeClass = commonUtil.getFeeClass(feeClassList,orderItemCode);
|
||||
if(feeClass.size() <= 0) {
|
||||
@ -149,7 +162,6 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
|
||||
String itemClass = LisUtil.isBank(feeClass.get("itemclass"));
|
||||
|
||||
|
||||
Map<String,Object> reqSqdInfo = new HashMap<>();
|
||||
reqSqdInfo.put("sample_PatId",regApply.getPatId());
|
||||
reqSqdInfo.put("sample_PatCardType",regApply.getPatCardType());
|
||||
@ -175,7 +187,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
reqSqdInfo.put("sample_DiagnosisName",regApply.getDiagnosisName());
|
||||
reqSqdInfo.put("sample_OrderUserCode",regApply.getDoctorCode());
|
||||
reqSqdInfo.put("sample_OrderUserName",regApply.getDoctorName());
|
||||
reqSqdInfo.put("sample_OrderTime",regApply.getOrderTime());
|
||||
reqSqdInfo.put("sample_OrderTime",DateUtil.format(regApply.getOrderTime(),"yyyy-MM-dd HH:mm:ss"));
|
||||
reqSqdInfo.put("sample_SrcHospCode",regApply.getSrcHospCode());
|
||||
reqSqdInfo.put("sample_SrcHospName",regApply.getSrcHospName());
|
||||
reqSqdInfo.put("sample_SampleTypeCode",regApplyDetail.getSampleTypeCode());
|
||||
@ -223,7 +235,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
stringObjectMap.put("detail_OrderItemSerial", xh);
|
||||
jymd = LisUtil.isBank(stringObjectMap.get("detail_OrderItemName"));
|
||||
regTransitSample.setCheckPUR(jymd);
|
||||
regTransitSampleList.add(k, regTransitSample);
|
||||
regTransitSampleList.set(k, regTransitSample);
|
||||
|
||||
//写条码明细表
|
||||
regTransitSampleDetail.setBarcode(barcode);
|
||||
@ -232,7 +244,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
regTransitSampleDetail.setOrderItemName(LisUtil.isBank(stringObjectMap.get("detail_OrderItemName")));
|
||||
regTransitSampleDetail.setCost(new BigDecimal(stringObjectMap.get("detail_cost").toString()));
|
||||
regTransitSampleDetail.setApplyid(LisUtil.isBank(stringObjectMap.get("detail_applyid")));
|
||||
regTransitSampleDetail.setApplyDetailId(String.valueOf(xh));
|
||||
regTransitSampleDetail.setApplyDetailId(LisUtil.isBank(stringObjectMap.get("detail_applyDetailId")));
|
||||
regTransitSampleDetailList.add(regTransitSampleDetail);
|
||||
continue;
|
||||
} else {
|
||||
@ -252,7 +264,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
regTransitSampleDetail.setOrderItemName(LisUtil.isBank(stringObjectMap.get("detail_OrderItemName")));
|
||||
regTransitSampleDetail.setCost(new BigDecimal(stringObjectMap.get("detail_cost").toString()));
|
||||
regTransitSampleDetail.setApplyid(LisUtil.isBank(stringObjectMap.get("detail_applyid")));
|
||||
regTransitSampleDetail.setApplyDetailId(String.valueOf(xh));
|
||||
regTransitSampleDetail.setApplyDetailId(LisUtil.isBank(stringObjectMap.get("detail_applyDetailId")));
|
||||
regTransitSampleDetailList.add(regTransitSampleDetail);
|
||||
|
||||
jymd = stringObjectMap.get("detail_OrderItemName").toString();
|
||||
@ -270,7 +282,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
regTransitSample.setPatAge(LisUtil.isBank(stringObjectMap.get("sample_PatAge")));
|
||||
regTransitSample.setAgeUnit(LisUtil.isBank(stringObjectMap.get("sample_AgeUnit")));
|
||||
regTransitSample.setPatAgeShow(LisUtil.isBank(stringObjectMap.get("sample_PatAgeShow")));
|
||||
regTransitSample.setPatBirthday(DateUtil.parse(LisUtil.isBank(stringObjectMap.get("sample_PatBirthday")), "yyyy-MM-dd HH:mm:ss"));
|
||||
regTransitSample.setPatBirthday(DateUtil.parse(LisUtil.isBank(stringObjectMap.get("sample_PatBirthday")), "yyyy-MM-dd"));
|
||||
regTransitSample.setPatIdentity(LisUtil.isBank(stringObjectMap.get("sample_PatIdentity")));
|
||||
regTransitSample.setPhone(LisUtil.isBank(stringObjectMap.get("sample_Phone")));
|
||||
regTransitSample.setAddress(LisUtil.isBank(stringObjectMap.get("sample_Address")));
|
||||
@ -295,7 +307,7 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
|
||||
regTransitSample.setCheckPUR(jymd);
|
||||
regTransitSample.setCreate_by(LisUtil.isBank(stringObjectMap.get("sample_UserCode")));
|
||||
regTransitSample.setCreate_time(commonUtil.getCurrentTime());
|
||||
regTransitSampleList.add(regTransitSample);
|
||||
regTransitSampleList.add(k,regTransitSample);
|
||||
}
|
||||
|
||||
//保存数据
|
||||
|
||||
@ -15,7 +15,11 @@
|
||||
</select>
|
||||
|
||||
<select id="getItemInfo" resultType="map">
|
||||
select b.classid, a.* from reg_item a,reg_itemclass b where a.itemclass = b.itemclass_code and a.status = '0'
|
||||
select b.classid,(case when isnull(a.yblx,'') = '' then b.itemclass_yblx else a.yblx end) as itemclass_yblx, a.* from reg_item a,reg_itemclass b where a.itemclass = b.itemclass_code and a.status = '0'
|
||||
</select>
|
||||
|
||||
<select id="existSQD" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegTransitSampleDetail">
|
||||
select * from reg_TransitSample_detail where applyid = #{applyId} and applyDetailId = #{applyDetailId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -43,7 +43,7 @@
|
||||
<if test="PatAge != null and PatAge != ''">PatAge,</if>
|
||||
<if test="AgeUnit != null and AgeUnit != ''">AgeUnit,</if>
|
||||
<if test="PatAgeShow != null and PatAgeShow != ''">PatAgeShow,</if>
|
||||
<if test="PatBirthday != null and PatBirthday != ''">PatBirthday,</if>
|
||||
<if test="PatBirthday != null">PatBirthday,</if>
|
||||
<if test="PatIdentity != null and PatIdentity != ''">PatIdentity,</if>
|
||||
<if test="Phone != null and Phone != ''">Phone,</if>
|
||||
<if test="Address != null and Address != ''">Address,</if>
|
||||
@ -99,7 +99,7 @@
|
||||
<if test="PatAge != null and PatAge != ''">#{PatAge},</if>
|
||||
<if test="AgeUnit != null and AgeUnit != ''">#{AgeUnit},</if>
|
||||
<if test="PatAgeShow != null and PatAgeShow != ''">#{PatAgeShow},</if>
|
||||
<if test="PatBirthday != null and PatBirthday != ''">#{PatBirthday},</if>
|
||||
<if test="PatBirthday != null">#{PatBirthday},</if>
|
||||
<if test="PatIdentity != null and PatIdentity != ''">#{PatIdentity},</if>
|
||||
<if test="Phone != null and Phone != ''">#{Phone},</if>
|
||||
<if test="Address != null and Address != ''">#{Address},</if>
|
||||
@ -159,6 +159,10 @@
|
||||
<if test="FeeName != null and FeeName != ''">FeeName,</if>
|
||||
<if test="Cost != null">Cost,</if>
|
||||
<if test="Status != null and Status != ''">Status,</if>
|
||||
<if test="applyid != null and applyid != ''">applyid,</if>
|
||||
<if test="applyDetailId != null and applyDetailId != ''">applyDetailId,</if>
|
||||
<if test="bz1 != null and bz1 != ''">bz1,</if>
|
||||
<if test="bz2 != null and bz2 != ''">bz2,</if>
|
||||
Barcode,OrderItemSerial,create_by,create_time,update_by,update_time
|
||||
)values(
|
||||
<if test="OrderItemCode != null and OrderItemCode != ''">#{OrderItemCode},</if>
|
||||
@ -171,6 +175,10 @@
|
||||
<if test="FeeName != null and FeeName != ''">#{FeeName},</if>
|
||||
<if test="Cost != null">#{Cost},</if>
|
||||
<if test="Status != null and Status != ''">#{Status},</if>
|
||||
<if test="applyid != null and applyid != ''">#{applyid},</if>
|
||||
<if test="applyDetailId != null and applyDetailId != ''">#{applyDetailId},</if>
|
||||
<if test="bz1 != null and bz1 != ''">#{bz1},</if>
|
||||
<if test="bz2 != null and bz2 != ''">#{bz2},</if>
|
||||
#{Barcode},#{OrderItemSerial},#{create_by},#{create_time},#{update_by},#{update_time}
|
||||
)
|
||||
</insert>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user