Browse Source

配件退款记录

FengChaoYu 8 months ago
parent
commit
c67143886d

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

@@ -0,0 +1,83 @@
+package com.gree.mall.manager.bean.material.manage;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.IsEnum;
+import com.gree.mall.manager.enums.material.PartsRefTypeEnum;
+import com.gree.mall.manager.enums.material.PartsRefundStateEnum;
+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 WebsitPartsRefundRecordVO {
+
+    @ApiModelProperty(value = "退款单号")
+    private String refundNo;
+
+    @ApiModelProperty(value = "记录号")
+    private String recordId;
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "商户编号")
+    private String companyWechatId;
+
+    @ApiModelProperty(value = "商户名称")
+    private String companyWechatName;
+
+    @ApiModelProperty(value = "网点编码")
+    private String websitId;
+
+    @ApiModelProperty(value = "网点名称")
+    private String websitName;
+
+    @ApiModelProperty(value = "配件网点编号")
+    private String partsWebsitId;
+
+    @ApiModelProperty(value = "师傅身份证")
+    private String identity;
+
+    @ApiModelProperty(value = "师傅编号")
+    private String workerId;
+
+    @ApiModelProperty(value = "师傅名称")
+    private String workerName;
+
+    @ApiModelProperty(value = "销售单号")
+    private String salesId;
+
+    @ZfireField(hide = true)
+    @ApiModelProperty(value = "销售单明细")
+    private String salesItemId;
+
+    @ApiModelProperty(value = "发生单号")
+    private String ref;
+
+    @ApiModelProperty(value = "单据类型")
+    private PartsRefTypeEnum refType;
+
+    @ApiModelProperty(value = "配件编码")
+    private String partsNumber;
+
+    @ApiModelProperty(value = "配件名称")
+    private String partsName;
+
+    @ApiModelProperty(value = "退款金额")
+    private BigDecimal refundAmount;
+
+    @ApiModelProperty(value = "退款状态")
+    private PartsRefundStateEnum refundState;
+
+    @ApiModelProperty(value = "是否已执行")
+    private IsEnum isExec;
+
+    @ApiModelProperty(value = "信息")
+    private String info;
+
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+}

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

@@ -344,4 +344,12 @@ public interface MaterialMapper {
     IPage<WebsitPartsChangeSalesVO> websitPurchaseChangeSalesPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
 
     void updateItemPushFlag(@Param("id") String id, @Param("pushFlag") String pushFlag);
+
+    /**
+     * 退款记录列表
+     * @param page
+     * @param zfireParamBean
+     * @return
+     */
+    IPage<WebsitPartsRefundRecordVO> websitPartsRefundRecordPage(Page page, @Param("ex") ZfireParamBean zfireParamBean);
 }

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

@@ -0,0 +1,57 @@
+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.WebsitPartsRefundRecordVO;
+import com.gree.mall.manager.exception.RemoteServiceException;
+import com.gree.mall.manager.helper.ResponseHelper;
+import com.gree.mall.manager.logic.material.manage.WebsitPartsRefundRecordLogic;
+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/refund-record", produces = "application/json; charset=utf-8")
+public class WebsitRefundRecordController {
+
+    @Resource
+    WebsitPartsRefundRecordLogic websitPartsRefundRecordLogic;
+
+    @ZfireList
+    @PostMapping("/list")
+    @ApiOperation("配件退款记录列表")
+    public ResponseHelper<IPage<WebsitPartsRefundRecordVO>> list(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) throws RemoteServiceException {
+        IPage<WebsitPartsRefundRecordVO> page = websitPartsRefundRecordLogic.pageList(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<WebsitPartsRefundRecordVO>() {
+        });
+    }
+
+    @PostMapping("/list/export")
+    @ApiOperation("配件退款记录导出")
+    public void listExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //2.查询要导出的内容
+        IPage<WebsitPartsRefundRecordVO> page = websitPartsRefundRecordLogic.pageList(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(page.getRecords(), zfireParamBean.getExportFields(), request, response);
+    }
+
+}

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

@@ -0,0 +1,29 @@
+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.WebsitPartsRefundRecordVO;
+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 WebsitPartsRefundRecordLogic {
+
+    private final CommonLogic commonLogic;
+    private final MaterialMapper materialMapper;
+
+    public IPage<WebsitPartsRefundRecordVO> pageList(ZfireParamBean zfireParamBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        FieldUtils.materialParam(zfireParamBean, WebsitPartsRefundRecordVO.class, adminUser);
+        IPage<WebsitPartsRefundRecordVO> page = materialMapper.websitPartsRefundRecordPage(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
+        return page;
+    }
+}

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

@@ -735,4 +735,23 @@
         </if>
         ${ex.orderBy}
     </select>
+
+    <select id="websitPartsRefundRecordPage"
+            resultType="com.gree.mall.manager.bean.material.manage.WebsitPartsRefundRecordVO">
+        SELECT
+            ${ex.selected}
+        FROM
+            websit_parts_refund_record 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>
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
 </mapper>