大屏接口调整、维护地区(area)字段

master
luojian 2025-01-17 11:03:36 +08:00
parent 0efe7b0fc3
commit 3b0eb0bb97
14 changed files with 307 additions and 24 deletions

View File

@ -276,30 +276,32 @@ public class LargeScreenController extends BaseController {
LambdaQueryWrapper<BizCustomerRouteShop> queryWrapper1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BizCustomerRouteShop> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.eq(BizCustomerRouteShop::getRouteId,bizCustomerRoute.getId()); queryWrapper1.eq(BizCustomerRouteShop::getRouteId,bizCustomerRoute.getId());
List<BizCustomerRouteShop> bizCustomerRouteShops = bizCustomerRouteShopMapper.selectList(queryWrapper1); List<BizCustomerRouteShop> bizCustomerRouteShops = bizCustomerRouteShopMapper.selectList(queryWrapper1);
List<Long> shopIdList = bizCustomerRouteShops.stream().map(BizCustomerRouteShop::getShopId).collect(Collectors.toList()); if (bizCustomerRouteShops.size() != 0){
LambdaQueryWrapper<BizCustomerShop> queryWrapper2 = new LambdaQueryWrapper<>(); List<Long> shopIdList = bizCustomerRouteShops.stream().map(BizCustomerRouteShop::getShopId).collect(Collectors.toList());
queryWrapper2.in(BizCustomerShop::getId,shopIdList); LambdaQueryWrapper<BizCustomerShop> queryWrapper2 = new LambdaQueryWrapper<>();
List<BizCustomerShop> bizCustomerShops = bizCustomerShopMapper.selectList(queryWrapper2); queryWrapper2.in(BizCustomerShop::getId,shopIdList);
for (BizCustomerShop bizCustomerShop : bizCustomerShops) { List<BizCustomerShop> bizCustomerShops = bizCustomerShopMapper.selectList(queryWrapper2);
LambdaQueryWrapper<BizCustomerShopState> queryWrapper3 = new LambdaQueryWrapper<>(); for (BizCustomerShop bizCustomerShop : bizCustomerShops) {
queryWrapper3.eq(BizCustomerShopState::getShopId,bizCustomerShop.getId()); LambdaQueryWrapper<BizCustomerShopState> queryWrapper3 = new LambdaQueryWrapper<>();
BizCustomerShopState bizCustomerShopState = bizCustomerShopStateMapper.selectOne(queryWrapper3); queryWrapper3.eq(BizCustomerShopState::getShopId,bizCustomerShop.getId());
if (bizCustomerShopState != null){ BizCustomerShopState bizCustomerShopState = bizCustomerShopStateMapper.selectOne(queryWrapper3);
bizCustomerShop.setIsFinish(bizCustomerShopState.getIsFinish()); if (bizCustomerShopState != null){
LambdaQueryWrapper<BizOrder> queryWrapper4 = new LambdaQueryWrapper<>(); bizCustomerShop.setIsFinish(bizCustomerShopState.getIsFinish());
queryWrapper4.eq(BizOrder::getOrderSn,bizCustomerShopState.getCurrentOrder()); LambdaQueryWrapper<BizOrder> queryWrapper4 = new LambdaQueryWrapper<>();
BizOrder bizOrder = bizOrderMapper.selectOne(queryWrapper4); queryWrapper4.eq(BizOrder::getOrderSn,bizCustomerShopState.getCurrentOrder());
if (bizOrder != null){ BizOrder bizOrder = bizOrderMapper.selectOne(queryWrapper4);
bizCustomerShop.setCurrentOrder(bizOrder.getOrderSn()); if (bizOrder != null){
bizCustomerShop.setCarNo(bizOrder.getCarNo()); bizCustomerShop.setCurrentOrder(bizOrder.getOrderSn());
bizCustomerShop.setDriveName(bizOrder.getDriverName()); bizCustomerShop.setCarNo(bizOrder.getCarNo());
bizCustomerShop.setCopilotName(bizOrder.getCopilotName()); bizCustomerShop.setDriveName(bizOrder.getDriverName());
bizCustomerShop.setStartTime(bizOrder.getStartTime()); bizCustomerShop.setCopilotName(bizOrder.getCopilotName());
bizCustomerShop.setArriveImg(bizOrder.getArriveImg()); bizCustomerShop.setStartTime(bizOrder.getStartTime());
bizCustomerShop.setArriveImg(bizOrder.getArriveImg());
}
} }
} }
bizCustomerRoute.setShopList(bizCustomerShops);
} }
bizCustomerRoute.setShopList(bizCustomerShops);
largeScreenEntity.setBizCustomerRoute(bizCustomerRoute); largeScreenEntity.setBizCustomerRoute(bizCustomerRoute);
return AjaxResult.success(largeScreenEntity); return AjaxResult.success(largeScreenEntity);
} }

View File

@ -0,0 +1,29 @@
package com.cpxt.web.controller.biz;
import com.cpxt.biz.service.SysAreaService;
import com.cpxt.common.core.controller.BaseController;
import com.cpxt.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* controller
* @author Luo.J
* @date 2024-1-16
*/
@RestController
@RequestMapping("/system/area")
public class SysAreaController extends BaseController
{
@Autowired
private SysAreaService sysAreaService;
/**
*
*/
@GetMapping("/getByParentId")
public AjaxResult getInfo(@RequestParam String parentId)
{
return success(sysAreaService.selectByParentId(parentId));
}
}

View File

@ -3,6 +3,10 @@ package com.cpxt.web.controller.system;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import com.cpxt.biz.domain.BizCustomer;
import com.cpxt.biz.domain.BizDriver;
import com.cpxt.biz.mapper.BizCustomerMapper;
import com.cpxt.biz.mapper.BizDriverMapper;
import com.cpxt.common.annotation.Anonymous; import com.cpxt.common.annotation.Anonymous;
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.GetMapping;
@ -41,6 +45,12 @@ public class SysLoginController
@Autowired @Autowired
private TokenService tokenService; private TokenService tokenService;
@Autowired
private BizDriverMapper bizDriverMapper;
@Autowired
private BizCustomerMapper bizCustomerMapper;
/** /**
* *
* *
@ -85,6 +95,15 @@ public class SysLoginController
{ {
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser user = loginUser.getUser(); SysUser user = loginUser.getUser();
if (user.getUserType().equals("1")){ // 司机
BizDriver bizDriver = bizDriverMapper.selectByUserId(user.getUserId());
user.setLinkId(bizDriver.getId());
}else if (user.getUserType().equals("2")){ // 客户
BizCustomer bizCustomer = bizCustomerMapper.selectByName(user.getNickName());
user.setLinkId(bizCustomer.getId());
}else {
user.setLinkId(user.getUserId());
}
// 角色集合 // 角色集合
Set<String> roles = permissionService.getRolePermission(user); Set<String> roles = permissionService.getRolePermission(user);
// 权限集合 // 权限集合

View File

@ -93,6 +93,16 @@ public class SysUser extends BaseEntity
/** 角色ID */ /** 角色ID */
private Long roleId; private Long roleId;
public Long getLinkId() {
return linkId;
}
public void setLinkId(Long linkId) {
this.linkId = linkId;
}
private Long linkId;
public SysUser() public SysUser()
{ {

View File

@ -121,7 +121,8 @@ public class BizCustomerShop
@TableField(exist = false) @TableField(exist = false)
private Integer isFinish; private Integer isFinish;
@TableField(exist = false)
private String areaFullName;
} }

View File

@ -3,6 +3,7 @@ package com.cpxt.biz.domain;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -76,4 +77,7 @@ public class BizCustomerWarehouse
/** 备注 */ /** 备注 */
private String remark; private String remark;
@TableField(exist = false)
private String areaFullName;
} }

View File

@ -0,0 +1,115 @@
package com.cpxt.biz.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;
/**
*
* @TableName sys_area
*/
@TableName(value ="sys_area")
@Data
public class SysArea implements Serializable {
/**
*
*/
@TableId
private String id;
/**
*
*/
private String name;
/**
*
*/
private String fullName;
/**
*
*/
private String parentId;
/**
*
*/
private String spell;
/**
* 12,3,4
*/
private Integer areaType;
/**
*
*/
private Integer orderNo;
/**
* 012345
*/
private Integer areaLevel;
/**
*
*/
private String remark;
/**
*
*/
private String villageType;
/**
*
*/
private String nation;
/**
*
*/
private String province;
/**
*
*/
private String city;
/**
*
*/
private String county;
/**
*
*/
private String town;
/**
*
*/
private String lng;
/**
*
*/
private String lat;
/**
* 1,2
*/
private Integer mapType;
/**
*
*/
private String isHaveChild;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}

View File

@ -0,0 +1,20 @@
package com.cpxt.biz.mapper;
import com.cpxt.biz.domain.SysArea;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author LuoJian
* @description sys_area()Mapper
* @createDate 2025-01-16 14:22:17
* @Entity com.cpxt.biz.domain.SysArea
*/
@Mapper
public interface SysAreaMapper extends BaseMapper<SysArea> {
}

View File

@ -0,0 +1,17 @@
package com.cpxt.biz.service;
import com.cpxt.biz.domain.SysArea;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @author LuoJian
* @description sys_area()Service
* @createDate 2025-01-16 14:22:17
*/
public interface SysAreaService extends IService<SysArea> {
List<SysArea> selectByParentId(String parentId);
}

View File

@ -53,6 +53,9 @@ public class BizCarStateServiceImpl implements IBizCarStateService
if (ObjectUtil.isNotEmpty(bizCarState.getCarNo())){ if (ObjectUtil.isNotEmpty(bizCarState.getCarNo())){
queryWrapper.eq(BizCarState::getCarNo, bizCarState.getCarNo()); queryWrapper.eq(BizCarState::getCarNo, bizCarState.getCarNo());
} }
if (ObjectUtil.isNotEmpty(bizCarState.getCarId()) && bizCarState.getCarId() != 0){
queryWrapper.eq(BizCarState::getCarId, bizCarState.getCarId());
}
return queryWrapper; return queryWrapper;
} }

View File

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cpxt.biz.domain.BizCustomerRoute; import com.cpxt.biz.domain.BizCustomerRoute;
import com.cpxt.biz.domain.SysArea;
import com.cpxt.biz.mapper.SysAreaMapper;
import com.cpxt.common.utils.DateUtils; import com.cpxt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,6 +29,9 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
@Autowired @Autowired
private BizCustomerShopMapper bizCustomerShopMapper; private BizCustomerShopMapper bizCustomerShopMapper;
@Autowired
private SysAreaMapper sysAreaMapper;
/** /**
* *
* *
@ -36,7 +41,14 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
@Override @Override
public BizCustomerShop selectBizCustomerShopById(Long id) public BizCustomerShop selectBizCustomerShopById(Long id)
{ {
return bizCustomerShopMapper.selectById(id); BizCustomerShop bizCustomerShop = bizCustomerShopMapper.selectById(id);
if (ObjectUtil.isNotEmpty(bizCustomerShop.getArea())){
SysArea sysArea = sysAreaMapper.selectById(bizCustomerShop.getArea());
if (sysArea != null){
bizCustomerShop.setAreaFullName(sysArea.getFullName());
}
}
return bizCustomerShop;
} }
/** /**

View File

@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cpxt.biz.domain.BizCustomerUser; import com.cpxt.biz.domain.BizCustomerUser;
import com.cpxt.biz.domain.SysArea;
import com.cpxt.biz.mapper.SysAreaMapper;
import com.cpxt.common.utils.DateUtils; import com.cpxt.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -27,6 +29,9 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
@Autowired @Autowired
private BizCustomerWarehouseMapper bizCustomerWarehouseMapper; private BizCustomerWarehouseMapper bizCustomerWarehouseMapper;
@Autowired
private SysAreaMapper sysAreaMapper;
/** /**
* *
* *
@ -36,7 +41,14 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
@Override @Override
public BizCustomerWarehouse selectBizCustomerWarehouseById(Long id) public BizCustomerWarehouse selectBizCustomerWarehouseById(Long id)
{ {
return bizCustomerWarehouseMapper.selectById(id); BizCustomerWarehouse bizCustomerWarehouse = bizCustomerWarehouseMapper.selectById(id);
if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getArea())){
SysArea sysArea = sysAreaMapper.selectById(bizCustomerWarehouse.getArea());
if (sysArea != null){
bizCustomerWarehouse.setAreaFullName(sysArea.getFullName());
}
}
return bizCustomerWarehouse;
} }
/** /**

View File

@ -389,6 +389,10 @@ public class BizOrderServiceImpl implements IBizOrderService {
*/ */
@Override @Override
public int updateBizOrder(BizOrder bizOrder) { public int updateBizOrder(BizOrder bizOrder) {
BizOrder order = bizOrderMapper.selectById(bizOrder.getId());
if (bizOrder.getIsCancel() == 1 && order.getCancelTime() == null){
bizOrder.setCancelTime(new Date());
}
return bizOrderMapper.updateById(bizOrder); return bizOrderMapper.updateById(bizOrder);
} }

View File

@ -0,0 +1,35 @@
package com.cpxt.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cpxt.biz.domain.SysArea;
import com.cpxt.biz.service.SysAreaService;
import com.cpxt.biz.mapper.SysAreaMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author LuoJian
* @description sys_area()Service
* @createDate 2025-01-16 14:22:17
*/
@Service
public class SysAreaServiceImpl extends ServiceImpl<SysAreaMapper, SysArea>
implements SysAreaService{
@Autowired
private SysAreaMapper sysAreaMapper;
@Override
public List<SysArea> selectByParentId(String parentId) {
LambdaQueryWrapper<SysArea> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SysArea::getParentId,parentId);
return sysAreaMapper.selectList(queryWrapper);
}
}