xie.kaifeng 7 ماه پیش
والد
کامیت
a0f5575354

+ 8 - 0
mtp3-century/src/main/java/com/muchinfo/mtp3century/controller/OrganController.java

@@ -212,6 +212,14 @@ public class OrganController {
         return iOrganService.initAdd(role, request);
     }
 
+    @ApiOperation("会员机构管理-->机构管理-->获取角色权限信息")
+    @RequestMapping(method = RequestMethod.GET, value = "/getOragnDefaultManager")
+    @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)
+    private AjaxResult<String> getOragnDefaultManager(Long userid, HttpServletRequest request) {
+        return iOrganService.getOragnDefaultManager(userid, request);
+    }
+
+
     @ApiOperation("会员机构管理-->机构管理-->新增、修改")
     @RequestMapping(method = RequestMethod.POST, value = "/roleadd")
     @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)

+ 8 - 1
mtp3-century/src/main/java/com/muchinfo/mtp3century/controller/ReportFormController.java

@@ -27,12 +27,19 @@ public class ReportFormController {
     private IReportFormService iReportFormService;
 
     @RequestMapping(method = RequestMethod.GET, value = "/shareAmountQuery")
-    @ApiOperation("报表管理-->分润报表")
+    @ApiOperation("报表管理-->分润报表(机构)")
     @ApiResponse(code = 200, message = "成功", response = PageResult.class)
     public PageResult<ShareAmountQueryResult> selectShareAmount(ShareAmountQueryParam param, HttpServletRequest request) {
         return iReportFormService.selectShareAmount(param, request);
     }
 
+    @RequestMapping(method = RequestMethod.GET, value = "/shareAmountQueryPlat")
+    @ApiOperation("报表管理-->分润报表(平台)")
+    @ApiResponse(code = 200, message = "成功", response = PageResult.class)
+    public PageResult<ShareAmountQueryResult> shareAmountQueryPlat(ShareAmountQueryParam param, HttpServletRequest request) {
+        return iReportFormService.shareAmountQueryPlat(param, request);
+    }
+
     @RequestMapping(method = RequestMethod.GET, value = "/queryRefUserSelect")
     @ApiOperation("报表管理-->推荐成交报表-->推荐人信息")
     @ApiResponse(code = 200, message = "成功", response = AjaxResult.class)

+ 2 - 0
mtp3-century/src/main/java/com/muchinfo/mtp3century/service/IOrganService.java

@@ -79,4 +79,6 @@ public interface IOrganService {
     AjaxResult logout(Long userid, HttpServletRequest request);
 
     AjaxResult<InitInvestorTradeResult> initAccTrade(String searchName, HttpServletRequest request);
+
+    AjaxResult<String> getOragnDefaultManager(Long userid, HttpServletRequest request);
 }

+ 2 - 0
mtp3-century/src/main/java/com/muchinfo/mtp3century/service/IReportFormService.java

@@ -52,4 +52,6 @@ public interface IReportFormService {
     AjaxResult<Map<Long, List<GoodsReportResult>>> daygoodscount(GoodsReportParam param, HttpServletRequest request);
 
     AjaxResult goodscountexport(GoodsReportParam param, HttpServletRequest request);
+
+    PageResult<ShareAmountQueryResult> shareAmountQueryPlat(ShareAmountQueryParam param, HttpServletRequest request);
 }

+ 8 - 0
mtp3-century/src/main/java/com/muchinfo/mtp3century/service/impl/OrganServiceImpl.java

@@ -1909,6 +1909,14 @@ public class OrganServiceImpl implements IOrganService {
         return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), results);
     }
 
+    @Override
+        public AjaxResult<String> getOragnDefaultManager(Long userid, HttpServletRequest request) {
+        Systemmanager user = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>()
+                .eq("areauserid", userid)
+                .eq("isdefault", 1));
+        return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), user == null ? "" : user.getLogincode() + "(" + user.getUsername() + ")");
+    }
+
     private void editARoleModifyMember(OrganRoleModifyParam vo, Systemmanager opeartion) {
         Date date = new Date();
 

+ 38 - 5
mtp3-century/src/main/java/com/muchinfo/mtp3century/service/impl/ReportFormServiceImpl.java

@@ -66,10 +66,6 @@ public class ReportFormServiceImpl implements IReportFormService {
     @Override
     public PageResult<ShareAmountQueryResult> selectShareAmount(ShareAmountQueryParam param, HttpServletRequest request) {
         Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
-        if (systemmanager.getReletype() != 1) {
-            param.setAreaid(systemmanager.getAreauserid());
-            param.setAreaname(iUseraccountMapper.selectOne(new QueryWrapper<Useraccount>().eq("userid", systemmanager.getAreauserid())).getAccountname());
-        }
         Object devidetype = redisServiceUtil.getCacheMapValue(Constants.REDIS_HEADER_SYSPARAM, SysConstants.SYSPARAM_CODE_DIVIDE);
         if (devidetype == null || "1".equals(devidetype.toString())) {
             param.setSearchtype(3);
@@ -95,8 +91,8 @@ public class ReportFormServiceImpl implements IReportFormService {
                 param.setTradedate(param.getTradedate() + param.getQuarter());
             }
             if (param.getCycletype() == 4 && param.getTradedate().length() == 8) {
-                param.setTradedate(null);
                 param.setCycletime(param.getTradedate());
+                param.setTradedate(null);
             }
             resultIPage = detailMapper.queryReportDivide(page, param);
         }
@@ -113,6 +109,43 @@ public class ReportFormServiceImpl implements IReportFormService {
     }
 
     @Override
+    public PageResult<ShareAmountQueryResult> shareAmountQueryPlat(ShareAmountQueryParam param, HttpServletRequest request) {
+        //只能查询自己和下一级的
+        Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
+        if (systemmanager.getReletype() != 1) {
+            if (param.getIsson() != null && param.getIsson() == 1) {
+                param.setParentareaid(systemmanager.getAreauserid());
+            } else {
+                param.setParentuserid(systemmanager.getAreauserid());
+            }
+        }
+
+        IPage<ShareAmountQueryResult> page = new Page<>(param.getPageNum(), param.getPageSize());
+        IPage<ShareAmountQueryResult> resultIPage;
+
+        if (param.getCycletype() == 0) {
+            resultIPage = detailMapper.queryByDate(page, param);
+        } else {
+            //周、月、季、年、全
+            if (param.getCycletype() == 2) {
+                //季报表
+                param.setTradedate(param.getTradedate() + param.getQuarter());
+            }
+            resultIPage = detailMapper.queryByOther(page, param);
+        }
+        PageResult<ShareAmountQueryResult> pageResult = new PageResult<>();
+        pageResult.setCode(Constants.Success_Code_Design);
+        pageResult.setMessage(AjaxResult.dealMsg(MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language")));
+        pageResult.setPages(resultIPage.getPages());
+        pageResult.setCurrent(resultIPage.getCurrent());
+        pageResult.setTotal(resultIPage.getTotal());
+        pageResult.setPageSize(resultIPage.getSize());
+        pageResult.setData(resultIPage.getRecords());
+        return pageResult;
+    }
+
+
+    @Override
     public AjaxResult<RefUserResult> queryRefUserSelect(String searchcode, HttpServletRequest request) {
         Systemmanager systemmanager = iSystemmanagerMapper.selectOne(new QueryWrapper<Systemmanager>().eq("LOGINCODE", iCommonService.getUserLoginCode(request)));
         Long refereeuserid = systemmanager.getAreauserid();

+ 94 - 3
mtp3-century/src/main/resources/mapper/ReckonDaydividecountdetailMapper.xml

@@ -224,7 +224,7 @@
                         'YYYYMMDD'),'iw')+3,'yyyy') || to_char(to_date(#{vo.cycletime},
                         'YYYYMMDD'), 'iw') from dual)
                     </if>
-                    <if test="vo.tradedate !=null and vo.tradedate != ''">
+                    <if test="vo.trade  date !=null and vo.tradedate != ''">
                         and t.cycletime = #{vo.tradedate}
                     </if>
                     <if test="vo.areaid != null">
@@ -1420,9 +1420,9 @@
                 to_date(#{vo.startDate},'yyyy-MM-dd')
                 and to_date(#{vo.endDate},'yyyy-MM-dd')
             </if>
-            <if test="vo.bankname != null and vo.bankname !=''">
+            <if test="vo.cusbankname != null and vo.cusbankname !=''">
                 and (bi.bankname like
-                '%'||#{vo.bankname}||'%')
+                '%'||#{vo.cusbankname}||'%')
             </if>
         </where>
         order by r.tradedate desc
@@ -1431,4 +1431,95 @@
     <select id="execReportMonthType" parameterType="java.util.HashMap" statementType="CALLABLE">
         <![CDATA[{call PKG_HIS_REPORT_TABLE.PROC_HIS_REPORT_TABLE_MONTH(#{tradedate,mode=IN,jdbcType=DATE})}]]>
     </select>
+
+    <select id="queryByDate" resultType="com.muchinfo.mtp3pojos.vo.reportform.ShareAmountQueryResult">
+        select
+        r.tradedate as cycletime,
+        r.areaid,
+        r.areatype,
+        r.areaaccountid,
+        r.totalcount,
+        r.totalfee,
+        r.divideamount,
+        r.accountcurrencyid,
+        u.userid || '/' || u.accountname as areaname
+        from reckon_daydividecount r
+        left join useraccount u on r.areaid = u.userid
+        <where>
+            <if test="vo.tradedate != null and vo.tradedate != '' ">
+                and r.tradedate= #{vo.tradedate,jdbcType=CHAR}
+            </if>
+            <if test="vo.areaid != null">
+                and r.areaid = #{vo.areaid}
+            </if>
+            <if test="vo.areaname != null and vo.areaname != ''">
+                and r.areaid = #{vo.areaname}
+            </if>
+            <if test="vo.areatype != null and vo.areatype !=''">
+                and r.areatype in (${vo.areatype})
+            </if>
+            <if test="vo.usertype != null">
+                and u.usertype in (${vo.usertype})
+            </if>
+            <if test="vo.parentuserid != null or vo.parentuserid==1">
+                and (r.areaid = #{vo.parentuserid} or u.usertype=2 )
+            </if>
+            <if test="vo.parentareaid != null">
+                and r.areaid in (select userid from useraccount uo start with
+                uo.userid=${vo.parentareaid} connect by prior uo.userid
+                =uo.parentuserid and uo.usertype=3)
+            </if>
+            <if test="vo.yxareauserid !=null and vo.yxareauserid != ''">
+                and (u.userid = #{vo.yxareauserid} or u.userid in (select userid from useraccount t
+                where t.usertype in (2,3) and t.memberuserid in (select userid from useraccount t where t.usertype = 2 and t.parentuserid = #{vo.yxareauserid})))
+            </if>
+        </where>
+        order by r.areaid,r.areatype,r.areaaccountid
+    </select>
+    <select id="queryByOther" resultType="com.muchinfo.mtp3pojos.vo.reportform.ShareAmountQueryResult">
+        select
+        r.cycletype,r.cycletime,r.areaid,r.areatype,
+        r.areaaccountid,r.totalcount,r.totalfee,
+        r.divideamount,
+        u.userid || '/' || u.accountname as areaname
+        from report_dividecount r
+        left join useraccount u on r.areaid = u.userid
+        <where>
+            <if test="vo.cycletype !=null and vo.cycletype != ''">
+                and r.cycletype=#{vo.cycletype}
+            </if>
+            <if test="vo.tradedate !=null and vo.tradedate != '' and vo.cycletype != 4">
+                and r.cycletime = #{vo.tradedate}
+            </if>
+            <if test="vo.tradedate !=null and vo.tradedate != '' and vo.cycletype == 4">
+                and r.cycletime= (select to_char(trunc(to_date(#{vo.tradedate},
+                'YYYYMMDD'),'iw')+3,'yyyy') || to_char(to_date(#{vo.tradedate},
+                'YYYYMMDD'), 'iw') from dual)
+            </if>
+            <if test="vo.areaname != null and vo.areaname !=''">
+                and r.areaid = #{vo.areaname}
+            </if>
+            <if test="vo.usertype != null and vo.usertype !=''">
+                and u.usertype in (${vo.usertype})
+            </if>
+            <if test="vo.areatype != null and vo.areatype !=''">
+                and r.areatype in (${vo.areatype})
+            </if>
+            <if test="vo.parentuserid != null or vo.parentuserid==1">
+                <choose>
+                    <when test="vo.parentuserid==1">
+                        and (r.areaid = 1 or u.usertype=2 )
+                    </when>
+                    <otherwise>
+                        and (r.areaid = #{vo.parentuserid} or u.parentuserid=#{vo.parentuserid} )
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="vo.yxareauserid !=null and vo.yxareauserid != ''">
+                and (u.userid = #{vo.yxareauserid} or u.userid in (select userid from useraccount t
+                where t.usertype in (2,3) and t.memberuserid in (select userid from useraccount t where t.usertype = 2 and t.parentuserid = #{vo.yxareauserid})))
+            </if>
+        </where>
+        order by r.areaid,r.areatype,r.areaaccountid
+    </select>
 </mapper>

+ 4 - 0
mtp3-interface/src/main/java/com/muchinfo/mtp3interface/mapper/IReckonDaydividecountdetailMapper.java

@@ -62,4 +62,8 @@ public interface IReckonDaydividecountdetailMapper extends BaseMapper<ReckonDayd
     List<ManageDivReportResult> managediv(@Param("vo") CusBankReportParam param);
 
     void execReportMonthType(@Param("tradedate") Date tradedate);
+
+    IPage<ShareAmountQueryResult> queryByDate(IPage<ShareAmountQueryResult> page,@Param("vo") ShareAmountQueryParam param);
+
+    IPage<ShareAmountQueryResult> queryByOther(IPage<ShareAmountQueryResult> page,@Param("vo")  ShareAmountQueryParam param);
 }

+ 3 - 1
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/vo/reportform/ShareAmountQueryParam.java

@@ -16,7 +16,7 @@ public class ShareAmountQueryParam {
 
     private Long areaid;
 
-    private String areaname;
+    private Long areaname;
 
     @ApiModelProperty(value = "报表类型")
     private Integer cycletype;
@@ -49,4 +49,6 @@ public class ShareAmountQueryParam {
     private Integer pageSize;
 
     private String cycletime;
+
+    private Long parentareaid;
 }