Compare commits
No commits in common. "8b058ad67e1e57670064012fc1f5a3919cec16c6" and "6e18a910b85c1313800c4052ed24d9b0fa6ca9f1" have entirely different histories.
8b058ad67e
...
6e18a910b8
@ -26,7 +26,6 @@ import javax.annotation.Resource;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -62,8 +61,6 @@ public class WorkReportServiceImpl extends ServiceImpl<WorkReportMapper, WorkRep
|
|||||||
public Integer createReport(WorkReportSaveReqVO createReqVO) {
|
public Integer createReport(WorkReportSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
WorkReport report = BeanUtils.toBean(createReqVO, WorkReport.class);
|
WorkReport report = BeanUtils.toBean(createReqVO, WorkReport.class);
|
||||||
// 设置汇报时间位当前时间
|
|
||||||
report.setReportTime(LocalDateTime.now());
|
|
||||||
|
|
||||||
// 将汇报对象集合转换为字符串
|
// 将汇报对象集合转换为字符串
|
||||||
report.setReportTo(createReqVO.getReportTos().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
report.setReportTo(createReqVO.getReportTos().stream().map(String::valueOf).collect(Collectors.joining(",")));
|
||||||
|
|||||||
@ -372,8 +372,8 @@ public class PartnerOwnController extends BaseController {
|
|||||||
* 店铺核销功能
|
* 店铺核销功能
|
||||||
*/
|
*/
|
||||||
@PostMapping("/takeOut")
|
@PostMapping("/takeOut")
|
||||||
public CommonResult takeOut(@RequestBody InspectionInfo inspectionInfo) throws Exception {
|
public CommonResult takeOut(Long partnerId, Long orderId, Long workId, String carNum) throws Exception {
|
||||||
partnerList.takeOut(inspectionInfo);
|
partnerList.takeOut(partnerId, orderId, workId, carNum);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,857 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.inspection.controller.app;
|
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|
||||||
import cn.iocoder.yudao.module.core.controller.BaseController;
|
|
||||||
import cn.iocoder.yudao.module.inspection.entity.*;
|
|
||||||
import cn.iocoder.yudao.module.inspection.query.OrderTableQuery;
|
|
||||||
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
|
||||||
import cn.iocoder.yudao.module.inspection.vo.*;
|
|
||||||
import cn.iocoder.yudao.module.partner.entity.PartnerBalanceDetail;
|
|
||||||
import cn.iocoder.yudao.module.partner.entity.PartnerWorker;
|
|
||||||
import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
|
||||||
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
|
||||||
import cn.iocoder.yudao.module.shop.entity.ShopCouponTemplate;
|
|
||||||
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO;
|
|
||||||
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
|
||||||
import cn.iocoder.yudao.module.system.service.dict.DictTypeService;
|
|
||||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
|
||||||
import cn.iocoder.yudao.util.StringUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/partnerOwn/partner")
|
|
||||||
public class AppPartnerOwnController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
private AppInspectionPartnerService partnerList;
|
|
||||||
@Autowired
|
|
||||||
private IPartnerWorkerService partnerWorkerService;
|
|
||||||
@Autowired
|
|
||||||
private DictTypeService dictTypeService;
|
|
||||||
@Autowired
|
|
||||||
private DictDataService dictDataService;
|
|
||||||
@Autowired
|
|
||||||
private RoleService roleService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取店铺详情
|
|
||||||
*/
|
|
||||||
@GetMapping("/shopInfo")
|
|
||||||
public CommonResult shopInfo() throws Exception {
|
|
||||||
return success(partnerList.shopInfo());
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/shopInfoByUserId")
|
|
||||||
public CommonResult shopInfoByUserId() throws Exception {
|
|
||||||
return success(partnerList.shopInfoByUserId());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取上门取车 和 预约条数
|
|
||||||
*/
|
|
||||||
@GetMapping("/getAppointAndPickNum")
|
|
||||||
public CommonResult getAppointAndPickNum() throws Exception {
|
|
||||||
return success(partnerList.getAppointAndPickNum());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 开始或者停止营业
|
|
||||||
*/
|
|
||||||
@PostMapping("/startOrEnd")
|
|
||||||
public CommonResult startOrEnd(Long partnerId) {
|
|
||||||
partnerList.startOrEnd(partnerId);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页 顶部数据统计
|
|
||||||
*/
|
|
||||||
@GetMapping("/statisticsInfo")
|
|
||||||
public CommonResult statisticsInfo() {
|
|
||||||
return success(partnerList.statisticsInfo(null));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测线图
|
|
||||||
*/
|
|
||||||
@GetMapping("/chartInfoAmount")
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* staticsTable1
|
|
||||||
* 检测数量折线图
|
|
||||||
*/
|
|
||||||
@GetMapping("/chartLineInspectionNum")
|
|
||||||
public CommonResult chartLineInspectionNum(Long partnerId, String unit) {
|
|
||||||
return success(partnerList.chartLineInspectionNum(partnerId, unit));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* staticsTable1
|
|
||||||
* 新检测数量折线图
|
|
||||||
*/
|
|
||||||
@GetMapping("/newChartLineInspectionNum")
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新检测金额折线图
|
|
||||||
*/
|
|
||||||
@GetMapping("/newChartLineInspectionAmount")
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新检测线图
|
|
||||||
*/
|
|
||||||
@GetMapping("/newChartInfoNum")
|
|
||||||
public CommonResult newChartInfoNum(String unit) {
|
|
||||||
return success(partnerList.newChartInfoNum(unit));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检测线图
|
|
||||||
*/
|
|
||||||
@GetMapping("/chartInfoRatio")
|
|
||||||
public CommonResult chartInfoRatio(Long partnerId, String unit) throws Exception {
|
|
||||||
if (ObjectUtil.isNull(partnerId)) {
|
|
||||||
partnerId = partnerList.shopInfoByUserId().getPartnerId();
|
|
||||||
}
|
|
||||||
return success(partnerList.chartInfoRatio(partnerId, unit));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新检测线图
|
|
||||||
*/
|
|
||||||
@GetMapping("/newChartInfoRatio")
|
|
||||||
public CommonResult newChartInfoRatio(String unit) {
|
|
||||||
return success(partnerList.newChartInfoRatio(unit));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 首页 订单信息
|
|
||||||
*/
|
|
||||||
@GetMapping("/orderInfo")
|
|
||||||
public CommonResult orderInfo(Long partnerId) {
|
|
||||||
return success(partnerList.orderInfo(partnerId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 热销商品列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/hotGoodsList")
|
|
||||||
public CommonResult hotGoodsList(Long partnerId) {
|
|
||||||
return success(partnerList.hotGoodsList(partnerId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 热销商品列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/newHotGoodsList")
|
|
||||||
public CommonResult newHotGoodsList() {
|
|
||||||
return success(partnerList.newHotGoodsList());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询所有数据
|
|
||||||
*
|
|
||||||
* @return 所有数据
|
|
||||||
*/
|
|
||||||
@GetMapping("/categoryList")
|
|
||||||
public CommonResult categoryList(Long partnerId) {
|
|
||||||
|
|
||||||
return success(partnerList.categoryList(partnerId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发布商品
|
|
||||||
*/
|
|
||||||
@PostMapping("/addGoods")
|
|
||||||
public CommonResult addGoods(@RequestBody ShopInspectionGoods goods) throws Exception {
|
|
||||||
partnerList.addGoods(goods);
|
|
||||||
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) {
|
|
||||||
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
// ShopMallPartners partners = partnerList.getById(partnerId);
|
|
||||||
// if (!partners.getUserId().equals(user.getId())) {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
Page<GoodsVo> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<GoodsVo> list = partnerList.goodsList(page, partnerId, isListing, goodsTitle);
|
|
||||||
return success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品管理列表
|
|
||||||
*/
|
|
||||||
@GetMapping("/canUsegoods")
|
|
||||||
public CommonResult canUseGoods(Long partnerId) {
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
ShopMallPartners partners = partnerList.getById(partnerId);
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改商品
|
|
||||||
*/
|
|
||||||
@PostMapping("/editGoods")
|
|
||||||
public CommonResult editGoods(@RequestBody ShopInspectionGoods goods) throws Exception {
|
|
||||||
partnerList.editGoods(goods);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/editSkuPrice")
|
|
||||||
public CommonResult editSkuPrice(@RequestBody ShopInspectionGoods goods) throws Exception {
|
|
||||||
partnerList.editSkuPrice(goods);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上下架
|
|
||||||
*/
|
|
||||||
@PostMapping("/changeListing")
|
|
||||||
public CommonResult changeListing(Long goodsId) throws Exception {
|
|
||||||
partnerList.changeListing(goodsId);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除商品
|
|
||||||
*/
|
|
||||||
@PostMapping("/delGoods")
|
|
||||||
public CommonResult delGoods(Long goodsId) throws Exception {
|
|
||||||
partnerList.delGoods(goodsId);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理店铺信息
|
|
||||||
*/
|
|
||||||
@PostMapping("/getPartnerInfo")
|
|
||||||
public CommonResult getPartnerInfo(Long partnerId) {
|
|
||||||
return success(partnerList.getPartnerInfo(partnerId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理店铺信息
|
|
||||||
*/
|
|
||||||
@PostMapping("/editPartnerInfo")
|
|
||||||
public CommonResult editPartnerInfo(@RequestBody ShopMallPartners partners) {
|
|
||||||
partnerList.editPartnerInfo(partners);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺账户信息
|
|
||||||
*/
|
|
||||||
@GetMapping("/accountInfo")
|
|
||||||
public CommonResult accountInfo(Long partnerId) {
|
|
||||||
return success(partnerList.accountInfo(partnerId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺账户信息
|
|
||||||
*/
|
|
||||||
@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) {
|
|
||||||
Page<PartnerBalanceDetail> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<PartnerBalanceDetail> 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) {
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
|
||||||
if (!partnersTmp.getUserId().equals(user.getId())) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Page<OrderAppDetail> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<OrderAppDetail> 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前的订单信息
|
|
||||||
*/
|
|
||||||
@GetMapping("/orderDetail")
|
|
||||||
public CommonResult orderDetail(Long partnerId, Long orderId) {
|
|
||||||
OrderAppDetail orderInfos = partnerList.orderDetail(partnerId, orderId);
|
|
||||||
return success(orderInfos);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺核销功能
|
|
||||||
*/
|
|
||||||
@PostMapping("/takeOut")
|
|
||||||
public CommonResult takeOut(@RequestBody InspectionInfo inspectionInfo) throws Exception {
|
|
||||||
partnerList.takeOut(inspectionInfo);
|
|
||||||
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<IPage<?>> 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())){
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
/*获取检测的用户*/
|
|
||||||
RolePageReqVO reqVO = new RolePageReqVO();
|
|
||||||
reqVO.setPageNo(pageNum);
|
|
||||||
reqVO.setNickname(workName);
|
|
||||||
reqVO.setPageSize(pageSize);
|
|
||||||
IPage<UserDTO> userDTOIPage = roleService.selectListByRoleId(reqVO);
|
|
||||||
// Page<LabelRespVO> page = new Page<>(pageNum, pageSize);
|
|
||||||
// IPage<PartnerWorker> workList = partnerList.pageWorkList(partnerId,postId, workName, phoneNum,page);
|
|
||||||
return CommonResult.success(userDTOIPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/delWorker")
|
|
||||||
public CommonResult delWorker(Long partnerId, String workIdStr) {
|
|
||||||
String[] workIds = workIdStr.split(",");
|
|
||||||
for (String workId : workIds) {
|
|
||||||
partnerList.delWorker(partnerId, Long.parseLong(workId));
|
|
||||||
}
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取检测的数据
|
|
||||||
@GetMapping("/inspectionList")
|
|
||||||
public CommonResult inspectionList(Long partnerId, String status, String carNum, Integer pageSize, Integer pageNum) throws Exception {
|
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
|
||||||
if (!partnerId.equals(partners.getPartnerId())) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Page<InspectionInfo> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<InspectionInfo> inspectionInfos = partnerList.inspectionList(page, partnerId, status, carNum);
|
|
||||||
return success(inspectionInfos);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取检测的详细信息
|
|
||||||
@GetMapping("/inspectionDetail")
|
|
||||||
public CommonResult inspectionDetail(Long inspectionInfoId) {
|
|
||||||
return CommonResult.success(partnerList.inspectionDetail(inspectionInfoId));
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取检测的数据
|
|
||||||
@GetMapping("/workerInspectionList")
|
|
||||||
public CommonResult workerInspectionList(Long partnerId, String status, String searchValue, Integer pageSize, Integer pageNum) {
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
LambdaQueryWrapper<PartnerWorker> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(PartnerWorker::getUserId, user.getId()).eq(PartnerWorker::getPartnerId, partnerId);
|
|
||||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapper);
|
|
||||||
if (ObjectUtil.isEmpty(worker)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Page<InspectionInfo> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<InspectionInfo> 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) {
|
|
||||||
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
// ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
|
||||||
// if (!partnersTmp.getUserId().equals(user.getId())){
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
Page<InspectionAppointment> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<InspectionAppointment> appointments = partnerList.getAppointmentList(page, partnerId, phoneNum);
|
|
||||||
return success(appointments);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取上门取车数据
|
|
||||||
@GetMapping("/getPickCarList")
|
|
||||||
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<InspectionPickCar> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarList(page, partnerId, phoneNum, pickStatus);
|
|
||||||
return success(pickCarList);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取上门取车详情页
|
|
||||||
@GetMapping("/getPickCarDetail")
|
|
||||||
public CommonResult getPickCarDetail(Long dataId) {
|
|
||||||
InspectionPickCar pickCar = partnerList.getPickCarDetail(dataId);
|
|
||||||
return success(pickCar);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 核销记录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) {
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
|
||||||
if (!partnersTmp.getUserId().equals(user.getId())) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<OrderInfo> orderInfos = partnerList.validationList(page, partnerId, searchValue);
|
|
||||||
return success(orderInfos);
|
|
||||||
}
|
|
||||||
|
|
||||||
//送券功能
|
|
||||||
@PostMapping("/sendCoupon")
|
|
||||||
public CommonResult sendCoupon(@RequestBody ShopCouponTemplate template) throws Exception {
|
|
||||||
partnerList.sendCoupon(template);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
//优惠券列表
|
|
||||||
@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) {
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
|
||||||
if (!partnersTmp.getUserId().equals(user.getId())) {
|
|
||||||
return success(new ArrayList<>());
|
|
||||||
}
|
|
||||||
Page<ShopCouponTemplate> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<ShopCouponTemplate> shopCouponTemplates = partnerList.listCoupon(page, partnerId, searchValue);
|
|
||||||
return success(shopCouponTemplates);
|
|
||||||
}
|
|
||||||
|
|
||||||
//删除优惠券
|
|
||||||
@PostMapping("/delCoupon")
|
|
||||||
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);
|
|
||||||
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) {
|
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
|
||||||
// .eq(PartnerWorker::getUserId,user.getId())
|
|
||||||
// LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
|
||||||
// queryWrapper.eq(PartnerWorker::getPartnerId,partnerId);
|
|
||||||
// PartnerWorker worker = partnerWorkerService.getOne(queryWrapper);
|
|
||||||
// if (ObjectUtil.isEmpty(worker)){
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
Page<InspectionPickCar> page = new Page<>(pageNum, pageSize);
|
|
||||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarListOfWorker(page, user.getId(), phoneNum);
|
|
||||||
return success(pickCarList);
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取客户来源
|
|
||||||
@GetMapping("/getCustomerSource")
|
|
||||||
public CommonResult getCustomerSource(String searchValue) throws Exception {
|
|
||||||
ShopMallPartners partners = partnerList.shopInfoByUserId();
|
|
||||||
String dictStr = "customer_source-" + partners.getPartnerId();
|
|
||||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
|
||||||
if (ObjectUtil.isEmpty(sysDictType)) {
|
|
||||||
//初始化
|
|
||||||
DictTypeSaveReqVO save = new DictTypeSaveReqVO();
|
|
||||||
save.setName("客户来源-" + partners.getPartnerName());
|
|
||||||
save.setStatus(0);
|
|
||||||
save.setType(dictStr);
|
|
||||||
dictTypeService.createDictType(save);
|
|
||||||
}
|
|
||||||
List<DictDataDO> dataList = dictDataService.getDictDataListByDictType(dictStr);
|
|
||||||
if (CollectionUtil.isEmpty(dataList)) {
|
|
||||||
dataList = new ArrayList<>();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(searchValue)) {
|
|
||||||
dataList = dataList.stream().filter(it -> {
|
|
||||||
return it.getLabel().contains(searchValue);
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
return success(dataList);
|
|
||||||
}
|
|
||||||
|
|
||||||
//新增客户来源
|
|
||||||
@PostMapping("/addCustomerSource")
|
|
||||||
public CommonResult addCustomerSource(@RequestBody SysDictData dictData) throws Exception {
|
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
|
||||||
String dictStr = "customer_source-" + partners.getPartnerId();
|
|
||||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
|
||||||
|
|
||||||
DictDataSaveReqVO dictSave = new DictDataSaveReqVO();
|
|
||||||
dictSave.setLabel(dictData.getDictLabel());
|
|
||||||
dictSave.setDictType(sysDictType.getType());
|
|
||||||
dictSave.setStatus(0);
|
|
||||||
dictSave.setValue(dictData.getDictLabel());
|
|
||||||
dictSave.setCssClass("default");
|
|
||||||
dictSave.setRemark(dictData.getRemark());
|
|
||||||
dictDataService.createDictData(dictSave);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
//新增客户来源
|
|
||||||
@PostMapping("/delCustomerSource")
|
|
||||||
public CommonResult delCustomerSource(Long dictId) {
|
|
||||||
dictDataService.deleteDictData(dictId);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
//批量删除客户来源
|
|
||||||
@PostMapping("/delCustomerSourceBatch")
|
|
||||||
public CommonResult delCustomerSourceBatch(@RequestBody List<Long> dictIds) {
|
|
||||||
dictDataService.deleteDictDataBatch(dictIds);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/vehicleLicenseOCR")
|
|
||||||
public CommonResult vehicleLicenseOCR(String imagePath) throws Exception {
|
|
||||||
return success(partnerList.vehicleLicenseOCR(imagePath));
|
|
||||||
}
|
|
||||||
|
|
||||||
//线下收费
|
|
||||||
@PostMapping("/offlineCharging")
|
|
||||||
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();
|
|
||||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
|
||||||
if (ObjectUtil.isEmpty(sysDictType)) {
|
|
||||||
//初始化
|
|
||||||
DictTypeSaveReqVO sysDictTypeSave = new DictTypeSaveReqVO();
|
|
||||||
sysDictTypeSave.setName("收款账户-" + partners.getPartnerName());
|
|
||||||
sysDictTypeSave.setStatus(0);
|
|
||||||
sysDictTypeSave.setType(dictStr);
|
|
||||||
dictTypeService.createDictType(sysDictTypeSave);
|
|
||||||
}
|
|
||||||
List<DictDataDO> dataList = dictDataService.getDictDataListByDictType(dictStr);
|
|
||||||
if (CollectionUtil.isEmpty(dataList)) {
|
|
||||||
dataList = new ArrayList<>();
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotEmpty(searchValue)) {
|
|
||||||
dataList = dataList.stream().filter(it -> {
|
|
||||||
return it.getLabel().contains(searchValue);
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
return success(dataList);
|
|
||||||
}
|
|
||||||
|
|
||||||
//新增银行卡账户
|
|
||||||
@PostMapping("/addBankAccount")
|
|
||||||
public CommonResult addBankAccount(@RequestBody SysDictData dictData) throws Exception {
|
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
|
||||||
String dictStr = "partner_bankList-" + partners.getPartnerId();
|
|
||||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
|
||||||
|
|
||||||
DictDataSaveReqVO dictSave = new DictDataSaveReqVO();
|
|
||||||
|
|
||||||
dictSave.setDictType(sysDictType.getType());
|
|
||||||
dictSave.setStatus(0);
|
|
||||||
dictSave.setLabel(dictData.getDictLabel());
|
|
||||||
dictSave.setValue(dictData.getDictValue());
|
|
||||||
dictSave.setRemark(dictData.getRemark());
|
|
||||||
dictSave.setCssClass("default");
|
|
||||||
dictDataService.createDictData(dictSave);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
//删除银行卡账户
|
|
||||||
@PostMapping("/delBankAccount")
|
|
||||||
public CommonResult delBankAccount(Long dictId) {
|
|
||||||
dictDataService.deleteDictData(dictId);
|
|
||||||
return success();
|
|
||||||
}
|
|
||||||
|
|
||||||
//工单预览
|
|
||||||
@GetMapping("/workOrderView")
|
|
||||||
public CommonResult workOrderView(Long inspectionId) {
|
|
||||||
return success(partnerList.workOrderView(inspectionId));
|
|
||||||
}
|
|
||||||
|
|
||||||
//岗位信息
|
|
||||||
@GetMapping("/inspectionPostInfo")
|
|
||||||
public CommonResult inspectionPostInfo() {
|
|
||||||
return success(partnerList.inspectionPostInfo());
|
|
||||||
}
|
|
||||||
|
|
||||||
//统计表格1
|
|
||||||
@GetMapping("/staticsTable1")
|
|
||||||
public CommonResult staticsTable1(String startTime, String endTime) throws Exception {
|
|
||||||
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")
|
|
||||||
public CommonResult staticsTable2(String startTime, String endTime) throws Exception {
|
|
||||||
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 {
|
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
|
||||||
return success(partnerList.staticsTable3Detail(partners.getPartnerId(), startTime, endTime, remark));
|
|
||||||
}
|
|
||||||
|
|
||||||
//统计表格4
|
|
||||||
@GetMapping("/staticsTable4")
|
|
||||||
public CommonResult staticsTable4(String startTime, String endTime) throws Exception {
|
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
|
||||||
return success(partnerList.staticsTable4(partners.getPartnerId(), startTime, endTime));
|
|
||||||
}
|
|
||||||
|
|
||||||
//统计表格5
|
|
||||||
@GetMapping("/staticsTable5")
|
|
||||||
public CommonResult staticsTable5(String startTime, String endTime) throws Exception {
|
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
|
||||||
return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询检测类型统计
|
|
||||||
*
|
|
||||||
* @param startTime 开始时间
|
|
||||||
* @param endTime 结束时间
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@GetMapping("/queryInspectionSkuList")
|
|
||||||
public CommonResult<?> queryInspectionSkuList(String startTime, String endTime) {
|
|
||||||
if (StrUtil.isEmpty(startTime) || StrUtil.isEmpty(endTime)) {
|
|
||||||
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
||||||
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
||||||
}
|
|
||||||
return success(partnerList.queryInspectionSkuList(startTime, endTime));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据inspection_info的id查有的项目名称
|
|
||||||
*
|
|
||||||
* @param ids inspection_info的id
|
|
||||||
* @author 小李
|
|
||||||
* @date 14:52 2024/12/10
|
|
||||||
**/
|
|
||||||
@GetMapping("/getProjectByIds")
|
|
||||||
public CommonResult<?> getProjectByIds(Long[] ids) {
|
|
||||||
return success(partnerList.getProjectByIds(ids));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据时间查订单
|
|
||||||
*
|
|
||||||
* @param startTime 开始时间 非必传
|
|
||||||
* @param endTime 结束时间 非必传
|
|
||||||
* @param pageNum 页码
|
|
||||||
* @param pageSize 条数
|
|
||||||
* @author 小李
|
|
||||||
* @date 14:39 2024/12/12
|
|
||||||
**/
|
|
||||||
@GetMapping("/getOrderByDate")
|
|
||||||
public CommonResult<?> getOrderByDate(OrderTableQuery query,
|
|
||||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
|
||||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
|
||||||
Page<OrderTable> page = new Page<>(pageNum, pageSize);
|
|
||||||
return success(partnerList.getOrderByDate(query, page));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据时间查订单
|
|
||||||
*
|
|
||||||
* @param startTime 开始时间 非必传
|
|
||||||
* @param endTime 结束时间 非必传
|
|
||||||
* @param pageNum 页码
|
|
||||||
* @param pageSize 条数
|
|
||||||
* @author 小李
|
|
||||||
* @date 14:39 2024/12/12
|
|
||||||
**/
|
|
||||||
@GetMapping("/getOrderApp")
|
|
||||||
public CommonResult<?> getOrderApp(@RequestParam(value = "startTime", required = false) String startTime,
|
|
||||||
@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<OrderTable> page = new Page<>(pageNum, pageSize);
|
|
||||||
return success(partnerList.getOrderApp(startTime, endTime, chooseStatus, page));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分类计数
|
|
||||||
*
|
|
||||||
* @param startTime 开始时间
|
|
||||||
* @param endTime 结束时间
|
|
||||||
* @param chooseStatus 状态
|
|
||||||
* @author 小李
|
|
||||||
* @date 17:14 2024/12/16
|
|
||||||
**/
|
|
||||||
@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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取员工统计
|
|
||||||
*
|
|
||||||
* @param dlInspectionProject 项目
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@PostMapping("/getStaffCount")
|
|
||||||
public CommonResult<?> getStaffCount(@RequestBody DlInspectionProject dlInspectionProject) {
|
|
||||||
return success(partnerList.getStaffCount(dlInspectionProject));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -58,10 +58,4 @@ public class InspectionFile extends TenantBaseDO
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Map<String,Object> params;
|
private Map<String,Object> params;
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private boolean IsImage;
|
|
||||||
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String fileType;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -169,6 +169,4 @@ public class InspectionInfo extends TenantBaseDO
|
|||||||
private String leadManName;
|
private String leadManName;
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer additionalRecording;
|
private Integer additionalRecording;
|
||||||
@TableField(exist = false)
|
|
||||||
private String orderId;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,7 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
|||||||
|
|
||||||
Long orderDetailByCode(Long partnerId, String code) throws Exception;
|
Long orderDetailByCode(Long partnerId, String code) throws Exception;
|
||||||
|
|
||||||
void takeOut(InspectionInfo inspectionInfo) throws Exception;
|
void takeOut(Long partnerId, Long orderId, Long workId, String carNum) throws Exception;
|
||||||
|
|
||||||
void addWorker(Long partnerId, String realName, String phoneNum, Long postId) throws Exception;
|
void addWorker(Long partnerId, String realName, String phoneNum, Long postId) throws Exception;
|
||||||
|
|
||||||
|
|||||||
@ -99,8 +99,8 @@ public class AppInspectionOrderServiceImpl extends ServiceImpl<OrderInfoMapper,
|
|||||||
public InspectionInfoVo inspectionDetail(Long inspectionInfoId) {
|
public InspectionInfoVo inspectionDetail(Long inspectionInfoId) {
|
||||||
InspectionInfo info = infoService.getById(inspectionInfoId);
|
InspectionInfo info = infoService.getById(inspectionInfoId);
|
||||||
AdminUserRespDTO buyUser = userService.getUser(info.getUserId());
|
AdminUserRespDTO buyUser = userService.getUser(info.getUserId());
|
||||||
// PartnerWorker workerTmp = workerService.getById(info.getWorkId());
|
PartnerWorker workerTmp = workerService.getById(info.getWorkId());
|
||||||
AdminUserRespDTO worker = userService.getUser(info.getWorkId());
|
AdminUserRespDTO worker = userService.getUser(workerTmp.getUserId());
|
||||||
OrderInfo orderInfo = orderInfoService.getById(info.getInspectionOrderId());
|
OrderInfo orderInfo = orderInfoService.getById(info.getInspectionOrderId());
|
||||||
ShopInspectionGoods goods = goodsService.getById(orderInfo.getGoodsId());
|
ShopInspectionGoods goods = goodsService.getById(orderInfo.getGoodsId());
|
||||||
ShopInspectionCategory category = categoryService.getById(goods.getGoodsCategoryId());
|
ShopInspectionCategory category = categoryService.getById(goods.getGoodsCategoryId());
|
||||||
@ -109,12 +109,9 @@ public class AppInspectionOrderServiceImpl extends ServiceImpl<OrderInfoMapper,
|
|||||||
res.setGoodsImage(ObjectUtil.isEmpty(goods)?"":goods.getImage());
|
res.setGoodsImage(ObjectUtil.isEmpty(goods)?"":goods.getImage());
|
||||||
res.setStatus(info.getStatus());
|
res.setStatus(info.getStatus());
|
||||||
res.setIsPass(info.getIsPass());
|
res.setIsPass(info.getIsPass());
|
||||||
if (ObjectUtil.isNotEmpty(worker)) {
|
res.setWorkerAvatar(Optional.ofNullable(worker.getAvatar()).orElse(null));
|
||||||
res.setWorkerAvatar(worker.getAvatar() == null ? "" : worker.getAvatar());
|
res.setWorkerName(worker.getNickname());
|
||||||
res.setWorkerName(worker.getNickname());
|
res.setWorkerPhone(worker.getMobile());
|
||||||
res.setWorkerPhone(worker.getMobile());
|
|
||||||
}
|
|
||||||
|
|
||||||
res.setBuyUserName(Optional.ofNullable(buyUser.getNickname()).orElse(""));
|
res.setBuyUserName(Optional.ofNullable(buyUser.getNickname()).orElse(""));
|
||||||
res.setBuyUserPhone(buyUser.getMobile());
|
res.setBuyUserPhone(buyUser.getMobile());
|
||||||
res.setCarNum(info.getCarNum());
|
res.setCarNum(info.getCarNum());
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||||
import cn.iocoder.yudao.module.appBase.controller.admin.InspectionSocket;
|
|
||||||
import cn.iocoder.yudao.module.config.service.IInspSysConfigService;
|
import cn.iocoder.yudao.module.config.service.IInspSysConfigService;
|
||||||
import cn.iocoder.yudao.module.inspection.query.OrderTableQuery;
|
import cn.iocoder.yudao.module.inspection.query.OrderTableQuery;
|
||||||
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
||||||
@ -25,7 +24,6 @@ import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
|||||||
import cn.iocoder.yudao.module.payment.entity.OrderInfoDetail;
|
import cn.iocoder.yudao.module.payment.entity.OrderInfoDetail;
|
||||||
import cn.iocoder.yudao.module.payment.service.IOrderInfoDetailService;
|
import cn.iocoder.yudao.module.payment.service.IOrderInfoDetailService;
|
||||||
import cn.iocoder.yudao.module.shop.service.IShopMallPartnersService;
|
import cn.iocoder.yudao.module.shop.service.IShopMallPartnersService;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
||||||
@ -64,7 +62,6 @@ import cn.iocoder.yudao.module.shop.service.IShopUserCarService;
|
|||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@ -133,13 +130,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
private IShopMallPartnersService partnersService;
|
private IShopMallPartnersService partnersService;
|
||||||
@Resource
|
@Resource
|
||||||
private DlInspectionProjectService projectService;
|
private DlInspectionProjectService projectService;
|
||||||
@Autowired
|
|
||||||
@Lazy
|
|
||||||
private AppInspectionPartnerService appInspectionPartnerService;
|
|
||||||
@Autowired
|
|
||||||
private InspectionSocket inspectionSocket;
|
|
||||||
@Autowired
|
|
||||||
private IInspectionWorkNodeService workNodeService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
|
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
|
||||||
@ -1319,24 +1309,20 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void takeOut(InspectionInfo inspectionInfo) throws Exception {
|
public void takeOut(Long partnerId, Long orderId, Long workId, String carNum) throws Exception {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
ShopMallPartners partners = appInspectionPartnerService.shopInfoByUserId();
|
|
||||||
AdminUserDO user = userService.getUser(loginUser.getId());
|
AdminUserDO user = userService.getUser(loginUser.getId());
|
||||||
ShopMallPartners partnersTmp = baseMapper.selectById(partners.getPartnerId());
|
ShopMallPartners partnersTmp = baseMapper.selectById(partnerId);
|
||||||
if (!partnersTmp.getUserId().equals(user.getId())) {
|
if (!partnersTmp.getUserId().equals(user.getId())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
OrderInfo orderInfo = orderService.getById(inspectionInfo.getOrderId());
|
OrderInfo orderInfo = orderService.getById(orderId);
|
||||||
if (!orderInfo.getPartnerId().equals(partners.getPartnerId())) {
|
if (!orderInfo.getPartnerId().equals(partnerId)) {
|
||||||
throw new Exception("您无核销权限");
|
throw new Exception("您无核销权限");
|
||||||
}
|
}
|
||||||
if (!orderInfo.getOrderStatus().equals("1") && !ObjectUtil.isEmpty(orderInfo.getValidationTime())) {
|
if (!orderInfo.getOrderStatus().equals("1") && !ObjectUtil.isEmpty(orderInfo.getValidationTime())) {
|
||||||
throw new Exception("已核销请不要重复核销");
|
throw new Exception("已核销请不要重复核销");
|
||||||
}
|
}
|
||||||
if (CollUtil.isEmpty(inspectionInfo.getInspectionWorkNodes())) {
|
|
||||||
throw new Exception("请选择检测项目");
|
|
||||||
}
|
|
||||||
//处理订单信息
|
//处理订单信息
|
||||||
orderInfo.setOrderStatus("2");
|
orderInfo.setOrderStatus("2");
|
||||||
orderInfo.setValidationTime(new Date());
|
orderInfo.setValidationTime(new Date());
|
||||||
@ -1353,7 +1339,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
info.setUserId(orderInfo.getUserId());
|
info.setUserId(orderInfo.getUserId());
|
||||||
info.setPartnerId(orderInfo.getPartnerId());
|
info.setPartnerId(orderInfo.getPartnerId());
|
||||||
info.setInspectionOrderId(orderInfo.getId());
|
info.setInspectionOrderId(orderInfo.getId());
|
||||||
info.setCarNum(inspectionInfo.getCarNum());
|
info.setCarNum(carNum);
|
||||||
info.setCategoryId(goods.getGoodsCategoryId());
|
info.setCategoryId(goods.getGoodsCategoryId());
|
||||||
info.setYear(DateUtil.format(new Date(), "yyyy"));
|
info.setYear(DateUtil.format(new Date(), "yyyy"));
|
||||||
info.setMonth(DateUtil.format(new Date(), "yyyy-MM"));
|
info.setMonth(DateUtil.format(new Date(), "yyyy-MM"));
|
||||||
@ -1361,12 +1347,12 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
info.setStartTime(new Date());
|
info.setStartTime(new Date());
|
||||||
info.setStatus("0");
|
info.setStatus("0");
|
||||||
//获取修理工信息
|
//获取修理工信息
|
||||||
// PartnerWorker worker = partnerWorkerService.getById(workId);
|
PartnerWorker worker = partnerWorkerService.getById(workId);
|
||||||
AdminUserDO sysUser = userService.getUser(inspectionInfo.getWorkId());
|
AdminUserDO sysUser = userService.getUser(worker.getUserId());
|
||||||
info.setWorkerName(sysUser.getNickname());
|
info.setWorkerName(sysUser.getNickname());
|
||||||
info.setWorkerPhone(sysUser.getMobile());
|
info.setWorkerPhone(sysUser.getMobile());
|
||||||
info.setWorkerAvatar(sysUser.getAvatar());
|
info.setWorkerAvatar(sysUser.getAvatar());
|
||||||
info.setWorkId(inspectionInfo.getWorkId());
|
info.setWorkId(workId);
|
||||||
info.setCustomerSource("线上客户");
|
info.setCustomerSource("线上客户");
|
||||||
//20240327 追加字段
|
//20240327 追加字段
|
||||||
info.setOtherPhone(orderInfo.getOtherPhone());
|
info.setOtherPhone(orderInfo.getOtherPhone());
|
||||||
@ -1374,19 +1360,16 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
info.setIsPayOnline(orderInfo.getIsPayOnline());
|
info.setIsPayOnline(orderInfo.getIsPayOnline());
|
||||||
info.setIsPickCar(orderInfo.getIsPickCar());
|
info.setIsPickCar(orderInfo.getIsPickCar());
|
||||||
info.setRemark(orderInfo.getRemark());
|
info.setRemark(orderInfo.getRemark());
|
||||||
info.setCarNum(inspectionInfo.getCarNum());
|
info.setCarNum(orderInfo.getCarNo());
|
||||||
info.setBuyName(orderInfo.getRealName());
|
|
||||||
info.setBuyPhone(orderInfo.getPhonenumber());
|
|
||||||
info.setUserId(orderInfo.getUserId());
|
|
||||||
inspectionInfoService.save(info);
|
inspectionInfoService.save(info);
|
||||||
//增加客户信息
|
//增加客户信息
|
||||||
LambdaQueryWrapper<PartnerCustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PartnerCustomerInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(PartnerCustomerInfo::getPartnerId, partners.getPartnerId()).eq(PartnerCustomerInfo::getUserId, orderInfo.getUserId());
|
queryWrapper.eq(PartnerCustomerInfo::getPartnerId, partnerId).eq(PartnerCustomerInfo::getUserId, orderInfo.getUserId());
|
||||||
PartnerCustomerInfo customerInfo = customerInfoService.getOne(queryWrapper);
|
PartnerCustomerInfo customerInfo = customerInfoService.getOne(queryWrapper);
|
||||||
if (ObjectUtil.isEmpty(customerInfo)) {
|
if (ObjectUtil.isEmpty(customerInfo)) {
|
||||||
AdminUserDO buyUser = userService.getUser(orderInfo.getUserId());
|
AdminUserDO buyUser = userService.getUser(orderInfo.getUserId());
|
||||||
customerInfo = new PartnerCustomerInfo();
|
customerInfo = new PartnerCustomerInfo();
|
||||||
customerInfo.setPartnerId(partners.getPartnerId());
|
customerInfo.setPartnerId(partnerId);
|
||||||
customerInfo.setUserId(buyUser.getId());
|
customerInfo.setUserId(buyUser.getId());
|
||||||
customerInfo.setCustomerPhone(buyUser.getMobile());
|
customerInfo.setCustomerPhone(buyUser.getMobile());
|
||||||
customerInfo.setCustomerName(buyUser.getNickname());
|
customerInfo.setCustomerName(buyUser.getNickname());
|
||||||
@ -1395,11 +1378,11 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
customerInfoService.save(customerInfo);
|
customerInfoService.save(customerInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
// InspectionStepInfo stepInfo = new InspectionStepInfo();
|
InspectionStepInfo stepInfo = new InspectionStepInfo();
|
||||||
// stepInfo.setInspectionInfoId(info.getId().intValue());
|
stepInfo.setInspectionInfoId(info.getId().intValue());
|
||||||
// stepInfo.setContent("检测开始");
|
stepInfo.setContent("检测开始");
|
||||||
// stepInfo.setTitle("检测开始");
|
stepInfo.setTitle("检测开始");
|
||||||
// this.addStepInfo(stepInfo);
|
this.addStepInfo(stepInfo);
|
||||||
//开始检测短信发送
|
//开始检测短信发送
|
||||||
// 获取当前日期和时间
|
// 获取当前日期和时间
|
||||||
LocalDateTime currentTime = LocalDateTime.now();
|
LocalDateTime currentTime = LocalDateTime.now();
|
||||||
@ -1415,47 +1398,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
log.error(ignored.getMessage());
|
log.error(ignored.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
List<InspectionWorkNode> inspectionWorkNodes = inspectionInfo.getInspectionWorkNodes();
|
|
||||||
|
|
||||||
inspectionWorkNodes.stream().forEach(inspectionWorkNode -> {
|
|
||||||
//检测工单id
|
|
||||||
inspectionWorkNode.setInspectionInfoId(info.getId());
|
|
||||||
//设置开始时间与更新时间为null
|
|
||||||
inspectionWorkNode.setCreateTime(null);
|
|
||||||
inspectionWorkNode.setUpdateTime(null);
|
|
||||||
//将节点状态设置为未开始
|
|
||||||
inspectionWorkNode.setStatus("0");
|
|
||||||
inspectionWorkNode.setId(null);
|
|
||||||
});
|
|
||||||
workNodeService.saveBatch(inspectionWorkNodes);
|
|
||||||
//检测步骤表插入检测开始
|
|
||||||
InspectionStepInfo stepInfo = new InspectionStepInfo();
|
|
||||||
stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(info.getId())));
|
|
||||||
stepInfo.setTitle("检测开始");
|
|
||||||
stepInfo.setCreateTime(new Date());
|
|
||||||
stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
|
||||||
this.addStepInfo(stepInfo);
|
|
||||||
|
|
||||||
List<Integer> roleIds = new ArrayList<>();
|
|
||||||
/*获取所有的角色id*/
|
|
||||||
if (CollUtil.isNotEmpty(inspectionWorkNodes)) {
|
|
||||||
roleIds = inspectionWorkNodes.stream().map(inspectionWorkNode -> inspectionWorkNode.getRoleId()).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
//根据角色id获取所有用户
|
|
||||||
List<UserDTO> listByUserId = roleService.getListByUserIds(roleIds);
|
|
||||||
List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList());
|
|
||||||
if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())) {
|
|
||||||
ids.add(inspectionInfo.getLeadManId());
|
|
||||||
}
|
|
||||||
//给ids去重
|
|
||||||
ids = ids.stream().distinct().collect(Collectors.toList());
|
|
||||||
// 获取当前共单引车员的id
|
|
||||||
if (CollUtil.isNotEmpty(ids) && ObjectUtil.isNull(inspectionInfo.getAdditionalRecording())) {
|
|
||||||
for (Long id : ids) {
|
|
||||||
inspectionSocket.sendMessage("接工单", id.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import cn.hutool.core.bean.BeanUtil;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
import cn.iocoder.yudao.module.constant.InspectionConstants;
|
import cn.iocoder.yudao.module.constant.InspectionConstants;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
||||||
@ -16,7 +15,6 @@ import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
|||||||
import cn.iocoder.yudao.module.inspection.service.IWarnMessageService;
|
import cn.iocoder.yudao.module.inspection.service.IWarnMessageService;
|
||||||
import cn.iocoder.yudao.module.inspection.service.InspectionFileRecordService;
|
import cn.iocoder.yudao.module.inspection.service.InspectionFileRecordService;
|
||||||
import cn.iocoder.yudao.module.inspection.service.InspectionFileUserService;
|
import cn.iocoder.yudao.module.inspection.service.InspectionFileUserService;
|
||||||
import cn.iocoder.yudao.util.FileTypeUtils;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
@ -237,17 +235,7 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
|||||||
queryWrapper.like(InspectionFile::getFileName, inspectionFile.getFileName());
|
queryWrapper.like(InspectionFile::getFileName, inspectionFile.getFileName());
|
||||||
}
|
}
|
||||||
queryWrapper.orderBy(false, false, InspectionFile::getCreateTime);
|
queryWrapper.orderBy(false, false, InspectionFile::getCreateTime);
|
||||||
List<InspectionFile> fileList = this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
//判断文件是否是图片
|
|
||||||
fileList.forEach(file -> {
|
|
||||||
if (StrUtil.isNotEmpty(file.getFilePath())) {
|
|
||||||
boolean image = FileTypeUtils.isImage(file.getFilePath());
|
|
||||||
String fileType = FileTypeUtils.getFileType(file.getFilePath());
|
|
||||||
file.setIsImage(image);
|
|
||||||
file.setFileType(fileType);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return fileList;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -373,16 +361,6 @@ public class InspectionFileServiceImpl extends ServiceImpl<InspectionFileMapper,
|
|||||||
//模糊匹配对应名称
|
//模糊匹配对应名称
|
||||||
resultFiles = resultFiles.stream().filter(file -> file.getFileName().contains(inspectionFile.getFileName())).collect(Collectors.toSet());
|
resultFiles = resultFiles.stream().filter(file -> file.getFileName().contains(inspectionFile.getFileName())).collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断文件是否是图片
|
|
||||||
resultFiles.forEach(file -> {
|
|
||||||
if (StrUtil.isNotEmpty(file.getFilePath())) {
|
|
||||||
boolean image = FileTypeUtils.isImage(file.getFilePath());
|
|
||||||
String fileType = FileTypeUtils.getFileType(file.getFilePath());
|
|
||||||
file.setIsImage(image);
|
|
||||||
file.setFileType(fileType);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return resultFiles;
|
return resultFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -322,9 +322,6 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
inspectionWorkNodes.stream().forEach(inspectionWorkNode -> {
|
inspectionWorkNodes.stream().forEach(inspectionWorkNode -> {
|
||||||
//检测工单id
|
//检测工单id
|
||||||
inspectionWorkNode.setInspectionInfoId(inspectionInfo.getId());
|
inspectionWorkNode.setInspectionInfoId(inspectionInfo.getId());
|
||||||
//设置开始时间与更新时间为null
|
|
||||||
inspectionWorkNode.setCreateTime(null);
|
|
||||||
inspectionWorkNode.setUpdateTime(null);
|
|
||||||
//将节点状态设置为未开始
|
//将节点状态设置为未开始
|
||||||
inspectionWorkNode.setStatus("0");
|
inspectionWorkNode.setStatus("0");
|
||||||
});
|
});
|
||||||
@ -358,6 +355,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
inspectionSocket.sendMessage("接工单", id.toString());
|
inspectionSocket.sendMessage("接工单", id.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -398,16 +398,6 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
//冻结积分
|
//冻结积分
|
||||||
userBalanceService.frozenBalance(orderInfo.getBalance(), user.getId());
|
userBalanceService.frozenBalance(orderInfo.getBalance(), user.getId());
|
||||||
}
|
}
|
||||||
//修改预约记录表的orderId
|
|
||||||
if (ObjectUtil.isNotEmpty(orderInfo.getAppointmentId())) {
|
|
||||||
appointmentService.update(Wrappers.<InspectionAppointment>lambdaUpdate()
|
|
||||||
.eq(InspectionAppointment::getId, orderInfo.getAppointmentId())
|
|
||||||
.set(InspectionAppointment::getOrderId, createOrder.getId()));
|
|
||||||
//处理预约记录
|
|
||||||
orderInfo.setId(createOrder.getId());
|
|
||||||
this.dealAppointment(orderInfo);
|
|
||||||
|
|
||||||
}
|
|
||||||
return createOrder.getId();
|
return createOrder.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package cn.iocoder.yudao.util;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件类型工具类
|
* 文件类型工具类
|
||||||
@ -75,20 +74,4 @@ public class FileTypeUtils
|
|||||||
}
|
}
|
||||||
return strFileExtendName;
|
return strFileExtendName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isImage(String fileUrl) {
|
|
||||||
// 常见的图片文件扩展名
|
|
||||||
String[] imageExtensions = {".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp"};
|
|
||||||
|
|
||||||
// 将URL转换为小写以便比较
|
|
||||||
fileUrl = fileUrl.toLowerCase();
|
|
||||||
|
|
||||||
// 检查URL是否以图片扩展名结尾
|
|
||||||
for (String extension : imageExtensions) {
|
|
||||||
if (fileUrl.endsWith(extension)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
left JOIN order_info oi ON ip.order_id = oi.id and oi.deleted=0
|
left JOIN order_info oi ON ip.order_id = oi.id and oi.deleted=0
|
||||||
left join shop_user_car suc on suc.car_id = oi.user_car_id and suc.deleted=0
|
left join shop_user_car suc on suc.car_id = oi.user_car_id and suc.deleted=0
|
||||||
LEFT JOIN inspection_goods_sku igs on igs.id = ip.sku_id
|
LEFT JOIN inspection_goods_sku igs on igs.id = ip.sku_id
|
||||||
where ip.deleted=0 and ip.partner_id = #{partnerId} and oi.validation_time IS NULL
|
where ip.deleted=0 and ip.partner_id = #{partnerId}
|
||||||
<if test="phoneNum!=null and phoneNum!=''">
|
<if test="phoneNum!=null and phoneNum!=''">
|
||||||
and su.mobile like concat('%',#{phoneNum},'%')
|
and su.mobile like concat('%',#{phoneNum},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -88,61 +88,60 @@ public class DeptDataPermissionRule implements DataPermissionRule {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Expression getExpression(String tableName, Alias tableAlias) {
|
public Expression getExpression(String tableName, Alias tableAlias) {
|
||||||
return null;
|
// 只有有登陆用户的情况下,才进行数据权限的处理
|
||||||
// // 只有有登陆用户的情况下,才进行数据权限的处理
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
//
|
if (loginUser == null) {
|
||||||
// if (loginUser == null) {
|
return null;
|
||||||
// return null;
|
}
|
||||||
// }
|
// 只有管理员类型的用户,才进行数据权限的处理
|
||||||
// // 只有管理员类型的用户,才进行数据权限的处理
|
if (ObjectUtil.notEqual(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue())) {
|
||||||
// if (ObjectUtil.notEqual(loginUser.getUserType(), UserTypeEnum.ADMIN.getValue())) {
|
return null;
|
||||||
// return null;
|
}
|
||||||
// }
|
|
||||||
//
|
// 获得数据权限
|
||||||
// // 获得数据权限
|
DeptDataPermissionRespDTO deptDataPermission = loginUser.getContext(CONTEXT_KEY, DeptDataPermissionRespDTO.class);
|
||||||
// DeptDataPermissionRespDTO deptDataPermission = loginUser.getContext(CONTEXT_KEY, DeptDataPermissionRespDTO.class);
|
// 从上下文中拿不到,则调用逻辑进行获取
|
||||||
// // 从上下文中拿不到,则调用逻辑进行获取
|
if (deptDataPermission == null) {
|
||||||
// if (deptDataPermission == null) {
|
deptDataPermission = permissionApi.getDeptDataPermission(loginUser.getId());
|
||||||
// deptDataPermission = permissionApi.getDeptDataPermission(loginUser.getId());
|
if (deptDataPermission == null) {
|
||||||
// if (deptDataPermission == null) {
|
log.error("[getExpression][LoginUser({}) 获取数据权限为 null]", JsonUtils.toJsonString(loginUser));
|
||||||
// log.error("[getExpression][LoginUser({}) 获取数据权限为 null]", JsonUtils.toJsonString(loginUser));
|
throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 未返回数据权限",
|
||||||
// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 未返回数据权限",
|
loginUser.getId(), tableName, tableAlias.getName()));
|
||||||
// loginUser.getId(), tableName, tableAlias.getName()));
|
}
|
||||||
// }
|
// 添加到上下文中,避免重复计算
|
||||||
// // 添加到上下文中,避免重复计算
|
loginUser.setContext(CONTEXT_KEY, deptDataPermission);
|
||||||
// loginUser.setContext(CONTEXT_KEY, deptDataPermission);
|
}
|
||||||
// }
|
|
||||||
//
|
// 情况一,如果是 ALL 可查看全部,则无需拼接条件
|
||||||
// // 情况一,如果是 ALL 可查看全部,则无需拼接条件
|
if (deptDataPermission.getAll()) {
|
||||||
// if (deptDataPermission.getAll()) {
|
return null;
|
||||||
// return null;
|
}
|
||||||
// }
|
|
||||||
//
|
// 情况二,即不能查看部门,又不能查看自己,则说明 100% 无权限
|
||||||
// // 情况二,即不能查看部门,又不能查看自己,则说明 100% 无权限
|
if (CollUtil.isEmpty(deptDataPermission.getDeptIds())
|
||||||
// if (CollUtil.isEmpty(deptDataPermission.getDeptIds())
|
&& Boolean.FALSE.equals(deptDataPermission.getSelf())) {
|
||||||
// && Boolean.FALSE.equals(deptDataPermission.getSelf())) {
|
return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空
|
||||||
// return new EqualsTo(null, null); // WHERE null = null,可以保证返回的数据为空
|
}
|
||||||
// }
|
|
||||||
//
|
// 情况三,拼接 Dept 和 User 的条件,最后组合
|
||||||
// // 情况三,拼接 Dept 和 User 的条件,最后组合
|
Expression deptExpression = buildDeptExpression(tableName,tableAlias, deptDataPermission.getDeptIds());
|
||||||
// Expression deptExpression = buildDeptExpression(tableName,tableAlias, deptDataPermission.getDeptIds());
|
Expression userExpression = buildUserExpression(tableName, tableAlias, deptDataPermission.getSelf(), loginUser.getId());
|
||||||
// Expression userExpression = buildUserExpression(tableName, tableAlias, deptDataPermission.getSelf(), loginUser.getId());
|
if (deptExpression == null && userExpression == null) {
|
||||||
// if (deptExpression == null && userExpression == null) {
|
// TODO 芋艿:获得不到条件的时候,暂时不抛出异常,而是不返回数据
|
||||||
// // TODO 芋艿:获得不到条件的时候,暂时不抛出异常,而是不返回数据
|
log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]",
|
||||||
// log.warn("[getExpression][LoginUser({}) Table({}/{}) DeptDataPermission({}) 构建的条件为空]",
|
JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(deptDataPermission));
|
||||||
// JsonUtils.toJsonString(loginUser), tableName, tableAlias, JsonUtils.toJsonString(deptDataPermission));
|
// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空",
|
||||||
//// throw new NullPointerException(String.format("LoginUser(%d) Table(%s/%s) 构建的条件为空",
|
// loginUser.getId(), tableName, tableAlias.getName()));
|
||||||
//// loginUser.getId(), tableName, tableAlias.getName()));
|
return EXPRESSION_NULL;
|
||||||
// return EXPRESSION_NULL;
|
}
|
||||||
// }
|
if (deptExpression == null) {
|
||||||
// if (deptExpression == null) {
|
return userExpression;
|
||||||
// return userExpression;
|
}
|
||||||
// }
|
if (userExpression == null) {
|
||||||
// if (userExpression == null) {
|
return deptExpression;
|
||||||
// return deptExpression;
|
}
|
||||||
// }
|
// 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?)
|
||||||
// // 目前,如果有指定部门 + 可查看自己,采用 OR 条件。即,WHERE (dept_id IN ? OR user_id = ?)
|
return new Parenthesis(new OrExpression(deptExpression, userExpression));
|
||||||
// return new Parenthesis(new OrExpression(deptExpression, userExpression));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Expression buildDeptExpression(String tableName, Alias tableAlias, Set<Long> deptIds) {
|
private Expression buildDeptExpression(String tableName, Alias tableAlias, Set<Long> deptIds) {
|
||||||
|
|||||||
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.service.user;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportExcelVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserImportExcelVO;
|
||||||
@ -293,5 +292,4 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<AdminUserDO> selectByRoleId(Long roleId);
|
List<AdminUserDO> selectByRoleId(Long roleId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user