Compare commits
16 Commits
87eb50c282
...
29aa2a2a4a
Author | SHA1 | Date | |
---|---|---|---|
29aa2a2a4a | |||
2bdd4d7fa4 | |||
![]() |
cb3bea2ad3 | ||
![]() |
e230c5ab09 | ||
![]() |
4b6d66e9b4 | ||
![]() |
dbe91094ec | ||
![]() |
324b241e12 | ||
![]() |
ec37eaf03b | ||
![]() |
18e1ed5e68 | ||
![]() |
a94700e4f6 | ||
![]() |
2fbbcb0daa | ||
![]() |
8c68f0b7c0 | ||
![]() |
8f92fd463f | ||
![]() |
68512f2e92 | ||
![]() |
e813321ea3 | ||
![]() |
3b5c87b032 |
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.staff.controller.admin;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
@ -15,6 +16,8 @@ import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.StaffLoginBody;
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
||||
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.controller.admin.auth.vo.AuthLoginReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.auth.AdminAuthService;
|
||||
@ -40,6 +43,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@ -63,6 +67,8 @@ public class CompanyStaffController {
|
||||
private AdminAuthService loginService;
|
||||
@Autowired
|
||||
private ApiAppLoginService apiAppLoginService;
|
||||
@Resource
|
||||
private AdminUserApi adminUserApi;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
@ -98,6 +104,19 @@ public class CompanyStaffController {
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建、修改员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
@PostMapping("/updateByExistUser")
|
||||
public CommonResult<?> updateByExistUser(@RequestBody CompanyStaffRespVO staffRespVO){
|
||||
staffService.updateByExistUser(staffRespVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工
|
||||
*
|
||||
@ -326,4 +345,25 @@ public class CompanyStaffController {
|
||||
return error(2_002_000_005,e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID获取信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:12 2024/12/18
|
||||
* @param id 用户ID
|
||||
**/
|
||||
@GetMapping("/getByUserId")
|
||||
public CommonResult<?> getByUserId(@RequestParam("id")Long id){
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<CompanyStaff> list = staffService.list(new LambdaQueryWrapper<CompanyStaff>().eq(CompanyStaff::getUserId, id));
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
map.put("staff", list.get(0));
|
||||
}
|
||||
AdminUserRespDTO user = adminUserApi.getUser(id);
|
||||
if (ObjectUtil.isNotEmpty(user)){
|
||||
map.put("user", user);
|
||||
}
|
||||
return success(map);
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -110,4 +111,23 @@ public class CompanyStaff extends TenantBaseDO {
|
||||
@TableField(exist = false)
|
||||
@ExcelProperty("员工角色")
|
||||
private String roleNames;
|
||||
|
||||
/** 身份证号 */
|
||||
@ExcelProperty("身份证号")
|
||||
private String IdNumber;
|
||||
|
||||
/** 转正时间 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("转正时间")
|
||||
private Date formalDate;
|
||||
|
||||
/** 购买保险时间 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("购买保险时间")
|
||||
private Date safeDate;
|
||||
|
||||
/** 附件的名称们,手动填写,逗号分隔,没有也要占位,和下面的urls对应 */
|
||||
private String fileNames;
|
||||
}
|
||||
|
@ -139,4 +139,14 @@ public interface CompanyStaffService extends IService<CompanyStaff> {
|
||||
* @return cn.iocoder.yudao.module.staff.entity.CompanyStaff
|
||||
**/
|
||||
CompanyStaffRespVO getMyAdviser(Long tenantId,String sysCode);
|
||||
|
||||
/**
|
||||
* 创建、修改员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
void updateByExistUser(CompanyStaffRespVO staffRespVO);
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.staff.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.log.Log;
|
||||
import cn.iocoder.yudao.common.*;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
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.util.TenantUtils;
|
||||
@ -685,4 +687,45 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
// 啥也不是
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建、修改员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
@Override
|
||||
public void updateByExistUser(CompanyStaffRespVO staffRespVO){
|
||||
if (ObjectUtil.isEmpty(staffRespVO.getId())){
|
||||
AdminUserRespDTO loginUser = getLoginUser();
|
||||
// 设置新增员工部门
|
||||
staffRespVO.setDeptId(loginUser.getDeptId());
|
||||
// 1 获取当前登录用户的企业信息给添加的员工
|
||||
DeptRespDTO loginDept = getLoginDept(loginUser.getDeptId());
|
||||
staffRespVO.setCorpId(loginDept.getCorpId());
|
||||
// 2 生成唯一推广码
|
||||
String uniqueCode = uniqueCodeService.createUniqueCode();
|
||||
if (!ObjectUtil.isNotEmpty(uniqueCode)) {
|
||||
throw exception(CommonErrorCodeConstants.UNIQUE_CODE_CREATE_REPEAT);
|
||||
}
|
||||
staffRespVO.setUniqueCode(uniqueCode);
|
||||
// 3 保存员工信息到数据库
|
||||
baseMapper.insert(staffRespVO);
|
||||
}else {
|
||||
AdminUserRespDTO user = adminUserApi.getUser(staffRespVO.getUserId());
|
||||
AdminUserRespDTO newUser = new AdminUserRespDTO();
|
||||
newUser.setId(user.getId());
|
||||
if (!user.getUsername().equals(staffRespVO.getTel())){
|
||||
newUser.setUsername(staffRespVO.getTel());
|
||||
}
|
||||
if (!user.getNickname().equals(staffRespVO.getName())){
|
||||
newUser.setNickname(staffRespVO.getName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(newUser.getUsername()) || ObjectUtil.isNotEmpty(newUser.getNickname())){
|
||||
adminUserApi.updateUser(newUser);
|
||||
}
|
||||
baseMapper.updateById(staffRespVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,9 @@ public enum InspectionRoleCommon {
|
||||
/** 检测业务管理员 */
|
||||
JIANCE("jiance", 1),
|
||||
|
||||
/** 站长 */
|
||||
JCZZ("jczz", 1),
|
||||
|
||||
/** 检测站老板 */
|
||||
JCBOSS("jcboss", 1),
|
||||
|
||||
@ -66,6 +69,33 @@ public enum InspectionRoleCommon {
|
||||
/** 检测用户 */
|
||||
JCYH("jcyh", 4),
|
||||
|
||||
/** 安检外检 */
|
||||
JCAJWJ("jcajwj", 4),
|
||||
|
||||
/** 收费登录 */
|
||||
JCSFDL("jcsfdl", 4),
|
||||
|
||||
/** 环检外检 */
|
||||
JCHJWJ("jchjwj", 4),
|
||||
|
||||
/** 底盘检测 */
|
||||
JCDPJC("jcdpjc", 4),
|
||||
|
||||
/** 环检操作 */
|
||||
JCHJCZ("jchjcz", 4),
|
||||
|
||||
/** 检测总检 */
|
||||
JCZJ("jczj", 4),
|
||||
|
||||
/** 检测资料管理员 */
|
||||
JCZLGLY("jczlgly", 4),
|
||||
|
||||
/** 安全检验员 */
|
||||
AQJYY("aqjyy", 4),
|
||||
|
||||
/** 授权签字人 */
|
||||
JCSQQZR("jcsqqzr", 4),
|
||||
|
||||
/** 检测员工 */
|
||||
JCWORKER("jcworker", 4);
|
||||
|
||||
|
@ -164,6 +164,12 @@ public class AppNewsController extends BaseController {
|
||||
inspectionNews.setPublishUnit(partners.getPartnerName());
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(inspectionNews.getType()) || inspectionNews.getType().equals("null")){
|
||||
if (ObjectUtil.isNotEmpty(inspectionNews.getIfShow())){
|
||||
inspectionNews.setType(inspectionNews.getIfShow().equals("01") ? "staff" : "user");
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否为当前登录用户创建的
|
||||
return toAjax(inspectionNewsService.insertInspectionNews(inspectionNews));
|
||||
}
|
||||
@ -314,5 +320,4 @@ public class AppNewsController extends BaseController {
|
||||
IPage<InspectionNews> news = inspectionNewsService.msgList(page,partnerId);
|
||||
return success(news);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
||||
import cn.iocoder.yudao.util.ExcelUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -122,4 +123,21 @@ public class InspectionFileController extends BaseController
|
||||
}
|
||||
return success(inspectionFileService.getCountByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到使用说明
|
||||
*
|
||||
* @author 小李
|
||||
* @date 12:31 2024/12/17
|
||||
**/
|
||||
@GetMapping("/getPresent")
|
||||
public CommonResult<?> getPresent(){
|
||||
List<InspectionFile> files = inspectionFileService.list(new LambdaQueryWrapper<InspectionFile>().eq(InspectionFile::getFileName, "使用说明"));
|
||||
if (CollUtil.isEmpty(files)){
|
||||
return null;
|
||||
}
|
||||
InspectionFile inspectionFile = files.get(0);
|
||||
return success(inspectionFile);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -359,4 +359,15 @@ public class InspectionInfoController extends BaseController {
|
||||
String name = inspectionInfoService.easyPoiExport("template/word/四川省超标排放汽车维护修理告知书.docx", str, map, request, response);
|
||||
return CommonResult.success(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得不同状态的数据的数量
|
||||
*
|
||||
* @author 小李
|
||||
* @date 16:22 2024/12/18
|
||||
**/
|
||||
@GetMapping("/getCountByType")
|
||||
public CommonResult<?> getCountByType(@RequestParam("partnerId")Integer partnerId){
|
||||
return success(inspectionInfoService.getCountByType(partnerId));
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,18 @@
|
||||
package cn.iocoder.yudao.module.inspection.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionNews;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionNewsService;
|
||||
import cn.iocoder.yudao.module.shop.entity.ShopMallPartners;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
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 com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -13,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Controller
|
||||
*
|
||||
@ -26,6 +35,15 @@ public class InspectionNewsController extends BaseController
|
||||
@Autowired
|
||||
private IInspectionNewsService inspectionNewsService;
|
||||
|
||||
@Resource
|
||||
private DictDataApi dataApi;
|
||||
|
||||
@Resource
|
||||
private PermissionApi permissionApi;
|
||||
|
||||
@Resource
|
||||
private RoleApi roleApi;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】列表
|
||||
*/
|
||||
@ -63,4 +81,22 @@ public class InspectionNewsController extends BaseController
|
||||
{
|
||||
return toAjax(inspectionNewsService.deleteInspectionNewsByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证当前登录用户是否可以发布通知
|
||||
*
|
||||
* @author 小李
|
||||
* @date 16:00 2024/12/18
|
||||
**/
|
||||
@GetMapping("/ifSend")
|
||||
public CommonResult<?> ifSend(){
|
||||
List<DictDataRespDTO> dataList = dataApi.getDictDataList("ins_send_news");
|
||||
List<String> values = dataList.stream().map(DictDataRespDTO::getValue).collect(Collectors.toList());
|
||||
List<Long> roleIds = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
List<RoleReqDTO> roles = roleApi.getRoleList();
|
||||
List<RoleReqDTO> role = roles.stream().filter(item -> roleIds.contains(item.getId())).collect(Collectors.toList());
|
||||
List<String> codes = role.stream().map(RoleReqDTO::getCode).collect(Collectors.toList());
|
||||
List<String> collect = codes.stream().filter(values::contains).collect(Collectors.toList());
|
||||
return success(!collect.isEmpty());
|
||||
}
|
||||
}
|
||||
|
@ -5,17 +5,23 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.InspectionRoleCommon;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionEquInfo;
|
||||
import cn.iocoder.yudao.module.inspection.entity.InspectionFile;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionEquInfoService;
|
||||
import cn.iocoder.yudao.module.inspection.service.IInspectionFileService;
|
||||
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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
@ -25,7 +31,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:36 2024/12/15
|
||||
**/
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/inspection/util")
|
||||
public class InspectionUtilController {
|
||||
@ -36,6 +42,12 @@ public class InspectionUtilController {
|
||||
@Resource
|
||||
private RoleApi roleApi;
|
||||
|
||||
@Resource
|
||||
private IInspectionEquInfoService equInfoService;
|
||||
|
||||
@Resource
|
||||
private IInspectionFileService fileService;
|
||||
|
||||
/**
|
||||
* 根据用户取出当前用户的角色,只针对检测
|
||||
*
|
||||
@ -43,10 +55,10 @@ public class InspectionUtilController {
|
||||
* @date 15:15 2024/12/15
|
||||
**/
|
||||
@GetMapping("/getRoleName")
|
||||
public CommonResult<?> getRoleName(){
|
||||
public CommonResult<?> getRoleName() {
|
||||
String name = "未知岗位";
|
||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
if (CollUtil.isEmpty(roleIdsByUserId)){
|
||||
if (CollUtil.isEmpty(roleIdsByUserId)) {
|
||||
return success(name);
|
||||
}
|
||||
List<RoleReqDTO> roleList = roleApi.getRoleList();
|
||||
@ -54,21 +66,74 @@ public class InspectionUtilController {
|
||||
List<InspectionRoleCommon> roleCommons = Arrays.asList(InspectionRoleCommon.values());
|
||||
List<String> codes = roleCommons.stream().map(InspectionRoleCommon::getCode).collect(Collectors.toList());
|
||||
List<RoleReqDTO> inspectionRoles = roles.stream().filter(item -> codes.contains(item.getCode())).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(inspectionRoles)){
|
||||
if (CollUtil.isEmpty(inspectionRoles)) {
|
||||
return success(name);
|
||||
}
|
||||
Integer index = Integer.MAX_VALUE;
|
||||
Integer index = Integer.MAX_VALUE;
|
||||
for (RoleReqDTO inspectionRole : inspectionRoles) {
|
||||
InspectionRoleCommon inspectionRoleCommon = InspectionRoleCommon.valueOf(inspectionRole.getCode().toUpperCase());
|
||||
if (ObjectUtil.isEmpty(inspectionRoleCommon)){
|
||||
if (ObjectUtil.isEmpty(inspectionRoleCommon)) {
|
||||
continue;
|
||||
}
|
||||
Integer weight = inspectionRoleCommon.getWeight();
|
||||
if (weight < index){
|
||||
if (weight < index) {
|
||||
index = weight;
|
||||
name = inspectionRole.getName();
|
||||
}
|
||||
}
|
||||
return success(name);
|
||||
}
|
||||
|
||||
@GetMapping("/getTypeCount")
|
||||
public CommonResult<?> getTypeCount(@RequestParam("partnerId") Long partnerId) {
|
||||
Map<String, Long> map = new HashMap<>();
|
||||
Long staffCount = roleApi.selectListByRoleId();
|
||||
map.put("staff", staffCount);
|
||||
Page<InspectionEquInfo> page = new Page<>(1, 1000);
|
||||
IPage<InspectionEquInfo> equs = equInfoService.selectInspectionEquInfoList(page, new InspectionEquInfo());
|
||||
map.put("equ", equs.getTotal());
|
||||
long fileCount = fileService.count(new LambdaQueryWrapper<InspectionFile>().eq(InspectionFile::getType, "2"));
|
||||
map.put("file", fileCount);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@GetMapping("/getRoleNameByIds")
|
||||
public CommonResult<?> getRoleNameByIds(@RequestParam("ids") List<Long> ids) {
|
||||
Map<Long, List<Long>> idToRoleIds = ids.stream().collect(Collectors.toMap(id -> id, id -> permissionApi.getRoleIdsByUserId(id)));
|
||||
if (CollUtil.isEmpty(idToRoleIds)){
|
||||
return null;
|
||||
}
|
||||
List<RoleReqDTO> roleList = roleApi.getRoleList();
|
||||
List<InspectionRoleCommon> roleCommons = Arrays.asList(InspectionRoleCommon.values());
|
||||
List<String> codes = roleCommons.stream().map(InspectionRoleCommon::getCode).collect(Collectors.toList());
|
||||
return success(idToRoleIds.entrySet().stream().collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
item -> {
|
||||
String name = "未知岗位";
|
||||
if (CollUtil.isEmpty(item.getValue())){
|
||||
return name;
|
||||
}
|
||||
List<RoleReqDTO> roles = roleList.stream().filter(i -> item.getValue().contains(i.getId())).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(roles)) {
|
||||
return name;
|
||||
}
|
||||
List<RoleReqDTO> inspectionRoles = roles.stream().filter(i -> codes.contains(i.getCode())).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(inspectionRoles)){
|
||||
return name;
|
||||
}
|
||||
Integer index = Integer.MAX_VALUE;
|
||||
for (RoleReqDTO inspectionRole : inspectionRoles) {
|
||||
InspectionRoleCommon inspectionRoleCommon = InspectionRoleCommon.valueOf(inspectionRole.getCode().toUpperCase());
|
||||
if (ObjectUtil.isEmpty(inspectionRoleCommon)) {
|
||||
continue;
|
||||
}
|
||||
Integer weight = inspectionRoleCommon.getWeight();
|
||||
if (weight < index) {
|
||||
index = weight;
|
||||
name = inspectionRole.getName();
|
||||
}
|
||||
}
|
||||
return name;
|
||||
})));
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/partnerOwn/partner")
|
||||
public class PartnerOwnController extends BaseController {
|
||||
public class PartnerOwnController extends BaseController {
|
||||
@Autowired
|
||||
private AppInspectionPartnerService partnerList;
|
||||
@Autowired
|
||||
@ -58,12 +58,12 @@ public class PartnerOwnController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/shopInfo")
|
||||
public CommonResult shopInfo() throws Exception {
|
||||
return success(partnerList.shopInfo());
|
||||
return success(partnerList.shopInfo());
|
||||
}
|
||||
|
||||
@GetMapping("/shopInfoByUserId")
|
||||
public CommonResult shopInfoByUserId() throws Exception {
|
||||
return success(partnerList.shopInfoByUserId());
|
||||
return success(partnerList.shopInfoByUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,7 +71,7 @@ public class PartnerOwnController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/getAppointAndPickNum")
|
||||
public CommonResult getAppointAndPickNum() throws Exception {
|
||||
return success(partnerList.getAppointAndPickNum());
|
||||
return success(partnerList.getAppointAndPickNum());
|
||||
}
|
||||
|
||||
|
||||
@ -79,127 +79,126 @@ public class PartnerOwnController extends BaseController {
|
||||
* 开始或者停止营业
|
||||
*/
|
||||
@PostMapping("/startOrEnd")
|
||||
public CommonResult startOrEnd(Long partnerId)
|
||||
{
|
||||
public CommonResult startOrEnd(Long partnerId) {
|
||||
partnerList.startOrEnd(partnerId);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页 顶部数据统计
|
||||
*/
|
||||
@GetMapping("/statisticsInfo")
|
||||
public CommonResult statisticsInfo()
|
||||
{
|
||||
return success(partnerList.statisticsInfo(null));
|
||||
public CommonResult statisticsInfo() {
|
||||
return success(partnerList.statisticsInfo(null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测线图
|
||||
*/
|
||||
@GetMapping("/chartInfoAmount")
|
||||
public CommonResult chartInfoAmount(Long partnerId,String unit)
|
||||
{
|
||||
return success(partnerList.chartInfoAmount(partnerId, unit));
|
||||
public CommonResult chartInfoAmount(Long partnerId, String unit) {
|
||||
return success(partnerList.chartInfoAmount(partnerId, unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新检测线图
|
||||
*/
|
||||
@GetMapping("/newChartInfoAmount")
|
||||
public CommonResult newChartInfoAmount(String unit)
|
||||
{
|
||||
return success(partnerList.newChartInfoAmount(unit));
|
||||
public CommonResult newChartInfoAmount(String unit) {
|
||||
return success(partnerList.newChartInfoAmount(unit));
|
||||
}
|
||||
/**staticsTable1
|
||||
|
||||
/**
|
||||
* staticsTable1
|
||||
* 检测数量折线图
|
||||
*/
|
||||
@GetMapping("/chartLineInspectionNum")
|
||||
public CommonResult chartLineInspectionNum(Long partnerId,String unit)
|
||||
{
|
||||
return success(partnerList.chartLineInspectionNum(partnerId, unit));
|
||||
public CommonResult chartLineInspectionNum(Long partnerId, String unit) {
|
||||
return success(partnerList.chartLineInspectionNum(partnerId, unit));
|
||||
}
|
||||
/**staticsTable1
|
||||
|
||||
/**
|
||||
* staticsTable1
|
||||
* 新检测数量折线图
|
||||
*/
|
||||
@GetMapping("/newChartLineInspectionNum")
|
||||
public CommonResult newChartLineInspectionNum(String unit)
|
||||
{
|
||||
return success(partnerList.newChartLineInspectionNum(unit));
|
||||
public CommonResult newChartLineInspectionNum(String unit) {
|
||||
return success(partnerList.newChartLineInspectionNum(unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测金额折线图
|
||||
*/
|
||||
@GetMapping("/chartLineInspectionAmount")
|
||||
public CommonResult chartLineInspectionAmount(Long partnerId,String unit)
|
||||
{
|
||||
return success(partnerList.chartLineInspectionAmount(partnerId, unit));
|
||||
public CommonResult chartLineInspectionAmount(Long partnerId, String unit) {
|
||||
return success(partnerList.chartLineInspectionAmount(partnerId, unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新检测金额折线图
|
||||
*/
|
||||
@GetMapping("/newChartLineInspectionAmount")
|
||||
public CommonResult newChartLineInspectionAmount(String unit)
|
||||
{
|
||||
return success(partnerList.newChartLineInspectionAmount(unit));
|
||||
public CommonResult newChartLineInspectionAmount(String unit) {
|
||||
return success(partnerList.newChartLineInspectionAmount(unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测线图
|
||||
*/
|
||||
@GetMapping("/chartInfoNum")
|
||||
public CommonResult chartInfoNum(Long partnerId,String unit)
|
||||
{
|
||||
return success(partnerList.chartInfoNum(partnerId, unit));
|
||||
public CommonResult chartInfoNum(Long partnerId, String unit) {
|
||||
return success(partnerList.chartInfoNum(partnerId, unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新检测线图
|
||||
*/
|
||||
@GetMapping("/newChartInfoNum")
|
||||
public CommonResult newChartInfoNum(String unit)
|
||||
{
|
||||
return success(partnerList.newChartInfoNum( unit));
|
||||
public CommonResult newChartInfoNum(String unit) {
|
||||
return success(partnerList.newChartInfoNum(unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测线图
|
||||
*/
|
||||
@GetMapping("/chartInfoRatio")
|
||||
public CommonResult chartInfoRatio(Long partnerId,String unit) throws Exception {
|
||||
public CommonResult chartInfoRatio(Long partnerId, String unit) throws Exception {
|
||||
if (ObjectUtil.isNull(partnerId)) {
|
||||
partnerId = partnerList.shopInfoByUserId().getPartnerId();
|
||||
}
|
||||
return success(partnerList.chartInfoRatio(partnerId, unit));
|
||||
return success(partnerList.chartInfoRatio(partnerId, unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新检测线图
|
||||
*/
|
||||
@GetMapping("/newChartInfoRatio")
|
||||
public CommonResult newChartInfoRatio(String unit)
|
||||
{
|
||||
return success(partnerList.newChartInfoRatio(unit));
|
||||
public CommonResult newChartInfoRatio(String unit) {
|
||||
return success(partnerList.newChartInfoRatio(unit));
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页 订单信息
|
||||
*/
|
||||
@GetMapping("/orderInfo")
|
||||
public CommonResult orderInfo(Long partnerId)
|
||||
{
|
||||
return success(partnerList.orderInfo(partnerId));
|
||||
public CommonResult orderInfo(Long partnerId) {
|
||||
return success(partnerList.orderInfo(partnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 热销商品列表
|
||||
*/
|
||||
@GetMapping("/hotGoodsList")
|
||||
public CommonResult hotGoodsList(Long partnerId)
|
||||
{
|
||||
return success(partnerList.hotGoodsList(partnerId));
|
||||
public CommonResult hotGoodsList(Long partnerId) {
|
||||
return success(partnerList.hotGoodsList(partnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 热销商品列表
|
||||
*/
|
||||
@GetMapping("/newHotGoodsList")
|
||||
public CommonResult newHotGoodsList()
|
||||
{
|
||||
return success(partnerList.newHotGoodsList());
|
||||
public CommonResult newHotGoodsList() {
|
||||
return success(partnerList.newHotGoodsList());
|
||||
}
|
||||
|
||||
|
||||
@ -209,57 +208,56 @@ public class PartnerOwnController extends BaseController {
|
||||
* @return 所有数据
|
||||
*/
|
||||
@GetMapping("/categoryList")
|
||||
public CommonResult categoryList(Long partnerId)
|
||||
{
|
||||
public CommonResult categoryList(Long partnerId) {
|
||||
|
||||
return success( partnerList.categoryList(partnerId));
|
||||
return success(partnerList.categoryList(partnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布商品
|
||||
*/
|
||||
@PostMapping("/addGoods")
|
||||
public CommonResult addGoods(@RequestBody ShopInspectionGoods goods) throws Exception {
|
||||
partnerList.addGoods(goods);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品管理列表
|
||||
*/
|
||||
@GetMapping("/goodsList")
|
||||
public CommonResult goodsList(Long partnerId,String isListing,String goodsTitle,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
public CommonResult goodsList(Long partnerId, String isListing, String goodsTitle,
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
ShopMallPartners partners = partnerList.getById(partnerId);
|
||||
if (!partners.getUserId().equals(user.getId())){
|
||||
if (!partners.getUserId().equals(user.getId())) {
|
||||
return null;
|
||||
}
|
||||
Page<GoodsVo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<GoodsVo> list = partnerList.goodsList(page,partnerId, isListing, goodsTitle);
|
||||
IPage<GoodsVo> list = partnerList.goodsList(page, partnerId, isListing, goodsTitle);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品管理列表
|
||||
*/
|
||||
@GetMapping("/canUsegoods")
|
||||
public CommonResult canUseGoods(Long partnerId)
|
||||
{
|
||||
public CommonResult canUseGoods(Long partnerId) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
ShopMallPartners partners = partnerList.getById(partnerId);
|
||||
if (!partners.getUserId().equals(user.getId())){
|
||||
if (!partners.getUserId().equals(user.getId())) {
|
||||
return null;
|
||||
}
|
||||
return success(partnerList.canUseGoods(partnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品详细信息
|
||||
*/
|
||||
@GetMapping("/goodsDetail")
|
||||
public CommonResult goodsDetail(Long goodsId)
|
||||
{
|
||||
return success(partnerList.goodsDetail(goodsId));
|
||||
public CommonResult goodsDetail(Long goodsId) {
|
||||
return success(partnerList.goodsDetail(goodsId));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -268,55 +266,56 @@ public class PartnerOwnController extends BaseController {
|
||||
@PostMapping("/editGoods")
|
||||
public CommonResult editGoods(@RequestBody ShopInspectionGoods goods) throws Exception {
|
||||
partnerList.editGoods(goods);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
@PostMapping("/editSkuPrice")
|
||||
public CommonResult editSkuPrice(@RequestBody ShopInspectionGoods goods) throws Exception {
|
||||
partnerList.editSkuPrice(goods);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 上下架
|
||||
*/
|
||||
@PostMapping("/changeListing")
|
||||
public CommonResult changeListing(Long goodsId) throws Exception {
|
||||
partnerList.changeListing(goodsId);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
@PostMapping("/delGoods")
|
||||
public CommonResult delGoods(Long goodsId) throws Exception {
|
||||
partnerList.delGoods(goodsId);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理店铺信息
|
||||
*/
|
||||
@PostMapping("/getPartnerInfo")
|
||||
public CommonResult getPartnerInfo(Long partnerId)
|
||||
{
|
||||
return success(partnerList.getPartnerInfo(partnerId));
|
||||
public CommonResult getPartnerInfo(Long partnerId) {
|
||||
return success(partnerList.getPartnerInfo(partnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理店铺信息
|
||||
*/
|
||||
@PostMapping("/editPartnerInfo")
|
||||
public CommonResult editPartnerInfo(@RequestBody ShopMallPartners partners)
|
||||
{
|
||||
public CommonResult editPartnerInfo(@RequestBody ShopMallPartners partners) {
|
||||
partnerList.editPartnerInfo(partners);
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺账户信息
|
||||
*/
|
||||
@GetMapping("/accountInfo")
|
||||
public CommonResult accountInfo(Long partnerId)
|
||||
{
|
||||
return success(partnerList.accountInfo(partnerId));
|
||||
public CommonResult accountInfo(Long partnerId) {
|
||||
return success(partnerList.accountInfo(partnerId));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -324,69 +323,69 @@ public class PartnerOwnController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/accountDetail")
|
||||
public CommonResult accountDetail(Long partnerId,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
Page<PartnerBalanceDetail> page = new Page<>(pageNum, pageSize);
|
||||
IPage<PartnerBalanceDetail> details = partnerList.accountDetail(page,partnerId,pageNum,pageSize);
|
||||
IPage<PartnerBalanceDetail> details = partnerList.accountDetail(page, partnerId, pageNum, pageSize);
|
||||
return success(details);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前店铺的订单信息
|
||||
*/
|
||||
@GetMapping("/orderList")
|
||||
public CommonResult orderList(Long partnerId,String phoneNum, String title,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize)
|
||||
{
|
||||
public CommonResult orderList(Long partnerId, String phoneNum, String title,
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||
if (!partnersTmp.getUserId().equals(user.getId())){
|
||||
if (!partnersTmp.getUserId().equals(user.getId())) {
|
||||
return null;
|
||||
}
|
||||
Page<OrderAppDetail> page = new Page<>(pageNum, pageSize);
|
||||
IPage<OrderAppDetail> orderInfos = partnerList.orderList(page,partnerId,phoneNum, title);
|
||||
IPage<OrderAppDetail> orderInfos = partnerList.orderList(page, partnerId, phoneNum, title);
|
||||
return success(orderInfos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过核销码获取订单信息
|
||||
*/
|
||||
@GetMapping("/orderDetailByCode")
|
||||
public CommonResult orderDetailByCode(Long partnerId,String code) throws Exception {
|
||||
Long orderId = partnerList.orderDetailByCode(partnerId,code);
|
||||
return success(orderId);
|
||||
public CommonResult orderDetailByCode(Long partnerId, String code) throws Exception {
|
||||
Long orderId = partnerList.orderDetailByCode(partnerId, code);
|
||||
return success(orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 当前的订单信息
|
||||
*/
|
||||
@GetMapping("/orderDetail")
|
||||
public CommonResult orderDetail(Long partnerId, Long orderId)
|
||||
{
|
||||
OrderAppDetail orderInfos = partnerList.orderDetail(partnerId,orderId);
|
||||
return success(orderInfos);
|
||||
public CommonResult orderDetail(Long partnerId, Long orderId) {
|
||||
OrderAppDetail orderInfos = partnerList.orderDetail(partnerId, orderId);
|
||||
return success(orderInfos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺核销功能
|
||||
*/
|
||||
@PostMapping("/takeOut")
|
||||
public CommonResult takeOut(Long partnerId,Long orderId,Long workId,String carNum) throws Exception {
|
||||
partnerList.takeOut(partnerId,orderId,workId,carNum);
|
||||
return success();
|
||||
public CommonResult takeOut(Long partnerId, Long orderId, Long workId, String carNum) throws Exception {
|
||||
partnerList.takeOut(partnerId, orderId, workId, carNum);
|
||||
return success();
|
||||
}
|
||||
@PostMapping("/addWorker")
|
||||
public CommonResult addWorker(Long partnerId,String realName,String phoneNum,Long postId) throws Exception {
|
||||
|
||||
partnerList.addWorker(partnerId,realName,phoneNum,postId);
|
||||
return success();
|
||||
@PostMapping("/addWorker")
|
||||
public CommonResult addWorker(Long partnerId, String realName, String phoneNum, Long postId) throws Exception {
|
||||
|
||||
partnerList.addWorker(partnerId, realName, phoneNum, postId);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工信息
|
||||
*/
|
||||
@GetMapping("/getWorkList")
|
||||
public CommonResult<IPage<?>> getWorkList(Long partnerId, String workName, String phoneNum, Long postId, Integer pageNum, Integer pageSize)
|
||||
{
|
||||
public CommonResult<IPage<?>> getWorkList(Long partnerId, String workName, String phoneNum, Long postId, Integer pageNum, Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
// ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||
// if (!partnersTmp.getUserId().equals(user.getId())){
|
||||
@ -404,23 +403,23 @@ public class PartnerOwnController extends BaseController {
|
||||
}
|
||||
|
||||
@PostMapping("/delWorker")
|
||||
public CommonResult delWorker(Long partnerId,String workIdStr) {
|
||||
public CommonResult delWorker(Long partnerId, String workIdStr) {
|
||||
String[] workIds = workIdStr.split(",");
|
||||
for (String workId : workIds) {
|
||||
partnerList.delWorker(partnerId,Long.parseLong(workId));
|
||||
partnerList.delWorker(partnerId, Long.parseLong(workId));
|
||||
}
|
||||
return success();
|
||||
return success();
|
||||
}
|
||||
|
||||
//获取检测的数据
|
||||
@GetMapping("/inspectionList")
|
||||
public CommonResult 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();
|
||||
if (!partnerId.equals(partners.getPartnerId())){
|
||||
if (!partnerId.equals(partners.getPartnerId())) {
|
||||
return null;
|
||||
}
|
||||
Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
||||
IPage<InspectionInfo> inspectionInfos = partnerList.inspectionList(page,partnerId, status, carNum);
|
||||
Page<InspectionInfo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionInfo> inspectionInfos = partnerList.inspectionList(page, partnerId, status, carNum);
|
||||
return success(inspectionInfos);
|
||||
}
|
||||
|
||||
@ -432,59 +431,63 @@ public class PartnerOwnController extends BaseController {
|
||||
|
||||
//获取检测的数据
|
||||
@GetMapping("/workerInspectionList")
|
||||
public CommonResult 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();
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PartnerWorker::getUserId,user.getId()).eq(PartnerWorker::getPartnerId,partnerId);
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PartnerWorker::getUserId, user.getId()).eq(PartnerWorker::getPartnerId, partnerId);
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(worker)){
|
||||
if (ObjectUtil.isEmpty(worker)) {
|
||||
return null;
|
||||
}
|
||||
Page<InspectionInfo> page = new Page<>(pageNum,pageSize);
|
||||
IPage<InspectionInfo> inspectionInfos = partnerList.inspectionList(page,partnerId, status, searchValue);
|
||||
Page<InspectionInfo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionInfo> inspectionInfos = partnerList.inspectionList(page, partnerId, status, searchValue);
|
||||
return success(inspectionInfos);
|
||||
}
|
||||
|
||||
//增加检测步骤信息
|
||||
@PostMapping("/addStepInfo")
|
||||
public CommonResult addStepInfo(@RequestBody InspectionStepInfo stepInfo) {
|
||||
partnerList.addStepInfo(stepInfo);
|
||||
return success();
|
||||
}
|
||||
|
||||
//增加检测结果
|
||||
@PostMapping("/stopInspection")
|
||||
public CommonResult editInspection(@RequestBody InspectionInfo info) throws Exception {
|
||||
partnerList.stopInspection(info);
|
||||
return success();
|
||||
}
|
||||
|
||||
//完成制证
|
||||
@PostMapping("/makeCertOk")
|
||||
public CommonResult makeCertOk(Long inspectionId) {
|
||||
partnerList.makeCertOk(inspectionId);
|
||||
return success();
|
||||
}
|
||||
|
||||
//获取到店预约的数据
|
||||
@GetMapping("/getAppointmentList")
|
||||
public CommonResult getAppointmentList(Long partnerId,String phoneNum,Integer pageSize,Integer pageNum) {
|
||||
public CommonResult getAppointmentList(Long partnerId, String phoneNum, Integer pageSize, Integer pageNum) {
|
||||
// LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
// ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||
// if (!partnersTmp.getUserId().equals(user.getId())){
|
||||
// return null;
|
||||
// }
|
||||
Page<InspectionAppointment> page = new Page<>(pageNum,pageSize);
|
||||
IPage<InspectionAppointment> appointments = partnerList.getAppointmentList(page,partnerId,phoneNum);
|
||||
Page<InspectionAppointment> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionAppointment> appointments = partnerList.getAppointmentList(page, partnerId, phoneNum);
|
||||
return success(appointments);
|
||||
}
|
||||
|
||||
//获取上门取车数据
|
||||
@GetMapping("/getPickCarList")
|
||||
public CommonResult 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();
|
||||
// ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||
// if (!partnersTmp.getUserId().equals(user.getId())){
|
||||
// return null;
|
||||
// }
|
||||
Page<InspectionPickCar> page = new Page<>(pageNum,pageSize);
|
||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarList(page,partnerId,phoneNum,pickStatus);
|
||||
Page<InspectionPickCar> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarList(page, partnerId, phoneNum, pickStatus);
|
||||
return success(pickCarList);
|
||||
}
|
||||
|
||||
@ -497,16 +500,16 @@ public class PartnerOwnController extends BaseController {
|
||||
|
||||
// 核销记录By核销人Id
|
||||
@GetMapping("/validationList")
|
||||
public CommonResult validationList(Long partnerId,String searchValue,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||
public CommonResult validationList(Long partnerId, String searchValue,
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||
if (!partnersTmp.getUserId().equals(user.getId())){
|
||||
if (!partnersTmp.getUserId().equals(user.getId())) {
|
||||
return null;
|
||||
}
|
||||
Page<OrderInfo> page = new Page<>(pageNum, pageSize);
|
||||
IPage<OrderInfo> orderInfos = partnerList.validationList(page,partnerId,searchValue);
|
||||
IPage<OrderInfo> orderInfos = partnerList.validationList(page, partnerId, searchValue);
|
||||
return success(orderInfos);
|
||||
}
|
||||
|
||||
@ -519,37 +522,38 @@ public class PartnerOwnController extends BaseController {
|
||||
|
||||
//优惠券列表
|
||||
@GetMapping("/listCoupon")
|
||||
public CommonResult listCoupon(Long partnerId,String searchValue,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize){
|
||||
public CommonResult listCoupon(Long partnerId, String searchValue,
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||
if (!partnersTmp.getUserId().equals(user.getId())){
|
||||
if (!partnersTmp.getUserId().equals(user.getId())) {
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
Page<ShopCouponTemplate> page = new Page<>(pageNum, pageSize);
|
||||
IPage<ShopCouponTemplate> shopCouponTemplates = partnerList.listCoupon(page,partnerId, searchValue);
|
||||
IPage<ShopCouponTemplate> shopCouponTemplates = partnerList.listCoupon(page, partnerId, searchValue);
|
||||
return success(shopCouponTemplates);
|
||||
}
|
||||
|
||||
//删除优惠券
|
||||
@PostMapping("/delCoupon")
|
||||
public CommonResult delCoupon(Long partnerId,Long id){
|
||||
partnerList.delCoupon(partnerId,id);
|
||||
public CommonResult delCoupon(Long partnerId, Long id) {
|
||||
partnerList.delCoupon(partnerId, id);
|
||||
return success();
|
||||
}
|
||||
|
||||
//指派工人上门取车
|
||||
@PostMapping("/designatePickCarWorker")
|
||||
public CommonResult designatePickCarWorker(Long pickCarId,Long workerId){
|
||||
partnerList.designatePickCarWorker(pickCarId,workerId);
|
||||
public CommonResult designatePickCarWorker(Long pickCarId, Long workerId) {
|
||||
partnerList.designatePickCarWorker(pickCarId, workerId);
|
||||
return success();
|
||||
}
|
||||
|
||||
//获取上门取车数据
|
||||
@GetMapping("/getPickCarListOfWorker")
|
||||
public CommonResult getPickCarListOfWorker(Long partnerId,String phoneNum,
|
||||
@RequestParam(value = "pageNum" ,required = false ,defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||
public CommonResult getPickCarListOfWorker(Long partnerId, String phoneNum,
|
||||
@RequestParam(value = "pageNum", required = false, defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", required = false, defaultValue = "10") Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
// .eq(PartnerWorker::getUserId,user.getId())
|
||||
// LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
||||
@ -559,7 +563,7 @@ public class PartnerOwnController extends BaseController {
|
||||
// return null;
|
||||
// }
|
||||
Page<InspectionPickCar> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarListOfWorker(page,user.getId(),phoneNum);
|
||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarListOfWorker(page, user.getId(), phoneNum);
|
||||
return success(pickCarList);
|
||||
}
|
||||
|
||||
@ -567,22 +571,22 @@ public class PartnerOwnController extends BaseController {
|
||||
@GetMapping("/getCustomerSource")
|
||||
public CommonResult getCustomerSource(String searchValue) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfoByUserId();
|
||||
String dictStr = "customer_source-"+partners.getPartnerId();
|
||||
String dictStr = "customer_source-" + partners.getPartnerId();
|
||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
||||
if (ObjectUtil.isEmpty(sysDictType)){
|
||||
if (ObjectUtil.isEmpty(sysDictType)) {
|
||||
//初始化
|
||||
DictTypeSaveReqVO save = new DictTypeSaveReqVO();
|
||||
save.setName("客户来源-"+partners.getPartnerName());
|
||||
save.setName("客户来源-" + partners.getPartnerName());
|
||||
save.setStatus(0);
|
||||
save.setType(dictStr);
|
||||
dictTypeService.createDictType(save);
|
||||
}
|
||||
List<DictDataDO> dataList = dictDataService.getDictDataListByDictType(dictStr);
|
||||
if (CollectionUtil.isEmpty(dataList)){
|
||||
dataList =new ArrayList<>();
|
||||
if (CollectionUtil.isEmpty(dataList)) {
|
||||
dataList = new ArrayList<>();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(searchValue)){
|
||||
dataList = dataList.stream().filter(it->{
|
||||
if (StringUtils.isNotEmpty(searchValue)) {
|
||||
dataList = dataList.stream().filter(it -> {
|
||||
return it.getLabel().contains(searchValue);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
@ -593,7 +597,7 @@ public class PartnerOwnController extends BaseController {
|
||||
@PostMapping("/addCustomerSource")
|
||||
public CommonResult addCustomerSource(@RequestBody SysDictData dictData) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
String dictStr = "customer_source-"+partners.getPartnerId();
|
||||
String dictStr = "customer_source-" + partners.getPartnerId();
|
||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
||||
|
||||
DictDataSaveReqVO dictSave = new DictDataSaveReqVO();
|
||||
@ -609,52 +613,51 @@ public class PartnerOwnController extends BaseController {
|
||||
|
||||
//新增客户来源
|
||||
@PostMapping("/delCustomerSource")
|
||||
public CommonResult delCustomerSource(Long dictId){
|
||||
public CommonResult delCustomerSource(Long dictId) {
|
||||
dictDataService.deleteDictData(dictId);
|
||||
return success();
|
||||
}
|
||||
|
||||
//批量删除客户来源
|
||||
@PostMapping("/delCustomerSourceBatch")
|
||||
public CommonResult delCustomerSourceBatch(@RequestBody List<Long> dictIds){
|
||||
public CommonResult delCustomerSourceBatch(@RequestBody List<Long> dictIds) {
|
||||
dictDataService.deleteDictDataBatch(dictIds);
|
||||
return success();
|
||||
}
|
||||
|
||||
@PostMapping("/vehicleLicenseOCR")
|
||||
public CommonResult vehicleLicenseOCR(String imagePath) throws Exception
|
||||
{
|
||||
public CommonResult vehicleLicenseOCR(String imagePath) throws Exception {
|
||||
return success(partnerList.vehicleLicenseOCR(imagePath));
|
||||
}
|
||||
|
||||
//线下收费
|
||||
@PostMapping("/offlineCharging")
|
||||
public CommonResult offlineCharging(@RequestBody InspectionInfoVo infoVo)
|
||||
{
|
||||
public CommonResult offlineCharging(@RequestBody InspectionInfoVo infoVo) {
|
||||
partnerList.offlineCharging(infoVo);
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//获取收款账号
|
||||
@GetMapping("/getBankAccountList")
|
||||
public CommonResult getBankAccountList(String searchValue) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfoByUserId();
|
||||
String dictStr = "partner_bankList-"+partners.getPartnerId();
|
||||
String dictStr = "partner_bankList-" + partners.getPartnerId();
|
||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
||||
if (ObjectUtil.isEmpty(sysDictType)){
|
||||
if (ObjectUtil.isEmpty(sysDictType)) {
|
||||
//初始化
|
||||
DictTypeSaveReqVO sysDictTypeSave =new DictTypeSaveReqVO();
|
||||
sysDictTypeSave.setName("收款账户-"+partners.getPartnerName());
|
||||
DictTypeSaveReqVO sysDictTypeSave = new DictTypeSaveReqVO();
|
||||
sysDictTypeSave.setName("收款账户-" + partners.getPartnerName());
|
||||
sysDictTypeSave.setStatus(0);
|
||||
sysDictTypeSave.setType(dictStr);
|
||||
dictTypeService.createDictType(sysDictTypeSave);
|
||||
}
|
||||
List<DictDataDO> dataList = dictDataService.getDictDataListByDictType(dictStr);
|
||||
if (CollectionUtil.isEmpty(dataList)){
|
||||
dataList =new ArrayList<>();
|
||||
if (CollectionUtil.isEmpty(dataList)) {
|
||||
dataList = new ArrayList<>();
|
||||
}
|
||||
if (StringUtils.isNotEmpty(searchValue)){
|
||||
dataList = dataList.stream().filter(it->{
|
||||
if (StringUtils.isNotEmpty(searchValue)) {
|
||||
dataList = dataList.stream().filter(it -> {
|
||||
return it.getLabel().contains(searchValue);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
@ -665,7 +668,7 @@ public class PartnerOwnController extends BaseController {
|
||||
@PostMapping("/addBankAccount")
|
||||
public CommonResult addBankAccount(@RequestBody SysDictData dictData) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
String dictStr = "partner_bankList-"+partners.getPartnerId();
|
||||
String dictStr = "partner_bankList-" + partners.getPartnerId();
|
||||
DictTypeDO sysDictType = dictTypeService.getDictType(dictStr);
|
||||
|
||||
DictDataSaveReqVO dictSave = new DictDataSaveReqVO();
|
||||
@ -682,83 +685,90 @@ public class PartnerOwnController extends BaseController {
|
||||
|
||||
//删除银行卡账户
|
||||
@PostMapping("/delBankAccount")
|
||||
public CommonResult delBankAccount(Long dictId){
|
||||
public CommonResult delBankAccount(Long dictId) {
|
||||
dictDataService.deleteDictData(dictId);
|
||||
return success();
|
||||
}
|
||||
|
||||
//工单预览
|
||||
@GetMapping("/workOrderView")
|
||||
public CommonResult workOrderView(Long inspectionId){
|
||||
public CommonResult workOrderView(Long inspectionId) {
|
||||
return success(partnerList.workOrderView(inspectionId));
|
||||
}
|
||||
|
||||
//岗位信息
|
||||
@GetMapping("/inspectionPostInfo")
|
||||
public CommonResult inspectionPostInfo(){
|
||||
public CommonResult inspectionPostInfo() {
|
||||
return success(partnerList.inspectionPostInfo());
|
||||
}
|
||||
|
||||
//统计表格1
|
||||
@GetMapping("/staticsTable1")
|
||||
public CommonResult staticsTable1(String startTime,String endTime) throws Exception {
|
||||
public CommonResult staticsTable1(String startTime, String endTime) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
return success(partnerList.staticsTable1(partners.getPartnerId(),startTime,endTime));
|
||||
return success(partnerList.staticsTable1(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
//统计表格1
|
||||
@GetMapping("/newStaticsTable1")
|
||||
public CommonResult newStaticsTable1(String startTime,String endTime) throws Exception {
|
||||
return success(partnerList.newStaticsTable1(startTime,endTime));
|
||||
public CommonResult newStaticsTable1(String startTime, String endTime) throws Exception {
|
||||
return success(partnerList.newStaticsTable1(startTime, endTime));
|
||||
}
|
||||
|
||||
//统计表格2
|
||||
@GetMapping("/staticsTable2")
|
||||
public CommonResult staticsTable2(String startTime,String endTime) throws Exception {
|
||||
public CommonResult staticsTable2(String startTime, String endTime) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
return success(partnerList.staticsTable2(partners.getPartnerId(),startTime,endTime));
|
||||
return success(partnerList.staticsTable2(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
//新统计表格2
|
||||
@GetMapping("/newStaticsTable2")
|
||||
public CommonResult newStaticsTable2(String startTime,String endTime) throws Exception {
|
||||
return success(partnerList.newStaticsTable2(startTime,endTime));
|
||||
public CommonResult newStaticsTable2(String startTime, String endTime) throws Exception {
|
||||
return success(partnerList.newStaticsTable2(startTime, endTime));
|
||||
}
|
||||
|
||||
//统计表格3
|
||||
@GetMapping("/staticsTable3")
|
||||
public CommonResult staticsTable3(String startTime,String endTime) throws Exception {
|
||||
public CommonResult staticsTable3(String startTime, String endTime) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
return success(partnerList.staticsTable3(partners.getPartnerId(),startTime,endTime));
|
||||
return success(partnerList.staticsTable3(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
//新统计表格3
|
||||
@GetMapping("/newStaticsTable3")
|
||||
public CommonResult newStaticsTable3(String startTime,String endTime) throws Exception {
|
||||
return success(partnerList.newStaticsTable3(startTime,endTime));
|
||||
public CommonResult newStaticsTable3(String startTime, String endTime) throws Exception {
|
||||
return success(partnerList.newStaticsTable3(startTime, endTime));
|
||||
}
|
||||
|
||||
//统计表格3
|
||||
@GetMapping("/staticsTable3Detail")
|
||||
public CommonResult staticsTable3Detail(String startTime,String endTime,String remark) throws Exception {
|
||||
public CommonResult staticsTable3Detail(String startTime, String endTime, String remark) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
return success(partnerList.staticsTable3Detail(partners.getPartnerId(),startTime,endTime,remark));
|
||||
return success(partnerList.staticsTable3Detail(partners.getPartnerId(), startTime, endTime, remark));
|
||||
}
|
||||
|
||||
//统计表格4
|
||||
@GetMapping("/staticsTable4")
|
||||
public CommonResult staticsTable4(String startTime,String endTime) throws Exception {
|
||||
public CommonResult staticsTable4(String startTime, String endTime) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
return success(partnerList.staticsTable4(partners.getPartnerId(),startTime,endTime));
|
||||
return success(partnerList.staticsTable4(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
//统计表格5
|
||||
@GetMapping("/staticsTable5")
|
||||
public CommonResult staticsTable5(String startTime,String endTime) throws Exception {
|
||||
public CommonResult staticsTable5(String startTime, String endTime) throws Exception {
|
||||
ShopMallPartners partners = partnerList.shopInfo();
|
||||
return success(partnerList.staticsTable5(partners.getPartnerId(),startTime,endTime));
|
||||
return success(partnerList.staticsTable5(partners.getPartnerId(), startTime, endTime));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据inspection_info的id查有的项目名称
|
||||
*
|
||||
* @param ids inspection_info的id
|
||||
* @author 小李
|
||||
* @date 14:52 2024/12/10
|
||||
* @param ids inspection_info的id
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/getProjectByIds")
|
||||
public CommonResult<?> getProjectByIds(Long[] ids) {
|
||||
return success(partnerList.getProjectByIds(ids));
|
||||
@ -767,19 +777,36 @@ public class PartnerOwnController extends BaseController {
|
||||
/**
|
||||
* 根据时间查订单
|
||||
*
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 条数
|
||||
* @author 小李
|
||||
* @date 14:39 2024/12/12
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
* @param pageNum 页码
|
||||
* @param pageSize 条数
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/getOrderByDate")
|
||||
public CommonResult<?> getOrderByDate(@RequestParam(value = "startTime", required = false) String startTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1")Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10")Integer pageSize){
|
||||
@RequestParam(value = "endTime", required = false) String endTime,
|
||||
@RequestParam(value = "chooseStatus", required = false) String chooseStatus,
|
||||
@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<OrderTable> page = new Page<>(pageNum, pageSize);
|
||||
return success(partnerList.getOrderByDate(startTime, endTime, page));
|
||||
return success(partnerList.getOrderByDate(startTime, endTime, chooseStatus, page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
**/
|
||||
@GetMapping("/getTypeCount")
|
||||
public CommonResult<?> getTypeCount(@RequestParam(value = "startTime", required = false) String startTime,
|
||||
@RequestParam(value = "endTime", required = false) String endTime,
|
||||
@RequestParam(value = "chooseStatus", required = false) String chooseStatus){
|
||||
return success(partnerList.getTypeCount(startTime, endTime, chooseStatus));
|
||||
}
|
||||
}
|
||||
|
@ -5,16 +5,12 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.util.ExcelUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
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.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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.bind.annotation.*;
|
||||
import cn.iocoder.yudao.module.core.controller.BaseController;
|
||||
import cn.iocoder.yudao.module.inspection.entity.WarnMessage;
|
||||
import cn.iocoder.yudao.module.inspection.service.IWarnMessageService;
|
||||
@ -27,8 +23,7 @@ import cn.iocoder.yudao.module.inspection.service.IWarnMessageService;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/warnMsg/warnMsg")
|
||||
public class WarnMessageController extends BaseController
|
||||
{
|
||||
public class WarnMessageController extends BaseController {
|
||||
@Autowired
|
||||
private IWarnMessageService warnMessageService;
|
||||
|
||||
@ -42,11 +37,12 @@ public class WarnMessageController extends BaseController
|
||||
}
|
||||
|
||||
@GetMapping("/pageList")
|
||||
public CommonResult pageList(WarnMessage warnMessage,Integer pageNo,Integer pageSize) throws Exception {
|
||||
Page page =new Page(pageNo,pageSize);
|
||||
IPage<WarnMessage> list = warnMessageService.pageList(page,warnMessage);
|
||||
public CommonResult pageList(WarnMessage warnMessage, Integer pageNo, Integer pageSize) throws Exception {
|
||||
Page page = new Page(pageNo, pageSize);
|
||||
IPage<WarnMessage> list = warnMessageService.pageList(page, warnMessage);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, WarnMessage warnMessage) throws Exception {
|
||||
List<WarnMessage> list = warnMessageService.selectWarnMessageList(warnMessage);
|
||||
@ -58,29 +54,56 @@ public class WarnMessageController extends BaseController
|
||||
* 获取warnMsg详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public CommonResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
public CommonResult getInfo(@PathVariable("id") Long id) {
|
||||
WarnMessage warnMessage = new WarnMessage();
|
||||
warnMessage.setId(id);
|
||||
warnMessage.setIsRead("1");
|
||||
warnMessageService.updateById(warnMessage);
|
||||
return success(warnMessageService.selectWarnMessageById(id));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/add")
|
||||
public CommonResult add(@RequestBody WarnMessage warnMessage)
|
||||
{
|
||||
public CommonResult add(@RequestBody WarnMessage warnMessage) {
|
||||
return toAjax(warnMessageService.insertWarnMessage(warnMessage));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/edit")
|
||||
public CommonResult edit(@RequestBody WarnMessage warnMessage)
|
||||
{
|
||||
public CommonResult edit(@RequestBody WarnMessage warnMessage) {
|
||||
return toAjax(warnMessageService.updateWarnMessage(warnMessage));
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
@DeleteMapping("/{ids}")
|
||||
public CommonResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(warnMessageService.deleteWarnMessageByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取未读的提醒数量
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:33 2024/12/16
|
||||
**/
|
||||
@GetMapping("/getCount")
|
||||
public CommonResult<?> getCount() {
|
||||
long count = warnMessageService.count(new LambdaQueryWrapper<WarnMessage>().eq(WarnMessage::getIsRead, "0"));
|
||||
return success(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已读全部
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:57 2024/12/16
|
||||
**/
|
||||
@GetMapping("/readAll")
|
||||
public CommonResult<?> readAll() {
|
||||
warnMessageService.update(new LambdaUpdateWrapper<WarnMessage>()
|
||||
.set(WarnMessage::getIsRead, "1")
|
||||
.eq(WarnMessage::getIsRead, "0")
|
||||
);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
}
|
||||
|
@ -62,4 +62,7 @@ public class InspectionEquInfo extends TenantBaseDO
|
||||
@TableField(exist = false)
|
||||
private Map<String,Object> params;
|
||||
|
||||
/** 设备类别(字典:ins_equ_type) */
|
||||
private String type;
|
||||
|
||||
}
|
||||
|
@ -56,4 +56,8 @@ public class InspectionNews extends TenantBaseDO
|
||||
@TableField(exist = false)
|
||||
private String isRead;
|
||||
|
||||
/** 设置可见 */
|
||||
@TableField(exist = false)
|
||||
private String ifShow;
|
||||
|
||||
}
|
||||
|
@ -74,5 +74,16 @@ public interface AppInspectionPartnerMapper extends BaseMapper<ShopMallPartners>
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
**/
|
||||
IPage<OrderTable> getOrderByDate(@Param("startTime") String startTime, @Param("endTime") String endTime, Page<OrderTable> page);
|
||||
IPage<OrderTable> getOrderByDate(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("chooseStatus") String chooseStatus, Page<OrderTable> page);
|
||||
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
**/
|
||||
List<Map<String, Long>> getTypeCount(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("chooseStatus") String chooseStatus);
|
||||
}
|
||||
|
@ -81,6 +81,6 @@ public interface InspectionNewsMapper extends BaseMapper<InspectionNews>
|
||||
void addReadNum(Long id);
|
||||
IPage<InspectionNews> collectionNews(Page<InspectionNews> page, @Param("userId") Long userId,@Param("newsName")String newsName);
|
||||
Integer newMsgNum(@Param("partnerId") Long partnerId);
|
||||
IPage<InspectionNews> msgList(Page<InspectionNews> page, @Param("partnerId") Long partnerId);
|
||||
IPage<InspectionNews> msgList(Page<InspectionNews> page, @Param("ifShow") String ifShow);
|
||||
List<String> listGfClass(@Param("type") String type);
|
||||
}
|
||||
|
@ -128,5 +128,16 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
|
||||
* @param startTime 开始时间 非必传
|
||||
* @param endTime 结束时间 非必传
|
||||
**/
|
||||
IPage<OrderTable> getOrderByDate(String startTime, String endTime, Page<OrderTable> page);
|
||||
IPage<OrderTable> getOrderByDate(String startTime, String endTime, String chooseStatus, Page<OrderTable> page);
|
||||
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
**/
|
||||
Map<String, Long> getTypeCount(String startTime, String endTime, String chooseStatus);
|
||||
}
|
||||
|
@ -139,4 +139,12 @@ public interface IInspectionInfoService extends IService<InspectionInfo>
|
||||
List<RoleDO> getRoleList();
|
||||
|
||||
String easyPoiExport(String templatePath, String filename, Map<String, Object> data, HttpServletRequest request, HttpServletResponse response);
|
||||
|
||||
/**
|
||||
* 获得不同状态的数据的数量
|
||||
*
|
||||
* @author 小李
|
||||
* @date 16:22 2024/12/18
|
||||
**/
|
||||
Map<String, Long> getCountByType(Integer partnerId);
|
||||
}
|
||||
|
@ -1951,13 +1951,34 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
* @param endTime 结束时间 非必传
|
||||
**/
|
||||
@Override
|
||||
public IPage<OrderTable> getOrderByDate(String startTime, String endTime, Page<OrderTable> page){
|
||||
public IPage<OrderTable> getOrderByDate(String startTime, String endTime, String chooseStatus, Page<OrderTable> page){
|
||||
if (StringUtils.isEmpty(startTime)){
|
||||
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
}
|
||||
startTime = startTime + " 00:00:00";
|
||||
endTime = endTime + " 23:59:59";
|
||||
return baseMapper.getOrderByDate(startTime, endTime, page);
|
||||
return baseMapper.getOrderByDate(startTime, endTime, chooseStatus, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类计数
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:14 2024/12/16
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param chooseStatus 状态
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Long> getTypeCount(String startTime, String endTime, String chooseStatus){
|
||||
if (StringUtils.isEmpty(startTime)){
|
||||
startTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
endTime = DateUtil.format(new Date(), "yyyy-MM-dd");
|
||||
}
|
||||
startTime = startTime + " 00:00:00";
|
||||
endTime = endTime + " 23:59:59";
|
||||
List<Map<String, Long>> typeCount = baseMapper.getTypeCount(startTime, endTime, chooseStatus);
|
||||
return typeCount.stream().collect(Collectors.toMap(map -> String.valueOf(map.get("type")), map -> map.get("count")));
|
||||
}
|
||||
}
|
||||
|
@ -9,9 +9,11 @@ import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.afterturn.easypoi.word.WordExportUtil;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@ -597,7 +599,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
wrapper.eq(InspectionWorkNode::getStatus, status);
|
||||
}
|
||||
InspectionInfo inspectionInfo = baseMapper.selectById(id);
|
||||
if (!inspectionInfo.getLeadManId().equals(userId)) {
|
||||
if (ObjectUtil.isEmpty(inspectionInfo.getLeadManId()) || !inspectionInfo.getLeadManId().equals(userId)) {
|
||||
wrapper.in(InspectionWorkNode::getRoleId, roleIds);
|
||||
}
|
||||
List<InspectionWorkNode> workNodes = workNodeService.list(wrapper);
|
||||
@ -623,26 +625,26 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
/**
|
||||
* 判断是否可以修改引车员
|
||||
*
|
||||
* @param id 工单ID
|
||||
* @author 小李
|
||||
* @date 15:22 2024/12/11
|
||||
* @param id 工单ID
|
||||
**/
|
||||
@Override
|
||||
public Boolean judgeUpdateLeadMan(Long id){
|
||||
public Boolean judgeUpdateLeadMan(Long id) {
|
||||
boolean result = true;
|
||||
InspectionInfo inspectionInfo = baseMapper.selectById(id);
|
||||
if (!inspectionInfo.getStatus().equals("2")){
|
||||
if (!inspectionInfo.getStatus().equals("2")) {
|
||||
result = false;
|
||||
}
|
||||
if (!result){
|
||||
if (!result) {
|
||||
List<InspectionWorkNode> list = workNodeService.list(new LambdaQueryWrapper<InspectionWorkNode>().eq(InspectionWorkNode::getInspectionInfoId, id));
|
||||
Set<String> status = list.stream().map(InspectionWorkNode::getStatus).collect(Collectors.toSet());
|
||||
if (status.contains("3")){
|
||||
if (status.contains("3")) {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
if (result){
|
||||
result = inspectionInfo.getCreator().equals(SecurityFrameworkUtils.getLoginUserId()+"");
|
||||
if (result) {
|
||||
result = inspectionInfo.getCreator().equals(SecurityFrameworkUtils.getLoginUserId() + "");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -663,6 +665,7 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
|
||||
/**
|
||||
* EasyPoi 替换数据 导出 word
|
||||
*
|
||||
* @param templatePath word模板地址
|
||||
* @param filename 文件名称
|
||||
* @param data 替换参数
|
||||
@ -691,10 +694,71 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
public static MultipartFile convertXWPFDocumentToMultipartFile(XWPFDocument document, String filename) throws IOException {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
document.write(bos);
|
||||
byte[] bytes = bos.toByteArray();
|
||||
return new MockMultipartFile(filename, filename, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得不同状态的数据的数量
|
||||
*
|
||||
* @author 小李
|
||||
* @date 16:22 2024/12/18
|
||||
**/
|
||||
@Override
|
||||
public Map<String, Long> getCountByType(Integer partnerId) {
|
||||
// 创建线程池
|
||||
ExecutorService executor = Executors.newFixedThreadPool(6);
|
||||
|
||||
try {
|
||||
InspectionInfo inspectionInfo = new InspectionInfo();
|
||||
inspectionInfo.setPartnerId(partnerId.longValue());
|
||||
|
||||
// 获取当前登录人
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
// 获取当前登陆人的角色
|
||||
List<UserRoleDO> byUserId = roleService.getByUserId(loginUser.getId());
|
||||
inspectionInfo.setLeadManId(loginUser.getId());
|
||||
List<Long> roleIds = byUserId.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList());
|
||||
if (!"1".equals(inspectionInfo.getStatus())) {
|
||||
// 进行中 已完成
|
||||
inspectionInfo.setDealUserId(loginUser.getId());
|
||||
}
|
||||
|
||||
Map<String, Long> result = new ConcurrentHashMap<>(); // 使用ConcurrentHashMap以确保线程安全
|
||||
|
||||
// 定义一个数组来保存所有的CompletableFuture
|
||||
CompletableFuture<Void>[] futures = new CompletableFuture[6];
|
||||
|
||||
for (int i = 0; i < 6; i++) {
|
||||
final String status = String.valueOf(i);
|
||||
|
||||
// 复制一份inspectionInfo对象,避免多线程修改同一个对象导致的问题
|
||||
InspectionInfo infoCopy = BeanUtil.toBean(inspectionInfo, InspectionInfo.class);
|
||||
infoCopy.setStatus(status);
|
||||
|
||||
// 为每个任务创建一个新的Page对象
|
||||
Page<InspectionInfo> page = new Page<>(1, 10);
|
||||
|
||||
futures[i] = CompletableFuture.runAsync(() -> {
|
||||
IPage<InspectionInfo> iPage = baseMapper.selectByUser(page, roleIds, infoCopy);
|
||||
result.put(status, iPage.getTotal());
|
||||
}, executor);
|
||||
}
|
||||
|
||||
// 等待所有任务完成
|
||||
CompletableFuture.allOf(futures).join();
|
||||
|
||||
return result;
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("Failed to execute tasks in parallel", e);
|
||||
} finally {
|
||||
// 关闭线程池
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,10 +4,15 @@ import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
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.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -28,6 +33,8 @@ import cn.iocoder.yudao.module.inspection.utils.HtmlFilter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】Service业务层处理
|
||||
*
|
||||
@ -44,6 +51,10 @@ public class InspectionNewsServiceImpl extends ServiceImpl<InspectionNewsMapper,
|
||||
private AdminUserService userService;
|
||||
@Autowired
|
||||
private IInspectionNewsCommentService commentService;
|
||||
@Resource
|
||||
private PermissionApi permissionApi;
|
||||
@Resource
|
||||
private RoleApi roleApi;
|
||||
|
||||
/**
|
||||
* 查询【请填写功能名称】
|
||||
@ -106,7 +117,7 @@ public class InspectionNewsServiceImpl extends ServiceImpl<InspectionNewsMapper,
|
||||
public int insertInspectionNews(InspectionNews inspectionNews)
|
||||
{
|
||||
|
||||
return baseMapper.insertInspectionNews(inspectionNews);
|
||||
return baseMapper.insert(inspectionNews);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -266,9 +277,27 @@ public class InspectionNewsServiceImpl extends ServiceImpl<InspectionNewsMapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
@TenantIgnore
|
||||
// @TenantIgnore
|
||||
public IPage<InspectionNews> msgList(Page<InspectionNews> page, Long partnerId) {
|
||||
IPage<InspectionNews> news = baseMapper.msgList(page, partnerId);
|
||||
List<Long> roleIdsByUserId = permissionApi.getRoleIdsByUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
List<RoleReqDTO> roleList = roleApi.getRoleList();
|
||||
List<RoleReqDTO> collect = roleList.stream().filter(item -> roleIdsByUserId.contains(item.getId())).collect(Collectors.toList());
|
||||
String ifShow = "";
|
||||
if (CollUtil.isNotEmpty(collect)){
|
||||
List<String> collect1 = collect.stream().map(RoleReqDTO::getCode).collect(Collectors.toList());
|
||||
// 检测用户
|
||||
if (collect1.contains("jcyh")){
|
||||
ifShow = "user";
|
||||
}
|
||||
// else if (collect1.contains("jcgf") || collect1.contains("jcshop") || collect1.contains("dealers") || collect1.contains("partners")){
|
||||
// // 检测官方 检测商户 经销商 合作商
|
||||
// ifShow = "";
|
||||
// }
|
||||
else {
|
||||
ifShow = "staff";
|
||||
}
|
||||
}
|
||||
IPage<InspectionNews> news = baseMapper.msgList(page, ifShow);
|
||||
news.getRecords().forEach(it->{
|
||||
it.setNewsContent(HtmlFilter.dealFunction(it.getNewsContent()));
|
||||
});
|
||||
|
@ -213,7 +213,8 @@ where sig.partner_id =#{partnerId}
|
||||
<select id="inspectionList" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
SELECT
|
||||
info.id,info.worker_name,info.worker_phone,info.worker_avatar,info.`status`,info.is_pass,info.start_time,info.end_time,step.title as lastTitle,
|
||||
su.nickname buyName,su.mobile as buyPhone,oi.order_no as orderNo,oi.pay_money+oi.balance as realPayMoney,oi.goods_title as goodsName,info.car_num,info.is_retrial
|
||||
su.nickname buyName,su.mobile as buyPhone,oi.order_no as orderNo,oi.pay_money+oi.balance as realPayMoney,oi.goods_title as goodsName,info.car_num,info.is_retrial,
|
||||
info.customer_source as customerSource, info.other_phone as otherPhone,oi.sku_id as skuId, oi.sku_name as skuName,oi.goods_price as goodsPrice
|
||||
from
|
||||
inspection_info info
|
||||
LEFT JOIN inspection_step_info step ON info.id = step.inspection_info_id
|
||||
@ -574,6 +575,78 @@ FROM
|
||||
ii.id = iwn_agg.inspection_info_id
|
||||
WHERE oi.create_time BETWEEN #{startTime} AND #{endTime}
|
||||
AND oi.deleted = '0') t
|
||||
<where>
|
||||
<choose>
|
||||
<when test="chooseStatus == '2'.toString()">
|
||||
t.status = '检测中'
|
||||
</when>
|
||||
<when test="chooseStatus == '3'.toString()">
|
||||
t.status = '已完成'
|
||||
</when>
|
||||
</choose>
|
||||
</where>
|
||||
ORDER BY t.create_time DESC
|
||||
</select>
|
||||
|
||||
<select id="getTypeCount" resultType="java.util.Map">
|
||||
SELECT t2.type as type, COUNT(*) as count FROM (
|
||||
SELECT t.id,
|
||||
t.carNum,
|
||||
t.type,
|
||||
t.pay,
|
||||
t.payType,
|
||||
CASE
|
||||
WHEN t.status = '已完成' AND t.is_pass = 0 THEN '不合格'
|
||||
WHEN t.status = '已完成' AND t.is_pass = 1 THEN '合格'
|
||||
WHEN t.status = '已完成' THEN '未知'
|
||||
ELSE ''
|
||||
END AS result,
|
||||
t.status
|
||||
FROM (SELECT ii.id,
|
||||
ii.car_num AS carNum,
|
||||
oi.sku_name AS type,
|
||||
oi.pay_type as payType,
|
||||
CASE
|
||||
WHEN oi.pay_type IS NULL THEN '未支付'
|
||||
ELSE '已支付'
|
||||
END AS pay,
|
||||
CASE
|
||||
WHEN oi.pay_type IS NOT NULL THEN '已完成'
|
||||
WHEN has_status_0_or_null THEN '检测中'
|
||||
WHEN (ii.status = 0 OR ii.status = 2) AND has_status_1 THEN '检测中'
|
||||
WHEN (COALESCE(max_iwn_status, 0) = 2 OR ii.status = 1) THEN '已完成'
|
||||
WHEN (ii.status = 0 OR ii.status = 2) AND COALESCE(max_iwn_status, 0) = 0 THEN '待检测'
|
||||
ELSE '未知状态' -- 这是为了处理任何未预期的情况
|
||||
END AS status,
|
||||
ii.is_pass,
|
||||
COALESCE(max_iwn_status, 0) AS max_iwn_status,
|
||||
oi.create_time
|
||||
FROM order_info oi
|
||||
INNER JOIN
|
||||
inspection_info ii
|
||||
ON
|
||||
oi.id = ii.inspection_order_id
|
||||
LEFT JOIN (SELECT inspection_info_id,
|
||||
MAX(COALESCE(status, 0)) AS max_iwn_status,
|
||||
MAX(CASE WHEN COALESCE(status, 0) = 1 THEN 1 ELSE 0 END) AS has_status_1,
|
||||
MAX(CASE WHEN COALESCE(status, 0) = 0 THEN 1 ELSE 0 END) AS has_status_0_or_null
|
||||
FROM inspection_work_node
|
||||
GROUP BY inspection_info_id) iwn_agg
|
||||
ON
|
||||
ii.id = iwn_agg.inspection_info_id
|
||||
WHERE oi.create_time BETWEEN #{startTime} AND #{endTime}
|
||||
AND oi.deleted = '0') t
|
||||
<where>
|
||||
<choose>
|
||||
<when test="chooseStatus == '2'.toString()">
|
||||
t.status = '检测中'
|
||||
</when>
|
||||
<when test="chooseStatus == '3'.toString()">
|
||||
t.status = '已完成'
|
||||
</when>
|
||||
</choose>
|
||||
</where>
|
||||
) t2
|
||||
GROUP BY t2.type
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -8,13 +8,24 @@ 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 * from inspection_equ_info
|
||||
select * from inspection_equ_info
|
||||
<where>
|
||||
<if test="inspectionEquInfo.equName != null and inspectionEquInfo.equName != ''"> and equ_name like concat('%', #{inspectionEquInfo.equName}, '%')</if>
|
||||
<if test="inspectionEquInfo.equModel != null and inspectionEquInfo.equModel != ''"> and equ_model like concat('%', #{inspectionEquInfo.equModel}, '%')</if>
|
||||
<if test="inspectionEquInfo.equNumber != null and inspectionEquInfo.equNumber != ''"> and equ_number like concat('%', #{inspectionEquInfo.equNumber}, '%')</if>
|
||||
<if test="inspectionEquInfo.equName != null and inspectionEquInfo.equName != ''">and equ_name like
|
||||
concat('%', #{inspectionEquInfo.equName}, '%')
|
||||
</if>
|
||||
<if test="inspectionEquInfo.equModel != null and inspectionEquInfo.equModel != ''">and equ_model like
|
||||
concat('%', #{inspectionEquInfo.equModel}, '%')
|
||||
</if>
|
||||
<if test="inspectionEquInfo.equNumber != null and inspectionEquInfo.equNumber != ''">and equ_number like
|
||||
concat('%', #{inspectionEquInfo.equNumber}, '%')
|
||||
</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>
|
||||
and next_check_time between #{inspectionEquInfo.params.beginNextCheckTime} and
|
||||
#{inspectionEquInfo.params.endNextCheckTime}
|
||||
</if>
|
||||
<if test="inspectionEquInfo.type != null and inspectionEquInfo.type != ''">
|
||||
and `type` = #{inspectionEquInfo.type}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
@ -409,5 +409,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<!-- </if>-->
|
||||
<!-- </where>-->
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -167,8 +167,14 @@
|
||||
news.*,IF(ina.id is null,0,1) as isRead
|
||||
FROM
|
||||
inspection_news news
|
||||
left JOIN inspection_news_association ina ON ina.news_id = news.id and ina.user_id = #{partnerId} and ina.type = 'read'
|
||||
WHERE news.category = 'jcztz' or news.category = 'zflm'
|
||||
left JOIN inspection_news_association ina ON ina.news_id = news.id and ina.type = 'read'
|
||||
WHERE news.category = 'zflm'
|
||||
<if test="ifShow != null and ifShow != ''">
|
||||
or news.category = 'jcztz'
|
||||
or news.type = #{ifShow}
|
||||
or news.type = 'null'
|
||||
</if>
|
||||
group by news.id
|
||||
order by isRead,news.create_time desc
|
||||
</select>
|
||||
<select id="listGfClass" resultType="java.lang.String">
|
||||
|
@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectWarnMessageList" resultType="cn.iocoder.yudao.module.inspection.entity.WarnMessage">
|
||||
select * from warn_message
|
||||
<where>
|
||||
and warn_time <![CDATA[<=]]> NOW()
|
||||
and warn_time <![CDATA[<=]]> NOW() and deleted = '0'
|
||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||
<if test="partnerId != null "> and partner_id = #{partnerId}</if>
|
||||
<if test="isRead != null and isRead != ''"> and is_read = #{isRead}</if>
|
||||
|
@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.rescue.domain.RescueInfo;
|
||||
import cn.iocoder.yudao.module.rescue.dto.DriverInfo2Dto;
|
||||
import cn.iocoder.yudao.module.rescue.dto.DriverInfoDto;
|
||||
import cn.iocoder.yudao.module.rescue.service.IRescueInfoService;
|
||||
import cn.iocoder.yudao.module.rescue.utils.StringUtils;
|
||||
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;
|
||||
@ -249,4 +250,21 @@ public class RescueInfoController extends BaseController {
|
||||
public CommonResult statisticsInfo(String type) {
|
||||
return success(rescueInfoService.statisticsInfo(type));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/toRepair")
|
||||
public CommonResult toRepair(Long id) {
|
||||
RescueInfo rescueInfo = rescueInfoService.getById(id);
|
||||
if("1".equals(rescueInfo.getIsWeiXiu())){
|
||||
return error("已转维修,请勿重复操作");
|
||||
}
|
||||
//创建维修订单
|
||||
|
||||
|
||||
|
||||
rescueInfo.setIsWeiXiu("1");
|
||||
rescueInfoService.updateRescueInfo(rescueInfo);
|
||||
return success(rescueInfo);
|
||||
}
|
||||
}
|
||||
|
@ -46,6 +46,14 @@ public class RescueInfo extends TenantBaseDO
|
||||
@Excel(name = "司机车牌号")
|
||||
private String driverCarNum;
|
||||
|
||||
/** 是否扣车 */
|
||||
@NotEmpty(message = "是否扣车不能为空")
|
||||
private String isKouChe;
|
||||
|
||||
/** 是否维修 */
|
||||
@NotEmpty(message = "是否维修不能为空")
|
||||
private String isWeiXiu;
|
||||
|
||||
/** 是否为预约单 */
|
||||
@NotEmpty(message = "是否为预约单不能为空")
|
||||
private String isAppointment;
|
||||
|
@ -40,4 +40,11 @@ public interface RoleApi {
|
||||
**/
|
||||
List<UserDTO> selectUserListByRoleCode(Long tenantId,String code);
|
||||
|
||||
/**
|
||||
* 通过角色id查询角色
|
||||
*
|
||||
* @author 小李
|
||||
* @date 13:21 2024/12/17
|
||||
**/
|
||||
Long selectListByRoleId();
|
||||
}
|
||||
|
@ -162,4 +162,13 @@ public interface AdminUserApi {
|
||||
**/
|
||||
void setOpenId(Long userId,String openId);
|
||||
|
||||
/**
|
||||
* 更新用户信息,慎用!
|
||||
*
|
||||
* @author 小李
|
||||
* @date 11:47 2024/12/20
|
||||
* @param newUser 新用户信息
|
||||
**/
|
||||
void updateUser(AdminUserRespDTO newUser);
|
||||
|
||||
}
|
||||
|
@ -3,8 +3,10 @@ package cn.iocoder.yudao.module.system.api.permission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -64,4 +66,19 @@ public class RoleApiImpl implements RoleApi {
|
||||
public List<UserDTO> selectUserListByRoleCode(Long tenantId,String code) {
|
||||
return roleService.selectByRoleCode(tenantId,code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过角色id查询角色
|
||||
*
|
||||
* @author 小李
|
||||
* @date 13:21 2024/12/17
|
||||
**/
|
||||
@Override
|
||||
public Long selectListByRoleId(){
|
||||
RolePageReqVO rolePageReqVO = new RolePageReqVO();
|
||||
rolePageReqVO.setPageNo(1);
|
||||
rolePageReqVO.setPageSize(1000);
|
||||
IPage<UserDTO> userDTOIPage = roleService.selectListByRoleId(rolePageReqVO);
|
||||
return userDTOIPage.getTotal();
|
||||
}
|
||||
}
|
||||
|
@ -195,4 +195,17 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
userService.setOpenId(userId, openId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新用户信息,慎用!
|
||||
*
|
||||
* @author 小李
|
||||
* @date 11:47 2024/12/20
|
||||
* @param newUser 新用户信息
|
||||
**/
|
||||
@Override
|
||||
public void updateUser(AdminUserRespDTO newUser){
|
||||
AdminUserDO bean = BeanUtil.toBean(newUser, AdminUserDO.class);
|
||||
userService.updateById(bean);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.config.CommonStr.SUPER_ADMIN_ID;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@ -349,8 +350,10 @@ public class RoleServiceImpl implements RoleService {
|
||||
*/
|
||||
@Override
|
||||
public List<RoleDO> pageByQuery(RoleDO roleDO) {
|
||||
return roleMapper.selectList(new LambdaQueryWrapper<RoleDO>()
|
||||
//去年检测用户
|
||||
List<RoleDO> roleDOS = roleMapper.selectList(new LambdaQueryWrapper<RoleDO>()
|
||||
.eq(RoleDO::getServicePackageId, roleDO.getServicePackageId()));
|
||||
return roleDOS.stream().filter(item -> !item.getCode().equals("jcyh")).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join system_user_role sr on su.id = sr.user_id
|
||||
left join system_role sr2 on sr.role_id = sr2.id
|
||||
<where>
|
||||
su.deleted = 0 and sr2.service_package_id = 'jiance'
|
||||
su.deleted = 0 and sr2.service_package_id = 'jiance' and sr2.code != 'jcyh'
|
||||
<if test="role.roleId != null">
|
||||
and sr.role_id = #{role.roleId}
|
||||
</if>
|
||||
|
Loading…
Reference in New Issue
Block a user