Explorar o código

垫款相关 申请记录和充值列表页面权限调整

zhaoxian %!s(int64=2) %!d(string=hai) anos
pai
achega
8fed59d2b6

+ 18 - 6
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentApplicationController.java

@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * 申请垫款表
@@ -51,15 +53,25 @@ public class FinancePaymentApplicationController {
         //查询用户角色
         String roleCode = sysRoleService.getRoleCodeByUserId(application.getUserId());
         if ("sale".equals(roleCode) || "saleAssistant".equals(roleCode) || "saleAm".equals(roleCode)) {
-            if (!Check.isNull(application.getApplicanterId())) {
-                queryWrapper.eq("applicanter_id", application.getApplicanterId());
+            if ("4f6454dbad954a8094013bf4c6d74796".equals(application.getUserId())) {
+                /*销售助理 曹媛:侯加鑫、王维新、高洪哲             */
+                List<String> userIds = new ArrayList<>();
+                userIds.add("4f6454dbad954a8094013bf4c6d74796");
+                userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫
+                userIds.add("959842590bfc4ad38e0aced255177ced");//王维新
+                userIds.add("f0190eaabfb4488caa22e123e94dadc8");//高洪哲
+                queryWrapper.in("applicanter_id", userIds);
+
+            } else if ("163a4cc9a72c425e873d36d08e75f2cd".equals(application.getUserId())) {
+                /*销售助理 陈心瑞:崔泽、王明雨                 */
+                List<String> userIds = new ArrayList<>();
+                userIds.add("163a4cc9a72c425e873d36d08e75f2cd");
+                userIds.add("fe4965692844468798e4fc265e3cdfc8");//崔泽
+                userIds.add("9a99a2e906b64f5082f87c3a60a20b2e");//王明雨
+                queryWrapper.in("applicanter_id", userIds);
             } else {
                 queryWrapper.eq("applicanter_id", application.getUserId());
             }
-        } else {
-            if (!Check.isNull(application.getApplicanterId())) {
-                queryWrapper.eq("applicanter_id", application.getApplicanterId());
-            }
         }
         if (!Check.isNull(application.getAdvertiserName())) {
             queryWrapper.like("advertiser_name", application.getAdvertiserName());

+ 23 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/controller/FinancePaymentRechargeApplicationController.java

@@ -17,6 +17,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 /**
  * 充值申请表
  */
@@ -42,7 +46,25 @@ public class FinancePaymentRechargeApplicationController {
             //查询用户角色
             String roleCode = sysRoleService.getRoleCodeByUserId(recharge.getUserId());
             if ("sale".equals(roleCode) || "saleAssistant".equals(roleCode) || "saleAm".equals(roleCode)) {
-                recharge.setApplicanterId(recharge.getUserId());
+                if ("4f6454dbad954a8094013bf4c6d74796".equals(recharge.getUserId())) {
+                    /*销售助理 曹媛 4f6454dbad954a8094013bf4c6d74796:侯加鑫、王维新、高洪哲             */
+
+                    List<String> userIds = new ArrayList<>();
+                    userIds.add("4f6454dbad954a8094013bf4c6d74796");
+                    userIds.add("42e137a90ca94cbfa89b21b306cb2e78");//侯加鑫
+                    userIds.add("959842590bfc4ad38e0aced255177ced");//王维新
+                    userIds.add("f0190eaabfb4488caa22e123e94dadc8");//高洪哲
+                    recharge.setUserIds(userIds);
+                } else if ("163a4cc9a72c425e873d36d08e75f2cd".equals(recharge.getUserId())) {
+                    /*销售助理 陈心瑞:崔泽、王明雨                 */
+                    List<String> userIds = new ArrayList<>();
+                    userIds.add("163a4cc9a72c425e873d36d08e75f2cd");
+                    userIds.add("fe4965692844468798e4fc265e3cdfc8");//崔泽
+                    userIds.add("9a99a2e906b64f5082f87c3a60a20b2e");//王明雨
+                    recharge.setUserIds(userIds);
+                } else {
+                    recharge.setApplicanterId(recharge.getUserId());
+                }
             }
             return financePaymentRechargeApplicationService.queryPageList(recharge, pageNo, pageSize);
         } catch (Exception e) {

+ 7 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/entity/FinancePaymentRechargeApplication.java

@@ -11,6 +11,8 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
+import java.util.List;
+
 /**
  * 充值申请表
  */
@@ -154,4 +156,9 @@ public class FinancePaymentRechargeApplication {
      */
     @TableField(exist = false)
     private String userId;
+    /**
+     * 登录人IDs
+     */
+    @TableField(exist = false)
+    private List<String> userIds;
 }

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/FinancePaymentPoolMapper.java

@@ -17,7 +17,7 @@ import java.util.Map;
  */
 public interface FinancePaymentPoolMapper extends BaseMapper<FinancePaymentPool> {
 
-    FinancePaymentPool queryFinancePaymentPool(@Param("advertiserId") String advertiserId, @Param("productId") Long productId, @Param("paymentMedia") String paymentMedia);
+    FinancePaymentPool queryFinancePaymentPool(@Param("advertiserName") String advertiserName, @Param("productId") Long productId, @Param("paymentMedia") String paymentMedia);
 
     List<JSONObject> queryIdAndName(Map<String, Object> map);
 

+ 1 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentPoolMapper.xml

@@ -16,7 +16,7 @@
                rebate_type,
                rebate_rate
         FROM finance_payment_pool
-        WHERE advertiser_id = #{advertiserId}
+        WHERE advertiser_name = #{advertiserName}
           AND product_id = #{productId}
           AND payment_media = #{paymentMedia}
     </select>

+ 7 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/mapper/xml/FinancePaymentRechargeApplicationMapper.xml

@@ -68,6 +68,13 @@
             <if test="applicanterId != null and applicanterId != '' ">
                 and t1.applicanter_id=#{applicanterId}
             </if>
+            <if test="userIds != null and userIds.size()>0">
+                and t1.applicanter_id IN
+                <foreach collection="userIds" item="item" separator=","
+                         open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
             <if test="paymentMedia != null and paymentMedia != '' ">
                 and t1.payment_media=#{paymentMedia}
             </if>

+ 2 - 2
jeecg-boot-module-system/src/main/java/cn/com/ctop/finance/payment/service/impl/FinancePaymentPoolServiceImpl.java

@@ -36,7 +36,7 @@ public class FinancePaymentPoolServiceImpl extends ServiceImpl<FinancePaymentPoo
     @Override
     public void add(FinancePaymentRechargeApplication recharge, FinancePaymentApplication application) {
         if (Check.isNull(recharge)) {
-            FinancePaymentPool pool = baseMapper.queryFinancePaymentPool(application.getAdvertiserId(), application.getProductId(), application.getPaymentMedia());
+            FinancePaymentPool pool = baseMapper.queryFinancePaymentPool(application.getAdvertiserName(), application.getProductId(), application.getPaymentMedia());
             if (Check.isNull(pool)) {
                 FinancePaymentPool paymentPool = new FinancePaymentPool();
                 BeanUtil.copyProperties(application, paymentPool);
@@ -52,7 +52,7 @@ public class FinancePaymentPoolServiceImpl extends ServiceImpl<FinancePaymentPoo
                 this.updateById(pool);
             }
         } else {
-            FinancePaymentPool pool = baseMapper.queryFinancePaymentPool(recharge.getAdvertiserId(), recharge.getProductId(), recharge.getPaymentMedia());
+            FinancePaymentPool pool = baseMapper.queryFinancePaymentPool(recharge.getAdvertiserName(), recharge.getProductId(), recharge.getPaymentMedia());
             if (!Check.isNull(pool)) {
                 JSONObject amounts = accountMapperl.queryAmounts(recharge.getId());
                 BigDecimal cashAmount = pool.getCashAmount();