Merge branch 'dev' of http://122.51.230.86:3000/dianliang/lanan-system into dev
This commit is contained in:
commit
1aa11cce44
@ -94,5 +94,30 @@ public class BaseConstants {
|
|||||||
public static final String ORDER_KKYL = "3";
|
public static final String ORDER_KKYL = "3";
|
||||||
/**订单店铺名称*/
|
/**订单店铺名称*/
|
||||||
public static final String ORDER_TENANT_NAME = "蓝安集团";
|
public static final String ORDER_TENANT_NAME = "蓝安集团";
|
||||||
|
/**------工单记录常量-----------*/
|
||||||
|
|
||||||
|
/**工单*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_TICKET = "ticket";
|
||||||
|
/**工单附属项目*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_REPAIR_ITEM = "repairItem";
|
||||||
|
/**维修记录*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_RECORD = "record";
|
||||||
|
|
||||||
|
/**创建工单*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_CJGD = "cjgd";
|
||||||
|
/**指派施工*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_ZPSG = "zpsg";
|
||||||
|
/**领料*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_LL = "ll";
|
||||||
|
/**退料*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_TL = "tl";
|
||||||
|
/**施工完成(自检)*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_SGWCZJ = "sgwczj";
|
||||||
|
/**总检*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_ZJ = "zj";
|
||||||
|
/**结束工单*/
|
||||||
|
public static final String REPAIR_RECORD_TYPE_JSGD = "jsgd";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.common;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bpm 消息的枚举
|
||||||
|
*
|
||||||
|
* @author 芋道源码
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
public enum SystemEnum {
|
||||||
|
/**
|
||||||
|
* 维修系统
|
||||||
|
*/
|
||||||
|
REPAIR("weixiu","维修系统"),
|
||||||
|
/**
|
||||||
|
* 救援系统
|
||||||
|
*/
|
||||||
|
RESCUE("jiuyuan","救援系统"),
|
||||||
|
/**
|
||||||
|
* 驾校系统
|
||||||
|
*/
|
||||||
|
SCHOOL("jiaxiao","驾校系统"),
|
||||||
|
/**
|
||||||
|
* 检测系统
|
||||||
|
*/
|
||||||
|
INSPECTION("jiance","检测系统"),
|
||||||
|
/**
|
||||||
|
* 保险系统
|
||||||
|
*/
|
||||||
|
INSURE("baoxian","保险系统");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统标识
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 系统名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.app.wechat.service;
|
package cn.iocoder.yudao.module.app.wechat.service;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vinjor-m
|
* @author vinjor-m
|
||||||
@ -14,4 +15,17 @@ public interface WechatService {
|
|||||||
* @param map 参数
|
* @param map 参数
|
||||||
**/
|
**/
|
||||||
CommonResult<?> loginByOpenId(String code);
|
CommonResult<?> loginByOpenId(String code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信授权登录-未注册自动注册,已登录的返回用户信息-
|
||||||
|
* --目前维修系统使用,后续客户信息整合可以复用
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 15:14 2024/10/9
|
||||||
|
* @param sysCode 系统标识
|
||||||
|
* @param decryptResult 微信授权解密密文
|
||||||
|
* @param openId 微信openId
|
||||||
|
* @param inviteId 邀请者code
|
||||||
|
* @return cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO
|
||||||
|
**/
|
||||||
|
AdminUserDO wechatLogin(String sysCode, String decryptResult, String openId, String inviteId);
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
package cn.iocoder.yudao.module.app.wechat.service.impl;
|
package cn.iocoder.yudao.module.app.wechat.service.impl;
|
||||||
|
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import cn.iocoder.yudao.common.SystemEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.module.app.wechat.service.WechatService;
|
import cn.iocoder.yudao.module.app.wechat.service.WechatService;
|
||||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO;
|
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||||
import cn.iocoder.yudao.util.WeChatLoginUtil;
|
import cn.iocoder.yudao.util.WeChatLoginUtil;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@ -31,6 +36,10 @@ public class WechatServiceImpl implements WechatService {
|
|||||||
private AdminUserApi adminUserApi;
|
private AdminUserApi adminUserApi;
|
||||||
@Resource
|
@Resource
|
||||||
private AdminAuthService loginService;
|
private AdminAuthService loginService;
|
||||||
|
@Resource
|
||||||
|
private AdminUserService userService;
|
||||||
|
@Resource
|
||||||
|
private PasswordEncoder passwordEncoder;
|
||||||
/**
|
/**
|
||||||
* 微信自动登录
|
* 微信自动登录
|
||||||
*
|
*
|
||||||
@ -88,4 +97,68 @@ public class WechatServiceImpl implements WechatService {
|
|||||||
throw new Exception(e.getMessage());
|
throw new Exception(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信授权登录-未注册自动注册,已登录的返回用户信息-
|
||||||
|
* --目前维修系统使用,后续客户信息整合可以复用
|
||||||
|
*
|
||||||
|
* @param sysCode 系统标识
|
||||||
|
* @param decryptResult 微信授权解密密文
|
||||||
|
* @param openId 微信openId
|
||||||
|
* @param inviteId 邀请者code
|
||||||
|
* @return cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 15:14 2024/10/9
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public AdminUserDO wechatLogin(String sysCode, String decryptResult, String openId, String inviteId) {
|
||||||
|
//字符串转json
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(decryptResult);
|
||||||
|
String phoneNumber = jsonObject.getStr("phoneNumber");
|
||||||
|
//根据手机号判断数据库中是否有该用户
|
||||||
|
AdminUserDO wxUser = userService.getUserByMobileWithoutTenant(phoneNumber);
|
||||||
|
//如果查不到,则新增,查到了,则更新
|
||||||
|
UserSaveReqVO user = new UserSaveReqVO();
|
||||||
|
if (null == wxUser) {
|
||||||
|
// 直接新注册一个账号
|
||||||
|
user.setUsername(phoneNumber);
|
||||||
|
user.setNickname(phoneNumber);
|
||||||
|
user.setMobile(phoneNumber);
|
||||||
|
user.setPassword(passwordEncoder.encode("123456"));
|
||||||
|
//TODO 客户后期没有租户ID
|
||||||
|
user.setTenantId(180L);
|
||||||
|
user.setDeptId(100L);
|
||||||
|
}else {
|
||||||
|
//更新
|
||||||
|
user.setId(wxUser.getId());
|
||||||
|
}
|
||||||
|
//设置微信openId
|
||||||
|
if(SystemEnum.REPAIR.getCode().equals(sysCode)){
|
||||||
|
//维修业务系统
|
||||||
|
user.setRepairOpenId(openId);
|
||||||
|
}else if(SystemEnum.INSPECTION.getCode().equals(sysCode)){
|
||||||
|
//检测业务系统
|
||||||
|
}else if(SystemEnum.SCHOOL.getCode().equals(sysCode)){
|
||||||
|
//驾校业务系统
|
||||||
|
}else if(SystemEnum.RESCUE.getCode().equals(sysCode)){
|
||||||
|
//救援业务系统
|
||||||
|
}else if(SystemEnum.INSURE.getCode().equals(sysCode)){
|
||||||
|
//保险业务系统
|
||||||
|
}else {
|
||||||
|
//默认维修业务
|
||||||
|
user.setRepairOpenId(openId);
|
||||||
|
}
|
||||||
|
if(null!=user.getId()){
|
||||||
|
//更新
|
||||||
|
userService.updateUser(user);
|
||||||
|
}else{
|
||||||
|
//插入
|
||||||
|
Long uid = userService.createUser(user);
|
||||||
|
wxUser = new AdminUserDO();
|
||||||
|
wxUser.setId(uid);
|
||||||
|
wxUser.setUsername(user.getUsername());
|
||||||
|
wxUser.setNickname(user.getNickname());
|
||||||
|
}
|
||||||
|
return wxUser;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.service.UserCarService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 用户车辆信息表--用户个人录入的")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/user-car")
|
||||||
|
@Validated
|
||||||
|
public class UserCarController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserCarService userCarService;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,119 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.entity;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 DO
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
@TableName("base_user_car")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class UserCar extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键标识
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 发动机号码
|
||||||
|
*/
|
||||||
|
private String engineNumber;
|
||||||
|
/**
|
||||||
|
* 车架号
|
||||||
|
*/
|
||||||
|
private String vin;
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String licenseNumber;
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
private String carBrand;
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
private String carModel;
|
||||||
|
/**
|
||||||
|
* 车辆性质:营运 非营运等
|
||||||
|
*/
|
||||||
|
private String carNature;
|
||||||
|
/**
|
||||||
|
* 车辆类别:私家车 货车 教练车 公务车 出租车
|
||||||
|
*/
|
||||||
|
private String carCategory;
|
||||||
|
/**
|
||||||
|
* 行驶证图片
|
||||||
|
*/
|
||||||
|
private String carLicenseImg;
|
||||||
|
/**
|
||||||
|
* 车辆注册日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime carRegisterDate;
|
||||||
|
/**
|
||||||
|
* 保养日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime maintenanceDate;
|
||||||
|
/**
|
||||||
|
* 保养里程
|
||||||
|
*/
|
||||||
|
private Long maintenanceMileage;
|
||||||
|
/**
|
||||||
|
* 年检日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime inspectionDate;
|
||||||
|
/**
|
||||||
|
* 保险日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime insuranceDate;
|
||||||
|
/**
|
||||||
|
* 二级维护时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime checkDate;
|
||||||
|
/**
|
||||||
|
* 下次保养日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime nextMaintenanceDate;
|
||||||
|
/**
|
||||||
|
* 下次保养里程
|
||||||
|
*/
|
||||||
|
private Long nextMaintenanceMileage;
|
||||||
|
/**
|
||||||
|
* 下次年检日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime nextInspectionDate;
|
||||||
|
/**
|
||||||
|
* 保险到期日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime insuranceExpiryDate;
|
||||||
|
/**
|
||||||
|
* 下次二级维护时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime nextCheckDate;
|
||||||
|
/**
|
||||||
|
* 是否车主
|
||||||
|
*/
|
||||||
|
private String isOwner;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.UserCar;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 Mapper
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface UserCarMapper extends BaseMapper<UserCar> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.UserCar;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 Service 接口
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
public interface UserCarService extends IService<UserCar> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package cn.iocoder.yudao.module.custom.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.custom.entity.UserCar;
|
||||||
|
import cn.iocoder.yudao.module.custom.mapper.UserCarMapper;
|
||||||
|
import cn.iocoder.yudao.module.custom.service.UserCarService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户车辆信息表--用户个人录入的 Service 实现类
|
||||||
|
*
|
||||||
|
* @author vinjor-M
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class UserCarServiceImpl extends ServiceImpl<UserCarMapper, UserCar> implements UserCarService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private UserCarMapper userCarMapper;
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package cn.iocoder.yudao.util;
|
||||||
|
|
||||||
|
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.security.spec.AlgorithmParameterSpec;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES加解密util
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 17:41 2024/10/10
|
||||||
|
**/
|
||||||
|
@Component
|
||||||
|
public class AESUtil {
|
||||||
|
/**
|
||||||
|
* AES解密
|
||||||
|
*/
|
||||||
|
public String decrypt(String sessionKey,String encryptedIv,String encryptedData) throws Exception{
|
||||||
|
// 转化为字节数组
|
||||||
|
byte[] key = Base64.decode(sessionKey);
|
||||||
|
byte[] iv = Base64.decode(encryptedIv);
|
||||||
|
byte[] encData = Base64.decode(encryptedData);
|
||||||
|
// 如果密钥不足16位,那么就补足
|
||||||
|
int base =16;
|
||||||
|
if (key.length % base !=0) {
|
||||||
|
int groups = key.length / base +(key.length % base != 0 ? 1 : 0);
|
||||||
|
byte[] temp = new byte[groups * base];
|
||||||
|
Arrays.fill(temp,(byte) 0);
|
||||||
|
System.arraycopy(key,0,temp,0,key.length);
|
||||||
|
key = temp;
|
||||||
|
}
|
||||||
|
// 如果初始向量不足16位,也补足
|
||||||
|
if (iv.length % base !=0) {
|
||||||
|
int groups = iv.length / base +(iv.length % base != 0 ? 1 : 0);
|
||||||
|
byte[] temp = new byte[groups * base];
|
||||||
|
Arrays.fill(temp,(byte) 0);
|
||||||
|
System.arraycopy(iv,0,temp,0,iv.length);
|
||||||
|
iv = temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
AlgorithmParameterSpec ivSpec = new IvParameterSpec(iv);
|
||||||
|
String resultStr = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(key,"AES");
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE,keySpec,ivSpec);
|
||||||
|
resultStr = new String(cipher.doFinal(encData),"UTF-8");
|
||||||
|
} catch (Exception e){
|
||||||
|
// logger.info("解析错误");
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析加密后的字符串
|
||||||
|
return resultStr;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.custom.mapper.UserCarMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -7,6 +7,8 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||||||
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||||
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
||||||
import cn.iocoder.yudao.util.ExcelUtil;
|
import cn.iocoder.yudao.util.ExcelUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
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;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@ -39,11 +41,11 @@ public class InspectionEquInfoController extends BaseController
|
|||||||
* 查询equInfo列表
|
* 查询equInfo列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(InspectionEquInfo inspectionEquInfo) throws Exception {
|
public CommonResult list(Integer pageNum,Integer pageSize,InspectionEquInfo inspectionEquInfo) throws Exception {
|
||||||
|
|
||||||
startPage();
|
Page page =new Page(pageNum,pageSize);
|
||||||
List<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(inspectionEquInfo);
|
IPage<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(page,inspectionEquInfo);
|
||||||
return getDataTable(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,9 +54,10 @@ public class InspectionEquInfoController extends BaseController
|
|||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, InspectionEquInfo inspectionEquInfo)
|
public void export(HttpServletResponse response, InspectionEquInfo inspectionEquInfo)
|
||||||
{
|
{
|
||||||
List<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(inspectionEquInfo);
|
Page page =new Page(1,100000);
|
||||||
|
IPage<InspectionEquInfo> list = inspectionEquInfoService.selectInspectionEquInfoList(page,inspectionEquInfo);
|
||||||
ExcelUtil<InspectionEquInfo> util = new ExcelUtil<InspectionEquInfo>(InspectionEquInfo.class);
|
ExcelUtil<InspectionEquInfo> util = new ExcelUtil<InspectionEquInfo>(InspectionEquInfo.class);
|
||||||
util.exportExcel(response, list, "equInfo数据");
|
util.exportExcel(response, list.getRecords(), "equInfo数据");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -347,14 +347,14 @@ public class PartnerOwnController extends BaseController {
|
|||||||
|
|
||||||
//获取检测的数据
|
//获取检测的数据
|
||||||
@GetMapping("/inspectionList")
|
@GetMapping("/inspectionList")
|
||||||
public TableDataInfo inspectionList(Long partnerId,String status,String carNum,Integer pageSize,Integer pageNum) throws Exception {
|
public CommonResult inspectionList(Long partnerId,String status,String carNum,Integer pageSize,Integer pageNum) throws Exception {
|
||||||
ShopMallPartners partners = partnerList.shopInfo();
|
ShopMallPartners partners = partnerList.shopInfo();
|
||||||
if (!partnerId.equals(partners.getPartnerId())){
|
if (!partnerId.equals(partners.getPartnerId())){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
||||||
List<InspectionInfo> inspectionInfos = partnerList.inspectionList(page,partnerId, status, carNum);
|
IPage<InspectionInfo> inspectionInfos = partnerList.inspectionList(page,partnerId, status, carNum);
|
||||||
return getDataTable(inspectionInfos);
|
return success(inspectionInfos);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取检测的详细信息
|
//获取检测的详细信息
|
||||||
@ -365,7 +365,7 @@ public class PartnerOwnController extends BaseController {
|
|||||||
|
|
||||||
//获取检测的数据
|
//获取检测的数据
|
||||||
@GetMapping("/workerInspectionList")
|
@GetMapping("/workerInspectionList")
|
||||||
public TableDataInfo workerInspectionList(Long partnerId,String status,String searchValue,Integer pageSize,Integer pageNum) {
|
public CommonResult workerInspectionList(Long partnerId,String status,String searchValue,Integer pageSize,Integer pageNum) {
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(PartnerWorker::getUserId,user.getId()).eq(PartnerWorker::getPartnerId,partnerId);
|
queryWrapper.eq(PartnerWorker::getUserId,user.getId()).eq(PartnerWorker::getPartnerId,partnerId);
|
||||||
@ -374,8 +374,8 @@ public class PartnerOwnController extends BaseController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
||||||
List<InspectionInfo> inspectionInfos = partnerList.inspectionList(page,partnerId, status, searchValue);
|
IPage<InspectionInfo> inspectionInfos = partnerList.inspectionList(page,partnerId, status, searchValue);
|
||||||
return getDataTable(inspectionInfos);
|
return success(inspectionInfos);
|
||||||
}
|
}
|
||||||
//增加检测步骤信息
|
//增加检测步骤信息
|
||||||
@PostMapping("/addStepInfo")
|
@PostMapping("/addStepInfo")
|
||||||
@ -397,28 +397,28 @@ public class PartnerOwnController extends BaseController {
|
|||||||
}
|
}
|
||||||
//获取到店预约的数据
|
//获取到店预约的数据
|
||||||
@GetMapping("/getAppointmentList")
|
@GetMapping("/getAppointmentList")
|
||||||
public TableDataInfo getAppointmentList(Long partnerId,String phoneNum,Integer pageSize,Integer pageNum) {
|
public CommonResult getAppointmentList(Long partnerId,String phoneNum,Integer pageSize,Integer pageNum) {
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||||
if (!partnersTmp.getUserId().equals(user.getId())){
|
if (!partnersTmp.getUserId().equals(user.getId())){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Page<InspectionAppointment> page = new Page<>(pageNum,pageSize);
|
Page<InspectionAppointment> page = new Page<>(pageNum,pageSize);
|
||||||
List<InspectionAppointment> appointments = partnerList.getAppointmentList(page,partnerId,phoneNum);
|
IPage<InspectionAppointment> appointments = partnerList.getAppointmentList(page,partnerId,phoneNum);
|
||||||
return getDataTable(appointments);
|
return success(appointments);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取上门取车数据
|
//获取上门取车数据
|
||||||
@GetMapping("/getPickCarList")
|
@GetMapping("/getPickCarList")
|
||||||
public TableDataInfo getPickCarList(Long partnerId,String phoneNum,String pickStatus,Integer pageSize,Integer pageNum) {
|
public CommonResult getPickCarList(Long partnerId,String phoneNum,String pickStatus,Integer pageSize,Integer pageNum) {
|
||||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||||
if (!partnersTmp.getUserId().equals(user.getId())){
|
if (!partnersTmp.getUserId().equals(user.getId())){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
PageHelper.startPage(pageNum,pageSize);
|
Page<InspectionPickCar> page = new Page<>(pageNum,pageSize);
|
||||||
List<InspectionPickCar> pickCarList = partnerList.getPickCarList(partnerId,phoneNum,pickStatus);
|
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarList(page,partnerId,phoneNum,pickStatus);
|
||||||
return getDataTable(pickCarList);
|
return success(pickCarList);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取上门取车详情页
|
//获取上门取车详情页
|
||||||
|
@ -36,10 +36,10 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
|
|||||||
List<OrderAppDetail> orderList(@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum,@Param("title") String title);
|
List<OrderAppDetail> orderList(@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum,@Param("title") String title);
|
||||||
List<PartnerWorker> getWorkList(@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum);
|
List<PartnerWorker> getWorkList(@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum);
|
||||||
IPage<PartnerWorker> pageWorkList(@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum,Page<LabelRespVO> page);
|
IPage<PartnerWorker> pageWorkList(@Param("partnerId")Long partnerId, @Param("postId") Long postId, @Param("workName") String workName, @Param("phoneNum")String phoneNum,Page<LabelRespVO> page);
|
||||||
List<InspectionInfo> inspectionList(Page<InspectionInfo> page,@Param("partnerId")Long partnerId, @Param("status") String status, @Param("carNum")String carNum);
|
IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page,@Param("partnerId")Long partnerId, @Param("status") String status, @Param("carNum")String carNum);
|
||||||
List<InspectionInfo> workerInspectionList(@Param("workerId")Long workerId,@Param("status") String status, @Param("searchValue")String searchValue);
|
List<InspectionInfo> workerInspectionList(@Param("workerId")Long workerId,@Param("status") String status, @Param("searchValue")String searchValue);
|
||||||
List<OrderInfo> validationList(@Param("partnerId") Long partnerId, @Param("searchValue") String searchValue);
|
List<OrderInfo> validationList(@Param("partnerId") Long partnerId, @Param("searchValue") String searchValue);
|
||||||
List<InspectionPickCar> getPickCarList(@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum, @Param("pickStatus") String pickStatus);
|
IPage<InspectionPickCar> getPickCarList(Page page,@Param("partnerId") Long partnerId, @Param("phoneNum") String phoneNum, @Param("pickStatus") String pickStatus);
|
||||||
List<InspectionPickCar> getPickCarListOfWorker(@Param("workerId") Long workerId, @Param("phoneNum") String phoneNum);
|
List<InspectionPickCar> getPickCarListOfWorker(@Param("workerId") Long workerId, @Param("phoneNum") String phoneNum);
|
||||||
|
|
||||||
List<OrderInfo> chartInfoAmount(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId);
|
List<OrderInfo> chartInfoAmount(@Param("startTime") String startTime,@Param("endTime")String endTime,@Param("partnerId")Long partnerId);
|
||||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.inspection.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@ -64,7 +65,7 @@ public interface InspectionAppointmentMapper extends BaseMapper<InspectionAppoin
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteInspectionAppointmentByIds(Long[] ids);
|
public int deleteInspectionAppointmentByIds(Long[] ids);
|
||||||
List<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,@Param("partnerId") Long partnerId, @Param("phoneNum")String phoneNum);
|
IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, @Param("partnerId") Long partnerId, @Param("phoneNum")String phoneNum);
|
||||||
List<InspectionAppointment> getAppointmentOwn(@Param("userId") Long userId);
|
List<InspectionAppointment> getAppointmentOwn(@Param("userId") Long userId);
|
||||||
|
|
||||||
|
|
||||||
|
@ -4,7 +4,10 @@ import java.util.List;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* equInfoMapper接口
|
* equInfoMapper接口
|
||||||
@ -29,6 +32,6 @@ public interface InspectionEquInfoMapper extends BaseMapper<InspectionEquInfo>
|
|||||||
* @param inspectionEquInfo equInfo
|
* @param inspectionEquInfo equInfo
|
||||||
* @return equInfo集合
|
* @return equInfo集合
|
||||||
*/
|
*/
|
||||||
public List<InspectionEquInfo> selectInspectionEquInfoList(InspectionEquInfo inspectionEquInfo);
|
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page, @Param("inspectionEquInfo") InspectionEquInfo inspectionEquInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,20 +69,20 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
|||||||
|
|
||||||
void delWorker(Long partnerId,Long workId);
|
void delWorker(Long partnerId,Long workId);
|
||||||
|
|
||||||
List<InspectionInfo> inspectionList(Page<InspectionInfo> page,Long partnerId, String status, String carNum);
|
IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page,Long partnerId, String status, String carNum);
|
||||||
InspectionInfoVo inspectionDetail(Long inspectionInfoId);
|
InspectionInfoVo inspectionDetail(Long inspectionInfoId);
|
||||||
|
|
||||||
List<InspectionInfo> workerInspectionList(Long partnerId,String status,String searchValue);
|
List<InspectionInfo> workerInspectionList(Long partnerId,String status,String searchValue);
|
||||||
void addStepInfo(InspectionStepInfo stepInfo);
|
void addStepInfo(InspectionStepInfo stepInfo);
|
||||||
void stopInspection(InspectionInfo info) throws Exception;
|
void stopInspection(InspectionInfo info) throws Exception;
|
||||||
void makeCertOk(Long inspectionId);
|
void makeCertOk(Long inspectionId);
|
||||||
List<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,Long partnerId,String phoneNum);
|
IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,Long partnerId,String phoneNum);
|
||||||
List<OrderInfo> validationList(Long partnerId,String searchValue);
|
List<OrderInfo> validationList(Long partnerId,String searchValue);
|
||||||
void sendCoupon(ShopCouponTemplate template) throws Exception;
|
void sendCoupon(ShopCouponTemplate template) throws Exception;
|
||||||
List<ShopCouponTemplate> listCoupon(Long partnerId,String searchValue);
|
List<ShopCouponTemplate> listCoupon(Long partnerId,String searchValue);
|
||||||
void delCoupon(Long partnerId,Long id);
|
void delCoupon(Long partnerId,Long id);
|
||||||
void designatePickCarWorker(Long pickCarId,Long workerId);
|
void designatePickCarWorker(Long pickCarId,Long workerId);
|
||||||
List<InspectionPickCar> getPickCarList(Long partnerId, String phoneNum,String pickStatus);
|
IPage<InspectionPickCar> getPickCarList(Page page,Long partnerId, String phoneNum,String pickStatus);
|
||||||
InspectionPickCar getPickCarDetail(Long dataId);
|
InspectionPickCar getPickCarDetail(Long dataId);
|
||||||
List<InspectionPickCar> getPickCarListOfWorker(Long workerId, String phoneNum);
|
List<InspectionPickCar> getPickCarListOfWorker(Long workerId, String phoneNum);
|
||||||
JSONObject vehicleLicenseOCR(String imagePath) throws Exception;
|
JSONObject vehicleLicenseOCR(String imagePath) throws Exception;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.inspection.service;
|
package cn.iocoder.yudao.module.inspection.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionAppointment;
|
||||||
@ -73,6 +74,6 @@ public interface IInspectionAppointmentService extends IService<InspectionAppoi
|
|||||||
JSONObject pickCarInfo();
|
JSONObject pickCarInfo();
|
||||||
JSONObject computeDistanceAndPrice(Long goodsId,Double longitude,Double latitude,String type ) throws Exception;
|
JSONObject computeDistanceAndPrice(Long goodsId,Double longitude,Double latitude,String type ) throws Exception;
|
||||||
|
|
||||||
public List<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,Long partnerId, String phoneNum);
|
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, Long partnerId, String phoneNum);
|
||||||
List<InspectionAppointment> getAppointmentOwn();
|
List<InspectionAppointment> getAppointmentOwn();
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.inspection.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
||||||
|
|
||||||
@ -27,7 +29,7 @@ public interface IInspectionEquInfoService extends IService<InspectionEquInfo>
|
|||||||
* @param inspectionEquInfo equInfo
|
* @param inspectionEquInfo equInfo
|
||||||
* @return equInfo集合
|
* @return equInfo集合
|
||||||
*/
|
*/
|
||||||
public List<InspectionEquInfo> selectInspectionEquInfoList(InspectionEquInfo inspectionEquInfo);
|
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page,InspectionEquInfo inspectionEquInfo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增equInfo
|
* 新增equInfo
|
||||||
|
@ -239,7 +239,6 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
StatisticsInfo statisticsInfo2 = baseMapper.orderNum(partnerId, DateUtil.format(new Date(),"yyyy-MM-dd"));
|
StatisticsInfo statisticsInfo2 = baseMapper.orderNum(partnerId, DateUtil.format(new Date(),"yyyy-MM-dd"));
|
||||||
|
|
||||||
//合规且合格双燃料
|
//合规且合格双燃料
|
||||||
Integer i = baseMapper.srlNum(partnerId, DateUtil.format(new Date(), "yyyy-MM-dd"));
|
Integer i = baseMapper.srlNum(partnerId, DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||||
Integer hgNum = baseMapper.hgNum(partnerId, DateUtil.format(new Date(), "yyyy-MM-dd"));
|
Integer hgNum = baseMapper.hgNum(partnerId, DateUtil.format(new Date(), "yyyy-MM-dd"));
|
||||||
@ -1100,7 +1099,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<InspectionInfo> inspectionList(Page<InspectionInfo> page,Long partnerId, String status, String carNum) {
|
public IPage<InspectionInfo> inspectionList(Page<InspectionInfo> page,Long partnerId, String status, String carNum) {
|
||||||
return baseMapper.inspectionList(page,partnerId,status,carNum);
|
return baseMapper.inspectionList(page,partnerId,status,carNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1243,7 +1242,7 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,Long partnerId,String phoneNum) {
|
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,Long partnerId,String phoneNum) {
|
||||||
return appointmentService.getAppointmentList(page,partnerId,phoneNum);
|
return appointmentService.getAppointmentList(page,partnerId,phoneNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1311,9 +1310,9 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<InspectionPickCar> getPickCarList(Long partnerId, String phoneNum,String pickStatus) {
|
public IPage<InspectionPickCar> getPickCarList(Page page,Long partnerId, String phoneNum,String pickStatus) {
|
||||||
|
|
||||||
return baseMapper.getPickCarList(partnerId,phoneNum,pickStatus);
|
return baseMapper.getPickCarList(page,partnerId,phoneNum,pickStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -13,6 +13,7 @@ import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
|||||||
import cn.iocoder.yudao.util.SendSmsUtil;
|
import cn.iocoder.yudao.util.SendSmsUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import cn.iocoder.yudao.util.DateUtils;
|
import cn.iocoder.yudao.util.DateUtils;
|
||||||
@ -347,7 +348,7 @@ public class InspectionAppointmentServiceImpl extends ServiceImpl<InspectionAppo
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page,Long partnerId, String phoneNum) {
|
public IPage<InspectionAppointment> getAppointmentList(Page<InspectionAppointment> page, Long partnerId, String phoneNum) {
|
||||||
return baseMapper.getAppointmentList(page,partnerId,phoneNum);
|
return baseMapper.getAppointmentList(page,partnerId,phoneNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import cn.iocoder.yudao.util.DateUtils;
|
import cn.iocoder.yudao.util.DateUtils;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
|
import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
|
||||||
@ -48,9 +50,9 @@ public class InspectionEquInfoServiceImpl extends ServiceImpl<InspectionEquInfoM
|
|||||||
* @return equInfo
|
* @return equInfo
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<InspectionEquInfo> selectInspectionEquInfoList(InspectionEquInfo inspectionEquInfo)
|
public IPage<InspectionEquInfo> selectInspectionEquInfoList(Page page,InspectionEquInfo inspectionEquInfo)
|
||||||
{
|
{
|
||||||
return baseMapper.selectInspectionEquInfoList(inspectionEquInfo);
|
return baseMapper.selectInspectionEquInfoList(page,inspectionEquInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.payment.entity;
|
package cn.iocoder.yudao.module.payment.entity;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -14,7 +15,7 @@ import java.util.Date;
|
|||||||
* @since 2023-07-24 18:30:28
|
* @since 2023-07-24 18:30:28
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class OrderInfo {
|
public class OrderInfo extends TenantBaseDO {
|
||||||
//订单id
|
//订单id
|
||||||
private Long id;
|
private Long id;
|
||||||
private String transactionId;
|
private String transactionId;
|
||||||
@ -63,16 +64,11 @@ public class OrderInfo {
|
|||||||
private Integer commentStar;
|
private Integer commentStar;
|
||||||
//订单类型
|
//订单类型
|
||||||
private String orderType;
|
private String orderType;
|
||||||
//创建时间
|
|
||||||
private Date createTime;
|
|
||||||
//创建人id
|
|
||||||
private Long creator;
|
|
||||||
//创建人所在部门
|
//创建人所在部门
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
//更新时间
|
|
||||||
private Date updateTime;
|
|
||||||
//更新人id
|
|
||||||
private Integer updater;
|
|
||||||
//积分充值的金额
|
//积分充值的金额
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Long balanceCz;
|
private Long balanceCz;
|
||||||
|
@ -278,7 +278,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||||||
createOrder.setPartnerName(goods.getString("partnerName"));
|
createOrder.setPartnerName(goods.getString("partnerName"));
|
||||||
createOrder.setRealName(user.getNickname());
|
createOrder.setRealName(user.getNickname());
|
||||||
createOrder.setPhonenumber(user.getMobile());
|
createOrder.setPhonenumber(user.getMobile());
|
||||||
createOrder.setCreator(user.getId());
|
createOrder.setCreator(String.valueOf(user.getId()));
|
||||||
createOrder.setDeptId(user.getDeptId());
|
createOrder.setDeptId(user.getDeptId());
|
||||||
createOrder.setReduceMoney(goods.getLong("reduceMoney"));
|
createOrder.setReduceMoney(goods.getLong("reduceMoney"));
|
||||||
//待支付
|
//待支付
|
||||||
|
@ -113,7 +113,6 @@
|
|||||||
sum((oi.pay_time like CONCAT(#{timeStr},'%') and oi.create_time like CONCAT(#{timeStr},'%'))),0) as workedNum
|
sum((oi.pay_time like CONCAT(#{timeStr},'%') and oi.create_time like CONCAT(#{timeStr},'%'))),0) as workedNum
|
||||||
FROM
|
FROM
|
||||||
order_info oi
|
order_info oi
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="allAmount" resultType="java.lang.Integer">
|
<select id="allAmount" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
@ -431,7 +430,7 @@ FROM
|
|||||||
partner_worker pw
|
partner_worker pw
|
||||||
INNER JOIN system_users su ON pw.user_id = su.id
|
INNER JOIN system_users su ON pw.user_id = su.id
|
||||||
left JOIN system_user_post sup on sup.user_id = su.id
|
left JOIN system_user_post sup on sup.user_id = su.id
|
||||||
where pw.partner_id = #{partnerId}
|
where pw.deleted = 0
|
||||||
<if test="workName!=null and workName!=''">
|
<if test="workName!=null and workName!=''">
|
||||||
and su.nickname like concat('%',#{workName},'%')
|
and su.nickname like concat('%',#{workName},'%')
|
||||||
</if>
|
</if>
|
||||||
|
@ -10,10 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<select id="selectInspectionEquInfoList" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo">
|
<select id="selectInspectionEquInfoList" parameterType="cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo">
|
||||||
select * from inspection_equ_info
|
select * from inspection_equ_info
|
||||||
<where>
|
<where>
|
||||||
<if test="equName != null and equName != ''"> and equ_name like concat('%', #{equName}, '%')</if>
|
<if test="inspectionEquInfo.equName != null and inspectionEquInfo.equName != ''"> and equ_name like concat('%', #{inspectionEquInfo.equName}, '%')</if>
|
||||||
<if test="equModel != null and equModel != ''"> and equ_model like concat('%', #{equModel}, '%')</if>
|
<if test="inspectionEquInfo.equModel != null and inspectionEquInfo.equModel != ''"> and equ_model like concat('%', #{inspectionEquInfo.equModel}, '%')</if>
|
||||||
<if test="equNumber != null and equNumber != ''"> and equ_number like concat('%', #{equNumber}, '%')</if>
|
<if test="inspectionEquInfo.equNumber != null and inspectionEquInfo.equNumber != ''"> and equ_number like concat('%', #{inspectionEquInfo.equNumber}, '%')</if>
|
||||||
<if test="params.beginNextCheckTime != null and params.beginNextCheckTime != '' and params.endNextCheckTime != null and params.endNextCheckTime != ''"> and next_check_time between #{params.beginNextCheckTime} and #{params.endNextCheckTime}</if>
|
<if test="inspectionEquInfo.params.beginNextCheckTime != null and inspectionEquInfo.params.beginNextCheckTime != '' and params.endNextCheckTime != null and params.endNextCheckTime != ''">
|
||||||
|
and next_check_time between #{inspectionEquInfo.params.beginNextCheckTime} and #{inspectionEquInfo.params.endNextCheckTime}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
@ -1,62 +1,34 @@
|
|||||||
package cn.iocoder.yudao.module.app.controller;
|
package cn.iocoder.yudao.module.app.controller;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
|
import cn.iocoder.yudao.common.SystemEnum;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.security.config.SecurityProperties;
|
import cn.iocoder.yudao.framework.security.config.SecurityProperties;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.app.vo.WxLoginBody;
|
import cn.iocoder.yudao.module.app.vo.WxLoginBody;
|
||||||
import cn.iocoder.yudao.module.custom.entity.CustomerMain;
|
import cn.iocoder.yudao.module.app.wechat.service.WechatService;
|
||||||
import cn.iocoder.yudao.module.custom.service.CustomerMainService;
|
|
||||||
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
|
|
||||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
|
||||||
import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
|
|
||||||
import cn.iocoder.yudao.module.system.api.permission.RoleApi;
|
|
||||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginRespVO;
|
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginRespVO;
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.LoginBody;
|
|
||||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||||
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.MenuService;
|
import cn.iocoder.yudao.util.AESUtil;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
|
||||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
|
||||||
import cn.iocoder.yudao.util.WechatPayConfig;
|
import cn.iocoder.yudao.util.WechatPayConfig;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.sun.org.apache.xerces.internal.impl.dv.util.Base64;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.crypto.Cipher;
|
|
||||||
import javax.crypto.spec.IvParameterSpec;
|
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.security.spec.AlgorithmParameterSpec;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.*;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录验证
|
* 登录验证
|
||||||
@ -76,11 +48,20 @@ public class LoginController {
|
|||||||
@Resource
|
@Resource
|
||||||
private SecurityProperties securityProperties;
|
private SecurityProperties securityProperties;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CustomerMainService customerMainService;
|
private WechatService wechatService;
|
||||||
|
@Autowired
|
||||||
|
private AESUtil aesUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 微信授权登录
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 17:43 2024/10/10
|
||||||
|
* @param wxLoginBody 请求体
|
||||||
|
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<?>
|
||||||
|
**/
|
||||||
@PostMapping("/wxLogin")
|
@PostMapping("/wxLogin")
|
||||||
@TenantIgnore
|
@TenantIgnore
|
||||||
public CommonResult wxLogin(@RequestBody WxLoginBody wxLoginBody) {
|
public CommonResult<?> wxLogin(@RequestBody WxLoginBody wxLoginBody) {
|
||||||
String code = wxLoginBody.getCode();
|
String code = wxLoginBody.getCode();
|
||||||
//秘钥
|
//秘钥
|
||||||
String encryptedIv = wxLoginBody.getEncryptedIv();
|
String encryptedIv = wxLoginBody.getEncryptedIv();
|
||||||
@ -97,29 +78,26 @@ public class LoginController {
|
|||||||
String decryptResult = "";
|
String decryptResult = "";
|
||||||
try {
|
try {
|
||||||
//如果没有绑定微信开放平台,解析结果是没有unionid的。
|
//如果没有绑定微信开放平台,解析结果是没有unionid的。
|
||||||
decryptResult = decrypt(sessionKey, encryptedIv, encryptedData);
|
decryptResult = aesUtil.decrypt(sessionKey, encryptedIv, encryptedData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return error(500, "微信登录失败!");
|
return error(500, "微信登录失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.hasText(decryptResult)) {
|
if (StringUtils.hasText(decryptResult)) {
|
||||||
//如果解析成功,获取token
|
//如果解析成功,获取token
|
||||||
AuthLoginRespVO loginVO = loginService.wxLoginRepair(decryptResult,openId,wxLoginBody.getInviteId());
|
//查用户(未注册的话自动注册)
|
||||||
|
AdminUserDO adminUserDO = wechatService.wechatLogin(SystemEnum.REPAIR.getCode(),decryptResult,openId,wxLoginBody.getInviteId());
|
||||||
|
//登录生成token
|
||||||
|
AuthLoginRespVO loginVO = loginService.wxLoginByUserId(adminUserDO.getId(),adminUserDO.getUsername());
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("token", loginVO.getAccessToken());
|
map.put("token", loginVO.getAccessToken());
|
||||||
//查会员表里是否有数据
|
map.put("userinfo", adminUserDO);
|
||||||
CustomerMain customerMain = customerMainService.getCustomerByUserId(loginVO.getUserId());
|
|
||||||
map.put("ifNeedFill", null==customerMain);
|
|
||||||
return success(map);
|
return success(map);
|
||||||
} else {
|
} else {
|
||||||
return error(500, "微信登录失败!");
|
return error(500, "微信登录失败!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/logout")
|
@PostMapping("/logout")
|
||||||
@Operation(summary = "登出系统")
|
@Operation(summary = "登出系统")
|
||||||
public CommonResult<Boolean> logout(HttpServletRequest request) {
|
public CommonResult<Boolean> logout(HttpServletRequest request) {
|
||||||
@ -130,48 +108,4 @@ public class LoginController {
|
|||||||
}
|
}
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* AES解密
|
|
||||||
*/
|
|
||||||
private String decrypt(String sessionKey,String encryptedIv,String encryptedData) throws Exception{
|
|
||||||
// 转化为字节数组
|
|
||||||
byte[] key = Base64.decode(sessionKey);
|
|
||||||
byte[] iv = Base64.decode(encryptedIv);
|
|
||||||
byte[] encData = Base64.decode(encryptedData);
|
|
||||||
// 如果密钥不足16位,那么就补足
|
|
||||||
int base =16;
|
|
||||||
if (key.length % base !=0) {
|
|
||||||
int groups = key.length / base +(key.length % base != 0 ? 1 : 0);
|
|
||||||
byte[] temp = new byte[groups * base];
|
|
||||||
Arrays.fill(temp,(byte) 0);
|
|
||||||
System.arraycopy(key,0,temp,0,key.length);
|
|
||||||
key = temp;
|
|
||||||
}
|
|
||||||
// 如果初始向量不足16位,也补足
|
|
||||||
if (iv.length % base !=0) {
|
|
||||||
int groups = iv.length / base +(iv.length % base != 0 ? 1 : 0);
|
|
||||||
byte[] temp = new byte[groups * base];
|
|
||||||
Arrays.fill(temp,(byte) 0);
|
|
||||||
System.arraycopy(iv,0,temp,0,iv.length);
|
|
||||||
iv = temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
AlgorithmParameterSpec ivSpec = new IvParameterSpec(iv);
|
|
||||||
String resultStr = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
|
|
||||||
SecretKeySpec keySpec = new SecretKeySpec(key,"AES");
|
|
||||||
cipher.init(Cipher.DECRYPT_MODE,keySpec,ivSpec);
|
|
||||||
resultStr = new String(cipher.doFinal(encData),"UTF-8");
|
|
||||||
} catch (Exception e){
|
|
||||||
// logger.info("解析错误");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解析加密后的字符串
|
|
||||||
return resultStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.app.service;
|
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author vinjor-m
|
|
||||||
* @description 维修模块微信登录逻辑
|
|
||||||
**/
|
|
||||||
public interface WechatLoginService {
|
|
||||||
/**
|
|
||||||
* 维修系统-微信授权登录-未注册自动注册
|
|
||||||
* @author vinjor-M
|
|
||||||
* @date 15:14 2024/10/9
|
|
||||||
* @param decryptResult TODO
|
|
||||||
* @param openId TODO
|
|
||||||
* @param inviteId TODO
|
|
||||||
* @return cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO
|
|
||||||
**/
|
|
||||||
AdminUserDO wechatLogin(String decryptResult,String openId,String inviteId);
|
|
||||||
}
|
|
@ -20,5 +20,5 @@ public class WxLoginBody {
|
|||||||
private String encryptedData;
|
private String encryptedData;
|
||||||
|
|
||||||
//邀请码
|
//邀请码
|
||||||
private Long inviteId;
|
private String inviteId;
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,12 @@
|
|||||||
package cn.iocoder.yudao.module.base.controller.admin;
|
package cn.iocoder.yudao.module.base.controller.admin;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
||||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修记录 管理 API
|
* 维修记录 管理 API
|
||||||
@ -30,43 +21,5 @@ public class RepairRecordsController {
|
|||||||
@Resource
|
@Resource
|
||||||
private RepairRecordsService repairRecordsService;
|
private RepairRecordsService repairRecordsService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
|
||||||
@Operation(summary = "创建维修记录")
|
|
||||||
public CommonResult<String> createRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO createReqVO) {
|
|
||||||
return success(repairRecordsService.createRepairRecords(createReqVO));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
|
||||||
@Operation(summary = "更新维修记录")
|
|
||||||
public CommonResult<Boolean> updateRepairRecords(@Valid @RequestBody RepairRecordsSaveReqVO updateReqVO) {
|
|
||||||
repairRecordsService.updateRepairRecords(updateReqVO);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
|
||||||
@Operation(summary = "删除维修记录")
|
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
|
||||||
public CommonResult<Boolean> deleteRepairRecords(@RequestParam("id") String id) {
|
|
||||||
repairRecordsService.deleteRepairRecords(id);
|
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @GetMapping("/get")
|
|
||||||
// @Operation(summary = "获得维修记录")
|
|
||||||
// @Parameter(name = "id", description = "编号", required = true, example = "1024")
|
|
||||||
// public CommonResult<RepairRecordsRespVO> getRecords(@RequestParam("id") String id) {
|
|
||||||
// RepairRecords records = repairRecordsService.getRepairRecords(id);
|
|
||||||
// return success(BeanUtils.toBean(records, RepairRecordsRespVO.class));
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维修工查询维修记录
|
|
||||||
* @param pageReqVO
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@GetMapping("/page")
|
|
||||||
@Operation(summary = "获得维修记录分页")
|
|
||||||
public List<RepairRecordsRespVO> queryAllRepairRecords(@RequestBody RepairRecordsPageReqVO pageReqVO) {
|
|
||||||
return repairRecordsService.queryAllRepairRecords(pageReqVO);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ public class RepairRecords extends TenantBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 主键标识
|
* 主键标识
|
||||||
*/
|
*/
|
||||||
@TableId(type = IdType.INPUT)
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
/**
|
/**
|
||||||
* 工单id
|
* 工单id
|
||||||
@ -32,7 +32,7 @@ public class RepairRecords extends TenantBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 工单子表id
|
* 工单子表id
|
||||||
*/
|
*/
|
||||||
private String repairTitemId;
|
private String repairItemId;
|
||||||
/**
|
/**
|
||||||
* 记录类型(repair_records_type)
|
* 记录类型(repair_records_type)
|
||||||
*/
|
*/
|
||||||
@ -41,10 +41,6 @@ public class RepairRecords extends TenantBaseDO {
|
|||||||
* 记录描述
|
* 记录描述
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
/**
|
|
||||||
* 过程记录中的图片(多个,拼接)
|
|
||||||
*/
|
|
||||||
private String image;
|
|
||||||
/**
|
/**
|
||||||
* 处理人
|
* 处理人
|
||||||
*/
|
*/
|
||||||
@ -52,6 +48,6 @@ public class RepairRecords extends TenantBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 处理人员工表id
|
* 处理人员工表id
|
||||||
*/
|
*/
|
||||||
private String dealUserId;
|
private Long dealUserId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.entity;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录附件
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@TableName("dl_repair_records_item")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RepairRecordsItem extends TenantBaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键标识
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_UUID)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 记录id
|
||||||
|
*/
|
||||||
|
private String recordId;
|
||||||
|
/**
|
||||||
|
* 工单id
|
||||||
|
*/
|
||||||
|
private String ticketId;
|
||||||
|
/**
|
||||||
|
* 工单子表id
|
||||||
|
*/
|
||||||
|
private String repairItemId;
|
||||||
|
/**
|
||||||
|
* 记录描述
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 图片附件
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
/**
|
||||||
|
* 是否开放给用户(0否1是)
|
||||||
|
*/
|
||||||
|
private String isOpen;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.mapper;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录 Mapper
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface RepairRecordsItemMapper extends BaseMapper<RepairRecordsItem> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -17,7 +17,6 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface RepairRecordsMapper extends BaseMapper<RepairRecords> {
|
public interface RepairRecordsMapper extends BaseMapper<RepairRecords> {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询维修记录
|
* 查询维修记录
|
||||||
* @author lzt
|
* @author lzt
|
||||||
@ -25,6 +24,8 @@ public interface RepairRecordsMapper extends BaseMapper<RepairRecords> {
|
|||||||
* @return List<RepairRecordsRespVO>
|
* @return List<RepairRecordsRespVO>
|
||||||
* @date 2024年10月9日
|
* @date 2024年10月9日
|
||||||
*/
|
*/
|
||||||
List<RepairRecordsRespVO> queryAllRepairRecords(@Param("entity") RepairRecordsPageReqVO entity);
|
List<RepairRecordsRespVO> queryRepairRecords(@Param("entity") RepairRecordsPageReqVO entity);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.service;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录 Service 接口
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
public interface RepairRecordsItemService extends IService<RepairRecordsItem> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主表id删除附件
|
||||||
|
*
|
||||||
|
* @param mainType ticket:工单;repairItem:工单附属项目;record:维修记录
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:43 2024/10/11
|
||||||
|
**/
|
||||||
|
void removeByMainId(String mainType, String mainId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id查询图片
|
||||||
|
*
|
||||||
|
* @param mainType ticket:工单;repairItem:工单附属项目;record:维修记录
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @param isOpen 是否开放给用户(默认查询全部,如不为null则根据条件查询)
|
||||||
|
* @return 记录图片集合
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:30 2024/10/11
|
||||||
|
**/
|
||||||
|
List<RepairRecordsItem> getByMainId(String mainType, String mainId, String isOpen);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存维修记录相关的图片
|
||||||
|
*
|
||||||
|
* @param recordId 记录id
|
||||||
|
* @param ticketId 工单id
|
||||||
|
* @param repairItemId 工单子表id
|
||||||
|
* @param image 上传附件相对路径(多个用“,”分隔)
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:09 2024/10/11
|
||||||
|
**/
|
||||||
|
void saveItem(String recordId, String ticketId, String repairItemId, String image);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置图片是否开放给用户
|
||||||
|
*
|
||||||
|
* @param ids 前端选中图片id(多个用“,”分隔)
|
||||||
|
* @param isOpen 0否1是
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:22 2024/10/11
|
||||||
|
**/
|
||||||
|
void setRepairOpen(String ids, String isOpen);
|
||||||
|
}
|
@ -3,13 +3,8 @@ package cn.iocoder.yudao.module.base.service;
|
|||||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,43 +15,25 @@ import java.util.List;
|
|||||||
public interface RepairRecordsService extends IService<RepairRecords> {
|
public interface RepairRecordsService extends IService<RepairRecords> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建维修记录
|
* 保存维修记录
|
||||||
*
|
*
|
||||||
* @param createReqVO 创建信息
|
* @param ticketId 工单id
|
||||||
* @return 编号
|
* @param repairItemId 工单子表id
|
||||||
*/
|
* @param type 工作类型(数据字典:repair_records_type;后端已初始化常量,可直接引用base包中BaseConstants下106-119行)
|
||||||
String createRepairRecords(@Valid RepairRecordsSaveReqVO createReqVO);
|
* @param remark 备注
|
||||||
|
* @param images 图片(相对路径按照“,”分隔)
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:51 2024/10/11
|
||||||
|
**/
|
||||||
|
void saveRepairRecord(String ticketId, String repairItemId, String type, String remark, String images);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新维修记录
|
* 根据条件查询维修记录
|
||||||
*
|
* @author PQZ
|
||||||
* @param updateReqVO 更新信息
|
* @date 15:14 2024/10/11
|
||||||
*/
|
* @param pageReqVO RepairRecordsPageReqVO实体
|
||||||
void updateRepairRecords(@Valid RepairRecordsSaveReqVO updateReqVO);
|
* @return java.util.List<cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO>
|
||||||
|
**/
|
||||||
/**
|
List<RepairRecordsRespVO> queryList(RepairRecordsPageReqVO pageReqVO);
|
||||||
* 删除维修记录
|
|
||||||
*
|
|
||||||
* @param id 编号
|
|
||||||
*/
|
|
||||||
void deleteRepairRecords(String id);
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 获得维修记录
|
|
||||||
// *
|
|
||||||
// * @param id 编号
|
|
||||||
// * @return 维修记录
|
|
||||||
// */
|
|
||||||
// RepairRecords getRepairRecords(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得维修记录
|
|
||||||
*
|
|
||||||
* @param pageReqVO 查询条件
|
|
||||||
* @return queryAllRepairRecords 所有维修记录
|
|
||||||
*/
|
|
||||||
List<RepairRecordsRespVO> queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,154 @@
|
|||||||
|
package cn.iocoder.yudao.module.base.service.impl;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
|
import cn.iocoder.yudao.module.base.mapper.RepairRecordsItemMapper;
|
||||||
|
import cn.iocoder.yudao.module.base.service.RepairRecordsItemService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.common.BaseConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修记录 Service 实现类
|
||||||
|
*
|
||||||
|
* @author pqz
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class RepairRecordsItemServiceImpl extends ServiceImpl<RepairRecordsItemMapper, RepairRecordsItem> implements RepairRecordsItemService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RepairRecordsItemMapper itemMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主表id删除附件
|
||||||
|
*
|
||||||
|
* @param mainType ticket:工单;repairItem:工单附属项目;record:维修记录
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @author PQZ
|
||||||
|
* @date 11:43 2024/10/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void removeByMainId(String mainType, String mainId) {
|
||||||
|
//根据不同类型初始化不通过查询条件
|
||||||
|
LambdaQueryWrapper<RepairRecordsItem> lambdaQueryWrapper = queryType(mainType, mainId);
|
||||||
|
remove(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id查询图片
|
||||||
|
*
|
||||||
|
* @param mainType ticket:工单;repairItem:工单附属项目;record:维修记录
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @param isOpen 是否开放给用户(默认查询全部,如不为null则根据条件查询)
|
||||||
|
* @return 记录图片集合
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:30 2024/10/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public List<RepairRecordsItem> getByMainId(String mainType, String mainId, String isOpen) {
|
||||||
|
//根据不同类型初始化不通过查询条件
|
||||||
|
LambdaQueryWrapper<RepairRecordsItem> lambdaQueryWrapper = queryType(mainType, mainId);
|
||||||
|
//默认查询全部,如不为null则根据条件查询
|
||||||
|
if (StringUtils.isNotEmpty(isOpen)) {
|
||||||
|
lambdaQueryWrapper.eq(RepairRecordsItem::getIsOpen, isOpen);
|
||||||
|
}
|
||||||
|
return list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存维修记录相关的图片
|
||||||
|
*
|
||||||
|
* @param recordId 记录id
|
||||||
|
* @param ticketId 工单id
|
||||||
|
* @param repairItemId 工单子表id
|
||||||
|
* @param image 上传附件相对路径(多个用“,”分隔)
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:09 2024/10/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void saveItem(String recordId, String ticketId, String repairItemId, String image) {
|
||||||
|
//根据记录id删除改记录中原有的图片
|
||||||
|
removeByMainId(REPAIR_RECORD_TYPE_RECORD, recordId);
|
||||||
|
//组装维修记录图片集合
|
||||||
|
List<RepairRecordsItem> saveList = new ArrayList<>();
|
||||||
|
if (StringUtils.isNotEmpty(image)) {
|
||||||
|
//字符串转换集合
|
||||||
|
List<String> imageList = Arrays.stream(image.split(","))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
imageList.forEach(item -> {
|
||||||
|
RepairRecordsItem saveItem = new RepairRecordsItem();
|
||||||
|
saveItem.setRecordId(recordId);
|
||||||
|
saveItem.setTicketId(ticketId);
|
||||||
|
saveItem.setRepairItemId(repairItemId);
|
||||||
|
saveItem.setImage(item);
|
||||||
|
saveList.add(saveItem);
|
||||||
|
});
|
||||||
|
saveBatch(saveList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置图片是否开放给用户
|
||||||
|
*
|
||||||
|
* @param ids 前端选中图片id(多个用“,”分隔)
|
||||||
|
* @param isOpen 0否1是
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:22 2024/10/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public void setRepairOpen(String ids, String isOpen) {
|
||||||
|
if (StringUtils.isNotEmpty(ids)) {
|
||||||
|
//id字符串转换集合
|
||||||
|
List<String> idList = Arrays.stream(ids.split(","))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
LambdaUpdateWrapper<RepairRecordsItem> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
//设置更新条件
|
||||||
|
lambdaUpdateWrapper.in(RepairRecordsItem::getId, idList).set(RepairRecordsItem::getIsOpen, isOpen);
|
||||||
|
//更新
|
||||||
|
update(lambdaUpdateWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 封装查询条件
|
||||||
|
*
|
||||||
|
* @param mainType ticket:工单;repairItem:工单附属项目;record:维修记录
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @return com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper<cn.iocoder.yudao.module.base.entity.RepairRecordsItem>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:36 2024/10/11
|
||||||
|
**/
|
||||||
|
private LambdaQueryWrapper<RepairRecordsItem> queryType(String mainType, String mainId) {
|
||||||
|
LambdaQueryWrapper<RepairRecordsItem> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
switch (mainType) {
|
||||||
|
//匹配根据工单表id删除条件
|
||||||
|
case REPAIR_RECORD_TYPE_TICKET:
|
||||||
|
lambdaQueryWrapper.eq(RepairRecordsItem::getTicketId, mainId);
|
||||||
|
break;
|
||||||
|
//匹配根据工单子表id删除条件
|
||||||
|
case REPAIR_RECORD_TYPE_REPAIR_ITEM:
|
||||||
|
lambdaQueryWrapper.eq(RepairRecordsItem::getRepairItemId, mainId);
|
||||||
|
break;
|
||||||
|
//匹配根据根据记录表id删除条件
|
||||||
|
case REPAIR_RECORD_TYPE_RECORD:
|
||||||
|
lambdaQueryWrapper.eq(RepairRecordsItem::getRecordId, mainId);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return lambdaQueryWrapper;
|
||||||
|
}
|
||||||
|
}
|
@ -1,21 +1,24 @@
|
|||||||
package cn.iocoder.yudao.module.base.service.impl;
|
package cn.iocoder.yudao.module.base.service.impl;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
import cn.iocoder.yudao.module.base.mapper.RepairRecordsMapper;
|
import cn.iocoder.yudao.module.base.mapper.RepairRecordsMapper;
|
||||||
|
import cn.iocoder.yudao.module.base.service.RepairRecordsItemService;
|
||||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairRecordsPageReqVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
import cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairRecordsSaveReqVO;
|
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.common.BaseConstants.REPAIR_RECORD_TYPE_RECORD;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修记录 Service 实现类
|
* 维修记录 Service 实现类
|
||||||
@ -28,46 +31,61 @@ public class RepairRecordsServiceImpl extends ServiceImpl<RepairRecordsMapper, R
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private RepairRecordsMapper repairRecordsMapper;
|
private RepairRecordsMapper repairRecordsMapper;
|
||||||
|
@Resource
|
||||||
@Override
|
private AdminUserApi userApi;
|
||||||
public String createRepairRecords(RepairRecordsSaveReqVO createReqVO) {
|
@Resource
|
||||||
// 插入
|
private RepairRecordsItemService itemService;
|
||||||
RepairRecords records = BeanUtils.toBean(createReqVO, RepairRecords.class);
|
|
||||||
repairRecordsMapper.insert(records);
|
|
||||||
// 返回
|
|
||||||
return records.getId();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateRepairRecords(RepairRecordsSaveReqVO updateReqVO) {
|
|
||||||
// 更新
|
|
||||||
RepairRecords updateObj = BeanUtils.toBean(updateReqVO, RepairRecords.class);
|
|
||||||
repairRecordsMapper.updateById(updateObj);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteRepairRecords(String id) {
|
|
||||||
// 删除
|
|
||||||
repairRecordsMapper.deleteById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public RepairRecords getRepairRecords(String id) {
|
|
||||||
// return repairRecordsMapper.selectById(id);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询维修记录
|
* 保存维修记录
|
||||||
* @apiNote lzt
|
*
|
||||||
* @param pageReqVO 查询条件
|
* @param ticketId 工单id
|
||||||
* @return queryAllRepairRecords 所有维修记录
|
* @param repairItemId 工单子表id
|
||||||
* @date 2024年10月9日
|
* @param type 工作类型(数据字典:repair_records_type;后端已初始化常量,可直接引用base包中BaseConstants下106-119行)
|
||||||
*/
|
* @param remark 备注
|
||||||
|
* @param images 图片(相对路径按照“,”分隔)
|
||||||
|
* @author PQZ
|
||||||
|
* @date 14:51 2024/10/11
|
||||||
|
**/
|
||||||
@Override
|
@Override
|
||||||
public List<RepairRecordsRespVO> queryAllRepairRecords(RepairRecordsPageReqVO pageReqVO) {
|
public void saveRepairRecord(String ticketId, String repairItemId, String type, String remark, String images) {
|
||||||
return repairRecordsMapper.queryAllRepairRecords(pageReqVO);
|
//获取当前登录用户
|
||||||
|
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||||
|
AdminUserRespDTO loginUser = userApi.getUser(userId);
|
||||||
|
//初始化维修记录
|
||||||
|
RepairRecords repairRecords = new RepairRecords();
|
||||||
|
repairRecords.setTicketId(ticketId);
|
||||||
|
repairRecords.setRepairItemId(repairItemId);
|
||||||
|
repairRecords.setType(type);
|
||||||
|
repairRecords.setRemark(remark);
|
||||||
|
repairRecords.setDealUserId(loginUser.getId());
|
||||||
|
repairRecords.setDealUserName(loginUser.getNickname());
|
||||||
|
//保存维修记录
|
||||||
|
save(repairRecords);
|
||||||
|
//保存附件信息
|
||||||
|
itemService.saveItem(repairRecords.getId(), ticketId, repairItemId, images);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据条件查询维修记录
|
||||||
|
*
|
||||||
|
* @param pageReqVO RepairRecordsPageReqVO实体
|
||||||
|
* @return java.util.List<cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO>
|
||||||
|
* @author PQZ
|
||||||
|
* @date 15:14 2024/10/11
|
||||||
|
**/
|
||||||
|
@Override
|
||||||
|
public List<RepairRecordsRespVO> queryList(RepairRecordsPageReqVO pageReqVO) {
|
||||||
|
//根据条件查询维修记录
|
||||||
|
List<RepairRecordsRespVO> list = repairRecordsMapper.queryRepairRecords(pageReqVO);
|
||||||
|
//为每一条维修记录设置查询附件
|
||||||
|
list.forEach(item -> {
|
||||||
|
List<RepairRecordsItem> itemList = itemService.getByMainId(REPAIR_RECORD_TYPE_RECORD, item.getId(), pageReqVO.getIsOpen());
|
||||||
|
item.setItemList(itemList);
|
||||||
|
//相对路径按照“,”分隔
|
||||||
|
item.setImages(itemList.stream().map(RepairRecordsItem::getImage).collect(Collectors.joining(",")));
|
||||||
|
});
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,5 +11,7 @@ import lombok.ToString;
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class RepairRecordsPageReqVO extends RepairRecords {
|
public class RepairRecordsPageReqVO extends RepairRecords {
|
||||||
|
/**是否开放给用户*/
|
||||||
|
private String isOpen;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
package cn.iocoder.yudao.module.base.vo;
|
package cn.iocoder.yudao.module.base.vo;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
import cn.iocoder.yudao.module.base.entity.RepairRecords;
|
||||||
|
import cn.iocoder.yudao.module.base.entity.RepairRecordsItem;
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 维修记录 Response VO")
|
@Schema(description = "管理后台 - 维修记录 Response VO")
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class RepairRecordsRespVO extends RepairRecords {
|
public class RepairRecordsRespVO extends RepairRecords {
|
||||||
|
/**维修记录关联子表*/
|
||||||
|
private List<RepairRecordsItem> itemList;
|
||||||
|
/**维修记录关联附件信息*/
|
||||||
|
private String images;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,4 +9,5 @@ import lombok.Data;
|
|||||||
public class RepairRecordsSaveReqVO extends RepairRecords {
|
public class RepairRecordsSaveReqVO extends RepairRecords {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="cn.iocoder.yudao.module.base.mapper.RepairRecordsItemMapper">
|
||||||
|
|
||||||
|
<!--
|
||||||
|
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||||
|
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||||
|
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||||
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
|
-->
|
||||||
|
|
||||||
|
</mapper>
|
@ -9,15 +9,25 @@
|
|||||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<select id="queryAllRepairRecords" resultType="cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO">
|
<select id="queryRepairRecords" resultType="cn.iocoder.yudao.module.base.vo.RepairRecordsRespVO">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM dl_repair_records
|
FROM dl_repair_records
|
||||||
<where>
|
<where>
|
||||||
<if test="entity.someField != null">
|
deleted = '0'
|
||||||
AND some_column = #{entity.someField}
|
<if test="entity.ticketId != null and entity.ticketId != ''">
|
||||||
|
AND ticket_id = #{entity.ticketId}
|
||||||
|
</if>
|
||||||
|
<if test="entity.repairItemId != null and entity.repairItemId != ''">
|
||||||
|
AND repair_item_id = #{entity.repairItemId}
|
||||||
|
</if>
|
||||||
|
<if test="entity.dealUserId != null and entity.dealUserId != ''">
|
||||||
|
AND deal_user_id = #{entity.dealUserId}
|
||||||
|
</if>
|
||||||
|
<if test="entity.type != null and entity.type != ''">
|
||||||
|
AND type = #{entity.type}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
<druid.version>1.2.23</druid.version>
|
<druid.version>1.2.23</druid.version>
|
||||||
<mybatis.version>3.5.16</mybatis.version>
|
<mybatis.version>3.5.16</mybatis.version>
|
||||||
<mybatis-plus.version>3.5.7</mybatis-plus.version>
|
<mybatis-plus.version>3.5.7</mybatis-plus.version>
|
||||||
<pagehelper.boot.version>2.1.0</pagehelper.boot.version>
|
<pagehelper.boot.version>1.4.6</pagehelper.boot.version>
|
||||||
<jsqlparser.version>4.9</jsqlparser.version>
|
<jsqlparser.version>4.9</jsqlparser.version>
|
||||||
<mybatis-plus-generator.version>3.5.7</mybatis-plus-generator.version>
|
<mybatis-plus-generator.version>3.5.7</mybatis-plus-generator.version>
|
||||||
<dynamic-datasource.version>4.3.1</dynamic-datasource.version>
|
<dynamic-datasource.version>4.3.1</dynamic-datasource.version>
|
||||||
|
@ -375,7 +375,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
|||||||
List<RoleDO> jcyh = roleService.getRoleListByCodes(Collections.singletonList("jcyh"));
|
List<RoleDO> jcyh = roleService.getRoleListByCodes(Collections.singletonList("jcyh"));
|
||||||
Set<Long> ids = new HashSet<>();
|
Set<Long> ids = new HashSet<>();
|
||||||
ids.add(jcyh.get(0).getId());
|
ids.add(jcyh.get(0).getId());
|
||||||
permissionService.assignUserRole(user.getId(),ids);
|
permissionService.assignUserRole(uid,ids);
|
||||||
}else {
|
}else {
|
||||||
//更新
|
//更新
|
||||||
user.setId(wxUser.getId());
|
user.setId(wxUser.getId());
|
||||||
@ -408,7 +408,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
|||||||
@Override
|
@Override
|
||||||
public AuthLoginRespVO wxLoginByUserId(Long userId, String userName) {
|
public AuthLoginRespVO wxLoginByUserId(Long userId, String userName) {
|
||||||
// 生成token
|
// 生成token
|
||||||
return createTokenAfterLoginSuccess(userId, userName, LoginLogTypeEnum.LOGIN_USERNAME);
|
return createTokenAfterLoginSuccess(userId, userName, LoginLogTypeEnum.LOGIN_SOCIAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,6 +36,12 @@
|
|||||||
<groupId>cn.iocoder.boot</groupId>
|
<groupId>cn.iocoder.boot</groupId>
|
||||||
<artifactId>dl-module-base</artifactId>
|
<artifactId>dl-module-base</artifactId>
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-fileupload</artifactId>
|
||||||
|
<groupId>commons-fileupload</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- 企业管理包 -->
|
<!-- 企业管理包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user