Merge branch 'master' of ssh://git.jizhiweb.cn:2222/clinic-v2/server
This commit is contained in:
commit
92711ff453
|
|
@ -0,0 +1,15 @@
|
|||
package com.syjiaer.clinic.server.common.util;
|
||||
|
||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||
|
||||
public class CheckUtil {
|
||||
public static void checkValue(Boolean flag,String empty_message) {
|
||||
if(flag)throw new MessageException(empty_message);
|
||||
}
|
||||
public static void isEmpty(Object object,String message) {
|
||||
if(object==null){
|
||||
throw new MessageException(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
package com.syjiaer.clinic.server.enity.item;
|
||||
|
||||
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;
|
||||
/**
|
||||
* <p>
|
||||
* 诊疗项目
|
||||
* </p>
|
||||
*
|
||||
* @author NiuZiYuan
|
||||
* @since 2025-05-21
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value = "Item对象", description = "诊疗项目")
|
||||
public class Item implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("自增主键")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty("项目创建时间")
|
||||
private LocalDateTime createDatetime;
|
||||
|
||||
@ApiModelProperty("项目创建人")
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty("项目修改时间")
|
||||
private LocalDateTime updateDatetime;
|
||||
|
||||
@ApiModelProperty("项目修改人")
|
||||
private String updateBy;
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String itemName;
|
||||
|
||||
@ApiModelProperty("项目医保目录编码")
|
||||
private String itemSocialCode;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("售价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("进货价")
|
||||
private BigDecimal purchaseUnitPrice;
|
||||
|
||||
@ApiModelProperty("逻辑删除")
|
||||
private Integer delFlag;
|
||||
|
||||
@ApiModelProperty("使用次数")
|
||||
private Integer useNum;
|
||||
|
||||
@ApiModelProperty("全拼")
|
||||
private String pinyinFull;
|
||||
|
||||
@ApiModelProperty("拼音首字母")
|
||||
private String pinyinFirst;
|
||||
|
||||
@ApiModelProperty("是否为组套 0为false 1为true")
|
||||
private Byte isGroup;
|
||||
}
|
||||
|
|
@ -5,22 +5,21 @@ 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.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
/**
|
||||
* <p>
|
||||
* 收费服务详情
|
||||
* </p>
|
||||
*
|
||||
* @author NiuZiYuan
|
||||
* @since 2025-04-24
|
||||
* @since 2025-05-21
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -71,4 +70,7 @@ public class ChargeItemList implements Serializable {
|
|||
|
||||
@ApiModelProperty("日期")
|
||||
private LocalDate createDate;
|
||||
|
||||
@ApiModelProperty("是否为组套 0为false 1为true")
|
||||
private Boolean isGroup;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ public class ChargeItemListVo {
|
|||
|
||||
@ApiModelProperty("逻辑删除")
|
||||
private Integer delFlag;
|
||||
@ApiModelProperty("是否为组套 0为false 1为true")
|
||||
private Boolean isGroup;
|
||||
|
||||
@ApiModelProperty("选择的单价")
|
||||
private BigDecimal selectedPrice;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ import com.syjiaer.clinic.server.entity.goods.Goods;
|
|||
import com.syjiaer.clinic.server.entity.inventory.Inventory;
|
||||
import com.syjiaer.clinic.server.entity.inventory.InventoryLog;
|
||||
import com.syjiaer.clinic.server.entity.item.Item;
|
||||
import com.syjiaer.clinic.server.entity.item.ItemGroup;
|
||||
import com.syjiaer.clinic.server.entity.item.ItemGroupList;
|
||||
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
||||
|
|
@ -42,6 +44,8 @@ import com.syjiaer.clinic.server.mapper.diagnosis.DiagnosisMedicalRecordMapper;
|
|||
import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
|
||||
import com.syjiaer.clinic.server.mapper.inventory.InventoryLogMapper;
|
||||
import com.syjiaer.clinic.server.mapper.inventory.InventoryMapper;
|
||||
import com.syjiaer.clinic.server.mapper.item.ItemGroupListMapper;
|
||||
import com.syjiaer.clinic.server.mapper.item.ItemGroupMapper;
|
||||
import com.syjiaer.clinic.server.mapper.item.ItemMapper;
|
||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationSectionMapper;
|
||||
|
|
@ -103,6 +107,8 @@ public class ChargeService extends BaseService {
|
|||
@Autowired
|
||||
private InventoryLogMapper inventoryLogMapper;
|
||||
@Autowired
|
||||
private ItemGroupListMapper itemGroupListMapper;
|
||||
@Autowired
|
||||
private SocialRequest socialRequest;
|
||||
@Autowired
|
||||
private DiagnosisMedicalRecordMapper diagnosisMedicalRecordMapper;
|
||||
|
|
@ -151,6 +157,8 @@ public class ChargeService extends BaseService {
|
|||
diagnosisMedicalRecordMapper.updateById(medicalRecord);
|
||||
List<DiagnosisMedicalItemList> mdItmeList = new ArrayList<>();
|
||||
for (ChargeItemListVo item : dto.getItemDetail()) {
|
||||
|
||||
|
||||
DiagnosisMedicalItemList itemDetail = new DiagnosisMedicalItemList();
|
||||
itemDetail.setItemId(item.getId());
|
||||
itemDetail.setDiagnosisCode(diaCode);
|
||||
|
|
@ -160,6 +168,8 @@ public class ChargeService extends BaseService {
|
|||
itemDetail.setUnit(item.getSelectedUnit());
|
||||
itemDetail.setUnitPrice(item.getSelectedPrice());
|
||||
mdItmeList.add(itemDetail);
|
||||
|
||||
|
||||
}
|
||||
diagnosisMedicalItemListMapper.insert(mdItmeList);
|
||||
List<DiagnosisMedicalGoodsList> mdGoodsList = new ArrayList<>();
|
||||
|
|
@ -203,7 +213,45 @@ public class ChargeService extends BaseService {
|
|||
List<ChargeItemList> chargeServiceLists = new ArrayList<>();
|
||||
for (
|
||||
ChargeItemListVo service : dto.getItemDetail()) {
|
||||
Item dbService = itemMapper.selectById(service.getId());
|
||||
if (dbService == null) {
|
||||
throw new MessageException("服务项目不存在");
|
||||
}
|
||||
//组套逻辑
|
||||
if (dbService.getIsGroup()) {
|
||||
List<ItemGroupList> itemGroupList = itemGroupListMapper.selectList(new QueryWrapper<ItemGroupList>().eq("item_id", dbService.getId()));
|
||||
if (itemGroupList.isEmpty()) {
|
||||
throw new MessageException("组套:" + service.getItemName() + "没有绑定商品数据");
|
||||
}
|
||||
for (ItemGroupList itemGroup : itemGroupList) {
|
||||
String fsn = StringUtil.getCode("FSN");
|
||||
ChargeItemList itemList = new ChargeItemList();
|
||||
itemList.setChargeOrderCode(code);
|
||||
itemList.setServiceId(itemGroup.getId());
|
||||
|
||||
itemList.setPreUnitPrice(itemGroup.getUnitPrice());
|
||||
itemList.setUnitPrice(itemGroup.getUnitPrice());
|
||||
itemList.setNumber(itemGroup.getNumber());
|
||||
|
||||
itemList.setUnit(itemGroup.getUnit());
|
||||
itemList.setName(itemGroup.getName());
|
||||
itemList.setFeedetlSn(fsn);
|
||||
itemList.setCreateDate(nowLocalDate);
|
||||
itemList.setCreateTime(nowLocalDateTime);
|
||||
itemList.setIsGroup(true);
|
||||
|
||||
BigDecimal subPrice = itemList.getUnitPrice().multiply(BigDecimal.valueOf(itemGroup.getNumber()));
|
||||
itemList.setSubTotalPrice(subPrice);
|
||||
chargeServiceLists.add(itemList);
|
||||
preTotalPrice = preTotalPrice.add(subPrice);
|
||||
totalPrice = totalPrice.add(subPrice);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
ChargeItemList itemList = new ChargeItemList();
|
||||
|
||||
String fsn = StringUtil.getCode("FSN");
|
||||
itemList.setChargeOrderCode(code);
|
||||
itemList.setServiceId(service.getId());
|
||||
|
|
@ -217,11 +265,13 @@ public class ChargeService extends BaseService {
|
|||
itemList.setFeedetlSn(fsn);
|
||||
itemList.setCreateDate(nowLocalDate);
|
||||
itemList.setCreateTime(nowLocalDateTime);
|
||||
itemList.setIsGroup(false);
|
||||
chargeServiceLists.add(itemList);
|
||||
BigDecimal subPrice = service.getSelectedPrice().multiply(BigDecimal.valueOf(service.getSelectedNum()));
|
||||
preTotalPrice = preTotalPrice.add(subPrice);
|
||||
totalPrice = totalPrice.add(subPrice);
|
||||
}
|
||||
}
|
||||
chargeItemListMapper.insert(chargeServiceLists);
|
||||
|
||||
List<ChargeGoodsList> chargeGoodsLists = new ArrayList<>();
|
||||
|
|
@ -409,8 +459,6 @@ public class ChargeService extends BaseService {
|
|||
this.recordChargeLog(order, ChargeSourceEnum.CHARGE, ChargeTypeEnum.CHARGE);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void uploadCostDetails(String changeOrderCode) {
|
||||
|
|
@ -950,6 +998,7 @@ public class ChargeService extends BaseService {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号获取订单详情 小票打印用
|
||||
*/
|
||||
|
|
@ -985,7 +1034,6 @@ public class ChargeService extends BaseService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
chargeOrderPrintVo.setPatientInfo(patientPrintInfoVo);
|
||||
return chargeOrderPrintVo;
|
||||
|
||||
|
|
@ -993,6 +1041,7 @@ public class ChargeService extends BaseService {
|
|||
|
||||
/**
|
||||
* 根据诊断id和状态查询订单
|
||||
*
|
||||
* @param diagnosisCode
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -265,7 +265,11 @@ public class StatisticsService extends BaseService {
|
|||
chrgitmLvOverview.setChrgitmLv(chrgitmLvEnum.getCode());
|
||||
chrgitmLvOverview.setName(chrgitmLvEnum.getName());
|
||||
chrgitmLvOverview.setCount(count);
|
||||
String ratio =String.format("%.2f", (count * 100.0 / totalCount));
|
||||
String ratio = "0.00";
|
||||
if (totalCount != 0){
|
||||
ratio =String.format("%.2f", (count * 100.0 / totalCount));
|
||||
}
|
||||
|
||||
chrgitmLvOverview.setRatio(ratio+"%");
|
||||
chrgitmLvInfoList.add(chrgitmLvOverview);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue