xie.kaifeng пре 7 месеци
родитељ
комит
6f08d8264d

+ 7 - 0
mtp3-century/src/main/java/com/muchinfo/mtp3century/controller/ReportFormController.java

@@ -40,6 +40,13 @@ public class ReportFormController {
         return iReportFormService.shareAmountQueryPlat(param, request);
     }
 
+    @RequestMapping(method = RequestMethod.GET, value = "/queryDODPage")
+    @ApiOperation("报表管理-->分润报表(机构)-->机构明细")
+    @ApiResponse(code = 200, message = "成功", response = PageResult.class)
+    public PageResult<ReckonDivideOrderDetailResult> queryDODPage(ReckonDivideOrderDetailParam param, HttpServletRequest request) {
+        return iReportFormService.queryDODPage(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/IReportFormService.java

@@ -54,4 +54,6 @@ public interface IReportFormService {
     AjaxResult goodscountexport(GoodsReportParam param, HttpServletRequest request);
 
     AjaxResult<ShareAmountQueryResult> shareAmountQueryPlat(ShareAmountQueryParam param, HttpServletRequest request);
+
+    PageResult<ReckonDivideOrderDetailResult> queryDODPage(ReckonDivideOrderDetailParam param, HttpServletRequest request);
 }

+ 60 - 0
mtp3-century/src/main/java/com/muchinfo/mtp3century/service/impl/ReportFormServiceImpl.java

@@ -122,6 +122,66 @@ public class ReportFormServiceImpl implements IReportFormService {
         return AjaxResult.success(Constants.Success_Code_Design, MessageType.MESSAGE_CODE_SYSTEM001.getCode(), request.getHeader("Accept-Language"), resultIPage);
     }
 
+    @Override
+    public PageResult<ReckonDivideOrderDetailResult> queryDODPage(ReckonDivideOrderDetailParam param, HttpServletRequest request) {
+        if (StringUtils.isNotBlank(param.getOrgztypes())) {
+            if (param.getOrgztypes().contains("7")) {
+                //经纪会员 ,自营会员 才有历史查询  成交单查询权限  其他无  因此机构分润单据明细中成交单号不跳转
+                param.setOrgztypes("7");
+            } else if (param.getOrgztypes().contains("6")) {
+                //经纪会员 ,自营会员 才有历史查询  成交单查询权限  其他无  因此机构分润单据明细中成交单号不跳转
+                param.setOrgztypes("6");
+            }
+        } else {
+            //既不是经纪会员也不是自营会员
+            param.setOrgztypes("0");
+        }
+
+        IPage<ReckonDivideOrderDetailResult> page = new Page<>(param.getPageNum(), param.getPageSize());
+        IPage<ReckonDivideOrderDetailResult> resultIPage;
+        if (param.getTradefeetype() != null &&
+                (param.getTradefeetype() == 103 || param.getTradefeetype() == 104 ||
+                        param.getTradefeetype() == 107 ||
+                        param.getTradefeetype() == 108 || param.getTradefeetype() == 109)) {
+            resultIPage = detailMapper.queryDODPage(page, param);
+        } else {
+            String sp = iCommonService.getSysparmById(SysConstants.SYSPARAM_CODE_DIVIDE);
+            if (sp != null && sp.equals("2")) {
+                ReckonDivideOrderDetailParam detail = new ReckonDivideOrderDetailParam();
+                detail.setSearchtype(param.getSearchtype());
+                if (param.getMemberuserid() != null)
+                    detail.setMemberuserid(param.getMemberuserid());
+                if (param.getParentuserid() != null)
+                    detail.setParentuserid(param.getParentuserid());
+                if (param.getGoodsid() != null)
+                    detail.setGoodsid(param.getGoodsid());
+                if (param.getTradefeetype() != null)
+                    detail.setTradefeetype(param.getTradefeetype());
+                if (param.getStartDate() != null)
+                    detail.setStartDate(param.getStartDate());
+                if (param.getEndDate() != null)
+                    detail.setEndDate(param.getEndDate());
+                if (param.getAreatype() != null) {
+                    detail.setAreatype(param.getAreatype());
+                }
+                if (param.getAreaid() != null) {
+                    detail.setAreaid(param.getAreaid());
+                }
+                resultIPage = detailMapper.queryReckonAGDivideDetail(page, detail);
+            } else {
+                resultIPage = detailMapper.queryDODPage(page, param);
+            }
+        }
+        PageResult<ReckonDivideOrderDetailResult> 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) {

+ 4 - 1
mtp3-century/src/main/resources/application.yml

@@ -42,7 +42,10 @@ spring:
     password: muchinfo
       #hikari:
     #schema: mtp2_xkf
-
+  servlet:
+    multipart:
+      max-file-size: 10MB
+      max-request-size: 15MB
 
   profiles:
     #测试环境默认开启,生产环境设置成prod

+ 138 - 0
mtp3-century/src/main/resources/mapper/ReckonDaydividecountdetailMapper.xml

@@ -1522,4 +1522,142 @@
         </where>
         order by r.areaid,r.areatype,r.areaaccountid
     </select>
+    <select id="queryDODPage" resultType="com.muchinfo.mtp3pojos.vo.reportform.ReckonDivideOrderDetailResult">
+        select t.tradeid, t.tradefeetype, t.areaid, t.areatype, t.buyorsell,
+        t.tradedate, t.accountid,t.areaaccountid,
+        t.goodsid, t.feeamount, t.dividetype, t.dividevalue, t.divideamount,
+        t.creatdate,m.trademode
+        from RECKON_DIVIDEORDERDETAIL t
+        left join (
+        select t.goodsid,t.goodscode,t.goodsname,t.marketid from goods t
+        union
+        select t.goodsid,t.goodscode,t.goodsname,t.marketid from presale_listinginfo t
+        union
+        select t.goodsid,t.goodscode,t.goodsname,t.marketid from auction_orderinfo t
+        union
+        select t.goodsid,t.goodscode,t.goodsname,t.marketid from his_presale_listinginfo t where t.isvaliddata = 1
+        union
+        select t.goodsid,t.goodscode,t.goodsname,t.marketid from his_auction_orderinfo t where t.isvaliddata = 1
+        union
+        select t.goodsid, t.goodscode,t.goodscode goodsname,t.marketid from his_tender_tenderinfo t where t.isvaliddata
+        = 1
+        union
+        select t.goodsid, t.goodscode, t.goodscode goodsname,t.marketid from tender_tenderinfo t
+        ) g on t.goodsid = g.goodsid
+        left join market m on g.marketid = m.marketid
+        <where>
+            <if test="vo.areaid != null">
+                and t.areaid = #{vo.areaid,jdbcType=DECIMAL}
+            </if>
+            <if test="vo.areatype != null">
+                and t.areatype = #{vo.areatype,jdbcType=DECIMAL}
+            </if>
+            <if test="vo.areaaccountid != null">
+                and t.areaaccountid = #{vo.areaaccountid,jdbcType=DECIMAL}
+            </if>
+            <if test="vo.tradefeetype != null">
+                and t.tradefeetype = #{vo.tradefeetype,jdbcType=DECIMAL}
+            </if>
+            <if test="vo.goodsid != null and vo.goodsid != ''">
+                <choose>
+                    <when test="vo.searchtype==1">
+                        and t.goodsid = #{vo.goodsid,jdbcType=DECIMAL}
+                    </when>
+                    <otherwise>
+                        and t.goodsid = #{vo.goodsid,jdbcType=DECIMAL}
+                    </otherwise>
+                </choose>
+            </if>
+            <if test="vo.startDate != null and vo.startDate != '' and vo.endDate != null and vo.endDate != ''  ">
+                and (t.tradedate >= #{vo.startDate} and t.tradedate &lt;= #{vo.endDate})
+            </if>
+        </where>
+        order by t.tradedate
+    </select>
+    <select id="queryReckonAGDivideDetail"
+            resultType="com.muchinfo.mtp3pojos.vo.reportform.ReckonDivideOrderDetailResult">
+        <choose>
+            <when test="vo.areatype==12">
+                select t.tradedate,t.accountid,t.goodsid,t.parentuserid,t.dividetype,
+                t.dividevalue,t.divideamount,t.dividemode,t.marketid,t.totalcount,
+                ua.userid "relateduserid",
+                ua.accountname "accountname",
+                <choose>
+                    <when test="vo.searchtype==1">
+                        t.totalfeeamount feeamount
+                    </when>
+                    <otherwise>
+                        t.feeamount
+                    </otherwise>
+                </choose>
+                from Reckon_SubAGDivideDetail t
+                left join taaccount ta on t.accountid = ta.accountid
+                left join useraccount ua on ta.userid = ua.userid
+                <where>
+                    <if test="vo.areaid != null">
+                        <![CDATA[and t.parentuserid = #{vo.areaid}]]>
+                    </if>
+                    <if test="vo.goodsid != null">
+                        <choose>
+                            <when test="vo.searchtype==1">
+                                <!-- and t.marketid = #{goodsid,jdbcType=DECIMAL} -->
+                                and t.goodsid = #{goodsid,jdbcType=DECIMAL}
+                            </when>
+                            <otherwise>
+                                and t.goodsid = #{goodsid,jdbcType=DECIMAL}
+                            </otherwise>
+                        </choose>
+                    </if>
+                    <if test="vo.tradefeetype != null">
+                        <![CDATA[and t.tradefeetype = #{vo.tradefeetype}]]>
+                    </if>
+                    <if test="vo.startDate != null and vo.startDate != '' and vo.endDate != null and vo.endDate != ''  ">
+                        and (t.tradedate >= #{vo.startDate} and t.tradedate &lt;= #{vo.endDate})
+                    </if>
+                    <if test="vo.areatype != null and vo.areatype != ''  ">
+                        and t.areatype = #{vo.areatype}
+                    </if>
+                </where>
+            </when>
+            <otherwise>
+                select t.*,
+                ua.accountname "accountname" from Reckon_AGDivideDetail t
+                left join useraccount ua on t.relateduserid = ua.userid
+                <where>
+                    <if test="vo.memberuserid != null">
+                        <![CDATA[and t.memberuserid = #{vo.memberuserid}]]>
+                    </if>
+                    <if test="vo.parentuserid != null">
+                        <![CDATA[and t.parentuserid = #{vo.parentuserid}]]>
+                    </if>
+                    <if test="vo.accountid != null">
+                        <![CDATA[and t.accountid = #{vo.accountid}]]>
+                    </if>
+                    <if test="vo.areaid != null">
+                        <![CDATA[and t.areaid = #{vo.areaid}]]>
+                    </if>
+                    <if test="vo.goodsid != null">
+                        <choose>
+                            <when test="vo.searchtype==1">
+                                <!-- and t.marketid = #{goodsid,jdbcType=DECIMAL} -->
+                                and t.goodsid = #{vgoodsid,jdbcType=DECIMAL}
+                            </when>
+                            <otherwise>
+                                and t.goodsid = #{vo.goodsid,jdbcType=DECIMAL}
+                            </otherwise>
+                        </choose>
+                    </if>
+                    <if test="vo.tradefeetype != null">
+                        <![CDATA[and t.tradefeetype = #{vo.tradefeetype}]]>
+                    </if>
+                    <if test="vo.startDate != null and vo.startDate != '' and vo.endDate != null and vo.endDate != ''  ">
+                        and (t.tradedate >= #{vo.startDate} and t.tradedate &lt;= #{vo.endDate})
+                    </if>
+                    <if test="vo.areatype != null and vo.areatype != ''  ">
+                        and t.areatype = #{vo.areatype}
+                    </if>
+                </where>
+            </otherwise>
+        </choose>
+    </select>
 </mapper>

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

@@ -66,4 +66,8 @@ public interface IReckonDaydividecountdetailMapper extends BaseMapper<ReckonDayd
     List<ShareAmountQueryResult> queryByDate(@Param("vo") ShareAmountQueryParam param);
 
     List<ShareAmountQueryResult> queryByOther(@Param("vo")  ShareAmountQueryParam param);
+
+    IPage<ReckonDivideOrderDetailResult> queryDODPage(IPage<ReckonDivideOrderDetailResult> page,@Param("vo") ReckonDivideOrderDetailParam param);
+
+    IPage<ReckonDivideOrderDetailResult> queryReckonAGDivideDetail(IPage<ReckonDivideOrderDetailResult> page,@Param("vo")  ReckonDivideOrderDetailParam detail);
 }

+ 50 - 0
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/vo/reportform/ReckonDivideOrderDetailParam.java

@@ -0,0 +1,50 @@
+package com.muchinfo.mtp3pojos.vo.reportform;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Builder
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@ApiModel(value = "ReckonDivideOrderDetailParam对象", description = "分润报表明细")
+public class ReckonDivideOrderDetailParam {
+
+    private String orgztypes;
+
+    private String areaid;
+
+    private String goodsid;
+
+    private String areaaccountid;
+
+    private Integer tradefeetype;
+
+    private Integer areatype;
+
+    private Integer tradeproperty;
+
+    @ExcelProperty("开始日期")
+    private String startDate;
+
+    @ExcelProperty("结束日期")
+    private String endDate;
+
+    private Long searchtype;
+
+    @ApiModelProperty(value = "* 页码 *")
+    private Integer pageNum;
+
+    @ApiModelProperty(value = "* 页大小 *")
+    private Integer pageSize;
+
+    private Long parentuserid;
+
+    private Long memberuserid;
+
+}

+ 37 - 0
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/vo/reportform/ReckonDivideOrderDetailResult.java

@@ -0,0 +1,37 @@
+package com.muchinfo.mtp3pojos.vo.reportform;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.annotations.ApiModel;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.math.BigDecimal;
+
+@Builder
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@ApiModel(value = "ReckonDivideOrderDetailResult对象", description = "分润报表明细响应")
+public class ReckonDivideOrderDetailResult {
+
+    @ExcelProperty("源账户")
+    private String accountid;
+
+    @ExcelProperty("总费用金额")
+    private BigDecimal feeamount;
+
+    @ExcelProperty("分润算法")
+    private Integer dividetype;
+
+    @ExcelProperty("分配值")
+    private BigDecimal dividevalue;
+
+    @ExcelProperty("分润金额")
+    private BigDecimal divideamount;
+
+    private Long relateduserid;
+
+    private String accountname;
+}

+ 4 - 0
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/vo/reportform/ShareAmountQueryParam.java

@@ -45,4 +45,8 @@ public class ShareAmountQueryParam {
     private String cycletime;
 
     private Long parentareaid;
+
+    private Integer usertype;
+
+    private Integer areatype;
 }

+ 1 - 0
mtp3-pojos/src/main/java/com/muchinfo/mtp3pojos/vo/reportform/ShareAmountQueryResult.java

@@ -40,4 +40,5 @@ public class ShareAmountQueryResult {
     @ApiModelProperty(value = "会员/机构 reletype == 1")
     private String areaname;
 
+    private Integer tradefeetype;
 }