姜永辉 2 лет назад
Родитель
Сommit
7d3fd416d0

+ 1 - 1
src/main/java/com/dk/oauth/controller/CompanyController.java

@@ -41,7 +41,7 @@ public class CompanyController {
      * @date : 2023/1/9 10:49
      * @date : 2023/1/9 10:49
      */
      */
     @ApiOperation(value = "更新微信用的公司", notes = "更新微信用的公司")
     @ApiOperation(value = "更新微信用的公司", notes = "更新微信用的公司")
-    @PostMapping({"update_wx_user_company/"})
+    @PostMapping({"feign_update_wx_user_company/"})
     public ResponseResultVO<Boolean> updateWxUserCompany(@RequestBody Map<String,Object> map) {
     public ResponseResultVO<Boolean> updateWxUserCompany(@RequestBody Map<String,Object> map) {
         return companyService.updateWxUserCompany(map);
         return companyService.updateWxUserCompany(map);
     }
     }

+ 14 - 9
src/main/java/com/dk/oauth/service/impl/CompanyServiceImpl.java

@@ -12,6 +12,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
@@ -29,26 +31,29 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
     UserMapper userMapper;
     UserMapper userMapper;
 
 
     /**
     /**
-     * @desc   : 通过ID查询
+     * @desc : 通过ID查询
      * @author : admin
      * @author : admin
-     * @date   : 2023/2/3 13:32
+     * @date : 2023/2/3 13:32
      */
      */
     @Override
     @Override
-    public  ResponseResultVO selectById(Integer id) {
+    public ResponseResultVO selectById(Integer id) {
         return ResponseResultUtil.success(companyMapper.selectById(id));
         return ResponseResultUtil.success(companyMapper.selectById(id));
     }
     }
 
 
     /**
     /**
-     * @desc   : 更新微信用的公司
+     * @desc : 更新微信用的公司
      * @author : admin
      * @author : admin
-     * @date   : 2023/2/3 13:32
+     * @date : 2023/2/3 13:32
      */
      */
     @Override
     @Override
     @Transactional(rollbackFor = Exception.class)
     @Transactional(rollbackFor = Exception.class)
-    public  ResponseResultVO updateWxUserCompany(Map<String,Object> map) {
-
-//        userMapper.updateCpid();
-        return ResponseResultUtil.success(null);
+    public ResponseResultVO updateWxUserCompany(Map<String, Object> map) {
+        String userId = map.get("userId") + "";
+        Integer cpId = Integer.valueOf(map.get("cpId") + "");
+        List<Integer> cpIds = new ArrayList<>();
+        cpIds.add(cpId);
+        int i = userMapper.updateCpid(userId, cpId, cpIds);
+        return ResponseResultUtil.success(true);
     }
     }
 
 
     /**
     /**