|
|
@@ -4,17 +4,20 @@ import com.siwei.apply.domain.NodeLand;
|
|
|
import com.siwei.apply.domain.res.JsydghxkRes;
|
|
|
import com.siwei.apply.domain.vo.JsydghxkUpdateVo;
|
|
|
import com.siwei.apply.domain.vo.JsydghxkVo;
|
|
|
+import com.siwei.apply.domain.vo.OnChainVo;
|
|
|
import com.siwei.apply.service.JsydghxkService;
|
|
|
import com.siwei.apply.service.LandOneCodeService;
|
|
|
import com.siwei.apply.service.NodeLandService;
|
|
|
import com.siwei.apply.service.ProjectService;
|
|
|
import com.siwei.common.core.domain.R;
|
|
|
import com.siwei.common.core.web.controller.BaseController;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
@@ -97,27 +100,34 @@ public class JsydghxkController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 更新建设用地规划许可的上链状态
|
|
|
*/
|
|
|
@PutMapping("/onchain")
|
|
|
- public R<Void> updateHasOnchain(@RequestBody Map<String, Object> params) {
|
|
|
+ public R<Void> updateHasOnchain(@RequestBody OnChainVo onChainVo) {
|
|
|
try {
|
|
|
- String id = (String) params.get("id");
|
|
|
- String projectId = (String) params.get("projectId");
|
|
|
- Boolean hasOnchain = (Boolean) params.get("hasOnchain");
|
|
|
- if (StringUtils.isBlank(id)) {
|
|
|
- return R.fail("nodeId不能为空");
|
|
|
+ List<String> ids = onChainVo.getIds();
|
|
|
+ String projectId = onChainVo.getProjectId();
|
|
|
+ Boolean hasOnchain = onChainVo.getHasOnchain();
|
|
|
+ if (CollectionUtils.isEmpty(ids)) {
|
|
|
+ return R.fail(502, "节点为空,确保基本数据填写完毕");
|
|
|
+ }
|
|
|
+ for (String id : onChainVo.getIds()) {
|
|
|
+ NodeLand nodeLand = nodeLandService.getNodeLandByNodeId(id);
|
|
|
+ if (Objects.isNull(nodeLand)) {
|
|
|
+ return R.fail(502, "数据空间信息不存在,请检查先导入空间数据");
|
|
|
+ }
|
|
|
}
|
|
|
- NodeLand nodeLand = nodeLandService.getNodeLandByNodeId(id);
|
|
|
- if(Objects.isNull(nodeLand)){
|
|
|
- return R.fail(502,"数据空间信息不存在,请检查先导入空间数据");
|
|
|
+ for (String id : onChainVo.getIds()) {
|
|
|
+ jsydghxkService.updateHasOnchain(id, hasOnchain);
|
|
|
}
|
|
|
- jsydghxkService.updateHasOnchain(id, hasOnchain);
|
|
|
// 更新项目表的上链数量
|
|
|
projectService.countOnChinaNum(projectId);
|
|
|
//这里生成资源吗
|
|
|
- landOneCodeService.addOrUpdateLandOneCodeInfo(projectId,id);
|
|
|
+ for (String id : onChainVo.getIds()) {
|
|
|
+ landOneCodeService.addOrUpdateLandOneCodeInfo(projectId,id);
|
|
|
+ }
|
|
|
return R.ok();
|
|
|
} catch (Exception e) {
|
|
|
return R.fail(e.getMessage());
|