|
|
|
|
@ -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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|