患者信息修改,

dev_kcyj
anthonywj 1 year ago
parent 0cee7aee54
commit c064fa3629

@ -57,4 +57,5 @@ public class BasicSkProjectRequest extends ListPageRequest {
private Integer type; private Integer type;
private Integer status; private Integer status;
private Integer contrastStatus;
} }

@ -60,6 +60,6 @@ public class BasicSkProjectResponse {
private String unit; private String unit;
private String price; private String price;
private Integer status; private Integer status;
private Integer contrastStatus;
private List<BasicSkProjectDetailResponse> basicSkProjectDetailResponses; private List<BasicSkProjectDetailResponse> basicSkProjectDetailResponses;
} }

@ -55,6 +55,7 @@ import com.glxp.api.util.OrderNoTypeBean;
import com.glxp.api.util.udi.FilterUdiUtils; import com.glxp.api.util.udi.FilterUdiUtils;
import com.glxp.api.util.udi.UdiCalCountUtil; import com.glxp.api.util.udi.UdiCalCountUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.regexp.RE;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -135,14 +136,14 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
thrInvOrderMapper.insert(thrInvOrder); thrInvOrderMapper.insert(thrInvOrder);
thrInvOrderDetailMapper.insertBatch(thrInvOrderDetails); thrInvOrderDetailMapper.insertBatch(thrInvOrderDetails);
//是否自动生成出入库单据 // //是否自动生成出入库单据
if (IntUtil.value(systemParamConfigService.selectValueByParamKey("fee_out_auto_gen")) > 0) { // if (IntUtil.value(systemParamConfigService.selectValueByParamKey("fee_out_auto_gen")) > 0) {
GenerateOrderRequest generateOrderRequest = new GenerateOrderRequest(); // GenerateOrderRequest generateOrderRequest = new GenerateOrderRequest();
generateOrderRequest.setBillNo(thrInvOrder.getBillNo()); // generateOrderRequest.setBillNo(thrInvOrder.getBillNo());
generateOrderRequest.setAction(thrInvOrder.getBillType()); // generateOrderRequest.setAction(thrInvOrder.getBillType());
generateOrderRequest.setFromCorp(thrInvOrder.getFromCorp()); // generateOrderRequest.setFromCorp(thrInvOrder.getFromCorp());
generateOrder(generateOrderRequest); // generateOrder(generateOrderRequest);
} // }
} }
}); });
@ -930,7 +931,6 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
} }
}); });
} }
} }
//删除原来的明细 //删除原来的明细
@ -949,22 +949,39 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) { if (CollectionUtil.isNotEmpty(updateThrInvOrderDetails)) {
thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails); thrInvOrderDetailMapper.updateBatchById(updateThrInvOrderDetails);
} }
genOrder(newBillNo, updateThrInvOrderDetails, addThrInvOrderDetails, thrInvOrder, bussinessTypeEntity); genOrder(newBillNo, thrInvOrder, bussinessTypeEntity);
log.info("扫描处理第三方收费明细生成单据定时任务结束"); log.info("扫描处理第三方收费明细生成单据定时任务结束");
} }
} }
} }
public void genOrder(String newBillNo, public boolean genOrder(String newBillNo,
List<ThrInvOrderDetail> updateThrInvOrderDetails, List<ThrInvOrderDetail> addThrInvOrderDetails,
ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity) { ThrInvOrder thrInvOrder, BasicBussinessTypeEntity bussinessTypeEntity) {
if (updateThrInvOrderDetails.size() > 0 || addThrInvOrderDetails.size() > 0) { QueryWrapper<ThrInvOrderDetail> qwd = new QueryWrapper<>();
qwd.eq("orderIdFk", thrInvOrder.getBillNo());
List<ThrInvOrderDetail> thrInvOrderDetails = thrInvOrderDetailMapper.selectList(qwd);
if (CollectionUtil.isEmpty(thrInvOrderDetails))
return false;
Map<String, List<ThrInvOrderDetail>> grouped = new HashMap<>();
//往来类型为患者,则需要根据患者进行拆单
if (bussinessTypeEntity.getCorpType() == ConstantStatus.CORP_TYPE_INPUT) {
grouped = thrInvOrderDetails.stream()
.collect(Collectors.groupingBy(ThrInvOrderDetail::getSickerCode));
} else {
grouped.put(thrInvOrder.getFromCorp(), thrInvOrderDetails);
}
for (Map.Entry<String, List<ThrInvOrderDetail>> entry : grouped.entrySet()) {
IoOrderEntity ioOrderEntity = new IoOrderEntity(); IoOrderEntity ioOrderEntity = new IoOrderEntity();
ioOrderEntity.setBillNo(newBillNo); ioOrderEntity.setBillNo(newBillNo);
ioOrderEntity.setMainAction(thrInvOrder.getMainAction()); ioOrderEntity.setMainAction(thrInvOrder.getMainAction());
ioOrderEntity.setFromCorp(thrInvOrder.getFromCorp()); String fromCorp;
if (entry.getValue().get(0).getSickerCode() != null || entry.getValue().get(0).getSickerName() != null)
fromCorp = addInoutService.updateCorp(bussinessTypeEntity, entry.getValue().get(0).getSickerName(), entry.getKey());
else
fromCorp = entry.getKey();
ioOrderEntity.setFromCorp(fromCorp);
ioOrderEntity.setInvCode(thrInvOrder.getInvCode()); ioOrderEntity.setInvCode(thrInvOrder.getInvCode());
ioOrderEntity.setDeptCode(thrInvOrder.getDeptCode()); ioOrderEntity.setDeptCode(thrInvOrder.getDeptCode());
ioOrderEntity.setAction(thrInvOrder.getBillType()); ioOrderEntity.setAction(thrInvOrder.getBillType());
@ -986,19 +1003,12 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
ioOrderEntity.setCreateUser(userId + ""); ioOrderEntity.setCreateUser(userId + "");
ioOrderEntity.setUpdateUser(userId + ""); ioOrderEntity.setUpdateUser(userId + "");
ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);//正常单据处理 ioOrderEntity.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);//正常单据处理
List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>(updateThrInvOrderDetails.size()); List<IoOrderDetailBizEntity> newOrderDetailBiz = new ArrayList<>();
if (entry.getValue().size() > 0) {
if (updateThrInvOrderDetails.size() > 0) { if (!copyOrderDetailBiz(entry.getValue(), newOrderDetailBiz, newBillNo)) {
if (!copyOrderDetailBiz(updateThrInvOrderDetails, newOrderDetailBiz, newBillNo)) {
throw new JsonException("第三方收费明细自动转化单据异常");
}
}
if (addThrInvOrderDetails.size() > 0) {
if (!copyOrderDetailBiz(addThrInvOrderDetails, newOrderDetailBiz, newBillNo)) {
throw new JsonException("第三方收费明细自动转化单据异常"); throw new JsonException("第三方收费明细自动转化单据异常");
} }
} }
String toBillNo = (thrInvOrder.getToBillNo() == null ? "" : thrInvOrder.getToBillNo()) + ("," + newBillNo); String toBillNo = (thrInvOrder.getToBillNo() == null ? "" : thrInvOrder.getToBillNo()) + ("," + newBillNo);
// 检查字符串是否以逗号开始 // 检查字符串是否以逗号开始
if (toBillNo.startsWith(",")) { if (toBillNo.startsWith(",")) {
@ -1013,6 +1023,8 @@ public class ThrInvOrderServiceImpl implements ThrInvOrderService {
//自动处理业务单据 //自动处理业务单据
ioAddInoutService.dealBusProcess(ioOrderEntity, bussinessTypeEntity); ioAddInoutService.dealBusProcess(ioOrderEntity, bussinessTypeEntity);
} }
return true;
} }
@Override @Override

@ -3,13 +3,25 @@
<mapper namespace="com.glxp.api.dao.basic.BasicSkProjectMapper"> <mapper namespace="com.glxp.api.dao.basic.BasicSkProjectMapper">
<select id="filterList" parameterType="com.glxp.api.req.basic.BasicSkProjectRequest" <select id="filterList" parameterType="com.glxp.api.req.basic.BasicSkProjectRequest"
resultType="com.glxp.api.res.basic.BasicSkProjectResponse"> resultType="com.glxp.api.res.basic.BasicSkProjectResponse">
SELECT *, cb.userName as createByName SELECT basic_sk_project.*,
cb.userName as createByName,
CASE
WHEN bsd.id IS NULL THEN 1
ELSE 2
END AS contrastStatus
FROM basic_sk_project FROM basic_sk_project
LEFT JOIN auth_user cb ON basic_sk_project.createUser = cb.id LEFT JOIN auth_user cb ON basic_sk_project.createUser = cb.id
left join basic_sk_project_detail bsd on bsd.pId = basic_sk_project.id
<where> <where>
<if test="type != '' and type != null"> <if test="type != '' and type != null">
AND type = #{type} AND type = #{type}
</if> </if>
<if test="contrastStatus != null and contrastStatus == 1">
AND bsd.id is null
</if>
<if test="contrastStatus != null and contrastStatus == 2">
AND bsd.id is not null
</if>
<if test="status != '' and status != null"> <if test="status != '' and status != null">
AND status = #{status} AND status = #{status}
</if> </if>
@ -20,5 +32,6 @@
AND code LIKE concat('%', #{code}, '%') AND code LIKE concat('%', #{code}, '%')
</if> </if>
</where> </where>
group by basic_sk_project.id
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save