三项制度库整体代码提交
parent
e14165e4cc
commit
feb83ceb03
|
@ -0,0 +1,219 @@
|
|||
package com.zcloud.controller.depository;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.depository.LabelFactoryService;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.Tools;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 说明:标签库
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/labelFactory")
|
||||
public class LabelFactoryController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private LabelFactoryService labelfactoryService;
|
||||
|
||||
@RequestMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = labelfactoryService.list(page); //列出LabelFacory列表
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* description:保存根节点方法
|
||||
*
|
||||
* @author sparrow
|
||||
*
|
||||
* @return save result
|
||||
* @throws Exception all
|
||||
*/
|
||||
@RequestMapping(value = "/addAncestors")
|
||||
@ResponseBody
|
||||
public Object addAncestors() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("result", "success");
|
||||
PageData pd = this.getPageData();
|
||||
PageData condition = new PageData();
|
||||
condition.put("NAME",pd.getString("NAME"));
|
||||
List<PageData> warden = labelfactoryService.listAll(condition);
|
||||
if (warden != null && warden.size() >0){
|
||||
map.put("code","9999");
|
||||
map.put("errorMessage","节点名重复");
|
||||
return map;
|
||||
}
|
||||
pd.put("BUS_LABEL_FACTORY_ID", this.get32UUID()); //主键
|
||||
pd.put("PARENT_ID", "0");
|
||||
pd.put("ANCESTORS_ID", pd.getString("BUS_LABEL_FACTORY_ID"));
|
||||
pd.put("IS_ANCESTORS_FLAG", "1");
|
||||
pd.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||
pd.put("CREATED_TIME", new Date());
|
||||
pd.put("ISDELETE", "0");
|
||||
pd.put("LEVEL", "0");
|
||||
labelfactoryService.save(pd);
|
||||
map.put("code","0");
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getAncestors")
|
||||
@ResponseBody
|
||||
public Object getAncestors() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
List<PageData> list = labelfactoryService.findAllAncestors(pd);
|
||||
map.put("list",list);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/tree")
|
||||
@ResponseBody
|
||||
public Object tree() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
PageData pd = this.getPageData();
|
||||
List<PageData> tree = labelfactoryService.getTree(pd); //列出LabelFacory列表
|
||||
map.put("tree", tree);
|
||||
map.put("result", "success");
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/saveTree")
|
||||
@ResponseBody
|
||||
public Object saveTree() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
PageData pd = this.getPageData();
|
||||
// 此处一定会炸雷(解决方案见历史版本)
|
||||
List<PageData> tree = labelfactoryService.saveTree(pd); //列出LabelFacory列表
|
||||
map.put("tree", tree);
|
||||
map.put("result", "success");
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/add")
|
||||
@ResponseBody
|
||||
public Object add() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = this.getPageData();
|
||||
pd.put("LABELFACORY_ID", this.get32UUID()); //主键
|
||||
labelfactoryService.save(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
@RequiresPermissions("labelfacory:del")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
labelfactoryService.delete(pd);
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/edit")
|
||||
@RequiresPermissions("labelfacory:edit")
|
||||
@ResponseBody
|
||||
public Object edit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
labelfactoryService.edit(pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = labelfactoryService.findById(pd); //根据ID读取
|
||||
map.put("pd", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/deleteAll")
|
||||
@RequiresPermissions("labelfacory:del")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if (Tools.notEmpty(DATA_IDS)) {
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
labelfactoryService.deleteAll(ArrayDATA_IDS);
|
||||
errInfo = "success";
|
||||
} else {
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.zcloud.controller.depository;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.depository.TermLibraryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/labelFactory")
|
||||
public class TermLibraryController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private TermLibraryService termLibraryService;
|
||||
|
||||
@RequestMapping(value = "/termList")
|
||||
@ResponseBody
|
||||
public Object list() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
List<PageData> varList = termLibraryService.listAll(pd); //列出LabelFacory列表
|
||||
map.put("varList", varList);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,328 @@
|
|||
package com.zcloud.controller.depository;
|
||||
|
||||
import com.zcloud.controller.base.BaseController;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.service.bus.CorpInfoService;
|
||||
import com.zcloud.service.depository.TextLibraryService;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.Tools;
|
||||
import com.zcloud.util.Warden;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:文本信息
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/textLibrary")
|
||||
public class TextLibraryController extends BaseController {
|
||||
|
||||
@Resource
|
||||
private TextLibraryService textlibraryService;
|
||||
|
||||
@Resource
|
||||
private CorpInfoService corpInfoService;
|
||||
|
||||
@RequestMapping(value = "/init")
|
||||
@ResponseBody
|
||||
public Object init(@RequestParam(value = "FILE", required = false) MultipartFile[] FILE) throws Exception {
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
PageData request = this.getPageData();
|
||||
textlibraryService.init(request, FILE);
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/list")
|
||||
@ResponseBody
|
||||
public Object list(Page page) throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
PageData pd = this.getPageData();
|
||||
String KEYWORDS = pd.getString("KEYWORDS");
|
||||
if (Tools.notEmpty(KEYWORDS)) pd.put("KEYWORDS", KEYWORDS.trim());
|
||||
List<String> labels_condition = new ArrayList<>();
|
||||
List<String> category_condition = new ArrayList<>();
|
||||
|
||||
if (StringUtils.isNotEmpty(pd.getString("labels"))) {
|
||||
List<PageData> _labels = Warden.getList(pd.getString("labels"));
|
||||
List<String> labels = _labels.stream().map(n -> n.getString("BUS_LABEL_FACTORY_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
if (labels.size() > 0) labels_condition.addAll(labels);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pd.getString("CATEGORY_LIST"))) {
|
||||
List<PageData> _category_list = Warden.getList(pd.getString("CATEGORY_LIST"));
|
||||
List<String> category_list = _category_list.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
if (category_list.size() > 0) category_condition.addAll(category_list);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pd.getString("SPECIFICATION_TYPES"))) {
|
||||
List<PageData> _SPECIFICATION_TYPES = Warden.getList(pd.getString("SPECIFICATION_TYPES"));
|
||||
List<String> specification_types = _SPECIFICATION_TYPES.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
if (specification_types.size() > 0) category_condition.addAll(specification_types);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pd.getString("TYPES"))) {
|
||||
List<PageData> _TYPES = Warden.getList(pd.getString("TYPES"));
|
||||
List<String> types = _TYPES.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
if (types.size() > 0) category_condition.addAll(types);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(pd.getString("ATTRIBUTE_LIST"))) {
|
||||
List<PageData> _TYPES = Warden.getList(pd.getString("ATTRIBUTE_LIST"));
|
||||
List<String> types = _TYPES.stream().map(n -> n.getString("DICTIONARIES_ID")).filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||
if (types.size() > 0) category_condition.addAll(types);
|
||||
}
|
||||
|
||||
pd.put("LABELS", labels_condition.toArray());
|
||||
pd.put("CATEGORY_IDS", category_condition.toArray());
|
||||
|
||||
PageData condition = new PageData();
|
||||
condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
PageData corp_info = corpInfoService.findById(condition);
|
||||
|
||||
if (StringUtils.isEmpty(corp_info.getString("CORP_TYPE4"))) {
|
||||
if (StringUtils.isEmpty(corp_info.getString("CORP_TYPE3"))) {
|
||||
if (StringUtils.isEmpty(corp_info.getString("CORP_TYPE2"))) {
|
||||
pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE"));
|
||||
} else {
|
||||
pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE2"));
|
||||
}
|
||||
} else {
|
||||
pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE3"));
|
||||
}
|
||||
} else {
|
||||
pd.put("CATEGORY_ID", corp_info.getString("CORP_TYPE4"));
|
||||
}
|
||||
if (StringUtils.isEmpty(pd.getString("CORPINFO_ID")))
|
||||
pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
|
||||
|
||||
if ("3".equals(pd.getString("ASSOCIATION"))) {
|
||||
pd.put("TYPE_ONE", "43ed4012090d4614bb35da60d06c8264");
|
||||
pd.put("plan",pd.getString("CATEGORY_ID"));
|
||||
pd.put("CATEGORY_ID","");
|
||||
}
|
||||
if ("2".equals(pd.getString("ASSOCIATION"))){
|
||||
pd.put("TYPE_ONE", "7158f688d0f34054a28a9275139298df");
|
||||
}
|
||||
if ("1".equals(pd.getString("ASSOCIATION"))){
|
||||
pd.put("TYPE_ONE", "691346658ed744a1bda2ed3a755f606c");
|
||||
}
|
||||
if ("0".equals(pd.getString("ASSOCIATION"))){
|
||||
pd.put("TYPE_ONE", "8051d985a2bc406a83ea9360b64182b2");
|
||||
}
|
||||
|
||||
pd.put("STATUS","1");
|
||||
|
||||
page.setPd(pd);
|
||||
List<PageData> varList = textlibraryService.list(page);
|
||||
map.put("varList", varList);
|
||||
map.put("page", page);
|
||||
map.put("result", "success");
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/delete")
|
||||
@ResponseBody
|
||||
public Object delete() throws Exception {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
map.put("result", "success");
|
||||
try {
|
||||
PageData pd = this.getPageData();
|
||||
textlibraryService.delete(pd);
|
||||
map.put("code", "0");
|
||||
return map;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
map.put("code", "9999");
|
||||
map.put("errorMessage", e.getMessage());
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 去修改页面获取数据
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/goEdit")
|
||||
@ResponseBody
|
||||
public Object goEdit() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
pd = textlibraryService.findById(pd); //根据ID读取
|
||||
map.put("data", pd);
|
||||
map.put("result", errInfo);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/deleteAll")
|
||||
@ResponseBody
|
||||
public Object deleteAll() throws Exception {
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
String errInfo = "success";
|
||||
PageData pd = new PageData();
|
||||
pd = this.getPageData();
|
||||
String DATA_IDS = pd.getString("DATA_IDS");
|
||||
if (Tools.notEmpty(DATA_IDS)) {
|
||||
String ArrayDATA_IDS[] = DATA_IDS.split(",");
|
||||
textlibraryService.deleteAll(ArrayDATA_IDS);
|
||||
errInfo = "success";
|
||||
} else {
|
||||
errInfo = "error";
|
||||
}
|
||||
map.put("result", errInfo); //返回结果
|
||||
return map;
|
||||
}
|
||||
|
||||
@RequestMapping("lock")
|
||||
@ResponseBody
|
||||
public Object lock() throws Exception {
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
try {
|
||||
PageData request = this.getPageData();
|
||||
textlibraryService.lock(request);
|
||||
response.put("code", "0");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("code", "9999");
|
||||
response.put("message", e.getMessage());
|
||||
}
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping("top")
|
||||
@ResponseBody
|
||||
public Object top() throws Exception {
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
try {
|
||||
PageData request = this.getPageData();
|
||||
textlibraryService.top(request);
|
||||
response.put("code", "0");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("code", "9999");
|
||||
response.put("message", e.getMessage());
|
||||
}
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping("updateFile")
|
||||
@ResponseBody
|
||||
public Object updateFile(@RequestParam(value = "FILE", required = false) MultipartFile[] FILE) throws Exception {
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
try {
|
||||
textlibraryService.updateFile(FILE, this.getPageData());
|
||||
response.put("code", "0");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("code", "9999");
|
||||
response.put("message", e.getMessage());
|
||||
}
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping("getUpdateLog")
|
||||
@ResponseBody
|
||||
public Object getUpdateLog() throws Exception {
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
try {
|
||||
response.put("list", textlibraryService.getUpdateLog(this.getPageData()));
|
||||
response.put("code", "0");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("code", "9999");
|
||||
response.put("message", e.getMessage());
|
||||
}
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping("setStatus")
|
||||
@ResponseBody
|
||||
public Object setStatus() throws Exception {
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
try {
|
||||
textlibraryService.setStatus(this.getPageData());
|
||||
response.put("code", "0");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("code", "9999");
|
||||
response.put("message", e.getMessage());
|
||||
}
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping("getTextInfo")
|
||||
@ResponseBody
|
||||
public Object getTextInfo() throws Exception{
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
try {
|
||||
PageData text_info = textlibraryService.getTextInfo(this.getPageData());
|
||||
response.put("info",text_info);
|
||||
response.put("code", "0");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("code", "9999");
|
||||
response.put("message", e.getMessage());
|
||||
}
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
|
||||
@RequestMapping("exportWord")
|
||||
public void exportWord(HttpServletResponse response) throws Exception{
|
||||
try {
|
||||
textlibraryService.exportWord(this.getPageData(),response);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("copyToOperate")
|
||||
@ResponseBody
|
||||
public Object copyToOperate() throws Exception{
|
||||
Map<String, Object> response = new HashMap<>();
|
||||
try {
|
||||
textlibraryService.copyToOperate(this.getPageData());
|
||||
response.put("code", "0");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
response.put("code", "9999");
|
||||
response.put("message", e.getMessage());
|
||||
}
|
||||
response.put("result", "success");
|
||||
return response;
|
||||
}
|
||||
}
|
|
@ -84,5 +84,7 @@ public interface CorpInfoMapper{
|
|||
List<PageData> datalistPageRetrieval(Page page);
|
||||
|
||||
List<PageData> listAllForMap(PageData pd);
|
||||
|
||||
PageData getInfo(PageData corpCondition);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.mapper.datasource.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:标签库
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface LabelFactoryMapper {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
List<PageData> findByAncestors(PageData condition);
|
||||
|
||||
void deleteByAncestors(PageData leafInfo);
|
||||
|
||||
List<PageData> findAllAncestors(PageData condition);
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.zcloud.mapper.datasource.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:文本关联标签
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface LibraryLabelsMapper {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
List<PageData> findBylibraryId(PageData info);
|
||||
|
||||
void deleteByLibraryId(PageData condition);
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.zcloud.mapper.datasource.depository;
|
||||
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:文本信息
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface LibraryLogMapper {
|
||||
|
||||
void save(PageData entity) throws Exception;
|
||||
|
||||
PageData findById(PageData condition) throws Exception;
|
||||
|
||||
List<PageData> findByLogId(PageData condition) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.mapper.datasource.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:包保责任人明细项
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-10-13
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TermLibraryMapper{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.mapper.datasource.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:文件内容详情
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-08-16
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TextInfoMapper {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
PageData findByMainId(PageData textInfo);
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.mapper.datasource.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:文本信息
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TextLibraryMapper {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void save(PageData pd);
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void delete(PageData pd);
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
void edit(PageData pd);
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> datalistPage(Page page);
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PageData> listAll(PageData pd);
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
PageData findById(PageData pd);
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteAll(String[] ArrayDATA_IDS);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
package com.zcloud.service.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:标签库
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface LabelFactoryService {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
List<PageData> getTree(PageData condition) throws Exception;
|
||||
|
||||
List<PageData> saveTree(PageData pd) throws Exception;
|
||||
|
||||
List<PageData> findAllAncestors(PageData condition) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.zcloud.service.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:包保责任人明细项
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-10-13
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TermLibraryService{
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.zcloud.service.depository;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:文本信息
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
public interface TextLibraryService {
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception;
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception;
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception;
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception;
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception;
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception;
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception;
|
||||
|
||||
void init(PageData request, MultipartFile [] file) throws Exception;
|
||||
|
||||
void lock(PageData request) throws Exception;
|
||||
|
||||
void top(PageData request) throws Exception;
|
||||
|
||||
void updateFile(MultipartFile[] file, PageData pageData) throws Exception;
|
||||
|
||||
List<PageData> getUpdateLog(PageData pageData) throws Exception;
|
||||
|
||||
void setStatus(PageData pageData) throws Exception;
|
||||
|
||||
void exportWord(PageData pageData, HttpServletResponse response) throws Exception;
|
||||
|
||||
PageData getTextInfo(PageData pageData);
|
||||
|
||||
void copyToOperate(PageData pageData) throws Exception;
|
||||
}
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
package com.zcloud.service.depository.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.depository.LabelFactoryMapper;
|
||||
import com.zcloud.service.depository.LabelFactoryService;
|
||||
import com.zcloud.util.DateUtil;
|
||||
import com.zcloud.util.Jurisdiction;
|
||||
import com.zcloud.util.Warden;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:标签库
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class LabelFacoryServiceImpl implements LabelFactoryService {
|
||||
|
||||
@Resource
|
||||
private LabelFactoryMapper labelFactoryMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception {
|
||||
labelFactoryMapper.save(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception {
|
||||
labelFactoryMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception {
|
||||
labelFactoryMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page) throws Exception {
|
||||
return labelFactoryMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表(全部)
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd) throws Exception {
|
||||
return labelFactoryMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd) throws Exception {
|
||||
return labelFactoryMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS) throws Exception {
|
||||
labelFactoryMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> getTree(PageData request) throws Exception {
|
||||
List<PageData> result = new ArrayList<>();
|
||||
PageData condition = new PageData();
|
||||
List<PageData> labels = labelFactoryMapper.findByAncestors(condition);
|
||||
for (PageData label : labels) {
|
||||
if ("1".equals(label.getString("IS_ANCESTORS_FLAG"))){
|
||||
condition.clear();
|
||||
condition.put("BUS_LABEL_FACTORY_ID",label.getString("BUS_LABEL_FACTORY_ID"));
|
||||
PageData ancestors = labelFactoryMapper.findById(condition);
|
||||
analysis(labels, ancestors);
|
||||
if (ancestors != null) {
|
||||
result.add(ancestors);
|
||||
}
|
||||
}
|
||||
}
|
||||
result = result.stream().sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString())))).collect(Collectors.toList());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<PageData> saveTree(PageData pd) throws Exception {
|
||||
// 组织
|
||||
List<PageData> _tree = Warden.getList(pd.getString("tree"));
|
||||
PageData condition = new PageData();
|
||||
// 删除所有标签
|
||||
condition.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
|
||||
condition.put("TYPE",pd.getString("TYPE"));
|
||||
labelFactoryMapper.deleteByAncestors(condition);
|
||||
List<PageData> result = new ArrayList<>();
|
||||
for (PageData leaf : _tree) {
|
||||
Warden.initDate(leaf);
|
||||
leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
if (leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30) {
|
||||
if ("1".equals(leaf.getString("IS_ANCESTORS_FLAG"))) {
|
||||
leaf.put("NAME", leaf.getString("NAME"));
|
||||
labelFactoryMapper.save(leaf);
|
||||
} else {
|
||||
leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID"));
|
||||
leaf.put("NAME", leaf.getString("NAME"));
|
||||
leaf.put("PARENT_ID", "0");
|
||||
leaf.put("IS_ANCESTORS_FLAG", "1");
|
||||
leaf.put("TYPE", pd.getString("TYPE"));
|
||||
labelFactoryMapper.save(leaf);
|
||||
}
|
||||
} else {
|
||||
leaf.put("BUS_LABEL_FACTORY_ID", Warden.get32UUID());
|
||||
leaf.put("ANCESTORS_ID", leaf.getString("BUS_LABEL_FACTORY_ID"));
|
||||
leaf.put("NAME", leaf.getString("NAME"));
|
||||
leaf.put("PARENT_ID", "0");
|
||||
leaf.put("IS_ANCESTORS_FLAG", "1");
|
||||
leaf.put("TYPE", pd.getString("TYPE"));
|
||||
labelFactoryMapper.save(leaf);
|
||||
}
|
||||
analysis(leaf, result, 1);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> findAllAncestors(PageData condition) throws Exception {
|
||||
return labelFactoryMapper.findAllAncestors(condition);
|
||||
}
|
||||
|
||||
private void analysis(PageData pd, List<PageData> result, Integer level) {
|
||||
JSONArray children = (JSONArray) pd.get("children");
|
||||
if (children == null || children.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
List<PageData> tree = Warden.getList(children);
|
||||
result.addAll(tree);
|
||||
for (PageData leaf : tree) {
|
||||
leaf.put("BUS_LABEL_FACTORY_ID", leaf.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? leaf.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID());
|
||||
leaf.put("ANCESTORS_ID", pd.getString("ANCESTORS_ID"));
|
||||
leaf.put("PARENT_ID", pd.getString("BUS_LABEL_FACTORY_ID"));
|
||||
leaf.put("IS_ANCESTORS_FLAG", "0");
|
||||
leaf.put("LEVEL", level);
|
||||
leaf.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||
leaf.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
leaf.put("CREATED_TIME", DateUtil.date2Str(new Date()));
|
||||
leaf.put("ISDELETE", "0");
|
||||
leaf.put("TYPE", pd.getString("TYPE"));
|
||||
labelFactoryMapper.save(leaf);
|
||||
analysis(leaf, result, ++level);
|
||||
}
|
||||
}
|
||||
|
||||
private void analysis(List<PageData> labels, PageData parent) {
|
||||
List<PageData> sons = labels.stream()
|
||||
.filter(n -> n.getString("PARENT_ID").equals(parent.getString("BUS_LABEL_FACTORY_ID")))
|
||||
.sorted(Comparator.comparing(o -> new BigDecimal(String.valueOf(o.get("SORT").toString()))))
|
||||
.collect(Collectors.toList());
|
||||
if (parent == null) {
|
||||
return;
|
||||
}
|
||||
parent.put("children", sons);
|
||||
if (sons.size() > 0) {
|
||||
for (PageData son : sons) {
|
||||
analysis(labels, son);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private PageData findParentNode(List<PageData> tree, PageData branch) throws Exception {
|
||||
for (PageData root : tree) {
|
||||
List<PageData> branches = (List<PageData>) root.get("children");
|
||||
if (branches.size() <= 0) {
|
||||
continue;
|
||||
}
|
||||
for (PageData _branch : branches) {
|
||||
if (branch.getString("BUS_LABEL_FACTORY_ID").equals(_branch.getString("BUS_LABEL_FACTORY_ID"))) {
|
||||
return root;
|
||||
}
|
||||
}
|
||||
PageData parentNode = findParentNode(branches, branch);
|
||||
if (parentNode != null && parentNode.size() > 0) {
|
||||
return parentNode;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void initNode(PageData info, PageData gene) {
|
||||
info.put("BUS_LABEL_FACTORY_ID", info.get("BUS_LABEL_FACTORY_ID").toString().length() > 30 ? info.getString("BUS_LABEL_FACTORY_ID") : Warden.get32UUID());
|
||||
info.put("PARENT_ID", gene.getString("BUS_LABEL_FACTORY_ID"));
|
||||
info.put("ANCESTORS_ID", gene.getString("ANCESTORS_ID"));
|
||||
info.put("IS_ANCESTORS_FLAG", "0");
|
||||
info.put("LEVEL", Integer.parseInt(gene.get("LEVEL").toString()) + 1);
|
||||
info.put("CREATOR_ID", Jurisdiction.getUSER_ID());
|
||||
info.put("CREATED_TIME", DateUtil.date2Str(new Date()));
|
||||
info.put("ISDELETE", "0");
|
||||
info.put("TYPE", gene.getString("TYPE"));
|
||||
JSONArray _children = (JSONArray) info.get("children");
|
||||
if (_children == null || _children.size() <= 0) {
|
||||
return;
|
||||
}
|
||||
List<PageData> children = Warden.getList(_children);
|
||||
for (PageData child : children) {
|
||||
initNode(child, info);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package com.zcloud.service.depository.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.depository.TermLibraryMapper;
|
||||
import com.zcloud.service.depository.TermLibraryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 说明:包保责任人明细项
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2023-10-13
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class TermLibraryServiceImpl implements TermLibraryService {
|
||||
|
||||
@Resource
|
||||
private TermLibraryMapper termlibraryMapper;
|
||||
|
||||
/**新增
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd)throws Exception{
|
||||
termlibraryMapper.save(pd);
|
||||
}
|
||||
|
||||
/**删除
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd)throws Exception{
|
||||
termlibraryMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**修改
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd)throws Exception{
|
||||
termlibraryMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**列表
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page)throws Exception{
|
||||
return termlibraryMapper.datalistPage(page);
|
||||
}
|
||||
|
||||
/**列表(全部)
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd)throws Exception{
|
||||
return termlibraryMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**通过id获取数据
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public PageData findById(PageData pd)throws Exception{
|
||||
return termlibraryMapper.findById(pd);
|
||||
}
|
||||
|
||||
/**批量删除
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS)throws Exception{
|
||||
termlibraryMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,416 @@
|
|||
package com.zcloud.service.depository.impl;
|
||||
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import com.zcloud.mapper.datasource.bus.CorpInfoMapper;
|
||||
import com.zcloud.mapper.datasource.depository.LibraryLabelsMapper;
|
||||
import com.zcloud.mapper.datasource.depository.LibraryLogMapper;
|
||||
import com.zcloud.mapper.datasource.depository.TextInfoMapper;
|
||||
import com.zcloud.mapper.datasource.depository.TextLibraryMapper;
|
||||
import com.zcloud.service.depository.TextLibraryService;
|
||||
import com.zcloud.util.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 说明:文本信息
|
||||
* 作者:luoxiaobao
|
||||
* 时间:2022-12-27
|
||||
* 官网:www.zcloudchina.com
|
||||
*/
|
||||
@Service
|
||||
@Transactional //开启事物
|
||||
public class TextLibraryServiceImpl implements TextLibraryService {
|
||||
|
||||
@Resource
|
||||
private TextLibraryMapper textlibraryMapper;
|
||||
|
||||
@Resource
|
||||
private LibraryLabelsMapper libraryLabelsMapper;
|
||||
|
||||
@Resource
|
||||
private LibraryLogMapper libraryLogMapper;
|
||||
|
||||
@Resource
|
||||
private CorpInfoMapper corpInfoMapper;
|
||||
|
||||
@Resource
|
||||
private Smb smb;
|
||||
|
||||
@Resource
|
||||
private TextInfoMapper textInfoMapper;
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void save(PageData pd) throws Exception {
|
||||
textlibraryMapper.save(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void delete(PageData pd) throws Exception {
|
||||
PageData entity = textlibraryMapper.findById(pd);
|
||||
if (StringUtils.isNotBlank(entity.getString("LOCKTOOL"))) {
|
||||
throw new RuntimeException("数据已被锁定,请先解锁数据");
|
||||
}
|
||||
textlibraryMapper.delete(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public void edit(PageData pd) throws Exception {
|
||||
textlibraryMapper.edit(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
* @param page
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> list(Page page) throws Exception {
|
||||
List<PageData> list = textlibraryMapper.datalistPage(page);
|
||||
for (PageData entity : list) {
|
||||
List<PageData> _labels = libraryLabelsMapper.findBylibraryId(entity);
|
||||
// 安全操作规程
|
||||
entity.put("labels", _labels.stream().filter(n -> n.get("BUS_LABEL_FACTORY_ID") != null).collect(Collectors.toList()));
|
||||
entity.put("TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("TYPES")).collect(Collectors.toList()));
|
||||
entity.put("SPECIFICATION_TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("SPECIFICATION_TYPES")).collect(Collectors.toList()));
|
||||
entity.put("ATTRIBUTE_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("ATTRIBUTE_LIST")).collect(Collectors.toList()));
|
||||
entity.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).collect(Collectors.toList()));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表(全部)
|
||||
*
|
||||
* @param pd
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<PageData> listAll(PageData pd) throws Exception {
|
||||
return textlibraryMapper.listAll(pd);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id获取数据
|
||||
*
|
||||
* @param condition 查询条件
|
||||
* @throws Exception all
|
||||
*/
|
||||
public PageData findById(PageData condition) throws Exception {
|
||||
PageData info = textlibraryMapper.findById(condition);
|
||||
if (info != null && info.size() > 0) {
|
||||
List<PageData> _labels = libraryLabelsMapper.findBylibraryId(info);
|
||||
if ("0".equals(info.getString("ASSOCIATION")) || "1".equals(info.getString("ASSOCIATION")) || "2".equals(info.getString("ASSOCIATION"))) {
|
||||
info.put("labels", _labels.stream().filter(n -> n.get("BUS_LABEL_FACTORY_ID") != null).collect(Collectors.toList()));
|
||||
info.put("TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("TYPES")).map(Warden::addDic).collect(Collectors.toList()));
|
||||
info.put("SPECIFICATION_TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("SPECIFICATION_TYPES")).map(Warden::addDic).collect(Collectors.toList()));
|
||||
info.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).map(Warden::addDic).collect(Collectors.toList()));
|
||||
}
|
||||
if ("3".equals(info.getString("ASSOCIATION"))) {
|
||||
info.put("TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("TYPES")).map(Warden::addDic).collect(Collectors.toList()));
|
||||
info.put("labels", _labels.stream().filter(n -> n.get("BUS_LABEL_FACTORY_ID") != null).collect(Collectors.toList()));
|
||||
info.put("SPECIFICATION_TYPES", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("SPECIFICATION_TYPES")).map(Warden::addDic).collect(Collectors.toList()));
|
||||
info.put("ATTRIBUTE_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("ATTRIBUTE_LIST")).map(Warden::addDic).collect(Collectors.toList()));
|
||||
info.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).map(Warden::addDic).collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ArrayDATA_IDS
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAll(String[] ArrayDATA_IDS) throws Exception {
|
||||
textlibraryMapper.deleteAll(ArrayDATA_IDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(PageData condition, MultipartFile[] file) throws Exception {
|
||||
if (file != null && file.length > 0) {
|
||||
String path = smb.saveFile(file[0]);
|
||||
condition.put("PATH", path);
|
||||
}
|
||||
if (StringUtils.isNotBlank(condition.getString("BUS_TEXT_LIBRARY_ID"))) {
|
||||
// 保存历史文件
|
||||
PageData entity = textlibraryMapper.findById(condition);
|
||||
condition.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH")));
|
||||
condition.put("CREATED_TIME", entity.get("CREATED_TIME"));
|
||||
condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
condition.put("STATUS", "1");
|
||||
textlibraryMapper.edit(condition);
|
||||
libraryLabelsMapper.deleteByLibraryId(condition);
|
||||
List<PageData> types = Warden.getList(condition.getString("TYPES"));
|
||||
List<PageData> list = new ArrayList<>(types);
|
||||
|
||||
PageData corp_condition = new PageData();
|
||||
corp_condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
PageData corp = corpInfoMapper.getInfo(corp_condition);
|
||||
|
||||
List<PageData> specificationTypes = Warden.initSpecificationTypes(corp);
|
||||
list.addAll(specificationTypes);
|
||||
List<PageData> labels = Warden.getList(condition.getString("labels"));
|
||||
list.addAll(labels);
|
||||
if ("3".equals(condition.getString("ASSOCIATION"))) {
|
||||
List<PageData> attributeList = Warden.getList(condition.getString("ATTRIBUTE_LIST"));
|
||||
list.addAll(attributeList);
|
||||
List<PageData> specification_types = Warden.getList(condition.getString("SPECIFICATION_TYPES"));
|
||||
list.addAll(specification_types);
|
||||
|
||||
PageData type = new PageData();
|
||||
type.put("CATEGORY_ID", "43ed4012090d4614bb35da60d06c8264");
|
||||
type.put("CATEGORY", "TYPES");
|
||||
type.put("CATEGORY_NAME", "企业预案");
|
||||
list.add(type);
|
||||
} else {
|
||||
List<PageData> category_list = Warden.getList(condition.getString("CATEGORY_LIST"));
|
||||
list.addAll(category_list);
|
||||
}
|
||||
|
||||
for (PageData _label : list) {
|
||||
PageData label = new PageData();
|
||||
label.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
label.put("BUS_LIBRARY_LABELS_ID", Warden.get32UUID());
|
||||
label.put("BUS_LABEL_FACTORY_ID", _label.getString("BUS_LABEL_FACTORY_ID"));
|
||||
label.put("NAME", _label.getString("NAME"));
|
||||
label.put("ISDELETE", "0");
|
||||
if (StringUtils.isNotEmpty(_label.getString("CATEGORY_ID")))
|
||||
label.put("CATEGORY_ID", _label.getString("CATEGORY_ID"));
|
||||
if (StringUtils.isNotEmpty(_label.getString("CATEGORY")))
|
||||
label.put("CATEGORY", _label.getString("CATEGORY"));
|
||||
if (StringUtils.isNotEmpty(_label.getString("CATEGORY_NAME")))
|
||||
label.put("CATEGORY_NAME", _label.getString("CATEGORY_NAME"));
|
||||
libraryLabelsMapper.save(label);
|
||||
}
|
||||
if (StringUtils.isNotBlank(condition.getString("TEXT_INFO"))) {
|
||||
PageData text_info = new PageData();
|
||||
text_info.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
text_info = textInfoMapper.findByMainId(text_info);
|
||||
if (text_info == null || text_info.size() == 0) {
|
||||
text_info = new PageData();
|
||||
text_info.put("CREATED_TIME", new Date());
|
||||
text_info.put("TEXT_INFO_ID", Warden.get32UUID());
|
||||
text_info.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
text_info.put("ISDELETE", "0");
|
||||
text_info.put("OPERATE_TIME", new Date());
|
||||
text_info.put("TEXT_INFO", condition.getString("TEXT_INFO"));
|
||||
textInfoMapper.save(text_info);
|
||||
} else {
|
||||
text_info.put("OPERATE_TIME", new Date());
|
||||
text_info.put("TEXT_INFO", condition.getString("TEXT_INFO"));
|
||||
text_info.put("ISDELETE", "0");
|
||||
textInfoMapper.edit(text_info);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
condition.put("BUS_TEXT_LIBRARY_ID", Warden.get32UUID());
|
||||
condition.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH")));
|
||||
condition.put("UPLOAD_TIME", DateUtil.date2Str(new Date()));
|
||||
condition.put("UPLOAD_USER", Jurisdiction.getUSER_ID());
|
||||
condition.put("UPLOAD_USER_NAME", Jurisdiction.getUsername());
|
||||
condition.put("CREATED_TIME", new Date());
|
||||
condition.put("ISDELETE", "0");
|
||||
condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
condition.put("STATUS", "1");
|
||||
textlibraryMapper.save(condition);
|
||||
|
||||
List<PageData> list = new ArrayList<>();
|
||||
|
||||
PageData corp_condition = new PageData();
|
||||
corp_condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
PageData corp = corpInfoMapper.getInfo(corp_condition);
|
||||
|
||||
List<PageData> specificationTypes = Warden.initSpecificationTypes(corp);
|
||||
if ("3".equals(condition.getString("ASSOCIATION"))) {
|
||||
List<PageData> attributeList = Warden.getList(condition.getString("ATTRIBUTE_LIST"));
|
||||
list.addAll(attributeList);
|
||||
|
||||
List<PageData> specification_types = Warden.getList(condition.getString("SPECIFICATION_TYPES"));
|
||||
list.addAll(specification_types);
|
||||
|
||||
PageData type = new PageData();
|
||||
type.put("CATEGORY_ID", "43ed4012090d4614bb35da60d06c8264");
|
||||
type.put("CATEGORY", "TYPES");
|
||||
type.put("CATEGORY_NAME", "企业预案");
|
||||
list.add(type);
|
||||
|
||||
for (PageData entity : specificationTypes) {
|
||||
entity.put("CATEGORY", "CATEGORY_LIST");
|
||||
}
|
||||
} else {
|
||||
List<PageData> category_list = Warden.getList(condition.getString("CATEGORY_LIST"));
|
||||
list.addAll(category_list);
|
||||
}
|
||||
list.addAll(specificationTypes);
|
||||
|
||||
List<PageData> labels = Warden.getList(condition.getString("labels"));
|
||||
List<PageData> types = Warden.getList(condition.getString("TYPES"));
|
||||
|
||||
list.addAll(labels);
|
||||
list.addAll(types);
|
||||
for (PageData _label : list) {
|
||||
PageData label = new PageData();
|
||||
label.put("BUS_LIBRARY_LABELS_ID", Warden.get32UUID());
|
||||
label.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
label.put("BUS_LABEL_FACTORY_ID", _label.getString("BUS_LABEL_FACTORY_ID"));
|
||||
label.put("NAME", _label.getString("NAME"));
|
||||
label.put("ISDELETE", "0");
|
||||
label.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
if (StringUtils.isNotEmpty(_label.getString("CATEGORY")))
|
||||
label.put("CATEGORY", _label.getString("CATEGORY"));
|
||||
if (StringUtils.isNotEmpty(_label.getString("CATEGORY_ID")))
|
||||
label.put("CATEGORY_ID", _label.getString("CATEGORY_ID"));
|
||||
if (StringUtils.isNotEmpty(_label.getString("CATEGORY_NAME")))
|
||||
label.put("CATEGORY_NAME", _label.getString("CATEGORY_NAME"));
|
||||
libraryLabelsMapper.save(label);
|
||||
}
|
||||
|
||||
PageData text_info = new PageData();
|
||||
text_info.put("CREATED_TIME", new Date());
|
||||
text_info.put("OPERATE_TIME", new Date());
|
||||
text_info.put("TEXT_INFO_ID", Warden.get32UUID());
|
||||
text_info.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
text_info.put("TEXT_INFO", condition.getString("TEXT_INFO"));
|
||||
text_info.put("ISDELETE", "0");
|
||||
textInfoMapper.save(text_info);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void lock(PageData request) throws Exception {
|
||||
PageData entity = textlibraryMapper.findById(request);
|
||||
Optional.ofNullable(entity).orElseThrow(() -> new RuntimeException("数据不正确"));
|
||||
if ("1".equals(request.getString("isLock"))) {
|
||||
entity.put("LOCKTOOL", Jurisdiction.getUSER_ID());
|
||||
textlibraryMapper.edit(entity);
|
||||
} else {
|
||||
if (Jurisdiction.getUSER_ID().equals(entity.getString("LOCKTOOL"))) {
|
||||
entity.put("LOCKTOOL", null);
|
||||
textlibraryMapper.edit(entity);
|
||||
} else {
|
||||
throw new RuntimeException("此条数据不能解锁,因为您不是锁定数据人");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void top(PageData request) throws Exception {
|
||||
PageData entity = textlibraryMapper.findById(request);
|
||||
Optional.ofNullable(entity).orElseThrow(() -> new RuntimeException("数据不正确"));
|
||||
if ("1".equals(request.getString("isTop"))) {
|
||||
entity.put("ISTOPTIME", new Date().getTime());
|
||||
textlibraryMapper.edit(entity);
|
||||
} else {
|
||||
entity.put("ISTOPTIME", null);
|
||||
textlibraryMapper.edit(entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFile(MultipartFile[] file, PageData pageData) throws Exception {
|
||||
if (file == null || file.length <= 0) throw new RuntimeException("系统异常,没用要更新的文件");
|
||||
String path = smb.saveFile(file[0]);
|
||||
|
||||
PageData condition = new PageData();
|
||||
condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
PageData entity = textlibraryMapper.findById(condition);
|
||||
|
||||
PageData log = new PageData();
|
||||
log.put("LIBRARY_LOG_ID", Warden.get32UUID());
|
||||
log.put("PATH", entity.getString("PATH"));
|
||||
log.put("BUS_TEXT_LIBRARY_ID", condition.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
Warden.initDate(log);
|
||||
libraryLogMapper.save(log);
|
||||
entity.put("PATH", path);
|
||||
textlibraryMapper.edit(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PageData> getUpdateLog(PageData pageData) throws Exception {
|
||||
PageData condition = new PageData();
|
||||
condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
return libraryLogMapper.findByLogId(condition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStatus(PageData pageData) throws Exception {
|
||||
PageData condtion = new PageData();
|
||||
condtion.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
PageData entity = textlibraryMapper.findById(condtion);
|
||||
entity.put("STATUS", pageData.getString("STATUS"));
|
||||
textlibraryMapper.edit(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void copyToOperate(PageData pageData) throws Exception {
|
||||
PageData condition = new PageData();
|
||||
condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
PageData info = textlibraryMapper.findById(condition);
|
||||
List<PageData> label_list = libraryLabelsMapper.findBylibraryId(condition);
|
||||
//复制数据
|
||||
info.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
|
||||
info.put("BUS_TEXT_LIBRARY_ID", Warden.get32UUID());
|
||||
// 2023-08-17 张志军要求,从其他企业加入库的数据自动置顶
|
||||
info.put("ISTOPTIME", null);
|
||||
|
||||
for (PageData entity : label_list) {
|
||||
entity.put("BUS_TEXT_LIBRARY_ID", info.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
entity.put("BUS_LIBRARY_LABELS_ID", Warden.get32UUID());
|
||||
}
|
||||
|
||||
textlibraryMapper.save(info);
|
||||
for (PageData entity : label_list) {
|
||||
libraryLabelsMapper.save(entity);
|
||||
}
|
||||
|
||||
PageData text_info = textInfoMapper.findByMainId(condition);
|
||||
if (text_info != null && text_info.size() > 0){
|
||||
text_info.put("TEXT_INFO_ID",Warden.get32UUID());
|
||||
text_info.put("BUS_TEXT_LIBRARY_ID",info.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
textInfoMapper.save(text_info);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageData getTextInfo(PageData pageData) {
|
||||
return textInfoMapper.findByMainId(pageData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void exportWord(PageData pageData, HttpServletResponse response) throws Exception {
|
||||
PageData condition = new PageData();
|
||||
condition.put("BUS_TEXT_LIBRARY_ID", pageData.getString("BUS_TEXT_LIBRARY_ID"));
|
||||
PageData info = textInfoMapper.findByMainId(condition);
|
||||
|
||||
//2023-08-21 created by liu jun 解决文本样式问题
|
||||
WordUtil.exportHtmlToWord(null,response,info.getString("TEXT_INFO"),"data");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -284,4 +284,25 @@ public class Smb {
|
|||
channelSftp.exit();
|
||||
|
||||
}
|
||||
|
||||
public String saveFile(MultipartFile multipartFile) throws Exception{
|
||||
return this.saveFile(multipartFile,Const.FILEPATHFILE);
|
||||
}
|
||||
|
||||
public String saveFile(MultipartFile file, String cost) throws Exception{
|
||||
// 生成文件名
|
||||
String fileName = Warden.get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
||||
// 根据项目类型生成项目文件
|
||||
String filePath;
|
||||
if ("admin".equals(Jurisdiction.getUsername())) {
|
||||
filePath = cost + "admin" + "/" + DateUtil.getDays();
|
||||
} else {
|
||||
filePath = cost + "imgFactory" + "/" + DateUtil.getDays();
|
||||
}
|
||||
|
||||
// 保存文件
|
||||
sshSftp(file, fileName, filePath);
|
||||
// 返回文件保存目录
|
||||
return filePath + "/" + fileName;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.zcloud.entity.Page;
|
||||
import com.zcloud.entity.PageData;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
|
@ -19,10 +20,7 @@ import java.net.URLConnection;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
public class Warden {
|
||||
|
@ -294,5 +292,60 @@ public class Warden {
|
|||
}
|
||||
}
|
||||
|
||||
public static void initDate(PageData entity) {
|
||||
entity.put("CREATOR", Jurisdiction.getUSER_ID());
|
||||
entity.put("CREATE_TIME", DateUtil.getTime());
|
||||
entity.put("CREATOR_NAME", Jurisdiction.getName());
|
||||
entity.put("CREATTIME", DateUtil.getTime());
|
||||
entity.put("OPERATOR", Jurisdiction.getUSER_ID());
|
||||
entity.put("OPERATOR_NAME", Jurisdiction.getName());
|
||||
entity.put("OPERAT_TIME", DateUtil.getTime());
|
||||
entity.put("OPERATTIME", DateUtil.getTime());
|
||||
entity.put("ISDELETE", "0");
|
||||
}
|
||||
|
||||
public static PageData addDic(PageData pageData) {
|
||||
pageData.put("DICTIONARIES_ID",pageData.getString("CATEGORY_ID"));
|
||||
pageData.put("NAME",pageData.getString("CATEGORY_NAME"));
|
||||
return pageData;
|
||||
}
|
||||
|
||||
public static String getFileName(String img_path) {
|
||||
if (StringUtils.isBlank(img_path)) {
|
||||
throw new RuntimeException("被解析路径为空");
|
||||
}
|
||||
String[] info = img_path.split("/");
|
||||
return info[info.length - 1];
|
||||
}
|
||||
|
||||
public static List<PageData> initSpecificationTypes(PageData corp) {
|
||||
List<PageData> list = new ArrayList<>();
|
||||
PageData one = new PageData();
|
||||
one.put("CATEGORY","SPECIFICATION_TYPES");
|
||||
one.put("CATEGORY_ID",corp.getString("CORP_TYPE"));
|
||||
one.put("CATEGORY_NAME",corp.getString("CORP_TYPE_ONE_NAME"));
|
||||
list.add(one);
|
||||
|
||||
PageData two = new PageData();
|
||||
two.put("CATEGORY","SPECIFICATION_TYPES");
|
||||
two.put("CATEGORY_ID",corp.getString("CORP_TYPE2"));
|
||||
two.put("CATEGORY_NAME",corp.getString("CORP_TYPE_TWO_NAME"));
|
||||
list.add(two);
|
||||
|
||||
PageData three = new PageData();
|
||||
three.put("CATEGORY","SPECIFICATION_TYPES");
|
||||
three.put("CATEGORY_ID",corp.getString("CORP_TYPE3"));
|
||||
three.put("CATEGORY_NAME",corp.getString("CORP_TYPE_THREE_NAME"));
|
||||
list.add(three);
|
||||
|
||||
PageData four = new PageData();
|
||||
four.put("CATEGORY","SPECIFICATION_TYPES");
|
||||
four.put("CATEGORY_ID",corp.getString("CORP_TYPE4"));
|
||||
four.put("CATEGORY_NAME",corp.getString("CORP_TYPE_FOUR_NAME"));
|
||||
list.add(four);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,103 @@
|
|||
package com.zcloud.util;
|
||||
|
||||
import org.apache.poi.poifs.filesystem.DirectoryEntry;
|
||||
import org.apache.poi.poifs.filesystem.DocumentEntry;
|
||||
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
|
||||
|
||||
/**
|
||||
* poi操作word工具类
|
||||
* @author lei
|
||||
* @version 1.0
|
||||
* @date 2022/11/14 10:23
|
||||
*/
|
||||
public class WordUtil {
|
||||
|
||||
/**
|
||||
* 导出富文本内容到word
|
||||
* @param request
|
||||
* @param response
|
||||
* @param content 输出内容
|
||||
* @param fileName 导出文件名称
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void exportHtmlToWord(HttpServletRequest request, HttpServletResponse response, String content, String fileName) throws Exception {
|
||||
//图片转为base64方法
|
||||
//String imagebase64 = getImageStr(imagePath);
|
||||
// 拼接html格式内容
|
||||
StringBuffer sbf = new StringBuffer();
|
||||
// 这里拼接一下html标签,便于word文档能够识别
|
||||
sbf.append("<html " +
|
||||
"xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" xmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\" xmlns=\"http://www.w3.org/TR/REC-html40\"" + //将版式从web版式改成页面试图
|
||||
">");
|
||||
sbf.append("<head>" +
|
||||
"<!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View><w:TrackMoves>false</w:TrackMoves><w:TrackFormatting/><w:ValidateAgainstSchemas/><w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid><w:IgnoreMixedContent>false</w:IgnoreMixedContent><w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText><w:DoNotPromoteQF/><w:LidThemeOther>EN-US</w:LidThemeOther><w:LidThemeAsian>ZH-CN</w:LidThemeAsian><w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript><w:Compatibility><w:BreakWrappedTables/><w:SnapToGridInCell/><w:WrapTextWithPunct/><w:UseAsianBreakRules/><w:DontGrowAutofit/><w:SplitPgBreakAndParaMark/><w:DontVertAlignCellWithSp/><w:DontBreakConstrainedForcedTables/><w:DontVertAlignInTxbx/><w:Word11KerningPairs/><w:CachedColBalance/><w:UseFELayout/></w:Compatibility><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><m:mathPr><m:mathFont m:val=\"Cambria Math\"/><m:brkBin m:val=\"before\"/><m:brkBinSub m:val=\"--\"/><m:smallFrac m:val=\"off\"/><m:dispDef/><m:lMargin m:val=\"0\"/> <m:rMargin m:val=\"0\"/><m:defJc m:val=\"centerGroup\"/><m:wrapIndent m:val=\"1440\"/><m:intLim m:val=\"subSup\"/><m:naryLim m:val=\"undOvr\"/></m:mathPr></w:WordDocument></xml><![endif]-->" +
|
||||
"</head>");
|
||||
sbf.append("<body>");
|
||||
// 富文本内容
|
||||
sbf.append(content);
|
||||
sbf.append("</body></html>");
|
||||
|
||||
// 必须要设置编码,避免中文就会乱码
|
||||
byte[] b = sbf.toString().getBytes("GBK");
|
||||
// 将字节数组包装到流中
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(b);
|
||||
POIFSFileSystem poifs = new POIFSFileSystem();
|
||||
DirectoryEntry directory = poifs.getRoot();
|
||||
// 这代码不能省略,否则导出乱码。
|
||||
DocumentEntry documentEntry = directory.createDocument("WordDocument", bais);
|
||||
//输出文件
|
||||
// request.setCharacterEncoding("utf-8");
|
||||
// 导出word格式
|
||||
response.setContentType("application/msword");
|
||||
response.addHeader("Content-Disposition", "attachment;filename=" +
|
||||
new String(fileName.getBytes("GB2312"),"iso8859-1") + ".doc");
|
||||
ServletOutputStream ostream = response.getOutputStream();
|
||||
poifs.writeFilesystem(ostream);
|
||||
bais.close();
|
||||
ostream.close();
|
||||
}
|
||||
|
||||
/**
|
||||
* 富文本内容到word(本地)
|
||||
* @param content 输出内容
|
||||
* @param fileName 导出文件名称
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void exportHtmlToWord(String filepath, String content, String fileName) throws Exception {
|
||||
// 拼接html格式内容
|
||||
StringBuffer sbf = new StringBuffer();
|
||||
// 这里拼接一下html标签,便于word文档能够识别
|
||||
sbf.append("<html " +
|
||||
"xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" xmlns:m=\"http://schemas.microsoft.com/office/2004/12/omml\" xmlns=\"http://www.w3.org/TR/REC-html40\"" + //将版式从web版式改成页面试图
|
||||
">");
|
||||
sbf.append("<head>" +
|
||||
"<!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View><w:TrackMoves>false</w:TrackMoves><w:TrackFormatting/><w:ValidateAgainstSchemas/><w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid><w:IgnoreMixedContent>false</w:IgnoreMixedContent><w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText><w:DoNotPromoteQF/><w:LidThemeOther>EN-US</w:LidThemeOther><w:LidThemeAsian>ZH-CN</w:LidThemeAsian><w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript><w:Compatibility><w:BreakWrappedTables/><w:SnapToGridInCell/><w:WrapTextWithPunct/><w:UseAsianBreakRules/><w:DontGrowAutofit/><w:SplitPgBreakAndParaMark/><w:DontVertAlignCellWithSp/><w:DontBreakConstrainedForcedTables/><w:DontVertAlignInTxbx/><w:Word11KerningPairs/><w:CachedColBalance/><w:UseFELayout/></w:Compatibility><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><m:mathPr><m:mathFont m:val=\"Cambria Math\"/><m:brkBin m:val=\"before\"/><m:brkBinSub m:val=\"--\"/><m:smallFrac m:val=\"off\"/><m:dispDef/><m:lMargin m:val=\"0\"/> <m:rMargin m:val=\"0\"/><m:defJc m:val=\"centerGroup\"/><m:wrapIndent m:val=\"1440\"/><m:intLim m:val=\"subSup\"/><m:naryLim m:val=\"undOvr\"/></m:mathPr></w:WordDocument></xml><![endif]-->" +
|
||||
"</head>");
|
||||
sbf.append("<body>");
|
||||
// 富文本内容
|
||||
sbf.append(content);
|
||||
sbf.append("</body></html>");
|
||||
|
||||
// 必须要设置编码,避免中文就会乱码
|
||||
byte[] b = sbf.toString().getBytes("GBK");
|
||||
// 将字节数组包装到流中
|
||||
ByteArrayInputStream bais = new ByteArrayInputStream(b);
|
||||
POIFSFileSystem poifs = new POIFSFileSystem();
|
||||
DirectoryEntry directory = poifs.getRoot();
|
||||
// 这代码不能省略,否则导出乱码。
|
||||
DocumentEntry documentEntry = directory.createDocument("WordDocument", bais);
|
||||
|
||||
FileOutputStream out = new FileOutputStream(new File(filepath+fileName));
|
||||
poifs.writeFilesystem(out);
|
||||
bais.close();
|
||||
out.close();
|
||||
}
|
||||
}
|
|
@ -682,4 +682,53 @@
|
|||
where USER_ID = #{USER_ID}
|
||||
</update>
|
||||
|
||||
<select id="getInfo" resultType="com.zcloud.entity.PageData">
|
||||
select
|
||||
f.*,
|
||||
s.NAME as SCALE_NAME,
|
||||
r.CORPINFO_ID,
|
||||
r.AQ_BZ_LEVEL,
|
||||
r.AQ_BZ_NO,
|
||||
r.AQ_BZ_UNIT,
|
||||
r.AQ_BZ_TIME,
|
||||
r.WHETHER_HYGIENE,
|
||||
r.WHETHER_HAZARDS,
|
||||
r.WHETHER_SCARCE,
|
||||
r.WHETHER_CHEMICALS,
|
||||
r.WHETHER_SPECIALEQUIPMENT,
|
||||
r.WHETHER_SPECIALPEOPLE,
|
||||
r.WHETHER_COALGAS,
|
||||
r.WHETHER_FIRE,
|
||||
r.WHETHER_CONFINED,
|
||||
r.WHETHER_POWDER,
|
||||
r.WHETHER_LIGHTNING,
|
||||
r.WHETHER_ACTINOGEN,
|
||||
r.WHETHER_LIQUIDAMMONIA,
|
||||
r.WHETHER_PIPELINE,
|
||||
cs.NAME CORP_STATE_NAME,
|
||||
sub.NAME SUBORDINATIONNAME,
|
||||
abl.NAME AQ_BZ_LEVEL_NAME,
|
||||
dicT.NAME as TRAINTYPE_NAME,
|
||||
b.ISSTOP,
|
||||
cto.NAME as CORP_TYPE_ONE_NAME,
|
||||
ctt.NAME as CORP_TYPE_TWO_NAME,
|
||||
ctth.NAME as CORP_TYPE_THREE_NAME,
|
||||
ctf.NAME as CORP_TYPE_FOUR_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join bus_corp_stop b on b.CORPINFO_ID = f.CORPINFO_ID and b.ISDELETE = '0'
|
||||
left join SYS_DICTIONARIES s on s.DICTIONARIES_ID = f.SCALE
|
||||
LEFT JOIN bus_corp_info_related r on r.CORPINFO_ID =f.CORPINFO_ID
|
||||
LEFT JOIN SYS_DICTIONARIES cs on cs.DICTIONARIES_ID = f.CORP_STATE
|
||||
LEFT JOIN SYS_DICTIONARIES sub on sub.DICTIONARIES_ID = f.SUBORDINATION
|
||||
LEFT JOIN SYS_DICTIONARIES abl on abl.DICTIONARIES_ID = r.AQ_BZ_LEVEL
|
||||
left join SYS_DICTIONARIES dicT on dicT.DICTIONARIES_ID = f.TRAINTYPE
|
||||
left join SYS_DICTIONARIES cto on cto.DICTIONARIES_ID = f.CORP_TYPE
|
||||
left join SYS_DICTIONARIES ctt on ctt.DICTIONARIES_ID = f.CORP_TYPE2
|
||||
left join SYS_DICTIONARIES ctth on ctth.DICTIONARIES_ID = f.CORP_TYPE3
|
||||
left join SYS_DICTIONARIES ctf on ctf.DICTIONARIES_ID = f.CORP_TYPE4
|
||||
where
|
||||
f.CORPINFO_ID = #{CORPINFO_ID}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -0,0 +1,278 @@
|
|||
<?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.zcloud.mapper.datasource.depository.HiddenLibraryMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_HIDDEN_LIBRARY
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.INDUSTRY_TYPE_ONE,
|
||||
f.INDUSTRY_TYPE_TWO,
|
||||
f.INDUSTRY_TYPE_THREE,
|
||||
f.INDUSTRY_TYPE_FOUR,
|
||||
f.HIDDEN_TYPES,
|
||||
f.RISK_UNIT_ID,
|
||||
f.RISK_UNIT_NAME,
|
||||
f.HIDDEN_PART,
|
||||
f.HIDDEN_DESCR,
|
||||
f.CREATOR_ID,
|
||||
f.CREATOR_NAME,
|
||||
f.CREATED_TIME,
|
||||
f.OPERATOR_ID,
|
||||
f.OPERATOR_NAME,
|
||||
f.OPERATE_TIME,
|
||||
f.INSPECTION_BASIS,
|
||||
f.INSPECTION_INFO,
|
||||
f.RECTIFYDESCR,
|
||||
f.CORP_INFO_ID,
|
||||
f.ISDELETE,
|
||||
f.STATUS,
|
||||
f.HIDDEN_LIBRARY_ID,
|
||||
f.SOURCE,
|
||||
f.HIDDEN_TYPE_ONE,
|
||||
f.HIDDEN_TYPE_TWO,
|
||||
f.HIDDEN_TYPE_THREE
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
INDUSTRY_TYPE_ONE,
|
||||
INDUSTRY_TYPE_TWO,
|
||||
INDUSTRY_TYPE_THREE,
|
||||
INDUSTRY_TYPE_FOUR,
|
||||
HIDDEN_TYPES,
|
||||
RISK_UNIT_ID,
|
||||
RISK_UNIT_NAME,
|
||||
HIDDEN_PART,
|
||||
HIDDEN_DESCR,
|
||||
CREATOR_ID,
|
||||
CREATOR_NAME,
|
||||
CREATED_TIME,
|
||||
OPERATOR_ID,
|
||||
OPERATOR_NAME,
|
||||
OPERATE_TIME,
|
||||
INSPECTION_BASIS,
|
||||
INSPECTION_INFO,
|
||||
RECTIFYDESCR,
|
||||
CORP_INFO_ID,
|
||||
ISDELETE,
|
||||
STATUS,
|
||||
HIDDEN_LIBRARY_ID,
|
||||
SOURCE,
|
||||
HIDDEN_TYPE_ONE,
|
||||
HIDDEN_TYPE_TWO,
|
||||
HIDDEN_TYPE_THREE
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{INDUSTRY_TYPE_ONE},
|
||||
#{INDUSTRY_TYPE_TWO},
|
||||
#{INDUSTRY_TYPE_THREE},
|
||||
#{INDUSTRY_TYPE_FOUR},
|
||||
#{HIDDEN_TYPES},
|
||||
#{RISK_UNIT_ID},
|
||||
#{RISK_UNIT_NAME},
|
||||
#{HIDDEN_PART},
|
||||
#{HIDDEN_DESCR},
|
||||
#{CREATOR_ID},
|
||||
#{CREATOR_NAME},
|
||||
#{CREATED_TIME},
|
||||
#{OPERATOR_ID},
|
||||
#{OPERATOR_NAME},
|
||||
#{OPERATE_TIME},
|
||||
#{INSPECTION_BASIS},
|
||||
#{INSPECTION_INFO},
|
||||
#{RECTIFYDESCR},
|
||||
#{CORP_INFO_ID},
|
||||
#{ISDELETE},
|
||||
#{STATUS},
|
||||
#{HIDDEN_LIBRARY_ID},
|
||||
#{SOURCE},
|
||||
#{HIDDEN_TYPE_ONE},
|
||||
#{HIDDEN_TYPE_TWO},
|
||||
#{HIDDEN_TYPE_THREE}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
HIDDEN_LIBRARY_ID = #{HIDDEN_LIBRARY_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
INDUSTRY_TYPE_ONE = #{INDUSTRY_TYPE_ONE},
|
||||
INDUSTRY_TYPE_TWO = #{INDUSTRY_TYPE_TWO},
|
||||
INDUSTRY_TYPE_THREE = #{INDUSTRY_TYPE_THREE},
|
||||
INDUSTRY_TYPE_FOUR = #{INDUSTRY_TYPE_FOUR},
|
||||
HIDDEN_TYPES = #{HIDDEN_TYPES},
|
||||
RISK_UNIT_ID = #{RISK_UNIT_ID},
|
||||
RISK_UNIT_NAME = #{RISK_UNIT_NAME},
|
||||
HIDDEN_PART = #{HIDDEN_PART},
|
||||
HIDDEN_DESCR = #{HIDDEN_DESCR},
|
||||
CREATOR_ID = #{CREATOR_ID},
|
||||
CREATOR_NAME = #{CREATOR_NAME},
|
||||
CREATED_TIME = #{CREATED_TIME},
|
||||
OPERATOR_ID = #{OPERATOR_ID},
|
||||
OPERATOR_NAME = #{OPERATOR_NAME},
|
||||
OPERATE_TIME = #{OPERATE_TIME},
|
||||
INSPECTION_BASIS = #{INSPECTION_BASIS},
|
||||
INSPECTION_INFO = #{INSPECTION_INFO},
|
||||
RECTIFYDESCR = #{RECTIFYDESCR},
|
||||
CORP_INFO_ID = #{CORP_INFO_ID},
|
||||
ISDELETE = #{ISDELETE},
|
||||
STATUS = #{STATUS},
|
||||
SOURCE = #{SOURCE},
|
||||
HIDDEN_TYPE_ONE = #{HIDDEN_TYPE_ONE},
|
||||
HIDDEN_TYPE_TWO = #{HIDDEN_TYPE_TWO},
|
||||
HIDDEN_TYPE_THREE = #{HIDDEN_TYPE_THREE},
|
||||
HIDDEN_LIBRARY_ID = HIDDEN_LIBRARY_ID
|
||||
where
|
||||
HIDDEN_LIBRARY_ID = #{HIDDEN_LIBRARY_ID}
|
||||
</update>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="addToLibrary" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
STATUS = '1'
|
||||
where
|
||||
HIDDEN_LIBRARY_ID in
|
||||
<foreach item="item" index="index" collection="HIDDEN_LIBRARY_IDS" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.HIDDEN_LIBRARY_ID = #{HIDDEN_LIBRARY_ID}
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
ito.NAME as INDUSTRY_TYPE_ONE_NAME,
|
||||
a.INDUSTRY_TYPE_ONE,
|
||||
itt.NAME as INDUSTRY_TYPE_TWO_NAME,
|
||||
a.INDUSTRY_TYPE_TWO,
|
||||
itth.NAME as INDUSTRY_TYPE_THREE_NAME,
|
||||
a.INDUSTRY_TYPE_THREE,
|
||||
itf.NAME as INDUSTRY_TYPE_FOUR_NAME,
|
||||
a.INDUSTRY_TYPE_FOUR,
|
||||
hto.NAME as HIDDEN_TYPE_ONE_NAME,
|
||||
a.HIDDEN_TYPE_ONE,
|
||||
htt.NAME as HIDDEN_TYPE_TWO_NAME,
|
||||
a.HIDDEN_TYPE_TWO,
|
||||
htth.NAME as HIDDEN_TYPE_THREE_NAME,
|
||||
a.HIDDEN_TYPE_THREE,
|
||||
a.HIDDEN_TYPES,
|
||||
a.HIDDEN_PART,
|
||||
a.HIDDEN_DESCR,
|
||||
a.INSPECTION_BASIS,
|
||||
a.INSPECTION_INFO,
|
||||
a.RECTIFYDESCR,
|
||||
a.RISK_UNIT_NAME,
|
||||
a.RISK_UNIT_ID,
|
||||
a.CORP_INFO_ID,
|
||||
ci.CORP_NAME as CORP_INFO_NAME,
|
||||
a.HIDDEN_LIBRARY_ID
|
||||
from
|
||||
<include refid="tableName"></include> a
|
||||
left join sys_dictionaries ito on ito.DICTIONARIES_ID = a.INDUSTRY_TYPE_ONE
|
||||
left join sys_dictionaries itt on itt.DICTIONARIES_ID = a.INDUSTRY_TYPE_TWO
|
||||
left join sys_dictionaries itth on itth.DICTIONARIES_ID = a.INDUSTRY_TYPE_THREE
|
||||
left join sys_dictionaries itf on itf.DICTIONARIES_ID = a.INDUSTRY_TYPE_FOUR
|
||||
left join sys_dictionaries hto on hto.DICTIONARIES_ID = a.HIDDEN_TYPE_ONE
|
||||
left join sys_dictionaries htt on htt.DICTIONARIES_ID = a.HIDDEN_TYPE_TWO
|
||||
left join sys_dictionaries htth on htth.DICTIONARIES_ID = a.HIDDEN_TYPE_THREE
|
||||
left join bus_corp_info ci on ci.CORPINFO_ID = a.CORP_INFO_ID
|
||||
where a.ISDELETE = '0'
|
||||
<if test="pd.STATUS != null and pd.STATUS != ''">
|
||||
and a.STATUS = #{pd.STATUS}
|
||||
</if>
|
||||
<if test="pd.HIDDEN_TYPES != null and pd.HIDDEN_TYPES != ''">
|
||||
and a.HIDDEN_TYPES = #{pd.HIDDEN_TYPES}
|
||||
</if>
|
||||
<if test="pd.HIDDEN_DESCR != null and pd.HIDDEN_DESCR != ''">
|
||||
and a.HIDDEN_DESCR like CONCAT(CONCAT('%', #{pd.HIDDEN_DESCR}),'%')
|
||||
</if>
|
||||
<if test="pd.HIDDEN_PART != null and pd.HIDDEN_PART != ''">
|
||||
and a.HIDDEN_PART like CONCAT(CONCAT('%', #{pd.HIDDEN_PART}),'%')
|
||||
</if>
|
||||
<if test="pd.RISK_UNIT_NAME != null and pd.RISK_UNIT_NAME != ''">
|
||||
and a.RISK_UNIT_NAME like CONCAT(CONCAT('%', #{pd.RISK_UNIT_NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.INDUSTRY_TYPE_FOUR != '' and pd.INDUSTRY_TYPE_FOUR != null">
|
||||
and a.INDUSTRY_TYPE_FOUR = #{pd.INDUSTRY_TYPE_FOUR}
|
||||
</if>
|
||||
<if test="pd.HIDDEN_TYPE_ONE != '' and pd.HIDDEN_TYPE_ONE != null">
|
||||
and a.HIDDEN_TYPE_ONE = #{pd.HIDDEN_TYPE_ONE}
|
||||
</if>
|
||||
<if test="pd.HIDDEN_TYPE_TWO != '' and pd.HIDDEN_TYPE_TWO != null">
|
||||
and a.HIDDEN_TYPE_TWO = #{pd.HIDDEN_TYPE_TWO}
|
||||
</if>
|
||||
<if test="pd.HIDDEN_TYPE_THREE != '' and pd.HIDDEN_TYPE_THREE != null">
|
||||
and a.HIDDEN_TYPE_THREE = #{pd.HIDDEN_TYPE_THREE}
|
||||
</if>
|
||||
<if test="pd.INSPECTION_BASIS != null and pd.INSPECTION_BASIS != ''">
|
||||
and a.INSPECTION_BASIS like CONCAT(CONCAT('%', #{pd.INSPECTION_BASIS}),'%')
|
||||
</if>
|
||||
order by date(a.OPERATE_TIME) desc
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteAll" parameterType="String">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
HIDDEN_LIBRARY_ID in
|
||||
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,197 @@
|
|||
<?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.zcloud.mapper.datasource.depository.LabelFactoryMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_LABEL_FACTORY
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.PARENT_ID,
|
||||
f.ANCESTORS_ID,
|
||||
f.IS_ANCESTORS_FLAG,
|
||||
f.LEVEL,
|
||||
f.NAME,
|
||||
f.CREATOR_ID,
|
||||
f.CREATED_TIME,
|
||||
f.ISDELETE,
|
||||
f.SORT,
|
||||
f.TYPE,
|
||||
f.BUS_LABEL_FACTORY_ID,
|
||||
f.CORPINFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
PARENT_ID,
|
||||
ANCESTORS_ID,
|
||||
IS_ANCESTORS_FLAG,
|
||||
LEVEL,
|
||||
NAME,
|
||||
CREATOR_ID,
|
||||
CREATED_TIME,
|
||||
ISDELETE,
|
||||
SORT,
|
||||
TYPE,
|
||||
BUS_LABEL_FACTORY_ID,
|
||||
CORPINFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{PARENT_ID},
|
||||
#{ANCESTORS_ID},
|
||||
#{IS_ANCESTORS_FLAG},
|
||||
#{LEVEL},
|
||||
#{NAME},
|
||||
#{CREATOR_ID},
|
||||
#{CREATED_TIME},
|
||||
#{ISDELETE},
|
||||
#{SORT},
|
||||
#{TYPE},
|
||||
#{BUS_LABEL_FACTORY_ID},
|
||||
#{CORPINFO_ID}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||
</delete>
|
||||
<delete id="deleteByAncestors" parameterType="pd">
|
||||
delete from
|
||||
<include refid="tableName"></include>
|
||||
where TYPE = #{TYPE}
|
||||
<if test="CORPINFO_ID != '' and CORPINFO_ID != null">
|
||||
and CORPINFO_ID = #{CORPINFO_ID}
|
||||
</if>
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
PARENT_ID = #{PARENT_ID},
|
||||
ANCESTORS_ID = #{ANCESTORS_ID},
|
||||
IS_ANCESTORS_FLAG = #{IS_ANCESTORS_FLAG},
|
||||
LEVEL = #{LEVEL},
|
||||
NAME = #{NAME},
|
||||
CREATOR_ID = #{CREATOR_ID},
|
||||
CREATED_TIME = #{CREATED_TIME},
|
||||
SORT = #{SORT},
|
||||
TYPE = #{TYPE},
|
||||
CORPINFO_ID = #{CORPINFO_ID},
|
||||
BUS_LABEL_FACTORY_ID = BUS_LABEL_FACTORY_ID
|
||||
where
|
||||
BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.BUS_LABEL_FACTORY_ID = #{BUS_LABEL_FACTORY_ID}
|
||||
</select>
|
||||
|
||||
<select id="findByAncestors" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include>
|
||||
f
|
||||
where f.ISDELETE = '0'
|
||||
<if test="ANCESTORS_ID != null and ANCESTORS_ID != ''">
|
||||
and f.ANCESTORS_ID = #{ANCESTORS_ID}
|
||||
</if>
|
||||
<if test="TYPE != null and TYPE != ''">
|
||||
and f.TYPE = #{TYPE}
|
||||
</if>
|
||||
<if test="CORPINFO_ID != '' and CORPINFO_ID != null">
|
||||
and f.CORPINFO_ID = #{CORPINFO_ID}
|
||||
</if>
|
||||
<if test="IS_ANCESTORS_FLAG != null and IS_ANCESTORS_FLAG != ''">
|
||||
and f.IS_ANCESTORS_FLAG = #{IS_ANCESTORS_FLAG}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findAllAncestors" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.IS_ANCESTORS_FLAG = '1' and f.ISDELETE = '0' and TYPE = #{TYPE}
|
||||
<if test="NAME != null and NAME != ''">
|
||||
and f.NAME LIKE CONCAT(CONCAT('%', #{NAME}),'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include>
|
||||
f
|
||||
where f.ISDELETE = '0'
|
||||
<if test="pd.NAME != null and pd.NAME != ''"><!-- 关键词检索 -->
|
||||
and f.NAME LIKE CONCAT(CONCAT('%', #{pd.NAME}),'%')
|
||||
</if>
|
||||
<if test="pd.IS_ANCESTORS_FLAG != null and pd.IS_ANCESTORS_FLAG != ''"><!-- 关键词检索 -->
|
||||
and f.IS_ANCESTORS_FLAG = #{pd.IS_ANCESTORS_FLAG}
|
||||
</if>
|
||||
<if test="pd.TYPE != null and pd.TYPE != ''">
|
||||
and f.TYPE = #{pd.TYPE}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f where f.ISDELETE = '0'
|
||||
<if test="NAME != '' and NAME != null">
|
||||
and f.NAME = #{NAME}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteAll" parameterType="String">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_LABEL_FACTORY_ID in
|
||||
<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,164 @@
|
|||
<?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.zcloud.mapper.datasource.depository.LibraryLabelsMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_LIBRARY_LABELS
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.BUS_TEXT_LIBRARY_ID,
|
||||
f.NAME,
|
||||
f.BUS_LABEL_FACTORY_ID,
|
||||
f.CREATED_TIME,
|
||||
f.LABEL_NAME,
|
||||
f.ISDELETE,
|
||||
f.BUS_LIBRARY_LABELS_ID,
|
||||
f.CORPINFO_ID,
|
||||
f.CATEGORY,
|
||||
f.CATEGORY_ID,
|
||||
f.CATEGORY_NAME
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
BUS_TEXT_LIBRARY_ID,
|
||||
NAME,
|
||||
BUS_LABEL_FACTORY_ID,
|
||||
CREATED_TIME,
|
||||
LABEL_NAME,
|
||||
ISDELETE,
|
||||
BUS_LIBRARY_LABELS_ID,
|
||||
CORPINFO_ID,
|
||||
CATEGORY,
|
||||
CATEGORY_ID,
|
||||
CATEGORY_NAME
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{BUS_TEXT_LIBRARY_ID},
|
||||
#{NAME},
|
||||
#{BUS_LABEL_FACTORY_ID},
|
||||
#{CREATED_TIME},
|
||||
#{LABEL_NAME},
|
||||
#{ISDELETE},
|
||||
#{BUS_LIBRARY_LABELS_ID},
|
||||
#{CORPINFO_ID},
|
||||
#{CATEGORY},
|
||||
#{CATEGORY_ID},
|
||||
#{CATEGORY_NAME}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_LIBRARY_LABELS_ID = #{BUS_LIBRARY_LABELS_ID}
|
||||
</delete>
|
||||
<delete id="deleteByLibraryId" parameterType="pd">
|
||||
delete from
|
||||
<include refid="tableName"></include>
|
||||
where
|
||||
BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID},
|
||||
NAME = #{NAME},
|
||||
CREATED_TIME = #{CREATED_TIME},
|
||||
LABEL_NAME = #{LABEL_NAME},
|
||||
ISDELETE = #{ISDELETE},
|
||||
CORPINFO_ID = #{CORPINFO_ID},
|
||||
CATEGORY = #{CATEGORY},
|
||||
CATEGORY_ID = #{CATEGORY_ID},
|
||||
CATEGORY_NAME = #{CATEGORY_NAME},
|
||||
BUS_LIBRARY_LABELS_ID = BUS_LIBRARY_LABELS_ID
|
||||
where
|
||||
BUS_LIBRARY_LABELS_ID = #{BUS_LIBRARY_LABELS_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.BUS_LIBRARY_LABELS_ID = #{BUS_LIBRARY_LABELS_ID}
|
||||
</select>
|
||||
<select id="findBylibraryId" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.ISDELETE = '0'
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||
and
|
||||
(
|
||||
<!-- 根据需求自己加检索条件
|
||||
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
or
|
||||
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
-->
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteAll" parameterType="String">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_LIBRARY_LABELS_ID in
|
||||
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,72 @@
|
|||
<?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.zcloud.mapper.datasource.depository.LibraryLogMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_LIBRARY_LOG
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.LIBRARY_LOG_ID,
|
||||
f.PATH,
|
||||
f.CREATOR,
|
||||
f.CREATOR_NAME,
|
||||
f.CREATE_TIME,
|
||||
f.BUS_TEXT_LIBRARY_ID
|
||||
</sql>
|
||||
|
||||
<sql id="Field2">
|
||||
LIBRARY_LOG_ID,
|
||||
PATH,
|
||||
CREATOR,
|
||||
CREATOR_NAME,
|
||||
CREATE_TIME,
|
||||
BUS_TEXT_LIBRARY_ID
|
||||
</sql>
|
||||
|
||||
<sql id="FieldValue">
|
||||
#{LIBRARY_LOG_ID},
|
||||
#{PATH},
|
||||
#{CREATOR},
|
||||
#{CREATOR_NAME},
|
||||
#{CREATE_TIME},
|
||||
#{BUS_TEXT_LIBRARY_ID}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.LIBRARY_LOG_ID = #{LIBRARY_LOG_ID}
|
||||
</select>
|
||||
|
||||
<select id="findByLogId" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,138 @@
|
|||
<?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.zcloud.mapper.datasource.depository.TextInfoMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_TEXT_INFO
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.TEXT_INFO,
|
||||
f.BUS_TEXT_LIBRARY_ID,
|
||||
f.ISDELETE,
|
||||
f.CREATED_TIME,
|
||||
f.OPERATE_TIME,
|
||||
f.TEXT_INFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
TEXT_INFO,
|
||||
BUS_TEXT_LIBRARY_ID,
|
||||
ISDELETE,
|
||||
CREATED_TIME,
|
||||
OPERATE_TIME,
|
||||
TEXT_INFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{TEXT_INFO},
|
||||
#{BUS_TEXT_LIBRARY_ID},
|
||||
#{ISDELETE},
|
||||
#{CREATED_TIME},
|
||||
#{OPERATE_TIME},
|
||||
#{TEXT_INFO_ID}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
TEXT_INFO_ID = #{TEXT_INFO_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
TEXT_INFO = #{TEXT_INFO},
|
||||
BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID},
|
||||
ISDELETE = #{ISDELETE},
|
||||
OPERATE_TIME = #{OPERATE_TIME},
|
||||
TEXT_INFO_ID = TEXT_INFO_ID
|
||||
where
|
||||
TEXT_INFO_ID = #{TEXT_INFO_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.TEXT_INFO_ID = #{TEXT_INFO_ID}
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.ISDELETE = '0'
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||
and
|
||||
(
|
||||
<!-- 根据需求自己加检索条件
|
||||
字段1 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
or
|
||||
字段2 LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
-->
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
</select>
|
||||
|
||||
<select id="findByMainId" resultType="com.zcloud.entity.PageData">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where f.BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteAll" parameterType="String">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
TEXT_INFO_ID in
|
||||
<foreach item="item" index="index" collection="ArrayDATA_IDS" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,202 @@
|
|||
<?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.zcloud.mapper.datasource.depository.TextLibraryMapper">
|
||||
|
||||
<!--表名 -->
|
||||
<sql id="tableName">
|
||||
BUS_TEXT_LIBRARY
|
||||
</sql>
|
||||
|
||||
<!--数据字典表名 -->
|
||||
<sql id="dicTableName">
|
||||
SYS_DICTIONARIES
|
||||
</sql>
|
||||
|
||||
<!-- 字段 -->
|
||||
<sql id="Field">
|
||||
f.REMARKS,
|
||||
f.TYPE,
|
||||
f.TYPE_NAME,
|
||||
f.FILE_NAME,
|
||||
f.UPLOAD_TIME,
|
||||
f.UPLOAD_USER,
|
||||
f.UPLOAD_USER_NAME,
|
||||
f.PATH,
|
||||
f.REMOTE_PATH,
|
||||
f.CREATED_TIME,
|
||||
f.ISDELETE,
|
||||
f.REMOTE_FILE_NAME,
|
||||
f.LOCKTOOL,
|
||||
f.ISTOPTIME,
|
||||
f.ASSOCIATION,
|
||||
f.STATUS,
|
||||
f.BUS_TEXT_LIBRARY_ID,
|
||||
f.CORPINFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段用于新增 -->
|
||||
<sql id="Field2">
|
||||
REMARKS,
|
||||
TYPE,
|
||||
TYPE_NAME,
|
||||
FILE_NAME,
|
||||
UPLOAD_TIME,
|
||||
UPLOAD_USER,
|
||||
UPLOAD_USER_NAME,
|
||||
PATH,
|
||||
REMOTE_PATH,
|
||||
CREATED_TIME,
|
||||
ISDELETE,
|
||||
REMOTE_FILE_NAME,
|
||||
LOCKTOOL,
|
||||
ISTOPTIME,
|
||||
ASSOCIATION,
|
||||
STATUS,
|
||||
BUS_TEXT_LIBRARY_ID,
|
||||
CORPINFO_ID
|
||||
</sql>
|
||||
|
||||
<!-- 字段值 -->
|
||||
<sql id="FieldValue">
|
||||
#{REMARKS},
|
||||
#{TYPE},
|
||||
#{TYPE_NAME},
|
||||
#{FILE_NAME},
|
||||
#{UPLOAD_TIME},
|
||||
#{UPLOAD_USER},
|
||||
#{UPLOAD_USER_NAME},
|
||||
#{PATH},
|
||||
#{REMOTE_PATH},
|
||||
#{CREATED_TIME},
|
||||
#{ISDELETE},
|
||||
#{REMOTE_FILE_NAME},
|
||||
#{LOCKTOOL},
|
||||
#{ISTOPTIME},
|
||||
#{ASSOCIATION},
|
||||
#{STATUS},
|
||||
#{BUS_TEXT_LIBRARY_ID},
|
||||
#{CORPINFO_ID}
|
||||
</sql>
|
||||
|
||||
<!-- 新增-->
|
||||
<insert id="save" parameterType="pd">
|
||||
insert into
|
||||
<include refid="tableName"></include>
|
||||
(
|
||||
<include refid="Field2"></include>
|
||||
) values (
|
||||
<include refid="FieldValue"></include>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 删除-->
|
||||
<delete id="delete" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
|
||||
</delete>
|
||||
|
||||
<!-- 修改 -->
|
||||
<update id="edit" parameterType="pd">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
REMARKS = #{REMARKS},
|
||||
TYPE = #{TYPE},
|
||||
FILE_NAME = #{FILE_NAME},
|
||||
REMOTE_FILE_NAME = #{REMOTE_FILE_NAME},
|
||||
UPLOAD_TIME = #{UPLOAD_TIME},
|
||||
UPLOAD_USER = #{UPLOAD_USER},
|
||||
UPLOAD_USER_NAME = #{UPLOAD_USER_NAME},
|
||||
PATH = #{PATH},
|
||||
REMOTE_PATH = #{REMOTE_PATH},
|
||||
CREATED_TIME = #{CREATED_TIME},
|
||||
LOCKTOOL = #{LOCKTOOL},
|
||||
ISTOPTIME = #{ISTOPTIME},
|
||||
TYPE_NAME = #{TYPE_NAME},
|
||||
ASSOCIATION = #{ASSOCIATION},
|
||||
STATUS = #{STATUS},
|
||||
CORPINFO_ID = #{CORPINFO_ID},
|
||||
BUS_TEXT_LIBRARY_ID = BUS_TEXT_LIBRARY_ID
|
||||
where
|
||||
BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
|
||||
</update>
|
||||
|
||||
<!-- 通过ID获取数据 -->
|
||||
<select id="findById" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
where
|
||||
f.BUS_TEXT_LIBRARY_ID = #{BUS_TEXT_LIBRARY_ID}
|
||||
</select>
|
||||
|
||||
<!-- 列表 -->
|
||||
<select id="datalistPage" parameterType="page" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>,
|
||||
bci.CORP_NAME
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
left join sys_user su on f.UPLOAD_USER = su.USER_ID
|
||||
left join bus_corp_info bci on bci.CORPINFO_ID = su.CORPINFO_ID
|
||||
where f.ISDELETE = '0'
|
||||
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''"><!-- 关键词检索 -->
|
||||
and f.REMARKS LIKE CONCAT(CONCAT('%', #{pd.KEYWORDS}),'%')
|
||||
</if>
|
||||
<if test="pd.LABELS != null and pd.LABELS.length > 0">
|
||||
and exists(select 1 from bus_library_labels b where b.BUS_TEXT_LIBRARY_ID = f.BUS_TEXT_LIBRARY_ID and
|
||||
b.BUS_LABEL_FACTORY_ID in
|
||||
<foreach item="item" index="index" collection="pd.LABELS" open="(" separator="," close=")">
|
||||
#{pd.LABELS[${index}]}
|
||||
</foreach>)
|
||||
</if>
|
||||
<if test="pd.ASSOCIATION != null and pd.ASSOCIATION != ''">
|
||||
and f.ASSOCIATION = #{pd.ASSOCIATION}
|
||||
</if>
|
||||
<if test="pd.STATUS != null and pd.STATUS != ''">
|
||||
and f.STATUS = #{pd.STATUS}
|
||||
</if>
|
||||
<if test="pd.CATEGORY_IDS != null and pd.CATEGORY_IDS.length > 0">
|
||||
and exists(select 1 from bus_library_labels b where b.BUS_TEXT_LIBRARY_ID = f.BUS_TEXT_LIBRARY_ID and
|
||||
b.CATEGORY_ID in
|
||||
<foreach item="item" index="index" collection="pd.CATEGORY_IDS" open="(" separator="," close=")">
|
||||
#{pd.CATEGORY_IDS[${index}]}
|
||||
</foreach>)
|
||||
</if>
|
||||
<if test="pd.CORPINFO_ID != null and pd.CORPINFO_ID != null">
|
||||
and f.CORPINFO_ID = #{pd.CORPINFO_ID}
|
||||
</if>
|
||||
<if test="pd.ENTERPRISE_SIDE != null and pd.ENTERPRISE_SIDE != ''">
|
||||
and f.CORPINFO_ID != #{pd.ENTERPRISE_SIDE}
|
||||
</if>
|
||||
order by f.ISTOPTIME desc,f.CREATED_TIME desc
|
||||
</select>
|
||||
|
||||
<!-- 列表(全部) -->
|
||||
<select id="listAll" parameterType="pd" resultType="pd">
|
||||
select
|
||||
<include refid="Field"></include>
|
||||
from
|
||||
<include refid="tableName"></include> f
|
||||
</select>
|
||||
|
||||
<!-- 批量删除 -->
|
||||
<delete id="deleteAll" parameterType="String">
|
||||
update
|
||||
<include refid="tableName"></include>
|
||||
set
|
||||
ISDELETE = '1'
|
||||
where
|
||||
BUS_TEXT_LIBRARY_ID in
|
||||
<foreach item="item" index="index" collection="array" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
and LOCKTOOL is null
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue