Commit db1ab3dd authored by fangxinjiang's avatar fangxinjiang

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

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