更新
This commit is contained in:
parent
5caea1c148
commit
a5015bddbb
@ -276,7 +276,7 @@ public class InspectionInfoController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("isExamine")
|
@GetMapping("isExamine")
|
||||||
public CommonResult isExamine() {
|
public CommonResult isExamine() {
|
||||||
return success(inspectionInfoService.isExamine());
|
return success(inspectionInfoService.isExamine("jcsfdl"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -389,6 +389,7 @@ public class InspectionInfoController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改异常工单
|
* 修改异常工单
|
||||||
|
*
|
||||||
* @param inspectionWorkNode
|
* @param inspectionWorkNode
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -397,4 +398,15 @@ public class InspectionInfoController extends BaseController {
|
|||||||
inspectionWorkNodeService.updateException(inspectionWorkNode.getInspectionInfoId(), inspectionWorkNode.getIdList());
|
inspectionWorkNodeService.updateException(inspectionWorkNode.getInspectionInfoId(), inspectionWorkNode.getIdList());
|
||||||
return success("操作成功");
|
return success("操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工 引车接单
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/leadCar")
|
||||||
|
public CommonResult<?> leadCar(@RequestBody InspectionInfo inspectionInfo) {
|
||||||
|
inspectionInfoService.leadCar(inspectionInfo);
|
||||||
|
return success("操作成功");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -179,6 +179,19 @@ public class InspectionStaffController extends BaseController {
|
|||||||
return success(inspectionStaffService.addFolder(userId));
|
return success(inspectionStaffService.addFolder(userId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取已完成项目
|
||||||
|
* @param userId 用户id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getFinishProjectByUserId")
|
||||||
|
public CommonResult<?> getFinishProjectByUserId(@RequestParam("userId") Long userId,
|
||||||
|
@RequestParam(value = "pageNo", required = false, defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||||
|
Page<Map<String, Object>> page = new Page<>(pageNo, pageSize);
|
||||||
|
return success(inspectionStaffService.getFinishProjectByUserId(page, userId));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验信息
|
* 校验信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -65,8 +65,10 @@ public class InspectionInfo extends TenantBaseDO
|
|||||||
//是否重审
|
//是否重审
|
||||||
private String isRetrial;
|
private String isRetrial;
|
||||||
private String remark;
|
private String remark;
|
||||||
/** 检测次数 */
|
/** 复检次数 */
|
||||||
private Integer infoCount;
|
private Integer recheckCount;
|
||||||
|
/** 重检次数 */
|
||||||
|
private Integer reinspectCount;
|
||||||
|
|
||||||
/** 0进行中1已结束 */
|
/** 0进行中1已结束 */
|
||||||
@Excel(name = "0进行中1已结束")
|
@Excel(name = "0进行中1已结束")
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionWorkNode;
|
|||||||
import cn.iocoder.yudao.module.inspection.vo.StaffProjectCountVO;
|
import cn.iocoder.yudao.module.inspection.vo.StaffProjectCountVO;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@ -48,4 +49,6 @@ public interface InspectionWorkNodeMapper extends BaseMapper<InspectionWorkNode>
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<Map<String, Object>> selectExceptionNodesByInspectionIds(@Param("ids") List<Long> idList);
|
List<Map<String, Object>> selectExceptionNodesByInspectionIds(@Param("ids") List<Long> idList);
|
||||||
|
|
||||||
|
IPage<Map<String, Object>> selectStaffProjectByUserId(@Param("page")Page<Map<String, Object>> page, @Param("userId") Long userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,4 +34,7 @@ public class OrderTableQuery {
|
|||||||
|
|
||||||
/** 车龄 */
|
/** 车龄 */
|
||||||
private Integer carYear;
|
private Integer carYear;
|
||||||
|
|
||||||
|
/** 检测类型*/
|
||||||
|
private String skuName;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,7 +111,7 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
|||||||
* 判断app当前检测人是否有审核权限
|
* 判断app当前检测人是否有审核权限
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean isExamine();
|
Boolean isExamine(String code);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取某个工单针对当前操作用户,某个状态的项目们
|
* 获取某个工单针对当前操作用户,某个状态的项目们
|
||||||
@ -153,4 +153,10 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
|||||||
* @param inspectionWorkNode
|
* @param inspectionWorkNode
|
||||||
*/
|
*/
|
||||||
Boolean meetCarPhoto(InspectionWorkNode inspectionWorkNode);
|
Boolean meetCarPhoto(InspectionWorkNode inspectionWorkNode);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 引车
|
||||||
|
* @param inspectionInfo
|
||||||
|
*/
|
||||||
|
void leadCar(InspectionInfo inspectionInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,5 +75,12 @@ public interface InspectionStaffService extends IService<InspectionStaff> {
|
|||||||
* @return 文件夹id
|
* @return 文件夹id
|
||||||
*/
|
*/
|
||||||
Long addFolder(Long userId);
|
Long addFolder(Long userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取已完成项目
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<Map<String, Object>> getFinishProjectByUserId(Page<Map<String, Object>> page, Long userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,7 @@ 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.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
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 com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
@ -1576,7 +1577,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
res.setGoodsPrice(order.getGoodsPrice());
|
res.setGoodsPrice(order.getGoodsPrice());
|
||||||
res.setGoodsName(sku.getSkuName());
|
res.setGoodsName(sku.getSkuName());
|
||||||
res.setIsOnline(order.getIsOnline());
|
res.setIsOnline(order.getIsOnline());
|
||||||
res.setInfoCount(info.getInfoCount());
|
res.setRecheckCount(info.getRecheckCount());
|
||||||
|
res.setReinspectCount(info.getReinspectCount());
|
||||||
res.setIsRetrial(info.getIsRetrial());
|
res.setIsRetrial(info.getIsRetrial());
|
||||||
res.setIsPass(info.getIsPass());
|
res.setIsPass(info.getIsPass());
|
||||||
res.setRemark(info.getRemark());
|
res.setRemark(info.getRemark());
|
||||||
@ -1924,6 +1926,10 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
startTime = startTime + " 00:00:00";
|
startTime = startTime + " 00:00:00";
|
||||||
endTime = endTime + " 23:59:59";
|
endTime = endTime + " 23:59:59";
|
||||||
Map<String, Integer> map = baseMapper.staticsTable2(partnerId, startTime, endTime);
|
Map<String, Integer> map = baseMapper.staticsTable2(partnerId, startTime, endTime);
|
||||||
|
|
||||||
|
// 查询未完成 所有时间
|
||||||
|
Map<String, Integer> stringIntegerMap = baseMapper.staticsTable2(partnerId, null, null);
|
||||||
|
map.put("allJxzNum", stringIntegerMap.get("jxzNum"));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2215,6 +2221,25 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject) {
|
public List<Map<String, Object>> getStaffCount(DlInspectionProject dlInspectionProject) {
|
||||||
return inspectionWorkNodeService.getStaffCount(dlInspectionProject);
|
List<Map<String, Object>> staffCount = inspectionWorkNodeService.getStaffCount(dlInspectionProject);
|
||||||
|
// 根据userId查询检测工单表 接车人
|
||||||
|
List<InspectionInfo> list = inspectionInfoService.list(Wrappers.<InspectionInfo>lambdaQuery()
|
||||||
|
.eq(InspectionInfo::getIsMeetCar, 1));
|
||||||
|
// 统计每个 meetManId 的数量,避免 null key 异常
|
||||||
|
Map<Long, Long> meetManIdCountMap = list.stream()
|
||||||
|
.filter(info -> info.getMeetManId() != null) // 过滤 null 值
|
||||||
|
.collect(Collectors.groupingBy(InspectionInfo::getMeetManId, Collectors.counting()));
|
||||||
|
|
||||||
|
|
||||||
|
for (Map<String, Object> stringObjectMap : staffCount) {
|
||||||
|
Long userId = (Long) stringObjectMap.get("userId");
|
||||||
|
List<Map<String, Object>> children = (List<Map<String, Object>>) stringObjectMap.get("children");
|
||||||
|
stringObjectMap.put("meetCarCount", meetManIdCountMap.get(userId));
|
||||||
|
HashMap<String, Object> objectObjectHashMap = new HashMap<>();
|
||||||
|
objectObjectHashMap.put("count", meetManIdCountMap.get(userId) == null ? 0 : meetManIdCountMap.get(userId));
|
||||||
|
objectObjectHashMap.put("projectName", "接车");
|
||||||
|
children.add(objectObjectHashMap);
|
||||||
|
}
|
||||||
|
return staffCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -656,7 +656,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean isExamine() {
|
public Boolean isExamine(String code) {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
//获取当前登陆人的所有角色
|
//获取当前登陆人的所有角色
|
||||||
List<UserRoleDO> userRoles = roleService.getByUserId(loginUser.getId());
|
List<UserRoleDO> userRoles = roleService.getByUserId(loginUser.getId());
|
||||||
@ -666,7 +666,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
//判断当前角色集合中的code是否包含jcyszz
|
//判断当前角色集合中的code是否包含jcyszz
|
||||||
if (CollectionUtil.isNotEmpty(roleList)) {
|
if (CollectionUtil.isNotEmpty(roleList)) {
|
||||||
List<RoleDO> filteredRoleList = roleList.stream()
|
List<RoleDO> filteredRoleList = roleList.stream()
|
||||||
.filter(role -> role.getCode().contains("jcsfdl"))
|
.filter(role -> role.getCode().contains(code))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtil.isNotEmpty(filteredRoleList)) {
|
if (CollectionUtil.isNotEmpty(filteredRoleList)) {
|
||||||
return true;
|
return true;
|
||||||
@ -829,9 +829,9 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
Map<String, Long> result = new ConcurrentHashMap<>(); // 线程安全
|
Map<String, Long> result = new ConcurrentHashMap<>(); // 线程安全
|
||||||
|
|
||||||
// 这里 `5` 而不是 `6`,因为 i 从 `0` 开始
|
// 这里 `5` 而不是 `6`,因为 i 从 `0` 开始
|
||||||
CompletableFuture<Void>[] futures = new CompletableFuture[8];
|
CompletableFuture<Void>[] futures = new CompletableFuture[9];
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) { // 改为 `0~4`
|
for (int i = 0; i < 9; i++) { // 改为 `0~4`
|
||||||
final String status = String.valueOf(i + 1);
|
final String status = String.valueOf(i + 1);
|
||||||
|
|
||||||
// 深拷贝对象,防止多线程修改冲突
|
// 深拷贝对象,防止多线程修改冲突
|
||||||
@ -906,4 +906,18 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 引车
|
||||||
|
*
|
||||||
|
* @param inspectionInfo
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void leadCar(InspectionInfo inspectionInfo) {
|
||||||
|
// 获取当前登陆人
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
inspectionInfo.setLeadManId(loginUser.getId());
|
||||||
|
|
||||||
|
baseMapper.updateById(inspectionInfo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
|||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionPickCar;
|
||||||
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
import cn.iocoder.yudao.module.inspection.entity.InspectionStaff;
|
||||||
import cn.iocoder.yudao.module.inspection.mapper.InspectionStaffMapper;
|
import cn.iocoder.yudao.module.inspection.mapper.InspectionStaffMapper;
|
||||||
|
import cn.iocoder.yudao.module.inspection.mapper.InspectionWorkNodeMapper;
|
||||||
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
import cn.iocoder.yudao.module.inspection.query.InspectionStaffQuery;
|
||||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||||
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
import cn.iocoder.yudao.module.inspection.service.InspectionStaffService;
|
||||||
@ -64,6 +65,9 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IInspectionFileService inspectionFileService;
|
private IInspectionFileService inspectionFileService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InspectionWorkNodeMapper inspectionWorkNodeMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取检测员工分页
|
* 获取检测员工分页
|
||||||
*
|
*
|
||||||
@ -248,6 +252,17 @@ public class InspectionStaffServiceImpl extends ServiceImpl<InspectionStaffMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取已完成项目
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public IPage<Map<String, Object>> getFinishProjectByUserId(Page<Map<String, Object>> page, Long userId) {
|
||||||
|
return inspectionWorkNodeMapper.selectStaffProjectByUserId(page,userId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存检测员工
|
* 保存检测员工
|
||||||
*
|
*
|
||||||
|
|||||||
@ -373,10 +373,10 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
info.setIsRetrial("1");
|
info.setIsRetrial("1");
|
||||||
info.setIsPass("0");
|
info.setIsPass("0");
|
||||||
// 设置检测次数加一
|
// 设置检测次数加一
|
||||||
if (ObjectUtil.isNotEmpty(info.getInfoCount())) {
|
if (ObjectUtil.isNotEmpty(info.getReinspectCount())) {
|
||||||
info.setInfoCount(info.getInfoCount() + 1);
|
info.setReinspectCount(info.getReinspectCount() + 1);
|
||||||
} else {
|
} else {
|
||||||
info.setInfoCount(2);
|
info.setReinspectCount(1);
|
||||||
}
|
}
|
||||||
//更新工单表
|
//更新工单表
|
||||||
inspectionInfoService.updateById(info);
|
inspectionInfoService.updateById(info);
|
||||||
@ -574,7 +574,7 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 重检
|
* 复检
|
||||||
*
|
*
|
||||||
* @param inspectionWorkNode
|
* @param inspectionWorkNode
|
||||||
*/
|
*/
|
||||||
@ -595,7 +595,14 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
|||||||
.set("type", null)
|
.set("type", null)
|
||||||
.in("id", workNodeIds));
|
.in("id", workNodeIds));
|
||||||
|
|
||||||
//跟新工单表
|
// 复检次数加一
|
||||||
|
if (ObjectUtil.isNotNull(info.getRecheckCount())) {
|
||||||
|
info.setRecheckCount(info.getRecheckCount() + 1);
|
||||||
|
} else {
|
||||||
|
info.setRecheckCount(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新工单表
|
||||||
inspectionInfoService.updateById(info);
|
inspectionInfoService.updateById(info);
|
||||||
|
|
||||||
//获取重审的节点的roleID
|
//获取重审的节点的roleID
|
||||||
|
|||||||
@ -34,7 +34,10 @@ public class InspectionInfoVo {
|
|||||||
private String remark;
|
private String remark;
|
||||||
private String buyUserName;
|
private String buyUserName;
|
||||||
private String buyUserPhone;
|
private String buyUserPhone;
|
||||||
private Integer infoCount;
|
/** 复检次数 */
|
||||||
|
private Integer recheckCount;
|
||||||
|
/** 重检次数 */
|
||||||
|
private Integer reinspectCount;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String buyName;
|
private String buyName;
|
||||||
|
|||||||
@ -283,4 +283,39 @@
|
|||||||
)
|
)
|
||||||
ORDER BY w.order_num
|
ORDER BY w.order_num
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectStaffProjectByUserId" resultType="java.util.Map">
|
||||||
|
SELECT
|
||||||
|
ii.id AS inspectionInfoId,
|
||||||
|
ii.user_id AS userId,
|
||||||
|
ii.user_name AS userName,
|
||||||
|
ii.buy_name AS buyName,
|
||||||
|
ii.buy_phone AS buyPhone,
|
||||||
|
ii.car_num AS carNum,
|
||||||
|
ii.car_model AS carModel,
|
||||||
|
ii.car_status AS carStatus,
|
||||||
|
ii.start_time AS startTime,
|
||||||
|
ii.end_time AS endTime,
|
||||||
|
ii.unit_name AS unitName,
|
||||||
|
ii.partner_id,
|
||||||
|
ii.work_id AS workId,
|
||||||
|
ii.worker_name AS workerName,
|
||||||
|
ii.worker_phone AS workerPhone,
|
||||||
|
ii.worker_avatar AS workerAvatar,
|
||||||
|
CASE
|
||||||
|
WHEN ii.is_pass = '0' THEN '不通过'
|
||||||
|
WHEN ii.is_pass = '1' THEN '通过'
|
||||||
|
WHEN ii.is_pass IS NULL THEN '进行中'
|
||||||
|
ELSE '未知'
|
||||||
|
END AS status,
|
||||||
|
GROUP_CONCAT(ip.project_name ORDER BY iwn.order_num SEPARATOR ',') AS projectName
|
||||||
|
FROM inspection_work_node iwn
|
||||||
|
LEFT JOIN inspection_info ii ON iwn.inspection_info_id = ii.id
|
||||||
|
LEFT JOIN inspection_project ip ON ip.id = iwn.project_id
|
||||||
|
WHERE
|
||||||
|
iwn.deal_user_id = #{userId}
|
||||||
|
AND iwn.status = '2'
|
||||||
|
AND iwn.deleted = b'0'
|
||||||
|
GROUP BY ii.id
|
||||||
|
ORDER BY ii.start_time DESC;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@ -479,12 +479,19 @@ FROM
|
|||||||
IFNULL(SUM(oi.sku_name LIKE '%年审%'),0) nsNum,
|
IFNULL(SUM(oi.sku_name LIKE '%年审%'),0) nsNum,
|
||||||
IFNULL(SUM(oi.sku_name LIKE '%上户%'),0) shNum,
|
IFNULL(SUM(oi.sku_name LIKE '%上户%'),0) shNum,
|
||||||
IFNULL(SUM(oi.sku_name LIKE '%非定检%'),0) fdjNum,
|
IFNULL(SUM(oi.sku_name LIKE '%非定检%'),0) fdjNum,
|
||||||
IFNULL(SUM(oi.sku_name LIKE '%双燃料%'),0) srlNum
|
IFNULL(SUM(oi.sku_name LIKE '%双燃料%'),0) srlNum,
|
||||||
|
IFNULL(SUM(ii.recheck_count),0) recheckNum,
|
||||||
|
IFNULL(SUM(ii.reinspect_count),0) reinspectNum
|
||||||
FROM
|
FROM
|
||||||
inspection_info ii
|
inspection_info ii
|
||||||
LEFT JOIN order_info oi on oi.id = ii.inspection_order_id
|
LEFT JOIN order_info oi on oi.id = ii.inspection_order_id
|
||||||
WHERE ii.partner_id =#{partnerId} and ii.deleted = 0 and oi.deleted = 0
|
<where>
|
||||||
|
ii.partner_id =#{partnerId} and ii.deleted = 0 and oi.deleted = 0
|
||||||
|
<if test="startTime != null and endTime != null">
|
||||||
and ii.create_time BETWEEN #{startTime} and #{endTime}
|
and ii.create_time BETWEEN #{startTime} and #{endTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="newStaticsTable2" resultType="java.util.Map">
|
<select id="newStaticsTable2" resultType="java.util.Map">
|
||||||
SELECT
|
SELECT
|
||||||
@ -668,6 +675,9 @@ FROM
|
|||||||
<if test="query.payType!=null and query.payType!=''">
|
<if test="query.payType!=null and query.payType!=''">
|
||||||
AND oi.pay_type = #{query.payType}
|
AND oi.pay_type = #{query.payType}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="query.skuName!=null and query.skuName!=''">
|
||||||
|
AND oi.sku_name LIKE concat('%',#{query.skuName},'%')
|
||||||
|
</if>
|
||||||
<if test="query.customerSource!=null and query.customerSource!=''">
|
<if test="query.customerSource!=null and query.customerSource!=''">
|
||||||
AND ii.customer_source = #{query.customerSource}
|
AND ii.customer_source = #{query.customerSource}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -369,6 +369,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND ii.status != '1'
|
AND ii.status != '1'
|
||||||
ORDER BY iwn.update_time DESC
|
ORDER BY iwn.update_time DESC
|
||||||
</if>
|
</if>
|
||||||
|
<!-- 新增:lead_man_id 为空 -->
|
||||||
|
<if test="inspectionInfo.status == 9">
|
||||||
|
AND ii.lead_man_id IS NULL
|
||||||
|
AND ii.status = '0'
|
||||||
|
ORDER BY ii.update_time DESC
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
) AS subquery
|
) AS subquery
|
||||||
WHERE rn = 1;
|
WHERE rn = 1;
|
||||||
@ -555,6 +561,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
AND iwn.type = '0'
|
AND iwn.type = '0'
|
||||||
AND ii.status != '1'
|
AND ii.status != '1'
|
||||||
</if>
|
</if>
|
||||||
|
<!-- 新增:lead_man_id 为空 -->
|
||||||
|
<if test="inspectionInfo.status == 9">
|
||||||
|
AND ii.lead_man_id IS NULL
|
||||||
|
AND ii.status = '0'
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</if>
|
</if>
|
||||||
<if test="inspectionInfo.status == 6">
|
<if test="inspectionInfo.status == 6">
|
||||||
|
|||||||
@ -180,7 +180,7 @@ public class UserController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过角色id查询用户列表
|
* 通过角色id查询用户列表
|
||||||
* @param roleId
|
* @param roleId 角色id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/selectByRoleId")
|
@GetMapping("/selectByRoleId")
|
||||||
@ -188,4 +188,14 @@ public class UserController {
|
|||||||
return success(userService.selectByRoleId(roleId));
|
return success(userService.selectByRoleId(roleId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前登录用户是否拥有某个角色
|
||||||
|
* @param roleCode 角色code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/ifLoginUserHasRoleByCode")
|
||||||
|
public CommonResult<?> ifLoginUserHasRoleByCode(String roleCode){
|
||||||
|
return success(userService.ifLoginUserHasRoleByCode(roleCode));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,9 +48,10 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序端修改用户个人信息
|
* 微信小程序端修改用户个人信息
|
||||||
|
*
|
||||||
|
* @param userInfoVO 用户对象
|
||||||
* @author vinjor-M
|
* @author vinjor-M
|
||||||
* @date 20:11 2024/10/11
|
* @date 20:11 2024/10/11
|
||||||
* @param userInfoVO 用户对象
|
|
||||||
**/
|
**/
|
||||||
void updateCusInfo(UserInfoVO userInfoVO);
|
void updateCusInfo(UserInfoVO userInfoVO);
|
||||||
|
|
||||||
@ -96,10 +97,11 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户所属部门
|
* 修改用户所属部门
|
||||||
* @author vinjor-M
|
*
|
||||||
* @date 16:34 2024/8/2
|
|
||||||
* @param id 用户id
|
* @param id 用户id
|
||||||
* @param deptId H部门id
|
* @param deptId H部门id
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 16:34 2024/8/2
|
||||||
**/
|
**/
|
||||||
void updateUserDept(Long id, Long deptId);
|
void updateUserDept(Long id, Long deptId);
|
||||||
|
|
||||||
@ -125,6 +127,7 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
AdminUserDO getUserByUsername(String username);
|
AdminUserDO getUserByUsername(String username);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户
|
* 通过用户名查询用户
|
||||||
*
|
*
|
||||||
@ -132,6 +135,7 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
AdminUserDO getUserByUsername(String username, Long tenantId);
|
AdminUserDO getUserByUsername(String username, Long tenantId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户---不带租户ID
|
* 通过用户名查询用户---不带租户ID
|
||||||
*
|
*
|
||||||
@ -147,6 +151,7 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
* @return 用户对象信息
|
* @return 用户对象信息
|
||||||
*/
|
*/
|
||||||
AdminUserDO getUserByMobile(String mobile);
|
AdminUserDO getUserByMobile(String mobile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过手机号获取用户(不带租户id)
|
* 通过手机号获取用户(不带租户id)
|
||||||
*
|
*
|
||||||
@ -250,9 +255,11 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
* @return 是否匹配
|
* @return 是否匹配
|
||||||
*/
|
*/
|
||||||
boolean isPasswordMatch(String rawPassword, String encodedPassword);
|
boolean isPasswordMatch(String rawPassword, String encodedPassword);
|
||||||
|
|
||||||
List<AdminUserDO> getUsersByRoleRescue(String roleCode, String searchValue, List<String> deptIds);
|
List<AdminUserDO> getUsersByRoleRescue(String roleCode, String searchValue, List<String> deptIds);
|
||||||
|
|
||||||
IPage<AdminUserDO> getUsersByRoleRescueTow(Page<AdminUserDO> page, String roleCode, String searchValue, List<String> deptIds);
|
IPage<AdminUserDO> getUsersByRoleRescueTow(Page<AdminUserDO> page, String roleCode, String searchValue, List<String> deptIds);
|
||||||
|
|
||||||
Integer getStudentNumberByUserId(Long jlId);
|
Integer getStudentNumberByUserId(Long jlId);
|
||||||
|
|
||||||
List<String> getStudentNumber(Long id);
|
List<String> getStudentNumber(Long id);
|
||||||
@ -263,12 +270,14 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据openid和租户id查询用户
|
* 根据openid和租户id查询用户
|
||||||
* @author vinjor-M
|
*
|
||||||
* @date 11:29 2024/9/24
|
|
||||||
* @param openId 微信id
|
* @param openId 微信id
|
||||||
* @param tenantId 租户id,可能为null
|
* @param tenantId 租户id,可能为null
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 11:29 2024/9/24
|
||||||
**/
|
**/
|
||||||
AdminUserDO selectUserByOpenId(String openId, String tenantId);
|
AdminUserDO selectUserByOpenId(String openId, String tenantId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置用户openId
|
* 设置用户openId
|
||||||
*
|
*
|
||||||
@ -281,15 +290,17 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据手机号查询所有用户--员工
|
* 根据手机号查询所有用户--员工
|
||||||
* @author vinjor-M
|
*
|
||||||
* @date 14:43 2024/10/16
|
|
||||||
* @param phone 手机号
|
* @param phone 手机号
|
||||||
* @return java.util.List<cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO>
|
* @return java.util.List<cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO>
|
||||||
|
* @author vinjor-M
|
||||||
|
* @date 14:43 2024/10/16
|
||||||
**/
|
**/
|
||||||
List<AdminUserDO> selectListByPhoneStaff(String phone);
|
List<AdminUserDO> selectListByPhoneStaff(String phone);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色id查询用户
|
* 根据角色id查询用户
|
||||||
|
*
|
||||||
* @param roleId
|
* @param roleId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -297,8 +308,17 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询用户信息(排除掉租户)
|
* 查询用户信息(排除掉租户)
|
||||||
|
*
|
||||||
* @param reqVO
|
* @param reqVO
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Map<String, Object> queryUserIgnoreTenant(AuthLoginReqVO reqVO);
|
Map<String, Object> queryUserIgnoreTenant(AuthLoginReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前登录用户是否拥有某个角色
|
||||||
|
*
|
||||||
|
* @param roleCode 角色编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Boolean ifLoginUserHasRoleByCode(String roleCode);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,12 +26,15 @@ import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqV
|
|||||||
import cn.iocoder.yudao.module.system.controller.app.user.UserInfoVO;
|
import cn.iocoder.yudao.module.system.controller.app.user.UserInfoVO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO;
|
import cn.iocoder.yudao.module.system.dal.dataobject.dept.UserPostDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.permission.UserRoleDO;
|
||||||
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.dal.mysql.dept.UserPostMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.dept.UserPostMapper;
|
||||||
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
||||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||||
import cn.iocoder.yudao.module.system.service.dept.PostService;
|
import cn.iocoder.yudao.module.system.service.dept.PostService;
|
||||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||||
|
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||||
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
import cn.iocoder.yudao.module.system.service.tenant.TenantService;
|
||||||
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.core.metadata.IPage;
|
||||||
@ -43,6 +46,7 @@ import com.mzt.logapi.service.impl.DiffParseFunction;
|
|||||||
import com.mzt.logapi.starter.annotation.LogRecord;
|
import com.mzt.logapi.starter.annotation.LogRecord;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Lazy;
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -52,6 +56,7 @@ import javax.annotation.Resource;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF;
|
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF;
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
@ -94,6 +99,9 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||||||
@Resource
|
@Resource
|
||||||
private ConfigApi configApi;
|
private ConfigApi configApi;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RoleService roleService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@LogRecord(type = SYSTEM_USER_TYPE, subType = SYSTEM_USER_CREATE_SUB_TYPE, bizNo = "{{#user.id}}",
|
@LogRecord(type = SYSTEM_USER_TYPE, subType = SYSTEM_USER_CREATE_SUB_TYPE, bizNo = "{{#user.id}}",
|
||||||
@ -662,6 +670,32 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||||||
return baseMapper.queryUserIgnoreTenant(reqVO);
|
return baseMapper.queryUserIgnoreTenant(reqVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断当前登录用户是否拥有某个角色
|
||||||
|
*
|
||||||
|
* @param roleCode 角色编码
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean ifLoginUserHasRoleByCode(String roleCode) {
|
||||||
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
|
//获取当前登陆人的所有角色
|
||||||
|
List<UserRoleDO> userRoles = roleService.getByUserId(loginUser.getId());
|
||||||
|
List<Long> userRoleIds = userRoles.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList());
|
||||||
|
List<RoleDO> roleList = roleService.getRoleList(userRoleIds);
|
||||||
|
|
||||||
|
//判断当前角色集合中的code是否包含jcyszz
|
||||||
|
if (CollectionUtil.isNotEmpty(roleList)) {
|
||||||
|
List<RoleDO> filteredRoleList = roleList.stream()
|
||||||
|
.filter(role -> role.getCode().contains(roleCode))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(filteredRoleList)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 对密码进行加密
|
* 对密码进行加密
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user