更新
This commit is contained in:
parent
a56689848b
commit
018faeb051
@ -81,5 +81,17 @@ public class DlInspectionProjectController {
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目排序
|
||||
* @param updateReqVO
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/updateSort")
|
||||
public CommonResult updateSort(@RequestBody DlInspectionProjectSaveReqVO updateReqVO) {
|
||||
dlInspectionProjectService.updateSort(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -255,6 +255,7 @@ public class InspectionInfoController extends BaseController {
|
||||
@PostMapping("recheck")
|
||||
public CommonResult recheck(@RequestBody InspectionWorkNode inspectionWorkNode){
|
||||
inspectionWorkNodeService.recheck(inspectionWorkNode);
|
||||
//发送消息提醒
|
||||
return success("操作成功");
|
||||
}
|
||||
|
||||
|
@ -11,12 +11,16 @@ import cn.iocoder.yudao.module.partner.entity.PartnerBalanceDetail;
|
||||
import cn.iocoder.yudao.module.partner.entity.PartnerWorker;
|
||||
import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
||||
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.data.DictDataSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dict.vo.type.DictTypeSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictDataDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dict.DictTypeDO;
|
||||
import cn.iocoder.yudao.module.system.service.dict.DictDataService;
|
||||
import cn.iocoder.yudao.module.system.service.dict.DictTypeService;
|
||||
import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -48,6 +52,8 @@ public class PartnerOwnController extends BaseController {
|
||||
private DictTypeService dictTypeService;
|
||||
@Autowired
|
||||
private DictDataService dictDataService;
|
||||
@Autowired
|
||||
private RoleService roleService;
|
||||
|
||||
/**
|
||||
* 获取店铺详情
|
||||
@ -384,13 +390,19 @@ public class PartnerOwnController extends BaseController {
|
||||
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())){
|
||||
return null;
|
||||
}
|
||||
Page<LabelRespVO> page = new Page<>(pageNum, pageSize);
|
||||
IPage<PartnerWorker> workList = partnerList.pageWorkList(partnerId,postId, workName, phoneNum,page);
|
||||
return CommonResult.success(workList);
|
||||
// ShopMallPartners partnersTmp = partnerList.getById(partnerId);
|
||||
// if (!partnersTmp.getUserId().equals(user.getId())){
|
||||
// return null;
|
||||
// }
|
||||
/*获取检测的用户*/
|
||||
RolePageReqVO reqVO = new RolePageReqVO();
|
||||
reqVO.setPageNo(pageNum);
|
||||
reqVO.setNickname(workName);
|
||||
reqVO.setPageSize(pageSize);
|
||||
IPage<UserDTO> userDTOIPage = roleService.selectListByRoleId(reqVO);
|
||||
// Page<LabelRespVO> page = new Page<>(pageNum, pageSize);
|
||||
// IPage<PartnerWorker> workList = partnerList.pageWorkList(partnerId,postId, workName, phoneNum,page);
|
||||
return CommonResult.success(userDTOIPage);
|
||||
}
|
||||
|
||||
@PostMapping("/delWorker")
|
||||
@ -455,11 +467,11 @@ public class PartnerOwnController extends BaseController {
|
||||
//获取到店预约的数据
|
||||
@GetMapping("/getAppointmentList")
|
||||
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;
|
||||
}
|
||||
// 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);
|
||||
return success(appointments);
|
||||
@ -469,10 +481,10 @@ public class PartnerOwnController extends BaseController {
|
||||
@GetMapping("/getPickCarList")
|
||||
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;
|
||||
}
|
||||
// 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);
|
||||
return success(pickCarList);
|
||||
@ -542,14 +554,14 @@ public class PartnerOwnController extends BaseController {
|
||||
@RequestParam(value ="pageSize" ,required = false ,defaultValue = "10") Integer pageSize) {
|
||||
LoginUser user = SecurityFrameworkUtils.getLoginUser();
|
||||
// .eq(PartnerWorker::getUserId,user.getId())
|
||||
LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PartnerWorker::getPartnerId,partnerId);
|
||||
PartnerWorker worker = partnerWorkerService.getOne(queryWrapper);
|
||||
if (ObjectUtil.isEmpty(worker)){
|
||||
return null;
|
||||
}
|
||||
// LambdaQueryWrapper<PartnerWorker> queryWrapper =new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(PartnerWorker::getPartnerId,partnerId);
|
||||
// PartnerWorker worker = partnerWorkerService.getOne(queryWrapper);
|
||||
// if (ObjectUtil.isEmpty(worker)){
|
||||
// return null;
|
||||
// }
|
||||
Page<InspectionPickCar> page = new Page<>(pageNum, pageSize);
|
||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarListOfWorker(page,worker.getId(),phoneNum);
|
||||
IPage<InspectionPickCar> pickCarList = partnerList.getPickCarListOfWorker(page,user.getId(),phoneNum);
|
||||
return success(pickCarList);
|
||||
}
|
||||
|
||||
|
@ -165,4 +165,6 @@ public class InspectionInfo extends TenantBaseDO
|
||||
private String projectName;
|
||||
@TableField(exist = false)
|
||||
private String leadManName;
|
||||
@TableField(exist = false)
|
||||
private Integer additionalRecording;
|
||||
}
|
||||
|
@ -31,6 +31,12 @@ public interface DlInspectionProjectService extends IService<DlInspectionProject
|
||||
*/
|
||||
void updateDlInspectionProject(@Valid DlInspectionProjectSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 更新排序
|
||||
* @param updateReqVO
|
||||
*/
|
||||
void updateSort(DlInspectionProjectSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除检测项目
|
||||
*
|
||||
|
@ -21,6 +21,7 @@ import cn.iocoder.yudao.module.partner.service.IPartnerWorkerService;
|
||||
import cn.iocoder.yudao.module.payment.entity.OrderInfo;
|
||||
import cn.iocoder.yudao.module.payment.entity.OrderInfoDetail;
|
||||
import cn.iocoder.yudao.module.payment.service.IOrderInfoDetailService;
|
||||
import cn.iocoder.yudao.module.shop.service.IShopMallPartnersService;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.post.PostPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.PostDO;
|
||||
@ -121,6 +122,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
private AdminUserService adminUserService;
|
||||
@Autowired
|
||||
private IInspectionWorkNodeService inspectionWorkNodeService;
|
||||
@Autowired
|
||||
private IShopMallPartnersService partnersService;
|
||||
|
||||
@Override
|
||||
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
|
||||
@ -1681,8 +1684,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
|
||||
InspectionPickCar pickCar = pickCarService.getById(dataId);
|
||||
//获取已经指派了的修理工
|
||||
if (null!=pickCar.getWorkerId()){
|
||||
PartnerWorker worker = partnerWorkerService.getById(pickCar.getWorkerId());
|
||||
AdminUserDO user = userService.getUser(worker.getUserId());
|
||||
// PartnerWorker worker = partnerWorkerService.getById(pickCar.getWorkerId());
|
||||
AdminUserDO user = userService.getUser(pickCar.getWorkerId());
|
||||
pickCar.setWorkerName(user.getNickname());
|
||||
pickCar.setWorkerPhone(user.getMobile());
|
||||
pickCar.setWorkerAvatar(user.getAvatar());
|
||||
|
@ -81,6 +81,18 @@ public class DlInspectionProjectServiceImpl extends ServiceImpl<DlInspectionProj
|
||||
projectRoyaltyService.batchInsertProjectRoyalty(collect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新排序
|
||||
*
|
||||
* @param updateReqVO
|
||||
*/
|
||||
@Override
|
||||
public void updateSort(DlInspectionProjectSaveReqVO updateReqVO) {
|
||||
DlInspectionProject updateObj = BeanUtils.toBean(updateReqVO, DlInspectionProject.class);
|
||||
dlInspectionProjectMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteDlInspectionProject(String id) {
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.inspection.service.impl;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@ -191,7 +192,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
inspectionInfo.setStartTime(new Date());
|
||||
}
|
||||
inspectionInfo.setCategoryId(goods.getGoodsCategoryId());
|
||||
|
||||
if (ObjectUtil.isNotNull(inspectionInfo.getAdditionalRecording()) && inspectionInfo.getAdditionalRecording() == 1){
|
||||
inspectionInfo.setStatus("1");
|
||||
inspectionInfo.setIsPass("1");
|
||||
inspectionInfo.setEndTime(inspectionInfo.getStartTime());
|
||||
}else {
|
||||
inspectionInfo.setStatus("0");
|
||||
}
|
||||
inspectionInfo.setWorkId(workerUser.getId());
|
||||
inspectionInfo.setYear(DateUtil.format(inspectionInfo.getStartTime(), "yyyy"));
|
||||
inspectionInfo.setMonth(DateUtil.format(inspectionInfo.getStartTime(), "yyyy-MM"));
|
||||
@ -236,23 +244,85 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
orderInfoDetailService.save(new OrderInfoDetail(orderInfo.getId(), "线下订单创建", new Date(), 0L, "1"));
|
||||
//默认当前流程的顺序为1
|
||||
inspectionInfo.setNowOrderNum(1);
|
||||
if (ObjectUtil.isNotNull(inspectionInfo.getAdditionalRecording()) && inspectionInfo.getAdditionalRecording() == 1) {
|
||||
//设置制证完成
|
||||
inspectionInfo.setMakeCert("1");
|
||||
}
|
||||
//添加检测工单
|
||||
baseMapper.insert(inspectionInfo);
|
||||
//补充检测流程
|
||||
List<InspectionWorkNode> inspectionWorkNodes = inspectionInfo.getInspectionWorkNodes();
|
||||
boolean save = false;
|
||||
//将检测工单流程补充检测工单id
|
||||
//如果是补录就将节点设置为已完成
|
||||
if (ObjectUtil.isNotNull(inspectionInfo.getAdditionalRecording()) && inspectionInfo.getAdditionalRecording() == 1) {
|
||||
inspectionWorkNodes.stream().forEach(inspectionWorkNode -> {
|
||||
//检测工单id
|
||||
inspectionWorkNode.setInspectionInfoId(inspectionInfo.getId());
|
||||
inspectionWorkNode.setCreateTime(inspectionInfo.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||
inspectionWorkNode.setUpdateTime(inspectionInfo.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime());
|
||||
|
||||
inspectionWorkNode.setStatus("2");
|
||||
inspectionWorkNode.setType("1");
|
||||
});
|
||||
|
||||
/*获取所有的检测项目 填充步骤*/
|
||||
List<InspectionStepInfo> inspectionStepInfos = new ArrayList<>();
|
||||
InspectionStepInfo inspectionStepInfoStrt = new InspectionStepInfo();
|
||||
inspectionStepInfoStrt.setTitle("检测开始");
|
||||
inspectionStepInfoStrt.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||
inspectionStepInfoStrt.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
inspectionStepInfoStrt.setUpdater(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
inspectionStepInfoStrt.setCreateTime(inspectionInfo.getStartTime());
|
||||
inspectionStepInfoStrt.setUpdateTime(inspectionInfo.getStartTime());
|
||||
inspectionStepInfos.add(inspectionStepInfoStrt);
|
||||
|
||||
for (InspectionWorkNode inspectionWorkNode : inspectionWorkNodes) {
|
||||
InspectionStepInfo inspectionStepInfo = new InspectionStepInfo();
|
||||
inspectionStepInfo.setTitle(inspectionWorkNode.getProjectName() + "项目检测完成");
|
||||
inspectionStepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||
inspectionStepInfo.setCreator(Integer.parseInt(String.valueOf(inspectionWorkNode.getDealUserId())));
|
||||
inspectionStepInfo.setUpdater(Integer.parseInt(String.valueOf(inspectionWorkNode.getDealUserId())));
|
||||
inspectionStepInfo.setCreateTime(inspectionInfo.getStartTime());
|
||||
inspectionStepInfo.setUpdateTime(inspectionInfo.getStartTime());
|
||||
|
||||
inspectionStepInfos.add(inspectionStepInfo);
|
||||
}
|
||||
InspectionStepInfo inspectionStepInfoEnd = new InspectionStepInfo();
|
||||
inspectionStepInfoEnd.setTitle("检测结束");
|
||||
inspectionStepInfoEnd.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||
inspectionStepInfoEnd.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
inspectionStepInfoEnd.setUpdater(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
inspectionStepInfoEnd.setCreateTime(inspectionInfo.getStartTime());
|
||||
inspectionStepInfoEnd.setUpdateTime(inspectionInfo.getStartTime());
|
||||
inspectionStepInfos.add(inspectionStepInfoEnd);
|
||||
save = inspectionStepInfoService.saveBatch(inspectionStepInfos);
|
||||
} else {
|
||||
inspectionWorkNodes.stream().forEach(inspectionWorkNode -> {
|
||||
//检测工单id
|
||||
inspectionWorkNode.setInspectionInfoId(inspectionInfo.getId());
|
||||
//将节点状态设置为未开始
|
||||
inspectionWorkNode.setStatus("0");
|
||||
});
|
||||
//检测步骤表插入检测开始
|
||||
InspectionStepInfo stepInfo = new InspectionStepInfo();
|
||||
stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||
stepInfo.setTitle("检测开始");
|
||||
stepInfo.setCreateTime(new Date());
|
||||
stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
save = inspectionStepInfoService.save(stepInfo);
|
||||
}
|
||||
|
||||
workNodeService.saveBatch(inspectionWorkNodes);
|
||||
//获取第一个节点的角色
|
||||
Integer roleId = inspectionWorkNodes.get(0).getRoleId();
|
||||
// //获取第一个节点的角色
|
||||
// Integer roleId = inspectionWorkNodes.get(0).getRoleId();
|
||||
List<Integer> roleIds = new ArrayList<>();
|
||||
/*获取所有的角色id*/
|
||||
if(CollUtil.isNotEmpty(inspectionWorkNodes)){
|
||||
roleIds = inspectionWorkNodes.stream().map(inspectionWorkNode -> inspectionWorkNode.getRoleId()).collect(Collectors.toList());
|
||||
}
|
||||
//根据角色id获取所有用户
|
||||
List<UserDTO> listByUserId = roleService.getListByUserId(roleId);
|
||||
List<UserDTO> listByUserId = roleService.getListByUserIds(roleIds);
|
||||
List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotNull(inspectionInfo.getLeadManId())) {
|
||||
ids.add(inspectionInfo.getLeadManId());
|
||||
@ -260,20 +330,14 @@ public class InspectionInfoServiceImpl extends ServiceImpl<InspectionInfoMapper,
|
||||
//给ids去重
|
||||
ids = ids.stream().distinct().collect(Collectors.toList());
|
||||
// 获取当前共单引车员的id
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
if (CollUtil.isNotEmpty(ids) && ObjectUtil.isNull(inspectionInfo.getAdditionalRecording())) {
|
||||
for (Long id : ids) {
|
||||
inspectionSocket.sendMessage("接工单", id.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//检测步骤表插入检测开始
|
||||
InspectionStepInfo stepInfo = new InspectionStepInfo();
|
||||
stepInfo.setInspectionInfoId(Integer.parseInt(String.valueOf(inspectionInfo.getId())));
|
||||
stepInfo.setTitle("检测开始");
|
||||
stepInfo.setCreateTime(new Date());
|
||||
stepInfo.setCreator(Integer.parseInt(String.valueOf(loginUser.getId())));
|
||||
boolean save = inspectionStepInfoService.save(stepInfo);
|
||||
|
||||
return save ? 1 : 0;
|
||||
}
|
||||
|
||||
|
@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
@ -320,6 +321,14 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
info.setIsPass("0");
|
||||
//更新工单表
|
||||
inspectionInfoService.updateById(info);
|
||||
|
||||
|
||||
// /*将当前步骤修改完已完成*/
|
||||
// if (ObjectUtil.isNotNull(workNodes.getId())) {
|
||||
// workNodes.setStatus("2");
|
||||
// baseMapper.updateById(workNodes);
|
||||
// }
|
||||
|
||||
// 添加步骤信息表
|
||||
InspectionStepInfo stepInfo = new InspectionStepInfo();
|
||||
stepInfo.setInspectionInfoId(Integer.parseInt(workNodes.getInspectionInfoId().toString()));
|
||||
@ -333,6 +342,27 @@ public class InspectionWorkNodeServiceImpl extends ServiceImpl<InspectionWorkNod
|
||||
stepInfo.setImages(workNodes.getDealImages());
|
||||
}
|
||||
inspectionStepService.save(stepInfo);
|
||||
|
||||
List<Integer> roleIds = new ArrayList<>();
|
||||
/*获取所有的角色id*/
|
||||
if(CollUtil.isNotEmpty(workNodes.getWorkNodes())){
|
||||
roleIds = workNodes.getWorkNodes().stream().map(inspectionWorkNode -> inspectionWorkNode.getRoleId()).collect(Collectors.toList());
|
||||
}
|
||||
//根据角色id获取所有用户
|
||||
List<UserDTO> listByUserId = roleService.getListByUserIds(roleIds);
|
||||
List<Long> ids = listByUserId.stream().map(UserDTO::getId).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotNull(info.getLeadManId())) {
|
||||
ids.add(info.getLeadManId());
|
||||
}
|
||||
//给ids去重
|
||||
ids = ids.stream().distinct().collect(Collectors.toList());
|
||||
// 获取当前共单引车员的id
|
||||
if (CollUtil.isNotEmpty(ids) && ObjectUtil.isNull(info.getAdditionalRecording())) {
|
||||
for (Long id : ids) {
|
||||
inspectionSocket.sendMessage("接工单", id.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -8,7 +8,7 @@
|
||||
</update>
|
||||
<update id="recheck">
|
||||
UPDATE inspection_work_node
|
||||
SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null
|
||||
SET status = '0', deal_user_id = null, deal_user_name = null, deal_images = null, remark = null,type = null
|
||||
WHERE id in (
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
#{item.id}
|
||||
@ -65,14 +65,14 @@
|
||||
AND node.deal_user_name LIKE CONCAT('%', #{inspectionWorkNode.dealUserName} , '%')
|
||||
</if>
|
||||
<if test="inspectionWorkNode.rescueStartMonth != null">
|
||||
AND DATE_FORMAT(info.end_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
|
||||
AND DATE_FORMAT(node.create_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
|
||||
</if>
|
||||
<if test="inspectionWorkNode.rescueStart != null and inspectionWorkNode.rescueEnd != null">
|
||||
AND info.end_time BETWEEN #{inspectionWorkNode.rescueStart} AND #{inspectionWorkNode.rescueEnd}
|
||||
AND node.create_time BETWEEN #{inspectionWorkNode.rescueStart} AND #{inspectionWorkNode.rescueEnd}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
info.end_time DESC;
|
||||
node.create_time DESC;
|
||||
</select>
|
||||
<select id="getRoyaltySum" resultType="java.util.Map">
|
||||
SELECT
|
||||
@ -109,10 +109,10 @@
|
||||
AND node.deal_user_name LIKE CONCAT('%', #{inspectionWorkNode.dealUserName} , '%')
|
||||
</if>
|
||||
<if test="inspectionWorkNode.rescueStartMonth != null">
|
||||
AND DATE_FORMAT(info.end_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
|
||||
AND DATE_FORMAT(node.create_time, '%Y-%m') = #{inspectionWorkNode.rescueStartMonth}
|
||||
</if>
|
||||
<if test="inspectionWorkNode.rescueStart != null and inspectionWorkNode.rescueEnd != null">
|
||||
AND info.end_time BETWEEN #{inspectionWorkNode.rescueStart} AND #{inspectionWorkNode.rescueEnd}
|
||||
AND node.create_time BETWEEN #{inspectionWorkNode.rescueStart} AND #{inspectionWorkNode.rescueEnd}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
|
@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="workOrder" resultType="cn.iocoder.yudao.module.inspection.entity.InspectionInfo">
|
||||
select ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
||||
select DISTINCT ins.*,oi.goods_title,su.nickname as buyName,su.mobile as buyPhone,oi.sku_name,oi.pay_money as realPayMoney
|
||||
,oi.pay_type,oi.order_status as orderStatus,oi.goods_id,oi.sku_id,oi.pay_time,oi.goods_price,ins.create_time
|
||||
from inspection_info ins
|
||||
left join order_info oi on oi.id = ins.inspection_order_id
|
||||
|
@ -178,4 +178,14 @@ public class UserController {
|
||||
return success(userService.importUserList(list, updateSupport));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过角色id查询用户列表
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectByRoleId")
|
||||
public CommonResult selectByRoleId(Long roleId){
|
||||
return success(userService.selectByRoleId(roleId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -53,4 +53,6 @@ public interface UserRoleMapper extends BaseMapperX<UserRoleDO> {
|
||||
* @return java.util.List<cn.iocoder.yudao.module.system.api.user.dto.UserRoleDTO>
|
||||
**/
|
||||
List<UserRoleDTO> userCodes(@Param("userIds") List<Long> userIds);
|
||||
|
||||
List<UserDTO> selectByRoleIds(@Param("roleIds") List<Integer> roleIds);
|
||||
}
|
||||
|
@ -82,4 +82,6 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
int updateCusInfo(@Param("entity") UserInfoVO userInfoVO);
|
||||
|
||||
AdminUserDO getUserByMobileTenantIgnore(String mobile);
|
||||
|
||||
List<AdminUserDO> selectByRoleId(Long roleId);
|
||||
}
|
||||
|
@ -182,4 +182,10 @@ public interface RoleService {
|
||||
* @return
|
||||
*/
|
||||
List<UserDTO> getListByUserId(Integer roleId);
|
||||
/**
|
||||
* 根据角色id查询用户
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
List<UserDTO> getListByUserIds(List<Integer> roleId);
|
||||
}
|
||||
|
@ -384,6 +384,19 @@ public class RoleServiceImpl implements RoleService {
|
||||
return userDTOS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据角色id查询用户
|
||||
*
|
||||
* @param roleIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<UserDTO> getListByUserIds(List<Integer> roleIds) {
|
||||
List<UserDTO> userDTOS = userRoleMapper.selectByRoleIds(roleIds);
|
||||
return userDTOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获得自身的代理对象,解决 AOP 生效问题
|
||||
*
|
||||
|
@ -285,4 +285,11 @@ public interface AdminUserService extends IService<AdminUserDO> {
|
||||
* @return java.util.List<cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO>
|
||||
**/
|
||||
List<AdminUserDO> selectListByPhoneStaff(String phone);
|
||||
|
||||
/**
|
||||
* 根据角色id查询用户
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
List<AdminUserDO> selectByRoleId(Long roleId);
|
||||
}
|
||||
|
@ -639,6 +639,17 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色id查询用户
|
||||
*
|
||||
* @param roleId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<AdminUserDO> selectByRoleId(Long roleId) {
|
||||
return baseMapper.selectByRoleId(roleId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 对密码进行加密
|
||||
*
|
||||
|
@ -86,4 +86,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND deleted = 0
|
||||
limit 1
|
||||
</select>
|
||||
<select id="selectByRoleId" resultType="cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
system_users
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
user_id
|
||||
FROM
|
||||
system_user_role
|
||||
WHERE
|
||||
role_id = #{roleId}
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
@ -62,4 +62,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE
|
||||
sur.role_id = #{roleId})
|
||||
</select>
|
||||
<select id="selectByRoleIds" resultType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
system_users
|
||||
WHERE
|
||||
id IN (
|
||||
SELECT
|
||||
user_id
|
||||
FROM
|
||||
system_user_role sur
|
||||
WHERE
|
||||
sur.role_id IN
|
||||
<foreach item="item" collection="roleIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue
Block a user