Merge remote-tracking branch 'origin/master'
This commit is contained in:
+1
-1
@@ -80,7 +80,7 @@ public class OSSFileServiceImpl extends ServiceImpl<OSSFileMapper, OSSFile> impl
|
||||
fileType = orgName.substring(orgName.lastIndexOf("."));
|
||||
//判断文件类型
|
||||
if (StringUtils.isNotEmpty(fileType)) {
|
||||
String[] fileTypeArr = {".doc", ".docx", ".xls", ".xlsx", ".pdf", ".png", ".jfif", ".pjpeg", ".jpeg", ".pjp", ".jpg", ".swf", ".bmp",".rar",".zip"};
|
||||
String[] fileTypeArr = {".doc",".DOC","txt","TXT", ".docx",".DOCX", ".xls", ".XLS",".xlsx",".XLSX", ".pdf",".PDF", ".png",".PNG", ".jfif",".JFIF", ".pjpeg",".PJPEG", ".jpeg",".JPEG", ".pjp",".PJP", ".jpg",".JPG", ".swf",".SWF", ".bmp",".BMP",".rar",".RAR",".zip",".ZIP"};
|
||||
boolean flag = true;
|
||||
for (String fileTypeTemp : fileTypeArr) {
|
||||
if (fileTypeTemp.equalsIgnoreCase(fileType)) {
|
||||
|
||||
+1
@@ -101,6 +101,7 @@ public class SysCategoryController {
|
||||
@AutoLog(value = "标签内容-树形结构-通过sysDictId查询")
|
||||
@ApiOperation(value="标签内容-树形结构-通过sysDictId查询", notes="标签内容-树形结构-通过sysDictId查询")
|
||||
@GetMapping(value = "/queryBySysDictId")
|
||||
// @RequiresPermissions("sys:category:queryBySysDictId")
|
||||
public Result<?> queryBySysDictId(@RequestParam(name="id",required=true) String sysDictId) {
|
||||
List<SysCategory> sysCategory = sysCategoryService.queryBySysDictId(sysDictId);
|
||||
if(sysCategory==null) {
|
||||
|
||||
+23
-15
@@ -365,26 +365,32 @@ public class SysDictController {
|
||||
@ApiOperation(value = "字典控制器-新增字典", notes = "字典控制器-新增字典")
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/add", method = RequestMethod.POST)
|
||||
//@RequiresPermissions("dict:add")
|
||||
public Result<SysDict> add(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
try {
|
||||
Integer count = sysDictService.queryExitData(sysDict);
|
||||
Integer countDictName=sysDictService.queryExitDictName(sysDict);
|
||||
System.out.println("count="+count);
|
||||
|
||||
if (count > 0) {
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
} else {
|
||||
if(sysDict.getIsTagDict() == 1){
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(sysDict.getDictName());
|
||||
sysDict.setDictCode(pinYin);
|
||||
if (countDictName > 0) {
|
||||
result.error500("标签名称不能重复");
|
||||
}else{
|
||||
//判断逻辑删除
|
||||
if (count > 0) {
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
} else {
|
||||
if(sysDict.getIsTagDict() == 1){
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(sysDict.getDictName());
|
||||
sysDict.setDictCode(pinYin.replace(" ","_"));
|
||||
}
|
||||
sysDict.setCreateTime(new Date());
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
sysDictService.save(sysDict);
|
||||
}
|
||||
sysDict.setCreateTime(new Date());
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_0);
|
||||
sysDictService.save(sysDict);
|
||||
result.success("保存成功!");
|
||||
//添加成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
}
|
||||
result.success("保存成功!");
|
||||
//添加成功后需要刷新缓存
|
||||
sysDictService.refreshCache();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
result.error500("操作失败");
|
||||
@@ -400,6 +406,7 @@ public class SysDictController {
|
||||
@ApiOperation(value = "字典控制器-编辑字典", notes = "字典控制器-编辑字典")
|
||||
@RequiresRoles({"admin"})
|
||||
@RequestMapping(value = "/edit", method = RequestMethod.PUT)
|
||||
//@RequiresPermissions("dict:edit")
|
||||
public Result<SysDict> edit(@RequestBody SysDict sysDict) {
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
SysDict sysdict = sysDictService.getById(sysDict.getId());
|
||||
@@ -460,6 +467,7 @@ public class SysDictController {
|
||||
@RequiresRoles({"admin"})
|
||||
@DeleteMapping(value = "/logicDelete")
|
||||
@CacheEvict(value=CacheConstant.SYS_DICT_CACHE, allEntries=true)
|
||||
//@RequiresPermissions("dict:logicDelete")
|
||||
public Result<SysDict> logicDelete(@RequestParam(name="id",required=true) String id) {
|
||||
|
||||
Result<SysDict> result = new Result<SysDict>();
|
||||
@@ -493,9 +501,9 @@ public class SysDictController {
|
||||
}else {
|
||||
if (StringUtils.isNotBlank(String.valueOf(sysDict.getIsReadOnly()))) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(sysDict.getIsReadOnly())) {
|
||||
result.error500("固定字段,不可删除");
|
||||
result.error500("包含固定字段,不可删除");
|
||||
} else {
|
||||
sysDictService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
sysDict.setDelFlag(CommonConstant.DEL_FLAG_1);
|
||||
result.success("删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -161,6 +161,5 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
||||
"from sys_dict as d\n" +
|
||||
"left join sys_dict_item as i on d.attribute_type=i.item_value\n" +
|
||||
"where i.dict_id=\"1494570247913512962\"")
|
||||
//IPage<Map<String,Object>> selectPageInfo(Page page, Wrapper<SysDict> queryWrapper);
|
||||
IPage<SysDict> queryPageList(IPage page,@Param("params") Map<String,Object> params);
|
||||
}
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
package com.jero.modules.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.common.system.vo.DictModel;
|
||||
import com.jero.common.system.vo.DictQuery;
|
||||
@@ -162,7 +160,7 @@ public interface ISysDictService extends IService<SysDict> {
|
||||
*/
|
||||
Integer queryExitData(SysDict sysDict);
|
||||
|
||||
//List<Map<String, Object>> selectPageInfo(Page page, Wrapper<SysDict> queryWrapper);
|
||||
Integer queryExitDictName(SysDict sysDict);
|
||||
|
||||
IPage<SysDict> queryPageList(Map<String, Object> params);
|
||||
}
|
||||
|
||||
+9
-7
@@ -382,13 +382,15 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
||||
Integer count = sysDictMapper.selectCount(queryWrapper);
|
||||
return count;
|
||||
}
|
||||
|
||||
/*@Override
|
||||
public List<Map<String, Object>> selectPageInfo(Page page, Wrapper<SysDict> queryWrapper) {
|
||||
IPage<Map<String, Object>> info= sysDictMapper.selectPageInfo(page, queryWrapper);
|
||||
List<Map<String, Object>> list = info.getRecords().stream().collect(Collectors.toList());
|
||||
return list;
|
||||
}*/
|
||||
@Override
|
||||
public Integer queryExitDictName(SysDict sysDict) {
|
||||
LambdaQueryWrapper<SysDict> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotBlank(sysDict.getDictName())) {
|
||||
queryWrapper.eq(SysDict::getDictName, sysDict.getDictName());
|
||||
}
|
||||
Integer count = sysDictMapper.selectCount(queryWrapper);
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 标签内容-分页查询
|
||||
|
||||
+25
-49
@@ -1,30 +1,26 @@
|
||||
package com.jero.modules.document.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import com.jero.modules.document.service.IBussDocumentLibraryEOService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -47,27 +43,6 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@Autowired
|
||||
private IBussDocumentLibraryEOService bussDocumentLibraryEOService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param bussDocumentLibraryEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档库信息表-分页列表查询")
|
||||
@ApiOperation(value="文档库信息表-分页列表查询", notes="文档库信息表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(BussDocumentLibraryEO bussDocumentLibraryEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BussDocumentLibraryEO> queryWrapper = QueryGenerator.initQueryWrapper(bussDocumentLibraryEO, req.getParameterMap());
|
||||
Page<BussDocumentLibraryEO> page = new Page<BussDocumentLibraryEO>(pageNo, pageSize);
|
||||
IPage<BussDocumentLibraryEO> pageList = bussDocumentLibraryEOService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
@@ -78,6 +53,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@ApiOperation(value="分页查询", notes="分页查询")
|
||||
@PostMapping(value = "/queryPageInfo")
|
||||
@ResponseBody
|
||||
// @RequiresPermissions("document:queryPageInfo")
|
||||
public JSONObject queryPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.getInfoPage(parameter);
|
||||
Result<IPage> ok = Result.OK(infoPage);
|
||||
@@ -94,6 +70,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@ApiOperation(value="代替标准分页列表查询", notes="代替标准分页列表查询")
|
||||
@PostMapping(value = "/replacePageInfo")
|
||||
@ResponseBody
|
||||
// @RequiresPermissions("document:replacePageInfo")
|
||||
public Result<?> replacePageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.replacePageInfo(parameter);
|
||||
// Result<IPage> ok = Result.OK(infoPage);
|
||||
@@ -110,6 +87,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@ApiOperation(value="ocr识别调取已入库文件", notes="ocr识别调取已入库文件")
|
||||
@PostMapping(value = "/ocrPageInfo")
|
||||
@ResponseBody
|
||||
// @RequiresPermissions("document:ocrPageInfo")
|
||||
public Result<?> ocrPageInfo(@RequestBody Map<String,Object> parameter) {
|
||||
IPage infoPage = bussDocumentLibraryEOService.ocrPageInfo(parameter);
|
||||
return Result.OK(infoPage);
|
||||
@@ -138,6 +116,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "文档库信息表-通过id删除")
|
||||
@ApiOperation(value="文档库信息表-通过id删除", notes="文档库信息表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@RequiresPermissions("document:deleteBatch")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
bussDocumentLibraryEOService.deleteById(id);
|
||||
return Result.OK("删除成功!");
|
||||
@@ -152,6 +131,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "文档库信息表-批量删除")
|
||||
@ApiOperation(value="文档库信息表-批量删除", notes="文档库信息表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@RequiresPermissions("document:deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.bussDocumentLibraryEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
@@ -166,6 +146,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "文档库信息表-通过id查询")
|
||||
@ApiOperation(value="文档库信息表-通过id查询", notes="文档库信息表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
// @RequiresPermissions("document:queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
BussDocumentLibraryEO bussDocumentLibraryEO = bussDocumentLibraryEOService.queryById(id);
|
||||
if(bussDocumentLibraryEO==null) {
|
||||
@@ -174,28 +155,6 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
return Result.OK(bussDocumentLibraryEO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param bussDocumentLibraryEO
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BussDocumentLibraryEO bussDocumentLibraryEO) {
|
||||
return super.exportXls(request, bussDocumentLibraryEO, BussDocumentLibraryEO.class, "文档库信息表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BussDocumentLibraryEO.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -206,6 +165,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "文档库信息表-查询条件")
|
||||
@ApiOperation(value="文档库信息表-查询条件", notes="文档库信息表-查询条件")
|
||||
@GetMapping(value = "/queryCondition")
|
||||
// @RequiresPermissions("document:queryCondition")
|
||||
public Result<List<Map<String,Object>>> queryCondition(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String,Object>> list = bussDocumentLibraryEOService.queryCondition(flag,cut);
|
||||
@@ -220,6 +180,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "文档库信息表-列表表头")
|
||||
@ApiOperation(value="文档库信息表-列表表头", notes="文档库信息表-列表表头")
|
||||
@GetMapping(value = "/getHeader")
|
||||
// @RequiresPermissions("document:getHeader")
|
||||
public Result<List<Map<String,Object>>> getHeader(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String,Object>> list = bussDocumentLibraryEOService.getHeader(flag,cut);
|
||||
@@ -234,6 +195,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "文档库信息表-新增表单")
|
||||
@ApiOperation(value="文档库信息表-新增表单", notes="文档库信息表-新增表单")
|
||||
@GetMapping(value = "/getAddForm")
|
||||
// @RequiresPermissions("document:getAddForm")
|
||||
public Result<List<Map<String,Object>>> getAddForm(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut,
|
||||
@RequestParam(name="type",required=true) String type) {
|
||||
@@ -249,6 +211,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "文档库信息表-ocr表头和查询条件")
|
||||
@ApiOperation(value="文档库信息表-ocr表头和查询条件", notes="文档库信息表-ocr表头和查询条件")
|
||||
@GetMapping(value = "/getHeaderOrConditionForOcr")
|
||||
// @RequiresPermissions("document:getHeaderOrConditionForOcr")
|
||||
public Result<List<Map<String,Object>>> getHeaderOrConditionForOcr(@RequestParam(name="flag",required=true) String flag,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getHeaderOrConditionForOcr(flag,cut);
|
||||
@@ -263,6 +226,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "编辑数据查询")
|
||||
@ApiOperation(value="编辑数据查询", notes="编辑数据查询")
|
||||
@GetMapping(value = "/getDocumentInfoById")
|
||||
// @RequiresPermissions("document:getDocumentInfoById")
|
||||
public Result<List<Map<String,Object>>> getDocumentInfoById(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getDocumentInfoById(id,cut);
|
||||
@@ -276,6 +240,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "详情数据查询")
|
||||
@ApiOperation(value="详情数据查询", notes="详情数据查询")
|
||||
@GetMapping(value = "/getInfoById")
|
||||
// @RequiresPermissions("document:getInfoById")
|
||||
public Result<List<Map<String,Object>>> getInfoById(@RequestParam(name="id",required=true) String id,
|
||||
@RequestParam(name="cut",required=true) String cut) {
|
||||
List<Map<String, Object>> list = bussDocumentLibraryEOService.getInfoById(id,cut);
|
||||
@@ -290,7 +255,8 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "新增数据")
|
||||
@ApiOperation(value="新增数据", notes="新增数据")
|
||||
@PostMapping(value = "/addInfo")
|
||||
public Result<?> addInfo(@RequestBody Map<String,Object> map) {
|
||||
@RequiresPermissions("document:getInfoById")
|
||||
public Result<?> getInfoById(@RequestBody Map<String,Object> map) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.addInfo(map);
|
||||
} catch (Exception e) {
|
||||
@@ -307,6 +273,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "编辑数据")
|
||||
@ApiOperation(value="编辑数据", notes="编辑数据")
|
||||
@PostMapping(value = "/updateInfo")
|
||||
@RequiresPermissions("document:updateInfo")
|
||||
public Result<?> updateInfo(@RequestBody Map<String,Object> map) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.updateInfo(map);
|
||||
@@ -325,6 +292,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "添加收藏")
|
||||
@ApiOperation(value="添加收藏", notes="添加收藏")
|
||||
@GetMapping(value = "/addCollect")
|
||||
@RequiresPermissions("document:addCollect")
|
||||
public Result<?> addCollect(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.addCollect(id);
|
||||
@@ -342,6 +310,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "取消收藏")
|
||||
@ApiOperation(value="取消收藏", notes="取消收藏")
|
||||
@GetMapping(value = "/cancelCollect")
|
||||
@RequiresPermissions("document:addCollect")
|
||||
public Result<?> cancelCollect(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.cancelCollect(id);
|
||||
@@ -359,6 +328,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "添加订阅")
|
||||
@ApiOperation(value="添加订阅", notes="添加订阅")
|
||||
@GetMapping(value = "/addSubscribe")
|
||||
@RequiresPermissions("document:addSubscribe")
|
||||
public Result<?> addSubscribe(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.addSubscribe(id);
|
||||
@@ -376,6 +346,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@AutoLog(value = "取消订阅")
|
||||
@ApiOperation(value="取消订阅", notes="取消订阅")
|
||||
@GetMapping(value = "/cancelSubscribe")
|
||||
@RequiresPermissions("document:addSubscribe")
|
||||
public Result<?> cancelSubscribe(String id) {
|
||||
try {
|
||||
bussDocumentLibraryEOService.cancelSubscribe(id);
|
||||
@@ -388,6 +359,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
|
||||
@ApiOperation(value = "导出excel")
|
||||
@GetMapping(value = "/exportExcel")
|
||||
@RequiresPermissions("document:exportExcel")
|
||||
public void exportExcel(@RequestParam Map<String,Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request){
|
||||
@@ -396,6 +368,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
|
||||
@ApiOperation(value = "带文件导出")
|
||||
@GetMapping(value = "/exportZip")
|
||||
@RequiresPermissions("document:exportZip")
|
||||
public void exportZip(@RequestParam Map<String,Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
@@ -405,6 +378,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
|
||||
@ApiOperation(value = "模板下载")
|
||||
@GetMapping(value = "/exportTemplate")
|
||||
@RequiresPermissions("document:exportTemplate")
|
||||
public void exportTemplate(@RequestParam Map<String,Object> map, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
bussDocumentLibraryEOService.exportTemplate(map,response,request);
|
||||
}
|
||||
@@ -412,6 +386,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
|
||||
@ApiOperation(value = "导入.zip")
|
||||
@PostMapping(value = "/importZip")
|
||||
@RequiresPermissions("document:importZip")
|
||||
public Result<?> importZip(@RequestParam(value = "file", required = false) MultipartFile file) throws Exception {
|
||||
String result = bussDocumentLibraryEOService.importZip(file);
|
||||
return Result.OK(result);
|
||||
@@ -419,6 +394,7 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
|
||||
@ApiOperation(value = "推送")
|
||||
@GetMapping(value = "/pullMessage")
|
||||
@RequiresPermissions("document:pullMessage")
|
||||
public Result<?> pullMessage(String departIds,String userIds,String documentIds) {
|
||||
|
||||
bussDocumentLibraryEOService.pullMessage(departIds,userIds,documentIds);
|
||||
|
||||
+16
-3
@@ -467,7 +467,9 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
|
||||
//区域管理
|
||||
List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(new OnlCgformArea());
|
||||
OnlCgformArea onlCgformArea = new OnlCgformArea();
|
||||
onlCgformArea.setIsModel(ModuleEnum.DOCUMENT_LIBRARY.getValue());
|
||||
List<OnlCgformArea> areaList = onlCgformAreaServiceImpl.queryList(onlCgformArea);
|
||||
//字段属性
|
||||
List<OnlCgformField> fieldList = onlCgformFieldService.getFieldList("1");
|
||||
|
||||
@@ -878,9 +880,15 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
List<String> fieldFile = fieldFileList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
//下拉类型的字段
|
||||
List<String> fieldPull = fieldPullList.stream().map(OnlCgformField::getDbFieldName).collect(Collectors.toList());
|
||||
//过滤出树形字段
|
||||
List<OnlCgformField> treeFieldList = fieldList.stream()
|
||||
.filter(e -> FieldTypeEnum.TREE.getValue().equals(e.getFieldShowType()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//数据字典
|
||||
List<SysDictItem> sysDictItems = sysDictItemServiceImpl.selectItemsAll();
|
||||
//树形数据字典
|
||||
List<SysCategory> categoryList = sysCategoryService.list();
|
||||
//下拉选处理数据字典
|
||||
for (Map.Entry<String, Object> entry : dataList.get(0).entrySet()) {
|
||||
List<OnlCgformField> collect = fieldPullList.stream()
|
||||
@@ -888,6 +896,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect, cut);
|
||||
treeDictItem(categoryList, entry, treeFieldList, cut);
|
||||
}
|
||||
for (Map.Entry<String, Object> entry : mapTemp.entrySet()) {
|
||||
List<OnlCgformField> collect = fieldPullList.stream()
|
||||
@@ -895,6 +904,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
.collect(Collectors.toList());
|
||||
//下拉选处理数据字典
|
||||
dictItem(sysDictItems, entry, collect, cut);
|
||||
treeDictItem(categoryList, entry, treeFieldList, cut);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -1389,14 +1399,17 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//输入框
|
||||
conditionSb.append(" and " + key + " like concat(concat('%','" + value + "'),'%')");
|
||||
} else if (FieldTypeEnum.PULL_SINGLE.getValue().equals(fieldType)
|
||||
|| FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)) {
|
||||
|| FieldTypeEnum.PULL_MORE.getValue().equals(fieldType)
|
||||
|| FieldTypeEnum.TREE.getValue().equals(fieldType)) {
|
||||
StringBuilder valueSb = new StringBuilder();
|
||||
StringBuilder condition = new StringBuilder();
|
||||
for (String valueTemp : value.split(",")) {
|
||||
valueSb.append("'" + valueTemp + "',");
|
||||
condition.append(" or " + key + " like concat(concat('%','" + valueTemp + "'),'%')");
|
||||
}
|
||||
String substring = valueSb.substring(0, valueSb.length() - 1);
|
||||
//下拉单选或下拉多选
|
||||
conditionSb.append(" and " + key + " in(" + substring + ")");
|
||||
conditionSb.append(" and " + key + " in(" + substring + ")" + condition.toString());
|
||||
|
||||
} else if (FieldTypeEnum.DATE_SINGLE.getValue().equals(fieldType)) {
|
||||
//日期(区分单日期还时间范围)
|
||||
|
||||
+4
@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -91,6 +92,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
|
||||
@AutoLog(value = "OCR识别转换记录表-同步至文档库")
|
||||
@ApiOperation(value="OCR识别转换记录表-同步至文档库", notes="OCR识别转换记录表-同步至文档库")
|
||||
@PostMapping(value = "/syncToDocument")
|
||||
@RequiresPermissions("ocr:ocrRecord:syncToDocument")
|
||||
public Result<?> syncToDocument(@RequestBody OcrRecordEO ocrRecordEO) {
|
||||
if(StringUtils.isBlank(ocrRecordEO.getConnectId())){
|
||||
return Result.error("同步失败");
|
||||
@@ -209,6 +211,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
|
||||
@AutoLog(value = "OCR识别转换记录表-通过id删除")
|
||||
@ApiOperation(value="OCR识别转换记录表-通过id删除", notes="OCR识别转换记录表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@RequiresPermissions("ocr:ocrRecord:delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return Result.error("删除数据不能为空");
|
||||
@@ -226,6 +229,7 @@ public class OcrRecordEOController extends JeroController<OcrRecordEO, IOcrRecor
|
||||
@AutoLog(value = "OCR识别转换记录表-批量删除")
|
||||
@ApiOperation(value="OCR识别转换记录表-批量删除", notes="OCR识别转换记录表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@RequiresPermissions("ocr:ocrRecord:deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
if (StringUtils.isBlank(ids)) {
|
||||
return Result.error("删除数据不能为空");
|
||||
|
||||
+5
-1
@@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
@@ -64,12 +65,14 @@ public class OcrRestfulController{
|
||||
|
||||
@ApiOperation(value = "下载word文件")
|
||||
@GetMapping("/downFile")
|
||||
@RequiresPermissions("ocr:ocrRestful:downFile")
|
||||
public void downFile(String fileName, HttpServletResponse response, HttpServletRequest request) throws Exception {
|
||||
InputStream is = null;
|
||||
OutputStream os = null;
|
||||
response.reset();
|
||||
try {
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + fileName);
|
||||
String downFileName = fileName.substring(fileName.lastIndexOf("_") + 1);
|
||||
response.setHeader("Content-Disposition", "attachment; filename=" + downFileName);
|
||||
response.setContentType("application/octet-stream");
|
||||
|
||||
String fullPath = ocrPath + fileName;
|
||||
@@ -151,6 +154,7 @@ public class OcrRestfulController{
|
||||
*/
|
||||
@ApiOperation(value = "新增OCR内容")
|
||||
@PostMapping("/addOcrRecord")
|
||||
@RequiresPermissions("ocr:ocrRestful:addOcrRecord")
|
||||
public Result<?> addOcrRecord(@RequestBody OcrRecordEO ocrRecordEO) throws Exception {
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||
log.info("收到文件上传请求,开始处理文件:【"+sdf.format(new Date())+"】");
|
||||
|
||||
+2
@@ -152,6 +152,7 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
|
||||
ocrRecordEO.setStandName(getOcrEO.getStandName());
|
||||
ocrRecordEO.setFileType(getOcrEO.getFileType());
|
||||
ocrRecordEO.setConnectId(getOcrEO.getConnectId());
|
||||
ocrRecordEO.setAttId(getOcrEO.getAttId());
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// ocrRecordEO.setCreateBy(sysUser.getId());
|
||||
// ocrRecordEO.setCreateTime(new Date());
|
||||
@@ -168,6 +169,7 @@ public class OcrRestfulServiceImpl implements IOcrRestfulService {
|
||||
ocrRecordEO.setFileType(getOcrEO.getFileType());
|
||||
ocrRecordEO.setCreateTime(new Date());
|
||||
ocrRecordEO.setConnectId(getOcrEO.getConnectId());
|
||||
ocrRecordEO.setAttId(getOcrEO.getAttId());
|
||||
ocrRecordEOService.editById(ocrRecordEO); //TODO ??
|
||||
return Result.OK( "加入转换成功", taskId);
|
||||
}
|
||||
|
||||
+4
-24
@@ -48,34 +48,11 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
|
||||
@AutoLog(value = "区域管理表-分页列表查询")
|
||||
@ApiOperation(value="区域管理表-分页列表查询", notes="区域管理表-分页列表查询")
|
||||
@PostMapping(value = "/page")
|
||||
//@RequiresPermissions("area:page")
|
||||
public Result<?> queryPageList(@RequestBody Map<String,Object> params) {
|
||||
IPage<OnlCgformArea> pageList=onlCgformAreaService.queryPageList(params);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
/*@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(@RequestParam(name = "cut") String cut,
|
||||
OnlCgformArea onlCgformArea,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<OnlCgformArea> queryWrapper = QueryGenerator.initQueryWrapper(onlCgformArea, req.getParameterMap());
|
||||
Page<OnlCgformArea> page = new Page<OnlCgformArea>(pageNo, pageSize);
|
||||
if(StringUtils.isNotBlank("create_time")) {
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
}
|
||||
//中英切换-所属模块列
|
||||
List<Map<String, Object>> pageList = onlCgformAreaService.selectPageInfo(page, queryWrapper);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK(pageList);
|
||||
} else {
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
jsonArray.addAll(pageList);
|
||||
List<OnlCgformArea> list = jsonArray.toJavaList(OnlCgformArea.class);
|
||||
list.stream().forEach(f -> f.setIsModel(f.getEnName()));
|
||||
return Result.OK(list);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
@@ -111,6 +88,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
|
||||
@AutoLog(value = "区域管理表-添加")
|
||||
@ApiOperation(value="区域管理表-添加", notes="区域管理表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
//@RequiresPermissions("area:add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformArea onlCgformArea) {
|
||||
onlCgformAreaService.add(onlCgformArea);
|
||||
return Result.OK("添加成功!");
|
||||
@@ -125,6 +103,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
|
||||
@AutoLog(value = "区域管理表-编辑")
|
||||
@ApiOperation(value="区域管理表-编辑", notes="区域管理表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
//@RequiresPermissions("area:edit")
|
||||
public Result<?> edit(@Validated @RequestBody OnlCgformArea onlCgformArea) {
|
||||
onlCgformAreaService.editById(onlCgformArea);
|
||||
return Result.OK("编辑成功!");
|
||||
@@ -139,6 +118,7 @@ public class OnlCgformAreaController extends JeroController<OnlCgformArea, IOnlC
|
||||
@AutoLog(value = "区域管理表-通过id删除")
|
||||
@ApiOperation(value="区域管理表-通过id删除", notes="区域管理表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
//@RequiresPermissions("area:delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
OnlCgformArea onlCgformArea = onlCgformAreaService.queryById(id);
|
||||
int count=onlCgformTagService.queryExitArea(onlCgformArea);
|
||||
|
||||
+12
-25
@@ -3,14 +3,13 @@ package com.jero.modules.tag.controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.generater.modules.online.cgform.controller.OnlCgformApiController;
|
||||
import com.jero.modules.enums.FixedFieldEnum;
|
||||
import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import com.jero.modules.tag.entity.OnlCgformTag;
|
||||
import com.jero.modules.tag.service.IOnlCgformTagService;
|
||||
import com.jero.modules.utils.HanYuPinYinUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -23,7 +22,6 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -46,6 +44,8 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
private OnlCgformTagController onlCgformAreaService;
|
||||
@Autowired
|
||||
private SysDictItemServiceImpl sysDictItemService;
|
||||
@Autowired
|
||||
private OnlCgformApiController onlCgformApiController;
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
@@ -81,29 +81,10 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
@AutoLog(value = "标签管理-添加")
|
||||
@ApiOperation(value="标签管理-添加", notes="标签管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
//@RequiresPermissions("tag:add")
|
||||
public Result<?> add(@Validated @RequestBody OnlCgformTag onlCgformTag) {
|
||||
Integer count=onlCgformTagService.queryExitData(onlCgformTag);
|
||||
if (count > 0) {
|
||||
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
} else {
|
||||
onlCgformTag.setCreateTime(new Date());
|
||||
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
onlCgformTag.setCgformHeadId("48308196e7b04761b533dc31bc899707");//设置文档库-表id
|
||||
onlCgformTag.setDbIsKey(0);
|
||||
onlCgformTag.setDbIsNull(1);
|
||||
onlCgformTag.setDbPointLength(0);
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
|
||||
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
|
||||
onlCgformTag.setDbFieldEnName(onlCgformTag.getDbFieldEnName().replace(" ","_"));
|
||||
if(onlCgformTag.getFieldShowType()=="2"){
|
||||
onlCgformTag.setDbType("int");
|
||||
}else if(onlCgformTag.getFieldShowType()=="5" && onlCgformTag.getFieldShowType()=="6"){
|
||||
onlCgformTag.setDbType("Date");
|
||||
}else{
|
||||
onlCgformTag.setDbType("String");
|
||||
}
|
||||
onlCgformTagService.add(onlCgformTag);
|
||||
}
|
||||
onlCgformTagService.add(onlCgformTag);
|
||||
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
@@ -116,11 +97,13 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
@AutoLog(value = "标签管理-编辑")
|
||||
@ApiOperation(value="标签管理-编辑", notes="标签管理-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
//@RequiresPermissions("tag:edit")
|
||||
public Result<?> edit(@Validated @RequestBody OnlCgformTag onlCgformTag) {
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
|
||||
return Result.error("固定字段,不可修改");
|
||||
}else {
|
||||
onlCgformTagService.editById(onlCgformTag);
|
||||
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
}
|
||||
@@ -134,6 +117,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
@AutoLog(value = "标签管理-通过id删除")
|
||||
@ApiOperation(value="标签管理-通过id删除", notes="标签管理-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
//@RequiresPermissions("tag:delete")
|
||||
public Result<OnlCgformTag> delete(@RequestParam(name="id",required=true) String id) {
|
||||
Result<OnlCgformTag> result = new Result<>();
|
||||
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(id);
|
||||
@@ -142,6 +126,7 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
result.error500("固定字段,不可删除");
|
||||
} else {
|
||||
onlCgformTagService.deleteById(id);
|
||||
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
|
||||
result.OK("删除成功!");
|
||||
}
|
||||
}
|
||||
@@ -157,12 +142,14 @@ public class OnlCgformTagController extends JeroController<OnlCgformTag, IOnlCgf
|
||||
@AutoLog(value = "标签管理-批量删除")
|
||||
@ApiOperation(value="标签管理-批量删除", notes="标签管理-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
//@RequiresPermissions("tag:deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
OnlCgformTag onlCgformTag = onlCgformTagService.queryById(ids);
|
||||
if (FixedFieldEnum.FIXED_FIELD_ENUM.getValue().equals(onlCgformTag.getIsReadOnly()) || FixedFieldEnum.CONFIGURABLE_FIELD.getValue().equals(onlCgformTag.getIsReadOnly())) {
|
||||
return Result.error("固定字段,不可删除");
|
||||
}else {
|
||||
this.onlCgformTagService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
onlCgformApiController.h("48308196e7b04761b533dc31bc899707","normal");
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
}
|
||||
|
||||
+4
-3
@@ -17,9 +17,10 @@ import java.util.Map;
|
||||
public interface OnlCgformTagMapper extends BaseMapper<OnlCgformTag> {
|
||||
@Select("select f.id,f.create_by,f.create_time,f.update_by,f.update_time,f.cgform_head_id,\n" +
|
||||
"f.is_model,f.db_field_txt,f.db_field_en_name,\n" +
|
||||
"f.field_show_type,i.item_text,f.dict_id,f.db_length,\n" +
|
||||
"f.order_num,f.field_must_input,f.is_show_form,f.is_show_list,\n" +
|
||||
"f.is_read_only,f.show_area,a.show_area as show_area_name,f.is_query,f.is_show_laws_list,f.is_show_search,f.is_delete,\n" +
|
||||
"f.field_show_type,i.item_text as field_show_type_name,\n" +
|
||||
"f.dict_id,f.db_length,f.order_num,f.field_must_input,\n" +
|
||||
"f.is_show_form,f.is_show_list,f.is_read_only,\n" +
|
||||
"f.show_area,a.show_area as show_area_name,f.is_query,f.is_show_laws_list,f.is_show_search,f.is_delete,\n" +
|
||||
"f.db_field_name,f.db_is_key,f.db_is_null,f.db_point_length,f.db_type,\n" +
|
||||
"i.en_name as field_show_type_en_name,a.en_name as show_area_en_name\n" +
|
||||
"from onl_cgform_field as f \n" +
|
||||
|
||||
+3
-3
@@ -103,9 +103,9 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
|
||||
public List<OnlCgformArea> queryList(OnlCgformArea onlCgformArea) {
|
||||
LambdaQueryWrapper<OnlCgformArea> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if(StringUtils.isNotBlank(onlCgformArea.getIsModel())){
|
||||
lambdaQueryWrapper.eq(OnlCgformArea::getIsModel,onlCgformArea.getIsModel())
|
||||
.orderByAsc(OnlCgformArea::getSort);
|
||||
lambdaQueryWrapper.eq(OnlCgformArea::getIsModel,onlCgformArea.getIsModel());
|
||||
}
|
||||
lambdaQueryWrapper.orderByAsc(OnlCgformArea::getSort);
|
||||
return list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -152,4 +152,4 @@ public class OnlCgformAreaServiceImpl extends ServiceImpl<OnlCgformAreaMapper, O
|
||||
IPage<OnlCgformArea> result=onlCgformAreaMapper.querPageList(page,params);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+25
-1
@@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.tag.entity.OnlCgformArea;
|
||||
import com.jero.modules.tag.entity.OnlCgformTag;
|
||||
import com.jero.modules.tag.mapper.OnlCgformTagMapper;
|
||||
import com.jero.modules.tag.service.IOnlCgformTagService;
|
||||
import com.jero.modules.utils.HanYuPinYinUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -43,10 +45,30 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
*/
|
||||
@Override
|
||||
public void add(OnlCgformTag onlCgformTag) {
|
||||
Integer count=queryExitData(onlCgformTag);
|
||||
if (count > 0) {
|
||||
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
} else {
|
||||
onlCgformTag.setIsDelete(CommonConstant.DEL_FLAG_0);
|
||||
onlCgformTag.setCgformHeadId("48308196e7b04761b533dc31bc899707");//设置文档库-表id
|
||||
onlCgformTag.setDbIsKey(0);
|
||||
onlCgformTag.setDbIsNull(1);
|
||||
onlCgformTag.setDbPointLength(0);
|
||||
onlCgformTag.setIsReadOnly(0);
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
|
||||
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
|
||||
onlCgformTag.setDbFieldEnName(onlCgformTag.getDbFieldEnName().replace(" ","_"));
|
||||
if(onlCgformTag.getFieldShowType()=="2"){
|
||||
onlCgformTag.setDbType("int");
|
||||
}else if(onlCgformTag.getFieldShowType()=="5" && onlCgformTag.getFieldShowType()=="6"){
|
||||
onlCgformTag.setDbType("Date");
|
||||
}else{
|
||||
onlCgformTag.setDbType("String");
|
||||
}
|
||||
}
|
||||
Date now = new Date();
|
||||
onlCgformTag.setCreateTime(now);
|
||||
onlCgformTag.setUpdateTime(now);
|
||||
onlCgformTag.setIsReadOnly(0);
|
||||
save(onlCgformTag);
|
||||
}
|
||||
|
||||
@@ -59,6 +81,8 @@ public class OnlCgformTagServiceImpl extends ServiceImpl<OnlCgformTagMapper, Onl
|
||||
@Override
|
||||
public void editById(OnlCgformTag onlCgformTag) {
|
||||
Date now = new Date();
|
||||
String pinYin = HanYuPinYinUtil.changeToNumberPinYin(onlCgformTag.getDbFieldTxt());
|
||||
onlCgformTag.setDbFieldName(pinYin.replace(" ","_"));
|
||||
onlCgformTag.setUpdateTime(now);
|
||||
saveOrUpdate(onlCgformTag);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user