diff --git a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java index 2576124b7..f75bd452c 100644 --- a/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java +++ b/src/main/java/com/glxp/api/controller/inout/IoCodeTempController.java @@ -141,7 +141,6 @@ public class IoCodeTempController extends BaseController { IoCollectOrderCodeManService collectOrderCodeManService; - /** * PDA-----单据上传 */ @@ -1244,6 +1243,12 @@ public class IoCodeTempController extends BaseController { if (udiInfoEntity == null) { return ResultVOUtils.error(500, "药品字典不存在此产品!"); } + + if (IntUtil.value(udiRelevanceResponse.getNotCodeType()) != 0) { + return ResultVOUtils.error(500, "当前为无码类型产品,无需扫码!"); + } + + if (StrUtil.isEmpty(udiEntity.getBatchNo())) { IoCodeLostEntity codeLostEntity = codeLostService.findByCode(addOrderRequest.getCode()); if (codeLostEntity != null) { diff --git a/src/main/java/com/glxp/api/entity/collect/IoCollectOrderBiz.java b/src/main/java/com/glxp/api/entity/collect/IoCollectOrderBiz.java index f0642c2e6..ae8a23a23 100644 --- a/src/main/java/com/glxp/api/entity/collect/IoCollectOrderBiz.java +++ b/src/main/java/com/glxp/api/entity/collect/IoCollectOrderBiz.java @@ -57,7 +57,6 @@ public class IoCollectOrderBiz implements Serializable { private String ybbm; - /** * 医保编码 */ @@ -153,7 +152,7 @@ public class IoCollectOrderBiz implements Serializable { * 单据明细赋码状态 1:未赋码;2:部分赋码;3:已赋码 */ @TableField(value = "tagStatus") - @ApiModelProperty(value = "单据明细赋码状态 1:未赋码;2:部分赋码;3:已赋码") + @ApiModelProperty(value = "单据明细赋码状态 1:未赋码;2:部分赋码;3:已赋码;4:无需赋码") private Integer tagStatus; /** diff --git a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java index 6a44338d4..7b3033c89 100644 --- a/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java +++ b/src/main/java/com/glxp/api/res/basic/UdiRelevanceResponse.java @@ -333,4 +333,36 @@ public class UdiRelevanceResponse { * 明细分类 */ private Integer detailSort; + + + + /** + * 无码类型 0、默认不是无码类型;1、部分早期未赋予追溯码;5、最小包装无追溯码;6、无追溯码;7、其他原因 + */ + private Integer notCodeType; + + /** + * 是否已经人工审核 0:未审核;1:已审核 + */ + private Integer manuReview; + + + + + /** + * 是否已经人工审核 0:未审核;1:已审核 + */ + @TableField(value = "drugSellingPrice") + private String drugSellingPrice; + /** + * 药品售价 + */ + @TableField(value = "drugSellingPriceTime") + private Date drugSellingPriceTime; + /** + * 是否挂网 0 否 1 是 + */ + @TableField(value = "hangingNetType") + private Integer hangingNetType; + } diff --git a/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java b/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java index d6a780fb8..eb7a70eac 100644 --- a/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java +++ b/src/main/java/com/glxp/api/service/inout/IoCodeTempService.java @@ -436,13 +436,13 @@ public class IoCodeTempService { if (code.length() == 13) { UdiProductEntity udiProductEntity = udiProductService.findBySptm(code); if (udiProductEntity != null) { - BaseResponse baseResponse = ResultVOUtils.error(508, "UDI码格式错误"); + BaseResponse baseResponse = ResultVOUtils.error(508, "追溯码格式错误"); baseResponse.setData(udiProductEntity); return baseResponse; } } } - BaseResponse baseResponse = ResultVOUtils.error(501, "UDI码格式错误"); + BaseResponse baseResponse = ResultVOUtils.error(501, "追溯码格式错误"); baseResponse.setData(originCode); return baseResponse; } diff --git a/src/main/java/com/glxp/api/service/inout/IoSplitCodeService.java b/src/main/java/com/glxp/api/service/inout/IoSplitCodeService.java index 2ad1fcd82..551a10eff 100644 --- a/src/main/java/com/glxp/api/service/inout/IoSplitCodeService.java +++ b/src/main/java/com/glxp/api/service/inout/IoSplitCodeService.java @@ -259,12 +259,16 @@ public class IoSplitCodeService extends ServiceImpl 0) { @@ -308,7 +312,6 @@ public class IoSplitCodeService extends ServiceImpl ioSplitFifoCodeEntities = splitFifoCodeService.findByRelId(putWorkPlaceCode, collectOrderBiz.getRelId(), collectOrderBiz.getBatchNo(), queueCode); if (ioSplitFifoCodeEntities.size() < quotient) { if (isAuto) throw new JsonException(500, "提交失败,工位库存数量不足!"); -// else return; } if (ioSplitFifoCodeEntities.size() > 0) { Integer indexFlag = ioSplitFifoCodeEntities.size() < quotient ? ioSplitFifoCodeEntities.size() : quotient; @@ -331,13 +334,12 @@ public class IoSplitCodeService extends ServiceImpl 0) { splitRemove(collectOrderBiz, collectOrder, putWorkPlaceCode, isAuto, null); } - + collectOrderBizService.updateById(collectOrderBiz); } ArrayList ioCollectOrderBizBackups = new ArrayList<>(); for (IoCollectOrderBiz ioCollectOrderBiz : collectOrderBizs) { diff --git a/src/main/java/com/glxp/api/task/AsyncIoCollectOrderFinishTask.java b/src/main/java/com/glxp/api/task/AsyncIoCollectOrderFinishTask.java index c91eb5c32..d9c740e34 100644 --- a/src/main/java/com/glxp/api/task/AsyncIoCollectOrderFinishTask.java +++ b/src/main/java/com/glxp/api/task/AsyncIoCollectOrderFinishTask.java @@ -19,6 +19,7 @@ import com.glxp.api.service.collect.IoCollectOrderService; import com.glxp.api.service.collect.IoCollectSetService; import com.glxp.api.util.IntUtil; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.BeanUtils; @@ -30,6 +31,7 @@ import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; @Slf4j @Component @@ -49,9 +51,13 @@ public class AsyncIoCollectOrderFinishTask implements SchedulingConfigurer { @Resource IoCollectSetBustypeMapper ioCollectSetBustypeMapper; + // 使用原子布尔值作为简单的锁机制 + private final AtomicBoolean isRunning = new AtomicBoolean(false); + + @Override public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) { - scheduledTaskRegistrar.addTriggerTask(() -> process(), + scheduledTaskRegistrar.addTriggerTask(() -> processWithLock(), triggerContext -> { ScheduledRequest scheduledRequest = new ScheduledRequest(); scheduledRequest.setCronName("ioCollectOrderFinishTask"); @@ -64,6 +70,23 @@ public class AsyncIoCollectOrderFinishTask implements SchedulingConfigurer { }); } + + private void processWithLock() { + // 如果已经在运行,则跳过本次执行 + if (!isRunning.compareAndSet(false, true)) { + log.warn("上一次任务还在执行中,跳过本次执行"); + return; + } + try { + log.info("开始执行订单下载任务"); + process(); + } finally { + isRunning.set(false); + log.info("订单下载任务执行完成"); + } + } + + @Resource IoCollectSetService collectSetService; @@ -97,7 +120,7 @@ public class AsyncIoCollectOrderFinishTask implements SchedulingConfigurer { try { collectOrderService.finishOrder(collectOrderRequest, authAdmin, true); } catch (Exception e) { - log.error("自动完成第三方处方单异常", e); + log.error("自动完成第三方处方单异常", ExceptionUtils.getStackTrace(e)); } }