Browse Source

Merge remote-tracking branch 'origin/develop' into develop

‘linchangsheng’ 9 months ago
parent
commit
32d29b9f0e

+ 2 - 2
mall-server-api/src/main/java/com/gree/mall/manager/bean/settle/repair/DailyIncrDecrCostCountVO.java

@@ -1,7 +1,7 @@
 package com.gree.mall.manager.bean.settle.repair;
 
 import com.gree.mall.manager.annotation.ZfireField;
-import com.gree.mall.manager.enums.repair.settle.SummaryStatusEnum;
+import com.gree.mall.manager.enums.repair.settle.DoStatusEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -33,7 +33,7 @@ public class DailyIncrDecrCostCountVO {
     private BigDecimal totalAmount;
 
     @ApiModelProperty(value = "状态")
-    private SummaryStatusEnum summaryStatus;
+    private DoStatusEnum doStatus;
 
     @ApiModelProperty(value = "导入操作人")
     private Date importBy;

+ 1 - 1
mall-server-api/src/main/java/com/gree/mall/manager/bean/settle/repair/DailyIncrDecrCostVO.java

@@ -21,7 +21,7 @@ public class DailyIncrDecrCostVO {
     @ApiModelProperty(value = "商户id")
     private String companyWechatId;
 
-    @ApiModelProperty(value = "商户名称")
+    @ApiModelProperty(value = "所属商户")
     private String companyWechatName;
 
     @ZfireField(hide = true)

+ 53 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/settle/repair/DailyReduceCostGatherVO.java

@@ -0,0 +1,53 @@
+package com.gree.mall.manager.bean.settle.repair;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.repair.settle.DoStatusEnum;
+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 DailyReduceCostGatherVO {
+
+    @ApiModelProperty(value = "所属商户")
+    private String companyWechatName;
+
+    @ApiModelProperty(value = "导入批次号")
+    private String importBatchNo;
+
+    @ZfireField(ignoreSelect = true)
+    @ApiModelProperty("人数")
+    private Integer personNums;
+
+    @ZfireField(ignoreSelect = true)
+    @ApiModelProperty("数量")
+    private Integer orderNums;
+
+    @ZfireField(ignoreSelect = true)
+    @ApiModelProperty("金额(元)")
+    private BigDecimal totalAmount;
+
+    @ApiModelProperty(value = "状态")
+    private DoStatusEnum doStatus;
+
+    @ApiModelProperty(value = "导入时间")
+    private Date importTime;
+
+    @ApiModelProperty(value = "导入操作人")
+    private String importBy;
+
+    @ApiModelProperty(value = "执行操作人")
+    private String doBy;
+
+    @ApiModelProperty(value = "执行时间")
+    private Date doTime;
+
+    @ApiModelProperty(value = "执行批次号")
+    private String doBatchNo;
+
+}

+ 176 - 0
mall-server-api/src/main/java/com/gree/mall/manager/bean/settle/repair/DailyReduceCostVO.java

@@ -0,0 +1,176 @@
+package com.gree.mall.manager.bean.settle.repair;
+
+import com.gree.mall.manager.annotation.ZfireField;
+import com.gree.mall.manager.enums.repair.settle.SummaryStatusEnum;
+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 DailyReduceCostVO {
+
+    @ZfireField(hide = true)
+    private String id;
+
+    @ApiModelProperty(value = "派工序号")
+    private String dispatchOrderNo;
+
+    @ApiModelProperty(value = "自编编号")
+    private String selfNo;
+
+    @ApiModelProperty(value = "工单状态")
+    private SummaryStatusEnum summaryStatus;
+
+    @ApiModelProperty(value = "导入批次号")
+    private String importBatchNo;
+
+    @ApiModelProperty(value = "新结算单位号")
+    private String summaryNumber;
+
+    @ApiModelProperty(value = "旧结算单位号")
+    private String oldSummaryNumber;
+
+    @ApiModelProperty(value = "结算单位名称")
+    private String summaryName;
+
+    @ApiModelProperty(value = "维修类型")
+    private String repairType;
+
+    @ApiModelProperty(value = "内外机")
+    private String inOutMachine;
+
+    @ApiModelProperty(value = "机器条码")
+    private String machineCode;
+
+    @ApiModelProperty(value = "外机型")
+    private String outMachineType;
+
+    @ApiModelProperty(value = "外机型描述")
+    private String outMachineDescribe;
+
+    @ApiModelProperty(value = "内机条码")
+    private String inMachineCode;
+
+    @ApiModelProperty(value = "内机类型")
+    private String inMachineType;
+
+    @ApiModelProperty(value = "内机型描述")
+    private String inMachineDescribe;
+
+    @ApiModelProperty(value = "用户姓名")
+    private String userName;
+
+    @ApiModelProperty(value = "区号")
+    private String areaCode;
+
+    @ApiModelProperty(value = "移动电话")
+    private String mobile;
+
+    @ApiModelProperty(value = "电话号码")
+    private String tel;
+
+    @ApiModelProperty(value = "省份")
+    private String province;
+
+    @ApiModelProperty(value = "市县")
+    private String city;
+
+    @ApiModelProperty(value = "区县")
+    private String county;
+
+    @ApiModelProperty(value = "用户地址")
+    private String userAddr;
+
+    @ApiModelProperty(value = "GPS定位")
+    private String gpsAddr;
+
+    @ApiModelProperty(value = "邮政编码")
+    private String postalCode;
+
+    @ApiModelProperty(value = "销售单位号")
+    private String saleDeptNo;
+
+    @ApiModelProperty(value = "销售单位")
+    private String saleDeptName;
+
+    @ApiModelProperty(value = "发票编号")
+    private String invoiceCode;
+
+    @ApiModelProperty(value = "购买日期")
+    private Date buyDate;
+
+    @ApiModelProperty(value = "安装日期")
+    private Date installDate;
+
+    @ApiModelProperty(value = "报修日期")
+    private Date reportDate;
+
+    @ApiModelProperty(value = "修复日期")
+    private Date repairDate;
+
+    @ApiModelProperty(value = "维修工id")
+    private String repairWorkerId;
+
+    @ApiModelProperty(value = "维修工名字")
+    private String repairWorkerName;
+
+    @ApiModelProperty(value = "维修工电话")
+    private String repairWorkerMobile;
+
+    @ApiModelProperty(value = "维修费用")
+    private BigDecimal repairFee;
+
+    @ApiModelProperty(value = "交通费")
+    private BigDecimal trafficFee;
+
+    @ApiModelProperty(value = "住宿费用")
+    private BigDecimal accommodationFee;
+
+    @ApiModelProperty(value = "吊装费用")
+    private BigDecimal liftingFee;
+
+    @ApiModelProperty(value = "其他费用")
+    private BigDecimal otherFee;
+
+    @ApiModelProperty(value = "总费用")
+    private BigDecimal totalFee;
+
+    @ApiModelProperty(value = "结算单批号")
+    private String settlementBatchNo;
+
+    @ApiModelProperty(value = "安装网点号")
+    private String installWebsitNo;
+
+    @ApiModelProperty(value = "安装网点名称")
+    private String installWebsitName;
+
+    @ApiModelProperty(value = "新维修单位号")
+    private String repairUnit;
+
+    @ApiModelProperty(value = "旧维修单位号")
+    private String oldRepairUnit;
+
+    @ApiModelProperty(value = "维修单位名")
+    private String repairName;
+
+    @ApiModelProperty(value = "故障现象")
+    private String faultPhenomenon;
+
+    @ApiModelProperty(value = "故障分析")
+    private String faultAnalysis;
+
+    @ApiModelProperty(value = "维修内容")
+    private String repairDetail;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "转结算时间")
+    private Date settlementTime;
+
+}

+ 16 - 0
mall-server-api/src/main/java/com/gree/mall/manager/commonmapper/CommonMapper.java

@@ -668,4 +668,20 @@ public interface CommonMapper {
      * @return
      */
     IPage<DailyIncrDecrCostVO> repairSettleDailyincrDecrCostList(Page page, @Param("ex") ZfireParamBean zfireParamBean);
+
+    /**
+     * 需扣回工单费用管理列表
+     * @param page
+     * @param zfireParamBean
+     * @return
+     */
+    IPage<DailyReduceCostGatherVO> reduceTotalList(Page page, @Param("ex") ZfireParamBean zfireParamBean);
+
+    /**
+     * 需扣回工单费用明细列表
+     * @param page
+     * @param zfireParamBean
+     * @return
+     */
+    IPage<DailyReduceCostVO> reduceList(Page page, @Param("ex") ZfireParamBean zfireParamBean);
 }

+ 71 - 4
mall-server-api/src/main/java/com/gree/mall/manager/controller/settle/repair/DailyImportSummaryController.java

@@ -3,10 +3,7 @@ package com.gree.mall.manager.controller.settle.repair;
 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.settle.repair.DailyImportSummaryItemVO;
-import com.gree.mall.manager.bean.settle.repair.DailyImportSummaryVO;
-import com.gree.mall.manager.bean.settle.repair.DailyIncrDecrCostCountVO;
-import com.gree.mall.manager.bean.settle.repair.DailyIncrDecrCostVO;
+import com.gree.mall.manager.bean.settle.repair.*;
 import com.gree.mall.manager.constant.Constant;
 import com.gree.mall.manager.exception.RemoteServiceException;
 import com.gree.mall.manager.helper.ResponseHelper;
@@ -244,5 +241,75 @@ public class DailyImportSummaryController {
         FieldUtils.exportData(page.getRecords(), zfireParamBean.getExportFields(), request, response);
     }
 
+    @ZfireList
+    @PostMapping("/reduce/total")
+    @ApiOperation(value = "需扣回工单费用-列表")
+    public ResponseHelper<IPage<DailyReduceCostGatherVO>> reduceTotalPage(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) {
+        IPage<DailyReduceCostGatherVO> page = dailyImportSummaryLogic.reduceTotalPage(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<DailyReduceCostGatherVO>() {
+        });
+    }
+
+    @ZfireList
+    @PostMapping("/reduce/list")
+    @ApiOperation(value = "需扣回费用明细-列表")
+    public ResponseHelper<IPage<DailyReduceCostVO>> reducePage(
+            @RequestBody ZfireParamBean zfireParamBean
+    ) {
+        IPage<DailyReduceCostVO> page = dailyImportSummaryLogic.reducePage(zfireParamBean);
+        return ResponseHelper.success(page, new TypeReference<DailyReduceCostVO>() {
+        });
+    }
+
+    @PostMapping("/reduce/list/export")
+    @ApiOperation("需扣回费用明细-导出")
+    public void reduceListExport(
+            @RequestBody ZfireParamBean zfireParamBean,
+            HttpServletRequest request,
+            HttpServletResponse response
+    ) throws Exception {
+        //2.查询要导出的内容
+        IPage<DailyReduceCostVO> page = dailyImportSummaryLogic.reducePage(zfireParamBean);
+        //3.导出
+        FieldUtils.exportData(page.getRecords(), zfireParamBean.getExportFields(), request, response);
+    }
+
+    @PostMapping("/reduce/delete")
+    @ApiOperation(value = "需扣回工单费用-删除")
+    public ResponseHelper reduceListDelete(
+            @ApiParam(required = true, value = "导入批次号") @RequestParam String importBatchNo
+    ){
+        dailyImportSummaryLogic.reduceListDelete(importBatchNo);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/reduce/do")
+    @ApiOperation(value = "需扣回工单费用-执行扣回")
+    public ResponseHelper reduceListDo(
+            @ApiParam(required = true, value = "导入批次号") @RequestParam String importBatchNo
+    ){
+        dailyImportSummaryLogic.reduceListDo(importBatchNo);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/reduce/item/delete")
+    @ApiOperation(value = "需扣回工单费用详情-删除")
+    public ResponseHelper reduceItemDelete(
+            @ApiParam(required = true, value = "ids") @RequestParam List<Integer> ids
+    ){
+        dailyImportSummaryLogic.reduceItemDelete(ids);
+        return ResponseHelper.success();
+    }
+
+    @PostMapping("/reduce/item/do")
+    @ApiOperation(value = "需扣回工单费用详情-执行扣回")
+    public ResponseHelper reduceItemDo(
+            @ApiParam(required = true, value = "ids") @RequestParam List<Integer> ids
+    ){
+        dailyImportSummaryLogic.reduceItemDo(ids);
+        return ResponseHelper.success();
+    }
 
 }

+ 28 - 0
mall-server-api/src/main/java/com/gree/mall/manager/enums/repair/settle/DoStatusEnum.java

@@ -0,0 +1,28 @@
+package com.gree.mall.manager.enums.repair.settle;
+
+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.AllArgsConstructor;
+import lombok.Getter;
+
+@Getter
+@AllArgsConstructor(access = AccessLevel.PRIVATE)
+public enum DoStatusEnum implements BaseEnum, IEnum<Integer> {
+    END("1","已执行"),
+    NOT("2","未执行"),
+    HOLD("3","已执行待扣回"),
+    ;
+
+    @EnumValue
+    @JsonValue
+    private final String key;
+    private final String remark;
+
+    @Override
+    public Integer getValue() {
+        return Integer.parseInt(key);
+    }
+}

+ 174 - 0
mall-server-api/src/main/java/com/gree/mall/manager/logic/settle/repair/DailyImportSummaryLogic.java

@@ -996,4 +996,178 @@ public class DailyImportSummaryLogic {
 
         return commonMapper.repairSettleDailyincrDecrCostList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
     }
+
+    public IPage<DailyReduceCostGatherVO> reduceTotalPage(ZfireParamBean zfireParamBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        FieldUtils.supplyParam(zfireParamBean, DailyReduceCostGatherVO.class, adminUser);
+
+        return commonMapper.reduceTotalList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
+    }
+
+    public IPage<DailyReduceCostVO> reducePage(ZfireParamBean zfireParamBean) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+        FieldUtils.supplyParam(zfireParamBean, DailyReduceCostVO.class, adminUser);
+
+        return commonMapper.reduceList(new Page(zfireParamBean.getPageNum(), zfireParamBean.getPageSize()), zfireParamBean);
+    }
+
+    @Transactional
+    public void reduceListDelete(String importBatchNo) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        if (adminUser.getType() == 2) {
+            throw new RemoteServiceException("平台账号禁止操作");
+        }
+
+        Integer count = settleDailyReduceCostService.lambdaQuery()
+                .eq(SettleDailyReduceCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
+                .eq(SettleDailyReduceCost::getImportBatchNo, importBatchNo)
+                .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
+                .count();
+
+        if (count > 0) {
+            throw new RemoteServiceException("存在已执行的数据,无法删除。");
+        }
+        settleDailyReduceCostService.lambdaUpdate()
+                .eq(SettleDailyReduceCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
+                .eq(SettleDailyReduceCost::getImportBatchNo, importBatchNo)
+                .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT)
+                .remove();
+    }
+
+    @Transactional
+    public void reduceItemDelete(List<Integer> ids) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        if (adminUser.getType() == 2) {
+            throw new RemoteServiceException("平台账号禁止操作");
+        }
+
+        Integer count = settleDailyReduceCostService.lambdaQuery()
+                .eq(SettleDailyReduceCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
+                .in(SettleDailyReduceCost::getId, ids)
+                .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
+                .count();
+        if (count > 0) {
+            throw new RemoteServiceException("存在已执行的数据,无法删除。");
+        }
+        settleDailyReduceCostService.lambdaUpdate()
+                .eq(SettleDailyReduceCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
+                .in(SettleDailyReduceCost::getId, ids)
+                .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT)
+                .remove();
+    }
+
+
+    @Transactional
+    public void reduceListDo(String importBatchNo) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        if (adminUser.getType() == 2) {
+            throw new RemoteServiceException("平台账号禁止操作");
+        }
+
+        String opName = adminUser.getNickName();
+
+        List<SettleDailyReduceCost> reduceList = settleDailyReduceCostService.lambdaQuery()
+                .eq(SettleDailyReduceCost::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
+                .eq(SettleDailyReduceCost::getImportBatchNo, importBatchNo)
+                .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT).list();
+
+        if (reduceList.size() == 0) {
+            throw new RemoteServiceException("暂无可扣回的数据");
+        }
+        summaryReduce(reduceList, opName, importBatchNo, null, adminUser);
+    }
+
+    @Transactional
+    public void summaryReduce(List<SettleDailyReduceCost> reduceList, String opName, String importBatchNo, List<Integer> ids, AdminUserCom adminUser) {
+        String doBatchNo = commonLogic.generateNo("ZX", "dailyDoBatch", 13);
+        List<SettleDailyIssueSummaryRecord> records = new ArrayList<>();
+//        List<String> serviceNumberList = new ArrayList<>();
+//        List<String> websiteNumberList = new ArrayList<>();
+        List<SettleDailyReduceCost> reduceUpdateList = new ArrayList<>();
+
+        for (SettleDailyReduceCost bean : reduceList) {
+            SettleDailyIssueSummaryRecord issueRecord = settleDailyIssueSummaryRecordService.getOne(
+                    Wrappers.<SettleDailyIssueSummaryRecord>lambdaQuery()
+                            .eq(SettleDailyIssueSummaryRecord::getCompanyWechatId, adminUser.getAdminCompanyWechat().getCompanyWechatId())
+                            .eq(SettleDailyIssueSummaryRecord::getStatus, DailyConstant.ISSUE_STATUS_NOT)
+                            .eq(SettleDailyIssueSummaryRecord::getServiceNumber, bean.getWorkerNumber())
+                            .eq(SettleDailyIssueSummaryRecord::getWebsitNumber, bean.getWebsitNumber())
+                            .orderByDesc(SettleDailyIssueSummaryRecord::getIssueCost)
+                            .last("limit 1"));
+            if (issueRecord != null) {
+                BigDecimal reduceCost = new BigDecimal(0);
+                if (issueRecord.getShouldReduceCost() != null) {
+                    reduceCost = reduceCost.add(issueRecord.getShouldReduceCost());
+                }
+                reduceCost = reduceCost.add(bean.getTotalFee());
+                BigDecimal subAmount = issueRecord.getIssueCost().subtract(reduceCost);
+                issueRecord.setShouldReduceCost(reduceCost);
+                issueRecord.setReduceCost(new BigDecimal(0));
+                issueRecord.setUpdateBy(opName);
+                issueRecord.setUpdateTime(new Date());
+                bean.setDoBatchNo(doBatchNo);
+                bean.setReduceDate(new Date());
+                bean.setDoTime(new Date());
+                bean.setDoBy(opName);
+                bean.setIssueSalaryId(issueRecord.getId());
+                bean.setDoStatus(DailyConstant.DO_STATUS_HAS);
+                bean.setCompanyWechatId(adminUser.getAdminCompanyWechat().getCompanyWechatId());
+                bean.setCompanyWechatName(adminUser.getAdminCompanyWechat().getCompanyName());
+                reduceUpdateList.add(bean);
+
+                if (subAmount.doubleValue() < 0) {
+                    //不够扣的处理
+                    saveRemaineBuckle(subAmount, DictCodeEnum.REDUCE_DAILY.toString(), bean.getWorkerNumber(),
+                            bean.getSummaryNumber(), bean.getWebsitName(), bean.getWebsitNumber(), opName);
+                    //设置为0
+                    issueRecord.setReduceCost(issueRecord.getIssueCost());
+                    issueRecord.setIssueCost(BigDecimal.valueOf(0));
+                } else {
+                    //够扣的处理
+                    issueRecord.setReduceCost(reduceCost);
+                    issueRecord.setIssueCost(subAmount);
+                }
+                records.add(issueRecord);
+//                serviceNumberList.add(bean.getWorkerNumber());
+//                websiteNumberList.add(bean.getWebsitNumber());
+            }
+        }
+        if (records.size() == 0) {
+            throw new RemoteServiceException("暂无可扣回的数据");
+        }
+        settleDailyIssueSummaryRecordService.updateBatchById(records);
+        settleDailyReduceCostService.updateBatchById(reduceUpdateList);
+//        dailyReduceCostService.lambdaUpdate()
+//                .set(DailyReduceCost::getDoBatchNo, doBatchNo)
+//                .set(DailyReduceCost::getReduceDate, new Date())
+//                .set(DailyReduceCost::getDoTime, new Date())
+//                .set(DailyReduceCost::getDoBy, opName)
+//                .set(DailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_HAS)
+//                .eq(StringUtils.isNotEmpty(importBatchNo), DailyReduceCost::getImportBatchNo, importBatchNo)
+//                .in(ids != null, DailyReduceCost::getId, ids)
+//                .in(DailyReduceCost::getWebsitNumber, websiteNumberList)
+//                .in(DailyReduceCost::getWorkerNumber, serviceNumberList)
+//                .eq(DailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT).update();
+    }
+
+    @Transactional
+    public void reduceItemDo(List<Integer> ids) {
+        AdminUserCom adminUser = commonLogic.getAdminUser();
+
+        if (adminUser.getType() == 2) {
+            throw new RemoteServiceException("平台账号禁止操作");
+        }
+        String opName = adminUser.getNickName();
+        List<SettleDailyReduceCost> reduceList = settleDailyReduceCostService.lambdaQuery()
+                .in(SettleDailyReduceCost::getId, ids)
+                .eq(SettleDailyReduceCost::getDoStatus, DailyConstant.DO_STATUS_NOT).list();
+
+        if (reduceList.size() == 0) {
+            throw new RemoteServiceException("暂无可扣回的数据");
+        }
+        summaryReduce(reduceList, opName, null, ids, adminUser);
+    }
 }

+ 39 - 0
mall-server-api/src/main/resources/mapper/CommonMapper.xml

@@ -1107,6 +1107,8 @@
     <select id="reduceCountList"
             resultType="com.gree.mall.manager.bean.settle.repair.DailyIncrDecrCostCountVO">
         SELECT
+            company_wechat_id,
+            company_wechat_name,
             import_batch_no,
             count(service_number) personNums,
             count(id) orderNums,
@@ -1120,6 +1122,7 @@
         FROM
             settle_daily_incr_decr_cost a
         ${ex.query}
+        GROUP BY a.company_wechat_id, a.import_batch_no
         <if test="ex.orderBy == null or ex.orderBy ==''">
             ORDER BY a.create_time DESC
         </if>
@@ -1139,5 +1142,41 @@
         ${ex.orderBy}
     </select>
 
+    <select id="reduceTotalList" resultType="com.gree.mall.manager.bean.settle.repair.DailyReduceCostGatherVO">
+        SELECT
+            company_wechat_id,
+            company_wechat_name,
+            count(DISTINCT repair_worker_mobile) as 'personNums',
+            count(1) as 'orderNums',
+            sum(total_fee) as 'totalAmount',
+            import_by ,
+            import_time ,
+            import_batch_no,
+            do_status,
+            do_by ,
+            do_time ,
+            do_batch_no
+        FROM
+            settle_daily_reduce_cost a
+        ${ex.query}
+        GROUP BY a.company_wechat_id, a.import_batch_no
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+
+    <select id="reduceList" resultType="com.gree.mall.manager.bean.settle.repair.DailyReduceCostVO">
+        SELECT
+            ${ex.selected}
+        FROM
+            settle_daily_reduce_cost a
+        ${ex.query}
+        <if test="ex.orderBy == null or ex.orderBy ==''">
+            ORDER BY a.create_time DESC
+        </if>
+        ${ex.orderBy}
+    </select>
+
 
 </mapper>