新增控制是否只校验批次号

dev
anthonywj 2 years ago
parent d086c63ab2
commit 8cf48f17d2

@ -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";
}

@ -34,7 +34,7 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus<IoOrderDetailBizDao,
IoOrderInvoiceResponse selectByinvoiceId(Long id);
IoOrderDetailBizEntity findByRelBatch(@Param("orderId") String orderId, @Param("relId") Long relId, @Param("bacthNo") String bacthNo);
IoOrderDetailBizEntity findByRelBatch(@Param("orderId") String orderId, @Param("relId") Long relId, @Param("batchNo") String batchNo);
/**
*

@ -308,6 +308,7 @@ public class IoCheckInoutService {
}
}
@Resource
SystemParamConfigService systemParamConfigService;
public String checkCode(IoCodeTempEntity codeEntity) {
@ -315,7 +316,7 @@ public class IoCheckInoutService {
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("only_vail_batch");
boolean vailBatchNo = false;
if (systemParamConfigEntity != null) {
if (systemParamConfigEntity.getParamValue().equals(1)) {
if (systemParamConfigEntity.getParamValue().equals("1")) {
vailBatchNo = true;
}
}

@ -7,6 +7,7 @@ import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.entity.thrsys.ThrSystemDetailEntity;
import com.glxp.api.req.thrsys.FilterThrProductsRequest;
import com.glxp.api.req.thrsys.PostThrProductsRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.thrsys.ThrProductsResponse;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.multipart.MultipartFile;
@ -46,7 +47,6 @@ public interface ThrProductsService extends IService<ThrProductsEntity> {
/**
*
*
* @param files
* @param thirdSys
* @return
*/
@ -74,7 +74,14 @@ public interface ThrProductsService extends IService<ThrProductsEntity> {
* @param filterThrProductsRequest
* @return
*/
BaseResponse downloadByRequest(FilterThrProductsRequest filterThrProductsRequest);
BaseResponse downloadByRequest(FilterThrProductsRequest filterThrProductsRequest);
ThrProductsEntity filterThrProductsByMainId(String relId);
/**
*
*
* @return
*/
BaseResponse uploadThrProduct(ThrSystemDetailEntity thrSystemDetailEntity);
}

@ -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<ThrProductsDao, ThrProdu
return thrProductsDao.filterThrProductsByMainId(relId);
}
@Resource
RedisUtil redisUtil;
@Override
public BaseResponse uploadThrProduct(ThrSystemDetailEntity thrSystemDetailEntity) {
//上次修改时间
String lastUploadTime = (String) redisUtil.get("THR_PI_UPLOAD_TIME");
if (StrUtil.isEmpty(lastUploadTime)) {
//下载耗材字典最新维护数据
//下载第三方产品信息
}
return null;
}
/**
*
*

@ -125,6 +125,8 @@ public class SyncThirdSysTask implements SchedulingConfigurer {
case ThirdSysConstant.ORDER_QUERY_URL:
downloadThrOrder(thrSystemDetailEntity);
break;
case ThirdSysConstant.PI_SUBMIT_URL:
break;
default:
//其他接口暂不处理
break;
@ -269,6 +271,29 @@ public class SyncThirdSysTask implements SchedulingConfigurer {
}
}
/**
*
*
* @param thrSystemDetailEntity
*/
private void submitThrProduct(ThrSystemDetailEntity thrSystemDetailEntity) {
//校验任务并更新redis数据执行标识
if (verifyTask(thrSystemDetailEntity)) {
getExecutor().submit(() -> {
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());

@ -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, '是否只校验批次号(01是)', NULL);

Loading…
Cancel
Save