parent
9ccd165c8d
commit
7bdeca12a1
|
|
@ -192,8 +192,14 @@ public class SocialRequest {
|
|||
return om2206A;
|
||||
}
|
||||
|
||||
public OM2207A call2207A(IM2207A im2207A) {
|
||||
JSONObject data = httpUtil.callBackMsgId("2207A",im2207A.buildToMap(),10000);
|
||||
/**
|
||||
* 需要在外层生成msgId
|
||||
* @param im2207A
|
||||
* @param msgId
|
||||
* @return
|
||||
*/
|
||||
public OM2207A call2207A(IM2207A im2207A,String msgId) {
|
||||
JSONObject data = httpUtil.callByMsgId(msgId,"2207A","data",im2207A.buildToMap(),10000);
|
||||
OM2207A om2207A=new OM2207A();
|
||||
om2207A.setMsgId(data.get("msgid").toString());
|
||||
om2207A.setSetlinfo(JSONObject.parseObject(data.get("setlinfo").toString(), OM2207A.Setlinfo.class));
|
||||
|
|
|
|||
|
|
@ -38,6 +38,17 @@ public class HttpUtil {
|
|||
private ManagerUserSignMapper managerUserSignMapper;
|
||||
|
||||
private Logger logger = Logger.getLogger(HttpUtil.class.getName());
|
||||
|
||||
public String generateMsgId() {
|
||||
Random random = new Random();
|
||||
int randomNumber = random.nextInt(9000) + 1000;
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
DateTimeFormatter now_str = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
return config.get("social", "msgid") + now_str.format(now) + String.valueOf(randomNumber);
|
||||
}
|
||||
|
||||
|
||||
private JSONObject post(String posturl, String params){
|
||||
return post(posturl, params, 120000);
|
||||
}
|
||||
|
|
@ -232,7 +243,11 @@ public class HttpUtil {
|
|||
JSONObject output = post(config.get("social", "url"), JSON.toJSONString(getparms(infno, tag, input)),timeout);
|
||||
return output;
|
||||
}
|
||||
|
||||
public JSONObject callByMsgId(String msgId, String infno, String tag, Map<String, Object> input, int timeout) {
|
||||
Map<String, Object> parmsMap = getparms(infno, tag, input);
|
||||
parmsMap.put("msgid", msgId);
|
||||
return callBackMsgIdDo(parmsMap);
|
||||
}
|
||||
public JSONObject callBackMsgId(String infno, Map<String, Object> input,int timeout) {
|
||||
Map<String, Object> parmsMap = getparms(infno, input);
|
||||
return callBackMsgIdDo(parmsMap);
|
||||
|
|
|
|||
|
|
@ -63,8 +63,7 @@ public class SocialController extends BaseController {
|
|||
String insutype = parmsUtil.getString("insutype");
|
||||
Integer payType = parmsUtil.getInteger("payType");
|
||||
String curBalc = parmsUtil.getString("curBalc");
|
||||
OM2207A om2207A = chargeService.socialRealPay(changeOrderCode,mdtrtCertType,mdtrtCertNO,insutype);
|
||||
chargeService.recordSocialInfo(om2207A, chargeService.getByCode(changeOrderCode), payType,curBalc);
|
||||
OM2207A om2207A = chargeService.socialRealPay(changeOrderCode,mdtrtCertType,mdtrtCertNO,insutype,payType);
|
||||
return success( );
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -90,17 +90,7 @@ public class SocialUploadController extends BaseController {
|
|||
@ApiOperation("进销存一键上报接口")
|
||||
@RequestMapping("quickUpload")
|
||||
public Result<NotDoNumberVo> quickUpload() {
|
||||
Boolean uploadResult = socialInventoryUploadService.upload3501();
|
||||
if (!uploadResult) {
|
||||
uploadResult = socialInventoryUploadService.upload3503();
|
||||
}
|
||||
if (!uploadResult){
|
||||
uploadResult = socialInventoryUploadService.upload3505();
|
||||
}
|
||||
if (!uploadResult) {
|
||||
uploadResult = socialInventoryUploadService.upload3502();
|
||||
}
|
||||
|
||||
socialInventoryUploadService.quickUpload();
|
||||
NotDoNumberVo notDoNumberVo = socialInventoryUploadService.getNotDoNumberDo();
|
||||
return success(notDoNumberVo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,5 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface SocialCompareCodeMapper extends BaseMapper<SocialCompareCode> {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.syjiaer.clinic.server.common.config.Config;
|
|||
import com.syjiaer.clinic.server.common.constants.Constants;
|
||||
import com.syjiaer.clinic.server.common.enums.*;
|
||||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||
import com.syjiaer.clinic.server.common.util.HttpUtil;
|
||||
import com.syjiaer.clinic.server.common.util.InfoUtil;
|
||||
import com.syjiaer.clinic.server.common.util.StringUtil;
|
||||
import com.syjiaer.clinic.server.common.vo.Page;
|
||||
|
|
@ -61,6 +62,8 @@ import com.syjiaer.clinic.server.service.charge.vo.RetailOrderDailyChargingRepor
|
|||
import com.syjiaer.clinic.server.service.diagnosis.DiagnosisService;
|
||||
import com.syjiaer.clinic.server.service.inventory.InventoryService;
|
||||
import com.syjiaer.clinic.server.service.social.SocialCompareService;
|
||||
import com.syjiaer.clinic.server.service.social.SocialReconciliationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
|
@ -73,6 +76,7 @@ import java.time.LocalDate;
|
|||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class ChargeService extends BaseService {
|
||||
@Autowired
|
||||
|
|
@ -134,6 +138,10 @@ public class ChargeService extends BaseService {
|
|||
private InventoryMapper inventoryMapper;
|
||||
@Autowired
|
||||
private SocialCompareService socialCompareService;
|
||||
@Autowired
|
||||
private HttpUtil httpUtil;
|
||||
@Autowired
|
||||
private SocialReconciliationService socialReconciliationService;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ChargeOrder save(ChargeSaveDto dto) {
|
||||
|
|
@ -302,39 +310,47 @@ public class ChargeService extends BaseService {
|
|||
|
||||
List<ChargeGoodsList> chargeGoodsLists = new ArrayList<>();
|
||||
for (ChargeGoodsListVo goods : dto.getGoodsDetail()) {
|
||||
ChargeGoodsList itemList = new ChargeGoodsList();
|
||||
ChargeGoodsList goodsList = new ChargeGoodsList();
|
||||
Goods dbGoods = goodsMapper.selectById(goods.getId());
|
||||
if (dbGoods == null) {
|
||||
throw new RuntimeException("商品不存在");
|
||||
}
|
||||
String fsn = StringUtil.getCode("FSN");
|
||||
itemList.setChargeOrderCode(code);
|
||||
itemList.setGoodsId(goods.getId());
|
||||
itemList.setPreUnitPrice(goods.getSelectedPrice());
|
||||
itemList.setUnitPrice(goods.getSelectedPrice());
|
||||
itemList.setNumber(goods.getSelectedNum());
|
||||
goodsList.setChargeOrderCode(code);
|
||||
goodsList.setGoodsId(goods.getId());
|
||||
goodsList.setPreUnitPrice(goods.getSelectedPrice());
|
||||
goodsList.setUnitPrice(goods.getSelectedPrice());
|
||||
goodsList.setNumber(goods.getSelectedNum());
|
||||
BigDecimal subTotalPrice = goods.getSelectedPrice().multiply(BigDecimal.valueOf(goods.getSelectedNum()));
|
||||
itemList.setSubTotalPrice(subTotalPrice);
|
||||
itemList.setTrdnFlag(true);
|
||||
goodsList.setSubTotalPrice(subTotalPrice);
|
||||
goodsList.setTrdnFlag(true);
|
||||
//小单位数量
|
||||
Integer number = goods.getSelectedNum()*goods.getMinPackagingNumber();
|
||||
|
||||
if (dbGoods.getPackagingUnit().equals(goods.getSelectedUnit()) || dbGoods.getPackagingUnit().equals(dbGoods.getMinPackagingUnit())) {
|
||||
itemList.setTrdnFlag(false);
|
||||
goodsList.setTrdnFlag(false);
|
||||
//未拆分数量
|
||||
number = goods.getSelectedNum();
|
||||
}
|
||||
itemList.setUnit(goods.getSelectedUnit());
|
||||
itemList.setName(dbGoods.getName());
|
||||
itemList.setFeedetlSn(fsn);
|
||||
itemList.setSocialCode(dbGoods.getHilistCode());
|
||||
itemList.setCreateDate(nowLocalDate);
|
||||
itemList.setCreateTime(nowLocalDateTime);
|
||||
itemList.setType(dbGoods.getType());
|
||||
if (!inventoryService.checkInventoryNumber(dbGoods.getId(), number)){
|
||||
throw new MessageException(goods.getName()+"库存不足");
|
||||
}
|
||||
goodsList.setUnit(goods.getSelectedUnit());
|
||||
goodsList.setName(dbGoods.getName());
|
||||
goodsList.setFeedetlSn(fsn);
|
||||
goodsList.setSocialCode(dbGoods.getHilistCode());
|
||||
goodsList.setCreateDate(nowLocalDate);
|
||||
goodsList.setCreateTime(nowLocalDateTime);
|
||||
goodsList.setType(dbGoods.getType());
|
||||
//添加追溯码
|
||||
String traceabilityCode = null;
|
||||
if (goods.getTraceAbilityCodeList() != null) {
|
||||
traceabilityCode = String.join(",", goods.getTraceAbilityCodeList());
|
||||
}
|
||||
itemList.setTraceabilityCode(traceabilityCode);
|
||||
goodsList.setTraceabilityCode(traceabilityCode);
|
||||
BigDecimal subCost = goods.getPurchaseUnitPrice().multiply(BigDecimal.valueOf(goods.getSelectedNum()));
|
||||
itemList.setCost(subCost);
|
||||
chargeGoodsLists.add(itemList);
|
||||
goodsList.setCost(subCost);
|
||||
chargeGoodsLists.add(goodsList);
|
||||
preTotalPrice = preTotalPrice.add(subTotalPrice);
|
||||
totalPrice = totalPrice.add(subTotalPrice);
|
||||
totalCost = totalCost.add(subCost);
|
||||
|
|
@ -513,6 +529,12 @@ public class ChargeService extends BaseService {
|
|||
if (order.getMdtrtId() == null) {
|
||||
throw new MessageException("非医保挂号,不能上传费用明细信息");
|
||||
}
|
||||
|
||||
//检查商品是否库存不足
|
||||
Goods lackGoods = this.checkInventoryNumber(order.getCode());
|
||||
if (lackGoods != null) {
|
||||
throw new MessageException(lackGoods.getName() + "库存不足");
|
||||
}
|
||||
//撤销之前上传的费用明细信息
|
||||
try {
|
||||
IM2205 im2205 = new IM2205();
|
||||
|
|
@ -541,8 +563,8 @@ public class ChargeService extends BaseService {
|
|||
throw new MessageException("本地医保目录中未查询到医保码为" + goodsList.getSocialCode() + "的商品信息");
|
||||
}
|
||||
SocialCompareCode sdCompare = socialCompareService.socialCompareInfo(goodsList.getSocialCode());
|
||||
if (sdGoods.getCompareCode() == null){
|
||||
throw new MessageException("医保服务项目"+sdCompare.getCode()+"未关联医保目录");
|
||||
if (sdCompare == null) {
|
||||
throw new MessageException("药品" + sdCompare.getCode() + "未关联医保目录");
|
||||
}
|
||||
feedetail.setMed_list_codg(goodsList.getSocialCode());
|
||||
feedetail.setMedins_list_codg(sdCompare.getCompareCode());
|
||||
|
|
@ -570,7 +592,7 @@ public class ChargeService extends BaseService {
|
|||
throw new MessageException("本地医保目录中未查询到医保码为" + itemList.getSocialCode() + "的医保服务项目");
|
||||
}
|
||||
SocialCompareCode sdCompare = socialCompareService.socialCompareInfo(itemList.getSocialCode());
|
||||
if (sdItem.getCompareCode() == null){
|
||||
if (sdCompare == null) {
|
||||
throw new MessageException("医保服务项目" + itemList.getSocialCode() + "未关联医保目录");
|
||||
}
|
||||
feedetail.setMed_list_codg(itemList.getSocialCode());
|
||||
|
|
@ -598,15 +620,21 @@ public class ChargeService extends BaseService {
|
|||
public OM2206A socialPrePay(String changeOrderCode, String mdtrtCertType, String mdtrtCertNo, String insutype) {
|
||||
ChargeOrder order = chargeOrderMapper.selectByCode(changeOrderCode);
|
||||
Diagnosis diagnosis = diagnosisMapper.selectByCode(order.getDiagnosisCode());
|
||||
//预支付只需要卡号
|
||||
String cardNumber = mdtrtCertNo;
|
||||
|
||||
|
||||
//检查商品是否库存不足
|
||||
Goods lackGoods = this.checkInventoryNumber(order.getCode());
|
||||
if (lackGoods != null) {
|
||||
throw new MessageException(lackGoods.getName() + "库存不足");
|
||||
}
|
||||
|
||||
PatientRegistration registration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
||||
|
||||
IM2206A im2206A = new IM2206A();
|
||||
IM2206A.Data data = new IM2206A.Data();
|
||||
data.setPsn_no(registration.getPsnNo());
|
||||
data.setMdtrt_cert_type(mdtrtCertType);
|
||||
data.setMdtrt_cert_no(cardNumber);
|
||||
data.setMdtrt_cert_no(mdtrtCertNo);
|
||||
data.setMed_type(config.get("social", "medType"));
|
||||
data.setMedfee_sumamt(order.getTotalPrice());
|
||||
data.setPsn_setlway("01");
|
||||
|
|
@ -630,15 +658,22 @@ public class ChargeService extends BaseService {
|
|||
* @param insutype
|
||||
* @return
|
||||
*/
|
||||
public OM2207A socialRealPay(String chargeOrderCode, String mdtrtCertType, String mdtrtCertNo, String insutype) {
|
||||
public OM2207A socialRealPay(String chargeOrderCode, String mdtrtCertType, String mdtrtCertNo, String insutype, Integer payType) {
|
||||
ChargeOrder order = chargeOrderMapper.selectByCode(chargeOrderCode);
|
||||
Diagnosis diagnosis = diagnosisMapper.selectByCode(order.getDiagnosisCode());
|
||||
|
||||
//检查商品是否库存不足
|
||||
Goods lackGoods = this.checkInventoryNumber(order.getCode());
|
||||
if (lackGoods != null) {
|
||||
throw new MessageException(lackGoods.getName() + "库存不足");
|
||||
}
|
||||
|
||||
PatientRegistration registration = patientRegistrationMapper.selectById(diagnosis.getRegistrationId());
|
||||
|
||||
String psnNo = registration.getPsnNo();
|
||||
IM2207A im2207A = new IM2207A();
|
||||
IM2207A.Data data = new IM2207A.Data();
|
||||
data.setPsn_no(registration.getPsnNo());
|
||||
data.setPsn_no(psnNo);
|
||||
data.setMdtrt_cert_type(mdtrtCertType);
|
||||
data.setMdtrt_cert_no(mdtrtCertNo);
|
||||
data.setMed_type(config.get("social", "medType"));
|
||||
|
|
@ -661,13 +696,24 @@ public class ChargeService extends BaseService {
|
|||
|
||||
}
|
||||
data.setMinpacunt_drug_trac_cnt(BigDecimal.valueOf(minpacunt_drug_trac_cnt));
|
||||
// IM2207A.ExpContent expContent = new IM2207A.ExpContent();
|
||||
// data.setExp_content(expContent);
|
||||
im2207A.setData(data);
|
||||
OM2207A om2207A = socialRequest.call2207A(im2207A);
|
||||
String msgId = httpUtil.generateMsgId();
|
||||
try {
|
||||
|
||||
OM2207A om2207A = socialRequest.call2207A(im2207A, msgId);
|
||||
recordSocialInfo(om2207A, chargeService.getByCode(chargeOrderCode), payType);
|
||||
//完成订单
|
||||
chargeService.completeOrder(order.getId(), RetailOrderPayTypeEnum.MEDICARE.getCode());
|
||||
//记录医保付费信息
|
||||
return om2207A;
|
||||
} catch (Exception e) {
|
||||
log.error("医保支付异常,自动冲正该交易", e);
|
||||
IM2601 im2601 = new IM2601();
|
||||
im2601.setPsnNo(psnNo);
|
||||
im2601.setOmsgid(msgId);
|
||||
im2601.setOinfno("2207A");
|
||||
socialReconciliationService.reversal(im2601);
|
||||
throw new MessageException("医保支付异常");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -892,9 +938,8 @@ public class ChargeService extends BaseService {
|
|||
* @param om2102A
|
||||
* @param dbOrder
|
||||
* @param payType
|
||||
* @param curBalc
|
||||
*/
|
||||
public void recordSocialInfo(OM2207A om2102A, ChargeOrder dbOrder, Integer payType, String curBalc) {
|
||||
public void recordSocialInfo(OM2207A om2102A, ChargeOrder dbOrder, Integer payType) {
|
||||
ChargeSocialPayLog socialPayLog = new ChargeSocialPayLog();
|
||||
OM2207A.Setlinfo setlinfo = om2102A.getSetlinfo();
|
||||
socialPayLog.setChargeOrderCode(dbOrder.getCode());
|
||||
|
|
@ -1104,6 +1149,30 @@ public class ChargeService extends BaseService {
|
|||
return chargeOrderMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据订单号检查商品数量是否充足
|
||||
*/
|
||||
public Goods checkInventoryNumber(String chargeCode) {
|
||||
List<ChargeGoodsList> goodsList = chargeGoodsListMapper.selectByCode(chargeCode);
|
||||
for (ChargeGoodsList goodsListItem : goodsList) {
|
||||
Integer number = 0;
|
||||
Goods goods = goodsMapper.selectById(goodsListItem.getGoodsId());
|
||||
if (goods == null) {
|
||||
throw new MessageException("商品" + goodsListItem.getName() + "不存在");
|
||||
}
|
||||
if (goods.getPackagingUnit().equals(goodsListItem.getUnit())) {
|
||||
number = goodsListItem.getNumber();
|
||||
} else {
|
||||
number = goodsListItem.getNumber() * goods.getMinPackagingNumber();
|
||||
}
|
||||
if (!inventoryService.checkInventoryNumber(goodsListItem.getGoodsId(), number)) {
|
||||
return goods;
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// public void recordSocialInfo(OM2103 om2103, RetailOrder dbOrder) {
|
||||
// QueryWrapper<RetailSocialPayLog> logQuery = new QueryWrapper<>();
|
||||
// logQuery.eq("retail_order_code", dbOrder.getCode());
|
||||
|
|
|
|||
|
|
@ -66,13 +66,22 @@ public class GoodsService extends BaseService {
|
|||
*/
|
||||
public Goods save(Goods goods) {
|
||||
String code = goods.getHilistCode();
|
||||
|
||||
if (!code.isEmpty()) {
|
||||
SocialDirectory socialDirectory = null;
|
||||
Goods codeGoods = null;
|
||||
if (code!=null && !code.isEmpty()) {
|
||||
QueryWrapper<SocialDirectory> socialDirectoryWrapper = new QueryWrapper<>();
|
||||
socialDirectoryWrapper.eq("code", code);
|
||||
CheckUtil.checkValue(socialDirectoryMapper.selectOne(socialDirectoryWrapper)==null, "医保目录编码不能为空");
|
||||
socialDirectory = socialDirectoryMapper.selectOne(socialDirectoryWrapper);
|
||||
|
||||
codeGoods = goodsMapper.selectOne(new QueryWrapper<Goods>().eq("hilist_code", code));
|
||||
}
|
||||
if (socialDirectory == null){
|
||||
throw new MessageException("该医保码"+code+"未能在医保目录中找到");
|
||||
}
|
||||
|
||||
if (codeGoods!=null&&(goods.getId() == null || !goods.getId().equals(codeGoods.getId()))){
|
||||
throw new MessageException("医保码"+code+"已存在绑定的商品");
|
||||
}
|
||||
GoodsPricingModelEnum modelEnum = GoodsPricingModelEnum.getByPricingModel(goods.getPricingModel());
|
||||
if (modelEnum == null){
|
||||
throw new MessageException("定价模式错误错误");
|
||||
|
|
|
|||
|
|
@ -590,5 +590,14 @@ public class InventoryService extends BaseService {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据商品id和数量 校验库存是否充足
|
||||
* @param goodsId number-拆分成最小单位数量
|
||||
* @return
|
||||
*/
|
||||
public boolean checkInventoryNumber(Integer goodsId, Integer number){
|
||||
Map<String, Integer> numberMap = totalNumber(goodsId);
|
||||
Integer totalFragment = numberMap.get("totalFragment");
|
||||
return totalFragment >= number;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,15 +119,28 @@ public class ItemService extends BaseService {
|
|||
if (item.getName() == null || item.getName().isEmpty()) {
|
||||
throw new MessageException("项目名称不能为空");
|
||||
}
|
||||
if (item.getSocialCode() == null || item.getSocialCode().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");
|
||||
}
|
||||
if (item.getSocialCode() == null || item.getSocialCode().isEmpty()) {
|
||||
throw new MessageException("项目医保目录编码不能为空");
|
||||
}
|
||||
SocialItem socialItem = socialItemMapper.selectOne(new QueryWrapper<SocialItem>().eq("code", item.getSocialCode()));
|
||||
if (socialItem == null){
|
||||
throw new MessageException("医保目录中未找到医保码为"+item.getSocialCode()+"的医疗服务项目");
|
||||
}
|
||||
|
||||
Item codeItem = itemMapper.selectOne(new QueryWrapper<Item>().eq("social_code", item.getSocialCode()));
|
||||
if (codeItem != null &&(item.getId() == null || !item.getId().equals(codeItem.getId()))){
|
||||
throw new MessageException("医保码"+item.getSocialCode()+"已存在绑定的医疗项目");
|
||||
}
|
||||
|
||||
|
||||
|
||||
ManagerUser managerUser = getManagerUser();
|
||||
item.setCreateDatetime(LocalDateTime.now());
|
||||
item.setCreateBy(managerUser.getName());
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ import com.syjiaer.clinic.server.common.config.Config;
|
|||
import com.syjiaer.clinic.server.common.exception.MessageException;
|
||||
import com.syjiaer.clinic.server.common.util.StringUtil;
|
||||
import com.syjiaer.clinic.server.common.vo.Page;
|
||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMemberSection;
|
||||
import com.syjiaer.clinic.server.entity.organization.OrganizationSection;
|
||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberSectionMapper;
|
||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationSectionMapper;
|
||||
import com.syjiaer.clinic.server.service.BaseService;
|
||||
|
|
@ -26,16 +28,14 @@ import java.util.List;
|
|||
@Service
|
||||
@Slf4j
|
||||
public class OrganizationSectionService extends BaseService {
|
||||
@Autowired
|
||||
private StringUtil stringUtil;
|
||||
@Autowired
|
||||
private OrganizationSectionMapper organizationSectionMapper;
|
||||
@Autowired
|
||||
private OrganizationMemberSectionMapper organizationMemberSectionMapper;
|
||||
@Autowired
|
||||
private Config config;
|
||||
private OrganizationMemberMapper organizationMemberMapper;
|
||||
@Autowired
|
||||
private SocialRequest socialRequest;
|
||||
private Config config;
|
||||
|
||||
/**
|
||||
* 分页查询科室
|
||||
|
|
@ -89,6 +89,30 @@ public class OrganizationSectionService extends BaseService {
|
|||
String processing = getString(caty);
|
||||
organizationSection.setCaty(processing);
|
||||
organizationSectionMapper.updateById(organizationSection);
|
||||
//更新成员冗余字段
|
||||
List<OrganizationMemberSection> organizationMemberSections = organizationMemberSectionMapper.selectList(new QueryWrapper<OrganizationMemberSection>().eq("organization_section_id", organizationSection.getId()));
|
||||
for (OrganizationMemberSection organizationMemberSection : organizationMemberSections) {
|
||||
OrganizationMember member = organizationMemberMapper.selectById(organizationMemberSection.getOrganizationMemberId());
|
||||
if (member == null){
|
||||
continue;
|
||||
}
|
||||
QueryWrapper<OrganizationMemberSection> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("organization_section_id");
|
||||
queryWrapper.eq("organization_member_id", member.getId());
|
||||
List<Integer> sections = organizationMemberSectionMapper.selectObjs(queryWrapper);
|
||||
QueryWrapper<OrganizationSection> sectionQueryWrapper = new QueryWrapper<>();
|
||||
sectionQueryWrapper.select("name");
|
||||
sectionQueryWrapper.in("id", sections);
|
||||
List<String> names = organizationSectionMapper.selectObjs(sectionQueryWrapper);
|
||||
if (names==null||names.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
OrganizationMember updateMember = new OrganizationMember();
|
||||
updateMember.setId(member.getId());
|
||||
updateMember.setSectionNames(String.join("/", names));
|
||||
organizationMemberMapper.updateById(updateMember);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.syjiaer.clinic.server.entity.goods.Goods;
|
|||
import com.syjiaer.clinic.server.entity.inventory.*;
|
||||
import com.syjiaer.clinic.server.entity.manager.ManagerUser;
|
||||
import com.syjiaer.clinic.server.entity.organization.OrganizationMember;
|
||||
import com.syjiaer.clinic.server.entity.social.SocialCompareCode;
|
||||
import com.syjiaer.clinic.server.entity.social.SocialDirectory;
|
||||
import com.syjiaer.clinic.server.entity.social.dto.InventoryInitQuery;
|
||||
import com.syjiaer.clinic.server.entity.social.dto.InventoryLogQuery;
|
||||
|
|
@ -34,6 +35,7 @@ import com.syjiaer.clinic.server.mapper.goods.GoodsMapper;
|
|||
import com.syjiaer.clinic.server.mapper.inventory.*;
|
||||
import com.syjiaer.clinic.server.mapper.manager.ManagerUserMapper;
|
||||
import com.syjiaer.clinic.server.mapper.organization.OrganizationMemberMapper;
|
||||
import com.syjiaer.clinic.server.mapper.social.SocialCompareCodeMapper;
|
||||
import com.syjiaer.clinic.server.mapper.social.SocialDirectoryMapper;
|
||||
import com.syjiaer.clinic.server.service.BaseService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
|
@ -78,6 +80,8 @@ public class SocialInventoryUploadService extends BaseService {
|
|||
private ChargeOrderMapper chargeOrderMapper;
|
||||
@Autowired
|
||||
private ChargeSocialPayLogMapper chargeSocialPayLogMapper;
|
||||
@Autowired
|
||||
private SocialCompareCodeMapper socialCompareCodeMapper;
|
||||
|
||||
public Page<SocialInventoryInitVo> get3501List(InventoryInitQuery initQuery) {
|
||||
if (initQuery == null) {
|
||||
|
|
@ -106,6 +110,7 @@ public class SocialInventoryUploadService extends BaseService {
|
|||
queryWrapper.le("create_time", initQuery.getCreateTimeAfter());
|
||||
}
|
||||
Page<InventoryInit> page = pageHelper(initQuery.getPageNum(), initQuery.getPageSize(), queryWrapper, inventoryInitMapper, "id", false);
|
||||
System.out.println(page.toString());
|
||||
List<SocialInventoryInitVo> voList = new ArrayList<>();
|
||||
for (InventoryInit inventoryInit : page.getList()) {
|
||||
SocialInventoryInitVo vo = new SocialInventoryInitVo();
|
||||
|
|
@ -550,5 +555,23 @@ public class SocialInventoryUploadService extends BaseService {
|
|||
chargeInventoryLogMapper.updateById(updateOrderInventory);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* 快速上报
|
||||
*/
|
||||
public boolean quickUpload() {
|
||||
|
||||
boolean uploadResult = this.upload3501();
|
||||
if (!uploadResult) {
|
||||
uploadResult = this.upload3503();
|
||||
}
|
||||
if (!uploadResult){
|
||||
uploadResult = this.upload3505();
|
||||
}
|
||||
if (!uploadResult) {
|
||||
uploadResult = this.upload3502();
|
||||
}
|
||||
return uploadResult;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue