|
|
@@ -3,14 +3,17 @@ package com.fs.company.controller;
|
|
|
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
+import com.fs.common.core.domain.model.LoginUser;
|
|
|
+import com.fs.common.utils.ServletUtils;
|
|
|
+import com.fs.company.domain.CompanyConfig;
|
|
|
import com.fs.company.service.ICompanyConfigService;
|
|
|
import com.fs.system.domain.SysConfig;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
/**
|
|
|
* 系统配置
|
|
|
@@ -44,5 +47,35 @@ public class CompanyConfigController extends BaseController
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改的是 销售端的配置
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/editCompanyConfig")
|
|
|
+ public R edit(@Validated @RequestBody CompanyConfig companyConfig)
|
|
|
+ {
|
|
|
+ companyConfigService.updateCompanyConfig(companyConfig);
|
|
|
+ return R.ok("操作成功");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据参数键名查询参数值
|
|
|
+ */
|
|
|
+ @GetMapping(value = "/getCompanyConfigKey/{configKey}/{companyId}")
|
|
|
+ public R getConfigKey(@PathVariable String configKey,@PathVariable Long companyId)
|
|
|
+ {
|
|
|
+ CompanyConfig config=companyConfigService.selectCompanyConfigByKey(companyId,configKey);
|
|
|
+ if(config==null){
|
|
|
+ config=new CompanyConfig();
|
|
|
+ config.setCompanyId(companyId);
|
|
|
+ config.setConfigKey(configKey);
|
|
|
+ config.setConfigType("N");
|
|
|
+ companyConfigService.insertCompanyConfig(config);
|
|
|
+
|
|
|
+ }
|
|
|
+ return R.ok().put("data",config);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|