deb
This commit is contained in:
parent
c19f7b8d83
commit
fb0dcc8793
|
|
@ -7,6 +7,7 @@ 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.*;
|
import com.syjiaer.clinic.server.entity.social.*;
|
||||||
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
|
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
|
||||||
|
import com.syjiaer.clinic.server.entity.social.vo.SocialItemVo;
|
||||||
import com.syjiaer.clinic.server.service.social.*;
|
import com.syjiaer.clinic.server.service.social.*;
|
||||||
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;
|
||||||
|
|
@ -56,7 +57,11 @@ public class SocialDirectoryController extends BaseController {
|
||||||
String code = parmsUtil.getString("code");
|
String code = parmsUtil.getString("code");
|
||||||
return success(socialDirectoryService.getByCode(code));
|
return success(socialDirectoryService.getByCode(code));
|
||||||
}
|
}
|
||||||
|
@RequestMapping("getItemByCode")
|
||||||
|
public Result<SocialItemVo> getItemByCode() {
|
||||||
|
String code = parmsUtil.getString("code");
|
||||||
|
return success(socialItemService.getByCode(code));
|
||||||
|
}
|
||||||
@PostMapping("download")
|
@PostMapping("download")
|
||||||
public Result<Object> download() {
|
public Result<Object> download() {
|
||||||
Map<String, Object> parms = getParms();
|
Map<String, Object> parms = getParms();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.syjiaer.clinic.server.entity.social.vo;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
|
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 lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author NiuZiYuan
|
||||||
|
* @since 2025-04-17
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SocialItemVo implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty("项目名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("医保编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty("单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@ApiModelProperty("数据创建时间")
|
||||||
|
private LocalDateTime createDatetime;
|
||||||
|
|
||||||
|
@ApiModelProperty("版本名称")
|
||||||
|
private String versionName;
|
||||||
|
|
||||||
|
@ApiModelProperty("数据修改时间")
|
||||||
|
private LocalDateTime updateDatetime;
|
||||||
|
|
||||||
|
|
||||||
|
private String hilistLmtpricType;
|
||||||
|
|
||||||
|
private BigDecimal hilistPricUplmtAmt;
|
||||||
|
|
||||||
|
private String chrgitmLv;
|
||||||
|
|
||||||
|
private String selfpayPropType;
|
||||||
|
|
||||||
|
private BigDecimal selfpayProp;
|
||||||
|
|
||||||
|
private LocalDateTime begndate;
|
||||||
|
|
||||||
|
private LocalDateTime enddate;
|
||||||
|
|
||||||
|
private String wubi;
|
||||||
|
|
||||||
|
private String pinyin;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
package com.syjiaer.clinic.server.service.social;
|
package com.syjiaer.clinic.server.service.social;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
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.common.vo.Page;
|
||||||
import com.syjiaer.clinic.server.entity.social.SocialDirectory;
|
import com.syjiaer.clinic.server.entity.social.*;
|
||||||
import com.syjiaer.clinic.server.entity.social.SocialItem;
|
|
||||||
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
|
import com.syjiaer.clinic.server.entity.social.vo.SocialDirectoryView;
|
||||||
|
import com.syjiaer.clinic.server.entity.social.vo.SocialItemVo;
|
||||||
|
import com.syjiaer.clinic.server.mapper.social.SocialDirectoryLimitMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.social.SocialDirectorySelfMapper;
|
||||||
|
import com.syjiaer.clinic.server.mapper.social.SocialDirectoryUpinfoMapper;
|
||||||
import com.syjiaer.clinic.server.mapper.social.SocialItemMapper;
|
import com.syjiaer.clinic.server.mapper.social.SocialItemMapper;
|
||||||
import com.syjiaer.clinic.server.service.BaseService;
|
import com.syjiaer.clinic.server.service.BaseService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
@ -22,18 +26,24 @@ public class SocialItemService extends BaseService {
|
||||||
private SocialItemMapper socialItemMapper;
|
private SocialItemMapper socialItemMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private SocialDirectoryVersionService socialDirectoryVersionService;
|
private SocialDirectoryVersionService socialDirectoryVersionService;
|
||||||
|
@Autowired
|
||||||
|
private SocialDirectoryUpinfoMapper socialDirectoryUpinfoMapper;
|
||||||
|
@Autowired
|
||||||
|
private SocialDirectoryLimitMapper socialDirectoryLimitMapper;
|
||||||
|
@Autowired
|
||||||
|
private SocialDirectorySelfMapper socialDirectorySelfMapper;
|
||||||
|
|
||||||
public String download( String version_name) {
|
public String download(String version_name) {
|
||||||
List<String[]> tab_list = httpUtil.download(version_name, 1305);
|
List<String[]> tab_list = httpUtil.download(version_name, 1305);
|
||||||
if (tab_list.isEmpty()){
|
if (tab_list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<SocialItem> list = new ArrayList<>();
|
List<SocialItem> list = new ArrayList<>();
|
||||||
String value = String.valueOf(1305);
|
String value = String.valueOf(1305);
|
||||||
List<String> codeList = new ArrayList<>();
|
List<String> codeList = new ArrayList<>();
|
||||||
String next_version_name="";
|
String next_version_name = "";
|
||||||
for (int i=0;i<tab_list.size();i++) {
|
for (int i = 0; i < tab_list.size(); i++) {
|
||||||
String[] line_array= tab_list.get(i);
|
String[] line_array = tab_list.get(i);
|
||||||
String flag = "";
|
String flag = "";
|
||||||
SocialItem socialItem = new SocialItem();
|
SocialItem socialItem = new SocialItem();
|
||||||
if (value.equals("1305")) {
|
if (value.equals("1305")) {
|
||||||
|
|
@ -43,7 +53,7 @@ public class SocialItemService extends BaseService {
|
||||||
socialItem.setName(line_array[9]);
|
socialItem.setName(line_array[9]);
|
||||||
socialItem.setVersionName(line_array[15]);
|
socialItem.setVersionName(line_array[15]);
|
||||||
socialItem.setUnit(line_array[1]);
|
socialItem.setUnit(line_array[1]);
|
||||||
}else if (value.equals("1321")) {
|
} else if (value.equals("1321")) {
|
||||||
flag = line_array[13];
|
flag = line_array[13];
|
||||||
String code = line_array[2];
|
String code = line_array[2];
|
||||||
socialItem.setCode(code);
|
socialItem.setCode(code);
|
||||||
|
|
@ -51,7 +61,7 @@ public class SocialItemService extends BaseService {
|
||||||
socialItem.setVersionName(line_array[21]);
|
socialItem.setVersionName(line_array[21]);
|
||||||
socialItem.setUnit(line_array[10]);
|
socialItem.setUnit(line_array[10]);
|
||||||
}
|
}
|
||||||
if(i==0){
|
if (i == 0) {
|
||||||
next_version_name = line_array[15];
|
next_version_name = line_array[15];
|
||||||
}
|
}
|
||||||
if (!flag.equals("1")) {
|
if (!flag.equals("1")) {
|
||||||
|
|
@ -61,10 +71,10 @@ public class SocialItemService extends BaseService {
|
||||||
list.add(socialItem);
|
list.add(socialItem);
|
||||||
}
|
}
|
||||||
socialDirectoryVersionService.saveVersion(1305, version_name, next_version_name, list.size());
|
socialDirectoryVersionService.saveVersion(1305, version_name, next_version_name, list.size());
|
||||||
if(list.isEmpty()){
|
if (list.isEmpty()) {
|
||||||
return next_version_name;
|
return next_version_name;
|
||||||
}
|
}
|
||||||
if(!codeList.isEmpty()){
|
if (!codeList.isEmpty()) {
|
||||||
QueryWrapper<SocialItem> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<SocialItem> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.in("code", codeList);
|
queryWrapper.in("code", codeList);
|
||||||
socialItemMapper.delete(queryWrapper);
|
socialItemMapper.delete(queryWrapper);
|
||||||
|
|
@ -87,7 +97,7 @@ public class SocialItemService extends BaseService {
|
||||||
// 执行查询
|
// 执行查询
|
||||||
Page<SocialItem> createDatetime = pageHelper(page, size, codeqw, socialItemMapper, "create_datetime", false);
|
Page<SocialItem> createDatetime = pageHelper(page, size, codeqw, socialItemMapper, "create_datetime", false);
|
||||||
List<SocialDirectoryView> list = new ArrayList<>();
|
List<SocialDirectoryView> list = new ArrayList<>();
|
||||||
for (SocialItem socialItem : createDatetime.getList()){
|
for (SocialItem socialItem : createDatetime.getList()) {
|
||||||
SocialDirectoryView view = new SocialDirectoryView();
|
SocialDirectoryView view = new SocialDirectoryView();
|
||||||
BeanUtils.copyProperties(socialItem, view);
|
BeanUtils.copyProperties(socialItem, view);
|
||||||
list.add(view);
|
list.add(view);
|
||||||
|
|
@ -101,10 +111,43 @@ public class SocialItemService extends BaseService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Page<SocialItem> pageList(Integer pageNum, Integer pageSize,String keyword) {
|
public Page<SocialItem> pageList(Integer pageNum, Integer pageSize, String keyword) {
|
||||||
QueryWrapper<SocialItem> codeqw = new QueryWrapper<>();
|
QueryWrapper<SocialItem> codeqw = new QueryWrapper<>();
|
||||||
codeqw.like("name", keyword);
|
codeqw.like("name", keyword);
|
||||||
codeqw.or().like("code", keyword);
|
codeqw.or().like("code", keyword);
|
||||||
return pageHelper(pageNum, pageSize, codeqw, socialItemMapper, "id", false);
|
return pageHelper(pageNum, pageSize, codeqw, socialItemMapper, "id", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SocialItemVo getByCode(String code) {
|
||||||
|
return fullInfo(code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SocialItemVo fullInfo(String code) {
|
||||||
|
QueryWrapper<SocialItem> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("code", code);
|
||||||
|
SocialItem socialItem = socialItemMapper.selectOne(queryWrapper);
|
||||||
|
if (socialItem == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
SocialItemVo socialItemVo = JSONObject.parseObject(JSONObject.toJSONString(socialItem), SocialItemVo.class);
|
||||||
|
SocialDirectoryUpinfo socialDirectoryUpinfo = socialDirectoryUpinfoMapper.selectByCode(code);
|
||||||
|
if (socialDirectoryUpinfo != null) {
|
||||||
|
socialDirectoryUpinfo.setBegndate(socialDirectoryUpinfo.getBegndate());
|
||||||
|
socialItemVo.setEnddate(socialDirectoryUpinfo.getEnddate());
|
||||||
|
socialItemVo.setWubi(socialDirectoryUpinfo.getWubi());
|
||||||
|
socialItemVo.setPinyin(socialDirectoryUpinfo.getPinyin());
|
||||||
|
socialItemVo.setChrgitmLv(socialDirectoryUpinfo.getChrgitmLv());
|
||||||
|
}
|
||||||
|
SocialDirectoryLimit socialDirectoryLimit = socialDirectoryLimitMapper.selectByCode(code);
|
||||||
|
if (socialDirectoryLimit != null) {
|
||||||
|
socialItemVo.setHilistPricUplmtAmt(socialDirectoryLimit.getHilistPricUplmtAmt());
|
||||||
|
socialItemVo.setHilistLmtpricType(socialDirectoryLimit.getHilistLmtpricType());
|
||||||
|
}
|
||||||
|
SocialDirectorySelf socialDirectorySelf = socialDirectorySelfMapper.selectByCode(code);
|
||||||
|
if (socialDirectorySelf != null) {
|
||||||
|
socialItemVo.setSelfpayPropType(socialDirectorySelf.getSelfpayPropType());
|
||||||
|
socialItemVo.setSelfpayProp(socialDirectorySelf.getSelfpayProp());
|
||||||
|
}
|
||||||
|
return socialItemVo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue