BE_ERP_OrderManager_Read.groovy 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import com.sdtool.common.api.BusinessExecutor
  2. import com.sdtool.common.api.ConfigService
  3. import com.sdtool.common.datas.ERPModule
  4. import com.sdtool.common.entity.base.InvokeCallParams
  5. import com.sdtool.common.entity.base.InvokeCallResult
  6. import com.sdtool.common.entity.system.ConfigValue
  7. import com.alibaba.fastjson.JSON
  8. import com.dySweetFishPlugin.sql.dao.OperatorWait
  9. import com.sweetfish.service.RetResult
  10. import org.apache.commons.lang3.StringUtils
  11. import javax.annotation.Resource
  12. class BE_ERP_OrderManager_Read implements BusinessExecutor<InvokeCallParams, InvokeCallResult> {
  13. @Resource
  14. private ConfigService configService
  15. @Override
  16. String scriptName() {
  17. return "读取ERP文件管理方式配置"
  18. }
  19. @Override
  20. ERPModule module() {
  21. return ERPModule.CONFIG
  22. }
  23. @Override
  24. OperatorWait getAWait(InvokeCallParams s) {
  25. return OperatorWait.SYNC
  26. }
  27. @Override
  28. boolean needLogin(InvokeCallParams source) {
  29. return true
  30. }
  31. RetResult<InvokeCallResult> execute(InvokeCallParams source) {
  32. int iManagerKind = configService.getIntRedisConfigValue1("ERPOrderManger", source.supplierCode)
  33. String orderUploadUrl = ""
  34. //if (iManagerKind == 1) {
  35. //样稿文件只用本地模式上传,文件不大,不要去占用七牛空间
  36. //本地需要一个给前端的上传服务器的地址,通过nginx的配置应该可以借用ERPOrderDownloadCenter
  37. ConfigValue downloadCenterValue = configService.getRedisConfigValue("ERPOrderDownloadCenter", source.dataSourceId, source.supplierCode)
  38. if ((downloadCenterValue != null) && (StringUtils.isNotBlank(downloadCenterValue.configValue1))) {
  39. orderUploadUrl = downloadCenterValue.configValue1
  40. }
  41. //}
  42. def result = [
  43. managerKind : iManagerKind,
  44. orderUploadUrl: orderUploadUrl
  45. ]
  46. return RetResult.<InvokeCallResult> successT().result(
  47. InvokeCallResult.success().data(JSON.toJSONString(result))
  48. )
  49. }
  50. }