Compare commits

..

No commits in common. "ba2ba26334b848b5555882f481e1b1cdae0e7c0a" and "8087c7ed48571bcea201f7f09c11b5333c3d0085" have entirely different histories.

15 changed files with 30 additions and 115 deletions

View File

@ -93,7 +93,7 @@ token:
# 令牌自定义标识 # 令牌自定义标识
header: Authorization header: Authorization
# 令牌密钥 # 令牌密钥
secret: abcdefghijk secret: abcdefghijklmnopqrstuvwxyz
# 令牌有效期默认30分钟 # 令牌有效期默认30分钟
expireTime: 30 expireTime: 30

View File

@ -5,7 +5,6 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cpxt.biz.domain.BizCustomer; import com.cpxt.biz.domain.BizCustomer;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
/** /**
* Mapper * Mapper
@ -15,7 +14,4 @@ import org.apache.ibatis.annotations.Select;
*/ */
@Mapper @Mapper
public interface BizCustomerMapper extends BaseMapper<BizCustomer> public interface BizCustomerMapper extends BaseMapper<BizCustomer>
{ { }
@Select("select * from biz_customer where linkphone = #{username}")
BizCustomer selectByLinkPhone(String username);
}

View File

@ -60,7 +60,6 @@ public class BizCarModelServiceImpl implements IBizCarModelService
if (ObjectUtil.isNotEmpty(bizCarModel.getName())) { if (ObjectUtil.isNotEmpty(bizCarModel.getName())) {
queryWrapper.like(BizCarModel::getName, bizCarModel.getName()); queryWrapper.like(BizCarModel::getName, bizCarModel.getName());
} }
queryWrapper.eq(BizCarModel::getStatus,1);
return queryWrapper; return queryWrapper;
} }
@ -111,9 +110,9 @@ public class BizCarModelServiceImpl implements IBizCarModelService
public int deleteBizCarModelByIds(Long[] ids) public int deleteBizCarModelByIds(Long[] ids)
{ {
UpdateWrapper<BizCarModel> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizCarModel> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizCarModelMapper.update(updateWrapper); return bizCarModelMapper.update(null,updateWrapper);
} }
/** /**

View File

@ -68,7 +68,6 @@ public class BizCarServiceImpl implements IBizCarService
if (ObjectUtil.isNotEmpty(bizCar.getSerialNo())) { if (ObjectUtil.isNotEmpty(bizCar.getSerialNo())) {
queryWrapper.like(BizCar::getSerialNo, bizCar.getSerialNo()); queryWrapper.like(BizCar::getSerialNo, bizCar.getSerialNo());
} }
queryWrapper.eq(BizCar::getStatus,1);
return queryWrapper; return queryWrapper;
} }
@ -128,9 +127,9 @@ public class BizCarServiceImpl implements IBizCarService
public int deleteBizCarByIds(Long[] ids) public int deleteBizCarByIds(Long[] ids)
{ {
UpdateWrapper<BizCar> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizCar> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizCarMapper.update(updateWrapper); return bizCarMapper.update(null,updateWrapper);
} }
/** /**

View File

@ -47,7 +47,7 @@ public class BizCustomerRouteServiceImpl implements IBizCustomerRouteService
public List<BizCustomerRoute> selectBizCustomerRouteList(BizCustomerRoute bizCustomerRoute) public List<BizCustomerRoute> selectBizCustomerRouteList(BizCustomerRoute bizCustomerRoute)
{ {
LambdaQueryWrapper<BizCustomerRoute> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BizCustomerRoute> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BizCustomerRoute::getStatus,1);
return bizCustomerRouteMapper.selectList(queryWrapper); return bizCustomerRouteMapper.selectList(queryWrapper);
} }
@ -85,7 +85,7 @@ public class BizCustomerRouteServiceImpl implements IBizCustomerRouteService
public int deleteBizCustomerRouteByIds(Long[] ids) public int deleteBizCustomerRouteByIds(Long[] ids)
{ {
UpdateWrapper<BizCustomerRoute> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizCustomerRoute> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizCustomerRouteMapper.update(null,updateWrapper); return bizCustomerRouteMapper.update(null,updateWrapper);
} }

View File

@ -8,11 +8,7 @@ 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.BizCarModel; import com.cpxt.biz.domain.BizCarModel;
import com.cpxt.common.core.domain.entity.SysDept;
import com.cpxt.common.core.domain.entity.SysUser;
import com.cpxt.common.utils.DateUtils; import com.cpxt.common.utils.DateUtils;
import com.cpxt.system.mapper.SysDeptMapper;
import com.cpxt.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.parameters.P; import org.springframework.security.core.parameters.P;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -32,12 +28,6 @@ public class BizCustomerServiceImpl implements IBizCustomerService
@Autowired @Autowired
private BizCustomerMapper bizCustomerMapper; private BizCustomerMapper bizCustomerMapper;
@Autowired
private SysDeptMapper sysDeptMapper;
@Autowired
private SysUserMapper sysUserMapper;
/** /**
* *
* *
@ -76,7 +66,6 @@ public class BizCustomerServiceImpl implements IBizCustomerService
if (ObjectUtil.isNotEmpty(bizCustomer.getLevel())){ if (ObjectUtil.isNotEmpty(bizCustomer.getLevel())){
queryWrapper.eq(BizCustomer::getLevel, bizCustomer.getLevel()); queryWrapper.eq(BizCustomer::getLevel, bizCustomer.getLevel());
} }
queryWrapper.eq(BizCustomer::getStatus,1);
return queryWrapper; return queryWrapper;
} }
@ -102,37 +91,9 @@ public class BizCustomerServiceImpl implements IBizCustomerService
@Override @Override
public int insertBizCustomer(BizCustomer bizCustomer) public int insertBizCustomer(BizCustomer bizCustomer)
{ {
Long parentId = sysDeptMapper.selectDeptIdByDeptName("外部单位");
Long aLong = sysDeptMapper.selectDeptIdByDeptName(bizCustomer.getName());
SysDept sysDept = new SysDept();
if (ObjectUtil.isEmpty(aLong)){
// 同步创建一个部门,名称为客户名称
sysDept.setParentId(parentId);
sysDept.setAncestors("0," + parentId);
sysDept.setDeptName(bizCustomer.getName());
sysDeptMapper.insertDept(sysDept);
}else {
sysDept.setDeptId(aLong);
}
// 同步新增一个用户
SysUser user = sysUserMapper.selectUserByUserName(bizCustomer.getLinkphone());
if (ObjectUtil.isEmpty(user)){
SysUser sysUser = new SysUser();
setSysUser(bizCustomer,sysUser,sysDept);
sysUserMapper.insertUser(sysUser);
}
return bizCustomerMapper.insert(bizCustomer); return bizCustomerMapper.insert(bizCustomer);
} }
private void setSysUser(BizCustomer bizCustomer, SysUser sysUser, SysDept sysDept) {
sysUser.setDeptId(sysDept.getDeptId());
sysUser.setUserName(bizCustomer.getLinkphone());
sysUser.setNickName(bizCustomer.getName());
sysUser.setUserType("2"); // 客户
sysUser.setPhonenumber(bizCustomer.getLinkphone());
sysUser.setPassword(bizCustomer.getLinkphone().substring(7,11)); // 18756576807
}
/** /**
* *
* *
@ -154,13 +115,8 @@ public class BizCustomerServiceImpl implements IBizCustomerService
@Override @Override
public int deleteBizCustomerByIds(Long[] ids) public int deleteBizCustomerByIds(Long[] ids)
{ {
// 删除客户对应的用户
for (Long id : ids) {
BizCustomer bizCustomer = bizCustomerMapper.selectById(id);
sysUserMapper.deleteByUserName(bizCustomer.getLinkphone());
}
UpdateWrapper<BizCustomer> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizCustomer> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizCustomerMapper.update(null,updateWrapper); return bizCustomerMapper.update(null,updateWrapper);
} }

View File

@ -78,7 +78,6 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
if (ObjectUtil.isNotEmpty(bizCustomerShop.getLinkphone())){ if (ObjectUtil.isNotEmpty(bizCustomerShop.getLinkphone())){
queryWrapper.like(BizCustomerShop::getLinkphone, bizCustomerShop.getLinkphone()); queryWrapper.like(BizCustomerShop::getLinkphone, bizCustomerShop.getLinkphone());
} }
queryWrapper.eq(BizCustomerShop::getStatus,1);
return queryWrapper; return queryWrapper;
} }
@ -116,7 +115,7 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
public int deleteBizCustomerShopByIds(Long[] ids) public int deleteBizCustomerShopByIds(Long[] ids)
{ {
UpdateWrapper<BizCustomerShop> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizCustomerShop> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizCustomerShopMapper.update(null,updateWrapper); return bizCustomerShopMapper.update(null,updateWrapper);
} }

View File

@ -46,7 +46,6 @@ public class BizCustomerUserServiceImpl implements IBizCustomerUserService
public List<BizCustomerUser> selectBizCustomerUserList(BizCustomerUser bizCustomerUser) public List<BizCustomerUser> selectBizCustomerUserList(BizCustomerUser bizCustomerUser)
{ {
LambdaQueryWrapper<BizCustomerUser> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BizCustomerUser> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(BizCustomerUser::getStatus,1);
return bizCustomerUserMapper.selectList(queryWrapper); return bizCustomerUserMapper.selectList(queryWrapper);
} }
@ -84,7 +83,7 @@ public class BizCustomerUserServiceImpl implements IBizCustomerUserService
public int deleteBizCustomerUserByIds(Long[] ids) public int deleteBizCustomerUserByIds(Long[] ids)
{ {
UpdateWrapper<BizCustomerUser> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizCustomerUser> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizCustomerUserMapper.update(null,updateWrapper); return bizCustomerUserMapper.update(null,updateWrapper);
} }

View File

@ -81,7 +81,6 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getAddress())){ if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getAddress())){
queryWrapper.like(BizCustomerWarehouse::getAddress, bizCustomerWarehouse.getAddress()); queryWrapper.like(BizCustomerWarehouse::getAddress, bizCustomerWarehouse.getAddress());
} }
queryWrapper.eq(BizCustomerWarehouse::getStatus,1);
return queryWrapper; return queryWrapper;
} }
@ -119,7 +118,7 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
public int deleteBizCustomerWarehouseByIds(Long[] ids) public int deleteBizCustomerWarehouseByIds(Long[] ids)
{ {
UpdateWrapper<BizCustomerWarehouse> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizCustomerWarehouse> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizCustomerWarehouseMapper.update(null,updateWrapper); return bizCustomerWarehouseMapper.update(null,updateWrapper);
} }

View File

@ -82,7 +82,6 @@ public class BizDriverServiceImpl implements IBizDriverService
if (ObjectUtil.isNotEmpty(bizDriver.getDefaultCarNo())){ if (ObjectUtil.isNotEmpty(bizDriver.getDefaultCarNo())){
queryWrapper.like(BizDriver::getDefaultCarNo, bizDriver.getDefaultCarNo()); queryWrapper.like(BizDriver::getDefaultCarNo, bizDriver.getDefaultCarNo());
} }
queryWrapper.eq(BizDriver::getStatus,"1");
return queryWrapper; return queryWrapper;
} }
@ -95,16 +94,12 @@ public class BizDriverServiceImpl implements IBizDriverService
@Override @Override
public int insertBizDriver(BizDriver bizDriver) public int insertBizDriver(BizDriver bizDriver)
{ {
bizDriver.setDeptName(sysDeptMapper.selectDeptById(bizDriver.getDeptId()).getDeptName());
SysUser user = sysUserMapper.selectUserByUserName(bizDriver.getPhone());
if (ObjectUtil.isEmpty(user)){
SysUser sysUser = new SysUser(); SysUser sysUser = new SysUser();
setSysUser(bizDriver,sysUser); setSysUser(bizDriver,sysUser);
sysUserMapper.insertUser(sysUser); sysUserMapper.insertUser(sysUser);
bizDriver.setDeptName(sysDeptMapper.selectDeptById(bizDriver.getDeptId()).getDeptName());
bizDriver.setUserId(sysUser.getUserId()); bizDriver.setUserId(sysUser.getUserId());
}else {
bizDriver.setUserId(user.getUserId());
}
return bizDriverMapper.insert(bizDriver); return bizDriverMapper.insert(bizDriver);
} }
@ -116,7 +111,7 @@ public class BizDriverServiceImpl implements IBizDriverService
sysUser.setPhonenumber(bizDriver.getPhone()); sysUser.setPhonenumber(bizDriver.getPhone());
sysUser.setSex(bizDriver.getGender()); sysUser.setSex(bizDriver.getGender());
sysUser.setAvatar(bizDriver.getPhoto()); sysUser.setAvatar(bizDriver.getPhoto());
sysUser.setPassword(bizDriver.getPhone().substring(7,11)); // 18756576807 sysUser.setPassword(bizDriver.getIdcard().substring(12,18)); // 340123199906222873
} }
/** /**
@ -140,13 +135,8 @@ public class BizDriverServiceImpl implements IBizDriverService
@Override @Override
public int deleteBizDriverByIds(Long[] ids) public int deleteBizDriverByIds(Long[] ids)
{ {
// 删除司机对应用户
for (Long id : ids) {
BizDriver bizDriver = bizDriverMapper.selectById(id);
sysUserMapper.deleteByUserName(bizDriver.getPhone());
}
UpdateWrapper<BizDriver> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizDriver> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizDriverMapper.update(null,updateWrapper); return bizDriverMapper.update(null,updateWrapper);
} }

View File

@ -9,7 +9,6 @@ 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.*; import com.cpxt.biz.domain.*;
import com.cpxt.biz.mapper.*; import com.cpxt.biz.mapper.*;
import com.cpxt.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.cpxt.biz.service.IBizOrderService; import com.cpxt.biz.service.IBizOrderService;
@ -254,7 +253,6 @@ public class BizOrderServiceImpl implements IBizOrderService
if (ObjectUtil.isNotEmpty(bizOrder.getArriveLat())){ if (ObjectUtil.isNotEmpty(bizOrder.getArriveLat())){
queryWrapper.eq(BizOrder::getArriveLat, bizOrder.getArriveLat()); queryWrapper.eq(BizOrder::getArriveLat, bizOrder.getArriveLat());
} }
queryWrapper.eq(BizOrder::getStatus,1);
return queryWrapper; return queryWrapper;
} }
@ -268,11 +266,6 @@ public class BizOrderServiceImpl implements IBizOrderService
public int insertBizOrder(BizOrder bizOrder) public int insertBizOrder(BizOrder bizOrder)
{ {
Long customerId = bizOrder.getCustomerId(); // 客户id Long customerId = bizOrder.getCustomerId(); // 客户id
if (ObjectUtil.isEmpty(customerId)){
String username = SecurityUtils.getUsername();
BizCustomer bizCustomer = bizCustomerMapper.selectByLinkPhone(username);
customerId = bizCustomer.getId();
}
Long routeId = bizOrder.getRouteId(); // 路线id Long routeId = bizOrder.getRouteId(); // 路线id
Long warehouseId = bizOrder.getWarehouseId(); // 仓库id Long warehouseId = bizOrder.getWarehouseId(); // 仓库id
Long shopId = bizOrder.getShopId(); // 店铺id Long shopId = bizOrder.getShopId(); // 店铺id
@ -281,12 +274,12 @@ public class BizOrderServiceImpl implements IBizOrderService
Long copilotId = bizOrder.getCopilotId(); // 副驾司机id Long copilotId = bizOrder.getCopilotId(); // 副驾司机id
bizOrder.setCustomerName(bizCustomerMapper.selectById(customerId).getName()); bizOrder.setCustomerName(bizCustomerMapper.selectById(customerId).getName());
if (ObjectUtil.isNotEmpty(routeId)) bizOrder.setRouteName(bizCustomerRouteMapper.selectById(routeId).getName()); bizOrder.setRouteName(bizCustomerRouteMapper.selectById(routeId).getName());
if (ObjectUtil.isNotEmpty(warehouseId)) bizOrder.setWarehouseName(bizCustomerWarehouseMapper.selectById(warehouseId).getName()); bizOrder.setWarehouseName(bizCustomerWarehouseMapper.selectById(warehouseId).getName());
if (ObjectUtil.isNotEmpty(shopId)) bizOrder.setShopName(bizCustomerShopMapper.selectById(shopId).getName()); bizOrder.setShopName(bizCustomerShopMapper.selectById(shopId).getName());
if (ObjectUtil.isNotEmpty(carId)) bizOrder.setCarNo(bizCarMapper.selectById(carId).getCarNo()); bizOrder.setCarNo(bizCarMapper.selectById(carId).getCarNo());
if (ObjectUtil.isNotEmpty(driverId)) bizOrder.setDriverName(bizDriverMapper.selectById(driverId).getName()); bizOrder.setDriverName(bizDriverMapper.selectById(driverId).getName());
if (ObjectUtil.isNotEmpty(copilotId)) bizOrder.setCopilotName(bizDriverMapper.selectById(copilotId).getName()); bizOrder.setCopilotName(bizDriverMapper.selectById(copilotId).getName());
return bizOrderMapper.insert(bizOrder); return bizOrderMapper.insert(bizOrder);
} }
@ -312,7 +305,7 @@ public class BizOrderServiceImpl implements IBizOrderService
public int deleteBizOrderByIds(Long[] ids) public int deleteBizOrderByIds(Long[] ids)
{ {
UpdateWrapper<BizOrder> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<BizOrder> updateWrapper = new UpdateWrapper<>();
updateWrapper.in("id", (Object[]) ids); updateWrapper.in("id", (Object) ids);
updateWrapper.set("status","2"); //状态改为删除 updateWrapper.set("status","2"); //状态改为删除
return bizOrderMapper.update(null,updateWrapper); return bizOrderMapper.update(null,updateWrapper);
} }

View File

@ -115,7 +115,4 @@ public interface SysDeptMapper
* @return * @return
*/ */
public int deleteDeptById(Long deptId); public int deleteDeptById(Long deptId);
Long selectDeptIdByDeptName(String deptName);
} }

View File

@ -124,6 +124,4 @@ public interface SysUserMapper
* @return * @return
*/ */
public SysUser checkEmailUnique(String email); public SysUser checkEmailUnique(String email);
public int deleteByUserName(String userName);
} }

View File

@ -87,10 +87,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select> </select>
<select id="selectDeptIdByDeptName" resultType="java.lang.Long">
select dept_id from sys_dept where dept_name = #{deptName}
</select>
<insert id="insertDept" parameterType="SysDept"> <insert id="insertDept" parameterType="SysDept">
insert into sys_dept( insert into sys_dept(
<if test="deptId != null and deptId != 0">dept_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if>

View File

@ -215,8 +215,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update sys_user set del_flag = '2' where user_id = #{userId} update sys_user set del_flag = '2' where user_id = #{userId}
</delete> </delete>
<delete id="deleteUserByIds" parameterType="Long"> <delete id="deleteUserByIds" parameterType="Long">
update sys_user set del_flag = '2' where user_id in update sys_user set del_flag = '2' where user_id in
<foreach collection="array" item="userId" open="(" separator="," close=")"> <foreach collection="array" item="userId" open="(" separator="," close=")">
@ -224,8 +222,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<delete id="deleteByUserName">
update sys_user set del_flag = '2' where user_name = #{userName}
</delete>
</mapper> </mapper>