浏览代码

no message

FengChaoYu 7 月之前
父节点
当前提交
e770ea7c11

+ 105 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/material/manage/WebsitPartsCreditItemVO.java

@@ -0,0 +1,105 @@
+package com.gree.mall.manager.bean.material.manage;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.material.*;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@ApiModel
+@ZfireField(tbName = "a")
+public class WebsitPartsCreditItemVO {
+
+    @ApiModelProperty(value = "销售单号")
+    private String salesId;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("销售类型")
+    private BuyPeopleEnum buyPeople;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("申请类别")
+    private PartsApplyCategoryEnum applyCategory;
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
+
+    @ApiModelProperty(value = "网点名称")
+    private String websitName;
+
+    @ApiModelProperty("申请人")
+    private String workerName;
+
+    @ApiModelProperty("联系电话")
+    private String mobile;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("申请类型")
+    private PartsApplyTypeEnum applyType;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("发货方式")
+    private DeliveryTypeEnum deliveryType;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("接收单位")
+    private String receiveUnit;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("发货单位")
+    private String deliveryUnit;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("详细地址")
+    private String address;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("订单来源")
+    private SourceSalesEnum orderSource;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("订单状态")
+    private PartsOrderStatusEnum status;
+
+    @ZfireField(tbName = "b")
+    @ApiModelProperty("支付状态")
+    private PartsPayFlagEnum payFlag;
+
+    @ApiModelProperty("备注")
+    private String remark;
+
+    @ApiModelProperty("创建人")
+    private String createBy;
+
+    @ApiModelProperty("创建时间")
+    private Date createTime;
+
+    @ApiModelProperty("配件名称")
+    private String partsName;
+
+    @ApiModelProperty("销售价")
+    private BigDecimal salesPrice;
+
+    @ApiModelProperty("优惠价")
+    private BigDecimal secondPrice;
+
+    @ApiModelProperty("数量")
+    private Integer qty;
+
+    @ApiModelProperty("应收金额")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty("收款状态")
+    private PartsCreditEnum creditStatus;
+
+    @ApiModelProperty("收款人")
+    private String updateBy;
+
+    @ApiModelProperty("收款时间")
+    private Date updateTime;
+}

+ 8 - 0
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/MaterialMapper.java

@@ -487,4 +487,12 @@ public interface MaterialMapper {
      * @return
      * @return
      */
      */
     IPage<WebsitPartsCreditVO> websitPartsCreditPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
     IPage<WebsitPartsCreditVO> websitPartsCreditPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
+
+    /**
+     * 网点记账列表
+     * @param page
+     * @param zfireParamBean
+     * @return
+     */
+    IPage<WebsitPartsCreditItemVO> websitPartsCreditItemPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
 }
 }

+ 27 - 3
mall-server-api/src/main/java/com/gree/mall/manager/controller/material/manage/WebsitPartsCreditController.java

@@ -3,6 +3,7 @@ package com.gree.mall.manager.controller.material.manage;
 import cn.hutool.core.lang.TypeReference;
 import cn.hutool.core.lang.TypeReference;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.gree.mall.manager.annotation.ZfireList;
 import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditItemVO;
 import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO;
 import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.helper.ResponseHelper;
 import com.gree.mall.manager.logic.material.manage.WebsitPartsCreditLogic;
 import com.gree.mall.manager.logic.material.manage.WebsitPartsCreditLogic;
@@ -32,22 +33,45 @@ public class WebsitPartsCreditController {
     @ZfireList
     @ZfireList
     @PostMapping("/gather/list")
     @PostMapping("/gather/list")
     @ApiOperation(value = "网点汇总记账-列表")
     @ApiOperation(value = "网点汇总记账-列表")
-    public ResponseHelper<IPage<WebsitPartsCreditVO>> page(
+    public ResponseHelper<IPage<WebsitPartsCreditVO>> gatherPage(
             @RequestBody ZfireParamBean zfireParamBean
             @RequestBody ZfireParamBean zfireParamBean
     ) {
     ) {
-        IPage<WebsitPartsCreditVO> page = websitPartsCreditLogic.page(zfireParamBean);
+        IPage<WebsitPartsCreditVO> page = websitPartsCreditLogic.gatherPage(zfireParamBean);
         return ResponseHelper.success(page, new TypeReference<WebsitPartsCreditVO>() {});
         return ResponseHelper.success(page, new TypeReference<WebsitPartsCreditVO>() {});
     }
     }
 
 
     @PostMapping("/gather/list/export")
     @PostMapping("/gather/list/export")
     @ApiOperation("网点汇总记账-列表导出")
     @ApiOperation("网点汇总记账-列表导出")
+    public void gatherListExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //2.查询要导出的内容
+        IPage<WebsitPartsCreditVO> baseVOIPage = websitPartsCreditLogic.gatherPage(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(baseVOIPage.getRecords(), zfireParamBean.getExportFields(), request, response);
+    }
+
+    @ZfireList
+    @PostMapping("/list")
+    @ApiOperation(value = "网点记账-列表")
+    public ResponseHelper<IPage<WebsitPartsCreditItemVO>> page(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) {
+        IPage<WebsitPartsCreditItemVO> page = websitPartsCreditLogic.page(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<WebsitPartsCreditItemVO>() {});
+    }
+
+    @PostMapping("/gather/list/export")
+    @ApiOperation("网点记账-列表导出")
     public void listExport(
     public void listExport(
             @RequestBody ZfireParamBean zfireParamBean,
             @RequestBody ZfireParamBean zfireParamBean,
             HttpServletRequest request,
             HttpServletRequest request,
             HttpServletResponse response
             HttpServletResponse response
     ) throws Exception {
     ) throws Exception {
         //2.查询要导出的内容
         //2.查询要导出的内容
-        IPage<WebsitPartsCreditVO> baseVOIPage = websitPartsCreditLogic.page(zfireParamBean);
+        IPage<WebsitPartsCreditItemVO> baseVOIPage = websitPartsCreditLogic.page(zfireParamBean);
         //3.导出
         //3.导出
         FieldUtils.exportData(baseVOIPage.getRecords(), zfireParamBean.getExportFields(), request, response);
         FieldUtils.exportData(baseVOIPage.getRecords(), zfireParamBean.getExportFields(), request, response);
     }
     }

+ 11 - 2
mall-server-api/src/main/java/com/gree/mall/manager/logic/material/manage/WebsitPartsCreditLogic.java

@@ -3,6 +3,7 @@ package com.gree.mall.manager.logic.material.manage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
 import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditItemVO;
 import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO;
 import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO;
 import com.gree.mall.manager.commonmapper.MaterialMapper;
 import com.gree.mall.manager.commonmapper.MaterialMapper;
 import com.gree.mall.manager.logic.common.CommonLogic;
 import com.gree.mall.manager.logic.common.CommonLogic;
@@ -20,11 +21,19 @@ public class WebsitPartsCreditLogic {
     private final CommonLogic commonLogic;
     private final CommonLogic commonLogic;
     private final MaterialMapper materialMapper;
     private final MaterialMapper materialMapper;
 
 
-
-    public IPage<WebsitPartsCreditVO> page(ZfireParamBean zfireParamBean) {
+    public IPage<WebsitPartsCreditVO> gatherPage(ZfireParamBean zfireParamBean) {
         AdminUserCom adminUser = commonLogic.getAdminUser();
         AdminUserCom adminUser = commonLogic.getAdminUser();
         FieldUtils.materialParam(zfireParamBean, WebsitPartsCreditVO.class, adminUser);
         FieldUtils.materialParam(zfireParamBean, WebsitPartsCreditVO.class, adminUser);
         IPage<WebsitPartsCreditVO> page = materialMapper.websitPartsCreditPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
         IPage<WebsitPartsCreditVO> page = materialMapper.websitPartsCreditPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
         return page;
         return page;
     }
     }
+
+    public IPage<WebsitPartsCreditItemVO> page(ZfireParamBean zfireParamBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        FieldUtils.materialParam(zfireParamBean, WebsitPartsCreditItemVO.class, adminUser);
+        IPage<WebsitPartsCreditItemVO> page = materialMapper.websitPartsCreditItemPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
+        return page;
+    }
+
+
 }
 }

+ 23 - 5
mall-server-api/src/main/resources/mapper/MaterialMapper.xml

@@ -1466,6 +1466,7 @@
             resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO">
             resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO">
         SELECT a.* FROM (
         SELECT a.* FROM (
             SELECT
             SELECT
+                a.company_wechat_id,
                 a.websit_id,
                 a.websit_id,
                 a.websit_name,
                 a.websit_name,
                 a.worker_id,
                 a.worker_id,
@@ -1473,15 +1474,13 @@
                 a.identity,
                 a.identity,
                 a.mobile,
                 a.mobile,
                 SUM(a.total_amount) AS total,
                 SUM(a.total_amount) AS total,
-                SUM(IF(a.status = 1, a.total_amount, 0)) AS rec_total,
-                SUM(IF(a.status = 0, a.total_amount, 0)) AS credit_total,
+                SUM(IF(a.credit_status = 1, a.total_amount, 0)) AS rec_total,
+                SUM(IF(a.credit_status = 0, a.total_amount, 0)) AS credit_total,
                 MAX(a.update_time) AS update_time
                 MAX(a.update_time) AS update_time
             FROM
             FROM
                 websit_parts_worker_credit_record a
                 websit_parts_worker_credit_record a
-            WHERE
-                a.company_wechat_id = '1831608878894858241'
             GROUP BY
             GROUP BY
-            a.websit_id, a.worker_id
+                a.company_wechat_id, a.websit_id, a.worker_id
         ) a
         ) a
         ${ex.query}
         ${ex.query}
         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
         <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
@@ -1493,4 +1492,23 @@
         ORDER BY
         ORDER BY
         a.update_time DESC
         a.update_time DESC
     </select>
     </select>
+
+    <select id="websitPartsCreditItemPage"
+            resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsCreditItemVO">
+        SELECT
+            ${ex.selected}
+        FROM
+            websit_parts_worker_credit_record a LEFT JOIN websit_sales b ON a.sales_id = b.sales_id
+        ${ex.query}
+        <if test="ex.adminWebsitIds != null and ex.adminWebsitIds.size > 0">
+            AND a.websit_id IN
+            <foreach item="item" index="index" collection="ex.adminWebsitIds" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
 </mapper>
 </mapper>