Merge branch 'dev' of http://122.51.230.86:3000/dianliang/lanan-system into dev
# Conflicts: # dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlTicketWaresServiceImpl.java
This commit is contained in:
commit
9c5c3343d4
@ -96,6 +96,14 @@ public class PartnerOwnController extends BaseController {
|
||||
{
|
||||
return success(partnerList.chartInfoAmount(partnerId, unit));
|
||||
}
|
||||
/**
|
||||
* 新检测线图
|
||||
*/
|
||||
@GetMapping("/newChartInfoAmount")
|
||||
public CommonResult newChartInfoAmount(String unit)
|
||||
{
|
||||
return success(partnerList.newChartInfoAmount(unit));
|
||||
}
|
||||
/**staticsTable1
|
||||
* 检测数量折线图
|
||||
*/
|
||||
@ -104,6 +112,14 @@ public class PartnerOwnController extends BaseController {
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新检测金额折线图
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
/**
|
||||
* 新检测线图
|
||||
*/
|
||||
@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));
|
||||
}
|
||||
/**
|
||||
* 新检测线图
|
||||
*/
|
||||
@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();
|
||||
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
|
||||
@GetMapping("/staticsTable2")
|
||||
@ -644,12 +690,22 @@ public class PartnerOwnController extends BaseController {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
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
|
||||
@GetMapping("/staticsTable3")
|
||||
public CommonResult staticsTable3(String startTime,String endTime) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
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
|
||||
@GetMapping("/staticsTable3Detail")
|
||||
public CommonResult staticsTable3Detail(String startTime,String endTime,String remark) throws Exception {
|
||||
|
@ -43,13 +43,20 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
|
||||
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> 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> 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>> newChartInfoRatio(@Param("startTime") String startTime, @Param("endTime")String endTime);
|
||||
List<ShopInspectionCategory> partnerCategoryList(@Param("partnerId") Long partnerId);
|
||||
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> 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> 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>> 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>> 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);
|
||||
|
@ -38,11 +38,15 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
||||
void startOrEnd(Long partnerId);
|
||||
StatisticsInfo statisticsInfo(Long partnerId);
|
||||
JSONObject chartInfoAmount(Long partnerId,String unit);
|
||||
JSONObject newChartInfoAmount(String unit);
|
||||
JSONObject chartLineInspectionNum(Long partnerId,String unit);
|
||||
JSONObject newChartLineInspectionNum(String unit);
|
||||
JSONObject chartLineInspectionAmount(Long partnerId,String unit);
|
||||
|
||||
JSONObject chartInfoNum(Long partnerId,String unit);
|
||||
JSONObject newChartInfoNum(String unit);
|
||||
JSONObject chartInfoRatio(Long partnerId, String unit);
|
||||
JSONObject newChartInfoRatio(String unit);
|
||||
List<OrderInfo> orderInfo(Long partnerId);
|
||||
List<HotGoodsVo> hotGoodsList(Long partnerId);
|
||||
void addGoods(ShopInspectionGoods goods) throws Exception;
|
||||
@ -90,14 +94,17 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
||||
String workOrderView(Long inspectionId);
|
||||
List<PostDO> inspectionPostInfo();
|
||||
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> newStaticsTable2(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>> staticsTable4(Long partnerId, String startTime, String endTime);
|
||||
List<Map<String,Object>> staticsTable5(Long partnerId, String startTime, String endTime);
|
||||
|
||||
|
||||
|
||||
|
||||
//新检测金额折线图
|
||||
JSONObject newChartLineInspectionAmount(String unit);
|
||||
}
|
||||
|
@ -336,6 +336,94 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
res.put("series",series);
|
||||
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
|
||||
public JSONObject chartLineInspectionNum(Long partnerId, String unit) {
|
||||
@ -388,6 +476,52 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
res.put("series",series);
|
||||
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
|
||||
public JSONObject chartLineInspectionAmount(Long partnerId, String unit) {
|
||||
@ -423,6 +557,36 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
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
|
||||
public JSONObject chartInfoNum(Long partnerId,String unit) {
|
||||
@ -517,6 +681,93 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
res.put("series",series);
|
||||
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
|
||||
public JSONObject chartInfoRatio(Long partnerId, String unit) {
|
||||
@ -616,6 +867,98 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
res.put("series",series);
|
||||
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
|
||||
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);
|
||||
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
|
||||
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);
|
||||
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
|
||||
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);
|
||||
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
|
||||
public List<Map<String, Object>> staticsTable3Detail(Long partnerId, String startTime, String endTime, String remark) {
|
||||
|
@ -277,6 +277,13 @@ FROM
|
||||
group by goods_id
|
||||
order by realPayMoney desc
|
||||
</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 count(1) as realPayNum,goods_title as goodsTitle from
|
||||
order_info
|
||||
@ -285,6 +292,13 @@ FROM
|
||||
group by goods_id
|
||||
order by realPayNum desc
|
||||
</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
|
||||
@ -297,6 +311,17 @@ FROM
|
||||
GROUP BY oi.goods_title
|
||||
order by passRatio desc
|
||||
</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
|
||||
cate.*
|
||||
@ -317,6 +342,14 @@ FROM
|
||||
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
|
||||
</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
|
||||
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.create_time BETWEEN #{startTime} and #{endTime}
|
||||
</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
|
||||
count(1) allNum,
|
||||
@ -339,6 +383,15 @@ FROM
|
||||
WHERE ii.partner_id =#{partnerId}
|
||||
and ii.create_time BETWEEN #{startTime} and #{endTime}
|
||||
</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
|
||||
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
|
||||
order by theNum desc
|
||||
</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
|
||||
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
|
||||
|
@ -6,22 +6,17 @@ import cn.iocoder.yudao.module.project.service.RepairWaresService;
|
||||
import cn.iocoder.yudao.module.project.vo.RepairWaresPageReqVO;
|
||||
import cn.iocoder.yudao.module.project.vo.RepairWaresRespVO;
|
||||
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.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 配件库")
|
||||
@ -129,5 +124,15 @@ public class RepairWaresController {
|
||||
return success(waresService.getWaresByName(name));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有有配件的分类
|
||||
* @author vinjor-M
|
||||
* @date 10:51 2024/10/22
|
||||
**/
|
||||
@GetMapping("/getAllTypeList")
|
||||
@Operation(summary = "查询所有有配件的分类")
|
||||
public CommonResult<?> getAllTypeList() {
|
||||
return success(waresService.getAllTypeList());
|
||||
}
|
||||
|
||||
}
|
@ -9,6 +9,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 配件库 Mapper
|
||||
*
|
||||
@ -35,4 +38,12 @@ public interface RepairWaresMapper extends BaseMapper<RepairWares> {
|
||||
* @date 18:03 2024/9/25
|
||||
**/
|
||||
RepairWaresRespVO getWaresByName(@Param("name") String name);
|
||||
|
||||
/**
|
||||
* 查询所有有配件的分配
|
||||
* @author vinjor-M
|
||||
* @date 10:54 2024/10/22
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.String>>
|
||||
**/
|
||||
List<Map<String,String>> selectAllType();
|
||||
}
|
@ -8,6 +8,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 配件库 Service 接口
|
||||
*
|
||||
@ -60,4 +63,12 @@ public interface RepairWaresService extends IService<RepairWares> {
|
||||
* @date 18:03 2024/9/25
|
||||
**/
|
||||
RepairWaresRespVO getWaresByName(String name);
|
||||
|
||||
/**
|
||||
* 查询所有有配件的分配
|
||||
* @author vinjor-M
|
||||
* @date 10:53 2024/10/22
|
||||
* @return java.util.List<java.util.Map<java.lang.String,java.lang.String>>
|
||||
**/
|
||||
List<Map<String,String>> getAllTypeList();
|
||||
}
|
@ -16,6 +16,8 @@ import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 配件库 Service 实现类
|
||||
@ -100,4 +102,16 @@ public class RepairWaresServiceImpl extends ServiceImpl<RepairWaresMapper, Repai
|
||||
return waresMapper.getWaresByName(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有有配件的分配
|
||||
*
|
||||
* @return java.util.List<java.util.Map < java.lang.String, java.lang.String>>
|
||||
* @author vinjor-M
|
||||
* @date 10:53 2024/10/22
|
||||
**/
|
||||
@Override
|
||||
public List<Map<String, String>> getAllTypeList() {
|
||||
return waresMapper.selectAllType();
|
||||
}
|
||||
|
||||
}
|
@ -17,6 +17,17 @@ import org.apache.ibatis.annotations.Param;
|
||||
public interface DlRepairSoMapper extends BaseMapper<DlRepairSo> {
|
||||
|
||||
IPage<DlRepairSo> getRepairSoPage(@Param("map") DlRepairSoReqVO repairSoReqVO, Page<DlRepairSo> page);
|
||||
|
||||
/**
|
||||
* 根据条件查询指定数量:待确认的领料单 待确认的退料单
|
||||
* @author vinjor-M
|
||||
* @date 16:09 2024/10/22
|
||||
* @param type 02 领料单 |04 退料单
|
||||
* @param userId 用户ID
|
||||
* @param status 04 待领料状态 |07 待退料状态
|
||||
* @return java.lang.Integer
|
||||
**/
|
||||
Integer selectCountNum(@Param("type") String type,@Param("userId") Long userId,@Param("status") String status);
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,6 +73,20 @@ public class DlTicketWaresController {
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建配件申请单、
|
||||
* @author vinjor-M
|
||||
* @date 14:35 2024/10/22
|
||||
* @param respVO 请求体
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@PostMapping("/newApplyOrder")
|
||||
@Operation(summary = "新增、修改")
|
||||
public CommonResult<?> newApplyOrder(@RequestBody DlTicketWaresRespVO respVO){
|
||||
dlTicketWaresService.createApplyOrder(respVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
@ -142,5 +156,17 @@ public class DlTicketWaresController {
|
||||
dlTicketWaresService.passBackTicketWares(respVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 维修工的角度查提交的配件申请单\待确认领料单\待确认退料单 待处理数量
|
||||
* @author vinjor-M
|
||||
* @date 15:32 2024/10/22
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||
**/
|
||||
@GetMapping("/getWorkerTodo")
|
||||
@Operation(summary = "维修工的角度查提交的配件申请单")
|
||||
public CommonResult<?> getWorkerTodo(){
|
||||
return success(dlTicketWaresService.getWorkerTodo());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 针对表【dl_ticket_wares(工单配件申请/退回表)】的数据库操作Service
|
||||
@ -88,4 +89,19 @@ public interface DlTicketWaresService extends IService<DlTicketWares> {
|
||||
* @param respVO 请求对象
|
||||
**/
|
||||
void passBackTicketWares(DlTicketWaresRespVO respVO);
|
||||
|
||||
/**
|
||||
* 创建配件申请单
|
||||
* @author vinjor-M
|
||||
* @date 14:48 2024/10/22
|
||||
* @param respVO 请求体
|
||||
**/
|
||||
void createApplyOrder(DlTicketWaresRespVO respVO);
|
||||
|
||||
/**
|
||||
* 维修工的角度查提交的配件申请单 待处理数量
|
||||
* @author vinjor-M
|
||||
* @date 15:38 2024/10/22
|
||||
**/
|
||||
Map<String,Integer> getWorkerTodo();
|
||||
}
|
||||
|
@ -3,12 +3,15 @@ package cn.iocoder.yudao.module.tickets.service.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.RepairRoleEnum;
|
||||
import cn.iocoder.yudao.common.SoStatusEnum;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||
import cn.iocoder.yudao.module.base.service.RepairWorkerService;
|
||||
import cn.iocoder.yudao.module.project.entity.RepairWares;
|
||||
import cn.iocoder.yudao.module.project.service.RepairWaresService;
|
||||
import cn.iocoder.yudao.module.stockOperate.entity.DlRepairSoi;
|
||||
import cn.iocoder.yudao.module.stockOperate.mapper.DlRepairSoMapper;
|
||||
import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoService;
|
||||
import cn.iocoder.yudao.module.stockOperate.service.DlRepairSoiService;
|
||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
||||
@ -31,15 +34,13 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
@ -51,8 +52,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
|
||||
* @date 11:56 2024/10/15
|
||||
**/
|
||||
@Service
|
||||
public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, DlTicketWares>
|
||||
implements DlTicketWaresService {
|
||||
public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, DlTicketWares> implements DlTicketWaresService {
|
||||
|
||||
|
||||
@Resource
|
||||
@ -83,6 +83,10 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
||||
private RepairWaresService repairWaresService;
|
||||
|
||||
@Resource
|
||||
private RepairWorkerService workerService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private DlRepairSoMapper dlRepairSoMapper;
|
||||
@Lazy
|
||||
private RoleApi roleApi;
|
||||
|
||||
@ -431,6 +435,72 @@ public class DlTicketWaresServiceImpl extends ServiceImpl<DlTicketWaresMapper, D
|
||||
// 更新申请单子表状态
|
||||
twItemService.updateBatchById(respVO.getItems());
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建配件申请单
|
||||
*
|
||||
* @param respVO 请求体
|
||||
* @author vinjor-M
|
||||
* @date 14:48 2024/10/22
|
||||
**/
|
||||
@Override
|
||||
public void createApplyOrder(DlTicketWaresRespVO respVO) {
|
||||
//默认待审核
|
||||
respVO.setStatus("01");
|
||||
//查维修单信息
|
||||
DlRepairTickets tickets = repairTicketsService.getById(respVO.getTicketId());
|
||||
respVO.setLicenseNumber(tickets.getCarNo());
|
||||
respVO.setAdviserId(Long.valueOf(tickets.getAdviserId()));
|
||||
respVO.setAdviserName(tickets.getAdviserName());
|
||||
this.save(respVO);
|
||||
if(!respVO.getItems().isEmpty()){
|
||||
List<DlTwItem> list = respVO.getItems().stream().map(dlTwItem -> dlTwItem.setTwId(respVO.getId())).collect(Collectors.toList());
|
||||
twItemService.saveBatch(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 维修工的角度查提交的配件申请单\待确认领料单\待确认退料单 待处理数量
|
||||
*
|
||||
* @author vinjor-M
|
||||
* @date 15:38 2024/10/22
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Integer> getWorkerTodo() {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
LambdaQueryWrapper<DlTicketWares> queryWrapper = new LambdaQueryWrapper<DlTicketWares>()
|
||||
.eq(DlTicketWares::getRepairId,loginUser.getId())
|
||||
.eq(DlTicketWares::getType,"01");
|
||||
List<DlTicketWares> list = this.list(queryWrapper);
|
||||
Map<String, Integer> rtnMap = new HashMap<>();
|
||||
//所有提交的
|
||||
Integer submitNum = list.size();
|
||||
//已通过的
|
||||
Integer allowNum = 0;
|
||||
//未通过的
|
||||
Integer noAllowNum = 0;
|
||||
//待确认领料单
|
||||
Integer waitingReceiveNum = dlRepairSoMapper.selectCountNum("02",loginUser.getId(), SoStatusEnum.TO_BE_PICKED.getCode());
|
||||
//待确认退料单
|
||||
Integer waitingBackNum = dlRepairSoMapper.selectCountNum("04",loginUser.getId(), SoStatusEnum.TO_BE_RETURNED.getCode());
|
||||
for (DlTicketWares wares:list){
|
||||
if("02".equals(wares.getStatus())){
|
||||
//已通过
|
||||
allowNum++;
|
||||
}else if("05".equals(wares.getStatus())){
|
||||
//被驳回
|
||||
noAllowNum++;
|
||||
}
|
||||
}
|
||||
rtnMap.put("submitNum",submitNum);
|
||||
rtnMap.put("allowNum",allowNum);
|
||||
rtnMap.put("noAllowNum",noAllowNum);
|
||||
rtnMap.put("waitingReceiveNum",waitingReceiveNum);
|
||||
rtnMap.put("waitingBackNum",waitingBackNum);
|
||||
return rtnMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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.vo.DlTwItemReqVO;
|
||||
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 org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -35,6 +36,9 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
|
||||
@Resource
|
||||
@Lazy
|
||||
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){
|
||||
// 查记录
|
||||
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());
|
||||
if (CollectionUtil.isNotEmpty(ids)){
|
||||
@ -57,6 +67,7 @@ public class DlTwItemServiceImpl extends ServiceImpl<DlTwItemMapper, DlTwItem>
|
||||
.filter(i -> i.getId().equals(bean.getWaresId()))
|
||||
.findFirst()
|
||||
.ifPresent(bean::setWares);
|
||||
bean.setTypeName(typeMap.get(bean.getWares().getType()));
|
||||
return bean;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
@ -15,4 +15,6 @@ public class DlTwItemRespVO extends DlTwItem {
|
||||
|
||||
/** 配件详情 */
|
||||
private RepairWares wares;
|
||||
/** 配件分类名称 */
|
||||
private String typeName;
|
||||
}
|
||||
|
@ -24,6 +24,9 @@
|
||||
<if test="entity.name != null and entity.name != ''">
|
||||
and drw.name like concat('%', #{entity.name}, '%')
|
||||
</if>
|
||||
<if test="entity.type != null and entity.type != ''">
|
||||
and drw.type =#{entity.type}
|
||||
</if>
|
||||
</where>
|
||||
GROUP BY
|
||||
drw.id
|
||||
@ -44,4 +47,12 @@
|
||||
LEFT JOIN dl_base_warehouse dbw ON drw.warehouse = dbw.id AND dbw.deleted = 0
|
||||
where drw.name = #{name} order by drw.create_time desc limit 1
|
||||
</select>
|
||||
<select id="selectAllType" resultType="java.util.Map">
|
||||
SELECT
|
||||
tmp.type as id,
|
||||
dbt.`name`
|
||||
FROM
|
||||
( SELECT DISTINCT type FROM dl_repair_wares ) tmp
|
||||
LEFT JOIN dl_base_type dbt ON tmp.type = dbt.id
|
||||
</select>
|
||||
</mapper>
|
@ -72,9 +72,6 @@
|
||||
<if test="map.supplierId != null and map.supplierId != ''">
|
||||
and so.supplier_id = #{map.supplierId}
|
||||
</if>
|
||||
<if test="map.soStatus != null and map.soStatus != ''">
|
||||
and so.so_status = #{map.soStatus}
|
||||
</if>
|
||||
<if test="map.corpId != null and map.corpId != ''">
|
||||
and so.corp_id = #{map.corpId}
|
||||
</if>
|
||||
@ -86,4 +83,15 @@
|
||||
</if>
|
||||
order by so.create_time desc
|
||||
</select>
|
||||
<select id="selectCountNum" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(id)
|
||||
FROM
|
||||
dl_repair_so
|
||||
WHERE
|
||||
user_id = #{userId}
|
||||
AND so_type = #{type}
|
||||
AND so_status = #{status}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -19,7 +19,7 @@
|
||||
sale_name = #{saleName},
|
||||
</if>
|
||||
</set>
|
||||
WHERE ticket_id = #{ticketId}
|
||||
WHERE ticket_id = #{ticketId} and project_id = #{projectId}
|
||||
</update>
|
||||
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
<result property="adviserId" column="adviser_id" />
|
||||
<result property="adviserName" column="adviser_name" />
|
||||
<result property="licenseNumber" column="license_number" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
@ -26,7 +27,8 @@
|
||||
dtw.repair_name as repair_name,
|
||||
dtw.adviser_id as adviser_id,
|
||||
dtw.adviser_name as adviser_name,
|
||||
dtw.license_number
|
||||
dtw.license_number as license_number,
|
||||
dtw.create_time as create_time
|
||||
from dl_ticket_wares dtw
|
||||
left join dl_repair_tickets drt
|
||||
on dtw.ticket_id = drt.id
|
||||
|
@ -180,6 +180,7 @@ logging:
|
||||
cn.iocoder.yudao.module.staff.mapper: debug #
|
||||
cn.iocoder.yudao.module.property.mapper: debug #
|
||||
cn.iocoder.yudao.module.tickets.mapper: debug #
|
||||
cn.iocoder.yudao.module.project.mapper: debug #
|
||||
|
||||
debug: false
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user