更新0711
This commit is contained in:
parent
e78b5a0c4f
commit
8db128ccc8
@ -63,18 +63,27 @@ public interface CompanyService extends IService<Company> {
|
|||||||
/**
|
/**
|
||||||
* 通过服务名称查能提供服务的企业 分页
|
* 通过服务名称查能提供服务的企业 分页
|
||||||
*
|
*
|
||||||
|
* @param company 企业对象,主要是serverCodes
|
||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 14:09 2024/9/23
|
* @date 14:09 2024/9/23
|
||||||
* @param company 企业对象,主要是serverCodes
|
|
||||||
**/
|
**/
|
||||||
IPage<Company> getCompanyPageByServer(Company company, Page<Company> page);
|
IPage<Company> getCompanyPageByServer(Company company, Page<Company> page);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查企业能提供的业务
|
* 查企业能提供的业务
|
||||||
*
|
*
|
||||||
|
* @param id 企业ID
|
||||||
* @author 小李
|
* @author 小李
|
||||||
* @date 10:21 2024/9/24
|
* @date 10:21 2024/9/24
|
||||||
* @param id 企业ID
|
|
||||||
**/
|
**/
|
||||||
CompanyToServerVO getCompanyServerById(String id);
|
CompanyToServerVO getCompanyServerById(String id);
|
||||||
}
|
|
||||||
|
/**
|
||||||
|
* 通过租户ID和系统编码查询企业信息
|
||||||
|
*
|
||||||
|
* @param tenantId 租户ID
|
||||||
|
* @param systemCode 系统编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
CompanyRespVO getCompanyByTenantIdAndSystemCode(Long tenantId, String systemCode);
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.company.service.impl;
|
package cn.iocoder.yudao.module.company.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||||
@ -18,6 +19,7 @@ import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
|||||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
|
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -213,4 +215,19 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|||||||
Optional.ofNullable(servicePackageByIds).ifPresent(result::setServicePackages);
|
Optional.ofNullable(servicePackageByIds).ifPresent(result::setServicePackages);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过租户ID和系统编码查询企业信息
|
||||||
|
*
|
||||||
|
* @param tenantId 租户ID
|
||||||
|
* @param systemCode 系统编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public CompanyRespVO getCompanyByTenantIdAndSystemCode(Long tenantId, String systemCode) {
|
||||||
|
return BeanUtil.copyProperties(baseMapper.selectOne(Wrappers.<Company>lambdaQuery()
|
||||||
|
.eq(Company::getTenantId, tenantId)
|
||||||
|
.like(ObjectUtil.isNotEmpty(systemCode), Company::getServiceCodes, systemCode)),
|
||||||
|
CompanyRespVO.class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,4 +9,12 @@ public interface InspectionNoticeService {
|
|||||||
* @param text 消息通知内容
|
* @param text 消息通知内容
|
||||||
**/
|
**/
|
||||||
void sentMessage(Long userId, String text);
|
void sentMessage(Long userId, String text);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向指定用户发送消息
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @param text 消息通知内容
|
||||||
|
**/
|
||||||
|
void sentMessage(Long userId, String text, Long tenantId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,4 +38,25 @@ public class InspectionNoticeServiceImpl implements InspectionNoticeService {
|
|||||||
.setTemplateParams(templateParams));
|
.setTemplateParams(templateParams));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 向指定用户发送消息
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @param text 消息通知内容
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void sentMessage(Long userId, String text, Long tenantId) {
|
||||||
|
// 准备发送参数
|
||||||
|
Map<String, Object> templateParams = new HashMap<>();
|
||||||
|
// 发送模版内容
|
||||||
|
templateParams.put("text", text);
|
||||||
|
// 发送站内信
|
||||||
|
sendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO()
|
||||||
|
.setUserId(userId)
|
||||||
|
.setTemplateCode(TICKET_EMPLOY)
|
||||||
|
.setSystemCode(SystemEnum.INSPECTION.getCode())
|
||||||
|
.setTemplateParams(templateParams), tenantId);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,9 +102,9 @@ public class AppGoodsController extends BaseController {
|
|||||||
* 预约功能
|
* 预约功能
|
||||||
*/
|
*/
|
||||||
@GetMapping("/appointmentDateList")
|
@GetMapping("/appointmentDateList")
|
||||||
public CommonResult appointmentDateList(Long goodsId,String type)
|
public CommonResult appointmentDateList(Long goodsId,String type,Long tenantId)
|
||||||
{
|
{
|
||||||
return success(appointmentService.appointmentDateList(goodsId,type));
|
return success(appointmentService.appointmentDateList(goodsId,type,tenantId));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -44,6 +44,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@ -181,7 +182,7 @@ public class InspectionMallPartnersController extends BaseController {
|
|||||||
Map<String, Object> stringObjectMap = orderInfoService.workOrderData(query);
|
Map<String, Object> stringObjectMap = orderInfoService.workOrderData(query);
|
||||||
|
|
||||||
rows.add(CollUtil.newArrayList("公示价格汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("goodsPriceSum").toString()) / 100d) + "元", "实付金额汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("payMoneySum").toString()) / 100d) + "元"));
|
rows.add(CollUtil.newArrayList("公示价格汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("goodsPriceSum").toString()) / 100d) + "元", "实付金额汇总:", "", String.valueOf(Double.parseDouble(stringObjectMap.get("payMoneySum").toString()) / 100d) + "元"));
|
||||||
rows.add(CollUtil.newArrayList("车牌号", "检测车型", "检测类型", "业务渠道", "客户来源", "经办人", "公示价格", "实收金额", "付款时间", "客户手机号", "支付方式", "开始时间", "结束时间", "检测结果"));
|
rows.add(CollUtil.newArrayList("车牌号", "检测车型", "检测类型", "业务渠道", "客户来源", "经办人", "公示价格", "实收金额", "付款时间", "客户手机号", "支付方式", "开始时间", "结束时间", "检测结果","出纳是否确认"));
|
||||||
|
|
||||||
|
|
||||||
List<DictDataDO> sysDictData = dictDataService.getDictDataListByDictType("pay_type");
|
List<DictDataDO> sysDictData = dictDataService.getDictDataListByDictType("pay_type");
|
||||||
@ -210,13 +211,22 @@ public class InspectionMallPartnersController extends BaseController {
|
|||||||
} else {
|
} else {
|
||||||
payTypeStr = payMap.get(item.getPayType());
|
payTypeStr = payMap.get(item.getPayType());
|
||||||
}
|
}
|
||||||
|
// 出纳是否审核
|
||||||
|
String cashier = "待审核";
|
||||||
|
if (ObjectUtil.isNotEmpty(item.getCashierConfirm())) {
|
||||||
|
if (item.getCashierConfirm().equals("0")) {
|
||||||
|
cashier = "待审核";
|
||||||
|
}else {
|
||||||
|
cashier = "已审核";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rows.add(CollUtil.newArrayList(Optional.ofNullable(item.getCarNum()).orElse(""), Optional.ofNullable(item.getGoodsTitle()).orElse(""), Optional.ofNullable(item.getSkuName()).orElse(""), Optional.ofNullable(item.getBusinessChannel()).orElse(""), Optional.ofNullable(item.getCustomerSource()).orElse(""), Optional.ofNullable(item.getOtherName()).orElse(""), ObjectUtil.isEmpty(item.getGoodsPrice()) ? "" : BigDecimal.valueOf(item.getGoodsPrice())
|
rows.add(CollUtil.newArrayList(Optional.ofNullable(item.getCarNum()).orElse(""), Optional.ofNullable(item.getGoodsTitle()).orElse(""), Optional.ofNullable(item.getSkuName()).orElse(""), Optional.ofNullable(item.getBusinessChannel()).orElse(""), Optional.ofNullable(item.getCustomerSource()).orElse(""), Optional.ofNullable(item.getOtherName()).orElse(""), ObjectUtil.isEmpty(item.getGoodsPrice()) ? "" : BigDecimal.valueOf(item.getGoodsPrice())
|
||||||
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
|
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
|
||||||
.toString(), ObjectUtil.isEmpty(item.getRealPayMoney()) ? "暂未支付" : BigDecimal.valueOf(item.getRealPayMoney())
|
.toString(), ObjectUtil.isEmpty(item.getRealPayMoney()) ? "暂未支付" : BigDecimal.valueOf(item.getRealPayMoney())
|
||||||
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
|
.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_UP)
|
||||||
.toString(), ObjectUtil.isEmpty(item.getPayTime()) ? "暂未支付" : DateUtil.format(item.getPayTime(), "yyyy-MM-dd hh:mm"),
|
.toString(), ObjectUtil.isEmpty(item.getPayTime()) ? "暂未支付" : DateUtil.format(item.getPayTime(), "yyyy-MM-dd hh:mm"),
|
||||||
Optional.ofNullable(item.getBuyPhone()).orElse(""), payTypeStr, ObjectUtil.isEmpty(item.getStartTime()) ? "" : DateUtil.format(item.getStartTime(), "yyyy-MM-dd hh:mm"), ObjectUtil.isEmpty(item.getEndTime()) ? "" : DateUtil.format(item.getEndTime(), "yyyy-MM-dd hh:mm"), isPassStr));
|
Optional.ofNullable(item.getBuyPhone()).orElse(""), payTypeStr, ObjectUtil.isEmpty(item.getStartTime()) ? "" : DateUtil.format(item.getStartTime(), "yyyy-MM-dd hh:mm"), ObjectUtil.isEmpty(item.getEndTime()) ? "" : DateUtil.format(item.getEndTime(), "yyyy-MM-dd hh:mm"), isPassStr, cashier));
|
||||||
}
|
}
|
||||||
|
|
||||||
ExcelWriter writer = ExcelUtil.getWriter();
|
ExcelWriter writer = ExcelUtil.getWriter();
|
||||||
@ -226,7 +236,7 @@ public class InspectionMallPartnersController extends BaseController {
|
|||||||
writer.write(rows, true);
|
writer.write(rows, true);
|
||||||
|
|
||||||
ExcelExtraHelper.enhanceExcel(writer, rows,
|
ExcelExtraHelper.enhanceExcel(writer, rows,
|
||||||
CollUtil.newArrayList(8,11,12),
|
CollUtil.newArrayList(8,11,12,15),
|
||||||
null);
|
null);
|
||||||
//out为OutputStream,需要写出到的目标流
|
//out为OutputStream,需要写出到的目标流
|
||||||
//response为HttpServletResponse对象
|
//response为HttpServletResponse对象
|
||||||
|
|||||||
@ -663,15 +663,19 @@ public class PartnerOwnController extends BaseController {
|
|||||||
if (ObjectUtil.isEmpty(query.getIds())) {
|
if (ObjectUtil.isEmpty(query.getIds())) {
|
||||||
throw new SecurityException("请选择结算工单");
|
throw new SecurityException("请选择结算工单");
|
||||||
}
|
}
|
||||||
/* 2.实付金额不能为空*/
|
if (ObjectUtil.isEmpty(query.getType())) {
|
||||||
if (ObjectUtil.isEmpty(query.getRealPayMoney())) {
|
throw new SecurityException("请选择类型");
|
||||||
throw new SecurityException("请填写实付金额");
|
|
||||||
}
|
}
|
||||||
/* 3.支付方式不能为空*/
|
if ("cn".equals(query.getType())) {
|
||||||
if (ObjectUtil.isEmpty(query.getPayType())) {
|
/* 2.实付金额不能为空*/
|
||||||
throw new SecurityException("请选择支付方式");
|
if (ObjectUtil.isEmpty(query.getRealPayMoney())) {
|
||||||
|
throw new SecurityException("请填写实付金额");
|
||||||
|
}
|
||||||
|
/* 3.支付方式不能为空*/
|
||||||
|
if (ObjectUtil.isEmpty(query.getPayType())) {
|
||||||
|
throw new SecurityException("请选择支付方式");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
query.setType("selected");
|
|
||||||
partnerList.batchSettlement(query);
|
partnerList.batchSettlement(query);
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
@ -708,8 +712,9 @@ public class PartnerOwnController extends BaseController {
|
|||||||
//新增银行卡账户
|
//新增银行卡账户
|
||||||
@PostMapping("/addBankAccount")
|
@PostMapping("/addBankAccount")
|
||||||
public CommonResult addBankAccount(@RequestBody SysDictData dictData) throws Exception {
|
public CommonResult addBankAccount(@RequestBody SysDictData dictData) throws Exception {
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
// 获取当前租户id
|
||||||
String dictStr = "partner_bankList-" + partners.getPartnerId();
|
Long tenantId = SecurityFrameworkUtils.getLoginUser().getTenantId();
|
||||||
|
String dictStr = "partner_bankList-" + tenantId;
|
||||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
||||||
|
|
||||||
DictDataSaveReqVO dictSave = new DictDataSaveReqVO();
|
DictDataSaveReqVO dictSave = new DictDataSaveReqVO();
|
||||||
|
|||||||
@ -186,9 +186,9 @@ public class ShopInspectionGoodsController extends BaseController {
|
|||||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) throws Exception {
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId());
|
// Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId());
|
||||||
List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
// List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
||||||
List<String> roles = roleList.stream().map(RoleDO::getCode).collect(Collectors.toList());
|
// List<String> roles = roleList.stream().map(RoleDO::getCode).collect(Collectors.toList());
|
||||||
|
|
||||||
// ShopMallPartners partner = new ShopMallPartners();
|
// ShopMallPartners partner = new ShopMallPartners();
|
||||||
// if (roles.contains("jcshop")) {
|
// if (roles.contains("jcshop")) {
|
||||||
@ -209,7 +209,7 @@ public class ShopInspectionGoodsController extends BaseController {
|
|||||||
// partner.setPartnerId(worker.getPartnerId());
|
// partner.setPartnerId(worker.getPartnerId());
|
||||||
// }
|
// }
|
||||||
// shopInspectionOrder.setPartnerId(partner.getPartnerId());
|
// shopInspectionOrder.setPartnerId(partner.getPartnerId());
|
||||||
shopInspectionOrder.setValidationTime(new Date());
|
// shopInspectionOrder.setValidationTime(new Date());
|
||||||
Page<OrderInfo> page = new Page<>(pageNo, pageSize);
|
Page<OrderInfo> page = new Page<>(pageNo, pageSize);
|
||||||
return CommonResult.success(orderInfoService.queryListPage(shopInspectionOrder, page));
|
return CommonResult.success(orderInfoService.queryListPage(shopInspectionOrder, page));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,4 +32,16 @@ public class AppInspectionController {
|
|||||||
public CommonResult<?> getInspectionStaffByUniqueCode(@RequestParam("uniqueCode") String uniqueCode) {
|
public CommonResult<?> getInspectionStaffByUniqueCode(@RequestParam("uniqueCode") String uniqueCode) {
|
||||||
return CommonResult.success(inspectionStaffService.getInspectionStaffByUniqueCode(uniqueCode));
|
return CommonResult.success(inspectionStaffService.getInspectionStaffByUniqueCode(uniqueCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据唯一码查询业务
|
||||||
|
*
|
||||||
|
* @param uniqueCode 唯一码
|
||||||
|
* @return 业务
|
||||||
|
*/
|
||||||
|
@RequestMapping("/getBusinessByUniqueCode")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult<?> getBusinessByUniqueCode(@RequestParam("uniqueCode") String uniqueCode) {
|
||||||
|
return CommonResult.success(inspectionStaffService.getBusinessByUniqueCode(uniqueCode));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,20 @@
|
|||||||
package cn.iocoder.yudao.module.inspection.controller.app;
|
package cn.iocoder.yudao.module.inspection.controller.app;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.InspectionGoodsSku;
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
|
||||||
import cn.iocoder.yudao.module.inspection.query.GoodsQuery;
|
import cn.iocoder.yudao.module.inspection.query.GoodsQuery;
|
||||||
import cn.iocoder.yudao.module.inspection.service.AppInspectionGoodsService;
|
import cn.iocoder.yudao.module.inspection.service.AppInspectionGoodsService;
|
||||||
import cn.iocoder.yudao.module.inspection.service.IInspectionAppointmentService;
|
import cn.iocoder.yudao.module.inspection.service.IInspectionAppointmentService;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.InspectionGoodsSkuService;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.IShopCouponService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import java.text.ParseException;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@ -20,11 +27,16 @@ public class AppInspectionGoodsController
|
|||||||
private AppInspectionGoodsService appInspectionGoodsService;
|
private AppInspectionGoodsService appInspectionGoodsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IInspectionAppointmentService appointmentService;
|
private IInspectionAppointmentService appointmentService;
|
||||||
|
@Autowired
|
||||||
|
private IShopCouponService couponService;
|
||||||
|
@Autowired
|
||||||
|
private InspectionGoodsSkuService skuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品规格
|
* 获取商品规格
|
||||||
*/
|
*/
|
||||||
@GetMapping("/goodsSkuList")
|
@GetMapping("/goodsSkuList")
|
||||||
|
@TenantIgnore
|
||||||
public CommonResult goodsSkuList(GoodsQuery goodsQuery)
|
public CommonResult goodsSkuList(GoodsQuery goodsQuery)
|
||||||
{
|
{
|
||||||
return success(appInspectionGoodsService.goodsSkuList(goodsQuery));
|
return success(appInspectionGoodsService.goodsSkuList(goodsQuery));
|
||||||
@ -34,6 +46,7 @@ public class AppInspectionGoodsController
|
|||||||
* 预约功能
|
* 预约功能
|
||||||
*/
|
*/
|
||||||
@GetMapping("/appointmentDateList")
|
@GetMapping("/appointmentDateList")
|
||||||
|
@TenantIgnore
|
||||||
public CommonResult appointmentDateList(Long goodsId,String type)
|
public CommonResult appointmentDateList(Long goodsId,String type)
|
||||||
{
|
{
|
||||||
return success(appointmentService.appointmentDateList(goodsId,type));
|
return success(appointmentService.appointmentDateList(goodsId,type));
|
||||||
@ -43,6 +56,7 @@ public class AppInspectionGoodsController
|
|||||||
* 获取商品详情
|
* 获取商品详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/goodsDetail")
|
@GetMapping("/goodsDetail")
|
||||||
|
@TenantIgnore
|
||||||
public CommonResult goodsDetail(GoodsQuery goodsQuery)
|
public CommonResult goodsDetail(GoodsQuery goodsQuery)
|
||||||
{
|
{
|
||||||
return success(appInspectionGoodsService.goodsDetail(goodsQuery));
|
return success(appInspectionGoodsService.goodsDetail(goodsQuery));
|
||||||
@ -52,8 +66,118 @@ public class AppInspectionGoodsController
|
|||||||
* 下单页信息返回
|
* 下单页信息返回
|
||||||
*/
|
*/
|
||||||
@GetMapping("/orderSkuInfo")
|
@GetMapping("/orderSkuInfo")
|
||||||
|
@TenantIgnore
|
||||||
public CommonResult orderSkuInfo(GoodsQuery goodsQuery)
|
public CommonResult orderSkuInfo(GoodsQuery goodsQuery)
|
||||||
{
|
{
|
||||||
return success(appInspectionGoodsService.orderSkuInfo(goodsQuery));
|
return success(appInspectionGoodsService.orderSkuInfo(goodsQuery));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单页信息返回
|
||||||
|
*/
|
||||||
|
@GetMapping("/orderGoodsInfo")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult orderGoodsInfo(GoodsQuery goodsQuery)
|
||||||
|
{
|
||||||
|
return success(appInspectionGoodsService.orderGoodsInfo(goodsQuery));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 下单页信息返回
|
||||||
|
*/
|
||||||
|
@GetMapping("/canUseCoupon")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult canUseCoupon(Integer objectId,String type)
|
||||||
|
{
|
||||||
|
Integer goodsId =objectId;
|
||||||
|
if (type.equals("sku")){
|
||||||
|
InspectionGoodsSku sku = skuService.getById(objectId);
|
||||||
|
goodsId=sku.getGoodsId() ;
|
||||||
|
}
|
||||||
|
return success(couponService.canUseCoupon(goodsId,"检测项目现金券"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上门取车功能
|
||||||
|
*/
|
||||||
|
@GetMapping("/pickCarInfo")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult pickCarInfo()
|
||||||
|
{
|
||||||
|
return success(appointmentService.pickCarInfo());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据经纬度计算距离和价格
|
||||||
|
*/
|
||||||
|
@GetMapping("/computeDistanceAndPrice")
|
||||||
|
public CommonResult computeDistanceAndPrice(Long goodsId,Double longitude,Double latitude,String type ) throws Exception {
|
||||||
|
return success(appointmentService.computeDistanceAndPrice(goodsId,longitude,latitude,type));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 预约功能
|
||||||
|
*/
|
||||||
|
@PostMapping("/appointmentInspection")
|
||||||
|
@TenantIgnore
|
||||||
|
@PreAuthenticated
|
||||||
|
public CommonResult appointmentInspection(@RequestBody InspectionAppointment appointment) throws ParseException {
|
||||||
|
return success(appointmentService.appointmentInspection(appointment));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改预约功能
|
||||||
|
*/
|
||||||
|
@PostMapping("/editAppointment")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult editAppointment(@RequestBody InspectionAppointment appointment)
|
||||||
|
{
|
||||||
|
return success(appointmentService.editAppointment(appointment));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除预约信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/delAppointment")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult delAppointment(@RequestParam("appointmentId") Long appointmentId)
|
||||||
|
{
|
||||||
|
appointmentService.delAppointment(appointmentId);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 上门取车
|
||||||
|
*/
|
||||||
|
@PostMapping("/pickCarInspection")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult pickCarInspection(@RequestBody InspectionPickCar pickCar) throws Exception {
|
||||||
|
return success(appointmentService.pickCarInspection(pickCar));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 进店获取可领取的优惠券
|
||||||
|
*/
|
||||||
|
@GetMapping("/canLedCoupon")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult canLedCoupon(Long partnerId)
|
||||||
|
{
|
||||||
|
return success(couponService.canLedCoupon(partnerId));
|
||||||
|
}
|
||||||
|
@PostMapping("/drawDownCoupon")
|
||||||
|
public CommonResult drawDownCoupon(Long partnerId)
|
||||||
|
{
|
||||||
|
couponService.drawDownCoupon(partnerId);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台赠送的可以领取的优惠券
|
||||||
|
*/
|
||||||
|
@GetMapping("/canLedCouponPlatform")
|
||||||
|
public CommonResult canLedCouponPlatform()
|
||||||
|
{
|
||||||
|
return success(couponService.canLedCouponPlatform());
|
||||||
|
}
|
||||||
|
@PostMapping("/drawDownCouponPlatform")
|
||||||
|
public CommonResult drawDownCouponPlatform()
|
||||||
|
{
|
||||||
|
couponService.drawDownCouponPlatform();
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@ public class AppInspectionOrderController extends BaseController {
|
|||||||
return success(orderInfos);
|
return success(orderInfos);
|
||||||
}
|
}
|
||||||
@GetMapping("/orderDetail")
|
@GetMapping("/orderDetail")
|
||||||
|
@TenantIgnore
|
||||||
public CommonResult orderDetail(Long orderId) {
|
public CommonResult orderDetail(Long orderId) {
|
||||||
return CommonResult.success(appInspectionOrderService.orderDetailApp(orderId));
|
return CommonResult.success(appInspectionOrderService.orderDetailApp(orderId));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.inspection.controller.app;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import cn.iocoder.yudao.module.inspection.entity.SiteInfo;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.ISiteInfoService;
|
||||||
|
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.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/inspection/info")
|
||||||
|
public class AppSiteInfoController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISiteInfoService siteInfoService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询inspection列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult<?> list(SiteInfo siteInfo, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize)
|
||||||
|
{
|
||||||
|
Page<SiteInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<SiteInfo> list = siteInfoService.selectSiteInfoList(page,siteInfo);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,12 +4,20 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
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.module.core.page.PageDomain;
|
||||||
|
import cn.iocoder.yudao.module.core.page.TableSupport;
|
||||||
import cn.iocoder.yudao.module.inspection.service.AppUserOwnService;
|
import cn.iocoder.yudao.module.inspection.service.AppUserOwnService;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.IInspectionAppointmentService;
|
||||||
|
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
||||||
|
import cn.iocoder.yudao.module.payment.service.OrderInfoService;
|
||||||
|
import cn.iocoder.yudao.module.shop.entity.ShopCoupon;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.IShopCouponService;
|
||||||
import cn.iocoder.yudao.module.shop.service.IShopUserCarService;
|
import cn.iocoder.yudao.module.shop.service.IShopUserCarService;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@ -21,9 +29,17 @@ public class AppUserInfoController {
|
|||||||
private AppUserOwnService ownService;
|
private AppUserOwnService ownService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
||||||
private IShopUserCarService shopUserCarService;
|
private IShopUserCarService shopUserCarService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderInfoService orderInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IInspectionAppointmentService inspectionAppointmentService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IShopCouponService shopCouponService;
|
||||||
|
|
||||||
@GetMapping("/getCars")
|
@GetMapping("/getCars")
|
||||||
@TenantIgnore
|
@TenantIgnore
|
||||||
public CommonResult getCars()
|
public CommonResult getCars()
|
||||||
@ -31,6 +47,17 @@ public class AppUserInfoController {
|
|||||||
return success(ownService.getCars());
|
return success(ownService.getCars());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getDbList")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult getDbList(String searchValue,
|
||||||
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
|
||||||
|
{
|
||||||
|
Page<AdminUserDO> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<AdminUserDO> dbList = ownService.getDbListTow(page,searchValue);
|
||||||
|
return success(dbList);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping(value = "/getUserCar")
|
@GetMapping(value = "/getUserCar")
|
||||||
@TenantIgnore
|
@TenantIgnore
|
||||||
public CommonResult getUserCarByUserId()
|
public CommonResult getUserCarByUserId()
|
||||||
@ -39,4 +66,56 @@ public class AppUserInfoController {
|
|||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
return success(shopUserCarService.selectShopUserCarByUserId(loginUser.getId()));
|
return success(shopUserCarService.selectShopUserCarByUserId(loginUser.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/orderList")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult orderList(String status, String title,
|
||||||
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<OrderInfo> orderInfos = orderInfoService.orderListApp(page, status, title, "jc");
|
||||||
|
return success(orderInfos);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getAppointmentOwn")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult getAppointmentOwn()
|
||||||
|
{
|
||||||
|
return success(inspectionAppointmentService.getAppointmentOwn());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/getDetail")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult getDetail(@RequestParam("id") Long id)
|
||||||
|
{
|
||||||
|
return success(inspectionAppointmentService.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getInfoCard")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult getInfoCard()
|
||||||
|
{
|
||||||
|
return success( shopUserCarService.getInfoCard());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/infoCardOCR")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult infoCardOCR(String imagePath) throws Exception
|
||||||
|
{
|
||||||
|
shopUserCarService.infoCardOCR(imagePath);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping(value = "/listByUserId")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult listByUserId(ShopCoupon shopCoupon,
|
||||||
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
|
||||||
|
{
|
||||||
|
shopCoupon.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||||
|
PageDomain pageDomain = TableSupport.getPageDomain();
|
||||||
|
Page<ShopCoupon> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<ShopCoupon> list = shopCouponService.selectShopCouponByUserId(page,shopCoupon);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,6 +99,8 @@ public class InspectionAppointment extends TenantBaseDO
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String sourceType;
|
private String sourceType;
|
||||||
@TableField(exist = false)
|
|
||||||
private String customerSource;
|
private String customerSource;
|
||||||
|
private Integer customerSourceId; //客户来源id
|
||||||
|
private Integer businessChannelId; //业务渠道id
|
||||||
|
private String businessChannel; //业务渠道
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,6 +229,11 @@ public class InspectionInfo extends TenantBaseDO
|
|||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String cashierConfirmRemark;
|
private String cashierConfirmRemark;
|
||||||
|
/**
|
||||||
|
* 出纳确认备注
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String cashierConfirmTime;
|
||||||
/**
|
/**
|
||||||
* 会计是否确认 0-未到账 1-已到账 null-待确认
|
* 会计是否确认 0-未到账 1-已到账 null-待确认
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,6 +4,14 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface InspectionBusinessChannelMapper extends BaseMapper<InspectionBusinessChannel> {
|
public interface InspectionBusinessChannelMapper extends BaseMapper<InspectionBusinessChannel> {
|
||||||
|
/**
|
||||||
|
* 获取业务渠道 和 客户来源
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
InspectionBusinessChannel getBusinessChannelByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,4 +66,6 @@ public class OrderTableQuery {
|
|||||||
private Long realPayMoney;
|
private Long realPayMoney;
|
||||||
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
private String receivablesAccount;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,6 +72,7 @@ public interface IInspectionAppointmentService extends IService<InspectionAppoi
|
|||||||
Long pickCarInspection(InspectionPickCar pickCar) throws Exception;
|
Long pickCarInspection(InspectionPickCar pickCar) throws Exception;
|
||||||
|
|
||||||
JSONObject appointmentDateList(Long goodsId,String type);
|
JSONObject appointmentDateList(Long goodsId,String type);
|
||||||
|
JSONObject appointmentDateList(Long goodsId,String type,Long tenantId);
|
||||||
JSONObject pickCarInfo();
|
JSONObject pickCarInfo();
|
||||||
JSONObject computeDistanceAndPrice(Long goodsId,Double longitude,Double latitude,String type ) throws Exception;
|
JSONObject computeDistanceAndPrice(Long goodsId,Double longitude,Double latitude,String type ) throws Exception;
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,16 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface InspectionBusinessChannelService extends IService<InspectionBusinessChannel> {
|
public interface InspectionBusinessChannelService extends IService<InspectionBusinessChannel> {
|
||||||
List<InspectionBusinessChannel> getChannelTree();
|
List<InspectionBusinessChannel> getChannelTree();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取业务渠道和客户来源
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Map<String, Object> getBusinessChannelByUserId(Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -92,5 +92,7 @@ public interface InspectionStaffService extends IService<InspectionStaff> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
InspectionStaffSaveVo getInspectionStaffByUniqueCode(String uniqueCode);
|
InspectionStaffSaveVo getInspectionStaffByUniqueCode(String uniqueCode);
|
||||||
|
|
||||||
|
Map<String, Object> getBusinessByUniqueCode(String uniqueCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -94,44 +94,61 @@ public class AppInspectionGoodsServiceImpl extends ServiceImpl<AppInspectionGood
|
|||||||
List<GoodsVo> goodsVoList = baseMapper.goodsList(goodsQuery);
|
List<GoodsVo> goodsVoList = baseMapper.goodsList(goodsQuery);
|
||||||
//获取当前登录用户
|
//获取当前登录用户
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(loginUser.getId());
|
if (loginUser!=null) {
|
||||||
List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(loginUser.getId());
|
||||||
List<String> roleKeys = roleList.stream().map(item->item.getCode()).collect(Collectors.toList());
|
List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
||||||
for (GoodsVo goodsVo : goodsVoList) {
|
List<String> roleKeys = roleList.stream().map(item -> item.getCode()).collect(Collectors.toList());
|
||||||
LambdaQueryWrapper<InspectionGoodsSku> queryWrapper =new LambdaQueryWrapper();
|
|
||||||
queryWrapper.eq(InspectionGoodsSku::getGoodsId,goodsVo.getGoodsId()).orderByAsc(InspectionGoodsSku::getOrderNum);
|
for (GoodsVo goodsVo : goodsVoList) {
|
||||||
List<InspectionGoodsSku> list = skuService.list(queryWrapper);
|
LambdaQueryWrapper<InspectionGoodsSku> queryWrapper = new LambdaQueryWrapper();
|
||||||
Integer goodsId = list.get(0).getGoodsId();
|
queryWrapper.eq(InspectionGoodsSku::getGoodsId, goodsVo.getGoodsId()).orderByAsc(InspectionGoodsSku::getOrderNum);
|
||||||
ShopInspectionGoods goods = this.getById(goodsId);
|
List<InspectionGoodsSku> list = skuService.list(queryWrapper);
|
||||||
try {
|
Integer goodsId = list.get(0).getGoodsId();
|
||||||
if (roleKeys.contains("jcdb")){
|
ShopInspectionGoods goods = this.getById(goodsId);
|
||||||
//先判断是否为代办
|
try {
|
||||||
for (InspectionGoodsSku skuItem : list) {
|
if (roleKeys.contains("jcdb")) {
|
||||||
skuItem.setPrice(skuItem.getDbPrice());
|
//先判断是否为代办
|
||||||
}
|
|
||||||
}else if (roleKeys.contains("jcdwgly")){
|
|
||||||
//单位管理员
|
|
||||||
for (InspectionGoodsSku skuItem : list) {
|
|
||||||
skuItem.setPrice(skuItem.getDwPrice());
|
|
||||||
}
|
|
||||||
}else if (roleKeys.contains("jcworker")||roleKeys.contains("jcshop")){
|
|
||||||
//检测工人
|
|
||||||
//判断是否为当前店铺的工人
|
|
||||||
LambdaQueryWrapper<PartnerWorker> queryWrapper1 =new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper1.eq(PartnerWorker::getUserId,loginUser.getId()).eq(PartnerWorker::getPartnerId,goods.getPartnerId()).last("limit 1");
|
|
||||||
PartnerWorker one = workerService.getOne(queryWrapper1);
|
|
||||||
if (ObjectUtils.isNotEmpty(one)){
|
|
||||||
for (InspectionGoodsSku skuItem : list) {
|
for (InspectionGoodsSku skuItem : list) {
|
||||||
skuItem.setPrice(skuItem.getYgPrice());
|
skuItem.setPrice(skuItem.getDbPrice());
|
||||||
|
}
|
||||||
|
} else if (roleKeys.contains("jcdwgly")) {
|
||||||
|
//单位管理员
|
||||||
|
for (InspectionGoodsSku skuItem : list) {
|
||||||
|
skuItem.setPrice(skuItem.getDwPrice());
|
||||||
|
}
|
||||||
|
} else if (roleKeys.contains("jcworker") || roleKeys.contains("jcshop")) {
|
||||||
|
//检测工人
|
||||||
|
//判断是否为当前店铺的工人
|
||||||
|
LambdaQueryWrapper<PartnerWorker> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper1.eq(PartnerWorker::getUserId, loginUser.getId()).eq(PartnerWorker::getPartnerId, goods.getPartnerId()).last("limit 1");
|
||||||
|
PartnerWorker one = workerService.getOne(queryWrapper1);
|
||||||
|
if (ObjectUtils.isNotEmpty(one)) {
|
||||||
|
for (InspectionGoodsSku skuItem : list) {
|
||||||
|
skuItem.setPrice(skuItem.getYgPrice());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
for (InspectionGoodsSku skuItem : list) {
|
||||||
|
skuItem.setPrice(skuItem.getPrice());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
goodsVo.setSkuList(list);
|
||||||
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error(e.getMessage());
|
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
goodsVo.setSkuList(list);
|
for (GoodsVo goodsVo : goodsVoList) {
|
||||||
|
LambdaQueryWrapper<InspectionGoodsSku> queryWrapper = new LambdaQueryWrapper();
|
||||||
|
queryWrapper.eq(InspectionGoodsSku::getGoodsId, goodsVo.getGoodsId()).orderByAsc(InspectionGoodsSku::getOrderNum);
|
||||||
|
List<InspectionGoodsSku> list = skuService.list(queryWrapper);
|
||||||
|
for (InspectionGoodsSku skuItem : list) {
|
||||||
|
skuItem.setPrice(skuItem.getPrice());
|
||||||
|
}
|
||||||
|
goodsVo.setSkuList(list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return goodsVoList;
|
return goodsVoList;
|
||||||
}
|
}
|
||||||
@ -146,7 +163,10 @@ public class AppInspectionGoodsServiceImpl extends ServiceImpl<AppInspectionGood
|
|||||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
GoodsDetail resInfo =new GoodsDetail();
|
GoodsDetail resInfo =new GoodsDetail();
|
||||||
AdminUserDO sysUser = userService.getUser(userId);
|
AdminUserDO sysUser = userService.getUser(userId);
|
||||||
Integer userLevel = sysUser.getUserLevel();
|
Integer userLevel = 0;
|
||||||
|
if (sysUser!=null) {
|
||||||
|
userLevel = sysUser.getUserLevel();
|
||||||
|
}
|
||||||
ShopInspectionGoods goods = baseMapper.selectById(goodsQuery.getGoodsId());
|
ShopInspectionGoods goods = baseMapper.selectById(goodsQuery.getGoodsId());
|
||||||
//处理图片格式
|
//处理图片格式
|
||||||
if (!StringUtils.isEmpty(goods.getImages())){
|
if (!StringUtils.isEmpty(goods.getImages())){
|
||||||
@ -234,6 +254,9 @@ public class AppInspectionGoodsServiceImpl extends ServiceImpl<AppInspectionGood
|
|||||||
ShopInspectionGoods goods = this.getById(goodsId);
|
ShopInspectionGoods goods = this.getById(goodsId);
|
||||||
//获取当前登录用户
|
//获取当前登录用户
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
if (ObjectUtils.isEmpty(loginUser)) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(loginUser.getId());
|
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(loginUser.getId());
|
||||||
List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
List<RoleDO> roleList = roleService.getRoleList(userRoleIdListByUserId);
|
||||||
List<String> roleKeys = roleList.stream().map(item->item.getCode()).collect(Collectors.toList());
|
List<String> roleKeys = roleList.stream().map(item->item.getCode()).collect(Collectors.toList());
|
||||||
@ -328,7 +351,10 @@ public class AppInspectionGoodsServiceImpl extends ServiceImpl<AppInspectionGood
|
|||||||
InspectionGoodsSku goodsSku = skuService.getById(goodsQuery.getGoodsId());
|
InspectionGoodsSku goodsSku = skuService.getById(goodsQuery.getGoodsId());
|
||||||
ShopInspectionGoods goodsInfo = this.getById(goodsSku.getGoodsId());
|
ShopInspectionGoods goodsInfo = this.getById(goodsSku.getGoodsId());
|
||||||
AdminUserDO sysUser = userService.getUser(userId);
|
AdminUserDO sysUser = userService.getUser(userId);
|
||||||
Integer userLevel = sysUser.getUserLevel();
|
Integer userLevel = 0;
|
||||||
|
if (ObjectUtils.isNotEmpty(sysUser)) {
|
||||||
|
userLevel = sysUser.getUserLevel();
|
||||||
|
}
|
||||||
res.setGoodsId(goodsSku.getId());
|
res.setGoodsId(goodsSku.getId());
|
||||||
res.setGoodsName(goodsSku.getSkuName());
|
res.setGoodsName(goodsSku.getSkuName());
|
||||||
res.setGoodsImage(goodsInfo.getImage());
|
res.setGoodsImage(goodsInfo.getImage());
|
||||||
|
|||||||
@ -4,6 +4,8 @@ import cn.hutool.core.date.DateUtil;
|
|||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
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.module.company.service.CompanyService;
|
||||||
|
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
|
||||||
import cn.iocoder.yudao.module.partner.entity.PartnerWorker;
|
import cn.iocoder.yudao.module.partner.entity.PartnerWorker;
|
||||||
import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
||||||
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
||||||
@ -54,6 +56,8 @@ public class AppInspectionOrderServiceImpl extends ServiceImpl<OrderInfoMapper,
|
|||||||
private IShopInspectionGoodsService goodsService;
|
private IShopInspectionGoodsService goodsService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopInspectionCategoryService categoryService;
|
private ShopInspectionCategoryService categoryService;
|
||||||
|
@Autowired
|
||||||
|
private CompanyService companyService;
|
||||||
|
|
||||||
//app的订单详情
|
//app的订单详情
|
||||||
@Override
|
@Override
|
||||||
@ -63,6 +67,8 @@ public class AppInspectionOrderServiceImpl extends ServiceImpl<OrderInfoMapper,
|
|||||||
if (!user.getId().equals(orderInfo.getUserId())){
|
if (!user.getId().equals(orderInfo.getUserId())){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
// 通过订单租户id 查询商家信息
|
||||||
|
CompanyRespVO partners = companyService.getCompanyByTenantIdAndSystemCode(orderInfo.getTenantId(), "jiance");
|
||||||
OrderAppDetail orderDetail =new OrderAppDetail();
|
OrderAppDetail orderDetail =new OrderAppDetail();
|
||||||
orderDetail.setOrderStatus(orderInfo.getOrderStatus());
|
orderDetail.setOrderStatus(orderInfo.getOrderStatus());
|
||||||
orderDetail.setGoodsId(orderInfo.getGoodsId());
|
orderDetail.setGoodsId(orderInfo.getGoodsId());
|
||||||
@ -78,13 +84,14 @@ public class AppInspectionOrderServiceImpl extends ServiceImpl<OrderInfoMapper,
|
|||||||
orderDetail.setPartnerName(orderInfo.getPartnerName());
|
orderDetail.setPartnerName(orderInfo.getPartnerName());
|
||||||
orderDetail.setReduceMoney(orderInfo.getReduceMoney());
|
orderDetail.setReduceMoney(orderInfo.getReduceMoney());
|
||||||
orderDetail.setValidationTime(orderInfo.getValidationTime());
|
orderDetail.setValidationTime(orderInfo.getValidationTime());
|
||||||
ShopMallPartners partners = partnerService.getById(orderInfo.getPartnerId());
|
// ShopMallPartners partners = partnerService.getById(orderInfo.getPartnerId());
|
||||||
|
orderDetail.setPartnerName(partners.getCorpName());
|
||||||
orderDetail.setAccessCode(orderInfo.getAccessCode());
|
orderDetail.setAccessCode(orderInfo.getAccessCode());
|
||||||
orderDetail.setPartnerAddress(Optional.ofNullable(partners.getAddress()).orElse(""));
|
orderDetail.setPartnerAddress(Optional.ofNullable(partners.getAddress()).orElse(""));
|
||||||
orderDetail.setContactNumber(partners.getContactNumber());
|
orderDetail.setContactNumber(partners.getMobilePhone());
|
||||||
orderDetail.setLatitude(partners.getLatitude());
|
orderDetail.setLatitude(partners.getLat() == null ? "" : partners.getLat().toString());
|
||||||
orderDetail.setLongitude(partners.getLongitude());
|
orderDetail.setLongitude(partners.getLgt() == null ? "" : partners.getLgt().toString());
|
||||||
orderDetail.setWorkTimeStr(partners.getWorkTime());
|
orderDetail.setWorkTimeStr(partners.getBusinessStartTime() + "~" + partners.getBusinessEndTime());
|
||||||
orderDetail.setCommentStar(orderInfo.getCommentStar());
|
orderDetail.setCommentStar(orderInfo.getCommentStar());
|
||||||
orderDetail.setCommentDesc(orderInfo.getCommentDesc());
|
orderDetail.setCommentDesc(orderInfo.getCommentDesc());
|
||||||
return orderDetail;
|
return orderDetail;
|
||||||
|
|||||||
@ -2645,45 +2645,43 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void batchSettlement(OrderTableQuery query) {
|
public void batchSettlement(OrderTableQuery query) {
|
||||||
// 获取type
|
|
||||||
if (query.getType() == null) {
|
|
||||||
throw new RuntimeException("请选择结算类型");
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (query.getType()) {
|
// 根据ids 查询工单
|
||||||
case "all": {
|
List<InspectionInfo> list = inspectionInfoService.list(Wrappers.<InspectionInfo>lambdaQuery()
|
||||||
// 这是根据筛选条件将所有的工单结算
|
.in(InspectionInfo::getId, query.getIds()));
|
||||||
InspectionInfoVo infoVo = query.getInfoVo();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "selected": {
|
|
||||||
InspectionInfoVo infoVo = query.getInfoVo();
|
|
||||||
Long realPayMoney = query.getRealPayMoney();
|
|
||||||
long averageMoney = realPayMoney / query.getIds().size();
|
|
||||||
// 根据ids 查询工单
|
|
||||||
List<InspectionInfo> list = inspectionInfoService.list(Wrappers.<InspectionInfo>lambdaQuery()
|
|
||||||
.in(InspectionInfo::getId, query.getIds()));
|
|
||||||
|
|
||||||
// 提取出订单ids
|
// 提取出订单ids
|
||||||
List<Long> orderIds = list.stream().map(InspectionInfo::getInspectionOrderId).collect(Collectors.toList());
|
List<Long> orderIds = list.stream().map(InspectionInfo::getInspectionOrderId).collect(Collectors.toList());
|
||||||
// 根据ids 修改工单结算
|
|
||||||
orderService.update(Wrappers.<OrderInfo>lambdaUpdate()
|
|
||||||
.in(OrderInfo::getId, orderIds)
|
|
||||||
.set(OrderInfo::getPayMoney, averageMoney)
|
|
||||||
.set(OrderInfo::getPayType, query.getPayType())
|
|
||||||
.set(OrderInfo::getCashierConfirm, "1")
|
|
||||||
.set(OrderInfo::getCashierConfirmUser, SecurityFrameworkUtils.getLoginUserId())
|
|
||||||
.set(ObjectUtil.isNotEmpty(query.getRemark()), OrderInfo::getCashierConfirmRemark, query.getRemark()));
|
|
||||||
|
|
||||||
// 插入批量结算订单表
|
if (query.getType().equals("cn")) {
|
||||||
InspectionBatchSettlementOrder inspectionBatchSettlementOrder = new InspectionBatchSettlementOrder();
|
Long realPayMoney = query.getRealPayMoney();
|
||||||
inspectionBatchSettlementOrder.setOrderIds(orderIds.stream()
|
long averageMoney = realPayMoney / query.getIds().size();
|
||||||
.map(String::valueOf) // 将 Long 转为 String
|
// 根据ids 修改工单结算
|
||||||
.collect(Collectors.joining(",")));
|
orderService.update(Wrappers.<OrderInfo>lambdaUpdate()
|
||||||
inspectionBatchSettlementOrder.setPayMoney(realPayMoney);
|
.in(OrderInfo::getId, orderIds)
|
||||||
batchSettlementOrderService.save(inspectionBatchSettlementOrder);
|
.set(OrderInfo::getPayMoney, averageMoney)
|
||||||
break;
|
.set(OrderInfo::getPayType, query.getPayType())
|
||||||
}
|
.set(OrderInfo::getCashierConfirm, "1")
|
||||||
|
.set(OrderInfo::getReceivablesAccount, query.getReceivablesAccount())
|
||||||
|
.set(OrderInfo::getCashierConfirmUser, SecurityFrameworkUtils.getLoginUserId())
|
||||||
|
.set(OrderInfo::getCashierConfirmTime, new Date())
|
||||||
|
.set(ObjectUtil.isNotEmpty(query.getRemark()), OrderInfo::getCashierConfirmRemark, query.getRemark()));
|
||||||
|
|
||||||
|
// 插入批量结算订单表
|
||||||
|
InspectionBatchSettlementOrder inspectionBatchSettlementOrder = new InspectionBatchSettlementOrder();
|
||||||
|
inspectionBatchSettlementOrder.setOrderIds(orderIds.stream()
|
||||||
|
.map(String::valueOf) // 将 Long 转为 String
|
||||||
|
.collect(Collectors.joining(",")));
|
||||||
|
inspectionBatchSettlementOrder.setPayMoney(realPayMoney);
|
||||||
|
batchSettlementOrderService.save(inspectionBatchSettlementOrder);
|
||||||
|
} else {
|
||||||
|
// 会计审核
|
||||||
|
orderService.update(Wrappers.<OrderInfo>lambdaUpdate()
|
||||||
|
.in(OrderInfo::getId, orderIds)
|
||||||
|
.set(OrderInfo::getAccountingConfirm, "1")
|
||||||
|
.set(ObjectUtil.isNotEmpty(query.getRemark()), OrderInfo::getAccountingConfirmRemark, query.getRemark())
|
||||||
|
.set(OrderInfo::getAccountingConfirmTime, new Date())
|
||||||
|
.set(OrderInfo::getAccountingConfirmUser, SecurityFrameworkUtils.getLoginUserId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,6 +155,9 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
|
|||||||
public Long appointmentInspection(InspectionAppointment appointment) throws ParseException {
|
public Long appointmentInspection(InspectionAppointment appointment) throws ParseException {
|
||||||
//当前登录用户
|
//当前登录用户
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
if (loginUser == null) {
|
||||||
|
throw new RuntimeException("请登录");
|
||||||
|
}
|
||||||
appointment.setUserId(loginUser.getId());
|
appointment.setUserId(loginUser.getId());
|
||||||
AdminUserDO ownUser = userService.getUser(loginUser.getId());
|
AdminUserDO ownUser = userService.getUser(loginUser.getId());
|
||||||
InspectionGoodsSku sku = skuService.getById(appointment.getSkuId());
|
InspectionGoodsSku sku = skuService.getById(appointment.getSkuId());
|
||||||
@ -195,19 +198,19 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
|
|||||||
if (StringUtils.isNotEmpty(appointment.getOtherPhone())) {
|
if (StringUtils.isNotEmpty(appointment.getOtherPhone())) {
|
||||||
phone = appointment.getOtherPhone();
|
phone = appointment.getOtherPhone();
|
||||||
//给联系人发送
|
//给联系人发送
|
||||||
// SendSmsUtil.sendMsgCommon(new String[]{Optional.ofNullable(appointment.getCarNo()).orElse("")
|
SendSmsUtil.sendMsgCommon(new String[]{Optional.ofNullable(appointment.getCarNo()).orElse("")
|
||||||
// , partners.getPartnerName(), sysUser.getNickname(), sysUser.getMobile()
|
// , partners.getPartnerName(), sysUser.getNickname(), sysUser.getMobile()
|
||||||
//// },appointment.getOtherPhone(),"1400852709","机动车管家小程序","2112792");
|
//// },appointment.getOtherPhone(),"1400852709","机动车管家小程序","2112792");
|
||||||
// }, appointment.getOtherPhone(), "1400852709", "机动车管家小程序", "2386324");
|
}, appointment.getOtherPhone(), "1400852709", "机动车管家小程序", "2386324");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
phone = ownUser.getMobile();
|
phone = ownUser.getMobile();
|
||||||
//给本人发送
|
//给本人发送
|
||||||
//给联系人发送
|
//给联系人发送
|
||||||
// SendSmsUtil.sendMsgCommon(new String[]{Optional.ofNullable(appointment.getCarNo()).orElse("")
|
SendSmsUtil.sendMsgCommon(new String[]{Optional.ofNullable(appointment.getCarNo()).orElse("")
|
||||||
// , partners.getPartnerName(), sysUser.getNickname(), sysUser.getMobile()
|
// , partners.getPartnerName(), sysUser.getNickname(), sysUser.getMobile()
|
||||||
//// },ownUser.getMobile(),"1400852709","机动车管家小程序","2112792");
|
// },ownUser.getMobile(),"1400852709","机动车管家小程序","2112792");
|
||||||
// }, ownUser.getMobile(), "1400852709", "机动车管家小程序", "2386324");
|
}, ownUser.getMobile(), "1400852709", "机动车管家小程序", "2386324");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//给检测站发送
|
//给检测站发送
|
||||||
@ -226,7 +229,7 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
|
|||||||
List<String> codes = roleList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList());
|
List<String> codes = roleList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList());
|
||||||
|
|
||||||
//根据角色查询用户
|
//根据角色查询用户
|
||||||
List<UserDTO> userListByCodes = roleService.getUserListByCodes(codes);
|
List<UserDTO> userListByCodes = roleService.getUserListByCodesAndTenantId(codes, appointment.getTenantId());
|
||||||
|
|
||||||
// 组装消息
|
// 组装消息
|
||||||
String day = Objects.equals(appointment.getAppointmentPeriod(), "0") ? "上午" : "下午";
|
String day = Objects.equals(appointment.getAppointmentPeriod(), "0") ? "上午" : "下午";
|
||||||
@ -249,7 +252,7 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
|
|||||||
redisDelayedQueueService.addToQueue(message, triggerTimeMillis);
|
redisDelayedQueueService.addToQueue(message, triggerTimeMillis);
|
||||||
|
|
||||||
// 发送站内信
|
// 发送站内信
|
||||||
noticeService.sentMessage(userListByCode.getId(), msg);
|
noticeService.sentMessage(userListByCode.getId(), msg, appointment.getTenantId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -414,6 +417,40 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject appointmentDateList(Long goodsId, String type,Long tenantId) {
|
||||||
|
if (type.equals("sku")) {
|
||||||
|
InspectionGoodsSku goodsSku = skuService.getById(goodsId);
|
||||||
|
goodsId = Long.parseLong(goodsSku.getGoodsId().toString());
|
||||||
|
}
|
||||||
|
JSONObject res = new JSONObject();
|
||||||
|
List<JSONObject> resList = new ArrayList<>();
|
||||||
|
List<Date> sevenDaysList = getSevenDaysList();
|
||||||
|
for (Date date : sevenDaysList) {
|
||||||
|
JSONObject item = new JSONObject();
|
||||||
|
String dateStr = DateUtil.format(date, "yyyy-MM-dd");
|
||||||
|
item.put("dateStr", dateStr);
|
||||||
|
item.put("weekStr", getDayOfWeek(date));
|
||||||
|
LambdaQueryWrapper<InspectionAppointment> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(InspectionAppointment::getAppointmentDay, dateStr).eq(InspectionAppointment::getAppointmentPeriod, "0");
|
||||||
|
long morningCount = this.count(queryWrapper);
|
||||||
|
queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(InspectionAppointment::getAppointmentDay, dateStr).eq(InspectionAppointment::getAppointmentPeriod, "1");
|
||||||
|
long afterCount = this.count(queryWrapper);
|
||||||
|
item.put("morningCount", morningCount);
|
||||||
|
item.put("afterCount", afterCount);
|
||||||
|
resList.add(item);
|
||||||
|
|
||||||
|
}
|
||||||
|
res.put("dataList", resList);
|
||||||
|
ShopInspectionGoods goods = goodsService.getById(goodsId);
|
||||||
|
ShopMallPartners partner = partnerService.getById(goods.getPartnerId());
|
||||||
|
res.put("partnerName", partner.getPartnerName());
|
||||||
|
res.put("address", partner.getAddress());
|
||||||
|
res.put("partnerId", partner.getPartnerId());
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject pickCarInfo() {
|
public JSONObject pickCarInfo() {
|
||||||
JSONObject res = new JSONObject();
|
JSONObject res = new JSONObject();
|
||||||
|
|||||||
@ -3,10 +3,12 @@ package cn.iocoder.yudao.module.inspection.service.impl;
|
|||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionBusinessChannel;
|
||||||
import cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper;
|
import cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper;
|
||||||
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
|
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -19,4 +21,28 @@ public class InspectionBusinessChannelServiceImpl extends ServiceImpl<Inspection
|
|||||||
return this.list();
|
return this.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取业务渠道和客户来源
|
||||||
|
*
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getBusinessChannelByUserId(Long userId) {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
// 客户来源
|
||||||
|
InspectionBusinessChannel channel = baseMapper.getBusinessChannelByUserId(userId);
|
||||||
|
if (channel == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
map.put("channel", channel);
|
||||||
|
// 根据客户来源的父id查询业务渠道
|
||||||
|
InspectionBusinessChannel business = getOne(Wrappers.<InspectionBusinessChannel>lambdaQuery()
|
||||||
|
.eq(InspectionBusinessChannel::getId, channel.getPid()));
|
||||||
|
if (business != null) {
|
||||||
|
map.put("business", business);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import cn.iocoder.yudao.module.inspection.mapper.InspectionWorkNodeMapper;
|
|||||||
import cn.iocoder.yudao.module.inspection.query.InspectionListQuery;
|
import cn.iocoder.yudao.module.inspection.query.InspectionListQuery;
|
||||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.InspectionBusinessChannelService;
|
||||||
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
||||||
import cn.iocoder.yudao.module.inspection.vo.ImportStaffVo;
|
import cn.iocoder.yudao.module.inspection.vo.ImportStaffVo;
|
||||||
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffExportVo;
|
import cn.iocoder.yudao.module.inspection.vo.InspectionStaffExportVo;
|
||||||
@ -74,6 +75,9 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
|
|||||||
@Resource
|
@Resource
|
||||||
private UniqueCodeService uniqueCodeService;
|
private UniqueCodeService uniqueCodeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InspectionBusinessChannelService inspectionBusinessChannelService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取检测员工分页
|
* 获取检测员工分页
|
||||||
*
|
*
|
||||||
@ -317,6 +321,17 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
|
|||||||
return baseMapper.getInspectionStaffByUniqueCode(uniqueCode);
|
return baseMapper.getInspectionStaffByUniqueCode(uniqueCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param uniqueCode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getBusinessByUniqueCode(String uniqueCode) {
|
||||||
|
InspectionStaffSaveVo staff = getInspectionStaffByUniqueCode(uniqueCode);
|
||||||
|
// 通过员工id查找 业务渠道和客户来源
|
||||||
|
return inspectionBusinessChannelService.getBusinessChannelByUserId(staff.getId());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存检测员工
|
* 保存检测员工
|
||||||
*
|
*
|
||||||
|
|||||||
@ -0,0 +1,519 @@
|
|||||||
|
package cn.iocoder.yudao.module.payment.controller.app;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||||
|
import cn.iocoder.yudao.module.partner.entity.PartnerBankInfo;
|
||||||
|
import cn.iocoder.yudao.module.payment.entity.FzRecord;
|
||||||
|
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
||||||
|
import cn.iocoder.yudao.module.payment.entity.OrderInfoDetail;
|
||||||
|
import cn.iocoder.yudao.module.payment.service.IFzRecordService;
|
||||||
|
import cn.iocoder.yudao.module.payment.service.IOrderInfoDetailService;
|
||||||
|
import cn.iocoder.yudao.module.payment.service.OrderInfoService;
|
||||||
|
import cn.iocoder.yudao.module.shop.entity.ShopConfig;
|
||||||
|
import cn.iocoder.yudao.module.shop.entity.ShopCoupon;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.IShopConfigService;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.IShopCouponService;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.IUserBalanceService;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
|
import cn.iocoder.yudao.util.StringUtils;
|
||||||
|
import cn.iocoder.yudao.util.WechatPayConfig;
|
||||||
|
import cn.iocoder.yudao.util.WechatPayRequest;
|
||||||
|
import cn.iocoder.yudao.util.WechatPayUrlEnum;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.ruoyi.partner.service.IPartnerBankInfoService;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
|
||||||
|
import com.wechat.pay.contrib.apache.httpclient.util.PemUtil;
|
||||||
|
import com.wechat.pay.java.core.Config;
|
||||||
|
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||||
|
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
||||||
|
import com.wechat.pay.java.service.payments.jsapi.model.*;
|
||||||
|
import com.wechat.pay.java.service.profitsharing.ProfitsharingService;
|
||||||
|
import com.wechat.pay.java.service.profitsharing.model.CreateOrderReceiver;
|
||||||
|
import com.wechat.pay.java.service.profitsharing.model.CreateOrderRequest;
|
||||||
|
import com.wechat.pay.java.service.profitsharing.model.OrdersEntity;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.security.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/payApi")
|
||||||
|
public class AppWxPayController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private WechatPayConfig wechatPayConfig;
|
||||||
|
@Autowired
|
||||||
|
private IShopCouponService shopCouponService;
|
||||||
|
@Resource
|
||||||
|
private WechatPayRequest wechatPayRequest;
|
||||||
|
@Autowired
|
||||||
|
private OrderInfoService orderInfoService;
|
||||||
|
@Autowired
|
||||||
|
private IPartnerBankInfoService partnerBankInfoService;
|
||||||
|
@Autowired
|
||||||
|
private AdminUserService adminUserService;
|
||||||
|
@Autowired
|
||||||
|
private IShopConfigService configService;
|
||||||
|
@Autowired
|
||||||
|
private IOrderInfoDetailService orderInfoDetailService;
|
||||||
|
@Autowired
|
||||||
|
private IUserBalanceService userBalanceService;
|
||||||
|
@Autowired
|
||||||
|
private AppInspectionPartnerService partnerService;
|
||||||
|
@Autowired
|
||||||
|
private IFzRecordService fzRecordService;
|
||||||
|
private final ReentrantLock lock = new ReentrantLock();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* type:h5、jsapi、app、native、sub_jsapi
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/prepayment")
|
||||||
|
public Map<String,Object> transactions(String type,Long orderId) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException, IOException {
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
AdminUserDO user = adminUserService.getUser(loginUser.getId());
|
||||||
|
OrderInfo orderInfo = orderInfoService.getById(orderId);
|
||||||
|
// 统一参数封装
|
||||||
|
Map<String, Object> params = new HashMap<>(8);
|
||||||
|
params.put("appid", wechatPayConfig.getJcAppId());
|
||||||
|
params.put("mchid", wechatPayConfig.getMchId());
|
||||||
|
params.put("description", orderInfo.getGoodsTitle());
|
||||||
|
params.put("out_trade_no", orderInfo.getOrderNo());
|
||||||
|
params.put("notify_url", wechatPayConfig.getJcNotifyUrl());
|
||||||
|
Map<String, Object> amountMap = new HashMap<>(4);
|
||||||
|
// 金额单位为分
|
||||||
|
amountMap.put("total", orderInfo.getPayMoney());
|
||||||
|
//人民币
|
||||||
|
amountMap.put("currency", "CNY");
|
||||||
|
params.put("amount", amountMap);
|
||||||
|
|
||||||
|
// 场景信息
|
||||||
|
Map<String, Object> sceneInfoMap = new HashMap<>(4);
|
||||||
|
// 客户端IP
|
||||||
|
sceneInfoMap.put("payer_client_ip", "127.0.0.1");
|
||||||
|
// 商户端设备号(门店号或收银设备ID)
|
||||||
|
sceneInfoMap.put("device_id", "127.0.0.1");
|
||||||
|
// 除H5与JSAPI有特殊参数外,其他的支付方式都一样
|
||||||
|
if (type.equals(WechatPayUrlEnum.H5.getType())) {
|
||||||
|
Map<String, Object> h5InfoMap = new HashMap<>(4);
|
||||||
|
// 场景类型:iOS, Android, Wap
|
||||||
|
h5InfoMap.put("type", "IOS");
|
||||||
|
sceneInfoMap.put("h5_info", h5InfoMap);
|
||||||
|
} else if (type.equals(WechatPayUrlEnum.JSAPI.getType()) || type.equals(WechatPayUrlEnum.SUB_JSAPI.getType())) {
|
||||||
|
Map<String, Object> payerMap = new HashMap<>(4);
|
||||||
|
payerMap.put("openid", user.getOpenId());
|
||||||
|
params.put("payer", payerMap);
|
||||||
|
}
|
||||||
|
params.put("scene_info", sceneInfoMap);
|
||||||
|
String paramsStr = JSON.toJSONString(params);
|
||||||
|
|
||||||
|
String resStr = wechatPayRequest.wechatHttpPost("https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi",paramsStr);
|
||||||
|
Map<String, Object> resMap = JSONObject.parseObject(resStr);
|
||||||
|
Map<String, Object> signMap = paySignMsg(resMap.get("prepay_id").toString(), wechatPayConfig.getAppId(),null);
|
||||||
|
return signMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* type:h5、jsapi、app、native、sub_jsapi
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/jcPrepayment2")
|
||||||
|
public Map<String,Object> jcPrepayment2(String type,Long orderId) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException, IOException {
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
AdminUserDO user = adminUserService.getUser(loginUser.getId());
|
||||||
|
OrderInfo orderInfo = orderInfoService.getById(orderId);
|
||||||
|
// 统一参数封装
|
||||||
|
Map<String, Object> params = new HashMap<>(8);
|
||||||
|
params.put("appid", wechatPayConfig.getJcAppId());
|
||||||
|
params.put("mchid", wechatPayConfig.getMchId());
|
||||||
|
params.put("description", orderInfo.getGoodsTitle());
|
||||||
|
params.put("out_trade_no", orderInfo.getOrderNo());
|
||||||
|
params.put("notify_url", wechatPayConfig.getJcNotifyUrl());
|
||||||
|
Map<String, Object> amountMap = new HashMap<>(4);
|
||||||
|
// 金额单位为分
|
||||||
|
amountMap.put("total", orderInfo.getPayMoney());
|
||||||
|
//人民币
|
||||||
|
amountMap.put("currency", "CNY");
|
||||||
|
params.put("amount", amountMap);
|
||||||
|
|
||||||
|
// 场景信息
|
||||||
|
Map<String, Object> sceneInfoMap = new HashMap<>(4);
|
||||||
|
// 客户端IP
|
||||||
|
sceneInfoMap.put("payer_client_ip", "127.0.0.1");
|
||||||
|
// 商户端设备号(门店号或收银设备ID)
|
||||||
|
sceneInfoMap.put("device_id", "127.0.0.1");
|
||||||
|
// 除H5与JSAPI有特殊参数外,其他的支付方式都一样
|
||||||
|
if (type.equals(WechatPayUrlEnum.H5.getType())) {
|
||||||
|
Map<String, Object> h5InfoMap = new HashMap<>(4);
|
||||||
|
// 场景类型:iOS, Android, Wap
|
||||||
|
h5InfoMap.put("type", "IOS");
|
||||||
|
sceneInfoMap.put("h5_info", h5InfoMap);
|
||||||
|
} else if (type.equals(WechatPayUrlEnum.JSAPI.getType()) || type.equals(WechatPayUrlEnum.SUB_JSAPI.getType())) {
|
||||||
|
Map<String, Object> payerMap = new HashMap<>(4);
|
||||||
|
payerMap.put("openid", user.getJcOpenId());
|
||||||
|
params.put("payer", payerMap);
|
||||||
|
}
|
||||||
|
params.put("scene_info", sceneInfoMap);
|
||||||
|
String paramsStr = JSON.toJSONString(params);
|
||||||
|
|
||||||
|
String resStr = wechatPayRequest.wechatHttpPost("https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi",paramsStr);
|
||||||
|
Map<String, Object> resMap = JSONObject.parseObject(resStr);
|
||||||
|
Map<String, Object> signMap = paySignMsg(resMap.get("prepay_id").toString(), wechatPayConfig.getAppId(),null);
|
||||||
|
return signMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* type:h5、jsapi、app、native、sub_jsapi
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/jcPrepayment")
|
||||||
|
@TenantIgnore
|
||||||
|
public Map<String,Object> jcPrepayment(String type,Long orderId) throws SignatureException, NoSuchAlgorithmException, InvalidKeyException, IOException {
|
||||||
|
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
AdminUserDO user = adminUserService.getUser(loginUser.getId());
|
||||||
|
OrderInfo orderInfo = orderInfoService.getById(orderId);
|
||||||
|
LambdaQueryWrapper<PartnerBankInfo> queryWrapper =new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(PartnerBankInfo::getPartnerId,orderInfo.getPartnerId());
|
||||||
|
PartnerBankInfo bankInfo = partnerBankInfoService.getOne(queryWrapper);
|
||||||
|
|
||||||
|
String prepayId = this.toGetPayInfo(wechatPayConfig.getJcAppId(), bankInfo.getMchId(), bankInfo.getApiclientKey(), orderInfo.getPayMoney().intValue()
|
||||||
|
, user.getJcOpenId(), bankInfo.getSerialNo(), bankInfo.getApiV3Key(), orderInfo.getGoodsTitle(),
|
||||||
|
wechatPayConfig.getJcNotifyUrl(), orderInfo.getOrderNo());
|
||||||
|
Map<String, Object> resMap = paySignMsg(prepayId, wechatPayConfig.getJcAppId(),bankInfo.getApiclientKey());
|
||||||
|
return resMap;
|
||||||
|
}
|
||||||
|
private Map<String, Object> paySignMsg(String prepayId,String appId,String privateKeyStr) throws IOException, NoSuchAlgorithmException, InvalidKeyException, SignatureException {
|
||||||
|
long timeMillis = System.currentTimeMillis();
|
||||||
|
String timeStamp = timeMillis/1000+"";
|
||||||
|
String nonceStr = timeMillis+"";
|
||||||
|
String packageStr = "prepay_id="+prepayId;
|
||||||
|
// 公共参数
|
||||||
|
Map<String, Object> resMap = new HashMap<>();
|
||||||
|
resMap.put("nonceStr",nonceStr);
|
||||||
|
resMap.put("timeStamp",timeStamp);
|
||||||
|
resMap.put("appId",appId);
|
||||||
|
resMap.put("package", packageStr);
|
||||||
|
// 使用字段appId、timeStamp、nonceStr、package进行签名
|
||||||
|
//从下往上依次生成
|
||||||
|
String message = buildMessage(appId, timeStamp, nonceStr, packageStr);
|
||||||
|
//签名
|
||||||
|
String paySign = sign(message.getBytes("utf-8"), privateKeyStr);
|
||||||
|
resMap.put("paySign", paySign);
|
||||||
|
resMap.put("signType", "RSA");
|
||||||
|
return resMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String sign(byte[] message,String privateKeyStr) throws NoSuchAlgorithmException, SignatureException, IOException, InvalidKeyException {
|
||||||
|
//签名方式
|
||||||
|
Signature sign = Signature.getInstance("SHA256withRSA");
|
||||||
|
//私钥,通过MyPrivateKey来获取,这是个静态类可以接调用方法 ,需要的是_key.pem文件的绝对路径配上文件名
|
||||||
|
PrivateKey privateKey =null;
|
||||||
|
if (StringUtils.isNotEmpty(privateKeyStr)){
|
||||||
|
privateKey = PemUtil.loadPrivateKey(privateKeyStr);
|
||||||
|
}else {
|
||||||
|
privateKey = wechatPayConfig.getPrivateKey(wechatPayConfig.getKeyPemPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
sign.initSign(privateKey);
|
||||||
|
sign.update(message);
|
||||||
|
return Base64.getEncoder().encodeToString(sign.sign());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按照前端签名文档规范进行排序,\n是换行
|
||||||
|
* @param timestamp
|
||||||
|
* @param nonceStr
|
||||||
|
* @param prepay_id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String buildMessage(String appId, String timestamp,String nonceStr,String prepay_id) {
|
||||||
|
|
||||||
|
return appId + "\n"
|
||||||
|
+ timestamp + "\n"
|
||||||
|
+ nonceStr + "\n"
|
||||||
|
+ prepay_id + "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String toGetPayInfo(String appId, String merchantId,String privateKey,Integer total,String openId,
|
||||||
|
String merchantSerialNumber,String apiV3Key,String title,String notifyUrl,String orderNo){
|
||||||
|
Config config =
|
||||||
|
new RSAAutoCertificateConfig.Builder()
|
||||||
|
.merchantId(merchantId)
|
||||||
|
.privateKey(privateKey)
|
||||||
|
.merchantSerialNumber(merchantSerialNumber)
|
||||||
|
.apiV3Key(apiV3Key)
|
||||||
|
.build();
|
||||||
|
// 构建service
|
||||||
|
JsapiService service = new JsapiService.Builder().config(config).build();
|
||||||
|
// request.setXxx(val)设置所需参数,具体参数可见Request定义
|
||||||
|
PrepayRequest request = new PrepayRequest();
|
||||||
|
Amount amount = new Amount();
|
||||||
|
amount.setTotal(total);
|
||||||
|
amount.setCurrency("CNY");
|
||||||
|
|
||||||
|
request.setAmount(amount);
|
||||||
|
request.setAppid(appId);
|
||||||
|
request.setMchid(merchantId);
|
||||||
|
request.setDescription(title);
|
||||||
|
request.setNotifyUrl(notifyUrl);
|
||||||
|
request.setOutTradeNo(orderNo);
|
||||||
|
Payer payer =new Payer();
|
||||||
|
payer.setOpenid(openId);
|
||||||
|
request.setPayer(payer);
|
||||||
|
SettleInfo settleInfo =new SettleInfo();
|
||||||
|
settleInfo.setProfitSharing(true);
|
||||||
|
request.setSettleInfo(settleInfo);
|
||||||
|
// 调用下单方法,得到应答
|
||||||
|
PrepayResponse response = service.prepay(request);
|
||||||
|
return response.getPrepayId();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/payNotify")
|
||||||
|
public Map<String, String> payNotify(@RequestBody JSONObject jsonObject) {
|
||||||
|
String method = Thread.currentThread().getStackTrace()[1].getMethodName();
|
||||||
|
|
||||||
|
try {
|
||||||
|
String key = wechatPayConfig.getApiV3Key();
|
||||||
|
String json = jsonObject.toString();
|
||||||
|
String associated_data = (String) JSONUtil.getByPath(JSONUtil.parse(json), "resource.associated_data");
|
||||||
|
String ciphertext = (String) JSONUtil.getByPath(JSONUtil.parse(json), "resource.ciphertext");
|
||||||
|
String nonce = (String) JSONUtil.getByPath(JSONUtil.parse(json), "resource.nonce");
|
||||||
|
|
||||||
|
String decryptData = new AesUtil(key.getBytes(StandardCharsets.UTF_8)).decryptToString(associated_data.getBytes(StandardCharsets.UTF_8), nonce.getBytes(StandardCharsets.UTF_8), ciphertext);
|
||||||
|
//验签成功
|
||||||
|
JSONObject decryptDataObj = JSONObject.parseObject(decryptData, JSONObject.class);
|
||||||
|
if(lock.tryLock()) {
|
||||||
|
try {
|
||||||
|
ShopConfig shopConfig = configService.selectShopConfigById(1L);
|
||||||
|
// 解密resource中的通知数据
|
||||||
|
String orderNo = decryptDataObj.get("out_trade_no").toString();
|
||||||
|
OrderInfo orderInfo = orderInfoService.getOrderByOrderNo(orderNo);
|
||||||
|
//追加订单明细记录
|
||||||
|
orderInfoDetailService.save(new OrderInfoDetail(orderInfo.getId(),"支付成功",new Date(),orderInfo.getPayMoney(),"0"));
|
||||||
|
JSONObject balanceObject =new JSONObject();
|
||||||
|
balanceObject.put("goodsType",orderInfo.getGoodsType());
|
||||||
|
balanceObject.put("goodsTitle",orderInfo.getGoodsTitle());
|
||||||
|
if (orderInfo.getOrderStatus().equals("0")){
|
||||||
|
orderInfo.setTransactionId(decryptDataObj.get("transaction_id").toString());
|
||||||
|
// 生成16位核销码 加到支付回调里
|
||||||
|
UUID uuid = UUID.randomUUID();
|
||||||
|
long mostSignificantBits = uuid.getMostSignificantBits();
|
||||||
|
long leastSignificantBits = uuid.getLeastSignificantBits();
|
||||||
|
|
||||||
|
String combinedBits = mostSignificantBits+ String.valueOf(leastSignificantBits);
|
||||||
|
String shortUuid = combinedBits.substring(combinedBits.length() - 16);
|
||||||
|
orderInfo.setAccessCode(shortUuid);
|
||||||
|
if (orderInfo.getGoodsType().equals("cz")){
|
||||||
|
balanceObject.put("silverNum", shopConfig.getShopUserSilver().longValue());
|
||||||
|
balanceObject.put("goldNum", shopConfig.getShopUserGold().longValue());
|
||||||
|
balanceObject.put("platinum", shopConfig.getShopUserPlatinum().longValue());
|
||||||
|
//积分充值的逻辑处理
|
||||||
|
orderInfo.setPayTime(new Date());
|
||||||
|
//状态直接值为 3 已完成 忽略 使用 评价的过程
|
||||||
|
orderInfo.setOrderStatus("3");
|
||||||
|
orderInfoService.updateById(orderInfo);
|
||||||
|
//处理 用户积分的变化
|
||||||
|
userBalanceService.addBalance(orderInfo.getPayMoney(),orderInfo.getUserId(),balanceObject);
|
||||||
|
}else if(orderInfo.getGoodsType().equals("jymd")){
|
||||||
|
//救援买单 忽略核销过程 直接修改为待评价
|
||||||
|
orderInfo.setPayTime(new Date());
|
||||||
|
orderInfo.setOrderStatus("2");
|
||||||
|
orderInfoService.updateById(orderInfo);
|
||||||
|
if (!ObjectUtil.isEmpty(orderInfo.getBalance())&&orderInfo.getBalance()>0){
|
||||||
|
//处理积分
|
||||||
|
userBalanceService.subtractFrozenBalance(orderInfo.getBalance(),orderInfo.getUserId(),balanceObject);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
orderInfo.setPayTime(new Date());
|
||||||
|
orderInfo.setOrderStatus("1");
|
||||||
|
orderInfoService.updateById(orderInfo);
|
||||||
|
if (!ObjectUtil.isEmpty(orderInfo.getIsCoupon())&&orderInfo.getIsCoupon().equals("1")){
|
||||||
|
ShopCoupon shopCoupon = shopCouponService.selectShopCouponByCouponId(orderInfo.getCouponId());
|
||||||
|
//处理优惠卷
|
||||||
|
shopCoupon.setCouponStatus("1");
|
||||||
|
shopCoupon.setOrderId(orderInfo.getId());
|
||||||
|
shopCoupon.setUseTime(new Date());
|
||||||
|
shopCouponService.updateShopCoupon(shopCoupon);
|
||||||
|
orderInfo.setCouponId(shopCoupon.getCouponId());
|
||||||
|
orderInfo.setCouponDiscount(orderInfo.getCouponDiscount());
|
||||||
|
}
|
||||||
|
if (!ObjectUtil.isEmpty(orderInfo.getBalance())&&orderInfo.getBalance()>0){
|
||||||
|
//处理积分
|
||||||
|
userBalanceService.subtractFrozenBalance(orderInfo.getBalance(),orderInfo.getUserId(),balanceObject);
|
||||||
|
}
|
||||||
|
//店铺销量+1
|
||||||
|
if (orderInfo.getPartnerId()!=null){
|
||||||
|
partnerService.addSalesNum(orderInfo.getPartnerId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//最后处理邀请人的积分奖励
|
||||||
|
AdminUserDO sysUser = adminUserService.getUser(orderInfo.getUserId());
|
||||||
|
if (ObjectUtil.isNotEmpty(sysUser.getInviteId())){
|
||||||
|
AdminUserDO inviteUser = adminUserService.getUser(sysUser.getInviteId());
|
||||||
|
userBalanceService.inviteSpend(inviteUser.getId(),orderInfo.getPayMoney());
|
||||||
|
}
|
||||||
|
//处理分账功能
|
||||||
|
if (ObjectUtil.isNotEmpty(shopConfig.getFzRatio())&&shopConfig.getFzRatio()>0d&&orderInfo.getSkuName().contains("环检")){
|
||||||
|
Timer timer = new Timer();
|
||||||
|
TimerTask task = new TimerTask() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
LambdaQueryWrapper<PartnerBankInfo> queryWrapper =new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(PartnerBankInfo::getPartnerId,orderInfo.getPartnerId());
|
||||||
|
PartnerBankInfo bankInfo = partnerBankInfoService.getOne(queryWrapper);
|
||||||
|
profitsharing(wechatPayConfig.getAppId(),bankInfo.getMchId(),bankInfo.getApiclientKey(),3000L,
|
||||||
|
bankInfo.getSerialNo(),bankInfo.getApiV3Key(),orderInfo.getOrderNo(),orderInfo.getTransactionId(),orderInfo.getPartnerId()
|
||||||
|
,orderInfo.getPartnerName(),orderInfo.getId(),orderInfo.getPayMoney());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
long delay = 300 * 1000; // 一分钟后执行,单位是毫秒
|
||||||
|
timer.schedule(task, delay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
//要主动释放锁
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> res = new HashMap<>();
|
||||||
|
res.put("code", "SUCCESS");
|
||||||
|
res.put("message", "成功");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/profitsharing")
|
||||||
|
void profitsharing(String appId, String merchantId,String privateKey,Long amount,
|
||||||
|
String merchantSerialNumber,String apiV3Key,String orderNo,String transactionId
|
||||||
|
,Long partnerId,String partnerName,Long orderId,Long totalAmount){
|
||||||
|
try {
|
||||||
|
Config config =
|
||||||
|
new RSAAutoCertificateConfig.Builder()
|
||||||
|
.merchantId(merchantId)
|
||||||
|
.privateKey(privateKey)
|
||||||
|
.merchantSerialNumber(merchantSerialNumber)
|
||||||
|
.apiV3Key(apiV3Key)
|
||||||
|
.build();
|
||||||
|
// 构建service
|
||||||
|
ProfitsharingService service = new ProfitsharingService.Builder().config(config).build();
|
||||||
|
CreateOrderRequest request =new CreateOrderRequest();
|
||||||
|
request.setAppid(appId);
|
||||||
|
request.setTransactionId(transactionId);
|
||||||
|
request.setOutOrderNo(orderNo);
|
||||||
|
request.setUnfreezeUnsplit(true);
|
||||||
|
List<CreateOrderReceiver> receivers =new ArrayList<>();
|
||||||
|
CreateOrderReceiver receiver =new CreateOrderReceiver();
|
||||||
|
receiver.setType("MERCHANT_ID");
|
||||||
|
receiver.setAccount(wechatPayConfig.getMchId());
|
||||||
|
receiver.setName("官方");
|
||||||
|
receiver.setAmount(amount);
|
||||||
|
receiver.setDescription("平台收取一定费用");
|
||||||
|
receivers.add(receiver);
|
||||||
|
request.setReceivers(receivers);
|
||||||
|
OrdersEntity order = service.createOrder(request);
|
||||||
|
FzRecord fzRecord =new FzRecord();
|
||||||
|
fzRecord.setPartnerId(partnerId);
|
||||||
|
fzRecord.setPartnerName(partnerName);
|
||||||
|
fzRecord.setOrderId(orderId);
|
||||||
|
fzRecord.setOrderNo(orderNo);
|
||||||
|
fzRecord.setIsSuccess("1");
|
||||||
|
fzRecord.setReason(JSONObject.toJSONString(order));
|
||||||
|
fzRecord.setAmount(amount);
|
||||||
|
fzRecord.setTotalAmount(totalAmount);
|
||||||
|
fzRecordService.save(fzRecord);
|
||||||
|
}catch (Exception e){
|
||||||
|
FzRecord fzRecord =new FzRecord();
|
||||||
|
fzRecord.setPartnerId(partnerId);
|
||||||
|
fzRecord.setPartnerName(partnerName);
|
||||||
|
fzRecord.setOrderId(orderId);
|
||||||
|
fzRecord.setOrderNo(orderNo);
|
||||||
|
fzRecord.setIsSuccess("0");
|
||||||
|
fzRecord.setReason(e.getMessage());
|
||||||
|
fzRecord.setAmount(amount);
|
||||||
|
fzRecord.setTotalAmount(totalAmount);
|
||||||
|
fzRecordService.save(fzRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/refundNotify")
|
||||||
|
public Map<String, String> refundNotify(@RequestBody JSONObject jsonObject) throws GeneralSecurityException, IOException {
|
||||||
|
String key = wechatPayConfig.getApiV3Key();
|
||||||
|
String json = jsonObject.toString();
|
||||||
|
String associated_data = (String) JSONUtil.getByPath(JSONUtil.parse(json), "resource.associated_data");
|
||||||
|
String ciphertext = (String) JSONUtil.getByPath(JSONUtil.parse(json), "resource.ciphertext");
|
||||||
|
String nonce = (String) JSONUtil.getByPath(JSONUtil.parse(json), "resource.nonce");
|
||||||
|
|
||||||
|
String decryptData = new AesUtil(key.getBytes(StandardCharsets.UTF_8)).decryptToString(associated_data.getBytes(StandardCharsets.UTF_8), nonce.getBytes(StandardCharsets.UTF_8), ciphertext);
|
||||||
|
//验签成功
|
||||||
|
JSONObject decryptDataObj = JSONObject.parseObject(decryptData, JSONObject.class);
|
||||||
|
if(lock.tryLock()) {
|
||||||
|
try {
|
||||||
|
String orderNo = decryptDataObj.get("out_trade_no").toString();
|
||||||
|
//根据订单编号进行退款处理
|
||||||
|
OrderInfo orderInfo = orderInfoService.getOrderByOrderNo(orderNo);
|
||||||
|
//追加订单明细记录
|
||||||
|
orderInfoDetailService.save(new OrderInfoDetail(orderInfo.getId(),"退款成功",new Date(),orderInfo.getPayMoney(),"1"));
|
||||||
|
if (orderInfo.getOrderStatus().equals("4")){
|
||||||
|
if (orderInfo.getIsCoupon().equals("1")){
|
||||||
|
//处理优惠卷
|
||||||
|
ShopCoupon shopCoupon = shopCouponService.selectShopCouponByCouponId(orderInfo.getCouponId());
|
||||||
|
shopCoupon.setCouponStatus("0");
|
||||||
|
shopCouponService.hfStatus(shopCoupon);
|
||||||
|
}
|
||||||
|
//申请退款的状态
|
||||||
|
//处理订单状态
|
||||||
|
orderInfo.setOrderStatus("5");
|
||||||
|
orderInfoService.updateById(orderInfo);
|
||||||
|
if (null!=orderInfo.getBalance()&&orderInfo.getBalance()>0){
|
||||||
|
//1处理积分
|
||||||
|
Long balance = orderInfo.getBalance();
|
||||||
|
JSONObject balanceObject =new JSONObject();
|
||||||
|
balanceObject.put("goodsType",orderInfo.getGoodsType());
|
||||||
|
balanceObject.put("goodsTitle",orderInfo.getGoodsTitle());
|
||||||
|
userBalanceService.refundBalance(orderInfo.getUserId(),balance,balanceObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//log.warn("=========== 根据订单号,做幂等处理 ===========");
|
||||||
|
} finally {
|
||||||
|
//要主动释放锁
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//成功应答
|
||||||
|
Map<String, String> res = new HashMap<>();
|
||||||
|
res.put("code", "SUCCESS");
|
||||||
|
res.put("message", "成功");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,195 @@
|
|||||||
|
package cn.iocoder.yudao.module.payment.controller.app;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||||
|
import cn.iocoder.yudao.module.core.page.PageDomain;
|
||||||
|
import cn.iocoder.yudao.module.core.page.TableSupport;
|
||||||
|
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||||
|
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
||||||
|
import cn.iocoder.yudao.module.payment.entity.commentVo;
|
||||||
|
import cn.iocoder.yudao.module.payment.service.OrderInfoService;
|
||||||
|
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
||||||
|
import cn.iocoder.yudao.module.shop.service.IShopMallPartnersService;
|
||||||
|
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.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/orderApi")
|
||||||
|
@RestController
|
||||||
|
public class OrderApi extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderInfoService orderInfoService;
|
||||||
|
@Autowired
|
||||||
|
private IShopMallPartnersService shopMallPartnersService;
|
||||||
|
@Autowired
|
||||||
|
private AppInspectionPartnerService partnerService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/createOrder")
|
||||||
|
@TenantIgnore
|
||||||
|
public CommonResult createOrder(@RequestBody OrderInfo orderInfo) throws Exception {
|
||||||
|
return CommonResult.success(orderInfoService.createOrder(orderInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/orderDetail")
|
||||||
|
public CommonResult orderDetail(Long goodsId, String type, String title, Integer amount) {
|
||||||
|
return CommonResult.success(orderInfoService.orderDetail(goodsId, type, title, amount));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/pickCarDetail")
|
||||||
|
public CommonResult pickCarDetail(Long pickCarId) {
|
||||||
|
return CommonResult.success(orderInfoService.pickCarDetail(pickCarId));
|
||||||
|
}
|
||||||
|
|
||||||
|
//取消支付
|
||||||
|
@PostMapping("/cancelPay")
|
||||||
|
public CommonResult cancelPay(Long orderId) {
|
||||||
|
orderInfoService.cancelPay(orderId);
|
||||||
|
return CommonResult.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/orderList")
|
||||||
|
public CommonResult orderList(String status, String title,
|
||||||
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<OrderInfo> orderInfos = orderInfoService.orderList(page,status, title);
|
||||||
|
return success(orderInfos);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用于自营维修保养核销
|
||||||
|
@PostMapping("/validation")
|
||||||
|
public CommonResult validation(@RequestBody Map<String, Object> requestBody) {
|
||||||
|
Object accessCodeValue = requestBody.get("accessCode");
|
||||||
|
if (accessCodeValue != null) {
|
||||||
|
String accessCode = accessCodeValue.toString();
|
||||||
|
return CommonResult.success(orderInfoService.validation(accessCode));
|
||||||
|
} else {
|
||||||
|
return CommonResult.error(500,"核销码错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 用于商城核销
|
||||||
|
@PostMapping("/validationMall")
|
||||||
|
public CommonResult validationMall(@RequestBody Map<String, Object> requestBody) {
|
||||||
|
Object accessCodeValue = requestBody.get("accessCode");
|
||||||
|
if (accessCodeValue != null) {
|
||||||
|
String accessCode = accessCodeValue.toString();
|
||||||
|
return CommonResult.success(orderInfoService.validationMall(accessCode));
|
||||||
|
} else {
|
||||||
|
return CommonResult.error(500,"核销码错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 核销记录By核销人Id 微信端
|
||||||
|
@GetMapping("/validationListWx")
|
||||||
|
public CommonResult validationListWx(@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<OrderInfo> list = orderInfoService.validationListWx(page);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 商城核销记录By核销人Id PC
|
||||||
|
@GetMapping("/validationListPc")
|
||||||
|
public CommonResult validationListPc(@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<OrderInfo> list = orderInfoService.validationListPc(page);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//评论商品和星级
|
||||||
|
@PostMapping("/reviewOrder")
|
||||||
|
public CommonResult reviewOrder(String orderId, Integer starLevel, String reviewStr) throws Exception {
|
||||||
|
orderInfoService.reviewOrder(orderId, starLevel, reviewStr);
|
||||||
|
return CommonResult.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询检测订单列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/orderListSystem")
|
||||||
|
public CommonResult orderListSystem(OrderInfo shopInspectionOrder,
|
||||||
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<OrderInfo> list = orderInfoService.orderListSystem(page,shopInspectionOrder);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单评价
|
||||||
|
*/
|
||||||
|
|
||||||
|
@PostMapping("/commentOrder")
|
||||||
|
public CommonResult commentOrder(@RequestBody OrderInfo orderInfo) throws Exception {
|
||||||
|
OrderInfo curOrderInfo = orderInfoService.getById(orderInfo.getId());
|
||||||
|
if (!Objects.equals(curOrderInfo.getUserId(), getUserId())) {
|
||||||
|
return CommonResult.error(500,"非当前用户订单,禁止评论");
|
||||||
|
}
|
||||||
|
return CommonResult.success(orderInfoService.commentOrder(orderInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取尚未评价的订单
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/getNoCommentOrder")
|
||||||
|
public CommonResult getNoCommentOrder() {
|
||||||
|
return CommonResult.success(orderInfoService.getNoCommentOrder());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取商品的评价列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
@GetMapping("/getCommentOrderList")
|
||||||
|
public CommonResult getCommentOrderList(
|
||||||
|
@RequestParam(value = "tenantId" ,required = false ,defaultValue = "1") Long tenantId,
|
||||||
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
|
//判断商家是否开启评论区
|
||||||
|
// ShopMallPartners partners = partnerService.getById(partnerId);
|
||||||
|
// if (StringUtils.isEmpty(partners.getOpenComment())||partners.getOpenComment().equals("0")){
|
||||||
|
// return success(new ArrayList<>());
|
||||||
|
// }
|
||||||
|
Page<commentVo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<commentVo> commentOrderList = orderInfoService.getCommentOrderList(page,tenantId);
|
||||||
|
return success(commentOrderList);
|
||||||
|
}
|
||||||
|
|
||||||
|
// pc端合作商订单列表
|
||||||
|
@GetMapping("/listPc")
|
||||||
|
public CommonResult listPc(OrderInfo orderInfo,
|
||||||
|
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||||
|
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||||
|
// 当前合作商的商品
|
||||||
|
ShopMallPartners shopMallPartners = shopMallPartnersService.selectShopMallPartnersByUserId(getUserId(),"sc");
|
||||||
|
orderInfo.setPartnerId(shopMallPartners.getPartnerId());
|
||||||
|
PageDomain pageDomain = TableSupport.getPageDomain();
|
||||||
|
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
||||||
|
IPage<OrderInfo> list = orderInfoService.orderListPc(page,orderInfo);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getOrderInfo/{id}")
|
||||||
|
public CommonResult getOrderInfo(@PathVariable("id") Long id) throws Exception {
|
||||||
|
OrderInfo curOrderInfo = orderInfoService.getById(id);
|
||||||
|
if (!Objects.equals(curOrderInfo.getUserId(), getUserId())) {
|
||||||
|
return CommonResult.error(500,"非当前用户订单");
|
||||||
|
}
|
||||||
|
return CommonResult.success(curOrderInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -111,6 +111,10 @@ public class OrderInfo extends TenantBaseDO {
|
|||||||
* 出纳确认备注
|
* 出纳确认备注
|
||||||
*/
|
*/
|
||||||
private String cashierConfirmRemark;
|
private String cashierConfirmRemark;
|
||||||
|
/**
|
||||||
|
* 出纳确认时间
|
||||||
|
*/
|
||||||
|
private Date cashierConfirmTime;
|
||||||
/**
|
/**
|
||||||
* 出纳人
|
* 出纳人
|
||||||
*/
|
*/
|
||||||
@ -123,6 +127,10 @@ public class OrderInfo extends TenantBaseDO {
|
|||||||
* 会计确认备注
|
* 会计确认备注
|
||||||
*/
|
*/
|
||||||
private String accountingConfirmRemark;
|
private String accountingConfirmRemark;
|
||||||
|
/**
|
||||||
|
* 会计确认时间
|
||||||
|
*/
|
||||||
|
private Date accountingConfirmTime;
|
||||||
/**
|
/**
|
||||||
* 出纳人
|
* 出纳人
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -333,6 +333,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
createOrder.setDriverLicenesImg(orderInfo.getDriverLicenesImg());
|
createOrder.setDriverLicenesImg(orderInfo.getDriverLicenesImg());
|
||||||
createOrder.setIsPayOnline(orderInfo.getIsPayOnline());
|
createOrder.setIsPayOnline(orderInfo.getIsPayOnline());
|
||||||
createOrder.setIsPickCar(orderInfo.getIsPickCar());
|
createOrder.setIsPickCar(orderInfo.getIsPickCar());
|
||||||
|
createOrder.setTenantId(orderInfo.getTenantId());
|
||||||
|
|
||||||
if (isCoupon.equals("1")) {
|
if (isCoupon.equals("1")) {
|
||||||
createOrder.setCouponId(orderInfo.getCouponId());
|
createOrder.setCouponId(orderInfo.getCouponId());
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.shop.controller.app;
|
package cn.iocoder.yudao.module.shop.controller.app;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
|
||||||
import cn.iocoder.yudao.module.inspection.service.IInspectionAppointmentService;
|
import cn.iocoder.yudao.module.inspection.service.IInspectionAppointmentService;
|
||||||
@ -29,6 +30,7 @@ public class SmallAppShopController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/appointmentInspection")
|
@PostMapping("/appointmentInspection")
|
||||||
@TenantIgnore
|
@TenantIgnore
|
||||||
|
@PreAuthenticated
|
||||||
public CommonResult appointmentInspection(@RequestBody InspectionAppointment appointment) throws ParseException {
|
public CommonResult appointmentInspection(@RequestBody InspectionAppointment appointment) throws ParseException {
|
||||||
return success(appointmentService.appointmentInspection(appointment));
|
return success(appointmentService.appointmentInspection(appointment));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -87,5 +87,21 @@ public class ShopCoupon extends TenantBaseDO
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Map<String,Object> params;
|
private Map<String,Object> params;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String beginStartTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String beginExpirationTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String endExpirationTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Date beginUseTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Date endUseTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -69,7 +69,7 @@ public interface ShopCouponMapper extends BaseMapper<ShopCoupon>
|
|||||||
*/
|
*/
|
||||||
public int deleteShopCouponByCouponIds(Long[] couponIds);
|
public int deleteShopCouponByCouponIds(Long[] couponIds);
|
||||||
|
|
||||||
IPage<ShopCoupon> selectShopCouponByUserId(Page<ShopCoupon> page, @Param("vo") ShopCoupon shopCoupon);
|
IPage<ShopCoupon> selectShopCouponByUserId(@Param("page") Page<ShopCoupon> page, @Param("vo") ShopCoupon shopCoupon);
|
||||||
|
|
||||||
IPage<ShopCoupon> availableCouponsListByUserId(Page<ShopCoupon> page, @Param("vo") ShopCoupon shopCoupon);
|
IPage<ShopCoupon> availableCouponsListByUserId(Page<ShopCoupon> page, @Param("vo") ShopCoupon shopCoupon);
|
||||||
|
|
||||||
|
|||||||
@ -717,6 +717,9 @@ FROM
|
|||||||
<if test="query.customerSource!=null and query.customerSource!=''">
|
<if test="query.customerSource!=null and query.customerSource!=''">
|
||||||
AND ii.customer_source = #{query.customerSource}
|
AND ii.customer_source = #{query.customerSource}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="query.businessChannel!=null and query.businessChannel!=''">
|
||||||
|
AND ii.business_channel = #{query.businessChannel}
|
||||||
|
</if>
|
||||||
<if test="query.carModelOrCarYear!=null and query.carModelOrCarYear!=''">
|
<if test="query.carModelOrCarYear!=null and query.carModelOrCarYear!=''">
|
||||||
AND ( ii.car_model LIKE concat('%',#{query.carModelOrCarYear},'%')
|
AND ( ii.car_model LIKE concat('%',#{query.carModelOrCarYear},'%')
|
||||||
OR ii.car_num LIKE concat('%',#{query.carModelOrCarYear},'%') )
|
OR ii.car_num LIKE concat('%',#{query.carModelOrCarYear},'%') )
|
||||||
|
|||||||
@ -111,21 +111,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
CONVERT(suc.car_model USING utf8mb4) COLLATE utf8mb4_general_ci AS car_model,
|
CONVERT(suc.car_model USING utf8mb4) COLLATE utf8mb4_general_ci AS car_model,
|
||||||
CONVERT(suc.car_no USING utf8mb4) COLLATE utf8mb4_general_ci AS car_no,
|
CONVERT(suc.car_no USING utf8mb4) COLLATE utf8mb4_general_ci AS car_no,
|
||||||
CONVERT(igs.sku_name USING utf8mb4) COLLATE utf8mb4_general_ci AS sku_name,
|
CONVERT(igs.sku_name USING utf8mb4) COLLATE utf8mb4_general_ci AS sku_name,
|
||||||
CONVERT("" USING utf8mb4) COLLATE utf8mb4_general_ci AS customerSource,
|
CONVERT(ip.customer_source USING utf8mb4) COLLATE utf8mb4_general_ci AS customerSource,
|
||||||
ip.create_time AS createTime,
|
ip.create_time AS createTime,
|
||||||
CONVERT('appointment' USING utf8mb4) COLLATE utf8mb4_general_ci AS sourceType
|
CONVERT('appointment' USING utf8mb4) COLLATE utf8mb4_general_ci AS sourceType
|
||||||
FROM inspection_appointment ip
|
FROM inspection_appointment ip
|
||||||
INNER JOIN system_users su ON ip.user_id = su.id AND ip.tenant_id = 180 AND su.tenant_id = 180
|
INNER JOIN system_users su ON ip.user_id = su.id
|
||||||
LEFT JOIN order_info oi ON ip.order_id = oi.id AND oi.deleted=0 AND oi.tenant_id=180
|
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 AND suc.tenant_id=180
|
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 AND igs.tenant_id=180
|
LEFT JOIN inspection_goods_sku igs ON igs.id = ip.sku_id
|
||||||
WHERE ip.deleted=0 AND oi.validation_time IS NULL
|
WHERE ip.deleted=0 AND oi.validation_time IS NULL
|
||||||
<if test="phoneNum!=null and phoneNum!=''">
|
<if test="phoneNum!=null and phoneNum!=''">
|
||||||
AND (su.mobile LIKE concat('%',#{phoneNum},'%') OR ip.car_no LIKE concat('%',#{phoneNum},'%'))
|
AND (su.mobile LIKE concat('%',#{phoneNum},'%') OR ip.car_no LIKE concat('%',#{phoneNum},'%'))
|
||||||
</if>
|
</if>
|
||||||
<if test="partnerId!=null and partnerId!=''">
|
|
||||||
AND ip.partner_id = #{partnerId}
|
|
||||||
</if>
|
|
||||||
<if test="carNo != null and carNo != ''">
|
<if test="carNo != null and carNo != ''">
|
||||||
AND ip.car_no LIKE concat('%',#{carNo},'%')
|
AND ip.car_no LIKE concat('%',#{carNo},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -4,4 +4,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper">
|
<mapper namespace="cn.iocoder.yudao.module.inspection.mapper.InspectionBusinessChannelMapper">
|
||||||
|
|
||||||
|
<select id="getBusinessChannelByUserId" parameterType="java.lang.Long">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM inspection_business_channel
|
||||||
|
WHERE FIND_IN_SET(#{userId}, user_ids)
|
||||||
|
ORDER BY sort ASC
|
||||||
|
limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -701,8 +701,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="pageWorkOrderNew" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
<select id="pageWorkOrderNew" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||||
select distinct ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
select distinct ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as
|
||||||
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,oi.cashier_confirm,oi.cashier_confirm_remark,oi.accounting_confirm,oi.accounting_confirm_remark
|
realPayMoney
|
||||||
|
,oi.pay_type,oi.order_status as
|
||||||
|
orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,oi.cashier_confirm,oi.cashier_confirm_remark,oi.cashier_confirm_time ,oi.accounting_confirm,oi.accounting_confirm_remark
|
||||||
from inspection_info ins
|
from inspection_info ins
|
||||||
left join order_info oi on oi.id = ins.inspection_order_id
|
left join order_info oi on oi.id = ins.inspection_order_id
|
||||||
left join system_users su on su.id = ins.user_id
|
left join system_users su on su.id = ins.user_id
|
||||||
@ -725,7 +727,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND TIMESTAMPDIFF(YEAR, ins.car_register_date, CURDATE()) < #{query.carYear} + 1)
|
AND TIMESTAMPDIFF(YEAR, ins.car_register_date, CURDATE()) < #{query.carYear} + 1)
|
||||||
</if>
|
</if>
|
||||||
<if test="query.payType!=null and query.payType!=''">
|
<if test="query.payType!=null and query.payType!=''">
|
||||||
and oi.pay_type = #{query.payType}
|
and oi.pay_type = #{query.payType}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.startTime!=null and query.startTime!=''">
|
<if test="query.startTime!=null and query.startTime!=''">
|
||||||
and ins.start_time between #{query.startTime} and #{query.endTime}
|
and ins.start_time between #{query.startTime} and #{query.endTime}
|
||||||
@ -733,13 +735,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="query.datetimeRange != null">
|
<if test="query.datetimeRange != null">
|
||||||
and ins.start_time between #{query.datetimeRange[0]} and #{query.datetimeRange[1]}
|
and ins.start_time between #{query.datetimeRange[0]} and #{query.datetimeRange[1]}
|
||||||
</if>
|
</if>
|
||||||
<if test="query.payStatus == 0">
|
<if test="query.payStatus == 0">
|
||||||
and (oi.pay_money is null OR oi.pay_type = 'sz')
|
and (oi.pay_money is null OR oi.pay_type = 'sz')
|
||||||
</if>
|
</if>
|
||||||
<if test="query.payStatus == 1">
|
<if test="query.payStatus == 1">
|
||||||
and oi.pay_time is not null AND oi.pay_type != 'sz'
|
and oi.pay_time is not null AND oi.pay_type != 'sz'
|
||||||
</if>
|
</if>
|
||||||
order by ins.start_time desc
|
<if test="query.payStatus == 2">
|
||||||
|
and oi.cashier_confirm = 1
|
||||||
|
and (oi.accounting_confirm is null or oi.accounting_confirm != 1)
|
||||||
|
</if>
|
||||||
|
order by ins.start_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="workOrderDataNew" resultType="java.util.Map">
|
<select id="workOrderDataNew" resultType="java.util.Map">
|
||||||
select ifnull(sum(case when oi.pay_type != 'sz' then oi.pay_money else 0 end), 0) as payMoneySum
|
select ifnull(sum(case when oi.pay_type != 'sz' then oi.pay_money else 0 end), 0) as payMoneySum
|
||||||
|
|||||||
@ -140,7 +140,8 @@
|
|||||||
iss.emergency_contact_phone,
|
iss.emergency_contact_phone,
|
||||||
iss.driver_license_type,
|
iss.driver_license_type,
|
||||||
iss.folder_id,
|
iss.folder_id,
|
||||||
iss.unique_code
|
iss.unique_code,
|
||||||
|
iss.tenant_id
|
||||||
FROM inspection_staff iss
|
FROM inspection_staff iss
|
||||||
inner join system_users su on iss.user_id = su.id
|
inner join system_users su on iss.user_id = su.id
|
||||||
<where>
|
<where>
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
*
|
*
|
||||||
FROM
|
FROM
|
||||||
`order_info`
|
`order_info`
|
||||||
where user_id =#{userId} and order_status!= '0'
|
where user_id =#{userId}
|
||||||
<if test="status!=null and status!='' ">
|
<if test="status!=null and status!='' ">
|
||||||
and order_status = #{status}
|
and order_status = #{status}
|
||||||
</if>
|
</if>
|
||||||
@ -141,7 +141,12 @@
|
|||||||
left join order_info oi on oi.id = info.inspection_order_id
|
left join order_info oi on oi.id = info.inspection_order_id
|
||||||
LEFT JOIN base_company company ON company.tenant_id = info.tenant_id AND company.service_codes LIKE '%jiance%' AND company.deleted = '0'
|
LEFT JOIN base_company company ON company.tenant_id = info.tenant_id AND company.service_codes LIKE '%jiance%' AND company.deleted = '0'
|
||||||
WHERE info.user_id = #{userId}
|
WHERE info.user_id = #{userId}
|
||||||
and info.status = #{status}
|
<if test="status ==0 ">
|
||||||
|
and info.status in (0,2)
|
||||||
|
</if>
|
||||||
|
<if test="status ==1 ">
|
||||||
|
and info.status in (1)
|
||||||
|
</if>
|
||||||
GROUP BY info.id
|
GROUP BY info.id
|
||||||
order by info.create_time desc
|
order by info.create_time desc
|
||||||
</select>
|
</select>
|
||||||
@ -237,6 +242,9 @@
|
|||||||
order_info oi
|
order_info oi
|
||||||
LEFT JOIN inspection_info info ON oi.id = info.inspection_order_id
|
LEFT JOIN inspection_info info ON oi.id = info.inspection_order_id
|
||||||
where comment_star is not null
|
where comment_star is not null
|
||||||
|
<if test="tenantId != null">
|
||||||
|
and oi.tenant_id = #{tenantId}
|
||||||
|
</if>
|
||||||
ORDER BY comment_time desc
|
ORDER BY comment_time desc
|
||||||
</select>
|
</select>
|
||||||
<select id="pageOrderListSystem" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
|
<select id="pageOrderListSystem" resultType="cn.iocoder.yudao.module.payment.entity.OrderInfo">
|
||||||
|
|||||||
@ -82,9 +82,9 @@
|
|||||||
<if test="vo.userId != null "> and sys_user.id = #{vo.userId}</if>
|
<if test="vo.userId != null "> and sys_user.id = #{vo.userId}</if>
|
||||||
<if test="vo.orderId != null "> and order_id = #{vo.orderId}</if>
|
<if test="vo.orderId != null "> and order_id = #{vo.orderId}</if>
|
||||||
<if test="vo.phonenumber != null and vo.phonenumber != ''"> and phonenumber like concat('%', #{vo.phonenumber}, '%')</if>
|
<if test="vo.phonenumber != null and vo.phonenumber != ''"> and phonenumber like concat('%', #{vo.phonenumber}, '%')</if>
|
||||||
<if test="params.beginStartTime != null and params.beginStartTime != '' and params.endStartTime != null and params.endStartTime != ''"> and start_time between #{params.beginStartTime} and #{params.endStartTime}</if>
|
<if test="vo.beginStartTime != null and vo.beginStartTime != '' and vo.endStartTime != null and vo.endStartTime != ''"> and start_time between #{vo.beginStartTime} and #{vo.endStartTime}</if>
|
||||||
<if test="params.beginExpirationTime != null and params.beginExpirationTime != '' and params.endExpirationTime != null and params.endExpirationTime != ''"> and expiration_time between #{params.beginExpirationTime} and #{params.endExpirationTime}</if>
|
<if test="vo.beginExpirationTime != null and vo.beginExpirationTime != '' and vo.endExpirationTime != null and vo.endExpirationTime != ''"> and expiration_time between #{vo.beginExpirationTime} and #{params.endExpirationTime}</if>
|
||||||
<if test="params.beginUseTime != null and params.beginUseTime != '' and params.endUseTime != null and params.endUseTime != ''"> and use_time between #{params.beginUseTime} and #{params.endUseTime}</if>
|
<if test="vo.beginUseTime != null and vo.beginUseTime != '' and vo.endUseTime != null and vo.endUseTime != ''"> and use_time between #{vo.beginUseTime} and #{vo.endUseTime}</if>
|
||||||
<if test="vo.couponStatus != null and vo.couponStatus != ''">
|
<if test="vo.couponStatus != null and vo.couponStatus != ''">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="vo.couponStatus=='0'.toString()">
|
<when test="vo.couponStatus=='0'.toString()">
|
||||||
|
|||||||
@ -416,7 +416,11 @@ public class AppSysLoginController {
|
|||||||
public CommonResult getAppInfo()
|
public CommonResult getAppInfo()
|
||||||
{
|
{
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
if (loginUser == null) {
|
||||||
|
throw new RuntimeException("请登录");
|
||||||
|
}
|
||||||
AdminUserDO user = userService.getUser(loginUser.getId());
|
AdminUserDO user = userService.getUser(loginUser.getId());
|
||||||
|
|
||||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(user.getId());
|
||||||
List<RoleDO> roleList = roleService.getRoleList(roleIdsByUserId);
|
List<RoleDO> roleList = roleService.getRoleList(roleIdsByUserId);
|
||||||
Map<String,Object> ajax = new HashMap<>();
|
Map<String,Object> ajax = new HashMap<>();
|
||||||
|
|||||||
@ -57,4 +57,6 @@ public interface UserRoleMapper extends BaseMapperX<UserRoleDO> {
|
|||||||
List<UserDTO> selectByRoleIds(@Param("roleIds") List<Integer> roleIds);
|
List<UserDTO> selectByRoleIds(@Param("roleIds") List<Integer> roleIds);
|
||||||
|
|
||||||
List<UserDTO> selectByRoleCodes(@Param("codes") List<String> codes);
|
List<UserDTO> selectByRoleCodes(@Param("codes") List<String> codes);
|
||||||
|
|
||||||
|
List<UserDTO> selectByRoleCodesAndTenantId(@Param("codes") List<String> codes, @Param("tenantId") Long tenantId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -204,4 +204,12 @@ public interface RoleService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<UserDTO> getUserListByCodes(List<String> codes);
|
List<UserDTO> getUserListByCodes(List<String> codes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色code查询用户
|
||||||
|
*
|
||||||
|
* @param codes 角色code数组
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<UserDTO> getUserListByCodesAndTenantId(List<String> codes, Long tenantId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -412,6 +412,17 @@ public class RoleServiceImpl implements RoleService {
|
|||||||
return userRoleMapper.selectByRoleCodes(codes);
|
return userRoleMapper.selectByRoleCodes(codes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据角色code查询用户
|
||||||
|
*
|
||||||
|
* @param codes 角色code数组
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<UserDTO> getUserListByCodesAndTenantId(List<String> codes, Long tenantId) {
|
||||||
|
return userRoleMapper.selectByRoleCodesAndTenantId(codes, tenantId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得自身的代理对象,解决 AOP 生效问题
|
* 获得自身的代理对象,解决 AOP 生效问题
|
||||||
*
|
*
|
||||||
|
|||||||
@ -109,4 +109,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
) AND sur.deleted = 0
|
) AND sur.deleted = 0
|
||||||
) AND deleted = 0
|
) AND deleted = 0
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectByRoleCodesAndTenantId" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM
|
||||||
|
system_users
|
||||||
|
WHERE
|
||||||
|
id IN (
|
||||||
|
SELECT
|
||||||
|
user_id
|
||||||
|
FROM
|
||||||
|
system_user_role sur
|
||||||
|
WHERE
|
||||||
|
sur.role_id IN (
|
||||||
|
SELECT
|
||||||
|
id
|
||||||
|
FROM
|
||||||
|
system_role
|
||||||
|
WHERE
|
||||||
|
code IN
|
||||||
|
<foreach item="item" collection="codes" open="(" separator="," close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
AND tenant_id = #{tenantId}
|
||||||
|
) AND sur.deleted = 0
|
||||||
|
) AND deleted = 0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user