大屏接口调整、维护地区(area)字段
parent
0efe7b0fc3
commit
3b0eb0bb97
|
|
@ -276,30 +276,32 @@ public class LargeScreenController extends BaseController {
|
|||
LambdaQueryWrapper<BizCustomerRouteShop> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.eq(BizCustomerRouteShop::getRouteId,bizCustomerRoute.getId());
|
||||
List<BizCustomerRouteShop> bizCustomerRouteShops = bizCustomerRouteShopMapper.selectList(queryWrapper1);
|
||||
List<Long> shopIdList = bizCustomerRouteShops.stream().map(BizCustomerRouteShop::getShopId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<BizCustomerShop> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.in(BizCustomerShop::getId,shopIdList);
|
||||
List<BizCustomerShop> bizCustomerShops = bizCustomerShopMapper.selectList(queryWrapper2);
|
||||
for (BizCustomerShop bizCustomerShop : bizCustomerShops) {
|
||||
LambdaQueryWrapper<BizCustomerShopState> queryWrapper3 = new LambdaQueryWrapper<>();
|
||||
queryWrapper3.eq(BizCustomerShopState::getShopId,bizCustomerShop.getId());
|
||||
BizCustomerShopState bizCustomerShopState = bizCustomerShopStateMapper.selectOne(queryWrapper3);
|
||||
if (bizCustomerShopState != null){
|
||||
bizCustomerShop.setIsFinish(bizCustomerShopState.getIsFinish());
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper4 = new LambdaQueryWrapper<>();
|
||||
queryWrapper4.eq(BizOrder::getOrderSn,bizCustomerShopState.getCurrentOrder());
|
||||
BizOrder bizOrder = bizOrderMapper.selectOne(queryWrapper4);
|
||||
if (bizOrder != null){
|
||||
bizCustomerShop.setCurrentOrder(bizOrder.getOrderSn());
|
||||
bizCustomerShop.setCarNo(bizOrder.getCarNo());
|
||||
bizCustomerShop.setDriveName(bizOrder.getDriverName());
|
||||
bizCustomerShop.setCopilotName(bizOrder.getCopilotName());
|
||||
bizCustomerShop.setStartTime(bizOrder.getStartTime());
|
||||
bizCustomerShop.setArriveImg(bizOrder.getArriveImg());
|
||||
if (bizCustomerRouteShops.size() != 0){
|
||||
List<Long> shopIdList = bizCustomerRouteShops.stream().map(BizCustomerRouteShop::getShopId).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<BizCustomerShop> queryWrapper2 = new LambdaQueryWrapper<>();
|
||||
queryWrapper2.in(BizCustomerShop::getId,shopIdList);
|
||||
List<BizCustomerShop> bizCustomerShops = bizCustomerShopMapper.selectList(queryWrapper2);
|
||||
for (BizCustomerShop bizCustomerShop : bizCustomerShops) {
|
||||
LambdaQueryWrapper<BizCustomerShopState> queryWrapper3 = new LambdaQueryWrapper<>();
|
||||
queryWrapper3.eq(BizCustomerShopState::getShopId,bizCustomerShop.getId());
|
||||
BizCustomerShopState bizCustomerShopState = bizCustomerShopStateMapper.selectOne(queryWrapper3);
|
||||
if (bizCustomerShopState != null){
|
||||
bizCustomerShop.setIsFinish(bizCustomerShopState.getIsFinish());
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper4 = new LambdaQueryWrapper<>();
|
||||
queryWrapper4.eq(BizOrder::getOrderSn,bizCustomerShopState.getCurrentOrder());
|
||||
BizOrder bizOrder = bizOrderMapper.selectOne(queryWrapper4);
|
||||
if (bizOrder != null){
|
||||
bizCustomerShop.setCurrentOrder(bizOrder.getOrderSn());
|
||||
bizCustomerShop.setCarNo(bizOrder.getCarNo());
|
||||
bizCustomerShop.setDriveName(bizOrder.getDriverName());
|
||||
bizCustomerShop.setCopilotName(bizOrder.getCopilotName());
|
||||
bizCustomerShop.setStartTime(bizOrder.getStartTime());
|
||||
bizCustomerShop.setArriveImg(bizOrder.getArriveImg());
|
||||
}
|
||||
}
|
||||
}
|
||||
bizCustomerRoute.setShopList(bizCustomerShops);
|
||||
}
|
||||
bizCustomerRoute.setShopList(bizCustomerShops);
|
||||
largeScreenEntity.setBizCustomerRoute(bizCustomerRoute);
|
||||
return AjaxResult.success(largeScreenEntity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,10 @@ package com.cpxt.web.controller.system;
|
|||
import java.util.List;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
|
@ -41,6 +45,12 @@ public class SysLoginController
|
|||
@Autowired
|
||||
private TokenService tokenService;
|
||||
|
||||
@Autowired
|
||||
private BizDriverMapper bizDriverMapper;
|
||||
|
||||
@Autowired
|
||||
private BizCustomerMapper bizCustomerMapper;
|
||||
|
||||
/**
|
||||
* 登录方法
|
||||
*
|
||||
|
|
@ -85,6 +95,15 @@ public class SysLoginController
|
|||
{
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
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);
|
||||
// 权限集合
|
||||
|
|
|
|||
|
|
@ -93,6 +93,16 @@ public class SysUser extends BaseEntity
|
|||
/** 角色ID */
|
||||
private Long roleId;
|
||||
|
||||
public Long getLinkId() {
|
||||
return linkId;
|
||||
}
|
||||
|
||||
public void setLinkId(Long linkId) {
|
||||
this.linkId = linkId;
|
||||
}
|
||||
|
||||
private Long linkId;
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,8 @@ public class BizCustomerShop
|
|||
@TableField(exist = false)
|
||||
private Integer isFinish;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private String areaFullName;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.cpxt.biz.domain;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
|
@ -76,4 +77,7 @@ public class BizCustomerWarehouse
|
|||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String areaFullName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
/**
|
||||
* 类型:1是省会,2直辖市,3港澳台,4其它
|
||||
*/
|
||||
private Integer areaType;
|
||||
|
||||
/**
|
||||
* 同级下排序
|
||||
*/
|
||||
private Integer orderNo;
|
||||
|
||||
/**
|
||||
* 0全国、1省、2市区、3郊县、4街道、5居委会
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
|
@ -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> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
@ -53,6 +53,9 @@ public class BizCarStateServiceImpl implements IBizCarStateService
|
|||
if (ObjectUtil.isNotEmpty(bizCarState.getCarNo())){
|
||||
queryWrapper.eq(BizCarState::getCarNo, bizCarState.getCarNo());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCarState.getCarId()) && bizCarState.getCarId() != 0){
|
||||
queryWrapper.eq(BizCarState::getCarId, bizCarState.getCarId());
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -27,6 +29,9 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
|
|||
@Autowired
|
||||
private BizCustomerShopMapper bizCustomerShopMapper;
|
||||
|
||||
@Autowired
|
||||
private SysAreaMapper sysAreaMapper;
|
||||
|
||||
/**
|
||||
* 查询门店
|
||||
*
|
||||
|
|
@ -36,7 +41,14 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
|
|||
@Override
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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 org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -27,6 +29,9 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
|
|||
@Autowired
|
||||
private BizCustomerWarehouseMapper bizCustomerWarehouseMapper;
|
||||
|
||||
@Autowired
|
||||
private SysAreaMapper sysAreaMapper;
|
||||
|
||||
/**
|
||||
* 查询仓库
|
||||
*
|
||||
|
|
@ -36,7 +41,14 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
|
|||
@Override
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -389,6 +389,10 @@ public class BizOrderServiceImpl implements IBizOrderService {
|
|||
*/
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue