diff --git a/src/main/java/com/glxp/api/constant/ThirdSysConstant.java b/src/main/java/com/glxp/api/constant/ThirdSysConstant.java index 1d5fdb608..e13d60168 100644 --- a/src/main/java/com/glxp/api/constant/ThirdSysConstant.java +++ b/src/main/java/com/glxp/api/constant/ThirdSysConstant.java @@ -8,36 +8,42 @@ public interface ThirdSysConstant { /** * 仓库货位码查询 */ - public static final String WAREHOUSE_QUERY_URL = "warehouseQueryUrl"; + String WAREHOUSE_QUERY_URL = "warehouseQueryUrl"; /** * 业务单据提交 */ - public static final String ORDER_SUBMIT_URL = "orderSubmitUrl"; + String ORDER_SUBMIT_URL = "orderSubmitUrl"; /** * 业务单据查询 */ - public static final String ORDER_QUERY_URL = "orderQueryUrl"; + String ORDER_QUERY_URL = "orderQueryUrl"; /** * 单据类型查询 */ - public static final String BUS_TYPE_QUERY_URL = "busTypeQueryUrl"; + String BUS_TYPE_QUERY_URL = "busTypeQueryUrl"; /** * 仓库/科室查询 */ - public static final String invPiUrl = "invPiUrl"; + String invPiUrl = "invPiUrl"; /** * 往来单位查询 */ - public static final String CORP_URL = "corpUrl"; + String CORP_URL = "corpUrl"; /** * 产品信息查询 */ - public static final String PI_QUERY_URL = "piQueryUrl"; + String PI_QUERY_URL = "piQueryUrl"; + + /** + * 产品信息提交 + */ + String PI_SUBMIT_URL = "productSubmitUrl"; + } diff --git a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java index 1e56cf232..8b89b4f18 100644 --- a/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java +++ b/src/main/java/com/glxp/api/dao/inout/IoOrderDetailBizDao.java @@ -34,7 +34,7 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus { /** * 导入第三方产品信息 * - * @param files * @param thirdSys * @return */ @@ -74,7 +74,14 @@ public interface ThrProductsService extends IService { * @param filterThrProductsRequest * @return */ - BaseResponse downloadByRequest(FilterThrProductsRequest filterThrProductsRequest); + BaseResponse downloadByRequest(FilterThrProductsRequest filterThrProductsRequest); ThrProductsEntity filterThrProductsByMainId(String relId); + + /** + * 上传本地变更产品信息 + * + * @return + */ + BaseResponse uploadThrProduct(ThrSystemDetailEntity thrSystemDetailEntity); } diff --git a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java index 9fc482659..967ea650c 100644 --- a/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java +++ b/src/main/java/com/glxp/api/service/thrsys/impl/ThrProductsServiceImpl.java @@ -17,8 +17,10 @@ import com.glxp.api.http.ErpBasicClient; import com.glxp.api.req.thrsys.FilterThrProductsRequest; import com.glxp.api.req.thrsys.PostThrProductsRequest; import com.glxp.api.res.PageSimpleResponse; +import com.glxp.api.res.basic.UdiRelevanceResponse; import com.glxp.api.res.thrsys.ThrProductsResponse; import com.glxp.api.service.thrsys.ThrProductsService; +import com.glxp.api.util.RedisUtil; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.session.ExecutorType; import org.apache.ibatis.session.SqlSession; @@ -281,6 +283,23 @@ public class ThrProductsServiceImpl extends ServiceImpl { + log.info("开始下载第三方业务单据"); + try { + thrProductsService.uploadThrProduct(thrSystemDetailEntity); + } catch (Exception e) { + log.error("下载第三方业务单据", e); + } finally { + updateTask(getTaskKey(thrSystemDetailEntity)); + } + log.info("第三方业务单据下载完成"); + }); + } + } + /** * 更新任务状态为已完成 * @@ -289,7 +314,7 @@ public class SyncThirdSysTask implements SchedulingConfigurer { */ private boolean verifyTask(ThrSystemDetailEntity thrSystemDetailEntity) { String taskKey = getTaskKey(thrSystemDetailEntity); - ThirdSysInterfaceExecuteVo vo = getLastResult(taskKey); + ThirdSysInterfaceExecuteVo vo = getLastResult(taskKey); if (null != vo && !vo.isFinished()) { log.info(vo.getKey() + "有任务尚未执行完成,当前任务key:{}", taskKey); return false; @@ -298,12 +323,12 @@ public class SyncThirdSysTask implements SchedulingConfigurer { if (vo != null) { long lastTime = vo.getNextTime(); - long timeInterval = Long.parseLong(thrSystemDetailEntity.getTime().intValue() + "") * 1000 * 60; + long timeInterval = Long.parseLong(thrSystemDetailEntity.getTime().intValue() + "") * 1000 * 60; if (curTime - lastTime < timeInterval) { log.info("定时任务时间未到---" + taskKey); return false; } else { - return true; + return true; } } else { vo = Optional.ofNullable(vo).orElse(new ThirdSysInterfaceExecuteVo()); diff --git a/src/main/resources/schemas/schema_v2.2.sql b/src/main/resources/schemas/schema_v2.2.sql index 4ffc83b51..4cb5d8668 100644 --- a/src/main/resources/schemas/schema_v2.2.sql +++ b/src/main/resources/schemas/schema_v2.2.sql @@ -85,3 +85,4 @@ CALL Pro_Temp_ColumnWork('device_inspect_plan', 'planStatus', 'tinyint', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'inspectUser', 'varchar(255)', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'lastTime', 'datetime', 1); CALL Pro_Temp_ColumnWork('device_inspect_plan', 'nextTime', 'datetime', 1); +INSERT ignore INTO `sys_param_config`(`id`, `parentId`, `paramName`, `paramKey`, `paramValue`, `paramStatus`, `paramType`, `paramExplain`, `updateTime`) VALUES (2088, 0, '是否只校验批次号', 'only_vail_batch', '0', 0, 0, '是否只校验批次号(0:否;1:是)', NULL);