This commit is contained in:
LiJianZhao 2025-04-25 14:28:47 +08:00
parent 6fafad14e3
commit 61d081c7cf
21 changed files with 499 additions and 324 deletions

View File

@ -4,12 +4,9 @@ import com.syjiaer.clinic.server.common.util.DictoryUtil;
import com.syjiaer.clinic.server.common.vo.Page; import com.syjiaer.clinic.server.common.vo.Page;
import com.syjiaer.clinic.server.common.vo.Result; import com.syjiaer.clinic.server.common.vo.Result;
import com.syjiaer.clinic.server.controller.BaseController; import com.syjiaer.clinic.server.controller.BaseController;
import com.syjiaer.clinic.server.entity.social.SocialDiagnose; import com.syjiaer.clinic.server.entity.social.*;
import com.syjiaer.clinic.server.entity.social.SocialDirectory;
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView; import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
import com.syjiaer.clinic.server.service.social.SocialDiagnoseService; import com.syjiaer.clinic.server.service.social.*;
import com.syjiaer.clinic.server.service.social.SocialDirectoryService;
import com.syjiaer.clinic.server.service.social.SocialItemService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -37,6 +34,10 @@ public class SocialDirectoryController extends BaseController {
@Autowired @Autowired
private SocialDiagnoseService socialDiagnoseService; private SocialDiagnoseService socialDiagnoseService;
@Autowired @Autowired
private SocialIcpcItemService socialIcpcItemService;
@Autowired
private SocialIcpcDiagnoseService socialIcpcDiagnoseService;
@Autowired
private DictoryUtil dictoryUtil; private DictoryUtil dictoryUtil;
@RequestMapping("search") @RequestMapping("search")
@ -65,7 +66,7 @@ public class SocialDirectoryController extends BaseController {
return error("参数 ver 不能为空"); return error("参数 ver 不能为空");
} }
String version_name= null; String version_name= null;
if(type==1301||type==1302||type==1306){ if(type==1301||type==1302||type==1306 || type==1309 || type==1314 || type==1315 ||type==1320){
version_name =socialDirectoryService.download(ver, type); version_name =socialDirectoryService.download(ver, type);
return success(version_name); return success(version_name);
} }
@ -75,8 +76,19 @@ public class SocialDirectoryController extends BaseController {
} }
if (type == 1307){ if (type == 1307){
version_name = socialDiagnoseService.download(ver); version_name = socialDiagnoseService.download(ver);
return success(version_name);
} }
if (type == 1361){
version_name = socialIcpcDiagnoseService.download(ver);
return success(version_name);
}
if (type == 1362){
version_name = socialIcpcItemService.download(ver);
return success(version_name);
}
return error("参数 type 不正确"); return error("参数 type 不正确");
@ -92,18 +104,28 @@ public class SocialDirectoryController extends BaseController {
} }
@RequestMapping("get_doc_list") @RequestMapping("get_doc_list")
public Result<Page<SocialDirectoryView>> get_doc_list() { public Result<Page<?>> get_doc_list() {
Map<String,Object> parms= parmsUtil.getMap(); Map<String,Object> parms= parmsUtil.getMap();
int type = (Integer) parms.get("type"); int type = (Integer) parms.get("type");
int page = (Integer) parms.getOrDefault("page", 1); int page = (Integer) parms.getOrDefault("page", 1);
int size = (Integer) parms.getOrDefault("size", 10); int size = (Integer) parms.getOrDefault("size", 10);
String keyword = (String) parms.getOrDefault("search_keyword", ""); String keyword = (String) parms.getOrDefault("search_keyword", "");
if (type == 1301 || type == 1302 || type == 1306){ if (type == 1301 || type == 1302 || type == 1306 || type == 1309 || type == 1314 || type == 1315 || type == 1320){
return success(socialDirectoryService.getDocList(type,page,size,keyword)); return success(socialDirectoryService.getDocList(type,page,size,keyword));
} }
if (type == 1305){ if (type == 1305){
return success(socialItemService.getDocList(type,page,size,keyword)); return success(socialItemService.getDocList(type,page,size,keyword));
} }
if (type == 1307){
return success(socialDiagnoseService.getDocList(type,page,size,keyword));
}
if (type == 1361){
return success(socialIcpcDiagnoseService.getDocList(type,page,size,keyword));
}
if (type == 1362){
return success(socialIcpcItemService.getDocList(type,page,size,keyword));
}
return error("类型未定义"); return error("类型未定义");

View File

@ -0,0 +1,67 @@
package com.syjiaer.clinic.server.entity.social;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
* <p>
* icpc 就诊原因与疾病诊断1361
* </p>
*
* @author NiuZiYuan
* @since 2025-04-25
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("social_icpc_diagnosis")
@ApiModel(value = "SocialIcpcDiagnosis对象", description = "icpc 就诊原因与疾病诊断1361")
public class SocialIcpcDiagnosis implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private String id;
@ApiModelProperty("门诊诊疗编码")
private String name;
@ApiModelProperty("门诊诊疗名称")
private String code;
@ApiModelProperty("ICD-10关联名称")
private String icd10AsocName;
@ApiModelProperty("诊疗类型")
private String trtType;
@ApiModelProperty("失效时间")
private LocalDateTime invdTime;
@ApiModelProperty("备注")
private String memo;
@ApiModelProperty("唯一记录号")
private String rid;
@ApiModelProperty("更新时间")
private LocalDateTime updtTime;
@ApiModelProperty("创建时间")
private LocalDateTime crteTime;
@ApiModelProperty("生效时间")
private LocalDateTime efftTime;
@ApiModelProperty("版本号")
private String var;
}

View File

@ -0,0 +1,73 @@
package com.syjiaer.clinic.server.entity.social;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author NiuZiYuan
* @since 2025-04-25
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("social_icpc_item")
@ApiModel(value = "SocialIcpcItem对象", description = "")
public class SocialIcpcItem implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty("收费项目省代码 ")
private String chrgitmProvCode;
@ApiModelProperty("收费项目国家代码")
private String code;
@ApiModelProperty("项目名称")
private String name;
@ApiModelProperty("icpc编码")
private String icpcCode;
@ApiModelProperty("ICPC编码应用标识")
private String icpcCodeFlag;
@ApiModelProperty("收费项目属性")
private String chrgitmAttr;
@ApiModelProperty("生效时间")
private LocalDateTime efftTime;
@ApiModelProperty("失效时间")
private LocalDateTime invdTime;
@ApiModelProperty("唯一记录号")
private String rid;
@ApiModelProperty("备注")
private String memo;
@ApiModelProperty("更新时间")
private LocalDateTime updtTime;
@ApiModelProperty("创建时间")
private LocalDateTime crteTime;
@ApiModelProperty("版本号")
private String ver;
}

View File

@ -0,0 +1,18 @@
package com.syjiaer.clinic.server.mapper.social;
import com.syjiaer.clinic.server.entity.social.SocialIcpcDiagnosis;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* icpc 就诊原因与疾病诊断1361 Mapper 接口
* </p>
*
* @author NiuZiYuan
* @since 2025-04-25
*/
public interface SocialIcpcDiagnosisMapper extends BaseMapper<SocialIcpcDiagnosis> {
}

View File

@ -0,0 +1,18 @@
package com.syjiaer.clinic.server.mapper.social;
import com.syjiaer.clinic.server.entity.social.SocialIcpcItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author NiuZiYuan
* @since 2025-04-25
*/
public interface SocialIcpcItemMapper extends BaseMapper<SocialIcpcItem> {
}

View File

@ -215,8 +215,8 @@ public class GoodsService {
goodsDetailVo.setHilistPricUplmtAmt(dbSocialInfo.getHilistPricUplmtAmt()); goodsDetailVo.setHilistPricUplmtAmt(dbSocialInfo.getHilistPricUplmtAmt());
goodsDetailVo.setHilistLmtpricType(dbSocialInfo.getHilistLmtpricType()); goodsDetailVo.setHilistLmtpricType(dbSocialInfo.getHilistLmtpricType());
goodsDetailVo.setSelfpayProp(dbSocialInfo.getSelfpayProp()); goodsDetailVo.setSelfpayProp(dbSocialInfo.getSelfpayProp());
goodsDetailVoList.add(goodsDetailVo);
} }
goodsDetailVoList.add(goodsDetailVo);
} }
Page<GoodsDetailVo> result = new Page<>(); Page<GoodsDetailVo> result = new Page<>();

View File

@ -3,8 +3,13 @@ package com.syjiaer.clinic.server.service.social;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.syjiaer.clinic.server.common.util.DateUtil; import com.syjiaer.clinic.server.common.util.DateUtil;
import com.syjiaer.clinic.server.common.util.HttpUtil; import com.syjiaer.clinic.server.common.util.HttpUtil;
import com.syjiaer.clinic.server.common.vo.Page;
import com.syjiaer.clinic.server.entity.social.SocialDiagnose; import com.syjiaer.clinic.server.entity.social.SocialDiagnose;
import com.syjiaer.clinic.server.entity.social.SocialItem;
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
import com.syjiaer.clinic.server.mapper.social.SocialDiagnoseMapper; import com.syjiaer.clinic.server.mapper.social.SocialDiagnoseMapper;
import com.syjiaer.clinic.server.service.BaseService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -15,7 +20,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
@Service @Service
public class SocialDiagnoseService { public class SocialDiagnoseService extends BaseService {
@Autowired @Autowired
private HttpUtil httpUtil; private HttpUtil httpUtil;
@Autowired @Autowired
@ -70,4 +75,18 @@ public class SocialDiagnoseService {
queryWrapper.last("limit 20"); queryWrapper.last("limit 20");
return socialDiagnoseMapper.selectList(queryWrapper); return socialDiagnoseMapper.selectList(queryWrapper);
} }
public Page<SocialDiagnose> getDocList(int type, int page, int size, String keyword) {
QueryWrapper<SocialDiagnose> codeqw = new QueryWrapper<>();
//模糊搜索
if (!keyword.trim().isEmpty()) {
codeqw.like("name", keyword);
codeqw.or().like("code", keyword);
}
// 执行查询
Page<SocialDiagnose> resultPage = pageHelper(page, size, codeqw, socialDiagnoseMapper, "create_datetime", false);
return resultPage;
}
} }

View File

@ -53,12 +53,10 @@ public class SocialDirectoryService extends BaseService {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String download(String version_name, int type) { public String download(String version_name, int type) {
Integer[] type_list = {1301, 1302, 1306};
//判断type在数组中
if (!Arrays.asList(type_list).contains(type)) {
throw new MessageException("参数type不正确");
}
List<String[]> tab_list = httpUtil.download(version_name, type); List<String[]> tab_list = httpUtil.download(version_name, type);
if (tab_list.isEmpty()){
return null;
}
//清楚原有的code //清楚原有的code
int batchSize = 100; int batchSize = 100;
for (int i = 0; i < tab_list.size(); i += batchSize) { for (int i = 0; i < tab_list.size(); i += batchSize) {
@ -121,6 +119,20 @@ public class SocialDirectoryService extends BaseService {
socialDirectory.setProducer(line_array[59]); socialDirectory.setProducer(line_array[59]);
socialDirectory.setKeyword(line_array[4]); socialDirectory.setKeyword(line_array[4]);
} }
if (type == 1309){
flag = line_array[5];
socialDirectory.setCreateDatetime(LocalDateTime.parse(line_array[7],dateTimeFormatter));
socialDirectory.setCreateDatetime(LocalDateTime.parse(line_array[8],dateTimeFormatter));
}
if (type == 1314){
flag = line_array[8];
}
if (type == 1315){
flag = line_array[8];
}
if (type == 1320){
flag = line_array[28];
}
SocialDirectory tmp_socialDirectory = tmp_map.get(code); SocialDirectory tmp_socialDirectory = tmp_map.get(code);
if(i==0){ if(i==0){
next_version_name=socialDirectory.getVersionName(); next_version_name=socialDirectory.getVersionName();
@ -240,7 +252,7 @@ public class SocialDirectoryService extends BaseService {
* @param type 类型 * @param type 类型
*/ */
public List<Map<String, Object>> getColumnList(int type) { public List<Map<String, Object>> getColumnList(int type) {
Integer[] typeList = {1301, 1302, 1305, 1306, 1307, 1309, 1314, 1315, 1320, 1321}; Integer[] typeList = {1301, 1302, 1305, 1306, 1307, 1309, 1314, 1315, 1320, 1321,1361,1362};
//判断type在数组中 //判断type在数组中
if (!Arrays.asList(typeList).contains(type)) { if (!Arrays.asList(typeList).contains(type)) {
throw new MessageException("参数 type 不能为空"); throw new MessageException("参数 type 不能为空");

View File

@ -26,7 +26,7 @@ public class SocialDirectoryVersionService {
* @param type 目录类型 * @param type 目录类型
*/ */
public SocialDirectoryVersion getCurrent(int type) { public SocialDirectoryVersion getCurrent(int type) {
Integer[] type_list = {1301, 1302, 1305, 1306, 1307, 1309, 1314, 1315, 1320, 1321}; Integer[] type_list = {1301, 1302, 1305, 1306, 1307, 1309, 1314, 1315, 1320, 1321,1361,1362};
//判断type在数组中 //判断type在数组中
if (!Arrays.asList(type_list).contains(type)) { if (!Arrays.asList(type_list).contains(type)) {
throw new MessageException("type不能为空"); throw new MessageException("type不能为空");

View File

@ -0,0 +1,84 @@
package com.syjiaer.clinic.server.service.social;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.syjiaer.clinic.server.common.util.DateUtil;
import com.syjiaer.clinic.server.common.util.HttpUtil;
import com.syjiaer.clinic.server.common.vo.Page;
import com.syjiaer.clinic.server.entity.social.SocialIcpcDiagnosis;
import com.syjiaer.clinic.server.entity.social.SocialIcpcDoctorDiagnose;
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
import com.syjiaer.clinic.server.mapper.social.SocialIcpcDiagnosisMapper;
import com.syjiaer.clinic.server.mapper.social.SocialIcpcDoctorDiagnoseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
@Service
public class SocialIcpcDiagnoseService {
@Autowired
private HttpUtil httpUtil;
@Autowired
private SocialIcpcDiagnosisMapper socialIcpcDiagnosisMapper;
@Autowired
private SocialDirectoryVersionService socialDirectoryVersionService;
public String download(String pre_version_name) {
JSONArray jsonArray = httpUtil.download2("icpc_doctor_diagnose", 1361);
List<String> code_list = new ArrayList<>();
DateTimeFormatter dateTimeFormatter = DateUtil.getDateTimeFormatter(DateUtil.DATE_TIME_FORMAT);
List<SocialIcpcDiagnosis> list = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
if (!jsonObject.getString("vali_flag").equals("1")) {
continue;
}
SocialIcpcDiagnosis socialIcpcDiagnosis = new SocialIcpcDiagnosis();
socialIcpcDiagnosis.setId(jsonObject.getString("six_code"));
socialIcpcDiagnosis.setName(jsonObject.getString("six_name"));
socialIcpcDiagnosis.setCode(jsonObject.getString("six_code"));
socialIcpcDiagnosis.setIcd10AsocName(jsonObject.getString("icd10_asoc_name"));
socialIcpcDiagnosis.setTrtType(jsonObject.getString("trt_type"));
if (jsonObject.getString("invd_time") != null && !jsonObject.getString("invd_time").isEmpty()) {
socialIcpcDiagnosis.setInvdTime(LocalDateTime.parse(jsonObject.getString("invd_time"), dateTimeFormatter));
} else {
socialIcpcDiagnosis.setInvdTime(null);
}
socialIcpcDiagnosis.setMemo(jsonObject.getString("memo"));
socialIcpcDiagnosis.setRid(jsonObject.getString("rid"));
if (jsonObject.getString("updt_time") != null && !jsonObject.getString("updt_time").isEmpty()) {
socialIcpcDiagnosis.setUpdtTime(LocalDateTime.parse(jsonObject.getString("updt_time"), dateTimeFormatter));
} else {
socialIcpcDiagnosis.setUpdtTime(null);
}
if (jsonObject.getString("crte_time") != null && !jsonObject.getString("crte_time").isEmpty()) {
socialIcpcDiagnosis.setCrteTime(LocalDateTime.parse(jsonObject.getString("crte_time"), dateTimeFormatter));
} else {
socialIcpcDiagnosis.setCrteTime(null);
}
if (jsonObject.getString("efft_time") != null && !jsonObject.getString("efft_time").isEmpty()) {
socialIcpcDiagnosis.setEfftTime(LocalDateTime.parse(jsonObject.getString("efft_time"), dateTimeFormatter));
} else {
socialIcpcDiagnosis.setEfftTime(null);
}
socialIcpcDiagnosis.setVar(jsonObject.getString("var"));
list.add(socialIcpcDiagnosis);
code_list.add(socialIcpcDiagnosis.getCode());
}
QueryWrapper<SocialIcpcDiagnosis> queryWrapper = new QueryWrapper<>();
queryWrapper.in("code", code_list);
socialIcpcDiagnosisMapper.delete(queryWrapper);
socialIcpcDiagnosisMapper.insert(list, 100);
socialDirectoryVersionService.saveVersion(1361, pre_version_name, list.get(0).getVar(), list.size());
return list.get(0).getVar();
}
public Page<SocialDirectoryView> getDocList(int type, int page, int size, String keyword) {
return null;
}
}

View File

@ -1,53 +0,0 @@
package com.syjiaer.clinic.server.service.social;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.syjiaer.clinic.server.common.util.DateUtil;
import com.syjiaer.clinic.server.common.util.HttpUtil;
import com.syjiaer.clinic.server.entity.social.SocialIcpcDoctorDiagnose;
import com.syjiaer.clinic.server.mapper.social.SocialIcpcDoctorDiagnoseMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
@Service
public class SocialIcpcDoctorDiagnoseService {
@Autowired
private HttpUtil httpUtil;
@Autowired
private SocialIcpcDoctorDiagnoseMapper socialIcpcDoctorDiagnoseMapper;
@Autowired
private SocialDirectoryVersionService socialDirectoryVersionService;
public String download(String pre_version_name) {
JSONArray jsonArray = httpUtil.download2("icpc_doctor_diagnose", 1361);
List<String> code_list = new ArrayList<>();
DateTimeFormatter dateTimeFormatter = DateUtil.getDateTimeFormatter(DateUtil.DATE_TIME_FORMAT);
List<SocialIcpcDoctorDiagnose> list = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
if (!jsonObject.getString("vali_flag").equals("1")) {
continue;
}
SocialIcpcDoctorDiagnose socialIcpcDoctorDiagnose = new SocialIcpcDoctorDiagnose();
socialIcpcDoctorDiagnose.setName(jsonObject.getString("six_name"));
socialIcpcDoctorDiagnose.setSocialCode(jsonObject.getString("six_code"));
socialIcpcDoctorDiagnose.setVersionName(jsonObject.getString("ver"));
socialIcpcDoctorDiagnose.setCreateDatetime(LocalDateTime.parse(jsonObject.getString("crte_time"), dateTimeFormatter));
socialIcpcDoctorDiagnose.setUpdateDatetime(LocalDateTime.parse(jsonObject.getString("updt_time"), dateTimeFormatter));
list.add(socialIcpcDoctorDiagnose);
code_list.add(socialIcpcDoctorDiagnose.getSocialCode());
}
QueryWrapper<SocialIcpcDoctorDiagnose> queryWrapper = new QueryWrapper<>();
queryWrapper.in("social_code", code_list);
socialIcpcDoctorDiagnoseMapper.delete(queryWrapper);
socialIcpcDoctorDiagnoseMapper.insert(list, 100);
socialDirectoryVersionService.saveVersion(1361, pre_version_name, list.get(0).getVersionName(), list.size());
return list.get(0).getVersionName();
}
}

View File

@ -1,54 +0,0 @@
package com.syjiaer.clinic.server.service.social;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.syjiaer.clinic.server.common.util.DateUtil;
import com.syjiaer.clinic.server.common.util.HttpUtil;
import com.syjiaer.clinic.server.entity.social.SocialIcpcExaminationTreatment;
import com.syjiaer.clinic.server.mapper.social.SocialIcpcExaminationTreatmentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
@Service
public class SocialIcpcExaminationTreatmentService {
@Autowired
private HttpUtil httpUtil;
@Autowired
private SocialIcpcExaminationTreatmentMapper socialIcpcExaminationTreatmentMapper;
@Autowired
private SocialDirectoryVersionService socialDirectoryVersionService;
public String download(String pre_version_name) {
JSONArray jsonArray = httpUtil.download2(pre_version_name, 1362);
List<String> code_list = new ArrayList<>();
DateTimeFormatter dateTimeFormatter = DateUtil.getDateTimeFormatter(DateUtil.DATE_TIME_FORMAT);
List<SocialIcpcExaminationTreatment> list = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
if (!jsonObject.getString("vali_flag").equals("1")) {
continue;
}
SocialIcpcExaminationTreatment socialIcpcExaminationTreatment = new SocialIcpcExaminationTreatment();
socialIcpcExaminationTreatment.setSocialCode(jsonObject.getString("chrgitm_nat_code"));
socialIcpcExaminationTreatment.setVersionName(jsonObject.getString("ver"));
socialIcpcExaminationTreatment.setIcpcCode(jsonObject.getString("icpc_code"));
socialIcpcExaminationTreatment.setIcpcCodeFlag(jsonObject.getString("icpc_code_flag"));
socialIcpcExaminationTreatment.setName(jsonObject.getString("chrgitm_name"));
socialIcpcExaminationTreatment.setCreateDatetime(LocalDateTime.parse(jsonObject.getString("crte_time"), dateTimeFormatter));
socialIcpcExaminationTreatment.setUpdateDatetime(LocalDateTime.parse(jsonObject.getString("updt_time"), dateTimeFormatter));
list.add(socialIcpcExaminationTreatment);
code_list.add(socialIcpcExaminationTreatment.getSocialCode());
}
QueryWrapper<SocialIcpcExaminationTreatment> queryWrapper = new QueryWrapper<>();
queryWrapper.in("social_code", code_list);
socialIcpcExaminationTreatmentMapper.delete(queryWrapper);
socialIcpcExaminationTreatmentMapper.insert(list, 100);
socialDirectoryVersionService.saveVersion(1361, pre_version_name, list.get(0).getVersionName(), list.size());
return list.get(0).getVersionName();
}
}

View File

@ -0,0 +1,98 @@
package com.syjiaer.clinic.server.service.social;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.syjiaer.clinic.server.common.util.DateUtil;
import com.syjiaer.clinic.server.common.util.HttpUtil;
import com.syjiaer.clinic.server.common.vo.Page;
import com.syjiaer.clinic.server.entity.social.SocialDiagnose;
import com.syjiaer.clinic.server.entity.social.SocialIcpcItem;
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
import com.syjiaer.clinic.server.mapper.social.SocialIcpcItemMapper;
import com.syjiaer.clinic.server.service.BaseService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@Service
public class SocialIcpcItemService extends BaseService {
@Autowired
private HttpUtil httpUtil;
@Autowired
private SocialIcpcItemMapper socialIcpcItemMapper;
@Autowired
private SocialDirectoryVersionService socialDirectoryVersionService;
public String download(String pre_version_name) {
JSONArray jsonArray = httpUtil.download2(pre_version_name, 1362);
List<String> code_list = new ArrayList<>();
DateTimeFormatter dateTimeFormatter = DateUtil.getDateTimeFormatter(DateUtil.DATE_TIME_FORMAT);
List<SocialIcpcItem> list = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
if (!jsonObject.getString("vali_flag").equals("1")) {
continue;
}
SocialIcpcItem socialIcpcItem = new SocialIcpcItem();
socialIcpcItem.setChrgitmProvCode(jsonObject.getString("chrgitm_prov_code"));
socialIcpcItem.setCode(jsonObject.getString("chrgitm_nat_code"));
socialIcpcItem.setName(jsonObject.getString("chrgitm_name"));
socialIcpcItem.setIcpcCode(jsonObject.getString("icpc_code"));
socialIcpcItem.setIcpcCodeFlag(jsonObject.getString("icpc_code_flag"));
socialIcpcItem.setChrgitmAttr(jsonObject.getString("chrgitm_attr"));
if (jsonObject.getString("efft_time") != null && !jsonObject.getString("efft_time").isEmpty()) {
socialIcpcItem.setEfftTime(LocalDateTime.parse(jsonObject.getString("efft_time"), dateTimeFormatter));
} else {
socialIcpcItem.setEfftTime(null);
}
if (jsonObject.getString("invd_time") != null && !jsonObject.getString("invd_time").isEmpty()) {
socialIcpcItem.setInvdTime(LocalDateTime.parse(jsonObject.getString("invd_time"), dateTimeFormatter));
} else {
socialIcpcItem.setInvdTime(null);
}
socialIcpcItem.setRid(jsonObject.getString("rid"));
socialIcpcItem.setMemo(jsonObject.getString("memo"));
if (jsonObject.getString("updt_time") != null && !jsonObject.getString("updt_time").isEmpty()) {
socialIcpcItem.setUpdtTime(LocalDateTime.parse(jsonObject.getString("updt_time"), dateTimeFormatter));
} else {
socialIcpcItem.setUpdtTime(null);
}
if (jsonObject.getString("crte_time") != null && !jsonObject.getString("crte_time").isEmpty()) {
socialIcpcItem.setCrteTime(LocalDateTime.parse(jsonObject.getString("crte_time"), dateTimeFormatter));
} else {
socialIcpcItem.setCrteTime(null);
}
socialIcpcItem.setVer(jsonObject.getString("ver"));
list.add(socialIcpcItem);
code_list.add(socialIcpcItem.getCode());
}
QueryWrapper<SocialIcpcItem> queryWrapper = new QueryWrapper<>();
queryWrapper.in("code", code_list);
socialIcpcItemMapper.delete(queryWrapper);
socialIcpcItemMapper.insert(list, 100);
socialDirectoryVersionService.saveVersion(1362, pre_version_name, list.get(0).getVer(), list.size());
return list.get(0).getVer();
}
public Page<SocialIcpcItem> getDocList(int type, int page, int size, String keyword) {
QueryWrapper<SocialIcpcItem> codeqw = new QueryWrapper<>();
//模糊搜索
if (!keyword.trim().isEmpty()) {
codeqw.like("name", keyword);
codeqw.or().like("code", keyword);
}
// 执行查询
Page<SocialIcpcItem> pageResult = pageHelper(page, size, codeqw, socialIcpcItemMapper, "updt_time", false);
return pageResult;
}
}

View File

@ -83,7 +83,6 @@ public class SocialItemService extends BaseService {
if (!keyword.trim().isEmpty()) { if (!keyword.trim().isEmpty()) {
codeqw.like("name", keyword); codeqw.like("name", keyword);
codeqw.or().like("code", keyword); codeqw.or().like("code", keyword);
codeqw.or().like("keyword", keyword);
} }
// 执行查询 // 执行查询
Page<SocialItem> createDatetime = pageHelper(page, size, codeqw, socialItemMapper, "create_datetime", false); Page<SocialItem> createDatetime = pageHelper(page, size, codeqw, socialItemMapper, "create_datetime", false);

View File

@ -21,8 +21,8 @@ public class SocialTcmDiseaseCatalogueService {
private SocialTcmDiseaseCatalogueMapper socialTcmDiseaseCatalogueMapper; private SocialTcmDiseaseCatalogueMapper socialTcmDiseaseCatalogueMapper;
@Autowired @Autowired
private SocialDirectoryVersionService socialDirectoryVersionService; private SocialDirectoryVersionService socialDirectoryVersionService;
public String download(int type, String version_name) { public String download( String version_name) {
List<String[]> tabList = httpUtil.download(version_name, type); List<String[]> tabList = httpUtil.download(version_name, 1314);
DateTimeFormatter dateTimeFormatter = DateUtil.getDateTimeFormatter(DateUtil.DATE_TIME_FORMAT); DateTimeFormatter dateTimeFormatter = DateUtil.getDateTimeFormatter(DateUtil.DATE_TIME_FORMAT);
List<String> code_list = new ArrayList<>(); List<String> code_list = new ArrayList<>();
List<SocialTcmDiseaseCatalogue> list = new ArrayList<>(); List<SocialTcmDiseaseCatalogue> list = new ArrayList<>();
@ -45,7 +45,7 @@ public class SocialTcmDiseaseCatalogueService {
queryWrapper.in("social_code", code_list); queryWrapper.in("social_code", code_list);
socialTcmDiseaseCatalogueMapper.delete(queryWrapper); socialTcmDiseaseCatalogueMapper.delete(queryWrapper);
socialTcmDiseaseCatalogueMapper.insert(list, 100); socialTcmDiseaseCatalogueMapper.insert(list, 100);
socialDirectoryVersionService.saveVersion(type, version_name, list.get(0).getVersionName(), list.size()); socialDirectoryVersionService.saveVersion(1314, version_name, list.get(0).getVersionName(), list.size());
return list.get(0).getVersionName(); return list.get(0).getVersionName();
} }
} }

View File

@ -1,110 +1,30 @@
[ [
{ {
"4": { "4": {
"en": "json.name", "en": "name",
"zh": "名称", "zh": "名称",
"column_width": 200 "column_width": 200
} }
}, },
{ {
"1": { "1": {
"en": "json.code", "en": "code",
"zh": "西医疾病诊断ID", "zh": "西医疾病诊断ID",
"column_width": 200 "column_width": 200
} }
}, },
{ {
"4": { "16": {
"en": "json.chapter_name", "en": "creation_time",
"zh": "章名称", "zh": "数据创建时间",
"column_width":200
}
},
{
"17": {
"en": "update_time",
"zh": "数据更新时间",
"column_width": 200 "column_width": 200
} }
},
{
"6": {
"en": "json.secondary_name",
"zh": "节名称",
"column_width": 200
}
},
{
"8": {
"en": "json.category_name",
"zh": "类目名称",
"column_width": 200
}
},
{
"10": {
"en": "json.suborder_name",
"zh": "亚目名称",
"column_width": 200
}
},
{
"12": {
"en": "json.diagnosis_name",
"zh": "诊断名称",
"column_width": 200
}
},
{
"13": {
"en": "json.usage_flag",
"zh": "使用标记",
"column_width": 200
}
},
{
"14": {
"en": "json.national_standard_diagnosis_code",
"zh": "国标版诊断代码",
"column_width": 200
}
},
{
"15": {
"en": "json.national_standard_diagnosis_name",
"zh": "国标版诊断名称",
"column_width": 200
}
},
{
"18": {
"en": "json.remarks",
"zh": "备注",
"column_width": 200
}
},
{
"19": {
"en": "json.valid_flag",
"zh": "有效标志"
}
},
{
"20": {
"en": "json.unique_record_number",
"zh": "唯一记录号"
}
},
{
"21": {
"en": "json.data_creation_time",
"zh": "数据创建时间"
}
},
{
"22": {
"en": "json.data_update_time",
"zh": "数据更新时间"
}
},
{
"23": {
"en": "json.version_name",
"zh": "版本名称",
"column_width": 0
}
} }
] ]

View File

@ -29,7 +29,7 @@
}, },
{ {
"15": { "15": {
"en": "json.disease_name", "en": "json.name",
"zh": "慢特病种名称", "zh": "慢特病种名称",
"column_width": 200 "column_width": 200
} }

View File

@ -1,68 +1,16 @@
[ [
{ {
"2": { "2": {
"en": "json.name", "en": "name",
"zh": "门诊诊疗名称", "zh": "门诊诊疗名称",
"column_width": 200 "column_width": 200
} }
}, },
{ {
"1": { "1": {
"en": "json.code", "en": "code",
"zh": "门诊诊疗代码", "zh": "门诊诊疗代码",
"column_width": 200 "column_width": 200
} }
},
{
"4": {
"en": "json.diagnosis_treatment_type",
"zh": "就诊类型",
"column_width": 200
}
},
{
"8": {
"en": "json.remarks",
"zh": "备注",
"column_width": 200
}
},
{
"9": {
"en": "json.valid_flag",
"zh": "有效标志",
"column_width": 200
}
},
{
"10": {
"en": "json.unique_record_number",
"zh": "唯一记录号"
}
},
{
"14": {
"en": "json.create_datetime",
"zh": "数据创建时间"
}
},
{
"11": {
"en": "json.update_datetime",
"zh": "数据更新时间"
}
},
{
"5": {
"en": "json.version_number",
"zh": "版本号"
}
},
{
"5": {
"en": "json.version_name",
"zh": "版本名称",
"column_width": 0
}
} }
] ]

View File

@ -1,68 +1,62 @@
[ [
{ {
"3": { "1": {
"en": "json.name", "en": "name",
"zh": "收费项目名称", "zh": "收费项目名称",
"column_width": 200 "column_width": 200
} }
}, },
{ {
"1": { "2": {
"en": "json.code", "en": "code",
"zh": "收费项目省代码,收费项目国家代码", "zh": "国家代码",
"column_width": 200
}
},
{
"3": {
"en": "chrgitmProvCode",
"zh": "省代码",
"column_width": 200 "column_width": 200
} }
}, },
{ {
"4": { "4": {
"en": "json.icpc_code", "en": "code",
"zh": "ICPC编码", "zh": "收费项目省代码,收费项目国家代码",
"column_width": 200 "column_width": 200
} }
}, },
{ {
"6": { "5": {
"en": "json.charge_item_attribute", "en": "code",
"zh": "收费项目属性", "zh": "收费项目省代码,收费项目国家代码",
"column_width": 200 "column_width": 200
} }
}, }
,
{ {
"11": { "5": {
"en": "json.valid_flag", "en": "code",
"zh": "有效标志", "zh": "收费项目省代码,收费项目国家代码",
"column_width": 200 "column_width": 200
} }
},
{
"12": {
"en": "json.unique_record_number",
"zh": "唯一记录号"
} }
}, ,
{
"16": {
"en": "json.create_datetime",
"zh": "数据创建时间"
}
},
{
"13": {
"en": "json.update_datetime",
"zh": "数据更新时间"
}
},
{ {
"7": { "7": {
"en": "json.version_number", "en": "code",
"zh": "版本号" "zh": "收费项目省代码,收费项目国家代码",
"column_width": 200
} }
}, }
,
{ {
"7": { "8": {
"en": "json.version_name", "en": "code",
"zh": "版本名称", "zh": "收费项目省代码,收费项目国家代码",
"column_width": 0 "column_width": 200
} }
} }
] ]

View File

@ -0,0 +1,5 @@
<?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.syjiaer.clinic.server.mapper.social.SocialIcpcDiagnosisMapper">
</mapper>

View File

@ -0,0 +1,5 @@
<?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.syjiaer.clinic.server.mapper.social.SocialIcpcItemMapper">
</mapper>