Merge branch 'master' of http://122.51.230.86:3000/dianliang/lanan-system
This commit is contained in:
commit
de5f19d3d2
@ -120,14 +120,30 @@ public class CarMainController {
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保险/年检/保养提醒列表
|
||||
*
|
||||
* @param pageReqVO CarMainReqVO(入参)
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage < cn.iocoder.yudao.module.custom.vo.CarMainRespVO>>
|
||||
* @author PQZ
|
||||
* @date 11:01 2024/8/14
|
||||
**/
|
||||
@GetMapping("/remindCarMainPage")
|
||||
@Operation(summary = "获得车辆信息分页")
|
||||
public CommonResult<IPage<CarMainRespVO>> remindCarMainPage(CarMainReqVO pageReqVO) {
|
||||
IPage<CarMainRespVO> pageResult = carMainService.remindCarMainPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 测算车辆下一次保养/检测/保险时间
|
||||
* @author PQZ
|
||||
* @date 11:48 2024/8/13
|
||||
*
|
||||
* @param pageReqVO CarMainReqVO
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
|
||||
**/
|
||||
* @author PQZ
|
||||
* @date 11:48 2024/8/13
|
||||
**/
|
||||
@PostMapping("/compute")
|
||||
@Operation(summary = "测算车辆下一次保养/检测/保险时间")
|
||||
public CommonResult<CarMainRespVO> compute(@RequestBody CarMainReqVO pageReqVO) {
|
||||
@ -135,6 +151,7 @@ public class CarMainController {
|
||||
return success(result);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出车辆信息
|
||||
*
|
||||
|
@ -29,6 +29,17 @@ public interface CarMainMapper extends BaseMapper<CarMain> {
|
||||
*/
|
||||
IPage<CarMainRespVO> findPage(Page<CarMainReqVO> page, @Param("dto") CarMainReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 保险/年检/保养提醒列表
|
||||
*
|
||||
* @param page Page<CarMainReqVO>
|
||||
* @param pageReqVO CarMainReqVO
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
|
||||
* @author PQZ
|
||||
* @date 9:12 2024/8/14
|
||||
**/
|
||||
IPage<CarMainRespVO> remindCarMainPage(Page<CarMainReqVO> page, @Param("entity") CarMainReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得车辆信息分页
|
||||
*
|
||||
@ -38,7 +49,6 @@ public interface CarMainMapper extends BaseMapper<CarMain> {
|
||||
CarMainRespVO findOne(@Param("id") String id);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 车牌号,车架号,发动机号码 查重
|
||||
*
|
||||
|
@ -60,6 +60,15 @@ public interface CarMainService extends IService<CarMain> {
|
||||
*/
|
||||
IPage<CarMainRespVO> getCarMainPage(CarMainReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 保险/年检/保养提醒列表
|
||||
* @author PQZ
|
||||
* @date 9:08 2024/8/14
|
||||
* @param pageReqVO 查询条件
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
|
||||
**/
|
||||
IPage<CarMainRespVO> remindCarMainPage(CarMainReqVO pageReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 绑定车辆信息
|
||||
|
@ -190,6 +190,20 @@ public class CarMainServiceImpl extends ServiceImpl<CarMainMapper, CarMain> impl
|
||||
return baseMapper.findPage(page, pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保险/年检/保养提醒列表
|
||||
*
|
||||
* @param pageReqVO 查询条件
|
||||
* @return com.baomidou.mybatisplus.core.metadata.IPage<cn.iocoder.yudao.module.custom.vo.CarMainRespVO>
|
||||
* @author PQZ
|
||||
* @date 9:08 2024/8/14
|
||||
**/
|
||||
@Override
|
||||
public IPage<CarMainRespVO> remindCarMainPage(CarMainReqVO pageReqVO) {
|
||||
Page<CarMainReqVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
return baseMapper.remindCarMainPage(page,pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定客户信息
|
||||
*
|
||||
|
@ -41,4 +41,8 @@ public class CarMainReqVO extends CarMain {
|
||||
List<BusiLabel> labelList;
|
||||
/**车辆品牌型号数组*/
|
||||
List<String> brandAndModel;
|
||||
/**客户名称*/
|
||||
String cusName;
|
||||
/**查询标识(01:年检临期;02:保养临期;03:保险临期)*/
|
||||
String selectSign;
|
||||
}
|
@ -17,9 +17,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
||||
@ExcelIgnoreUnannotated
|
||||
public class CarMainRespVO extends CarMain {
|
||||
|
||||
|
||||
|
||||
|
||||
/**是否车主(0否1是)*/
|
||||
@Schema(description = "是否车主(0否1是)")
|
||||
private String isOwner;
|
||||
@ -33,12 +30,16 @@ public class CarMainRespVO extends CarMain {
|
||||
String brandStr;
|
||||
/**型号字符*/
|
||||
String modelStr;
|
||||
|
||||
|
||||
/**客户名称*/
|
||||
String cusName;
|
||||
/**电话号码*/
|
||||
String phoneNumber;
|
||||
/**年检剩余*/
|
||||
String njCont;
|
||||
/**保险剩余*/
|
||||
String byCont;
|
||||
/**保险剩余*/
|
||||
String bxCont;
|
||||
/**车辆品牌型号数组*/
|
||||
List<String> brandAndModel;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -109,5 +109,40 @@
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="remindCarMainPage" resultType="cn.iocoder.yudao.module.custom.vo.CarMainRespVO">
|
||||
SELECT
|
||||
<include refid="baseCarMainColumn"></include>,
|
||||
bcc.is_owner AS isOwner,
|
||||
bcm.cus_name AS cusName,
|
||||
bcm.phone_number AS phoneNumber,
|
||||
bcb.brand_name AS brandStr,
|
||||
bcmm.model_name AS modelStr,
|
||||
DATEDIFF(tbcm.next_inspection_date, CURDATE()) AS njCont,
|
||||
DATEDIFF(tbcm.next_maintenance_date, CURDATE()) AS byCont,
|
||||
DATEDIFF(tbcm.insurance_expiry_date, CURDATE()) AS bxCont
|
||||
FROM
|
||||
base_car_main tbcm
|
||||
LEFT JOIN base_customer_car bcc ON tbcm.id = bcc.car_id AND bcc.deleted = 0
|
||||
LEFT JOIN base_customer_main bcm ON bcc.cus_id = bcm.id AND bcm.deleted = 0
|
||||
LEFT JOIN base_car_brand bcb ON bcb.deleted = 0 AND tbcm.car_brand = bcb.id
|
||||
LEFT JOIN base_car_model bcmm ON bcmm.deleted = 0 AND tbcm.car_model = bcmm.id
|
||||
WHERE
|
||||
tbcm.deleted = 0
|
||||
<if test="entity.licenseNumber != null and entity.licenseNumber != ''">
|
||||
AND tbcm.license_number LIKE CONCAT('%',#{entity.licenseNumber},'%')
|
||||
</if>
|
||||
<if test="entity.cusName != null and entity.cusName != ''">
|
||||
AND bcm.cus_name LIKE CONCAT('%',#{entity.cusName},'%')
|
||||
</if>
|
||||
<if test="entity.selectSign == '01'">
|
||||
AND tbcm.next_inspection_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 3 MONTH)
|
||||
</if>
|
||||
<if test="entity.selectSign == '02'">
|
||||
AND tbcm.next_maintenance_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 6 MONTH)
|
||||
</if>
|
||||
<if test="entity.selectSign == '03'">
|
||||
AND tbcm.insurance_expiry_date BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 45 DAY)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -80,4 +80,17 @@ public class PropertyPosController {
|
||||
return success(propertyPosService.getPropertyPosPage( page,pageReqVO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 资产存放位置列表 --下拉选择使用
|
||||
* @author vinjor-M
|
||||
* @date 17:37 2024/8/14
|
||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<com.baomidou.mybatisplus.core.metadata.IPage<?>>
|
||||
**/
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得企业管理-资产存放位置列表")
|
||||
@PreAuthorize("@ss.hasPermission('company:property-pos:query')")
|
||||
public CommonResult<List<?>> getPropertyPosList() {
|
||||
return success(propertyPosService.list());
|
||||
}
|
||||
|
||||
}
|
@ -47,15 +47,21 @@ public class DefaultDBFieldHandler implements MetaObjectHandler {
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
// 更新时间为空,则以当前时间为更新时间
|
||||
Object modifyTime = getFieldValByName("updateTime", metaObject);
|
||||
if (Objects.isNull(modifyTime)) {
|
||||
setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
|
||||
}
|
||||
|
||||
// 当前登录用户不为空,更新人为空,则当前登录用户为更新人
|
||||
Object modifier = getFieldValByName("updater", metaObject);
|
||||
// Object modifyTime = getFieldValByName("updateTime", metaObject);
|
||||
// if (Objects.isNull(modifyTime)) {
|
||||
// setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
|
||||
// }
|
||||
//
|
||||
// // 当前登录用户不为空,更新人为空,则当前登录用户为更新人
|
||||
// Object modifier = getFieldValByName("updater", metaObject);
|
||||
// Long userId = WebFrameworkUtils.getLoginUserId();
|
||||
// if (Objects.nonNull(userId) && Objects.isNull(modifier)) {
|
||||
// setFieldValByName("updater", userId.toString(), metaObject);
|
||||
// }
|
||||
//更新数据时,强制更新数据的更新时间和更新人
|
||||
setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
|
||||
Long userId = WebFrameworkUtils.getLoginUserId();
|
||||
if (Objects.nonNull(userId) && Objects.isNull(modifier)) {
|
||||
if (Objects.nonNull(userId)) {
|
||||
setFieldValByName("updater", userId.toString(), metaObject);
|
||||
}
|
||||
}
|
||||
|
@ -18,13 +18,21 @@ import java.util.Set;
|
||||
public interface DeptService {
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
* 创建部门--走校验
|
||||
*
|
||||
* @param createReqVO 部门信息
|
||||
* @return 部门编号
|
||||
*/
|
||||
Long createDept(DeptSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 创建部门--不走校验
|
||||
*
|
||||
* @param createReqVO 部门信息
|
||||
* @return 部门编号
|
||||
*/
|
||||
Long createDeptNoVerify(DeptSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新部门
|
||||
*
|
||||
|
@ -50,6 +50,7 @@ public class DeptServiceImpl implements DeptService {
|
||||
createReqVO.setAncestors(validateParentDept(null, createReqVO.getParentId()));
|
||||
// 校验部门名的唯一性
|
||||
validateDeptNameUnique(null, createReqVO.getParentId(), createReqVO.getName());
|
||||
// 设置所属企业ID
|
||||
if(StringUtils.isEmpty(createReqVO.getCorpId()) && !DeptDO.PARENT_ID_ROOT.equals(createReqVO.getParentId())){
|
||||
//没有传企业ID,且不是最顶级部门,自动取上一节点的企业ID(如果有的话)
|
||||
DeptDO parentDept = this.getDept(createReqVO.getParentId());
|
||||
@ -63,6 +64,23 @@ public class DeptServiceImpl implements DeptService {
|
||||
return dept.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建部门--不走校验
|
||||
*
|
||||
* @param createReqVO 部门信息
|
||||
* @return 部门编号
|
||||
*/
|
||||
@Override
|
||||
public Long createDeptNoVerify(DeptSaveReqVO createReqVO) {
|
||||
if (createReqVO.getParentId() == null) {
|
||||
createReqVO.setParentId(DeptDO.PARENT_ID_ROOT);
|
||||
}
|
||||
// 插入部门
|
||||
DeptDO dept = BeanUtils.toBean(createReqVO, DeptDO.class);
|
||||
deptMapper.insert(dept);
|
||||
return dept.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST,
|
||||
allEntries = true) // allEntries 清空所有缓存,因为操作一个部门,涉及到多个缓存
|
||||
|
@ -132,11 +132,11 @@ public class TenantServiceImpl implements TenantService {
|
||||
// 修改租户的管理员
|
||||
tenantMapper.updateById(new TenantDO().setId(tenant.getId()).setContactUserId(userId));
|
||||
//创建租户顶级部门
|
||||
Long deptId = createDept(userId,createReqVO.getName(),createReqVO.getContactMobile(),null);
|
||||
Long deptId = createDept(userId,createReqVO.getName(),createReqVO.getContactMobile(),null,"0");
|
||||
//创建三个客户部门:私人客户、代办客户、政企客户
|
||||
createDept(null,PRIVATE_CUS.getName(),null,deptId);
|
||||
createDept(null,AGENT_CUS.getName(),null,deptId);
|
||||
createDept(null,GOV_CUS.getName(),null,deptId);
|
||||
createDept(null,PRIVATE_CUS.getName(),null,deptId,"0,"+deptId);
|
||||
createDept(null,AGENT_CUS.getName(),null,deptId,"0,"+deptId);
|
||||
createDept(null,GOV_CUS.getName(),null,deptId,"0,"+deptId);
|
||||
//拉取本租户配置的服务套餐对应的角色和权限,存入本租户对应信息
|
||||
createServiceRole(createReqVO.getPackageId());
|
||||
});
|
||||
@ -163,10 +163,11 @@ public class TenantServiceImpl implements TenantService {
|
||||
}
|
||||
}
|
||||
|
||||
private Long createDept(Long userId,String deptName,String phone,Long parentId){
|
||||
private Long createDept(Long userId,String deptName,String phone,Long parentId,String ancestors){
|
||||
DeptSaveReqVO deptSaveReqVO = new DeptSaveReqVO();
|
||||
deptSaveReqVO.setName(deptName);
|
||||
deptSaveReqVO.setSort(0);
|
||||
deptSaveReqVO.setAncestors(ancestors);
|
||||
deptSaveReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
if(null!=phone){
|
||||
deptSaveReqVO.setPhone(phone);
|
||||
@ -177,7 +178,7 @@ public class TenantServiceImpl implements TenantService {
|
||||
if(null!=parentId){
|
||||
deptSaveReqVO.setParentId(parentId);
|
||||
}
|
||||
return deptService.createDept(deptSaveReqVO);
|
||||
return deptService.createDeptNoVerify(deptSaveReqVO);
|
||||
}
|
||||
|
||||
private Long createUser(Long roleId, TenantSaveReqVO createReqVO) {
|
||||
|
@ -178,6 +178,7 @@ logging:
|
||||
cn.iocoder.yudao.module.custom.mapper: debug #
|
||||
cn.iocoder.yudao.module.company.mapper: debug #
|
||||
cn.iocoder.yudao.module.staff.mapper: debug #
|
||||
cn.iocoder.yudao.module.property.mapper: debug #
|
||||
|
||||
debug: false
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user