|
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
@@ -40,11 +41,20 @@ public class BusinessOpportunityController {
|
|
|
|
|
|
|
|
|
@RequestMapping("insertAndUpdate")
|
|
|
- public HttpRespMsg insertAndUpdate(@RequestBody BusinessOpportunity bo) {
|
|
|
+ public HttpRespMsg insertAndUpdate(@RequestBody BusinessOpportunity bo, HttpServletRequest request) {
|
|
|
+ User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ if (bo.getId() == null){
|
|
|
+ //新增
|
|
|
+ bo.setCompanyId(user.getCompanyId());
|
|
|
+ bo.setCreatorId(user.getId());
|
|
|
+ bOservice.insert(bo);
|
|
|
+ }else {
|
|
|
+ //修改
|
|
|
+
|
|
|
+ }
|
|
|
msg.setMsg("操作成功");
|
|
|
return msg;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@RequestMapping("list")
|
|
@@ -96,13 +106,7 @@ public class BusinessOpportunityController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- @RequestMapping("getAllProduct")
|
|
|
- public HttpRespMsg getAllProduct(@RequestBody BusinessOpportunity bo) {
|
|
|
- HttpRespMsg msg = new HttpRespMsg();
|
|
|
- msg.setMsg("操作成功");
|
|
|
- return msg;
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
}
|