feat: 本部门保修单、报修单大厅、我的报修单、我的维修单

dev_fifo1.0
chenhc 1 year ago
parent 308f817e82
commit 46ae4e7141

@ -57,6 +57,25 @@ public class DeptUserController {
return ResultVOUtils.success(deptEntityPageSimpleResponse); return ResultVOUtils.success(deptEntityPageSimpleResponse);
} }
@AuthRuleAnnotation("")
@GetMapping("udi/auth/dept/user/list")
public BaseResponse filterListByDeptCode(FilterDeptUserReqeust filterDeptUserReqeust) {
//获取部门id
String idByCode = filterDeptUserReqeust.getDeptCode();
DeptEntity deptEntity = deptService.selectByCode(idByCode);
if (deptEntity.getLevel() == 1) {
filterDeptUserReqeust.setDeptId(null);
} else {
filterDeptUserReqeust.setDeptId(deptEntity.getId());
}
List<DeptUserResponse> deptEntityList = deptUserService.selectJoinDeptUser(filterDeptUserReqeust);
PageInfo<DeptUserResponse> pageInfo = new PageInfo<>(deptEntityList);
PageSimpleResponse<DeptUserResponse> deptEntityPageSimpleResponse = new PageSimpleResponse<>();
deptEntityPageSimpleResponse.setTotal(pageInfo.getTotal());
deptEntityPageSimpleResponse.setList(deptEntityList);
return ResultVOUtils.success(deptEntityPageSimpleResponse);
}
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("udi/auth/dept/user/delete") @PostMapping("udi/auth/dept/user/delete")

@ -33,5 +33,6 @@ public class DeptEntity {
private String thirdId4; private String thirdId4;
private boolean spUse; private boolean spUse;
private boolean maintenance;
} }

@ -73,6 +73,11 @@ public class DeviceRepairEntity {
*/ */
@TableField(value = "repairUserName") @TableField(value = "repairUserName")
private String repairUserName; private String repairUserName;
/**
*
*/
@TableField(value = "repairDeptCode")
private String repairDeptCode;
/** /**
* *
@ -247,4 +252,4 @@ public class DeviceRepairEntity {
*/ */
@TableField(value = "confirmRemark") @TableField(value = "confirmRemark")
private String confirmRemark; private String confirmRemark;
} }

@ -8,5 +8,6 @@ public class FilterDeptUserReqeust extends ListPageRequest {
private Long deptId; private Long deptId;
private Long userId; private Long userId;
private String deptName; private String deptName;
private String deptCode;
private String key; private String key;
} }

@ -33,4 +33,5 @@ public class FilterInvWarehouseRequest extends ListPageRequest {
private String subordinateCode;//下级 private String subordinateCode;//下级
private String superiorPcode;//上级 private String superiorPcode;//上级
private Integer type; private Integer type;
private Boolean maintenance;
} }

@ -14,7 +14,7 @@ public class DeviceInfoDetailQuery extends ListPageRequest {
@NotNull(message = "缺少必要参数") @NotNull(message = "缺少必要参数")
private DeviceStatusEnum status; private DeviceStatusEnum status;
@NotNull(message = "缺少必要参数") // @NotNull(message = "缺少必要参数")
private Boolean checkLock; private Boolean checkLock;
/** /**
@ -26,7 +26,7 @@ public class DeviceInfoDetailQuery extends ListPageRequest {
/** /**
* id * id
*/ */
@NotNull(message = "缺少必要参数") // @NotNull(message = "缺少必要参数")
private Long productId; private Long productId;
/** /**

@ -26,6 +26,8 @@ public class DeviceRepairApplyDetailDiagnosisParam {
String repairUserName; String repairUserName;
String repairDeptCode;
String repairUserPhone; String repairUserPhone;
public void valid() { public void valid() {
@ -33,6 +35,9 @@ public class DeviceRepairApplyDetailDiagnosisParam {
if (innerFlag == null) { if (innerFlag == null) {
throw new JsonException("请选择维修方式"); throw new JsonException("请选择维修方式");
} }
if (StrUtil.isBlank(repairDeptCode)) {
throw new JsonException("维修部门不能为空");
}
if (StrUtil.isBlank(repairUserName)) { if (StrUtil.isBlank(repairUserName)) {
throw new JsonException("维修人姓名不能为空"); throw new JsonException("维修人姓名不能为空");
} }
@ -43,6 +48,7 @@ public class DeviceRepairApplyDetailDiagnosisParam {
innerFlag = null; innerFlag = null;
repairUserName = null; repairUserName = null;
repairUserPhone = null; repairUserPhone = null;
repairDeptCode = null;
} }
} }

@ -24,4 +24,13 @@ public class DeviceRepairApplyQuery extends ListPageRequest {
*/ */
Long confirmUserId; Long confirmUserId;
/**
*
*/
String acceptInfo;
/**
*
*/
String repairInfo;
} }

@ -26,4 +26,5 @@ public class InvSubWarehouseResponse {
private Boolean lyInvType; private Boolean lyInvType;
private Boolean sgInvType; private Boolean sgInvType;
private Boolean maintenance;
} }

@ -87,7 +87,7 @@ public class DeviceRepairApplyDetailServiceImpl extends ServiceImpl<DeviceRepair
.setCreateUserId(user.getId()).setCreateUserName(user.getEmployeeName()) .setCreateUserId(user.getId()).setCreateUserName(user.getEmployeeName())
.setCreateDeptCode(user.getLocDeptCode()).setCreateDeptName(user.getDeptName()) .setCreateDeptCode(user.getLocDeptCode()).setCreateDeptName(user.getDeptName())
.setCreateTime(now).setDiagnosisInfo(param.getDiagnosisInfo()).setInnerFlag(param.getInnerFlag()) .setCreateTime(now).setDiagnosisInfo(param.getDiagnosisInfo()).setInnerFlag(param.getInnerFlag())
.setRepairUserName(param.getRepairUserName()).setRepairUserPhone(param.getRepairUserPhone()) .setRepairUserName(param.getRepairUserName()).setRepairUserPhone(param.getRepairUserPhone()).setRepairDeptCode(param.getRepairDeptCode())
; ;
deviceRepairService.createRepair(repairEntity); deviceRepairService.createRepair(repairEntity);
} }

@ -1,6 +1,8 @@
package com.glxp.api.service.dev.impl; package com.glxp.api.service.dev.impl;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -24,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.List; import java.util.List;
/** /**
@ -43,16 +46,43 @@ public class DeviceRepairApplyServiceImpl extends ServiceImpl<DeviceRepairApplyM
@Override @Override
public List<DeviceRepairApplyEntity> pageList(DeviceRepairApplyQuery query) { public List<DeviceRepairApplyEntity> pageList(DeviceRepairApplyQuery query) {
String acceptInfo = query.getAcceptInfo();
String repairInfo = query.getRepairInfo();
if (query.getPage() != null) { if (query.getPage() != null) {
PageHelper.startPage(query.getPage(), query.getLimit()); PageHelper.startPage(query.getPage(), query.getLimit());
} }
List<DeviceRepairApplyEntity> list = super.list(Wrappers.lambdaQuery(DeviceRepairApplyEntity.class) LambdaQueryWrapper<DeviceRepairApplyEntity> wrapper = Wrappers.lambdaQuery(DeviceRepairApplyEntity.class);
.eq(query.getApplyId() != null, DeviceRepairApplyEntity::getId, query.getApplyId()) wrapper.eq(query.getApplyId() != null, DeviceRepairApplyEntity::getId, query.getApplyId())
.eq(query.getStatus() != null, DeviceRepairApplyEntity::getStatus, query.getStatus()) .eq(query.getStatus() != null, DeviceRepairApplyEntity::getStatus, query.getStatus())
.eq(query.getConfirmUserId() != null, DeviceRepairApplyEntity::getConfirmUserId, query.getConfirmUserId()) .eq(query.getConfirmUserId() != null, DeviceRepairApplyEntity::getConfirmUserId, query.getConfirmUserId())
.eq(StrUtil.isNotBlank(query.getApplyDeptCode()), DeviceRepairApplyEntity::getApplyDeptCode, query.getApplyDeptCode()) .eq(StrUtil.isNotBlank(query.getApplyDeptCode()), DeviceRepairApplyEntity::getApplyDeptCode, query.getApplyDeptCode())
.orderByDesc(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyEntity::getApplyTime) .orderByDesc(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyEntity::getApplyTime);
); if (StringUtils.isNotBlank(acceptInfo)){
wrapper.and(warpper->warpper.like(DeviceRepairApplyEntity::getConfirmDeptCode, acceptInfo)
.or()
.like(DeviceRepairApplyEntity::getConfirmDeptName, acceptInfo)
.or()
.like(DeviceRepairApplyEntity::getConfirmUserId, acceptInfo)
.or()
.like(DeviceRepairApplyEntity::getConfirmUserName, acceptInfo)
.or()
.like(DeviceRepairApplyEntity::getConfirmPhone, acceptInfo));
}
if (StringUtils.isNotBlank(repairInfo)){
wrapper.and(warpper->warpper.like(DeviceRepairApplyEntity::getApplyDeptCode, repairInfo)
.or()
.like(DeviceRepairApplyEntity::getApplyDeptName, repairInfo)
.or()
.like(DeviceRepairApplyEntity::getApplyUserId, repairInfo)
.or()
.like(DeviceRepairApplyEntity::getApplyUserName, repairInfo)
.or()
.like(DeviceRepairApplyEntity::getApplyUserPhone, repairInfo)
.or()
.like(DeviceRepairApplyEntity::getId, repairInfo));
}
List<DeviceRepairApplyEntity> list = super.list(wrapper);
return list; return list;
} }

@ -38,6 +38,9 @@
<if test="spUse != null"> <if test="spUse != null">
AND a.spUse = #{spUse} AND a.spUse = #{spUse}
</if> </if>
<if test="maintenance != null">
AND a.maintenance = #{maintenance}
</if>
</where> </where>
@ -197,7 +200,7 @@
replace replace
INTO auth_dept INTO auth_dept
(id,pid, code, `name`, advanceType, isDefault, (id,pid, code, `name`, advanceType, isDefault,
status, updateTime, remark,`level`,pcode,spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4) status, updateTime, remark,`level`,pcode,spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4,maintenance)
values ( values (
#{id}, #{id},
#{pid}, #{pid},
@ -215,7 +218,8 @@
#{thirdId1}, #{thirdId1},
#{thirdId2}, #{thirdId2},
#{thirdId3}, #{thirdId3},
#{thirdId4} #{thirdId4},
#{maintenance}
) )
</insert> </insert>
@ -245,6 +249,7 @@
<if test="thirdId3 != null">remark=#{thirdId3},</if> <if test="thirdId3 != null">remark=#{thirdId3},</if>
<if test="thirdId4 != null">remark=#{thirdId4},</if> <if test="thirdId4 != null">remark=#{thirdId4},</if>
<if test="spUse != null">spUse=#{spUse},</if> <if test="spUse != null">spUse=#{spUse},</if>
<if test="maintenance != null">maintenance=#{maintenance},</if>
</trim> </trim>

@ -2462,6 +2462,20 @@ CALL Pro_Temp_ColumnWork('device_info', 'assetReserveType',
CALL Pro_Temp_ColumnWork('device_plan', 'status', 'tinyint NULL DEFAULT NULL COMMENT ''设备巡检计划状态 1草稿2.已提交''', 1); CALL Pro_Temp_ColumnWork('device_plan', 'status', 'tinyint NULL DEFAULT NULL COMMENT ''设备巡检计划状态 1草稿2.已提交''', 1);
INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`,
`visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`)
VALUES (2094, '我的报修单', 1703, 11, '/dev/deviceRepairApplyMy', 'dev/deviceRepairApplyMy',
NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-11-29 18:00:49', NULL, NULL, NULL);
CALL Pro_Temp_ColumnWork('auth_dept', 'maintenance',
' tinyint(0) ZEROFILL NULL COMMENT''是否为维修部门''',
1);
CALL Pro_Temp_ColumnWork('device_repair', 'repairDeptCode',
'varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修部门''',
1);
CALL Pro_Temp_ColumnWork('device_check_detail', 'normalFlag', 'tinyint NULL DEFAULT NULL COMMENT ''巡检状态 0异常1.正常''', 1); CALL Pro_Temp_ColumnWork('device_check_detail', 'normalFlag', 'tinyint NULL DEFAULT NULL COMMENT ''巡检状态 0异常1.正常''', 1);

Loading…
Cancel
Save