|
@@ -48,6 +48,7 @@ import com.fs.qwApi.service.QwApiService;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.mapper.SysConfigMapper;
|
|
|
import com.google.gson.Gson;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -59,6 +60,7 @@ import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+@Slf4j
|
|
|
@Component("task")
|
|
|
public class Task {
|
|
|
@Autowired
|
|
@@ -181,6 +183,21 @@ public class Task {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 生成已开方且处方单图片为空的处方单
|
|
|
+ */
|
|
|
+ public void generatePresImg(){
|
|
|
+ log.info("开始生成已开方且处方单图片为空的处方单");
|
|
|
+ try {
|
|
|
+ fsPrescribeService.generatePrescribeImg();
|
|
|
+ log.info("生成已开方且处方单图片为空的处方单完成");
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("生成已开方且处方单图片为空的处方单出错", e);
|
|
|
+ throw e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public void addQwWatchLog() throws Exception
|
|
|
{
|
|
|
fsCourseWatchLogService.addCourseWatchLogDay();
|
|
@@ -251,12 +268,30 @@ public class Task {
|
|
|
//每10秒执行一次
|
|
|
public void auditPrescribe()
|
|
|
{
|
|
|
- SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.inquiryConfig");
|
|
|
- String configValue = sysConfig.getConfigValue();
|
|
|
- Map<String, Object> config = (Map<String, Object>) JSON.parse(configValue);
|
|
|
- boolean isAudit = (boolean)config.get("isAutoPrescribeAudit");
|
|
|
- if (isAudit){
|
|
|
- fsPrescribeService.auditPrescribe();
|
|
|
+ log.info("开始执行处方审核定时任务");
|
|
|
+ long startTime = System.currentTimeMillis();
|
|
|
+
|
|
|
+ try {
|
|
|
+ SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("his.inquiryConfig");
|
|
|
+ log.info("获取到系统配置his.inquiryConfig: {}", sysConfig.getConfigValue());
|
|
|
+
|
|
|
+ String configValue = sysConfig.getConfigValue();
|
|
|
+ Map<String, Object> config = (Map<String, Object>) JSON.parse(configValue);
|
|
|
+ boolean isAudit = (boolean)config.get("isAutoPrescribeAudit");
|
|
|
+ log.info("处方自动审核配置状态: {}", isAudit);
|
|
|
+
|
|
|
+ if (isAudit) {
|
|
|
+ log.info("开始执行处方审核业务");
|
|
|
+ fsPrescribeService.auditPrescribe();
|
|
|
+ log.info("处方审核业务执行完成");
|
|
|
+ } else {
|
|
|
+ log.info("自动处方审核功能未开启,跳过处理");
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("处方审核定时任务执行异常", e);
|
|
|
+ } finally {
|
|
|
+ long endTime = System.currentTimeMillis();
|
|
|
+ log.info("处方审核定时任务结束,总耗时:{}毫秒", (endTime - startTime));
|
|
|
}
|
|
|
}
|
|
|
|