1
This commit is contained in:
parent
4e5a0d3f63
commit
f6511ea3b0
@ -12,6 +12,7 @@ import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.core.text.Convert;
|
||||
import cn.iocoder.yudao.module.core.text.ServletUtils;
|
||||
import cn.iocoder.yudao.module.label.vo.LabelRespVO;
|
||||
import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
||||
import cn.iocoder.yudao.module.payment.service.OrderInfoService;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
||||
@ -21,6 +22,7 @@ import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||
@ -98,7 +100,7 @@ public class InspectionMallPartnersController extends BaseController {
|
||||
* 工单管理
|
||||
*/
|
||||
@GetMapping("/workOrder")
|
||||
public TableDataInfo workOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum)
|
||||
public CommonResult<IPage<?>> workOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum)
|
||||
{
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId());
|
||||
@ -110,33 +112,24 @@ public class InspectionMallPartnersController extends BaseController {
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
partner = shopMallPartnersService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
TableDataInfo dataInfo =new TableDataInfo();
|
||||
dataInfo.setCode(500);
|
||||
dataInfo.setRows(new ArrayList<>());
|
||||
dataInfo.setMsg("信息有误");
|
||||
return dataInfo;
|
||||
return error();
|
||||
}
|
||||
}else if (roles.contains("jcworker")){
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapperWork =new LambdaQueryWrapper<>();
|
||||
queryWrapperWork.eq(PartnerWorker::getUserId,user.getId());
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork);
|
||||
if (ObjectUtil.isEmpty(worker)){
|
||||
TableDataInfo dataInfo =new TableDataInfo();
|
||||
dataInfo.setCode(500);
|
||||
dataInfo.setRows(new ArrayList<>());
|
||||
dataInfo.setMsg("信息有误");
|
||||
return dataInfo;
|
||||
return error();
|
||||
}
|
||||
partner.setPartnerId(worker.getPartnerId());
|
||||
}
|
||||
// Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<InspectionInfo> list = orderInfoService.workOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime);
|
||||
return getDataTable(list);
|
||||
Page<InspectionInfo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionInfo> list = orderInfoService.pageWorkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime,page);
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/delWorkOrder")
|
||||
public TableDataInfo delWorkOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum)
|
||||
public CommonResult<IPage<?>> delWorkOrder(String carNum,String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime,Integer pageSize,Integer pageNum)
|
||||
{
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
Set<Long> userRoleIdListByUserId = permissionService.getUserRoleIdListByUserId(user.getId());
|
||||
@ -150,29 +143,24 @@ public class InspectionMallPartnersController extends BaseController {
|
||||
queryWrapper.eq(ShopMallPartners::getUserId,user.getId()).eq(ShopMallPartners::getType,"jc").eq(ShopMallPartners::getIsBanned,"0");
|
||||
partner = shopMallPartnersService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(partner)){
|
||||
TableDataInfo dataInfo =new TableDataInfo();
|
||||
dataInfo.setCode(500);
|
||||
dataInfo.setRows(new ArrayList<>());
|
||||
dataInfo.setMsg("信息有误");
|
||||
return dataInfo;
|
||||
return error();
|
||||
}
|
||||
}else if (roles.contains("jcworker")){
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapperWork =new LambdaQueryWrapper<>();
|
||||
queryWrapperWork.eq(PartnerWorker::getUserId,user.getId());
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapperWork);
|
||||
if (ObjectUtil.isEmpty(worker)){
|
||||
TableDataInfo dataInfo =new TableDataInfo();
|
||||
dataInfo.setCode(500);
|
||||
dataInfo.setRows(new ArrayList<>());
|
||||
dataInfo.setMsg("信息有误");
|
||||
return dataInfo;
|
||||
return error();
|
||||
}
|
||||
partner.setPartnerId(worker.getPartnerId());
|
||||
}
|
||||
// Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
||||
PageHelper.startPage(pageNum,pageSize);
|
||||
List<InspectionInfo> list = orderInfoService.delworkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime);
|
||||
return getDataTable(list);
|
||||
Page<InspectionInfo> page = new Page<>(pageNum, pageSize);
|
||||
|
||||
// List<InspectionInfo> list = orderInfoService.delworkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime);
|
||||
IPage<InspectionInfo> list = orderInfoService.pageWorkOrder(partner.getPartnerId(),carNum,goodsTitle, customerSource, payType,startTime,roleId,endTime,page);
|
||||
|
||||
return CommonResult.success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/exportWorkOrder")
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionInfo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -69,11 +70,18 @@ public interface InspectionInfoMapper extends BaseMapper<InspectionInfo>
|
||||
List<InspectionInfo> workOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle
|
||||
, @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime
|
||||
, @Param("roleId") Long roleId, @Param("endTime")String endTime);
|
||||
IPage<InspectionInfo> pageWorkOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle
|
||||
, @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime
|
||||
, @Param("roleId") Long roleId, @Param("endTime")String endTime,Page<InspectionInfo> page);
|
||||
|
||||
List<InspectionInfo> delworkOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle
|
||||
,@Param("customerSource")String customerSource,@Param("payType")String payType,@Param("startTime")String startTime
|
||||
,@Param("roleId") Long roleId,@Param("endTime")String endTime);
|
||||
|
||||
IPage<InspectionInfo> pageDelWorkOrder(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle
|
||||
, @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime
|
||||
, @Param("roleId") Long roleId, @Param("endTime")String endTime,Page<InspectionInfo> page);
|
||||
|
||||
Map<String, Object> workOrderData(@Param("partnerId") Long partnerId, @Param("carNum")String carNum, @Param("goodsTitle")String goodsTitle
|
||||
, @Param("customerSource")String customerSource, @Param("payType")String payType, @Param("startTime")String startTime
|
||||
, @Param("roleId") Long roleId, @Param("endTime")String endTime);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.inspection.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionInfo;
|
||||
@ -62,9 +63,15 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteInspectionInfoById(Long id);
|
||||
|
||||
List<InspectionInfo> workOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime);
|
||||
|
||||
IPage<InspectionInfo> pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page<InspectionInfo> page);
|
||||
|
||||
|
||||
List<InspectionInfo> delworkOrder(Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime);
|
||||
|
||||
IPage<InspectionInfo> pageDelWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page<InspectionInfo> page);
|
||||
|
||||
Map<String,Object> workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime);
|
||||
|
||||
|
@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.util.SendSmsUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.iocoder.yudao.util.StringUtils;
|
||||
@ -301,11 +302,21 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
return baseMapper.workOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InspectionInfo> pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page<InspectionInfo> page) {
|
||||
return baseMapper.pageWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime,page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InspectionInfo> delworkOrder(Long partnerId, String carNum, String goodsTitle,String customerSource,String payType,String startTime,Long roleId,String endTime){
|
||||
return baseMapper.delworkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InspectionInfo> pageDelWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page<InspectionInfo> page) {
|
||||
return baseMapper.pageDelWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime,page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) {
|
||||
return baseMapper.workOrderData(partnerId,carNum,goodsTitle, customerSource, payType, startTime,roleId,endTime);
|
||||
|
@ -27,10 +27,14 @@ public interface OrderInfoService extends IService<OrderInfo> {
|
||||
|
||||
List<InspectionInfo> workOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime);
|
||||
|
||||
IPage<InspectionInfo> pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page<InspectionInfo> page);
|
||||
|
||||
Map<String, Object> workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime);
|
||||
|
||||
List<InspectionInfo> delworkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime);
|
||||
|
||||
IPage<InspectionInfo> pageDelworkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime,Page<InspectionInfo> page);
|
||||
|
||||
List<OrderInfo> orderListSystem(OrderInfo orderInfo);
|
||||
|
||||
/**
|
||||
|
@ -117,6 +117,18 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
return iInspectionInfoService.workOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InspectionInfo> pageWorkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page<InspectionInfo> page) {
|
||||
if (StringUtils.isNotEmpty(startTime)){
|
||||
startTime = startTime+" 00:00:00";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(endTime)){
|
||||
endTime = endTime+" 23:59:59";
|
||||
}
|
||||
|
||||
return iInspectionInfoService.pageWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime,page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> workOrderData(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime) {
|
||||
if (StringUtils.isNotEmpty(startTime)){
|
||||
@ -139,6 +151,17 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
||||
return iInspectionInfoService.delworkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<InspectionInfo> pageDelworkOrder(Long partnerId, String carNum, String goodsTitle, String customerSource, String payType, String startTime, Long roleId, String endTime, Page<InspectionInfo> page) {
|
||||
if (StringUtils.isNotEmpty(startTime)){
|
||||
startTime = startTime+" 00:00:00";
|
||||
}
|
||||
if (StringUtils.isNotEmpty(endTime)){
|
||||
endTime = endTime+" 23:59:59";
|
||||
}
|
||||
return iInspectionInfoService.pageDelWorkOrder(partnerId,carNum,goodsTitle, customerSource, payType, startTime, roleId,endTime,page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderInfo> orderListSystem(OrderInfo orderInfo) {
|
||||
return baseMapper.orderListSystem(orderInfo);
|
||||
|
@ -208,4 +208,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and ins.start_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
</select>
|
||||
<select id="pageWorkOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
select ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
||||
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time
|
||||
from inspection_info ins
|
||||
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_user_role sur on sur.user_id = su.id
|
||||
where 1=1
|
||||
<if test="carNum!=null and carNum!=''">
|
||||
and ins.car_num like concat('%',#{carNum},'%')
|
||||
</if>
|
||||
<if test="goodsTitle!=null and goodsTitle!=''">
|
||||
and oi.goods_title like concat('%',#{goodsTitle},'%')
|
||||
</if>
|
||||
<if test="roleId!=null and roleId!=''">
|
||||
and sur.role_id = #{roleId}
|
||||
</if>
|
||||
|
||||
<if test="customerSource!=null and customerSource!=''">
|
||||
and ins.customer_source =#{customerSource}
|
||||
</if>
|
||||
<if test="payType!=null and payType!=''">
|
||||
and oi.pay_type = #{payType}
|
||||
</if>
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and ins.start_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
order by ins.start_time desc
|
||||
</select>
|
||||
<select id="pageDelWorkOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
select ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
||||
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time
|
||||
from del_inspection_info ins
|
||||
left join del_order_info oi on oi.id = ins.inspection_order_id
|
||||
left join system_users su on su.id = ins.user_id
|
||||
left join system_user_role sur on sur.user_id = su.id
|
||||
where 1=1
|
||||
<if test="carNum!=null and carNum!=''">
|
||||
and ins.car_num like concat('%',#{carNum},'%')
|
||||
</if>
|
||||
<if test="goodsTitle!=null and goodsTitle!=''">
|
||||
and oi.goods_title like concat('%',#{goodsTitle},'%')
|
||||
</if>
|
||||
<if test="roleId!=null and roleId!=''">
|
||||
and sur.role_id = #{roleId}
|
||||
</if>
|
||||
|
||||
<if test="customerSource!=null and customerSource!=''">
|
||||
and ins.customer_source =#{customerSource}
|
||||
</if>
|
||||
<if test="payType!=null and payType!=''">
|
||||
and oi.pay_type = #{payType}
|
||||
</if>
|
||||
<if test="startTime!=null and startTime!=''">
|
||||
and ins.start_time between #{startTime} and #{endTime}
|
||||
</if>
|
||||
order by ins.start_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user