| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import com.sdtool.common.api.BusinessExecutor
- import com.sdtool.common.api.ConfigService
- import com.sdtool.common.datas.ERPModule
- import com.sdtool.common.entity.base.InvokeCallParams
- import com.sdtool.common.entity.base.InvokeCallResult
- import com.sdtool.common.entity.system.ConfigValue
- import com.alibaba.fastjson.JSON
- import com.dySweetFishPlugin.sql.dao.OperatorWait
- import com.sweetfish.service.RetResult
- import org.apache.commons.lang3.StringUtils
- import javax.annotation.Resource
- class BE_ERP_OrderManager_Read implements BusinessExecutor<InvokeCallParams, InvokeCallResult> {
- @Resource
- private ConfigService configService
- @Override
- String scriptName() {
- return "读取ERP文件管理方式配置"
- }
- @Override
- ERPModule module() {
- return ERPModule.CONFIG
- }
- @Override
- OperatorWait getAWait(InvokeCallParams s) {
- return OperatorWait.SYNC
- }
- @Override
- boolean needLogin(InvokeCallParams source) {
- return true
- }
- RetResult<InvokeCallResult> execute(InvokeCallParams source) {
- int iManagerKind = configService.getIntRedisConfigValue1("ERPOrderManger", source.supplierCode)
- String orderUploadUrl = ""
- //if (iManagerKind == 1) {
- //样稿文件只用本地模式上传,文件不大,不要去占用七牛空间
- //本地需要一个给前端的上传服务器的地址,通过nginx的配置应该可以借用ERPOrderDownloadCenter
- ConfigValue downloadCenterValue = configService.getRedisConfigValue("ERPOrderDownloadCenter", source.dataSourceId, source.supplierCode)
- if ((downloadCenterValue != null) && (StringUtils.isNotBlank(downloadCenterValue.configValue1))) {
- orderUploadUrl = downloadCenterValue.configValue1
- }
- //}
- def result = [
- managerKind : iManagerKind,
- orderUploadUrl: orderUploadUrl
- ]
- return RetResult.<InvokeCallResult> successT().result(
- InvokeCallResult.success().data(JSON.toJSONString(result))
- )
- }
- }
|