deb
This commit is contained in:
parent
53ec8eab04
commit
4145455f9b
|
|
@ -22,8 +22,7 @@ public class IM2203A extends BaseInputModel{
|
|||
@IMField(key = "diseinfo", name = "诊断信息", required = true)
|
||||
private List<Diseinfo> diseinfo;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Data
|
||||
public static class Mdtrtinfo{
|
||||
@IMField(key = "mdtrt_id", name = "就诊ID", required = true)
|
||||
private String mdtrt_id;
|
||||
|
|
@ -50,8 +49,7 @@ public class IM2203A extends BaseInputModel{
|
|||
@IMField(key = "exp_content", name = "字段扩展")
|
||||
private ExpContent exp_content;
|
||||
}
|
||||
@Getter
|
||||
@Setter
|
||||
@Data
|
||||
public static class Diseinfo{
|
||||
@IMField(key = "diag_type", name = "诊断类别", required = true)
|
||||
private String diag_type;
|
||||
|
|
|
|||
|
|
@ -62,9 +62,7 @@ public class ItemController extends BaseController {
|
|||
@RequestMapping("/search")
|
||||
public Result<List<Item>> search() {
|
||||
String keyword = parmsUtil.getString("keyword");
|
||||
if (keyword == null || keyword.isEmpty()) {
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
|
||||
return success(itemService.search(keyword));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,21 +4,20 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
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
|
||||
* @since 2025-05-07
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -62,4 +61,13 @@ public class Item implements Serializable {
|
|||
|
||||
@ApiModelProperty("逻辑删除")
|
||||
private Integer delFlag;
|
||||
|
||||
@ApiModelProperty("使用次数")
|
||||
private Integer useNum;
|
||||
|
||||
@ApiModelProperty("全拼")
|
||||
private String pinyinFull;
|
||||
|
||||
@ApiModelProperty("拼音首字母")
|
||||
private String pinyinFirst;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ public class SocialDirectoryView implements Serializable {
|
|||
private String wubi;
|
||||
|
||||
private String pinyin;
|
||||
private String lmtUsedFlag;
|
||||
private JSONObject json;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
package com.syjiaer.clinic.server.mapper.item;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.syjiaer.clinic.server.entity.item.Item;
|
||||
import com.syjiaer.clinic.server.entity.social.SocialDiagnose;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -13,6 +18,5 @@ import com.syjiaer.clinic.server.entity.item.Item;
|
|||
* @since 2025-04-17
|
||||
*/
|
||||
public interface ItemMapper extends BaseMapper<Item> {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import com.syjiaer.clinic.server.mapper.patient.PatientInfoMapper;
|
|||
import com.syjiaer.clinic.server.mapper.patient.PatientRegistrationMapper;
|
||||
import com.syjiaer.clinic.server.service.BaseService;
|
||||
import com.syjiaer.clinic.server.service.charge.ChargeService;
|
||||
import com.syjiaer.clinic.server.service.item.ItemService;
|
||||
import com.syjiaer.clinic.server.service.social.SocialDiagnoseService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -71,6 +72,8 @@ public class MedicalRecordService extends BaseService {
|
|||
@Autowired
|
||||
private PatientRegistrationMapper patientRegistrationMapper;
|
||||
@Autowired
|
||||
private ItemService itemService;
|
||||
@Autowired
|
||||
private ItemMapper itemMapper;
|
||||
@Autowired
|
||||
private GoodsMapper goodsMapper;
|
||||
|
|
@ -140,8 +143,9 @@ public class MedicalRecordService extends BaseService {
|
|||
//服务项目表
|
||||
Integer medicalRecordId = diagnosisMedicalRecord.getId();
|
||||
List<DiagnosisMedicalItemList> itemLists = new ArrayList<>();
|
||||
|
||||
List<Integer> itemIds = new ArrayList<>();
|
||||
for (ItemRetailDto item : saveDto.getItemList()) {
|
||||
itemIds.add(item.getId());
|
||||
Item dbItem = itemMapper.selectById(item.getId());
|
||||
DiagnosisMedicalItemList itemDetail = new DiagnosisMedicalItemList();
|
||||
itemDetail.setDiagnosisCode(code);
|
||||
|
|
@ -158,7 +162,6 @@ public class MedicalRecordService extends BaseService {
|
|||
|
||||
}
|
||||
diagnosisMedicalItemListMapper.insert(itemLists);
|
||||
|
||||
List<DiagnosisMedicalGoodsList> goodsLists = new ArrayList<>();
|
||||
for (GoodsRetailDto goodsRetailDto : saveDto.getGoodsList()) {
|
||||
Goods dbGoods = goodsMapper.selectById(goodsRetailDto.getId());
|
||||
|
|
@ -181,6 +184,8 @@ public class MedicalRecordService extends BaseService {
|
|||
System.out.println(saveDto.getDiagnosisMedicalRecord().getDiagnosisDetail());
|
||||
List<SocialDiagnose> diagnoseList = JSONArray.parseArray(saveDto.getDiagnosisMedicalRecord().getDiagnosisDetail(),SocialDiagnose.class);
|
||||
socialDiagnoseService.updateNumAddOne(diagnoseList);
|
||||
itemService.updateNumAddOne(itemIds);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,16 +1,20 @@
|
|||
package com.syjiaer.clinic.server.service.item;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||
import com.syjiaer.clinic.server.common.util.PinYinUtil;
|
||||
import com.syjiaer.clinic.server.common.vo.Page;
|
||||
import com.syjiaer.clinic.server.entity.item.Item;
|
||||
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
||||
import com.syjiaer.clinic.server.entity.social.SocialDiagnose;
|
||||
import com.syjiaer.clinic.server.mapper.item.ItemMapper;
|
||||
import com.syjiaer.clinic.server.service.BaseService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -51,9 +55,25 @@ public class ItemService extends BaseService {
|
|||
if (item == null) {
|
||||
throw new MessageException("item参数为空");
|
||||
}
|
||||
if (item.getItemName() == null || item.getItemName().isEmpty()){
|
||||
throw new MessageException("项目名称不能为空");
|
||||
}
|
||||
if (item.getItemSocialCode() == null || item.getItemSocialCode().isEmpty()){
|
||||
throw new MessageException("项目医保目录编码不能为空");
|
||||
}
|
||||
if (item.getUnit() == null || item.getUnit().isEmpty()){
|
||||
throw new MessageException("单位不能为空");
|
||||
}
|
||||
if (item.getUnitPrice() == null || item.getUnitPrice().compareTo(BigDecimal.ZERO) <= 0){
|
||||
throw new MessageException("售价不能小于0");
|
||||
}
|
||||
ManagerUser managerUser = getManagerUser();
|
||||
item.setCreateDatetime(LocalDateTime.now());
|
||||
item.setCreateBy(managerUser.getName());
|
||||
String pinyin_full= PinYinUtil.getPinyinFull(item.getItemName());
|
||||
pinyin_full = pinyin_full.toUpperCase();
|
||||
item.setPinyinFull(pinyin_full);
|
||||
item.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(item.getItemName()).toUpperCase());
|
||||
itemMapper.insertOrUpdate(item);
|
||||
}
|
||||
|
||||
|
|
@ -63,10 +83,12 @@ public class ItemService extends BaseService {
|
|||
if (id == null) {
|
||||
throw new MessageException("id参数为空");
|
||||
}
|
||||
|
||||
Item item = itemMapper.selectById(id);
|
||||
if (item == null || item.getDelFlag() == 1) {
|
||||
throw new MessageException("该服务项目已被删除或不存在");
|
||||
}
|
||||
|
||||
Item updateItem = new Item();
|
||||
updateItem.setId(id);
|
||||
updateItem.setDelFlag(1);
|
||||
|
|
@ -74,7 +96,10 @@ public class ItemService extends BaseService {
|
|||
}
|
||||
public List<Item> search(String keyword){
|
||||
QueryWrapper<Item> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.like("item_name", keyword);
|
||||
if (keyword != null && !keyword.isEmpty()){
|
||||
queryWrapper.like("item_name", keyword.toUpperCase());
|
||||
}
|
||||
queryWrapper.orderByDesc("use_num","update_datetime");
|
||||
queryWrapper.last("limit 20");
|
||||
return itemMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
|
@ -87,8 +112,34 @@ public class ItemService extends BaseService {
|
|||
if (item == null) {
|
||||
throw new MessageException("item参数为空");
|
||||
}
|
||||
if (item.getItemName() == null || item.getItemName().isEmpty()){
|
||||
throw new MessageException("项目名称不能为空");
|
||||
}
|
||||
if (item.getItemSocialCode() == null || item.getItemSocialCode().isEmpty()){
|
||||
throw new MessageException("项目医保目录编码不能为空");
|
||||
}
|
||||
if (item.getUnit() == null || item.getUnit().isEmpty()){
|
||||
throw new MessageException("单位不能为空");
|
||||
}
|
||||
if (item.getUnitPrice() == null || item.getUnitPrice().compareTo(BigDecimal.ZERO) <= 0){
|
||||
throw new MessageException("售价不能小于0");
|
||||
}
|
||||
item.setUpdateBy(getManagerUser().getName());
|
||||
item.setUpdateDatetime(LocalDateTime.now());
|
||||
String pinyin_full= PinYinUtil.getPinyinFull(item.getItemName());
|
||||
pinyin_full = pinyin_full.toUpperCase();
|
||||
item.setPinyinFull(pinyin_full);
|
||||
item.setPinyinFirst(PinYinUtil.getPinyinFirstLetters(item.getItemName()).toUpperCase());
|
||||
itemMapper.updateById(item);
|
||||
}
|
||||
|
||||
|
||||
public void updateNumAddOne(List<Integer> ids) {
|
||||
for (Integer itemId : ids){
|
||||
UpdateWrapper<Item> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.setSql("use_num = use_num+1");
|
||||
updateWrapper.eq("id",itemId);
|
||||
itemMapper.update(null,updateWrapper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -346,6 +346,7 @@ public class SocialDirectoryService extends BaseService {
|
|||
socialDirectoryView.setEnddate(socialDirectoryUpinfo.getEnddate());
|
||||
socialDirectoryView.setWubi(socialDirectoryUpinfo.getWubi());
|
||||
socialDirectoryView.setPinyin(socialDirectoryUpinfo.getPinyin());
|
||||
socialDirectoryView.setLmtUsedFlag(socialDirectoryUpinfo.getLmtUsedFlag());
|
||||
}
|
||||
SocialDirectoryLimit socialDirectoryLimit = socialDirectoryLimitMapper.selectByCode(code);
|
||||
if (socialDirectoryLimit != null) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue