This commit is contained in:
xiao-fajia 2024-08-14 20:01:49 +08:00
commit de5f19d3d2
13 changed files with 165 additions and 28 deletions

View File

@ -120,14 +120,30 @@ public class CarMainController {
return success(pageResult); 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 * @param pageReqVO CarMainReqVO
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<cn.iocoder.yudao.module.custom.vo.CarMainRespVO> * @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") @PostMapping("/compute")
@Operation(summary = "测算车辆下一次保养/检测/保险时间") @Operation(summary = "测算车辆下一次保养/检测/保险时间")
public CommonResult<CarMainRespVO> compute(@RequestBody CarMainReqVO pageReqVO) { public CommonResult<CarMainRespVO> compute(@RequestBody CarMainReqVO pageReqVO) {
@ -135,6 +151,7 @@ public class CarMainController {
return success(result); return success(result);
} }
/** /**
* 导出车辆信息 * 导出车辆信息
* *

View File

@ -29,6 +29,17 @@ public interface CarMainMapper extends BaseMapper<CarMain> {
*/ */
IPage<CarMainRespVO> findPage(Page<CarMainReqVO> page, @Param("dto") CarMainReqVO pageReqVO); 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); CarMainRespVO findOne(@Param("id") String id);
/** /**
* 车牌号车架号发动机号码 查重 * 车牌号车架号发动机号码 查重
* *

View File

@ -60,6 +60,15 @@ public interface CarMainService extends IService<CarMain> {
*/ */
IPage<CarMainRespVO> getCarMainPage(CarMainReqVO pageReqVO); 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);
/** /**
* 绑定车辆信息 * 绑定车辆信息

View File

@ -190,6 +190,20 @@ public class CarMainServiceImpl extends ServiceImpl<CarMainMapper, CarMain> impl
return baseMapper.findPage(page, pageReqVO); 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);
}
/** /**
* 绑定客户信息 * 绑定客户信息
* *

View File

@ -41,4 +41,8 @@ public class CarMainReqVO extends CarMain {
List<BusiLabel> labelList; List<BusiLabel> labelList;
/**车辆品牌型号数组*/ /**车辆品牌型号数组*/
List<String> brandAndModel; List<String> brandAndModel;
/**客户名称*/
String cusName;
/**查询标识(01:年检临期02保养临期03保险临期)*/
String selectSign;
} }

View File

@ -17,9 +17,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ExcelIgnoreUnannotated @ExcelIgnoreUnannotated
public class CarMainRespVO extends CarMain { public class CarMainRespVO extends CarMain {
/**是否车主0否1是*/ /**是否车主0否1是*/
@Schema(description = "是否车主0否1是") @Schema(description = "是否车主0否1是")
private String isOwner; private String isOwner;
@ -33,12 +30,16 @@ public class CarMainRespVO extends CarMain {
String brandStr; String brandStr;
/**型号字符*/ /**型号字符*/
String modelStr; String modelStr;
/**客户名称*/
String cusName;
/**电话号码*/
String phoneNumber;
/**年检剩余*/
String njCont;
/**保险剩余*/
String byCont;
/**保险剩余*/
String bxCont;
/**车辆品牌型号数组*/ /**车辆品牌型号数组*/
List<String> brandAndModel; List<String> brandAndModel;
} }

View File

@ -109,5 +109,40 @@
</if> </if>
</select> </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> </mapper>

View File

@ -80,4 +80,17 @@ public class PropertyPosController {
return success(propertyPosService.getPropertyPosPage( page,pageReqVO)); 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());
}
} }

View File

@ -47,15 +47,21 @@ public class DefaultDBFieldHandler implements MetaObjectHandler {
@Override @Override
public void updateFill(MetaObject metaObject) { public void updateFill(MetaObject metaObject) {
// 更新时间为空则以当前时间为更新时间 // 更新时间为空则以当前时间为更新时间
Object modifyTime = getFieldValByName("updateTime", metaObject); // Object modifyTime = getFieldValByName("updateTime", metaObject);
if (Objects.isNull(modifyTime)) { // if (Objects.isNull(modifyTime)) {
setFieldValByName("updateTime", LocalDateTime.now(), metaObject); // setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
} // }
//
// 当前登录用户不为空更新人为空则当前登录用户为更新人 // // 当前登录用户不为空更新人为空则当前登录用户为更新人
Object modifier = getFieldValByName("updater", 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(); Long userId = WebFrameworkUtils.getLoginUserId();
if (Objects.nonNull(userId) && Objects.isNull(modifier)) { if (Objects.nonNull(userId)) {
setFieldValByName("updater", userId.toString(), metaObject); setFieldValByName("updater", userId.toString(), metaObject);
} }
} }

View File

@ -18,13 +18,21 @@ import java.util.Set;
public interface DeptService { public interface DeptService {
/** /**
* 创建部门 * 创建部门--走校验
* *
* @param createReqVO 部门信息 * @param createReqVO 部门信息
* @return 部门编号 * @return 部门编号
*/ */
Long createDept(DeptSaveReqVO createReqVO); Long createDept(DeptSaveReqVO createReqVO);
/**
* 创建部门--不走校验
*
* @param createReqVO 部门信息
* @return 部门编号
*/
Long createDeptNoVerify(DeptSaveReqVO createReqVO);
/** /**
* 更新部门 * 更新部门
* *

View File

@ -50,6 +50,7 @@ public class DeptServiceImpl implements DeptService {
createReqVO.setAncestors(validateParentDept(null, createReqVO.getParentId())); createReqVO.setAncestors(validateParentDept(null, createReqVO.getParentId()));
// 校验部门名的唯一性 // 校验部门名的唯一性
validateDeptNameUnique(null, createReqVO.getParentId(), createReqVO.getName()); validateDeptNameUnique(null, createReqVO.getParentId(), createReqVO.getName());
// 设置所属企业ID
if(StringUtils.isEmpty(createReqVO.getCorpId()) && !DeptDO.PARENT_ID_ROOT.equals(createReqVO.getParentId())){ if(StringUtils.isEmpty(createReqVO.getCorpId()) && !DeptDO.PARENT_ID_ROOT.equals(createReqVO.getParentId())){
//没有传企业ID且不是最顶级部门自动取上一节点的企业ID如果有的话 //没有传企业ID且不是最顶级部门自动取上一节点的企业ID如果有的话
DeptDO parentDept = this.getDept(createReqVO.getParentId()); DeptDO parentDept = this.getDept(createReqVO.getParentId());
@ -63,6 +64,23 @@ public class DeptServiceImpl implements DeptService {
return dept.getId(); 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 @Override
@CacheEvict(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST, @CacheEvict(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST,
allEntries = true) // allEntries 清空所有缓存因为操作一个部门涉及到多个缓存 allEntries = true) // allEntries 清空所有缓存因为操作一个部门涉及到多个缓存

View File

@ -132,11 +132,11 @@ public class TenantServiceImpl implements TenantService {
// 修改租户的管理员 // 修改租户的管理员
tenantMapper.updateById(new TenantDO().setId(tenant.getId()).setContactUserId(userId)); 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,PRIVATE_CUS.getName(),null,deptId,"0,"+deptId);
createDept(null,AGENT_CUS.getName(),null,deptId); createDept(null,AGENT_CUS.getName(),null,deptId,"0,"+deptId);
createDept(null,GOV_CUS.getName(),null,deptId); createDept(null,GOV_CUS.getName(),null,deptId,"0,"+deptId);
//拉取本租户配置的服务套餐对应的角色和权限存入本租户对应信息 //拉取本租户配置的服务套餐对应的角色和权限存入本租户对应信息
createServiceRole(createReqVO.getPackageId()); 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 deptSaveReqVO = new DeptSaveReqVO();
deptSaveReqVO.setName(deptName); deptSaveReqVO.setName(deptName);
deptSaveReqVO.setSort(0); deptSaveReqVO.setSort(0);
deptSaveReqVO.setAncestors(ancestors);
deptSaveReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); deptSaveReqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
if(null!=phone){ if(null!=phone){
deptSaveReqVO.setPhone(phone); deptSaveReqVO.setPhone(phone);
@ -177,7 +178,7 @@ public class TenantServiceImpl implements TenantService {
if(null!=parentId){ if(null!=parentId){
deptSaveReqVO.setParentId(parentId); deptSaveReqVO.setParentId(parentId);
} }
return deptService.createDept(deptSaveReqVO); return deptService.createDeptNoVerify(deptSaveReqVO);
} }
private Long createUser(Long roleId, TenantSaveReqVO createReqVO) { private Long createUser(Long roleId, TenantSaveReqVO createReqVO) {

View File

@ -178,6 +178,7 @@ logging:
cn.iocoder.yudao.module.custom.mapper: debug # cn.iocoder.yudao.module.custom.mapper: debug #
cn.iocoder.yudao.module.company.mapper: debug # cn.iocoder.yudao.module.company.mapper: debug #
cn.iocoder.yudao.module.staff.mapper: debug # cn.iocoder.yudao.module.staff.mapper: debug #
cn.iocoder.yudao.module.property.mapper: debug #
debug: false debug: false