FengChaoYu vor 7 Monaten
Ursprung
Commit
42b9f7b2da

+ 1 - 1
mall-miniapp-service/src/main/java/com/gree/mall/miniapp/enums/MaterialSalesFlagEnum.java

@@ -15,7 +15,7 @@ public enum MaterialSalesFlagEnum implements BaseEnum {
     SAVE("SAVE","保存"),
     SUBMIT("SUBMIT","提交"),
     PAY_NOT_TAKE("PAY_NOT_TAKE","已支付,未提货"),
-    PAY_TAKE("PAY_TAKE","已支付,已提货"),
+    PAY_TAKE("PAY_TAKE","已提货"),
     CANCEL("CANCEL","取消订单"),
     ;
 

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

@@ -0,0 +1,46 @@
+package com.gree.mall.manager.bean.material.manage;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+@Data
+@ApiModel
+@ZfireField(tbName = "a")
+public class WebsitPartsCreditVO {
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "网点编号")
+    private String websitId;
+
+    @ApiModelProperty(value = "网点名称")
+    private String websitName;
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "师傅编号")
+    private String workerId;
+
+    @ApiModelProperty(value = "师傅姓名")
+    private String workerName;
+
+    @ApiModelProperty(value = "师傅身份证")
+    private String identity;
+
+    @ApiModelProperty(value = "师傅联系电话")
+    private String mobile;
+
+    @ApiModelProperty(value = "记账总金额")
+    private BigDecimal total;
+
+    @ApiModelProperty(value = "记账总金额")
+    private BigDecimal recTotal;
+
+    @ApiModelProperty(value = "记账总金额")
+    private BigDecimal creditTotal;
+
+    @ApiModelProperty(value = "更新时间")
+    private Data updateTime;
+}

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

@@ -479,4 +479,12 @@ public interface MaterialMapper {
     List<WorkerPurchaseCategoryBean> getWorkerMonthSummaryData(@Param("companyWechatId") String companyWechatId,
                                                                @Param("startDate") String startDate,
                                                                @Param("endDate") String endDate);
+
+    /**
+     * 网点汇总记账列表
+     * @param page
+     * @param zfireParamBean
+     * @return
+     */
+    IPage<WebsitPartsCreditVO> websitPartsCreditPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
 }

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

@@ -0,0 +1,54 @@
+package com.gree.mall.manager.controller.material.manage;
+
+import cn.hutool.core.lang.TypeReference;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.gree.mall.manager.annotation.ZfireList;
+import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.material.manage.WebsitPartsCreditLogic;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Slf4j
+@RestController
+@Api(value = "网点配件记账管理", tags ={"网点配件记账管理"} )
+@RequestMapping(value = "/parts/credit", produces = "application/json; charset=utf-8")
+public class WebsitPartsCreditController {
+
+    @Resource
+    WebsitPartsCreditLogic websitPartsCreditLogic;
+
+    @ZfireList
+    @PostMapping("/gather/list")
+    @ApiOperation(value = "网点汇总记账-列表")
+    public ResponseHelper<IPage<WebsitPartsCreditVO>> page(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) {
+        IPage<WebsitPartsCreditVO> page = websitPartsCreditLogic.page(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<WebsitPartsCreditVO>() {});
+    }
+
+    @PostMapping("/gather/list/export")
+    @ApiOperation("网点汇总记账-列表导出")
+    public void listExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //2.查询要导出的内容
+        IPage<WebsitPartsCreditVO> baseVOIPage = websitPartsCreditLogic.page(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(baseVOIPage.getRecords(), zfireParamBean.getExportFields(), request, response);
+    }
+}

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/enums/material/MaterialSalesFlagEnum.java

@@ -15,7 +15,7 @@ public enum MaterialSalesFlagEnum implements BaseEnum {
     SAVE("SAVE","保存"),
     SUBMIT("SUBMIT","提交"),
     PAY_NOT_TAKE("PAY_NOT_TAKE","已支付,未提货"),
-    PAY_TAKE("PAY_TAKE","已支付,已提货"),
+    PAY_TAKE("PAY_TAKE","已提货"),
     CANCEL("CANCEL","取消订单"),
     IMPORT_WAIT("IMPORT_WAIT","导入待处理"),
     IMPORT_ERR("IMPORT_ERR","导入处理失败"),

+ 28 - 0
mall-server-api/src/main/java/com/gree/mall/manager/enums/material/PartsCreditEnum.java

@@ -0,0 +1,28 @@
+package com.gree.mall.manager.enums.material;
+
+import com.baomidou.mybatisplus.annotation.EnumValue;
+import com.baomidou.mybatisplus.annotation.IEnum;
+import com.fasterxml.jackson.annotation.JsonValue;
+import com.gree.mall.manager.enums.base.BaseEnum;
+import lombok.AccessLevel;
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+@Getter
+@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
+public enum PartsCreditEnum implements BaseEnum,IEnum<Boolean> {
+    NOT("true","未收款"),
+    END("false","已收款"),
+    ;
+
+    @EnumValue
+    @JsonValue
+    private final String key;
+    private final String remark;
+
+
+    @Override
+    public Boolean getValue() {
+        return Boolean.parseBoolean(key);
+    }
+}

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/enums/material/PartsPayFlagEnum.java

@@ -12,7 +12,7 @@ import lombok.RequiredArgsConstructor;
 public enum PartsPayFlagEnum implements BaseEnum {
     NOT("NOT","未支付"),
     PAY_NOT_TAKE("PAY_NOT_TAKE","已付未提货"),
-    PAY_TAKE("PAY_TAKE","已提货"),
+    PAY_TAKE("PAY_TAKE","已提货"),
     PAY_NOT_STOCK("PAY_NOT_STOCK","已付缺货");
 
     @EnumValue

+ 2 - 1
mall-server-api/src/main/java/com/gree/mall/manager/enums/material/PayTypeEnum.java

@@ -15,7 +15,8 @@ public enum PayTypeEnum implements BaseEnum {
     ALLINPAY("ALLINPAY","通联支付"),
     ENGIN("ENGIN","工程支付"),
     TRANSFER("TRANSFER","转账支付"),
-    LINE("LINE","线下支付")
+    LINE("LINE","线下支付"),
+    CREDIT("CREDIT","记账")
     ;
 
     @EnumValue

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

@@ -0,0 +1,30 @@
+package com.gree.mall.manager.logic.material.manage;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.gree.mall.manager.bean.admin.AdminUserCom;
+import com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO;
+import com.gree.mall.manager.commonmapper.MaterialMapper;
+import com.gree.mall.manager.logic.common.CommonLogic;
+import com.gree.mall.manager.zfire.bean.ZfireParamBean;
+import com.gree.mall.manager.zfire.util.FieldUtils;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class WebsitPartsCreditLogic {
+
+    private final CommonLogic commonLogic;
+    private final MaterialMapper materialMapper;
+
+
+    public IPage<WebsitPartsCreditVO> page(ZfireParamBean zfireParamBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        FieldUtils.materialParam(zfireParamBean, WebsitPartsCreditVO.class, adminUser);
+        IPage<WebsitPartsCreditVO> page = materialMapper.websitPartsCreditPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
+        return page;
+    }
+}

+ 32 - 0
mall-server-api/src/main/resources/mapper/MaterialMapper.xml

@@ -1461,4 +1461,36 @@
             a.worker_id,
             a.websit_id
     </select>
+
+    <select id="websitPartsCreditPage"
+            resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsCreditVO">
+        SELECT a.* FROM (
+            SELECT
+                a.websit_id,
+                a.websit_name,
+                a.worker_id,
+                a.worker_name,
+                a.identity,
+                a.mobile,
+                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,
+                MAX(a.update_time) AS update_time
+            FROM
+                websit_parts_worker_credit_record a
+            WHERE
+                a.company_wechat_id = '1831608878894858241'
+            GROUP BY
+            a.websit_id, a.worker_id
+        ) a
+        ${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>
+        ORDER BY
+        a.update_time DESC
+    </select>
 </mapper>