|
@@ -5,9 +5,9 @@ import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.onemap.apply.domain.cggl.*;
|
|
|
-import com.onemap.apply.mapper.cggl.EscalationFileMapper;
|
|
|
-import com.onemap.apply.mapper.cggl.EscalationMapper;
|
|
|
-import com.onemap.apply.mapper.cggl.EscalationRzMapper;
|
|
|
+import com.onemap.apply.domain.sbjk.XzczghcgsbDTO;
|
|
|
+import com.onemap.apply.mapper.cggl.*;
|
|
|
+import com.onemap.apply.mapper.sbjk.XzczghcgsbMapper;
|
|
|
import com.onemap.apply.service.cggl.CgglService;
|
|
|
import com.onemap.apply.utils.*;
|
|
|
import com.onemap.common.core.domain.UploadZipDTO;
|
|
@@ -60,6 +60,12 @@ public class CgglServiceImpl implements CgglService {
|
|
|
private EscalationRzMapper escalationRzMapper;
|
|
|
@Autowired
|
|
|
private RedisService redisService;
|
|
|
+ @Autowired
|
|
|
+ private ScmxMapper scmxMapper;
|
|
|
+ @Autowired
|
|
|
+ private ScmxRecordMapper scmxRecordMapper;
|
|
|
+ @Autowired
|
|
|
+ private XzczghcgsbMapper xzczghcgsbMapper;
|
|
|
|
|
|
|
|
|
@Value("${Cggl.temp}")
|
|
@@ -83,6 +89,8 @@ public class CgglServiceImpl implements CgglService {
|
|
|
|
|
|
@Value("${Cggl.cgsc}")
|
|
|
private String cgscUrl;
|
|
|
+ @Value("${Cggl.cgjc}")
|
|
|
+ private String cgjcUrl;
|
|
|
|
|
|
|
|
|
private String Authorization = "Basic c2FiZXI6c2FiZXJfc2VjcmV0";
|
|
@@ -96,9 +104,9 @@ public class CgglServiceImpl implements CgglService {
|
|
|
if (file == null) {
|
|
|
return RequestResult.error("上传失败!", false);
|
|
|
}
|
|
|
- if (file.getOriginalFilename().getBytes().length > 100) {
|
|
|
- return RequestResult.error("上传文件名不能大于100个字节!", false);
|
|
|
- }
|
|
|
+// if (file.getOriginalFilename().getBytes().length > 100) {
|
|
|
+// return RequestResult.error("上传文件名不能大于100个字节!", false);
|
|
|
+// }
|
|
|
String uuid = StringUtils.getUUID();
|
|
|
EscalationFileDTO dto = new EscalationFileDTO();
|
|
|
dto.setId(uuid);
|
|
@@ -130,8 +138,8 @@ public class CgglServiceImpl implements CgglService {
|
|
|
//解压rar格式
|
|
|
new UnPackageUtils().unPackRar(copyFile, unzippath);
|
|
|
}
|
|
|
- //TODO wanger 总体规划跳过审查,原始赋值是9(待审查),现在改为1(审查结束)
|
|
|
- curdto.setStatus("1");
|
|
|
+ //TODO wanger 总体规划跳过机器审查,原始赋值是9(待审查),现在改为1(审查结束)
|
|
|
+ curdto.setStatus("9");
|
|
|
curdto.setPath(temppath);
|
|
|
curdto.setUnzippath(unzippath);
|
|
|
escalationFileMapper.update(curdto, wrapper);
|
|
@@ -177,9 +185,9 @@ public class CgglServiceImpl implements CgglService {
|
|
|
if (res != null) {
|
|
|
return RequestResult.error("该名称已存在!", false);
|
|
|
}
|
|
|
- if (escalationDTO.getName().getBytes().length > 100) {
|
|
|
- return RequestResult.error("成果名称不能大于100个字节!", false);
|
|
|
- }
|
|
|
+// if (escalationDTO.getName().getBytes().length > 100) {
|
|
|
+// return RequestResult.error("成果名称不能大于100个字节!", false);
|
|
|
+// }
|
|
|
String id = StringUtils.getUUID();
|
|
|
escalationDTO.setUploadstatus("0");
|
|
|
escalationDTO.setUploadtime(new Date());
|
|
@@ -204,6 +212,47 @@ public class CgglServiceImpl implements CgglService {
|
|
|
return RequestResult.success("保存成功!", id);
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public RequestResult startcgsc(String scmodel, String jqscmodel, String cgid) {
|
|
|
+ try {
|
|
|
+ //机器审查
|
|
|
+ escalationMapper.updateWaitCheck(cgid);
|
|
|
+ if (StringUtils.isNotEmpty(jqscmodel)) {
|
|
|
+ String getUrl = cgjcUrl + "" + cgid;
|
|
|
+ System.out.println("开始进行成果完整性检查,调用地址" + getUrl);
|
|
|
+ String msg = HttpClientUtil.doGet(getUrl);
|
|
|
+ System.out.println("成果完整性检查结果" + msg);
|
|
|
+ System.out.println("成果完整性检查模块:" + cgid + "审查任务调用成果!!!!!!!! " + new Date().toString());
|
|
|
+ }
|
|
|
+ //人工审查
|
|
|
+ if (StringUtils.isNotEmpty(scmodel)) {
|
|
|
+ escalationMapper.updateCgScModel(cgid, scmodel);
|
|
|
+ //TODO wanger 增加人工审查模型详情表
|
|
|
+ ScmxDTO scmxdto = scmxMapper.selectById(scmodel);
|
|
|
+ String users = scmxdto.getUsers();
|
|
|
+ if (StringUtils.isNotEmpty(users)) {
|
|
|
+ String[] userlist = users.split(",");
|
|
|
+ for (int i = 0; i < userlist.length; i++) {
|
|
|
+ String userid = userlist[i];
|
|
|
+ ScmxRecordDTO recordDto = new ScmxRecordDTO();
|
|
|
+ recordDto.setCgid(cgid);
|
|
|
+ recordDto.setSort(String.valueOf(i));
|
|
|
+ recordDto.setUserid(userid);
|
|
|
+ scmxRecordMapper.insert(recordDto);
|
|
|
+ }
|
|
|
+ scmxRecordMapper.updateUserName();
|
|
|
+ } else {
|
|
|
+ //空的人工审查流程 直接办结
|
|
|
+ escalationMapper.updateCgScZt(cgid, "2");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return RequestResult.success("发起审查成功!");
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return RequestResult.error("发起审查失败!");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<EscalationInfoDTO> cgInfoList(String year, String xzqdm, String uploadstatus, String username, String cglevel, String plantype) {
|
|
|
//判断是否为市级用户查看旗县数据,需要过滤uploadstatus != '0'
|
|
@@ -501,8 +550,29 @@ public class CgglServiceImpl implements CgglService {
|
|
|
|
|
|
@Override
|
|
|
public RequestResult cgDelete(String id) {
|
|
|
+ //主表
|
|
|
QueryWrapper<EscalationDTO> wrapper = new QueryWrapper<EscalationDTO>();
|
|
|
wrapper.eq("id", id);
|
|
|
+ EscalationDTO dto = escalationMapper.selectOne(wrapper);
|
|
|
+ //文件表
|
|
|
+ String fileid = dto.getFileid();
|
|
|
+ if (StringUtils.isNotEmpty(fileid)) {
|
|
|
+ //删除文件表和文件夹
|
|
|
+ QueryWrapper<EscalationFileDTO> filewrapper = new QueryWrapper<EscalationFileDTO>();
|
|
|
+ filewrapper.eq("id", fileid);
|
|
|
+ EscalationFileDTO fileDto = escalationFileMapper.selectOne(filewrapper);
|
|
|
+ String filepath = fileDto.getPath();
|
|
|
+ //删除文件夹
|
|
|
+ try {
|
|
|
+ File file = new File(filepath);
|
|
|
+ File parentDir = file.getParentFile();
|
|
|
+// String parentDirPath = parentDir.getAbsolutePath();
|
|
|
+ FileUtils.deleteDirectory(parentDir);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ escalationFileMapper.delete(filewrapper);
|
|
|
+ }
|
|
|
escalationMapper.delete(wrapper);
|
|
|
return RequestResult.success("删除成功!", true);
|
|
|
}
|
|
@@ -542,19 +612,27 @@ public class CgglServiceImpl implements CgglService {
|
|
|
}
|
|
|
//判断为id数值还是直接传递的路径
|
|
|
String fileDir = "";
|
|
|
- if (id.contains("/")) {
|
|
|
+ if (id.contains("/")|| id.contains("\\") ) {
|
|
|
fileDir = id.substring(0, id.lastIndexOf("."));
|
|
|
} else {
|
|
|
QueryWrapper<EscalationDTO> EscalationQrapper = new QueryWrapper<>();
|
|
|
EscalationQrapper.eq("id", id);
|
|
|
EscalationDTO escalationDTO = escalationMapper.selectOne(EscalationQrapper);
|
|
|
+ //TODO wanger 成果包id不是总规的 再查询下 是不是村庄规划的
|
|
|
if (escalationDTO == null) {
|
|
|
- return RequestResult.error("id数据传错了!", false);
|
|
|
+ QueryWrapper<XzczghcgsbDTO> wrapper = new QueryWrapper();
|
|
|
+ wrapper.eq("uuid", id);
|
|
|
+ XzczghcgsbDTO dto = xzczghcgsbMapper.selectOne(wrapper);
|
|
|
+ if (dto == null) {
|
|
|
+ return RequestResult.error("id数据传错了!", false);
|
|
|
+ }
|
|
|
+ fileDir = dto.getFilePath().replace(".zip", "").replace(".rar", "");
|
|
|
+ } else {
|
|
|
+ QueryWrapper<EscalationFileDTO> EscalationFileQrapper = new QueryWrapper<>();
|
|
|
+ EscalationFileQrapper.eq("id", escalationDTO.getFileid());
|
|
|
+ EscalationFileDTO fileDto = escalationFileMapper.selectOne(EscalationFileQrapper);
|
|
|
+ fileDir = fileDto.getUnzippath();
|
|
|
}
|
|
|
- QueryWrapper<EscalationFileDTO> EscalationFileQrapper = new QueryWrapper<>();
|
|
|
- EscalationFileQrapper.eq("id", escalationDTO.getFileid());
|
|
|
- EscalationFileDTO fileDto = escalationFileMapper.selectOne(EscalationFileQrapper);
|
|
|
- fileDir = fileDto.getUnzippath();
|
|
|
}
|
|
|
fileDir = fileDir.replaceAll("\\\\", "/");
|
|
|
File c = new File(fileDir);
|
|
@@ -689,7 +767,7 @@ public class CgglServiceImpl implements CgglService {
|
|
|
// System.out.println("开始进行成果审查,调用地址" + getUrl);
|
|
|
// String msg = HttpClientUtil.doGet(getUrl);
|
|
|
// System.out.println("成果审查结果" + msg);
|
|
|
- updatescqxinfo(1, "", gcid, SecurityUtils.getUsername());
|
|
|
+ updatescqxinfo(0, "", gcid, SecurityUtils.getUsername());
|
|
|
System.out.println("成果审查模块:" + gcid + "审查任务调用成果!!!!!!!! " + new Date().toString());
|
|
|
}
|
|
|
|
|
@@ -698,32 +776,29 @@ public class CgglServiceImpl implements CgglService {
|
|
|
try {
|
|
|
String username = SecurityUtils.getUsername();
|
|
|
List<EscalationTaskDTO> lists = null;
|
|
|
- if (StringUtils.isNotEmpty(cglx)) {
|
|
|
- if (cglx.equals("总体规划")) {
|
|
|
- cglx = "3";
|
|
|
- } else if (cglx.equals("详细规划")) {
|
|
|
- cglx = "4";
|
|
|
- } else if (cglx.equals("专项规划")) {
|
|
|
- cglx = "5";
|
|
|
+ if ("9".equals(cglx)) {//TODO wanger 村庄规划
|
|
|
+ if ("0".equals(type) || "1".equals(type)) {
|
|
|
+ type = "10";
|
|
|
+ } else if ("2".equals(type)) {
|
|
|
+ type = "11";
|
|
|
}
|
|
|
- }
|
|
|
- if (SecurityUtils.getLoginUserXzq().length() == 4) //市级人员 获取到状态信息
|
|
|
- {
|
|
|
- lists = escalationMapper.getSelectCgSclistbyzt(type, xzqdm, cgmc, cglx);
|
|
|
- } else //县级人员 获取到状态信息
|
|
|
- {
|
|
|
- if (type.equals("2")) {
|
|
|
- xzqdm = SecurityUtils.getLoginUserXzq();
|
|
|
- lists = escalationMapper.getSelectCgSclistbyztwj(type, xzqdm, cgmc, cglx);
|
|
|
- } else {
|
|
|
- xzqdm = SecurityUtils.getLoginUserXzq();
|
|
|
- lists = escalationMapper.getSelectCgSclistbyzt(type, xzqdm, cgmc, cglx);
|
|
|
+ lists = xzczghcgsbMapper.getSelectCgSclistbyzt(type, xzqdm, cgmc, cglx, username);
|
|
|
+ } else {
|
|
|
+ if (StringUtils.isNotEmpty(cglx)) {
|
|
|
+ if (cglx.equals("总体规划")) {
|
|
|
+ cglx = "3";
|
|
|
+ } else if (cglx.equals("详细规划")) {
|
|
|
+ cglx = "4";
|
|
|
+ } else if (cglx.equals("专项规划")) {
|
|
|
+ cglx = "5";
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (lists.size() > 0) {
|
|
|
- for (int i = lists.size() - 1; i > -1; i--) {
|
|
|
- if ("0".equals(lists.get(i).getStatus())) {
|
|
|
- lists.remove(i);
|
|
|
+ lists = escalationMapper.getSelectCgSclistbyzt(type, xzqdm, cgmc, cglx, username);
|
|
|
+ if (lists.size() > 0) {
|
|
|
+ for (int i = lists.size() - 1; i > -1; i--) {
|
|
|
+ if ("0".equals(lists.get(i).getStatus())) {
|
|
|
+ lists.remove(i);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -896,4 +971,57 @@ public class CgglServiceImpl implements CgglService {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public RequestResult insertOrUpdateScmx(ScmxDTO scmxDTO) {
|
|
|
+ if (scmxDTO == null) {
|
|
|
+ return RequestResult.error("参数错误");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ String id = scmxDTO.getId();
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ scmxDTO.setId(StringUtils.getUUID());
|
|
|
+ scmxMapper.insert(scmxDTO);
|
|
|
+ } else {
|
|
|
+ QueryWrapper<ScmxDTO> wrapper = new QueryWrapper();
|
|
|
+ wrapper.eq("id", id);
|
|
|
+ scmxMapper.update(scmxDTO, wrapper);
|
|
|
+ }
|
|
|
+ return RequestResult.success("成功!", 1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return RequestResult.error("失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public RequestResult scmxDelete(String id) {
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ return RequestResult.error("参数错误");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ QueryWrapper<ScmxDTO> wrapper = new QueryWrapper();
|
|
|
+ wrapper.eq("id", id);
|
|
|
+ scmxMapper.delete(wrapper);
|
|
|
+ return RequestResult.success("成功!", 1);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return RequestResult.error("失败!");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public RequestResult getScmxList(String name) {
|
|
|
+ try {
|
|
|
+ QueryWrapper<ScmxDTO> wrapper = new QueryWrapper();
|
|
|
+ if (StringUtils.isNotEmpty(name)) {
|
|
|
+ wrapper.eq("name", name);
|
|
|
+ }
|
|
|
+ List<ScmxDTO> res = scmxMapper.selectList(wrapper);
|
|
|
+ return RequestResult.success("成功!", res);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return RequestResult.error("失败!");
|
|
|
+ }
|
|
|
+
|
|
|
}
|