接口和登录修改

This commit is contained in:
jiangs 2026-03-23 17:00:29 +08:00
parent 31f1cc460a
commit b56588b19f
12 changed files with 64 additions and 19 deletions

View File

@ -124,4 +124,7 @@ public interface SysUserMapper {
* @return 结果 * @return 结果
*/ */
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
public SysUser queryUserList(SysUser sysUser);
} }

View File

@ -206,4 +206,6 @@ public interface ISysUserService {
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
Result syncUser(); Result syncUser();
public SysUser queryUserList(SysUser sysUser);
} }

View File

@ -533,4 +533,9 @@ public class SysUserServiceImpl implements ISysUserService {
// return new Result("0","导入成功,共有:"+j+"条数据导入!"); // return new Result("0","导入成功,共有:"+j+"条数据导入!");
return new Result("-1","接口为定义!"); return new Result("-1","接口为定义!");
} }
@Override
public SysUser queryUserList(SysUser sysUser) {
return userMapper.queryUserList(sysUser);
}
} }

View File

@ -133,6 +133,7 @@ public class SysLoginService {
loginYLJG = loginBody.getLoginParam().getLoginYLJG(); //登录的医疗机构 loginYLJG = loginBody.getLoginParam().getLoginYLJG(); //登录的医疗机构
loginYLJGName = loginBody.getLoginParam().getLoginYLJGName(); //登录的医疗机构名称 loginYLJGName = loginBody.getLoginParam().getLoginYLJGName(); //登录的医疗机构名称
localid = loginBody.getLoginParam().getLocalid(); localid = loginBody.getLoginParam().getLocalid();
if(loginYLJG == null || loginYLJG.equals("")) throw new GlobalException("获取到登录机构为空,不允许登录!");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error("获取登录信息失败:", e); log.error("获取登录信息失败:", e);
@ -237,12 +238,16 @@ public class SysLoginService {
} }
//判断用户名是否在登录的医疗机构中 //判断用户名是否在登录的医疗机构中
SysUser sysUser = userService.selectUserByUserName(username); SysUser sysUser1 = new SysUser();
if (sysUser == null) throw new UserNotExistsException(); sysUser1.setUserName(username);
sysUser1.setYljg(loginParam.getLoginYLJG());
SysUser sysUser = userService.queryUserList(sysUser1);
//管理员不判断 //管理员不判断
if (!username.equals("admin")){ // if (!username.equals("admin")){
if(!sysUser.getYljg().equals(loginParam.getLoginYLJG())) throw new GlobalException("医疗机构代码:"+loginParam.getLoginYLJG()+"不存在该用户!"+username+","+sysUser.getNickName()); // if (sysUser == null) throw new GlobalException("医疗机构:"+loginParam.getLoginYLJGName()+"不存在该用户!"+username);
} // }
if (sysUser == null) throw new GlobalException("医疗机构:"+loginParam.getLoginYLJGName()+"不存在该用户!"+username);
} }

View File

@ -138,6 +138,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where u.user_id = #{userId} where u.user_id = #{userId}
</select> </select>
<select id="queryUserList" resultMap="SysUserResult">
select * from sys_user where del_flag = '0'
<if test="userName != null and userName != ''">and user_name = #{userName}</if>
<if test="yljg != null and yljg != ''">and yljg = #{yljg}</if>
</select>
<select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult">
select top 1 user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' select top 1 user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0'
</select> </select>

View File

@ -17,7 +17,7 @@ public class SpringbootTest {
@Test @Test
public void test01(){ public void test01(){
String dateStr = DateUtil.format(commonUtil.getCurrentTime(), "yyyyMMdd"); String dateStr = "20260323";
System.out.println(dateStr); System.out.println(dateStr.substring(3));
} }
} }

View File

@ -15,6 +15,6 @@ import java.util.List;
@AllArgsConstructor @AllArgsConstructor
public class RegTransitSampleDTO { public class RegTransitSampleDTO {
@ApiModelProperty(value = "主表信息") @ApiModelProperty(value = "主表信息")
private List<RegTransitSample> LabQuerySampleList; private List<RegTransitSample> regTransitSampleList;
private List<RegTransitSampleDetail> regTransitSampleDetailList; private List<RegTransitSampleDetail> regTransitSampleDetailList;
} }

View File

@ -45,11 +45,11 @@ public class SampleSignVO {
@ApiModelProperty(value = "标本退回人姓名") @ApiModelProperty(value = "标本退回人姓名")
private String backUserName; private String backUserName;
@ApiModelProperty(value = "报告时间") @ApiModelProperty(value = "报告时间")
private Date ReportTime; private Date reportTime;
@ApiModelProperty(value = "报告人代码") @ApiModelProperty(value = "报告人代码")
private String ReportUserCode; private String reportUserCode;
@ApiModelProperty(value = "报告人姓名") @ApiModelProperty(value = "报告人姓名")
private String ReportUserName; private String reportUserName;
@ApiModelProperty(value = "标本作废时间") @ApiModelProperty(value = "标本作废时间")
private Date cancelTime; private Date cancelTime;
@ApiModelProperty(value = "标本作废人代码") @ApiModelProperty(value = "标本作废人代码")
@ -57,5 +57,5 @@ public class SampleSignVO {
@ApiModelProperty(value = "标本作废人名称") @ApiModelProperty(value = "标本作废人名称")
private String cancelName; private String cancelName;
@ApiModelProperty(value = "标本退回时间") @ApiModelProperty(value = "标本退回时间")
private Date BackTime; private Date backTime;
} }

View File

@ -9,6 +9,7 @@ import com.transitPlatForm.interfaceCommon.mapper.RegApplyMapper;
import com.transitPlatForm.interfaceCommon.utils.CommonUtil; import com.transitPlatForm.interfaceCommon.utils.CommonUtil;
import com.transitPlatForm.transitPF.mapper.RegTransitSampleMapper; import com.transitPlatForm.transitPF.mapper.RegTransitSampleMapper;
import com.transitPlatForm.transitPF.pojo.DTO.LisReportDTO; import com.transitPlatForm.transitPF.pojo.DTO.LisReportDTO;
import com.transitPlatForm.transitPF.pojo.DTO.RegTransitSampleDTO;
import com.transitPlatForm.transitPF.pojo.DTO.SampleSignVO; import com.transitPlatForm.transitPF.pojo.DTO.SampleSignVO;
import com.transitPlatForm.common.core.domain.entity.reg.RegTransitSample; 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.RegTransitSampleDetail;
@ -31,6 +32,7 @@ public class RegInterfaceImpl {
RequestInfoUtil requestInfoUtil; RequestInfoUtil requestInfoUtil;
/** /**
* 新增条码信息
*{ *{
* "method":"addTransitSample", * "method":"addTransitSample",
* "req": { * "req": {
@ -89,6 +91,7 @@ public class RegInterfaceImpl {
} }
/** /**
* 删除条码信息
* { * {
* "method":"delTransitSample", * "method":"delTransitSample",
* "req": { * "req": {
@ -122,6 +125,19 @@ public class RegInterfaceImpl {
return new Result("0","删除成功!"); return new Result("0","删除成功!");
} }
/**
* {
* "method":"queryTransitSample",
* "req":{
* "param": {
* "barcode":""
* }
* * }
* }
* 查询条码信息
* @param jsonStr
* @return
*/
public Result queryTransitSample(String jsonStr){ public Result queryTransitSample(String jsonStr){
try{ try{
JSONObject jsonObject = JSONUtil.parseObj(jsonStr); JSONObject jsonObject = JSONUtil.parseObj(jsonStr);
@ -129,7 +145,11 @@ public class RegInterfaceImpl {
RegTransitSample regTransitSample = new RegTransitSample(); RegTransitSample regTransitSample = new RegTransitSample();
regTransitSample.setBarcode(barcode); regTransitSample.setBarcode(barcode);
List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample); List<RegTransitSample> regTransitSampleList = regTransitSampleMapper.getRegTransitSample(regTransitSample);
return new Result("0","获取数据成功!",regTransitSampleList); RegTransitSampleDetail regTransitSampleDetail = new RegTransitSampleDetail();
regTransitSampleDetail.setBarcode(barcode);
List<RegTransitSampleDetail> regTransitSampleDetailList = regTransitSampleMapper.getRegTransitSampleDetail(regTransitSampleDetail);
RegTransitSampleDTO regTransitSampleDTO = new RegTransitSampleDTO(regTransitSampleList,regTransitSampleDetailList);
return new Result("0","获取数据成功!",regTransitSampleDTO);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
log.error("调用的json格式不合法!",e); log.error("调用的json格式不合法!",e);
@ -178,6 +198,7 @@ public class RegInterfaceImpl {
regApply.setStatus("20"); regApply.setStatus("20");
requestInfoUtil.updateRegTransitSampleStatus(regTransitSample20,regApply); requestInfoUtil.updateRegTransitSampleStatus(regTransitSample20,regApply);
break;
case "30": //标本送检 case "30": //标本送检
Date sendPackTime = sampleSignVO.getSendPackTime(); Date sendPackTime = sampleSignVO.getSendPackTime();
String sendUserCode = sampleSignVO.getSendUserCode(); String sendUserCode = sampleSignVO.getSendUserCode();
@ -285,7 +306,7 @@ public class RegInterfaceImpl {
log.error("json格式不合法",e); log.error("json格式不合法",e);
return new Result("-1","json格式不合法!"); return new Result("-1","json格式不合法!");
} }
return null; return new Result("0","修改状态成功!");
} }

View File

@ -71,6 +71,8 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
*/ */
@Override @Override
public Result queryRegRequestInfo(RegRequestInfoDTO regRequestInfoDTO) { public Result queryRegRequestInfo(RegRequestInfoDTO regRequestInfoDTO) {
// SysLoginParam sysLoginParam = SecurityUtils.getLoginUser().getSysLoginParam();
// System.out.println("SysLoginParam:"+sysLoginParam);
List<RegApply> regApplyList = regRequestInfoMapper.queryRegRequestInfo(regRequestInfoDTO); List<RegApply> regApplyList = regRequestInfoMapper.queryRegRequestInfo(regRequestInfoDTO);
return new Result("0", "查询成功!", regApplyList); return new Result("0", "查询成功!", regApplyList);
} }
@ -327,7 +329,8 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
if (srcHospCode.length() == 1) { if (srcHospCode.length() == 1) {
srcHospCode = String.format("%02d", Integer.valueOf(srcHospCode)); srcHospCode = String.format("%02d", Integer.valueOf(srcHospCode));
} }
barcode = DateUtil.format(commonUtil.getCurrentTime(), "yyyyMMdd") + srcHospCode + commonUtil.getNextSeq_pro("barcode", 4); String barcodeFormat = DateUtil.format(commonUtil.getCurrentTime(), "yyyyMMdd").substring(2);
barcode = srcHospCode + barcodeFormat + commonUtil.getNextSeq_pro("barcode", 4);
itemClassOne = itemClass; itemClassOne = itemClass;
yblxOne = yblx; yblxOne = yblx;
} }
@ -552,8 +555,8 @@ public class RegRequestInfoServiceImpl implements RegRequestInfoService {
@Override @Override
public Result getPatInfo(RegRequestInfoDTO regRequestInfoDTO) { public Result getPatInfo(RegRequestInfoDTO regRequestInfoDTO) {
String patId = regRequestInfoDTO.getPatId(); String patId = regRequestInfoDTO.getPatId();
String srcHospCode = regRequestInfoDTO.getSrcHospCode(); String loginYLJG = SecurityUtils.getLoginUser().getSysLoginParam().getLoginYLJG();
RegApply regApply = regRequestInfoMapper.getPatInfo(patId, srcHospCode); RegApply regApply = regRequestInfoMapper.getPatInfo(patId, loginYLJG);
return new Result("0","查询数据成功!",regApply); return new Result("0","查询数据成功!",regApply);
} }

View File

@ -61,7 +61,7 @@ public class RegTransitSampleServiceImpl implements RegTransitSampleService {
return regInterfaceImpl.delTransitSample(jsonStr); return regInterfaceImpl.delTransitSample(jsonStr);
case "queryTransitSample": //查询数据接口 case "queryTransitSample": //查询数据接口
return regInterfaceImpl.queryTransitSample(jsonStr); return regInterfaceImpl.queryTransitSample(jsonStr);
case "update": //修改状态, 目前只写了送检状态的 case "update": //修改状态
return regInterfaceImpl.updateStatus(jsonStr); return regInterfaceImpl.updateStatus(jsonStr);
case "addReport": case "addReport":
return regInterfaceImpl.addReport(jsonStr); return regInterfaceImpl.addReport(jsonStr);

View File

@ -31,7 +31,7 @@
<select id="getPatInfo" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApply"> <select id="getPatInfo" resultType="com.transitPlatForm.common.core.domain.entity.reg.RegApply">
select * from reg_apply where PatId = #{patId} and SrcHospCode = #{srcHospCode} select top 1 * from reg_apply where PatId = #{patId} and SrcHospCode = #{srcHospCode}
</select> </select>
</mapper> </mapper>