增加分管查询

main
gaoshuguang 2 years ago
parent cdf03bd72f
commit d0736ef763

@ -32,8 +32,12 @@ public class CorsConfig implements WebMvcConfigurer {
registry.addInterceptor(filterconfig)
.addPathPatterns("/**")
// 是否允许证书
.excludePathPatterns(
);
.excludePathPatterns("/index.html/**")
.excludePathPatterns("/index/**")
.excludePathPatterns("/assets/**")
.excludePathPatterns("/index**")
.excludePathPatterns("/WorkOrderCirculation**")
;
}

@ -0,0 +1,19 @@
package com.nmgs.workorder.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
* @author: shuguang
* @date: 20231116 9:47
* @description:
*/
@TableName("USER_STA_TABLE")
@Data
public class UserStaTable {
@TableField("MANNO")
private Integer manno;
@TableField("STANO")
private Integer stano;
}

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nmgs.workorder.entity.NameTable;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author: shuguang
* @date: 20231108 14:37
@ -11,4 +13,5 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface NameTableMapper extends BaseMapper<NameTable> {
List<NameTable> selectMyList(String whereSql);
}

@ -5,4 +5,9 @@
<mapper namespace="com.nmgs.workorder.mapper.NameTableMapper">
<select id="selectMyList" resultType="com.nmgs.workorder.entity.NameTable">
SELECT u.STANO,s.STANAME FROM (SELECT * FROM USER_STA_TABLE ${whereSql} ) u
LEFT JOIN (SELECT * FROM NAME_TABLE) s
on u.STANO=s.STANO
</select>
</mapper>

@ -0,0 +1,14 @@
package com.nmgs.workorder.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nmgs.workorder.entity.UserStaTable;
import org.apache.ibatis.annotations.Mapper;
/**
* @author: shuguang
* @date: 20231116 9:53
* @description:
*/
@Mapper
public interface UserStaTableMapper extends BaseMapper<UserStaTable> {
}

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.nmgs.workorder.mapper.UserStaTableMapper">
</mapper>

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nmgs.config.Constant;
import com.nmgs.util.DESUtil;
import com.nmgs.util.DateTimeUtil;
import com.nmgs.util.FileUtil;
import com.nmgs.util.PropertiesUtil;
@ -23,6 +24,7 @@ import com.nmgs.workorder.mapper.WorkInfoMapper;
import com.nmgs.workorder.service.WorkOrderService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
@ -269,15 +271,38 @@ public class WorkOrderServiceImpl implements WorkOrderService {
public List<NameTable> selectStaNoList(Map<String, Object> map) {
String uuid = UuidUtil.getUuid();
log.info("[uuid:{}]-根据用户信息{}查询所属的站信息", uuid, map);
QueryWrapper<NameTable> wrapper = new QueryWrapper<>();
//QueryWrapper<NameTable> wrapper = new QueryWrapper<>();
//if (ObjectUtils.isNotEmpty(map.get("userUnitClass"))) {
// String userUnitClass = (String) map.get("userUnitClass");
// String userStano = (String) map.get("userStano");
// if (Constant.STR_ONE.equals(userUnitClass)) {
// wrapper.eq("STANO", userStano);
// }
//}
//List<NameTable> nameTables = nameTableMapper.selectList(wrapper);
//log.info("[uuid:{}]-根据用户信息查询所属的站信息集合条数为{}", uuid, nameTables.size());
List<NameTable> nameTables = new ArrayList<>();
if (ObjectUtils.isNotEmpty(map.get("userUnitClass"))) {
String userUnitClass = (String) map.get("userUnitClass");
String userStano = (String) map.get("userStano");
if (Constant.STR_ONE.equals(userUnitClass)) {
wrapper.eq("STANO", userStano);
String manno = (String) map.get("manno");
String decryptManNo = DESUtil.decrypt(manno);
if (StringUtils.isBlank(decryptManNo)) {
throw new RuntimeException("解密失败,请重新登录");
} else if ("admin".equals(decryptManNo)) {
decryptManNo = "-1";
}
String whereSql = " WHERE 1=1 ";
if (Constant.STR_ONE.equals(userUnitClass) || Constant.STR_TWO.equals(userUnitClass)) {
whereSql += "AND MANNO=" + decryptManNo;
nameTables = nameTableMapper.selectMyList(whereSql);
} else {
QueryWrapper<NameTable> wrapper = new QueryWrapper<>();
nameTables = nameTableMapper.selectList(wrapper);
}
}
List<NameTable> nameTables = nameTableMapper.selectList(wrapper);
log.info("[uuid:{}]-根据用户信息查询所属的站信息集合条数为{}", uuid, nameTables.size());
return nameTables;
@ -326,9 +351,9 @@ public class WorkOrderServiceImpl implements WorkOrderService {
String downFilePath = downloadPath + File.separator + fileName;
log.info("[uuid:{}]-开始下载:{},下载路径:{}", uuid, fileName, downloadPath);
//判断文件是否存在
if(FileUtil.fileExists(downFilePath)){
if (FileUtil.fileExists(downFilePath)) {
FileUtil.fileInput(response, fileName, new File(downFilePath));
}else {
} else {
log.info("[uuid:{}]-文件不存在:{}", uuid, downFilePath);
throw new PPException(MessageEnum..getCode(), MessageEnum..getMessage());
}
@ -365,7 +390,7 @@ public class WorkOrderServiceImpl implements WorkOrderService {
wrapper.eq("stano", stano);
if (!workFeedBackMapper.exists(wrapper)) {
Unprocessed un = new Unprocessed();
String message = "工单号:"+workorderno+"未反馈,请及时处理";
String message = "工单号:" + workorderno + "未反馈,请及时处理";
un.setWorkorderno(workorderno);
un.setSTANO(Integer.valueOf(stano));
un.setMessage(message);
@ -374,13 +399,13 @@ public class WorkOrderServiceImpl implements WorkOrderService {
queryWrapper.eq("WORKORDERNO", workorderno);
queryWrapper.eq("stano", stano);
unprocessedMapper.delete(queryWrapper);
count+= unprocessedMapper.insert(un);
count += unprocessedMapper.insert(un);
}
}
}
}
return count>0;
return count > 0;
}
/**

@ -315,6 +315,7 @@
style="width: 100%;"
filterable="true"
clearable="true"
disabled=""
>
<el-option
v-for="item in stanos"
@ -485,6 +486,7 @@ export default {
userUnitClass: '1',
userSubComNo: '1',
userStano: '1',
manno:'',
token: '',
searchFormLabelWidth: '70px',
formLabelWidth: '130px',
@ -520,10 +522,13 @@ export default {
this.userSubComNo = localStorage.getItem("userSubComNo");
this.userStano = localStorage.getItem("userStano");
this.token=localStorage.getItem('token')
this.manno=localStorage.getItem('manno')
// this.token = 'test';
// this.userUnitClass = '2';
// this.userUnitClass = '1';
// this.userSubComNo = '3';
// this.userStano = '305';
// this.manno = 'nytdC8Z/qfc=';
// this.manno = 'admin';
if (this.userUnitClass === '1') {
this.permissionShow = false;
}
@ -986,12 +991,12 @@ export default {
//
queryStaNoList() {
const userUnitClass = this.userUnitClass;
const userSubComNo = this.userSubComNo;
const userStano = this.userStano;
const manno = this.manno;
this.stanos = [];
selectStaNoList({
userUnitClass: userUnitClass,
userSubComNo: userSubComNo,
manno: manno,
userStano: userStano
}).then((res) => {
// console.log(res.data);

Loading…
Cancel
Save