Bladeren bron

bug修改

24282 2 jaren geleden
bovenliggende
commit
4f56dc6e6c

+ 49 - 51
bladex-saas-project/saas-business-tradeerp/src/main/java/com/fjhx/supply/service/impl/SupplyServiceImpl.java

@@ -14,8 +14,6 @@ import org.springblade.core.mp.base.BasicsServiceImpl;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtils;
-import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.Md5Utils;
 import org.springblade.core.tool.utils.id.IdUtils;
 import org.springblade.system.constant.RoleConstant;
 import org.springblade.system.user.entity.User;
@@ -192,62 +190,62 @@ public class SupplyServiceImpl extends BasicsServiceImpl<SupplyMapper, Supply> i
     @Transactional(rollbackFor = {Exception.class})
     @Override
     public void update(Supply supply) {
-        if (StringUtils.isAnyBlank(supply.getId(), supply.getSupplyName(), supply.getAccount())) {
+        if (StringUtils.isAnyBlank(supply.getId(), supply.getSupplyName())) {
             throw new ServiceException("参数缺失");
         }
-        //当前租户id
+        // 当前租户id
         String tenantId = AuthUtil.getTenantId();
         if (StringUtils.isBlank(tenantId)) {
             throw new ServiceException("当前租户ID为空");
         }
 
-        //判断账号是否重复
-        boolean exist = getAccountIsExist(supply.getId(), tenantId, supply.getAccount());
-        if (exist) {
-            throw new ServiceException("账号已存在");
-        }
-
-        //供应商详情
-        Supply info = getById(supply.getId());
-        //如果供应商账号为空则新增账号
-        if (StringUtils.isBlank(info.getAccount())) {
-            if (StringUtils.isBlank(supply.getPassword())) {
-                throw new ServiceException("参数缺失");
-            }
-            //校验账号是否存在
-            R<Boolean> r = iUserClient.checkAccountExist(tenantId, null, supply.getAccount());
-            if (!r.isSuccess()) {
-                throw new ServiceException("获取用户失败");
-            }
-            if (r.getData()) {
-                throw new ServiceException("账号已存在");
-            }
-
-            //新增用户
-            User user = new User();
-            user.setAccount(supply.getAccount());
-            user.setPassword(Md5Utils.hash(supply.getPassword()));
-            user.setName(supply.getSupplyName());
-            user.setRealName(supply.getSupplyName());
-            user.setEmail(supply.getContactMail());
-            user.setPhone(supply.getSupplyTel());
-            saveUser(Arrays.asList(user));
-        } else {
-            //校验账号是否存在
-            R<Boolean> r = iUserClient.checkAccountExist(tenantId, info.getAccount(), supply.getAccount());
-            if (!r.isSuccess()) {
-                throw new ServiceException("获取用户失败");
-            }
-            if (r.getData()) {
-                throw new ServiceException("账号已存在");
-            }
-            //通过旧账号修改账号
-            R r2 = iUserClient.updateAccount(tenantId, info.getAccount(), supply.getAccount());
-            if (!r2.isSuccess()) {
-                throw new ServiceException("修改供应商账号失败");
-            }
-        }
-        //修改供应商
+        // //判断账号是否重复
+        // boolean exist = getAccountIsExist(supply.getId(), tenantId, supply.getAccount());
+        // if (exist) {
+        //     throw new ServiceException("账号已存在");
+        // }
+        //
+        // //供应商详情
+        // Supply info = getById(supply.getId());
+        // //如果供应商账号为空则新增账号
+        // if (StringUtils.isBlank(info.getAccount())) {
+        //     if (StringUtils.isBlank(supply.getPassword())) {
+        //         throw new ServiceException("参数缺失");
+        //     }
+        //     //校验账号是否存在
+        //     R<Boolean> r = iUserClient.checkAccountExist(tenantId, null, supply.getAccount());
+        //     if (!r.isSuccess()) {
+        //         throw new ServiceException("获取用户失败");
+        //     }
+        //     if (r.getData()) {
+        //         throw new ServiceException("账号已存在");
+        //     }
+        //
+        //     //新增用户
+        //     User user = new User();
+        //     user.setAccount(supply.getAccount());
+        //     user.setPassword(Md5Utils.hash(supply.getPassword()));
+        //     user.setName(supply.getSupplyName());
+        //     user.setRealName(supply.getSupplyName());
+        //     user.setEmail(supply.getContactMail());
+        //     user.setPhone(supply.getSupplyTel());
+        //     saveUser(Arrays.asList(user));
+        // } else {
+        //     //校验账号是否存在
+        //     R<Boolean> r = iUserClient.checkAccountExist(tenantId, info.getAccount(), supply.getAccount());
+        //     if (!r.isSuccess()) {
+        //         throw new ServiceException("获取用户失败");
+        //     }
+        //     if (r.getData()) {
+        //         throw new ServiceException("账号已存在");
+        //     }
+        //     //通过旧账号修改账号
+        //     R r2 = iUserClient.updateAccount(tenantId, info.getAccount(), supply.getAccount());
+        //     if (!r2.isSuccess()) {
+        //         throw new ServiceException("修改供应商账号失败");
+        //     }
+        // }
+        // 修改供应商
         super.updateById(supply);
     }
 

+ 4 - 3
bladex-saas-project/service-flow/src/main/java/com/fjhx/controller/example/ExampleInfoController.java

@@ -60,7 +60,7 @@ public class ExampleInfoController {
      * 已办
      */
     @PostMapping("/getDone")
-    public R getDone(Map<String, String> condition) {
+    public R getDone(@RequestBody Map<String, String> condition) {
         Page<Map<String, Object>> result = exampleInfoService.getDone(condition);
         return R.data(result);
     }
@@ -69,7 +69,7 @@ public class ExampleInfoController {
      * 撤回
      */
     @PostMapping("/withdraw")
-    public R withdraw(Map<String, Long> condition) {
+    public R withdraw(@RequestBody Map<String, Long> condition) {
         Long withdrawExampleInfoId = condition.get("withdrawExampleInfoId");
         Long withdrawExampleDetailsId = condition.get("withdrawExampleDetailsId");
         exampleInfoService.withdraw(withdrawExampleInfoId, withdrawExampleDetailsId);
@@ -80,10 +80,11 @@ public class ExampleInfoController {
      * 撤销
      */
     @PostMapping("/revoke")
-    public R revoke(Map<String, Long> condition) {
+    public R revoke(@RequestBody Map<String, Long> condition) {
         Long withdrawExampleInfoId = condition.get("withdrawExampleInfoId");
         exampleInfoService.revoke(withdrawExampleInfoId);
         return R.success();
     }
+
 }