安全承诺完成
parent
ea0e12e364
commit
1894777d56
|
@ -2,6 +2,7 @@ package com.zcloud.controller.bus;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.zcloud.aspect.DockAnnotation;
|
||||||
import com.zcloud.controller.base.BaseController;
|
import com.zcloud.controller.base.BaseController;
|
||||||
import com.zcloud.entity.Page;
|
import com.zcloud.entity.Page;
|
||||||
import com.zcloud.entity.PageData;
|
import com.zcloud.entity.PageData;
|
||||||
|
@ -11,6 +12,7 @@ import com.zcloud.service.bus.CorpPromiseService;
|
||||||
import com.zcloud.service.bus.ImgFilesService;
|
import com.zcloud.service.bus.ImgFilesService;
|
||||||
import com.zcloud.util.DateUtil;
|
import com.zcloud.util.DateUtil;
|
||||||
import com.zcloud.util.Jurisdiction;
|
import com.zcloud.util.Jurisdiction;
|
||||||
|
import com.zcloud.util.ReturnMap;
|
||||||
import com.zcloud.util.Tools;
|
import com.zcloud.util.Tools;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -46,7 +48,13 @@ public class CorpPromiseController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/add")
|
@RequestMapping(value = "/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@DockAnnotation
|
||||||
public Object add() throws Exception {
|
public Object add() throws Exception {
|
||||||
|
PageData dockData = new PageData();
|
||||||
|
ArrayList<PageData> corpPromiseDetails = new ArrayList<>();
|
||||||
|
ArrayList<PageData> corpPromisePeoples = new ArrayList<>();
|
||||||
|
ArrayList<PageData> coverPeoples = new ArrayList<>();
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
|
@ -63,6 +71,7 @@ public class CorpPromiseController extends BaseController {
|
||||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||||
pd.put("RELEASE_PLATFORM", "1");//企业端发布
|
pd.put("RELEASE_PLATFORM", "1");//企业端发布
|
||||||
corpPromiseService.save(pd);
|
corpPromiseService.save(pd);
|
||||||
|
dockData.put("corpPromiseSave",JSON.toJSONString(pd));
|
||||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL")); //副文内容
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL")); //副文内容
|
||||||
if (list.size() > 0) {
|
if (list.size() > 0) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
@ -72,7 +81,9 @@ public class CorpPromiseController extends BaseController {
|
||||||
promise.put("COLLATERAL", list.get(i).get("value"));
|
promise.put("COLLATERAL", list.get(i).get("value"));
|
||||||
promise.put("SORTINDEX", list.get(i).get("index"));
|
promise.put("SORTINDEX", list.get(i).get("index"));
|
||||||
corpPromiseDetailsService.save(promise);
|
corpPromiseDetailsService.save(promise);
|
||||||
|
corpPromiseDetails.add(promise);
|
||||||
}
|
}
|
||||||
|
dockData.put("corpPromiseDetailsSave",JSON.toJSONString(corpPromiseDetails));
|
||||||
}
|
}
|
||||||
if (people.size() > 0) { //承诺人数据
|
if (people.size() > 0) { //承诺人数据
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
@ -90,12 +101,15 @@ public class CorpPromiseController extends BaseController {
|
||||||
promise.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
promise.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||||
promise.put("ISPROMISE_PEOPLE", "0");
|
promise.put("ISPROMISE_PEOPLE", "0");
|
||||||
corpPromisePeopleService.save(promise);
|
corpPromisePeopleService.save(promise);
|
||||||
|
corpPromisePeoples.add(promise);
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
|
dockData.put("corpPromisePeopleSave",JSON.toJSONString(corpPromisePeoples));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pd.put("PEOPLENUM_INVOLVED", num);
|
pd.put("PEOPLENUM_INVOLVED", num);
|
||||||
corpPromiseService.editpeople(pd);
|
corpPromiseService.editpeople(pd);
|
||||||
|
dockData.put("editPeople",JSON.toJSONString(pd));
|
||||||
}
|
}
|
||||||
List<JSONObject> coverpeople = (List<JSONObject>) JSON.parse(pd.getString("coverpeople"));
|
List<JSONObject> coverpeople = (List<JSONObject>) JSON.parse(pd.getString("coverpeople"));
|
||||||
if (coverpeople.size() > 0) { //被承诺人数据
|
if (coverpeople.size() > 0) { //被承诺人数据
|
||||||
|
@ -113,12 +127,14 @@ public class CorpPromiseController extends BaseController {
|
||||||
promise.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
promise.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||||
promise.put("ISPROMISE_PEOPLE", "1");
|
promise.put("ISPROMISE_PEOPLE", "1");
|
||||||
corpPromisePeopleService.save(promise);
|
corpPromisePeopleService.save(promise);
|
||||||
|
coverPeoples.add(promise);
|
||||||
}
|
}
|
||||||
|
dockData.put("coverPeopleList",JSON.toJSONString(coverPeoples));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
map.put("dockData", JSON.toJSONString(dockData));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,13 +185,22 @@ public class CorpPromiseController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/editdelete")
|
@RequestMapping(value = "/editdelete")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@DockAnnotation
|
||||||
public Object editdelete() throws Exception {
|
public Object editdelete() throws Exception {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
|
if (Tools.notEmpty(pd.getString("dockData"))) {
|
||||||
|
// 咱们的对接流程 如有异常 使用 throw new BizException();
|
||||||
|
PageData dockData = JSON.parseObject(pd.getString("dockData"), PageData.class);
|
||||||
|
corpPromiseService.editdelete(dockData);
|
||||||
|
// 正常返回
|
||||||
|
return ReturnMap.ok();
|
||||||
|
}
|
||||||
corpPromiseService.editdelete(pd);
|
corpPromiseService.editdelete(pd);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
map.put("dockData", JSON.toJSONString(pd));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,12 +269,17 @@ public class CorpPromiseController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/edit")
|
@RequestMapping(value = "/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@DockAnnotation
|
||||||
public Object edit() throws Exception {
|
public Object edit() throws Exception {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||||
|
PageData dockData = new PageData();
|
||||||
|
ArrayList<PageData> corpPromiseDetails = new ArrayList<>();
|
||||||
|
ArrayList<PageData> corpPromisePeoples = new ArrayList<>();
|
||||||
|
ArrayList<PageData> coverPeoples = new ArrayList<>();
|
||||||
corpPromiseService.edit(pd);
|
corpPromiseService.edit(pd);
|
||||||
corpPromiseDetailsService.deletePromiseId(pd);
|
corpPromiseDetailsService.deletePromiseId(pd);
|
||||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL"));
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL"));
|
||||||
|
@ -261,9 +291,12 @@ public class CorpPromiseController extends BaseController {
|
||||||
promise.put("COLLATERAL", list.get(i).get("value"));
|
promise.put("COLLATERAL", list.get(i).get("value"));
|
||||||
promise.put("SORTINDEX", list.get(i).get("index"));
|
promise.put("SORTINDEX", list.get(i).get("index"));
|
||||||
corpPromiseDetailsService.save(promise);
|
corpPromiseDetailsService.save(promise);
|
||||||
|
corpPromiseDetails.add(promise);
|
||||||
}
|
}
|
||||||
|
dockData.put("corpPromiseDetails",JSON.toJSONString(corpPromiseDetails));
|
||||||
}
|
}
|
||||||
corpPromisePeopleService.deletePromiseId(pd); //先删除承诺人数据,再新增
|
corpPromisePeopleService.deletePromiseId(pd); //先删除承诺人数据,再新增
|
||||||
|
dockData.put("baseData",JSON.toJSONString(pd));
|
||||||
List<JSONObject> people = (List<JSONObject>) JSON.parse(pd.getString("people"));
|
List<JSONObject> people = (List<JSONObject>) JSON.parse(pd.getString("people"));
|
||||||
if (people.size() > 0) { //承诺人数据
|
if (people.size() > 0) { //承诺人数据
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
@ -282,11 +315,15 @@ public class CorpPromiseController extends BaseController {
|
||||||
promise.put("ISPROMISE_PEOPLE", "0");
|
promise.put("ISPROMISE_PEOPLE", "0");
|
||||||
corpPromisePeopleService.save(promise);
|
corpPromisePeopleService.save(promise);
|
||||||
num++;
|
num++;
|
||||||
|
corpPromisePeoples.add(promise);
|
||||||
}
|
}
|
||||||
|
dockData.put("corpPromisePeoples",JSON.toJSONString(corpPromisePeoples));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pd.put("PEOPLENUM_INVOLVED", num);
|
pd.put("PEOPLENUM_INVOLVED", num);
|
||||||
corpPromiseService.editpeople(pd);
|
corpPromiseService.editpeople(pd);
|
||||||
|
dockData.put("editData",JSON.toJSONString(pd));
|
||||||
|
|
||||||
}
|
}
|
||||||
List<JSONObject> coverpeople = (List<JSONObject>) JSON.parse(pd.getString("coverpeople"));
|
List<JSONObject> coverpeople = (List<JSONObject>) JSON.parse(pd.getString("coverpeople"));
|
||||||
if (coverpeople.size() > 0) { //被承诺人数据
|
if (coverpeople.size() > 0) { //被承诺人数据
|
||||||
|
@ -304,11 +341,14 @@ public class CorpPromiseController extends BaseController {
|
||||||
promise.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
promise.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||||
promise.put("ISPROMISE_PEOPLE", "1");
|
promise.put("ISPROMISE_PEOPLE", "1");
|
||||||
corpPromisePeopleService.save(promise);
|
corpPromisePeopleService.save(promise);
|
||||||
|
coverPeoples.add(promise);
|
||||||
}
|
}
|
||||||
|
dockData.put("coverPeoples",JSON.toJSONString(coverPeoples));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
map.put("dockData", JSON.toJSONString(dockData));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,18 +472,24 @@ public class CorpPromiseController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/delete")
|
@RequestMapping(value = "/delete")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
@DockAnnotation
|
||||||
public Object delete() throws Exception {
|
public Object delete() throws Exception {
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
|
PageData dockData = new PageData();
|
||||||
|
List<PageData> corpPromisePeopleList = new ArrayList<>();
|
||||||
List<PageData> promiseList = corpPromisePeopleService.getListAllByPromiseId(pd);
|
List<PageData> promiseList = corpPromisePeopleService.getListAllByPromiseId(pd);
|
||||||
for (PageData pageData : promiseList) {
|
for (PageData pageData : promiseList) {
|
||||||
corpPromisePeopleService.delete(pageData);
|
corpPromisePeopleService.delete(pageData);
|
||||||
|
corpPromisePeopleList.add(pageData);
|
||||||
}
|
}
|
||||||
|
|
||||||
corpPromiseService.delete(pd);
|
corpPromiseService.delete(pd);
|
||||||
|
dockData.put("removeData",JSON.toJSONString(pd));
|
||||||
|
dockData.put("corpPromisePeopleList",JSON.toJSONString(corpPromisePeopleList));
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
map.put("dockData", JSON.toJSONString(dockData));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package com.zcloud.controller.bus;
|
package com.zcloud.controller.bus;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
import com.zcloud.aspect.DockAnnotation;
|
||||||
import com.zcloud.util.Jurisdiction;
|
import com.zcloud.util.Jurisdiction;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
@ -38,150 +36,175 @@ public class PromiseController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private CorpPromisePeopleService corpPromisePeopleService;
|
private CorpPromisePeopleService corpPromisePeopleService;
|
||||||
|
|
||||||
/**新增
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/add")
|
@RequestMapping(value = "/add")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object add() throws Exception{
|
@DockAnnotation
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
public Object add() throws Exception {
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
pd.put("PROMISE_ID", this.get32UUID()); //主键
|
pd.put("PROMISE_ID", this.get32UUID()); //主键
|
||||||
pd.put("ISDELETE",0);
|
pd.put("ISDELETE", 0);
|
||||||
pd.put("CREATOR", "admin"); //创建人
|
pd.put("CREATOR", "admin"); //创建人
|
||||||
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
|
pd.put("CREATTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||||
pd.put("OPERATOR", "admin"); //创建人
|
pd.put("OPERATOR", "admin"); //创建人
|
||||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||||
promiseService.save(pd);
|
promiseService.save(pd);
|
||||||
|
ArrayList<PageData> promiseDetailList = new ArrayList<>();
|
||||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL"));
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL"));
|
||||||
if(list.size()>0){
|
if (list.size() > 0) {
|
||||||
for (int i=0;i<list.size();i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
PageData promise = new PageData();
|
PageData promise = new PageData();
|
||||||
promise.put("PROMISEDETAIL_ID", this.get32UUID()); //主键
|
promise.put("PROMISEDETAIL_ID", this.get32UUID()); //主键
|
||||||
promise.put("PROMISE_ID", pd.getString("PROMISE_ID")); //外键ID
|
promise.put("PROMISE_ID", pd.getString("PROMISE_ID")); //外键ID
|
||||||
promise.put("COLLATERAL",list.get(i).get("value"));
|
promise.put("COLLATERAL", list.get(i).get("value"));
|
||||||
promise.put("SORTINDEX",list.get(i).get("index"));
|
promise.put("SORTINDEX", list.get(i).get("index"));
|
||||||
promiseDetailsService.save(promise);
|
promiseDetailsService.save(promise);
|
||||||
|
promiseDetailList.add(promise);
|
||||||
}
|
}
|
||||||
|
pd.put("promiseDetailList", JSON.toJSONString(promiseDetailList));
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
map.put("dockData", JSON.toJSONString(pd));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**列表
|
/**
|
||||||
|
* 列表
|
||||||
|
*
|
||||||
* @param page
|
* @param page
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/list")
|
@RequestMapping(value = "/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object list(Page page) throws Exception{
|
public Object list(Page page) throws Exception {
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件
|
||||||
if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim());
|
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||||
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||||
page.setPd(pd);
|
page.setPd(pd);
|
||||||
List<PageData> varList = promiseService.list(page); //列出Notice列表
|
List<PageData> varList = promiseService.list(page); //列出Notice列表
|
||||||
map.put("varList", varList);
|
map.put("varList", varList);
|
||||||
map.put("page", page);
|
map.put("page", page);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**启用禁用
|
/**
|
||||||
|
* 启用禁用
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/editdelete")
|
@RequestMapping(value = "/editdelete")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object editdelete() throws Exception{
|
@DockAnnotation
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
public Object editdelete() throws Exception {
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
promiseService.editdelete(pd);
|
promiseService.editdelete(pd);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
map.put("dockData", JSON.toJSONString(pd));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**查看
|
/**
|
||||||
|
* 查看
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/goEdit")
|
@RequestMapping(value = "/goEdit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object goEdit() throws Exception{
|
public Object goEdit() throws Exception {
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
PageData promise = promiseService.findById(pd);
|
PageData promise = promiseService.findById(pd);
|
||||||
List<PageData> promistDetail = promiseDetailsService.findByPromiseId(pd);
|
List<PageData> promistDetail = promiseDetailsService.findByPromiseId(pd);
|
||||||
map.put("promistDetail",promistDetail);
|
map.put("promistDetail", promistDetail);
|
||||||
map.put("varList", promise);
|
map.put("varList", promise);
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**查看
|
/**
|
||||||
|
* 查看
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/edit")
|
@RequestMapping(value = "/edit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object edit() throws Exception{
|
@DockAnnotation
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
public Object edit() throws Exception {
|
||||||
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
pd.put("OPERATTIME", DateUtil.date2Str(new Date())); //创建时间
|
||||||
promiseService.edit(pd);
|
promiseService.edit(pd);
|
||||||
promiseDetailsService.deletePromiseId(pd);
|
promiseDetailsService.deletePromiseId(pd);
|
||||||
|
ArrayList<PageData> promiseDetailList = new ArrayList<>();
|
||||||
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL"));
|
List<JSONObject> list = (List<JSONObject>) JSON.parse(pd.getString("DETAIL"));
|
||||||
if(list.size()>0){
|
if (list.size() > 0) {
|
||||||
for (int i=0;i<list.size();i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
PageData promise = new PageData();
|
PageData promise = new PageData();
|
||||||
promise.put("PROMISEDETAIL_ID", this.get32UUID()); //主键
|
promise.put("PROMISEDETAIL_ID", this.get32UUID()); //主键
|
||||||
promise.put("PROMISE_ID", pd.getString("PROMISE_ID")); //外键ID
|
promise.put("PROMISE_ID", pd.getString("PROMISE_ID")); //外键ID
|
||||||
promise.put("COLLATERAL",list.get(i).get("value"));
|
promise.put("COLLATERAL", list.get(i).get("value"));
|
||||||
promise.put("SORTINDEX",list.get(i).get("index"));
|
promise.put("SORTINDEX", list.get(i).get("index"));
|
||||||
promiseDetailsService.save(promise);
|
promiseDetailsService.save(promise);
|
||||||
|
promiseDetailList.add(promise);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pd.put("promiseDetailList",JSON.toJSONString(promiseDetailList));
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
|
map.put("dockData", JSON.toJSONString(pd));
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
/**启用禁用
|
|
||||||
|
/**
|
||||||
|
* 启用禁用
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value="/delete")
|
@RequestMapping(value = "/delete")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public Object delete() throws Exception{
|
public Object delete() throws Exception {
|
||||||
Map<String,Object> map = new HashMap<String,Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
String errInfo = "success";
|
String errInfo = "success";
|
||||||
PageData pd = new PageData();
|
PageData pd = new PageData();
|
||||||
pd = this.getPageData();
|
pd = this.getPageData();
|
||||||
// b3f6c82e51774b4b82e2a87363c8f1cf
|
// b3f6c82e51774b4b82e2a87363c8f1cf
|
||||||
List<PageData> coverpeople = corpPromisePeopleService.findByCoverPromiseId(pd); //被承诺人
|
List<PageData> coverpeople = corpPromisePeopleService.findByCoverPromiseId(pd); //被承诺人
|
||||||
List<PageData> people = corpPromisePeopleService.findByPromiseId(pd);//承诺人
|
List<PageData> people = corpPromisePeopleService.findByPromiseId(pd);//承诺人
|
||||||
if(coverpeople.size()>0){
|
if (coverpeople.size() > 0) {
|
||||||
map.put("result", "fail");
|
map.put("result", "fail");
|
||||||
map.put("msg", "该承诺书有被承诺人,删除失败!");
|
map.put("msg", "该承诺书有被承诺人,删除失败!");
|
||||||
return map;
|
return map;
|
||||||
}else if(people.size()>0){
|
} else if (people.size() > 0) {
|
||||||
map.put("result", "fail");
|
map.put("result", "fail");
|
||||||
map.put("msg", "该承诺书有承诺人,删除失败!");
|
map.put("msg", "该承诺书有承诺人,删除失败!");
|
||||||
return map;
|
return map;
|
||||||
}else{
|
} else {
|
||||||
promiseService.delete(pd); // 删除
|
promiseService.delete(pd); // 删除
|
||||||
}
|
}
|
||||||
map.put("result", errInfo);
|
map.put("result", errInfo);
|
||||||
return map;
|
return map;
|
||||||
|
|
Loading…
Reference in New Issue