Commit db1ab3dd authored by fangxinjiang's avatar fangxinjiang

员工报账查询&批量导出&审核人导出最终版-fxj

parent fad52f5c
......@@ -153,7 +153,6 @@ public class EkpOrderUtil {
* @Param
* @return
**/
@Async
public String syncFileFromEkp(String orderNo, String attIds){
log.info("同步项目订单附件信息");
RestTemplate yourRestTemplate = new RestTemplate();
......@@ -169,7 +168,7 @@ public class EkpOrderUtil {
ResponseEntity<String> obj = yourRestTemplate.exchange(ekpProperties.getUrl2()+"?addIds="+attIds+"&orderNo="+orderNo, HttpMethod.POST, null, String.class);
log.error("附件同步结果:"+ JSONObject.toJSONString(obj));
String body = obj.getBody();
if (StringUtils.isBlank(body)){
if (!"推送成功".equals(body)){
log.error(EkpConstants.SEND_FAILED);
return EkpConstants.SEND_FAILED;
}else{
......
......@@ -122,7 +122,7 @@ public interface TOrderService extends IService<TOrder> {
void receiveOrderFileAsc(InputStream inputStream, String orderNo, String fileName, String originalFileName);
R<String> syncFileFromEkp(String orderNo, String attIds);
R<String> syncFileFromEkp(String orderNo, String attIds,String id);
/**
* 订单作废
......
......@@ -759,9 +759,9 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
* @Param
* @return
**/
@Async
@Override
public R<String> syncFileFromEkp(String orderNo, String attIds) {
log.error("I AM HERE 2");
public R<String> syncFileFromEkp(String orderNo, String attIds,String id) {
if (StringUtils.isEmpty(orderNo)){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
}
......@@ -769,9 +769,12 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
return R.failed(OrderConstants.ENCLOSURE_ID_IS_EMPTY);
}
String res = ekpOrderUtil.syncFileFromEkp(orderNo,attIds);
if (Common.isNotNull(res)){
log.error("I AM HERE 1"+res);
return R.failed(res);
if (!Common.isNotNull(res)){
// 记录到数据库 失败的部分可在前端列表重试
this.saveFileSyncLog(orderNo,attIds,null,id);
}else {
// 记录到数据库 失败的部分可在前端列表重试
this.saveFileSyncLog(orderNo,attIds,res,id);
}
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
......@@ -815,14 +818,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if (Common.isEmpty(log)){
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
R<String> res = syncFileFromEkp(log.getOrderNo(),log.getAttIds());
if (Common.isNotNull(res) && CommonConstants.SUCCESS.intValue() == res.getCode()){
// 记录到数据库 失败的部分可在前端列表重试
this.saveFileSyncLog(log.getOrderNo(),log.getAttIds(),null,id);
}else {
// 记录到数据库 失败的部分可在前端列表重试
this.saveFileSyncLog(log.getOrderNo(),log.getAttIds(),res.getMsg(),id);
}
return res;
syncFileFromEkp(log.getOrderNo(),log.getAttIds(),id);
return R.ok();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment