Merge branch 'master' of ssh://git.jizhiweb.cn:2222/clinic-v2/server
This commit is contained in:
commit
a6797e49c3
|
|
@ -20,6 +20,7 @@ public class ApiInfo {
|
||||||
}
|
}
|
||||||
@Data
|
@Data
|
||||||
public static class Request extends BaseProperty {
|
public static class Request extends BaseProperty {
|
||||||
|
private boolean isRequired;
|
||||||
// 原有结构保持不变
|
// 原有结构保持不变
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,8 @@ public class ScanUtil {
|
||||||
ApiInfo.Request apiParam = new ApiInfo.Request();
|
ApiInfo.Request apiParam = new ApiInfo.Request();
|
||||||
apiParam.setComment(param.value());
|
apiParam.setComment(param.value());
|
||||||
apiParam.setName(param.name());
|
apiParam.setName(param.name());
|
||||||
|
apiParam.setRequired(param.required());
|
||||||
|
|
||||||
|
|
||||||
// 设置参数类型
|
// 设置参数类型
|
||||||
if (!param.typeName().isEmpty()) {
|
if (!param.typeName().isEmpty()) {
|
||||||
|
|
@ -183,6 +185,7 @@ public class ScanUtil {
|
||||||
} else if (!apiReturn.type().equals(Object.class)) {
|
} else if (!apiReturn.type().equals(Object.class)) {
|
||||||
Class<?> returnType = apiReturn.type();
|
Class<?> returnType = apiReturn.type();
|
||||||
response.setType(returnType.getSimpleName());
|
response.setType(returnType.getSimpleName());
|
||||||
|
response.setName("对象");
|
||||||
|
|
||||||
// 递归处理复杂类型
|
// 递归处理复杂类型
|
||||||
if (isComplexType(returnType)) {
|
if (isComplexType(returnType)) {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.syjiaer.clinic.server.controller.common;
|
package com.syjiaer.clinic.server.controller.common;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.syjiaer.clinic.server.common.annotations.ApiParam;
|
||||||
|
import com.syjiaer.clinic.server.common.annotations.ApiParams;
|
||||||
|
import com.syjiaer.clinic.server.common.annotations.ApiReturn;
|
||||||
import com.syjiaer.clinic.server.common.annotations.NoAuthCheck;
|
import com.syjiaer.clinic.server.common.annotations.NoAuthCheck;
|
||||||
import com.syjiaer.clinic.server.common.config.Config;
|
import com.syjiaer.clinic.server.common.config.Config;
|
||||||
import com.syjiaer.clinic.server.common.util.RsaUtil;
|
import com.syjiaer.clinic.server.common.util.RsaUtil;
|
||||||
|
|
@ -18,8 +21,12 @@ public class AuthController extends BaseController {
|
||||||
private Config config;
|
private Config config;
|
||||||
@RequestMapping("set")
|
@RequestMapping("set")
|
||||||
@ApiOperation("设置认证信息")
|
@ApiOperation("设置认证信息")
|
||||||
|
@ApiParams({
|
||||||
|
@ApiParam(name = "ciphertext", value = "密文", required = true, typeName = "String")
|
||||||
|
})
|
||||||
|
@ApiReturn(isNull = true)
|
||||||
@NoAuthCheck
|
@NoAuthCheck
|
||||||
public Result<JSONObject> set() {
|
public Result<Object> set() {
|
||||||
String ciphertext = parmsUtil.getString("ciphertext", "请输入密文");
|
String ciphertext = parmsUtil.getString("ciphertext", "请输入密文");
|
||||||
String data= RsaUtil.decryp(ciphertext);
|
String data= RsaUtil.decryp(ciphertext);
|
||||||
config.set("common","cert",ciphertext);
|
config.set("common","cert",ciphertext);
|
||||||
|
|
@ -28,6 +35,7 @@ public class AuthController extends BaseController {
|
||||||
@RequestMapping("get")
|
@RequestMapping("get")
|
||||||
@ApiOperation("获取认证信息")
|
@ApiOperation("获取认证信息")
|
||||||
@NoAuthCheck
|
@NoAuthCheck
|
||||||
|
@ApiReturn(type = String.class)
|
||||||
public Result<String> get() {
|
public Result<String> get() {
|
||||||
String cert=config.get("common","cert");
|
String cert=config.get("common","cert");
|
||||||
return success(cert);
|
return success(cert);
|
||||||
|
|
@ -35,6 +43,8 @@ public class AuthController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping("check")
|
@RequestMapping("check")
|
||||||
@NoAuthCheck
|
@NoAuthCheck
|
||||||
|
@ApiOperation("检查认证信息")
|
||||||
|
@ApiReturn(type = JSONObject.class)
|
||||||
public Result<JSONObject> check(){
|
public Result<JSONObject> check(){
|
||||||
String cert=config.get("common","cert");
|
String cert=config.get("common","cert");
|
||||||
String data= RsaUtil.decryp(cert);
|
String data= RsaUtil.decryp(cert);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
package com.syjiaer.clinic.server.controller.diagnosis;
|
package com.syjiaer.clinic.server.controller.diagnosis;
|
||||||
|
|
||||||
|
import com.syjiaer.clinic.server.common.annotations.ApiParam;
|
||||||
|
import com.syjiaer.clinic.server.common.annotations.ApiParams;
|
||||||
|
import com.syjiaer.clinic.server.common.annotations.ApiReturn;
|
||||||
import com.syjiaer.clinic.server.common.annotations.RecordCommonLog;
|
import com.syjiaer.clinic.server.common.annotations.RecordCommonLog;
|
||||||
import com.syjiaer.clinic.server.common.vo.Page;
|
import com.syjiaer.clinic.server.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.common.vo.Result;
|
import com.syjiaer.clinic.server.common.vo.Result;
|
||||||
|
|
@ -39,6 +42,10 @@ public class DiagnosisController extends BaseController {
|
||||||
@RecordCommonLog(operation = "完成诊断")
|
@RecordCommonLog(operation = "完成诊断")
|
||||||
@ApiOperation("保存诊断")
|
@ApiOperation("保存诊断")
|
||||||
@RequestMapping("/save")
|
@RequestMapping("/save")
|
||||||
|
@ApiReturn(type = PatientRegistration.class)
|
||||||
|
@ApiParams({
|
||||||
|
@ApiParam(name = "data", value = "模型", required = true, type = DiagnosisDto.class)
|
||||||
|
})
|
||||||
public Result<PatientRegistration> save() {
|
public Result<PatientRegistration> save() {
|
||||||
DiagnosisDto saveDto = parmsUtil.getObject("data", DiagnosisDto.class);
|
DiagnosisDto saveDto = parmsUtil.getObject("data", DiagnosisDto.class);
|
||||||
diagnosisService.save(saveDto);
|
diagnosisService.save(saveDto);
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class SocialDirectoryController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("下载目录")
|
@ApiOperation("下载目录")
|
||||||
@PostMapping("download")
|
@RequestMapping("download")
|
||||||
public Result<Object> download() {
|
public Result<Object> download() {
|
||||||
Map<String, Object> parms = getParms();
|
Map<String, Object> parms = getParms();
|
||||||
String ver = (String) parms.get("ver");
|
String ver = (String) parms.get("ver");
|
||||||
|
|
@ -178,7 +178,7 @@ public class SocialDirectoryController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("同步到MongoDB")
|
@ApiOperation("同步到MongoDB")
|
||||||
@PostMapping("syncToMongo")
|
@RequestMapping("syncToMongo")
|
||||||
public Result<Object> syncToMongo() {
|
public Result<Object> syncToMongo() {
|
||||||
return success(socialDirectoryService.syncSocialDirectoryCache(parmsUtil.getInteger("page","请输入page")));
|
return success(socialDirectoryService.syncSocialDirectoryCache(parmsUtil.getInteger("page","请输入page")));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author NiuZiYuan
|
* @author NiuZiYuan
|
||||||
* @since 2025-05-21
|
* @since 2025-05-29
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -45,10 +45,10 @@ public class Item implements Serializable {
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
@ApiModelProperty("项目名称")
|
@ApiModelProperty("项目名称")
|
||||||
private String itemName;
|
private String name;
|
||||||
|
|
||||||
@ApiModelProperty("项目医保目录编码")
|
@ApiModelProperty("项目医保目录编码")
|
||||||
private String itemSocialCode;
|
private String socialCode;
|
||||||
|
|
||||||
@ApiModelProperty("单位")
|
@ApiModelProperty("单位")
|
||||||
private String unit;
|
private String unit;
|
||||||
|
|
|
||||||
|
|
@ -45,19 +45,7 @@ public class FileService extends BaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getJarDirectory() {
|
public String getJarDirectory() {
|
||||||
try {
|
return System.getProperty("user.dir");
|
||||||
// 获取当前类所在的 JAR 文件路径
|
|
||||||
String path = FileService.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
|
|
||||||
if (path.endsWith(".jar")) {
|
|
||||||
// 如果是 JAR 包,返回 JAR 所在目录
|
|
||||||
return new File(path).getParent();
|
|
||||||
} else {
|
|
||||||
// 如果是开发环境(非 JAR),返回项目根目录或其他合适的路径
|
|
||||||
return new File("").getAbsolutePath();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException("无法获取 JAR 文件路径", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String generateTempFileName(MultipartFile file) {
|
private String generateTempFileName(MultipartFile file) {
|
||||||
|
|
|
||||||
|
|
@ -167,8 +167,8 @@ public class DiagnosisService extends BaseService {
|
||||||
DiagnosisMedicalItemList itemDetail = new DiagnosisMedicalItemList();
|
DiagnosisMedicalItemList itemDetail = new DiagnosisMedicalItemList();
|
||||||
itemDetail.setDiagnosisCode(code);
|
itemDetail.setDiagnosisCode(code);
|
||||||
itemDetail.setItemId(item.getId());
|
itemDetail.setItemId(item.getId());
|
||||||
itemDetail.setName(dbItem.getItemName());
|
itemDetail.setName(dbItem.getName());
|
||||||
itemDetail.setSocialCode(dbItem.getItemSocialCode());
|
itemDetail.setSocialCode(dbItem.getSocialCode());
|
||||||
itemDetail.setUnit(dbItem.getUnit());
|
itemDetail.setUnit(dbItem.getUnit());
|
||||||
itemDetail.setUnitPrice(dbItem.getUnitPrice());
|
itemDetail.setUnitPrice(dbItem.getUnitPrice());
|
||||||
if (item.getSelectedNum() == null || item.getSelectedNum() <= 0) {
|
if (item.getSelectedNum() == null || item.getSelectedNum() <= 0) {
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,9 @@ public class ItemGroupService extends BaseService {
|
||||||
for (Item item : list) {
|
for (Item item : list) {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("id", item.getId());
|
jsonObject.put("id", item.getId());
|
||||||
jsonObject.put("name", item.getItemName());
|
jsonObject.put("name", item.getName());
|
||||||
jsonObject.put("unit", item.getUnit());
|
jsonObject.put("unit", item.getUnit());
|
||||||
jsonObject.put("itemSocialCode", item.getItemSocialCode());
|
jsonObject.put("itemSocialCode", item.getSocialCode());
|
||||||
jsonObject.put("unitPrice", item.getUnitPrice());
|
jsonObject.put("unitPrice", item.getUnitPrice());
|
||||||
jsonObject.put("purchaseUnitPrice", item.getPurchaseUnitPrice());
|
jsonObject.put("purchaseUnitPrice", item.getPurchaseUnitPrice());
|
||||||
unitPrice = unitPrice.add(item.getUnitPrice());
|
unitPrice = unitPrice.add(item.getUnitPrice());
|
||||||
|
|
|
||||||
|
|
@ -94,10 +94,10 @@ public class ItemService extends BaseService {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
throw new MessageException("item参数为空");
|
throw new MessageException("item参数为空");
|
||||||
}
|
}
|
||||||
if (item.getItemName() == null || item.getItemName().isEmpty()) {
|
if (item.getName() == null || item.getName().isEmpty()) {
|
||||||
throw new MessageException("项目名称不能为空");
|
throw new MessageException("项目名称不能为空");
|
||||||
}
|
}
|
||||||
if (item.getItemSocialCode() == null || item.getItemSocialCode().isEmpty()) {
|
if (item.getSocialCode() == null || item.getSocialCode().isEmpty()) {
|
||||||
throw new MessageException("项目医保目录编码不能为空");
|
throw new MessageException("项目医保目录编码不能为空");
|
||||||
}
|
}
|
||||||
if (item.getUnit() == null || item.getUnit().isEmpty()) {
|
if (item.getUnit() == null || item.getUnit().isEmpty()) {
|
||||||
|
|
@ -109,10 +109,10 @@ public class ItemService extends BaseService {
|
||||||
ManagerUser managerUser = getManagerUser();
|
ManagerUser managerUser = getManagerUser();
|
||||||
item.setCreateDatetime(LocalDateTime.now());
|
item.setCreateDatetime(LocalDateTime.now());
|
||||||
item.setCreateBy(managerUser.getName());
|
item.setCreateBy(managerUser.getName());
|
||||||
String pinyin_full = PinYinUtil.getPinyinFull(item.getItemName());
|
String pinyin_full = PinYinUtil.getPinyinFull(item.getName());
|
||||||
pinyin_full = pinyin_full.toUpperCase();
|
pinyin_full = pinyin_full.toUpperCase();
|
||||||
item.setPinyinFull(pinyin_full);
|
item.setPinyinFull(pinyin_full);
|
||||||
item.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(item.getItemName()).toUpperCase());
|
item.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(item.getName()).toUpperCase());
|
||||||
itemMapper.insertOrUpdate(item);
|
itemMapper.insertOrUpdate(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -139,7 +139,7 @@ public class ItemService extends BaseService {
|
||||||
queryWrapper.eq("del_flag", 0);
|
queryWrapper.eq("del_flag", 0);
|
||||||
if (keyword != null && !keyword.isEmpty()) {
|
if (keyword != null && !keyword.isEmpty()) {
|
||||||
String upperKeyword = keyword.toUpperCase();
|
String upperKeyword = keyword.toUpperCase();
|
||||||
queryWrapper.like("item_name", upperKeyword);
|
queryWrapper.like("name", upperKeyword);
|
||||||
queryWrapper.or().like("pinyin_full", upperKeyword);
|
queryWrapper.or().like("pinyin_full", upperKeyword);
|
||||||
queryWrapper.or().like("pinyin_first", upperKeyword);
|
queryWrapper.or().like("pinyin_first", upperKeyword);
|
||||||
|
|
||||||
|
|
@ -151,7 +151,7 @@ public class ItemService extends BaseService {
|
||||||
for (Item item : items) {
|
for (Item item : items) {
|
||||||
ItemSearchVo itemSearchVo = new ItemSearchVo();
|
ItemSearchVo itemSearchVo = new ItemSearchVo();
|
||||||
BeanUtils.copyProperties(item, itemSearchVo);
|
BeanUtils.copyProperties(item, itemSearchVo);
|
||||||
SocialDirectoryUpinfo socialDirectoryUpinfo = socialDirectoryUpinfoMapper.selectByCode(item.getItemSocialCode());
|
SocialDirectoryUpinfo socialDirectoryUpinfo = socialDirectoryUpinfoMapper.selectByCode(item.getSocialCode());
|
||||||
if (socialDirectoryUpinfo != null) {
|
if (socialDirectoryUpinfo != null) {
|
||||||
ChrgitmLvEnum chrgitmLvEnum = ChrgitmLvEnum.getChrgitmLvEnumByCode(socialDirectoryUpinfo.getChrgitmLv());
|
ChrgitmLvEnum chrgitmLvEnum = ChrgitmLvEnum.getChrgitmLvEnumByCode(socialDirectoryUpinfo.getChrgitmLv());
|
||||||
itemSearchVo.setChrgitmLv(chrgitmLvEnum == null ? null : chrgitmLvEnum.getName());
|
itemSearchVo.setChrgitmLv(chrgitmLvEnum == null ? null : chrgitmLvEnum.getName());
|
||||||
|
|
@ -169,10 +169,10 @@ public class ItemService extends BaseService {
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
throw new MessageException("item参数为空");
|
throw new MessageException("item参数为空");
|
||||||
}
|
}
|
||||||
if (item.getItemName() == null || item.getItemName().isEmpty()) {
|
if (item.getName() == null || item.getName().isEmpty()) {
|
||||||
throw new MessageException("项目名称不能为空");
|
throw new MessageException("项目名称不能为空");
|
||||||
}
|
}
|
||||||
if (item.getItemSocialCode() == null || item.getItemSocialCode().isEmpty()) {
|
if (item.getSocialCode() == null || item.getSocialCode().isEmpty()) {
|
||||||
throw new MessageException("项目医保目录编码不能为空");
|
throw new MessageException("项目医保目录编码不能为空");
|
||||||
}
|
}
|
||||||
if (item.getUnit() == null || item.getUnit().isEmpty()) {
|
if (item.getUnit() == null || item.getUnit().isEmpty()) {
|
||||||
|
|
@ -183,10 +183,10 @@ public class ItemService extends BaseService {
|
||||||
}
|
}
|
||||||
item.setUpdateBy(getManagerUser().getName());
|
item.setUpdateBy(getManagerUser().getName());
|
||||||
item.setUpdateDatetime(LocalDateTime.now());
|
item.setUpdateDatetime(LocalDateTime.now());
|
||||||
String pinyin_full = PinYinUtil.getPinyinFull(item.getItemName());
|
String pinyin_full = PinYinUtil.getPinyinFull(item.getName());
|
||||||
pinyin_full = pinyin_full.toUpperCase();
|
pinyin_full = pinyin_full.toUpperCase();
|
||||||
item.setPinyinFull(pinyin_full);
|
item.setPinyinFull(pinyin_full);
|
||||||
item.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(item.getItemName()).toUpperCase());
|
item.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(item.getName()).toUpperCase());
|
||||||
itemMapper.updateById(item);
|
itemMapper.updateById(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -232,17 +232,17 @@ public class ItemService extends BaseService {
|
||||||
if(itemInfo==null){
|
if(itemInfo==null){
|
||||||
itemInfo=new Item();
|
itemInfo=new Item();
|
||||||
}
|
}
|
||||||
itemInfo.setItemName(itemParam.getName());
|
itemInfo.setName(itemParam.getName());
|
||||||
itemInfo.setUnit(itemParam.getUnit());
|
itemInfo.setUnit(itemParam.getUnit());
|
||||||
itemInfo.setIsGroup(true);
|
itemInfo.setIsGroup(true);
|
||||||
itemInfo.setPurchaseUnitPrice(new BigDecimal(0));
|
itemInfo.setPurchaseUnitPrice(new BigDecimal(0));
|
||||||
itemInfo.setUnitPrice(new BigDecimal(0));
|
itemInfo.setUnitPrice(new BigDecimal(0));
|
||||||
itemInfo.setCreateDatetime(LocalDateTime.now());
|
itemInfo.setCreateDatetime(LocalDateTime.now());
|
||||||
itemInfo.setCreateBy(managerUser.getName());
|
itemInfo.setCreateBy(managerUser.getName());
|
||||||
String pinyinFull = PinYinUtil.getPinyinFull(itemInfo.getItemName());
|
String pinyinFull = PinYinUtil.getPinyinFull(itemInfo.getName());
|
||||||
pinyinFull = pinyinFull.toUpperCase();
|
pinyinFull = pinyinFull.toUpperCase();
|
||||||
itemInfo.setPinyinFull(pinyinFull);
|
itemInfo.setPinyinFull(pinyinFull);
|
||||||
itemInfo.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(itemInfo.getItemName()).toUpperCase());
|
itemInfo.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(itemInfo.getName()).toUpperCase());
|
||||||
itemInfo.setIsGroup(true);
|
itemInfo.setIsGroup(true);
|
||||||
if(itemInfo.getId()!= null && itemInfo.getId()>0){
|
if(itemInfo.getId()!= null && itemInfo.getId()>0){
|
||||||
UpdateWrapper<ItemGroupList> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<ItemGroupList> updateWrapper = new UpdateWrapper<>();
|
||||||
|
|
@ -338,7 +338,7 @@ public class ItemService extends BaseService {
|
||||||
|
|
||||||
//设置结果json中info字段
|
//设置结果json中info字段
|
||||||
HashMap<String,Object> infoMap = new HashMap<>();
|
HashMap<String,Object> infoMap = new HashMap<>();
|
||||||
infoMap.put("name",itemInfo.getItemName());
|
infoMap.put("name",itemInfo.getName());
|
||||||
infoMap.put("unit",itemInfo.getUnit());
|
infoMap.put("unit",itemInfo.getUnit());
|
||||||
infoMap.put("id",itemInfo.getId());
|
infoMap.put("id",itemInfo.getId());
|
||||||
resultMap.put("info",infoMap);
|
resultMap.put("info",infoMap);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue