|
@@ -14,6 +14,7 @@ import com.management.platform.service.ExpenseTypeService;
|
|
|
import com.management.platform.util.HttpRespMsg;
|
|
|
import com.management.platform.util.MessageUtils;
|
|
|
import com.taobao.api.ApiException;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
@@ -213,5 +214,25 @@ public class CompanyController {
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping("/editCompanyName")
|
|
|
+ public HttpRespMsg editCompanyName(String name,HttpServletRequest request){
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ String token = request.getHeader("token");
|
|
|
+ User user = userMapper.selectById(token);
|
|
|
+ if (StringUtils.isBlank(name)){
|
|
|
+ msg.setError("公司名称不可为空");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if ("超级管理员".equals(user.getRoleName())){
|
|
|
+ Company company = companyMapper.selectById(user.getCompanyId());
|
|
|
+ company.setCompanyName(name);
|
|
|
+ companyMapper.updateById(company);
|
|
|
+ msg.msg = "修改成功";
|
|
|
+ }else {
|
|
|
+ msg.setError("无权修改");
|
|
|
+ }
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|