# Conflicts:
#	dl-module-repair/src/main/resources/mapper/tickets/DlTicketWaresMapper.xml
This commit is contained in:
PQZ 2024-10-22 18:33:49 +08:00
commit a4f792a0d0
11 changed files with 533 additions and 10 deletions

View File

@ -96,6 +96,14 @@ public class PartnerOwnController extends BaseController {
{ {
return success(partnerList.chartInfoAmount(partnerId, unit)); return success(partnerList.chartInfoAmount(partnerId, unit));
} }
/**
* 新检测线图
*/
@GetMapping("/newChartInfoAmount")
public CommonResult newChartInfoAmount(String unit)
{
return success(partnerList.newChartInfoAmount(unit));
}
/**staticsTable1 /**staticsTable1
* 检测数量折线图 * 检测数量折线图
*/ */
@ -104,6 +112,14 @@ public class PartnerOwnController extends BaseController {
{ {
return success(partnerList.chartLineInspectionNum(partnerId, unit)); return success(partnerList.chartLineInspectionNum(partnerId, unit));
} }
/**staticsTable1
* 新检测数量折线图
*/
@GetMapping("/newChartLineInspectionNum")
public CommonResult newChartLineInspectionNum(String unit)
{
return success(partnerList.newChartLineInspectionNum(unit));
}
/** /**
* 检测金额折线图 * 检测金额折线图
*/ */
@ -113,6 +129,15 @@ public class PartnerOwnController extends BaseController {
return success(partnerList.chartLineInspectionAmount(partnerId, unit)); return success(partnerList.chartLineInspectionAmount(partnerId, unit));
} }
/**
* 新检测金额折线图
*/
@GetMapping("/newChartLineInspectionAmount")
public CommonResult newChartLineInspectionAmount(String unit)
{
return success(partnerList.newChartLineInspectionAmount(unit));
}
/** /**
* 检测线图 * 检测线图
*/ */
@ -121,6 +146,14 @@ public class PartnerOwnController extends BaseController {
{ {
return success(partnerList.chartInfoNum(partnerId, unit)); return success(partnerList.chartInfoNum(partnerId, unit));
} }
/**
* 新检测线图
*/
@GetMapping("/newChartInfoNum")
public CommonResult newChartInfoNum(String unit)
{
return success(partnerList.newChartInfoNum( unit));
}
/** /**
* 检测线图 * 检测线图
@ -130,6 +163,14 @@ public class PartnerOwnController extends BaseController {
{ {
return success(partnerList.chartInfoRatio(partnerId, unit)); return success(partnerList.chartInfoRatio(partnerId, unit));
} }
/**
* 新检测线图
*/
@GetMapping("/newChartInfoRatio")
public CommonResult newChartInfoRatio(String unit)
{
return success(partnerList.newChartInfoRatio(unit));
}
/** /**
* 首页 订单信息 * 首页 订单信息
*/ */
@ -637,6 +678,11 @@ public class PartnerOwnController extends BaseController {
ShopMallPartners partners = partnerList.shopInfo(); ShopMallPartners partners = partnerList.shopInfo();
return success(partnerList.staticsTable1(partners.getPartnerId(),startTime,endTime)); return success(partnerList.staticsTable1(partners.getPartnerId(),startTime,endTime));
} }
//统计表格1
@GetMapping("/newStaticsTable1")
public CommonResult newStaticsTable1(String startTime,String endTime) throws Exception {
return success(partnerList.newStaticsTable1(startTime,endTime));
}
//统计表格2 //统计表格2
@GetMapping("/staticsTable2") @GetMapping("/staticsTable2")
@ -644,12 +690,22 @@ public class PartnerOwnController extends BaseController {
ShopMallPartners partners = partnerList.shopInfo(); ShopMallPartners partners = partnerList.shopInfo();
return success(partnerList.staticsTable2(partners.getPartnerId(),startTime,endTime)); return success(partnerList.staticsTable2(partners.getPartnerId(),startTime,endTime));
} }
//新统计表格2
@GetMapping("/newStaticsTable2")
public CommonResult newStaticsTable2(String startTime,String endTime) throws Exception {
return success(partnerList.newStaticsTable2(startTime,endTime));
}
//统计表格3 //统计表格3
@GetMapping("/staticsTable3") @GetMapping("/staticsTable3")
public CommonResult staticsTable3(String startTime,String endTime) throws Exception { public CommonResult staticsTable3(String startTime,String endTime) throws Exception {
ShopMallPartners partners = partnerList.shopInfo(); ShopMallPartners partners = partnerList.shopInfo();
return success(partnerList.staticsTable3(partners.getPartnerId(),startTime,endTime)); return success(partnerList.staticsTable3(partners.getPartnerId(),startTime,endTime));
} }
//新统计表格3
@GetMapping("/newStaticsTable3")
public CommonResult newStaticsTable3(String startTime,String endTime) throws Exception {
return success(partnerList.newStaticsTable3(startTime,endTime));
}
//统计表格3 //统计表格3
@GetMapping("/staticsTable3Detail") @GetMapping("/staticsTable3Detail")
public CommonResult staticsTable3Detail(String startTime,String endTime,String remark) throws Exception { public CommonResult staticsTable3Detail(String startTime,String endTime,String remark) throws Exception {

View File

@ -43,13 +43,20 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
IPage<InspectionPickCar> getPickCarListOfWorker(Page<InspectionPickCar> page,@Param("workerId") Long workerId, @Param("phoneNum") String phoneNum); IPage<InspectionPickCar> getPickCarListOfWorker(Page<InspectionPickCar> page,@Param("workerId") Long workerId, @Param("phoneNum") String phoneNum);
List<OrderInfo> chartInfoAmount(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId); List<OrderInfo> chartInfoAmount(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId);
List<OrderInfo> newChartInfoAmount(@Param("startTime") String startTime,@Param("endTime")String endTime);
List<OrderInfo> chartInfoNum(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId); List<OrderInfo> chartInfoNum(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId);
List<OrderInfo> newChartInfoNum(@Param("startTime") String startTime,@Param("endTime")String endTime);
List<Map<String,String>> chartInfoRatio(@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("partnerId")Long partnerId); List<Map<String,String>> chartInfoRatio(@Param("startTime") String startTime, @Param("endTime")String endTime, @Param("partnerId")Long partnerId);
List<Map<String,String>> newChartInfoRatio(@Param("startTime") String startTime, @Param("endTime")String endTime);
List<ShopInspectionCategory> partnerCategoryList(@Param("partnerId") Long partnerId); List<ShopInspectionCategory> partnerCategoryList(@Param("partnerId") Long partnerId);
OrderInfo chartLineInspectionAmount(@Param("partnerId") Long partnerId,@Param("dateStr") String dateStr); OrderInfo chartLineInspectionAmount(@Param("partnerId") Long partnerId,@Param("dateStr") String dateStr);
OrderInfo newChartLineInspectionAmount(@Param("dateStr") String dateStr);
Map<String,Double> staticsTable1(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime); Map<String,Double> staticsTable1(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
Map<String,Double> newStaticsTable1(@Param("startTime") String startTime,@Param("endTime") String endTime);
Map<String,Integer> staticsTable2(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime); Map<String,Integer> staticsTable2(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
Map<String,Integer> newStaticsTable2(@Param("startTime") String startTime,@Param("endTime") String endTime);
List<Map<String,Object>> staticsTable3(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime); List<Map<String,Object>> staticsTable3(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
List<Map<String,Object>> newStaticsTable3(@Param("startTime") String startTime,@Param("endTime") String endTime);
List<Map<String,Object>> staticsTable3Detail(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("remark") String remark); List<Map<String,Object>> staticsTable3Detail(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("remark") String remark);
List<Map<String,Object>> staticsTable4(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime); List<Map<String,Object>> staticsTable4(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);
List<Map<String,Object>> staticsTable5(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime); List<Map<String,Object>> staticsTable5(@Param("partnerId") Long partnerId,@Param("startTime") String startTime,@Param("endTime") String endTime);

View File

@ -38,11 +38,15 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
void startOrEnd(Long partnerId); void startOrEnd(Long partnerId);
StatisticsInfo statisticsInfo(Long partnerId); StatisticsInfo statisticsInfo(Long partnerId);
JSONObject chartInfoAmount(Long partnerId,String unit); JSONObject chartInfoAmount(Long partnerId,String unit);
JSONObject newChartInfoAmount(String unit);
JSONObject chartLineInspectionNum(Long partnerId,String unit); JSONObject chartLineInspectionNum(Long partnerId,String unit);
JSONObject newChartLineInspectionNum(String unit);
JSONObject chartLineInspectionAmount(Long partnerId,String unit); JSONObject chartLineInspectionAmount(Long partnerId,String unit);
JSONObject chartInfoNum(Long partnerId,String unit); JSONObject chartInfoNum(Long partnerId,String unit);
JSONObject newChartInfoNum(String unit);
JSONObject chartInfoRatio(Long partnerId, String unit); JSONObject chartInfoRatio(Long partnerId, String unit);
JSONObject newChartInfoRatio(String unit);
List<OrderInfo> orderInfo(Long partnerId); List<OrderInfo> orderInfo(Long partnerId);
List<HotGoodsVo> hotGoodsList(Long partnerId); List<HotGoodsVo> hotGoodsList(Long partnerId);
void addGoods(ShopInspectionGoods goods) throws Exception; void addGoods(ShopInspectionGoods goods) throws Exception;
@ -90,14 +94,17 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
String workOrderView(Long inspectionId); String workOrderView(Long inspectionId);
List<PostDO> inspectionPostInfo(); List<PostDO> inspectionPostInfo();
Map<String,Double> staticsTable1(Long partnerId, String startTime, String endTime); Map<String,Double> staticsTable1(Long partnerId, String startTime, String endTime);
Map<String,Double> newStaticsTable1(String startTime, String endTime);
Map<String,Integer> staticsTable2(Long partnerId, String startTime, String endTime); Map<String,Integer> staticsTable2(Long partnerId, String startTime, String endTime);
Map<String,Integer> newStaticsTable2(String startTime, String endTime);
List<Map<String,Object>> staticsTable3(Long partnerId, String startTime, String endTime); List<Map<String,Object>> staticsTable3(Long partnerId, String startTime, String endTime);
List<Map<String,Object>> newStaticsTable3(String startTime, String endTime);
List<Map<String,Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime,String remark); List<Map<String,Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime,String remark);
List<Map<String,Object>> staticsTable4(Long partnerId, String startTime, String endTime); List<Map<String,Object>> staticsTable4(Long partnerId, String startTime, String endTime);
List<Map<String,Object>> staticsTable5(Long partnerId, String startTime, String endTime); List<Map<String,Object>> staticsTable5(Long partnerId, String startTime, String endTime);
//新检测金额折线图
JSONObject newChartLineInspectionAmount(String unit);
} }

View File

@ -336,6 +336,94 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.put("series",series); res.put("series",series);
return res; return res;
} }
@Override
public JSONObject newChartInfoAmount(String unit) {
JSONObject res =new JSONObject();
List<String> categories =new ArrayList<>();
List<JSONObject> series =new ArrayList<>();
JSONObject seriesObject=new JSONObject();
seriesObject.put("name","金额");
List<Double> seriesObjectData =new ArrayList<>();
//按照单位日期查询数据
//横坐标获取当前商品上架的商品
String startTime = null;
String endTime = null;
if (unit.equals("day")){
String format = DateUtil.format(new Date(), "yyyy-MM-dd");
startTime = format+" 00:00:00";
endTime = format+" 23:59:59";
} else if (unit.equals("week")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前周的开始日期
LocalDate startOfWeek = currentDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 将日期格式化为字符串
startTime = startOfWeek.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
} else if (unit.equals("month")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前月的第一天
LocalDate firstDayOfMonth = currentDate.with(TemporalAdjusters.firstDayOfMonth());
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
startTime = firstDayOfMonth.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
} else if (unit.equals("year")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前年的第一天
LocalDate firstDayOfYear = currentDate.withDayOfYear(1).withMonth(1);
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
startTime = firstDayOfYear.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
}else {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前周的开始日期
LocalDate startOfWeek = currentDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 将日期格式化为字符串
startTime = startOfWeek.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
}
//获取商家现有商品
LambdaQueryWrapper<ShopInspectionGoods> queryWrapper1 =new LambdaQueryWrapper<>();
// queryWrapper1.eq(ShopInspectionGoods::getPartnerId,partnerId);
List<ShopInspectionGoods> list1 = goodsService.list(queryWrapper1);
List<OrderInfo> list = baseMapper.newChartInfoAmount(startTime,endTime);
//统计各个车型的价格 从高到低
for (OrderInfo orderInfo : list) {
categories.add(orderInfo.getGoodsTitle().indexOf("(")>0?orderInfo.getGoodsTitle().substring(0,orderInfo.getGoodsTitle().indexOf("(")):orderInfo.getGoodsTitle());
list1.removeIf(it->{
return it.getTitle().equals(orderInfo.getGoodsTitle());
});
seriesObjectData.add(Double.valueOf(orderInfo.getRealPayMoney())/100);
}
categories.addAll(list1.stream().map(it->{
return it.getTitle().indexOf("(")>0?it.getTitle().substring(0,it.getTitle().indexOf("(")):it.getTitle();
}).collect(Collectors.toList()));
seriesObjectData.addAll(list1.stream().map(it->{
return 0d;
}).collect(Collectors.toList()));
seriesObject.put("data",seriesObjectData);
series.add(seriesObject);
res.put("categories",categories);
res.put("series",series);
return res;
}
@Override @Override
public JSONObject chartLineInspectionNum(Long partnerId, String unit) { public JSONObject chartLineInspectionNum(Long partnerId, String unit) {
@ -388,6 +476,52 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.put("series",series); res.put("series",series);
return res; return res;
} }
@Override
public JSONObject newChartLineInspectionNum(String unit) {
JSONObject res = new JSONObject();
List<String> categories =new ArrayList<>();
List<JSONObject> series =new ArrayList<>();
JSONObject seriesData1 =new JSONObject();
seriesData1.put("name","总数量");
List<Long> seriesData1List =new ArrayList<>();
JSONObject seriesData2 =new JSONObject();
List<Long> seriesData2List =new ArrayList<>();
seriesData2.put("name","合格数");
// JSONObject seriesData3 =new JSONObject();
// List<Long> seriesData3List =new ArrayList<>();
// seriesData3.put("name","环检次数");
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for (int i = 0; i < 7; i++) {
//先获取最近七天的日期
Date date = DateUtils.addDays(new Date(), -i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
}
for (String date : dateList) {
categories.add(date);
LambdaQueryWrapper<InspectionInfo> queryWrapper1 =new LambdaQueryWrapper<>();
queryWrapper1.like(InspectionInfo::getStartTime,date);
Long sum = inspectionInfoService.count(queryWrapper1);
LambdaQueryWrapper<InspectionInfo> queryWrapper2 =new LambdaQueryWrapper<>();
queryWrapper2.like(InspectionInfo::getStartTime,date).eq(InspectionInfo::getIsPass,"1");
Long passNum = inspectionInfoService.count(queryWrapper2);
// Long noPassNum = baseMapper.dhjNum(partnerId,date);
seriesData1List.add(sum);
seriesData2List.add(passNum);
// seriesData3List.add(noPassNum);
}
seriesData1.put("data",seriesData1List);
seriesData2.put("data",seriesData2List);
// seriesData3.put("data",seriesData3List);
series.add(seriesData1);
series.add(seriesData2);
//series.add(seriesData3);
res.put("categories",categories);
res.put("series",series);
return res;
}
@Override @Override
public JSONObject chartLineInspectionAmount(Long partnerId, String unit) { public JSONObject chartLineInspectionAmount(Long partnerId, String unit) {
@ -423,6 +557,36 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
return res; return res;
} }
@Override
public JSONObject newChartLineInspectionAmount(String unit) {
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
JSONObject res = new JSONObject();
List<String> categories =new ArrayList<>();
List<JSONObject> series =new ArrayList<>();
JSONObject seriesData1 =new JSONObject();
seriesData1.put("name","成交金额");
List<Long> seriesData1List =new ArrayList<>();
List<String> dateList = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
for (int i = 0; i < 7; i++) {
//先获取最近七天的日期
Date date = DateUtils.addDays(new Date(), -i);
String formatDate = sdf.format(date);
dateList.add(formatDate);
}
for (String date : dateList) {
categories.add(date);
OrderInfo one = baseMapper.newChartLineInspectionAmount(date);
Integer amount = Optional.ofNullable(one.getRealPayMoney()).orElse(0);
seriesData1List.add(amount/100L);
}
seriesData1.put("data",seriesData1List);
series.add(seriesData1);
res.put("categories",categories);
res.put("series",series);
return res;
}
@Override @Override
public JSONObject chartInfoNum(Long partnerId,String unit) { public JSONObject chartInfoNum(Long partnerId,String unit) {
@ -517,6 +681,93 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.put("series",series); res.put("series",series);
return res; return res;
} }
@Override
public JSONObject newChartInfoNum(String unit) {
JSONObject res =new JSONObject();
List<String> categories =new ArrayList<>();
List<JSONObject> series =new ArrayList<>();
JSONObject seriesObject=new JSONObject();
seriesObject.put("name","数量");
List<Integer> seriesObjectData =new ArrayList<>();
//按照单位日期查询数据
//横坐标获取当前商品上架的商品
String startTime ;
String endTime ;
if (unit.equals("day")){
String format = DateUtil.format(new Date(), "yyyy-MM-dd");
startTime = format+" 00:00:00";
endTime = format+" 23:59:59";
} else if (unit.equals("week")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前周的开始日期
LocalDate startOfWeek = currentDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 将日期格式化为字符串
startTime = startOfWeek.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
} else if (unit.equals("month")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前月的第一天
LocalDate firstDayOfMonth = currentDate.with(TemporalAdjusters.firstDayOfMonth());
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
startTime = firstDayOfMonth.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
} else if (unit.equals("year")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前年的第一天
LocalDate firstDayOfYear = currentDate.withDayOfYear(1).withMonth(1);
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
startTime = firstDayOfYear.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
}else {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前周的开始日期
LocalDate startOfWeek = currentDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 将日期格式化为字符串
startTime = startOfWeek.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
}
//获取商家现有商品
LambdaQueryWrapper<ShopInspectionGoods> queryWrapper1 =new LambdaQueryWrapper<>();
List<ShopInspectionGoods> list1 = goodsService.list(queryWrapper1);
List<OrderInfo> list = baseMapper.newChartInfoNum(startTime,endTime);
//统计各个车型的价格 从高到低
for (OrderInfo orderInfo : list) {
categories.add(orderInfo.getGoodsTitle().indexOf("(")>0?orderInfo.getGoodsTitle().substring(0,orderInfo.getGoodsTitle().indexOf("(")):orderInfo.getGoodsTitle());
list1.removeIf(it->{
return it.getTitle().equals(orderInfo.getGoodsTitle());
});
seriesObjectData.add(orderInfo.getRealPayNum());
}
categories.addAll(list1.stream().map(it->{
return it.getTitle().indexOf("(")>0?it.getTitle().substring(0,it.getTitle().indexOf("(")):it.getTitle();
}).collect(Collectors.toList()));
seriesObjectData.addAll(list1.stream().map(it->{
return 0;
}).collect(Collectors.toList()));
seriesObject.put("data",seriesObjectData);
series.add(seriesObject);
res.put("categories",categories);
res.put("series",series);
return res;
}
@Override @Override
public JSONObject chartInfoRatio(Long partnerId, String unit) { public JSONObject chartInfoRatio(Long partnerId, String unit) {
@ -616,6 +867,98 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
res.put("series",series); res.put("series",series);
return res; return res;
} }
@Override
public JSONObject newChartInfoRatio(String unit) {
JSONObject res =new JSONObject();
List<String> categories =new ArrayList<>();
List<JSONObject> series =new ArrayList<>();
JSONObject seriesObject=new JSONObject();
seriesObject.put("name","合格率");
List<Double> seriesObjectData =new ArrayList<>();
//按照单位日期查询数据
//横坐标获取当前商品上架的商品
String startTime ;
String endTime ;
if (unit.equals("day")){
String format = DateUtil.format(new Date(), "yyyy-MM-dd");
startTime = format+" 00:00:00";
endTime = format+" 23:59:59";
} else if (unit.equals("week")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前周的开始日期
LocalDate startOfWeek = currentDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 将日期格式化为字符串
startTime = startOfWeek.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
} else if (unit.equals("month")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前月的第一天
LocalDate firstDayOfMonth = currentDate.with(TemporalAdjusters.firstDayOfMonth());
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
startTime = firstDayOfMonth.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
} else if (unit.equals("year")){
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前年的第一天
LocalDate firstDayOfYear = currentDate.withDayOfYear(1).withMonth(1);
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
startTime = firstDayOfYear.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
}else {
// 获取当前日期
LocalDate currentDate = LocalDate.now();
// 获取当前周的开始日期
LocalDate startOfWeek = currentDate.with(TemporalAdjusters.previousOrSame(java.time.DayOfWeek.MONDAY));
// 创建日期时间格式化器
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
// 将日期格式化为字符串
startTime = startOfWeek.atStartOfDay().format(formatter);
endTime = DateUtil.format(new Date(),"yyyy-MM-dd HH:mm:ss");
}
//获取商家现有商品
LambdaQueryWrapper<ShopInspectionGoods> queryWrapper1 =new LambdaQueryWrapper<>();
List<ShopInspectionGoods> list1 = goodsService.list(queryWrapper1);
List<Map<String,String>> list = baseMapper.newChartInfoRatio(startTime,endTime);
//统计各个车型的价格 从高到低
for (Map<String,String> orderInfo : list) {
categories.add(orderInfo.get("goodsTitle").indexOf("(")>0?orderInfo.get("goodsTitle").substring(0,orderInfo.get("goodsTitle").indexOf("(")):orderInfo.get("goodsTitle"));
list1.removeIf(it->{
return it.getTitle().equals(orderInfo.get("goodsTitle"));
});
if (ObjectUtil.isEmpty(orderInfo.get("passRatio"))){
seriesObjectData.add(0d);
}else {
seriesObjectData.add(Double.valueOf(String.valueOf(orderInfo.get("passRatio"))));
}
}
categories.addAll(list1.stream().map(it->{
return it.getTitle().indexOf("(")>0?it.getTitle().substring(0,it.getTitle().indexOf("(")):it.getTitle();
}).collect(Collectors.toList()));
seriesObjectData.addAll(list1.stream().map(it->{
return 0d;
}).collect(Collectors.toList()));
seriesObject.put("data",seriesObjectData);
series.add(seriesObject);
res.put("categories",categories);
res.put("series",series);
return res;
}
@Override @Override
public List<OrderInfo> orderInfo(Long partnerId) { public List<OrderInfo> orderInfo(Long partnerId) {
@ -1436,6 +1779,17 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
Map<String, Double> map = baseMapper.staticsTable1(partnerId, startTime, endTime); Map<String, Double> map = baseMapper.staticsTable1(partnerId, startTime, endTime);
return map; return map;
} }
@Override
public Map<String,Double> newStaticsTable1(String startTime,String endTime) {
if (StringUtils.isEmpty(startTime)){
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
}
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
Map<String, Double> map = baseMapper.newStaticsTable1(startTime, endTime);
return map;
}
@Override @Override
public Map<String, Integer> staticsTable2(Long partnerId, String startTime, String endTime) { public Map<String, Integer> staticsTable2(Long partnerId, String startTime, String endTime) {
@ -1448,6 +1802,17 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
Map<String, Integer> map = baseMapper.staticsTable2(partnerId, startTime, endTime); Map<String, Integer> map = baseMapper.staticsTable2(partnerId, startTime, endTime);
return map; return map;
} }
@Override
public Map<String, Integer> newStaticsTable2(String startTime, String endTime) {
if (StringUtils.isEmpty(startTime)){
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
}
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
Map<String, Integer> map = baseMapper.newStaticsTable2( startTime, endTime);
return map;
}
@Override @Override
public List<Map<String, Object>> staticsTable3(Long partnerId, String startTime, String endTime) { public List<Map<String, Object>> staticsTable3(Long partnerId, String startTime, String endTime) {
@ -1460,6 +1825,17 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
List<Map<String, Object>> res = baseMapper.staticsTable3(partnerId, startTime, endTime); List<Map<String, Object>> res = baseMapper.staticsTable3(partnerId, startTime, endTime);
return res; return res;
} }
@Override
public List<Map<String, Object>> newStaticsTable3(String startTime, String endTime) {
if (StringUtils.isEmpty(startTime)){
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
}
startTime = startTime + " 00:00:00";
endTime = endTime + " 23:59:59";
List<Map<String, Object>> res = baseMapper.newStaticsTable3(startTime, endTime);
return res;
}
@Override @Override
public List<Map<String, Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime, String remark) { public List<Map<String, Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime, String remark) {

View File

@ -277,6 +277,13 @@ FROM
group by goods_id group by goods_id
order by realPayMoney desc order by realPayMoney desc
</select> </select>
<select id="newChartInfoAmount" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
select sum(pay_money) as realPayMoney,goods_title as goodsTitle from
order_info
where validation_time is not null and validation_time between #{startTime} and #{endTime}
group by goods_id
order by realPayMoney desc
</select>
<select id="chartInfoNum" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo"> <select id="chartInfoNum" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
select count(1) as realPayNum,goods_title as goodsTitle from select count(1) as realPayNum,goods_title as goodsTitle from
order_info order_info
@ -285,6 +292,13 @@ FROM
group by goods_id group by goods_id
order by realPayNum desc order by realPayNum desc
</select> </select>
<select id="newChartInfoNum" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
select count(1) as realPayNum,goods_title as goodsTitle from
order_info
where validation_time is not null and validation_time between #{startTime} and #{endTime}
group by goods_id
order by realPayNum desc
</select>
<select id="chartInfoRatio" resultType="java.util.Map"> <select id="chartInfoRatio" resultType="java.util.Map">
SELECT SELECT
@ -297,6 +311,17 @@ FROM
GROUP BY oi.goods_title GROUP BY oi.goods_title
order by passRatio desc order by passRatio desc
</select> </select>
<select id="newChartInfoRatio" resultType="java.util.Map">
SELECT
ROUND((SUM(ins.is_pass='1')/SUM(1))*100,2) as passRatio,oi.goods_title as goodsTitle
FROM
inspection_info ins
inner join order_info oi on oi.id = ins.inspection_order_id
WHERE ins.create_time between #{startTime} and #{endTime}
GROUP BY oi.goods_title
order by passRatio desc
</select>
<select id="partnerCategoryList" resultType="cn.iocoder.yudao.module.inspection.entity.ShopInspectionCategory"> <select id="partnerCategoryList" resultType="cn.iocoder.yudao.module.inspection.entity.ShopInspectionCategory">
SELECT SELECT
cate.* cate.*
@ -317,6 +342,14 @@ FROM
INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id
WHERE oi.partner_id = #{partnerId} and ii.create_time like concat(#{dateStr},'%') and ii.`status`='1' and ii.is_pass = '1' and oi.validation_time is not null WHERE oi.partner_id = #{partnerId} and ii.create_time like concat(#{dateStr},'%') and ii.`status`='1' and ii.is_pass = '1' and oi.validation_time is not null
</select> </select>
<select id="newChartLineInspectionAmount" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
SELECT
IFNULL(SUM(oi.pay_money),0)as realPayMoney
FROM
order_info oi
INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id
WHERE ii.create_time like concat(#{dateStr},'%') and ii.`status`='1' and ii.is_pass = '1' and oi.validation_time is not null
</select>
<select id="staticsTable1" resultType="java.util.Map"> <select id="staticsTable1" resultType="java.util.Map">
SELECT SELECT
ROUND(IFNULL(SUM(oi.goods_price),0)/100) gsAmount, ROUND(IFNULL(SUM(oi.goods_price),0)/100) gsAmount,
@ -329,6 +362,17 @@ FROM
and (ii.`status`='1' and ii.is_pass = '1' or ii.`status`='0') and (ii.`status`='1' and ii.is_pass = '1' or ii.`status`='0')
and ii.create_time BETWEEN #{startTime} and #{endTime} and ii.create_time BETWEEN #{startTime} and #{endTime}
</select> </select>
<select id="newStaticsTable1" resultType="java.util.Map">
SELECT
ROUND(IFNULL(SUM(oi.goods_price),0)/100) gsAmount,
ROUND(IFNULL(SUM(case when ii.`status`='1' and ii.is_pass = '1' then oi.pay_money else 0 end)/100,0)) ysAmount,
ROUND(IFNULL(SUM(case when ii.`status`='1' and ii.is_pass = '1' and oi.validation_time is not null then oi.pay_money else 0 end)/100,0)) yjsAmount
FROM
order_info oi
INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id
WHERE (ii.`status`='1' and ii.is_pass = '1' or ii.`status`='0')
and ii.create_time BETWEEN #{startTime} and #{endTime}
</select>
<select id="staticsTable2" resultType="java.util.Map"> <select id="staticsTable2" resultType="java.util.Map">
SELECT SELECT
count(1) allNum, count(1) allNum,
@ -339,6 +383,15 @@ FROM
WHERE ii.partner_id =#{partnerId} WHERE ii.partner_id =#{partnerId}
and ii.create_time BETWEEN #{startTime} and #{endTime} and ii.create_time BETWEEN #{startTime} and #{endTime}
</select> </select>
<select id="newStaticsTable2" resultType="java.util.Map">
SELECT
count(1) allNum,
IFNULL(SUM(ii.status='0'),0) jxzNum,
IFNULL(SUM(ii.status='1'),0) ywcNum
FROM
inspection_info ii
WHERE ii.create_time BETWEEN #{startTime} and #{endTime}
</select>
<select id="staticsTable3" resultType="java.util.Map"> <select id="staticsTable3" resultType="java.util.Map">
SELECT SELECT
ii.customer_source customerSource,IFNULL(sdd.remark,'未知类别') remark,count(1) theNum, ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount ii.customer_source customerSource,IFNULL(sdd.remark,'未知类别') remark,count(1) theNum, ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount
@ -352,6 +405,18 @@ FROM
having count(1)>0 having count(1)>0
order by theNum desc order by theNum desc
</select> </select>
<select id="newStaticsTable3" resultType="java.util.Map">
SELECT
ii.customer_source customerSource,IFNULL(sdd.remark,'未知类别') remark,count(1) theNum, ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount
FROM
order_info oi
INNER JOIN inspection_info ii on oi.id = ii.inspection_order_id
left join system_dict_data sdd on sdd.value = ii.customer_source and sdd.dict_type = concat('customer_source-',#{partnerId})
WHERE ii.create_time BETWEEN #{startTime} and #{endTime}
GROUP BY sdd.remark
having count(1)>0
order by theNum desc
</select>
<select id="staticsTable3Detail" resultType="java.util.Map"> <select id="staticsTable3Detail" resultType="java.util.Map">
SELECT SELECT
ii.customer_source customerSource,oi.goods_title as goodsTitle,IFNULL(sdd.remark,'未知类别') remark,count(1) theNum, ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount ii.customer_source customerSource,oi.goods_title as goodsTitle,IFNULL(sdd.remark,'未知类别') remark,count(1) theNum, ROUND(IFNULL(SUM(oi.goods_price),0)/100) theAmount

View File

@ -130,7 +130,7 @@ public class RepairWaresController {
* @date 10:51 2024/10/22 * @date 10:51 2024/10/22
**/ **/
@GetMapping("/getAllTypeList") @GetMapping("/getAllTypeList")
@Operation(summary = "查询所有有配件的分") @Operation(summary = "查询所有有配件的分")
public CommonResult<?> getAllTypeList() { public CommonResult<?> getAllTypeList() {
return success(waresService.getAllTypeList()); return success(waresService.getAllTypeList());
} }

View File

@ -436,7 +436,8 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
public Map<String, Integer> getWorkerTodo() { public Map<String, Integer> getWorkerTodo() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
LambdaQueryWrapper<DlTicketWares> queryWrapper = new LambdaQueryWrapper<DlTicketWares>() LambdaQueryWrapper<DlTicketWares> queryWrapper = new LambdaQueryWrapper<DlTicketWares>()
.eq(DlTicketWares::getRepairId,loginUser.getId()); .eq(DlTicketWares::getRepairId,loginUser.getId())
.eq(DlTicketWares::getType,"01");
List<DlTicketWares> list = this.list(queryWrapper); List<DlTicketWares> list = this.list(queryWrapper);
Map<String, Integer> rtnMap = new HashMap<>(); Map<String, Integer> rtnMap = new HashMap<>();
//所有提交的 //所有提交的

View File

@ -10,13 +10,14 @@ import cn.iocoder.yudao.module.tickets.service.DlTicketWaresService;
import cn.iocoder.yudao.module.tickets.service.DlTwItemService; import cn.iocoder.yudao.module.tickets.service.DlTwItemService;
import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO; import cn.iocoder.yudao.module.tickets.vo.DlTwItemReqVO;
import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO; import cn.iocoder.yudao.module.tickets.vo.DlTwItemRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -35,6 +36,9 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
@Resource @Resource
@Lazy @Lazy
private DlTicketWaresService ticketWaresService; private DlTicketWaresService ticketWaresService;
@Resource
@Lazy
private RepairWaresService waresService;
/** /**
* 根据主表查看全部 * 根据主表查看全部
@ -47,6 +51,12 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
public List<DlTwItemRespVO> listTwItem(DlTwItemReqVO reqVO){ public List<DlTwItemRespVO> listTwItem(DlTwItemReqVO reqVO){
// 查记录 // 查记录
List<DlTwItem> dlTwItems = baseMapper.listTwItem(reqVO); List<DlTwItem> dlTwItems = baseMapper.listTwItem(reqVO);
//所有有配件的分类
List<Map<String,String>> typeMapList = waresService.getAllTypeList();
Map<String,String> typeMap = new HashMap<>();
for(Map<String,String> map:typeMapList){
typeMap.put(map.get("id"),map.get("name"));
}
// 查配件详情 // 查配件详情
List<String> ids = dlTwItems.stream().map(DlTwItem::getWaresId).collect(Collectors.toList()); List<String> ids = dlTwItems.stream().map(DlTwItem::getWaresId).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(ids)){ if (CollectionUtil.isNotEmpty(ids)){
@ -57,6 +67,7 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
.filter(i -> i.getId().equals(bean.getWaresId())) .filter(i -> i.getId().equals(bean.getWaresId()))
.findFirst() .findFirst()
.ifPresent(bean::setWares); .ifPresent(bean::setWares);
bean.setTypeName(typeMap.get(bean.getWares().getType()));
return bean; return bean;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
} }

View File

@ -15,4 +15,6 @@ public class DlTwItemRespVO extends DlTwItem {
/** 配件详情 */ /** 配件详情 */
private RepairWares wares; private RepairWares wares;
/** 配件分类名称 */
private String typeName;
} }

View File

@ -72,9 +72,6 @@
<if test="map.supplierId != null and map.supplierId != ''"> <if test="map.supplierId != null and map.supplierId != ''">
and so.supplier_id = #{map.supplierId} and so.supplier_id = #{map.supplierId}
</if> </if>
<if test="map.soStatus != null and map.soStatus != ''">
and so.so_status = #{map.soStatus}
</if>
<if test="map.corpId != null and map.corpId != ''"> <if test="map.corpId != null and map.corpId != ''">
and so.corp_id = #{map.corpId} and so.corp_id = #{map.corpId}
</if> </if>

View File

@ -16,6 +16,7 @@
<result property="adviserId" column="adviser_id" /> <result property="adviserId" column="adviser_id" />
<result property="adviserName" column="adviser_name" /> <result property="adviserName" column="adviser_name" />
<result property="licenseNumber" column="license_number" /> <result property="licenseNumber" column="license_number" />
<result property="createTime" column="create_time" />
</resultMap> </resultMap>
<sql id="Base_SQL"> <sql id="Base_SQL">
@ -26,8 +27,8 @@
dtw.repair_name as repair_name, dtw.repair_name as repair_name,
dtw.adviser_id as adviser_id, dtw.adviser_id as adviser_id,
dtw.adviser_name as adviser_name, dtw.adviser_name as adviser_name,
dtw.license_number, dtw.license_number as license_number,
dtw.create_time dtw.create_time as create_time
from dl_ticket_wares dtw from dl_ticket_wares dtw
left join dl_repair_tickets drt left join dl_repair_tickets drt
on dtw.ticket_id = drt.id on dtw.ticket_id = drt.id