Browse Source

fixed 修复发现的一些bug

fushengqian 1 year ago
parent
commit
cecaf2f8fe

+ 4 - 2
fuint-application/src/main/java/com/fuint/common/service/StaffService.java

@@ -27,10 +27,12 @@ public interface StaffService extends IService<MtStaff> {
     /**
     /**
      * 保存员工信息
      * 保存员工信息
      *
      *
-     * @param reqStaff
+     * @param reqStaff 员工信息
+     * @param operator 操作人
      * @throws BusinessCheckException
      * @throws BusinessCheckException
+     * @return
      */
      */
-    MtStaff saveStaff(MtStaff reqStaff) throws BusinessCheckException;
+    MtStaff saveStaff(MtStaff reqStaff, String operator) throws BusinessCheckException;
 
 
     /**
     /**
      * 根据ID获取店铺信息
      * 根据ID获取店铺信息

+ 4 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/BannerServiceImpl.java

@@ -114,6 +114,9 @@ public class BannerServiceImpl extends ServiceImpl<MtBannerMapper, MtBanner> imp
                 mtBanner.setMerchantId(mtStore.getMerchantId());
                 mtBanner.setMerchantId(mtStore.getMerchantId());
             }
             }
         }
         }
+        if (mtBanner.getMerchantId() == null || mtBanner.getMerchantId() <= 0) {
+            throw new BusinessCheckException("新增焦点图失败:所属商户不能为空!");
+        }
         mtBanner.setStoreId(storeId);
         mtBanner.setStoreId(storeId);
         mtBanner.setStatus(StatusEnum.ENABLED.getKey());
         mtBanner.setStatus(StatusEnum.ENABLED.getKey());
         mtBanner.setUpdateTime(new Date());
         mtBanner.setUpdateTime(new Date());
@@ -123,7 +126,7 @@ public class BannerServiceImpl extends ServiceImpl<MtBannerMapper, MtBanner> imp
             return mtBanner;
             return mtBanner;
         } else {
         } else {
             logger.error("新增焦点图失败.");
             logger.error("新增焦点图失败.");
-            throw new BusinessCheckException("新增焦点图失败");
+            throw new BusinessCheckException("抱歉,新增焦点图失败");
         }
         }
     }
     }
 
 

+ 1 - 0
fuint-application/src/main/java/com/fuint/common/service/impl/GoodsServiceImpl.java

@@ -165,6 +165,7 @@ public class GoodsServiceImpl extends ServiceImpl<MtGoodsMapper, MtGoods> implem
             item.setUpdateTime(mtGoods.getUpdateTime());
             item.setUpdateTime(mtGoods.getUpdateTime());
             item.setStatus(mtGoods.getStatus());
             item.setStatus(mtGoods.getStatus());
             item.setOperator(mtGoods.getOperator());
             item.setOperator(mtGoods.getOperator());
+            item.setWeight(mtGoods.getWeight());
             dataList.add(item);
             dataList.add(item);
         }
         }
 
 

+ 7 - 1
fuint-application/src/main/java/com/fuint/common/service/impl/StaffServiceImpl.java

@@ -116,12 +116,13 @@ public class StaffServiceImpl extends ServiceImpl<MtStaffMapper, MtStaff> implem
      * 保存员工信息
      * 保存员工信息
      *
      *
      * @param  mtStaff 员工参数
      * @param  mtStaff 员工参数
+     * @param operator 操作人
      * @throws BusinessCheckException
      * @throws BusinessCheckException
      * @return
      * @return
      */
      */
     @Override
     @Override
     @OperationServiceLog(description = "保存店铺员工")
     @OperationServiceLog(description = "保存店铺员工")
-    public MtStaff saveStaff(MtStaff mtStaff) throws BusinessCheckException {
+    public MtStaff saveStaff(MtStaff mtStaff, String operator) throws BusinessCheckException {
         mtStaff.setUpdateTime(new Date());
         mtStaff.setUpdateTime(new Date());
         if (mtStaff.getId() == null || mtStaff.getId() <= 0) {
         if (mtStaff.getId() == null || mtStaff.getId() <= 0) {
             mtStaff.setCreateTime(new Date());
             mtStaff.setCreateTime(new Date());
@@ -153,12 +154,17 @@ public class StaffServiceImpl extends ServiceImpl<MtStaffMapper, MtStaff> implem
             userInfo.setStoreId(mtStaff.getStoreId());
             userInfo.setStoreId(mtStaff.getStoreId());
             userInfo.setMerchantId(mtStaff.getMerchantId());
             userInfo.setMerchantId(mtStaff.getMerchantId());
             userInfo.setIsStaff(YesOrNoEnum.YES.getKey());
             userInfo.setIsStaff(YesOrNoEnum.YES.getKey());
+            userInfo.setOperator(operator);
             mtUser = memberService.addMember(userInfo);
             mtUser = memberService.addMember(userInfo);
             if (mtUser != null) {
             if (mtUser != null) {
                 mtStaff.setUserId(mtUser.getId());
                 mtStaff.setUserId(mtUser.getId());
             } else {
             } else {
                 throw new BusinessCheckException("新增员工失败");
                 throw new BusinessCheckException("新增员工失败");
             }
             }
+        } else {
+            mtUser.setIsStaff(YesOrNoEnum.YES.getKey());
+            mtUser.setOperator(operator);
+            memberService.updateMember(mtUser, false);
         }
         }
 
 
         // 更新员工
         // 更新员工

+ 1 - 1
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendBalanceController.java

@@ -272,7 +272,7 @@ public class BackendBalanceController extends BaseController {
         if (rechargeItems.size() < 0) {
         if (rechargeItems.size() < 0) {
             return getFailureResult(201, "充值规则设置不能为空");
             return getFailureResult(201, "充值规则设置不能为空");
         }
         }
-        if (accountInfo.getMerchantId() == null || accountInfo.getMerchantId() < 0) {
+        if (accountInfo.getMerchantId() == null || accountInfo.getMerchantId() <= 0) {
             return getFailureResult(201, "平台方帐号无法执行该操作,请使用商户帐号操作");
             return getFailureResult(201, "平台方帐号无法执行该操作,请使用商户帐号操作");
         }
         }
 
 

+ 1 - 1
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendPointController.java

@@ -194,7 +194,7 @@ public class BackendPointController extends BaseController {
         if (accountInfo == null) {
         if (accountInfo == null) {
             return getFailureResult(1001, "请先登录");
             return getFailureResult(1001, "请先登录");
         }
         }
-        if (accountInfo.getMerchantId() == null || accountInfo.getMerchantId() < 0) {
+        if (accountInfo.getMerchantId() == null || accountInfo.getMerchantId() <= 0) {
             return getFailureResult(201, "平台方帐号无法执行该操作,请使用商户帐号操作");
             return getFailureResult(201, "平台方帐号无法执行该操作,请使用商户帐号操作");
         }
         }
 
 

+ 3 - 1
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendSmsController.java

@@ -159,7 +159,9 @@ public class BackendSmsController extends BaseController {
         if (accountInfo == null) {
         if (accountInfo == null) {
             return getFailureResult(1001, "请先登录");
             return getFailureResult(1001, "请先登录");
         }
         }
-
+        if (accountInfo.getMerchantId() == null || accountInfo.getMerchantId() <= 0) {
+            return getFailureResult(201, "平台方帐号无法执行该操作,请使用商户帐号操作");
+        }
         SmsSettingEnum[] settingList = SmsSettingEnum.values();
         SmsSettingEnum[] settingList = SmsSettingEnum.values();
         for (SmsSettingEnum setting : settingList) {
         for (SmsSettingEnum setting : settingList) {
             MtSetting mtSetting = new MtSetting();
             MtSetting mtSetting = new MtSetting();

+ 1 - 1
fuint-application/src/main/java/com/fuint/module/backendApi/controller/BackendStaffController.java

@@ -189,7 +189,7 @@ public class BackendStaffController extends BaseController {
                 return getFailureResult(201, "该手机号码已经存在");
                 return getFailureResult(201, "该手机号码已经存在");
             }
             }
         }
         }
-        staffService.saveStaff(mtStaff);
+        staffService.saveStaff(mtStaff, accountInfo.getAccountName());
         return getSuccessResult(true);
         return getSuccessResult(true);
     }
     }