diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java index efe3bd21..e417d375 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java @@ -41,7 +41,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/admin-api/partnerOwn/partner") -public class PartnerOwnController extends BaseController { +public class PartnerOwnController extends BaseController { @Autowired private AppInspectionPartnerService partnerList; @Autowired @@ -58,12 +58,12 @@ public class PartnerOwnController extends BaseController { */ @GetMapping("/shopInfo") public CommonResult shopInfo() throws Exception { - return success(partnerList.shopInfo()); + return success(partnerList.shopInfo()); } @GetMapping("/shopInfoByUserId") public CommonResult shopInfoByUserId() throws Exception { - return success(partnerList.shopInfoByUserId()); + return success(partnerList.shopInfoByUserId()); } /** @@ -71,7 +71,7 @@ public class PartnerOwnController extends BaseController { */ @GetMapping("/getAppointAndPickNum") public CommonResult getAppointAndPickNum() throws Exception { - return success(partnerList.getAppointAndPickNum()); + return success(partnerList.getAppointAndPickNum()); } @@ -79,127 +79,126 @@ public class PartnerOwnController extends BaseController { * 开始或者停止营业 */ @PostMapping("/startOrEnd") - public CommonResult startOrEnd(Long partnerId) - { + public CommonResult startOrEnd(Long partnerId) { partnerList.startOrEnd(partnerId); - return success(); + return success(); } + /** * 首页 顶部数据统计 */ @GetMapping("/statisticsInfo") - public CommonResult statisticsInfo() - { - return success(partnerList.statisticsInfo(null)); + public CommonResult statisticsInfo() { + return success(partnerList.statisticsInfo(null)); } + /** * 检测线图 */ @GetMapping("/chartInfoAmount") - public CommonResult chartInfoAmount(Long partnerId,String unit) - { - return success(partnerList.chartInfoAmount(partnerId, unit)); + public CommonResult chartInfoAmount(Long partnerId, String unit) { + return success(partnerList.chartInfoAmount(partnerId, unit)); } + /** * 新检测线图 */ @GetMapping("/newChartInfoAmount") - public CommonResult newChartInfoAmount(String unit) - { - return success(partnerList.newChartInfoAmount(unit)); + public CommonResult newChartInfoAmount(String unit) { + return success(partnerList.newChartInfoAmount(unit)); } - /**staticsTable1 + + /** + * staticsTable1 * 检测数量折线图 */ @GetMapping("/chartLineInspectionNum") - public CommonResult chartLineInspectionNum(Long partnerId,String unit) - { - return success(partnerList.chartLineInspectionNum(partnerId, unit)); + public CommonResult chartLineInspectionNum(Long partnerId, String unit) { + return success(partnerList.chartLineInspectionNum(partnerId, unit)); } - /**staticsTable1 + + /** + * staticsTable1 * 新检测数量折线图 */ @GetMapping("/newChartLineInspectionNum") - public CommonResult newChartLineInspectionNum(String unit) - { - return success(partnerList.newChartLineInspectionNum(unit)); + public CommonResult newChartLineInspectionNum(String unit) { + return success(partnerList.newChartLineInspectionNum(unit)); } + /** * 检测金额折线图 */ @GetMapping("/chartLineInspectionAmount") - public CommonResult chartLineInspectionAmount(Long partnerId,String unit) - { - return success(partnerList.chartLineInspectionAmount(partnerId, unit)); + public CommonResult chartLineInspectionAmount(Long partnerId, String unit) { + return success(partnerList.chartLineInspectionAmount(partnerId, unit)); } /** * 新检测金额折线图 */ @GetMapping("/newChartLineInspectionAmount") - public CommonResult newChartLineInspectionAmount(String unit) - { - return success(partnerList.newChartLineInspectionAmount(unit)); + public CommonResult newChartLineInspectionAmount(String unit) { + return success(partnerList.newChartLineInspectionAmount(unit)); } /** * 检测线图 */ @GetMapping("/chartInfoNum") - public CommonResult chartInfoNum(Long partnerId,String unit) - { - return success(partnerList.chartInfoNum(partnerId, unit)); + public CommonResult chartInfoNum(Long partnerId, String unit) { + return success(partnerList.chartInfoNum(partnerId, unit)); } + /** * 新检测线图 */ @GetMapping("/newChartInfoNum") - public CommonResult newChartInfoNum(String unit) - { - return success(partnerList.newChartInfoNum( unit)); + public CommonResult newChartInfoNum(String unit) { + return success(partnerList.newChartInfoNum(unit)); } /** * 检测线图 */ @GetMapping("/chartInfoRatio") - public CommonResult chartInfoRatio(Long partnerId,String unit) throws Exception { + public CommonResult chartInfoRatio(Long partnerId, String unit) throws Exception { if (ObjectUtil.isNull(partnerId)) { partnerId = partnerList.shopInfoByUserId().getPartnerId(); } - return success(partnerList.chartInfoRatio(partnerId, unit)); + return success(partnerList.chartInfoRatio(partnerId, unit)); } + /** * 新检测线图 */ @GetMapping("/newChartInfoRatio") - public CommonResult newChartInfoRatio(String unit) - { - return success(partnerList.newChartInfoRatio(unit)); + public CommonResult newChartInfoRatio(String unit) { + return success(partnerList.newChartInfoRatio(unit)); } + /** * 首页 订单信息 */ @GetMapping("/orderInfo") - public CommonResult orderInfo(Long partnerId) - { - return success(partnerList.orderInfo(partnerId)); + public CommonResult orderInfo(Long partnerId) { + return success(partnerList.orderInfo(partnerId)); } + /** * 热销商品列表 */ @GetMapping("/hotGoodsList") - public CommonResult hotGoodsList(Long partnerId) - { - return success(partnerList.hotGoodsList(partnerId)); + public CommonResult hotGoodsList(Long partnerId) { + return success(partnerList.hotGoodsList(partnerId)); } + /** * 热销商品列表 */ @GetMapping("/newHotGoodsList") - public CommonResult newHotGoodsList() - { - return success(partnerList.newHotGoodsList()); + public CommonResult newHotGoodsList() { + return success(partnerList.newHotGoodsList()); } @@ -209,57 +208,56 @@ public class PartnerOwnController extends BaseController { * @return 所有数据 */ @GetMapping("/categoryList") - public CommonResult categoryList(Long partnerId) - { + public CommonResult categoryList(Long partnerId) { - return success( partnerList.categoryList(partnerId)); + return success(partnerList.categoryList(partnerId)); } + /** * 发布商品 */ @PostMapping("/addGoods") public CommonResult addGoods(@RequestBody ShopInspectionGoods goods) throws Exception { partnerList.addGoods(goods); - return success(); + return success(); } /** * 商品管理列表 */ @GetMapping("/goodsList") - public CommonResult goodsList(Long partnerId,String isListing,String goodsTitle, - @RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum, - @RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) - { + public CommonResult goodsList(Long partnerId, String isListing, String goodsTitle, + @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); ShopMallPartners partners = partnerList.getById(partnerId); - if (!partners.getUserId().equals(user.getId())){ + if (!partners.getUserId().equals(user.getId())) { return null; } Page page = new Page<>(pageNum, pageSize); - IPage list = partnerList.goodsList(page,partnerId, isListing, goodsTitle); + IPage list = partnerList.goodsList(page, partnerId, isListing, goodsTitle); return success(list); } + /** * 商品管理列表 */ @GetMapping("/canUsegoods") - public CommonResult canUseGoods(Long partnerId) - { + public CommonResult canUseGoods(Long partnerId) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); ShopMallPartners partners = partnerList.getById(partnerId); - if (!partners.getUserId().equals(user.getId())){ + if (!partners.getUserId().equals(user.getId())) { return null; } return success(partnerList.canUseGoods(partnerId)); } + /** * 商品详细信息 */ @GetMapping("/goodsDetail") - public CommonResult goodsDetail(Long goodsId) - { - return success(partnerList.goodsDetail(goodsId)); + public CommonResult goodsDetail(Long goodsId) { + return success(partnerList.goodsDetail(goodsId)); } /** @@ -268,55 +266,56 @@ public class PartnerOwnController extends BaseController { @PostMapping("/editGoods") public CommonResult editGoods(@RequestBody ShopInspectionGoods goods) throws Exception { partnerList.editGoods(goods); - return success(); + return success(); } + @PostMapping("/editSkuPrice") public CommonResult editSkuPrice(@RequestBody ShopInspectionGoods goods) throws Exception { partnerList.editSkuPrice(goods); - return success(); + return success(); } + /** * 上下架 */ @PostMapping("/changeListing") public CommonResult changeListing(Long goodsId) throws Exception { partnerList.changeListing(goodsId); - return success(); + return success(); } + /** * 删除商品 */ @PostMapping("/delGoods") public CommonResult delGoods(Long goodsId) throws Exception { partnerList.delGoods(goodsId); - return success(); + return success(); } + /** * 管理店铺信息 */ @PostMapping("/getPartnerInfo") - public CommonResult getPartnerInfo(Long partnerId) - { - return success(partnerList.getPartnerInfo(partnerId)); + public CommonResult getPartnerInfo(Long partnerId) { + return success(partnerList.getPartnerInfo(partnerId)); } /** * 管理店铺信息 */ @PostMapping("/editPartnerInfo") - public CommonResult editPartnerInfo(@RequestBody ShopMallPartners partners) - { + public CommonResult editPartnerInfo(@RequestBody ShopMallPartners partners) { partnerList.editPartnerInfo(partners); - return success(); + return success(); } /** * 店铺账户信息 */ @GetMapping("/accountInfo") - public CommonResult accountInfo(Long partnerId) - { - return success(partnerList.accountInfo(partnerId)); + public CommonResult accountInfo(Long partnerId) { + return success(partnerList.accountInfo(partnerId)); } /** @@ -324,69 +323,69 @@ public class PartnerOwnController extends BaseController { */ @GetMapping("/accountDetail") public CommonResult accountDetail(Long partnerId, - @RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum, - @RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) - { + @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { Page page = new Page<>(pageNum, pageSize); - IPage details = partnerList.accountDetail(page,partnerId,pageNum,pageSize); + IPage details = partnerList.accountDetail(page, partnerId, pageNum, pageSize); return success(details); } + /** * 当前店铺的订单信息 */ @GetMapping("/orderList") - public CommonResult orderList(Long partnerId,String phoneNum, String title, - @RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum, - @RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) - { + public CommonResult orderList(Long partnerId, String phoneNum, String title, + @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); ShopMallPartners partnersTmp = partnerList.getById(partnerId); - if (!partnersTmp.getUserId().equals(user.getId())){ + if (!partnersTmp.getUserId().equals(user.getId())) { return null; } Page page = new Page<>(pageNum, pageSize); - IPage orderInfos = partnerList.orderList(page,partnerId,phoneNum, title); + IPage orderInfos = partnerList.orderList(page, partnerId, phoneNum, title); return success(orderInfos); } + /** * 通过核销码获取订单信息 */ @GetMapping("/orderDetailByCode") - public CommonResult orderDetailByCode(Long partnerId,String code) throws Exception { - Long orderId = partnerList.orderDetailByCode(partnerId,code); - return success(orderId); + public CommonResult orderDetailByCode(Long partnerId, String code) throws Exception { + Long orderId = partnerList.orderDetailByCode(partnerId, code); + return success(orderId); } /** * 当前的订单信息 */ @GetMapping("/orderDetail") - public CommonResult orderDetail(Long partnerId, Long orderId) - { - OrderAppDetail orderInfos = partnerList.orderDetail(partnerId,orderId); - return success(orderInfos); + public CommonResult orderDetail(Long partnerId, Long orderId) { + OrderAppDetail orderInfos = partnerList.orderDetail(partnerId, orderId); + return success(orderInfos); } + /** * 店铺核销功能 */ @PostMapping("/takeOut") - public CommonResult takeOut(Long partnerId,Long orderId,Long workId,String carNum) throws Exception { - partnerList.takeOut(partnerId,orderId,workId,carNum); - return success(); + public CommonResult takeOut(Long partnerId, Long orderId, Long workId, String carNum) throws Exception { + partnerList.takeOut(partnerId, orderId, workId, carNum); + return success(); } - @PostMapping("/addWorker") - public CommonResult addWorker(Long partnerId,String realName,String phoneNum,Long postId) throws Exception { - partnerList.addWorker(partnerId,realName,phoneNum,postId); - return success(); + @PostMapping("/addWorker") + public CommonResult addWorker(Long partnerId, String realName, String phoneNum, Long postId) throws Exception { + + partnerList.addWorker(partnerId, realName, phoneNum, postId); + return success(); } /** * 获取员工信息 */ @GetMapping("/getWorkList") - public CommonResult> getWorkList(Long partnerId, String workName, String phoneNum, Long postId, Integer pageNum, Integer pageSize) - { + public CommonResult> getWorkList(Long partnerId, String workName, String phoneNum, Long postId, Integer pageNum, Integer pageSize) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); // ShopMallPartners partnersTmp = partnerList.getById(partnerId); // if (!partnersTmp.getUserId().equals(user.getId())){ @@ -404,23 +403,23 @@ public class PartnerOwnController extends BaseController { } @PostMapping("/delWorker") - public CommonResult delWorker(Long partnerId,String workIdStr) { + public CommonResult delWorker(Long partnerId, String workIdStr) { String[] workIds = workIdStr.split(","); for (String workId : workIds) { - partnerList.delWorker(partnerId,Long.parseLong(workId)); + partnerList.delWorker(partnerId, Long.parseLong(workId)); } - return success(); + return success(); } //获取检测的数据 @GetMapping("/inspectionList") - public CommonResult inspectionList(Long partnerId,String status,String carNum,Integer pageSize,Integer pageNum) throws Exception { + public CommonResult inspectionList(Long partnerId, String status, String carNum, Integer pageSize, Integer pageNum) throws Exception { ShopMallPartners partners = partnerList.shopInfo(); - if (!partnerId.equals(partners.getPartnerId())){ + if (!partnerId.equals(partners.getPartnerId())) { return null; } - Page page = new Page<>(pageNum,pageSize); - IPage inspectionInfos = partnerList.inspectionList(page,partnerId, status, carNum); + Page page = new Page<>(pageNum, pageSize); + IPage inspectionInfos = partnerList.inspectionList(page, partnerId, status, carNum); return success(inspectionInfos); } @@ -432,59 +431,63 @@ public class PartnerOwnController extends BaseController { //获取检测的数据 @GetMapping("/workerInspectionList") - public CommonResult workerInspectionList(Long partnerId,String status,String searchValue,Integer pageSize,Integer pageNum) { + public CommonResult workerInspectionList(Long partnerId, String status, String searchValue, Integer pageSize, Integer pageNum) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); - LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); - queryWrapper.eq(PartnerWorker::getUserId,user.getId()).eq(PartnerWorker::getPartnerId,partnerId); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(PartnerWorker::getUserId, user.getId()).eq(PartnerWorker::getPartnerId, partnerId); PartnerWorker worker = partnerWorkerService.getOne(queryWrapper); - if (ObjectUtil.isEmpty(worker)){ + if (ObjectUtil.isEmpty(worker)) { return null; } - Page page = new Page<>(pageNum,pageSize); - IPage inspectionInfos = partnerList.inspectionList(page,partnerId, status, searchValue); + Page page = new Page<>(pageNum, pageSize); + IPage inspectionInfos = partnerList.inspectionList(page, partnerId, status, searchValue); return success(inspectionInfos); } + //增加检测步骤信息 @PostMapping("/addStepInfo") public CommonResult addStepInfo(@RequestBody InspectionStepInfo stepInfo) { partnerList.addStepInfo(stepInfo); return success(); } + //增加检测结果 @PostMapping("/stopInspection") public CommonResult editInspection(@RequestBody InspectionInfo info) throws Exception { partnerList.stopInspection(info); return success(); } + //完成制证 @PostMapping("/makeCertOk") public CommonResult makeCertOk(Long inspectionId) { partnerList.makeCertOk(inspectionId); return success(); } + //获取到店预约的数据 @GetMapping("/getAppointmentList") - public CommonResult getAppointmentList(Long partnerId,String phoneNum,Integer pageSize,Integer pageNum) { + public CommonResult getAppointmentList(Long partnerId, String phoneNum, Integer pageSize, Integer pageNum) { // LoginUser user = SecurityFrameworkUtils.getLoginUser(); // ShopMallPartners partnersTmp = partnerList.getById(partnerId); // if (!partnersTmp.getUserId().equals(user.getId())){ // return null; // } - Page page = new Page<>(pageNum,pageSize); - IPage appointments = partnerList.getAppointmentList(page,partnerId,phoneNum); + Page page = new Page<>(pageNum, pageSize); + IPage appointments = partnerList.getAppointmentList(page, partnerId, phoneNum); return success(appointments); } //获取上门取车数据 @GetMapping("/getPickCarList") - public CommonResult getPickCarList(Long partnerId,String phoneNum,String pickStatus,Integer pageSize,Integer pageNum) { + public CommonResult getPickCarList(Long partnerId, String phoneNum, String pickStatus, Integer pageSize, Integer pageNum) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); // ShopMallPartners partnersTmp = partnerList.getById(partnerId); // if (!partnersTmp.getUserId().equals(user.getId())){ // return null; // } - Page page = new Page<>(pageNum,pageSize); - IPage pickCarList = partnerList.getPickCarList(page,partnerId,phoneNum,pickStatus); + Page page = new Page<>(pageNum, pageSize); + IPage pickCarList = partnerList.getPickCarList(page, partnerId, phoneNum, pickStatus); return success(pickCarList); } @@ -497,16 +500,16 @@ public class PartnerOwnController extends BaseController { // 核销记录By核销人Id @GetMapping("/validationList") - public CommonResult validationList(Long partnerId,String searchValue, - @RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum, - @RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) { + public CommonResult validationList(Long partnerId, String searchValue, + @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); ShopMallPartners partnersTmp = partnerList.getById(partnerId); - if (!partnersTmp.getUserId().equals(user.getId())){ + if (!partnersTmp.getUserId().equals(user.getId())) { return null; } Page page = new Page<>(pageNum, pageSize); - IPage orderInfos = partnerList.validationList(page,partnerId,searchValue); + IPage orderInfos = partnerList.validationList(page, partnerId, searchValue); return success(orderInfos); } @@ -519,37 +522,38 @@ public class PartnerOwnController extends BaseController { //优惠券列表 @GetMapping("/listCoupon") - public CommonResult listCoupon(Long partnerId,String searchValue, - @RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum, - @RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize){ + public CommonResult listCoupon(Long partnerId, String searchValue, + @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); ShopMallPartners partnersTmp = partnerList.getById(partnerId); - if (!partnersTmp.getUserId().equals(user.getId())){ + if (!partnersTmp.getUserId().equals(user.getId())) { return success(new ArrayList<>()); } Page page = new Page<>(pageNum, pageSize); - IPage shopCouponTemplates = partnerList.listCoupon(page,partnerId, searchValue); + IPage shopCouponTemplates = partnerList.listCoupon(page, partnerId, searchValue); return success(shopCouponTemplates); } + //删除优惠券 @PostMapping("/delCoupon") - public CommonResult delCoupon(Long partnerId,Long id){ - partnerList.delCoupon(partnerId,id); + public CommonResult delCoupon(Long partnerId, Long id) { + partnerList.delCoupon(partnerId, id); return success(); } //指派工人上门取车 @PostMapping("/designatePickCarWorker") - public CommonResult designatePickCarWorker(Long pickCarId,Long workerId){ - partnerList.designatePickCarWorker(pickCarId,workerId); + public CommonResult designatePickCarWorker(Long pickCarId, Long workerId) { + partnerList.designatePickCarWorker(pickCarId, workerId); return success(); } //获取上门取车数据 @GetMapping("/getPickCarListOfWorker") - public CommonResult getPickCarListOfWorker(Long partnerId,String phoneNum, - @RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum, - @RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) { + public CommonResult getPickCarListOfWorker(Long partnerId, String phoneNum, + @RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) { LoginUser user = SecurityFrameworkUtils.getLoginUser(); // .eq(PartnerWorker::getUserId,user.getId()) // LambdaQueryWrapper queryWrapper =new LambdaQueryWrapper<>(); @@ -559,7 +563,7 @@ public class PartnerOwnController extends BaseController { // return null; // } Page page = new Page<>(pageNum, pageSize); - IPage pickCarList = partnerList.getPickCarListOfWorker(page,user.getId(),phoneNum); + IPage pickCarList = partnerList.getPickCarListOfWorker(page, user.getId(), phoneNum); return success(pickCarList); } @@ -567,22 +571,22 @@ public class PartnerOwnController extends BaseController { @GetMapping("/getCustomerSource") public CommonResult getCustomerSource(String searchValue) throws Exception { ShopMallPartners partners = partnerList.shopInfoByUserId(); - String dictStr = "customer_source-"+partners.getPartnerId(); + String dictStr = "customer_source-" + partners.getPartnerId(); DictTypeDO sysDictType = dictTypeService.getDictType(dictStr); - if (ObjectUtil.isEmpty(sysDictType)){ + if (ObjectUtil.isEmpty(sysDictType)) { //初始化 DictTypeSaveReqVO save = new DictTypeSaveReqVO(); - save.setName("客户来源-"+partners.getPartnerName()); + save.setName("客户来源-" + partners.getPartnerName()); save.setStatus(0); save.setType(dictStr); dictTypeService.createDictType(save); } List dataList = dictDataService.getDictDataListByDictType(dictStr); - if (CollectionUtil.isEmpty(dataList)){ - dataList =new ArrayList<>(); + if (CollectionUtil.isEmpty(dataList)) { + dataList = new ArrayList<>(); } - if (StringUtils.isNotEmpty(searchValue)){ - dataList = dataList.stream().filter(it->{ + if (StringUtils.isNotEmpty(searchValue)) { + dataList = dataList.stream().filter(it -> { return it.getLabel().contains(searchValue); }).collect(Collectors.toList()); } @@ -593,7 +597,7 @@ public class PartnerOwnController extends BaseController { @PostMapping("/addCustomerSource") public CommonResult addCustomerSource(@RequestBody SysDictData dictData) throws Exception { ShopMallPartners partners = partnerList.shopInfo(); - String dictStr = "customer_source-"+partners.getPartnerId(); + String dictStr = "customer_source-" + partners.getPartnerId(); DictTypeDO sysDictType = dictTypeService.getDictType(dictStr); DictDataSaveReqVO dictSave = new DictDataSaveReqVO(); @@ -609,52 +613,51 @@ public class PartnerOwnController extends BaseController { //新增客户来源 @PostMapping("/delCustomerSource") - public CommonResult delCustomerSource(Long dictId){ + public CommonResult delCustomerSource(Long dictId) { dictDataService.deleteDictData(dictId); return success(); } + //批量删除客户来源 @PostMapping("/delCustomerSourceBatch") - public CommonResult delCustomerSourceBatch(@RequestBody List dictIds){ + public CommonResult delCustomerSourceBatch(@RequestBody List dictIds) { dictDataService.deleteDictDataBatch(dictIds); return success(); } @PostMapping("/vehicleLicenseOCR") - public CommonResult vehicleLicenseOCR(String imagePath) throws Exception - { + public CommonResult vehicleLicenseOCR(String imagePath) throws Exception { return success(partnerList.vehicleLicenseOCR(imagePath)); } + //线下收费 @PostMapping("/offlineCharging") - public CommonResult offlineCharging(@RequestBody InspectionInfoVo infoVo) - { + public CommonResult offlineCharging(@RequestBody InspectionInfoVo infoVo) { partnerList.offlineCharging(infoVo); return success(); } - //获取收款账号 @GetMapping("/getBankAccountList") public CommonResult getBankAccountList(String searchValue) throws Exception { ShopMallPartners partners = partnerList.shopInfoByUserId(); - String dictStr = "partner_bankList-"+partners.getPartnerId(); + String dictStr = "partner_bankList-" + partners.getPartnerId(); DictTypeDO sysDictType = dictTypeService.getDictType(dictStr); - if (ObjectUtil.isEmpty(sysDictType)){ + if (ObjectUtil.isEmpty(sysDictType)) { //初始化 - DictTypeSaveReqVO sysDictTypeSave =new DictTypeSaveReqVO(); - sysDictTypeSave.setName("收款账户-"+partners.getPartnerName()); + DictTypeSaveReqVO sysDictTypeSave = new DictTypeSaveReqVO(); + sysDictTypeSave.setName("收款账户-" + partners.getPartnerName()); sysDictTypeSave.setStatus(0); sysDictTypeSave.setType(dictStr); dictTypeService.createDictType(sysDictTypeSave); } List dataList = dictDataService.getDictDataListByDictType(dictStr); - if (CollectionUtil.isEmpty(dataList)){ - dataList =new ArrayList<>(); + if (CollectionUtil.isEmpty(dataList)) { + dataList = new ArrayList<>(); } - if (StringUtils.isNotEmpty(searchValue)){ - dataList = dataList.stream().filter(it->{ + if (StringUtils.isNotEmpty(searchValue)) { + dataList = dataList.stream().filter(it -> { return it.getLabel().contains(searchValue); }).collect(Collectors.toList()); } @@ -665,7 +668,7 @@ public class PartnerOwnController extends BaseController { @PostMapping("/addBankAccount") public CommonResult addBankAccount(@RequestBody SysDictData dictData) throws Exception { ShopMallPartners partners = partnerList.shopInfo(); - String dictStr = "partner_bankList-"+partners.getPartnerId(); + String dictStr = "partner_bankList-" + partners.getPartnerId(); DictTypeDO sysDictType = dictTypeService.getDictType(dictStr); DictDataSaveReqVO dictSave = new DictDataSaveReqVO(); @@ -682,83 +685,90 @@ public class PartnerOwnController extends BaseController { //删除银行卡账户 @PostMapping("/delBankAccount") - public CommonResult delBankAccount(Long dictId){ + public CommonResult delBankAccount(Long dictId) { dictDataService.deleteDictData(dictId); return success(); } //工单预览 @GetMapping("/workOrderView") - public CommonResult workOrderView(Long inspectionId){ + public CommonResult workOrderView(Long inspectionId) { return success(partnerList.workOrderView(inspectionId)); } //岗位信息 @GetMapping("/inspectionPostInfo") - public CommonResult inspectionPostInfo(){ + public CommonResult inspectionPostInfo() { return success(partnerList.inspectionPostInfo()); } //统计表格1 @GetMapping("/staticsTable1") - public CommonResult staticsTable1(String startTime,String endTime) throws Exception { + public CommonResult staticsTable1(String startTime, String endTime) throws Exception { 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)); + public CommonResult newStaticsTable1(String startTime, String endTime) throws Exception { + return success(partnerList.newStaticsTable1(startTime, endTime)); } //统计表格2 @GetMapping("/staticsTable2") - public CommonResult staticsTable2(String startTime,String endTime) throws Exception { + public CommonResult staticsTable2(String startTime, String endTime) throws Exception { 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)); + 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 { + public CommonResult staticsTable3(String startTime, String endTime) throws Exception { 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)); + 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 { + public CommonResult staticsTable3Detail(String startTime, String endTime, String remark) throws Exception { ShopMallPartners partners = partnerList.shopInfo(); - return success(partnerList.staticsTable3Detail(partners.getPartnerId(),startTime,endTime,remark)); + return success(partnerList.staticsTable3Detail(partners.getPartnerId(), startTime, endTime, remark)); } + //统计表格4 @GetMapping("/staticsTable4") - public CommonResult staticsTable4(String startTime,String endTime) throws Exception { + public CommonResult staticsTable4(String startTime, String endTime) throws Exception { ShopMallPartners partners = partnerList.shopInfo(); - return success(partnerList.staticsTable4(partners.getPartnerId(),startTime,endTime)); + return success(partnerList.staticsTable4(partners.getPartnerId(), startTime, endTime)); } + //统计表格5 @GetMapping("/staticsTable5") - public CommonResult staticsTable5(String startTime,String endTime) throws Exception { + public CommonResult staticsTable5(String startTime, String endTime) throws Exception { ShopMallPartners partners = partnerList.shopInfo(); - return success(partnerList.staticsTable5(partners.getPartnerId(),startTime,endTime)); + return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime)); } /** * 根据inspection_info的id查有的项目名称 * + * @param ids inspection_info的id * @author 小李 * @date 14:52 2024/12/10 - * @param ids inspection_info的id - **/ + **/ @GetMapping("/getProjectByIds") public CommonResult getProjectByIds(Long[] ids) { return success(partnerList.getProjectByIds(ids)); @@ -767,19 +777,36 @@ public class PartnerOwnController extends BaseController { /** * 根据时间查订单 * + * @param startTime 开始时间 非必传 + * @param endTime 结束时间 非必传 + * @param pageNum 页码 + * @param pageSize 条数 * @author 小李 * @date 14:39 2024/12/12 - * @param startTime 开始时间 非必传 - * @param endTime 结束时间 非必传 - * @param pageNum 页码 - * @param pageSize 条数 - **/ + **/ @GetMapping("/getOrderByDate") public CommonResult getOrderByDate(@RequestParam(value = "startTime", required = false) String startTime, - @RequestParam(value = "endTime", required = false) String endTime, - @RequestParam(value = "pageNum", defaultValue = "1")Integer pageNum, - @RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){ + @RequestParam(value = "endTime", required = false) String endTime, + @RequestParam(value = "chooseStatus", required = false) String chooseStatus, + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { Page page = new Page<>(pageNum, pageSize); - return success(partnerList.getOrderByDate(startTime, endTime, page)); + return success(partnerList.getOrderByDate(startTime, endTime, chooseStatus, page)); + } + + /** + * 分类计数 + * + * @author 小李 + * @date 17:14 2024/12/16 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param chooseStatus 状态 + **/ + @GetMapping("/getTypeCount") + public CommonResult getTypeCount(@RequestParam(value = "startTime", required = false) String startTime, + @RequestParam(value = "endTime", required = false) String endTime, + @RequestParam(value = "chooseStatus", required = false) String chooseStatus){ + return success(partnerList.getTypeCount(startTime, endTime, chooseStatus)); } } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java index d7395458..a92b2c7c 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/AppInspectionPartnerMapper.java @@ -74,5 +74,16 @@ public interface AppInspectionPartnerMapper extends BaseMapper * @param startTime 开始时间 非必传 * @param endTime 结束时间 非必传 **/ - IPage getOrderByDate(@Param("startTime") String startTime, @Param("endTime") String endTime, Page page); + IPage getOrderByDate(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("chooseStatus") String chooseStatus, Page page); + + /** + * 分类计数 + * + * @author 小李 + * @date 17:14 2024/12/16 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param chooseStatus 状态 + **/ + List> getTypeCount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("chooseStatus") String chooseStatus); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java index 40f5de69..c003fae6 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java @@ -128,5 +128,16 @@ public interface AppInspectionPartnerService extends IService * @param startTime 开始时间 非必传 * @param endTime 结束时间 非必传 **/ - IPage getOrderByDate(String startTime, String endTime, Page page); + IPage getOrderByDate(String startTime, String endTime, String chooseStatus, Page page); + + /** + * 分类计数 + * + * @author 小李 + * @date 17:14 2024/12/16 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param chooseStatus 状态 + **/ + Map getTypeCount(String startTime, String endTime, String chooseStatus); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 287c7e16..e6d3effc 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1951,13 +1951,34 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl getOrderByDate(String startTime, String endTime, Page page){ + public IPage getOrderByDate(String startTime, String endTime, String chooseStatus, Page page){ 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"; - return baseMapper.getOrderByDate(startTime, endTime, page); + return baseMapper.getOrderByDate(startTime, endTime, chooseStatus, page); + } + + /** + * 分类计数 + * + * @author 小李 + * @date 17:14 2024/12/16 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @param chooseStatus 状态 + **/ + @Override + public Map getTypeCount(String startTime, String endTime, String chooseStatus){ + 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> typeCount = baseMapper.getTypeCount(startTime, endTime, chooseStatus); + return typeCount.stream().collect(Collectors.toMap(map -> String.valueOf(map.get("type")), map -> map.get("count"))); } } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml index ac3443fa..bb20c90c 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/AppInspectionPartnerMapper.xml @@ -574,6 +574,78 @@ FROM ii.id = iwn_agg.inspection_info_id WHERE oi.create_time BETWEEN #{startTime} AND #{endTime} AND oi.deleted = '0') t + + + + t.status = '检测中' + + + t.status = '已完成' + + + ORDER BY t.create_time DESC + +