# Conflicts:
#	dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java
This commit is contained in:
PQZ 2024-09-25 19:56:09 +08:00
commit 5c73d31551
9 changed files with 126 additions and 1 deletions

View File

@ -84,5 +84,16 @@ public class RepairOrderInfoController {
return success(repairOrderInfoService.queryListPage(pageReqVO,page)); return success(repairOrderInfoService.queryListPage(pageReqVO,page));
} }
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
@GetMapping("/census")
@Operation(summary = "统计未入账和已入账")
@PreAuthorize("@ss.hasPermission('repair:order-info:query')")
public CommonResult<?> census() {
return success(repairOrderInfoService.census());
}
} }

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.order.mapper; package cn.iocoder.yudao.module.order.mapper;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import cn.iocoder.yudao.module.order.vo.RepairOrderCensusVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -37,4 +38,13 @@ public interface RepairOrderInfoMapper extends BaseMapper<RepairOrderInfo> {
* @param respVO 查询对象 * @param respVO 查询对象
**/ **/
IPage<RepairOrderInfoRespVO> getOrderPageByStatus(@Param("map") RepairOrderInfoRespVO respVO, Page<RepairOrderInfo> page); IPage<RepairOrderInfoRespVO> getOrderPageByStatus(@Param("map") RepairOrderInfoRespVO respVO, Page<RepairOrderInfo> page);
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
RepairOrderCensusVO census();
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.order.service;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import cn.iocoder.yudao.module.order.vo.RepairOrderCensusVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO;
@ -114,4 +115,13 @@ public interface RepairOrderInfoService extends IService<RepairOrderInfo> {
* @date 15:50 2024/9/24 * @date 15:50 2024/9/24
**/ **/
IPage<RepairOrderInfo> getAppraisePage(Page<RepairOrderInfo> page); IPage<RepairOrderInfo> getAppraisePage(Page<RepairOrderInfo> page);
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
RepairOrderCensusVO census();
} }

View File

@ -11,6 +11,7 @@ import cn.iocoder.yudao.module.custom.service.CustomerCouponService;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import cn.iocoder.yudao.module.order.mapper.RepairOrderInfoMapper; import cn.iocoder.yudao.module.order.mapper.RepairOrderInfoMapper;
import cn.iocoder.yudao.module.order.service.RepairOrderInfoService; import cn.iocoder.yudao.module.order.service.RepairOrderInfoService;
import cn.iocoder.yudao.module.order.vo.*;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoPageReqVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoRespVO;
import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO; import cn.iocoder.yudao.module.order.vo.RepairOrderInfoSaveReqVO;
@ -201,6 +202,7 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl<RepairOrderInfoMappe
* @param orderId 订单主键 * @param orderId 订单主键
* @return * @return
*/ */
@Override
public Map<String,Object> payTransactions(String orderId){ public Map<String,Object> payTransactions(String orderId){
RepairOrderInfo orderInfo = this.getById(orderId); RepairOrderInfo orderInfo = this.getById(orderId);
// 统一参数封装 // 统一参数封装
@ -236,4 +238,15 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl<RepairOrderInfoMappe
.isNotNull(RepairOrderInfo::getCommentDesc); .isNotNull(RepairOrderInfo::getCommentDesc);
})); }));
} }
/**
* 统计未入账和已入账(最简版)
*
* @author 小李
* @date 18:52 2024/9/25
**/
@Override
public RepairOrderCensusVO census(){
return baseMapper.census();
}
} }

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.order.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* 统计用
*
* @author 小李
* @date 18:54 2024/9/25
**/
@Data
public class RepairOrderCensusVO {
/** 已入账 */
private BigDecimal credited;
/** 未入账 */
private BigDecimal notCredited;
/** 线上支付 */
private BigDecimal onlinePay;
/** 现金支付 */
private BigDecimal cashPay;
/** 签单、挂账 */
private BigDecimal signedPay;
}

View File

@ -57,4 +57,15 @@
</if> </if>
order by roi.create_time desc order by roi.create_time desc
</select> </select>
<select id="census" resultType="cn.iocoder.yudao.module.order.vo.RepairOrderCensusVO">
SELECT
-- 统计已入账和未入账的数量
SUM(CASE WHEN order_status = '1' THEN pay_money ELSE 0 END) AS credited,
SUM(CASE WHEN order_status = '0' THEN goods_price ELSE 0 END) AS notCredited,
-- 统计已入账的细分情况
SUM(CASE WHEN order_status = '1' AND pay_type = '01' THEN pay_money ELSE 0 END) AS onlinePay,
SUM(CASE WHEN order_status = '1' AND pay_type = '02' THEN pay_money ELSE 0 END) AS cashPay,
SUM(CASE WHEN order_status = '1' AND pay_type = '03' THEN pay_money ELSE 0 END) AS signedPay
FROM repair_order_info;
</select>
</mapper> </mapper>

View File

@ -5,12 +5,16 @@ import cn.iocoder.yudao.module.other.entity.DlRepairOther;
import cn.iocoder.yudao.module.other.service.DlRepairOtherService; import cn.iocoder.yudao.module.other.service.DlRepairOtherService;
import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO; import cn.iocoder.yudao.module.other.vo.DlRepairOtherReqVO;
import cn.iocoder.yudao.module.other.vo.DlRepairOtherRespVO; import cn.iocoder.yudao.module.other.vo.DlRepairOtherRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/** /**
@ -73,5 +77,12 @@ public class DlRepairOtherController {
dlRepairOtherService.deleteOther(id); dlRepairOtherService.deleteOther(id);
return CommonResult.ok(); return CommonResult.ok();
} }
@GetMapping("/getByName")
@Operation(summary = "根据名称获取最新的数据")
public CommonResult<?> getOtherByName(@RequestParam("name") String name){
List<DlRepairOther> list = dlRepairOtherService.list(new LambdaQueryWrapper<DlRepairOther>().eq(DlRepairOther::getName, name));
return success(list.stream().max(Comparator.comparing(DlRepairOther::getCreateTime)).orElse(null));
}
} }

View File

@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.project.service.RepairProjectService;
import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO;
import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO; import cn.iocoder.yudao.module.project.vo.RepairProjectRespVO;
import cn.iocoder.yudao.module.project.vo.RepairProjectSaveReqVO; import cn.iocoder.yudao.module.project.vo.RepairProjectSaveReqVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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 io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -19,6 +20,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Comparator;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 维修项目") @Tag(name = "管理后台 - 维修项目")
@ -117,4 +121,16 @@ public class RepairProjectController {
return success(repairProjectService.queryListPage(pageReqVO,page)); return success(repairProjectService.queryListPage(pageReqVO,page));
} }
/**
* 根据名称获取最新的数据
*
* @author 小李
* @date 18:01 2024/9/25
**/
@GetMapping("/getByName")
@Operation(summary = "根据名称获取最新的数据")
public CommonResult<?> getRepairProjectByName(@RequestParam("name") String name) {
List<RepairProject> list = repairProjectService.list(new LambdaQueryWrapper<RepairProject>().eq(RepairProject::getName, name));
return success(list.stream().max(Comparator.comparing(RepairProject::getCreateTime)).orElse(null));
}
} }

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.project.service.RepairWaresService;
import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO; import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO;
import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO; import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO;
import cn.iocoder.yudao.module.project.vo.RepairWaresSaveReqVO; import cn.iocoder.yudao.module.project.vo.RepairWaresSaveReqVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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 io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -18,6 +19,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.Comparator;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 配件库") @Tag(name = "管理后台 - 配件库")
@ -113,5 +117,18 @@ public class RepairWaresController {
return success(waresService.getWaresPage(pageReqVO, page)); return success(waresService.getWaresPage(pageReqVO, page));
} }
/**
* 根据名称获取最新的数据
*
* @author 小李
* @date 18:03 2024/9/25
**/
@GetMapping("/getByName")
@Operation(summary = "根据名称获取最新的数据")
public CommonResult<?> getWaresByName(@RequestParam("name") String name) {
List<RepairWares> list = waresService.list(new LambdaQueryWrapper<RepairWares>().eq(RepairWares::getName, name));
return success(list.stream().max(Comparator.comparing(RepairWares::getCreateTime)).orElse(null));
}
} }