数据整合(项目 - etl中间件)

整合表单管理 / 整合记录
数据同步(etl - 大数据局)
数据源管理 / 数据表管理(待写) / 同步方式配置(待写) / 同步记录(待写)
数据查询
预设SQL查询配置功能
This commit is contained in:
cuibaocheng 2021-12-23 10:37:23 +08:00
parent 13ff86882b
commit efcfe8b64c
29 changed files with 658 additions and 31 deletions

View File

@ -12,6 +12,7 @@ import cn.com.tenlion.bigdata.service.bigdatatemplate.IBigdataTemplateService;
import cn.com.tenlion.bigdata.service.bigdatatemplatearea.IBigdataTemplateAreaService;
import cn.com.tenlion.bigdata.util.BigDataResult;
import cn.com.tenlion.freemarker.pojo.vos.templaterecord.TemplateRecordVO;
import cn.com.tenlion.freemarker.service.templaterecord.ITemplateRecordService;
import cn.com.tenlion.freemarker.util.TemplateBuilderUtil;
import cn.com.tenlion.freemarker.util.TemplateCreateData;
import com.github.pagehelper.PageHelper;
@ -64,6 +65,9 @@ public class BigdataTemplateServiceImpl extends DefaultBaseService implements IB
@Autowired
private IDataService iDataService;
@Autowired
private ITemplateRecordService iTemplateRecordService;
@Override
public SuccessResult saveBigdataTemplate(BigdataTemplateVO bigdataTemplateVO) throws Exception {
saveBigdataTemplateInfo(null, bigdataTemplateVO);
@ -450,6 +454,7 @@ public class BigdataTemplateServiceImpl extends DefaultBaseService implements IB
params.put("bigdataTemplatePublishStatus", bigdataTemplatePublishStatus ? "1" : "0");
params.put("bigdataTemplatePublishTime", DateUtil.getTime());
setUpdateInfo(params);
iTemplateRecordService.updateStatus(bigdataTemplateId, bigdataTemplatePublishStatus);
bigdataTemplateDao.updateBigdataTemplatePublishStatus(params);
return new SuccessResult();
}

View File

@ -2,6 +2,7 @@ package cn.com.tenlion.bigdata.util;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.joda.time.DateTime;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -48,8 +49,42 @@ public class WeatherUtil {
return resultMap;
}
public static Map<String, Object> getWeather(Date queryDate, String id) throws Exception {
String date = sdfTime.format(queryDate);
if (weather.get(id + "_" + date) != null) {
return weather.get(id + "_" + date);
}
Map<String, Object> params = new HashMap<String, Object>();
params.put("key", "Sk1Gt66B1Z-ZsEJP5");
params.put("location", id);
params.put("language", "zh-Hans");
params.put("unit", "c");
String result = HttpUtil.doGet(url, params);
System.out.println("天气预报返回 : " + result);
JSONObject jsonObject = JSONObject.parseObject(result);
JSONArray array = jsonObject.getJSONArray("results");
Map<String, Object> resultMap = new HashMap<String, Object>();
if(array.size() > 0) {
JSONObject object = array.getJSONObject(0).getJSONObject("now");
JSONObject location = array.getJSONObject(0).getJSONObject("location");
String text = object.getString("text");
String temperature = object.getString("temperature");
String code = object.getString("code");
resultMap.put("text", text);
resultMap.put("temperature", temperature);
resultMap.put("code", code);
resultMap.put("city", location.getString("name"));
weather.put(id + "_" + date, resultMap);
System.out.println(resultMap.toString());
}
return resultMap;
}
public static void main(String[] args) throws Exception {
WeatherUtil.getWeather("WRR2Q2Z7CXWM");
for(int i = 1 ; i < 10 ; i++) {
WeatherUtil.getWeather(DateTime.now().plusDays(i).toDate(), "榆林市");
}
}
}

View File

@ -121,7 +121,7 @@
left : pageX > 0 ? pageX : (pos.left > 0 ? 0 : pos.left * -1 + 30)
}).appendTo("#canvas");
/**
* 键盘控制位置移动 2021年6月22日16:33:34 由CBC新增
* 键盘控制位置移动 2021年6月22日16:33:34 由CBC新增 tabindex="1"
* */
$(document).on('keydown', '#' + dataId, function(e){
if(lock == true){

View File

@ -2,9 +2,7 @@ package cn.com.tenlion.configcolumn.controller.app.api.configcolumnset;
import cn.com.tenlion.configcolumn.pojo.dtos.configcolumn.ConfigColumnDTO;
import cn.com.tenlion.configcolumn.pojo.dtos.configcolumngroup.ConfigColumnGroupDTO;
import cn.com.tenlion.configcolumn.pojo.vos.configcolumnset.ConfigColumnSetDisplayVO;
import cn.com.tenlion.configcolumn.pojo.vos.configcolumnset.ConfigColumnSetNameVO;
import cn.com.tenlion.configcolumn.pojo.vos.configcolumnset.ConfigColumnSetOrderVO;
import cn.com.tenlion.configcolumn.pojo.vos.configcolumnset.*;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
@ -14,7 +12,6 @@ import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultData;
import ink.wgink.pojo.result.SuccessResultList;
import cn.com.tenlion.configcolumn.pojo.dtos.configcolumnset.ConfigColumnSetDTO;
import cn.com.tenlion.configcolumn.pojo.vos.configcolumnset.ConfigColumnSetVO;
import cn.com.tenlion.configcolumn.service.configcolumnset.IConfigColumnSetService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -39,6 +36,18 @@ public class ConfigColumnSetAppController extends DefaultBaseController {
@Autowired
private IConfigColumnSetService configColumnSetService;
@ApiOperation(value = "用户自定义栏目首页置顶", notes = "用户自定义栏目首页置顶接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("savetop")
@CheckRequestBodyAnnotation
public SuccessResult saveTop(@RequestHeader("token") String token, @RequestBody ConfigColumnSetTopVO configColumnSetTopVO) {
configColumnSetService.saveTop(token, configColumnSetTopVO);
return new SuccessResult();
}
@ApiOperation(value = "用户自定义栏目排序", notes = "用户自定义栏目排序接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header")

View File

@ -12,6 +12,8 @@ import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.SaveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.app.AppTokenUser;
import ink.wgink.pojo.bos.UserInfoBO;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
import ink.wgink.util.map.HashMapUtil;
@ -309,6 +311,21 @@ public class ConfigColumnServiceImpl extends DefaultBaseService implements IConf
return listData(token, configColumnDTO.getConfigColumnId(), params);
}
private String getUserId(String token) {
String userId = "notUserId";
try{
if (StringUtils.isBlank(token)) {
UserInfoBO userInfoBO = this.securityComponent.getCurrentUser();
userId = userInfoBO.getUserId();
} else {
AppTokenUser appTokenUser = this.getAppTokenUser(token);
userId = appTokenUser.getId();
}
}catch(Exception e) {
}
return userId;
}
@Override
public List<ConfigColumnDTO> listApp(String token, Map<String, Object> params) {
params.put("configColumnStatus", "1");
@ -318,7 +335,7 @@ public class ConfigColumnServiceImpl extends DefaultBaseService implements IConf
*/
List<ConfigColumnDTO> resultList = new ArrayList<ConfigColumnDTO>();
// 首页是加载名片创建者userId下配置的所有栏目, 个人中心加载的是token下配置的所有栏目
String userIdOrToken = getAppTokenUser(token).getId();
String userIdOrToken = getUserId(token);
if(params.get("creator") != null) {
userIdOrToken = params.get("creator").toString();
}
@ -326,6 +343,7 @@ public class ConfigColumnServiceImpl extends DefaultBaseService implements IConf
ConfigColumnSetDTO setDisplayDTO = iConfigColumnSetService.getSetDisplayByUserId(userIdOrToken, dto.getConfigColumnId());
ConfigColumnSetDTO setNameDTO = iConfigColumnSetService.getSetNameByUserId(userIdOrToken, dto.getConfigColumnId());
ConfigColumnSetDTO setOrderDTO = iConfigColumnSetService.getSetOrderByUserId(userIdOrToken, dto.getConfigColumnId());
ConfigColumnSetDTO setTopDTO = iConfigColumnSetService.getSetTopByUserId(userIdOrToken, dto.getConfigColumnId());
ConfigTableDTO tableDTO = iConfigTableOperationService.getTable(dto.getConfigTableId());
if (tableDTO != null) {
dto.setConfigTableMode(tableDTO.getConfigTableMode());
@ -339,6 +357,10 @@ public class ConfigColumnServiceImpl extends DefaultBaseService implements IConf
dto.setConfigColumnSetName(setNameDTO.getConfigColumnName());
dto.setConfigColumnName(setNameDTO.getConfigColumnName());
}
// 封装自定义是否首页置顶
if (setTopDTO != null) {
dto.setConfigColumnSetTop("1");
}
// 封装自定义是否显示
if (setDisplayDTO == null) {
dto.setConfigColumnSet("1");

View File

@ -188,6 +188,13 @@ public interface IConfigColumnSetService {
*/
void saveIcon(String token, ConfigColumnSetIconVO configColumnSetIconVO);
/**
* 修改栏目的自定义首页显示
* @param token
* @param configColumnSetTopVO
*/
void saveTop(String token, ConfigColumnSetTopVO configColumnSetTopVO);
/**
* 查询栏目的自定义名称
* @param token
@ -195,6 +202,26 @@ public interface IConfigColumnSetService {
*/
ConfigColumnSetDTO getSetName(String token, String configColumnId);
/**
* 查询栏目的自定义隐藏
* @param token
* @param configColumnId
*/
ConfigColumnSetDTO getSetTop(String token, String configColumnId);
/**
* 查询栏目的自定义隐藏
* @param userId
*/
List<ConfigColumnSetDTO> getSetTopByUserId(String userId);
/**
* 查询栏目的自定义隐藏
* @param token
* @param configColumnId
*/
ConfigColumnSetDTO getSetTopByUserId(String token, String configColumnId);
/**
* 查询栏目的自定义隐藏
* @param token

View File

@ -139,6 +139,34 @@ public class ConfigColumnSetServiceImpl extends DefaultBaseService implements IC
}
}
@Override
public void saveTop(String token, ConfigColumnSetTopVO configColumnSetTopVO) {
String configColumnId = configColumnSetTopVO.getConfigColumnId();
ConfigColumnSetDTO setDTO = getSetTop(token, configColumnId);
if (setDTO != null) {
// 执行修改
setDTO.setConfigColumnTop(configColumnSetTopVO.getConfigColumnTop());
Map<String, Object> params = HashMapUtil.beanToMap(setDTO);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
configColumnSetDao.update(params);
}else {
// 执行新增
String configColumnSetId = UUIDUtil.getUUID();
Map<String, Object> params = HashMapUtil.beanToMap(configColumnSetTopVO);
params.put("configColumnSetId", configColumnSetId);
if (StringUtils.isBlank(token)) {
setSaveInfo(params);
} else {
setAppSaveInfo(token, params);
}
configColumnSetDao.save(params);
}
}
@Override
public void saveOrder(String token, ConfigColumnSetOrderVO configColumnSetOrderVO) {
Map<String, Integer> configColumnOrderParams = configColumnSetOrderVO.getConfigColumnOrder();
@ -182,6 +210,15 @@ public class ConfigColumnSetServiceImpl extends DefaultBaseService implements IC
return get(params);
}
@Override
public List<ConfigColumnSetDTO> getSetTopByUserId(String userId) {
Map<String, Object> params = getHashMap(3);
params.put("userId", userId);
params.put("configColumnSetMode", "5");
return list(params);
}
@Override
public ConfigColumnSetDTO getSetIcon(String token, String configColumnId) {
Map<String, Object> params = getHashMap(3);
@ -200,6 +237,15 @@ public class ConfigColumnSetServiceImpl extends DefaultBaseService implements IC
return get(params);
}
@Override
public ConfigColumnSetDTO getSetTop(String token, String configColumnId) {
Map<String, Object> params = getHashMap(3);
params.put("userId", getUserId(token));
params.put("configColumnId", configColumnId);
params.put("configColumnSetMode", "5");
return get(params);
}
@Override
public ConfigColumnSetDTO getSetDisplay(String token, String configColumnId) {
Map<String, Object> params = getHashMap(3);
@ -302,6 +348,7 @@ public class ConfigColumnSetServiceImpl extends DefaultBaseService implements IC
ConfigColumnSetDTO setDisplayDTO = getSetDisplay(token, dto.getConfigColumnId());
ConfigColumnSetDTO setNameDTO = getSetName(token, dto.getConfigColumnId());
ConfigColumnSetDTO setOrderDTO = getSetOrder(token, dto.getConfigColumnId());
ConfigColumnSetDTO setTopDTO = getSetTop(token, dto.getConfigColumnId());
// 封装自定义排序
if (setOrderDTO != null) {
dto.setConfigColumnSetOrder(setOrderDTO.getConfigColumnOrder());
@ -318,6 +365,10 @@ public class ConfigColumnSetServiceImpl extends DefaultBaseService implements IC
}else{
dto.setConfigColumnSet("0");
}
// 封装自定义是否首页置顶
if (setTopDTO != null) {
dto.setConfigColumnSetTop("1");
}
configColumnList.add(dto);
}
}
@ -398,4 +449,13 @@ public class ConfigColumnSetServiceImpl extends DefaultBaseService implements IC
return get(params);
}
@Override
public ConfigColumnSetDTO getSetTopByUserId(String userId, String configColumnId) {
Map<String, Object> params = getHashMap(3);
params.put("userId", userId);
params.put("configColumnId", configColumnId);
params.put("configColumnSetMode", "5");
return get(params);
}
}

View File

@ -10,6 +10,7 @@
<result column="config_column_name" property="configColumnName"/>
<result column="config_column_order" property="configColumnOrder"/>
<result column="config_column_icon" property="configColumnIcon"/>
<result column="config_column_top" property="configColumnTop"/>
<result column="config_column_set_mode" property="configColumnSetMode"/>
<result column="creator" property="creator"/>
<result column="gmt_create" property="gmtCreate"/>
@ -51,6 +52,7 @@
config_column_set_mode,
config_column_order,
config_column_icon,
config_column_top,
creator,
gmt_create,
modifier,
@ -63,6 +65,7 @@
#{configColumnSetMode},
#{configColumnOrder},
#{configColumnIcon},
#{configColumnTop},
#{creator},
#{gmtCreate},
#{modifier},
@ -116,6 +119,9 @@
</if>
<if test="configColumnSetMode != null and configColumnSetMode != ''">
config_column_set_mode = #{configColumnSetMode},
</if>
<if test="configColumnTop != null and configColumnTop != ''">
config_column_top = #{configColumnTop},
</if>
gmt_modified = #{gmtModified},
modifier = #{modifier},
@ -132,7 +138,8 @@
t1.config_column_set_mode,
t1.config_column_set_id,
t1.config_column_order,
t1.config_column_icon
t1.config_column_icon,
t1.config_column_top
FROM
m_config_column_set t1
WHERE
@ -216,7 +223,8 @@
t1.gmt_modified,
t1.is_delete,
t1.config_column_order,
t1.config_column_icon
t1.config_column_icon,
t1.config_column_top
FROM
m_config_column_set t1
WHERE
@ -227,6 +235,14 @@
t1.id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="configColumnSetMode != null and configColumnSetMode != ''">
AND
t1.config_column_set_mode = #{configColumnSetMode}
</if>
<if test="userId != null and userId != ''">
AND
t1.creator = #{userId}
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}

View File

@ -3,6 +3,7 @@ package cn.com.tenlion.freemarker.controller.apis.templaterecord;
import cn.com.tenlion.freemarker.pojo.dtos.templaterecord.TemplateRecordDTO;
import cn.com.tenlion.freemarker.pojo.vos.templaterecord.TemplateRecordVO;
import cn.com.tenlion.freemarker.service.templaterecord.ITemplateRecordService;
import cn.com.tenlion.freemarker.util.StopPage;
import ink.wgink.annotation.CheckRequestBodyAnnotation;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.common.component.SecurityComponent;
@ -51,6 +52,14 @@ public class TemplateRecordController extends DefaultBaseController {
@Autowired
private SecurityComponent securityComponent;
@ApiOperation(value = "更改显示方式", notes = "更改显示方式")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("updatestatus/{templateRecordId}/{templateRecordStatus}")
@CheckRequestBodyAnnotation
public SuccessResult updateDirectoriesView(@PathVariable("templateRecordId") String templateRecordId, @PathVariable("templateRecordStatus") Boolean templateRecordStatus) throws Exception {
return templateRecordService.updateStatus(templateRecordId, templateRecordStatus);
}
@ApiOperation(value = "模板构建文件获取", notes = "模板构建文件获取")
@ApiImplicitParams({
@ApiImplicitParam(name = "templateFileType", value = "文件类型", paramType = "path"),
@ -94,6 +103,9 @@ public class TemplateRecordController extends DefaultBaseController {
@GetMapping(value = "get/html/{templateRecordId}", produces = "text/html")
public String getHtmlById(@PathVariable("templateRecordId") String templateRecordId) throws Exception {
TemplateRecordDTO dto = templateRecordService.getTemplateRecordById(templateRecordId);
if(!"1".equals(dto.getTemplateRecordStatus())) {
return StopPage.stopPage;
}
File file = new File(dto.getTemplateRecordPath());
StringBuilder logContent = new StringBuilder();
try {
@ -131,8 +143,6 @@ public class TemplateRecordController extends DefaultBaseController {
return dto;
}
@ApiOperation(value = "新增模板构建记录", notes = "新增模板构建记录接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("savetemplaterecord")

View File

@ -2,6 +2,7 @@ package cn.com.tenlion.freemarker.controller.app.apis.templaterecord;
import cn.com.tenlion.freemarker.pojo.dtos.templaterecord.TemplateRecordDTO;
import cn.com.tenlion.freemarker.service.templaterecord.ITemplateRecordService;
import cn.com.tenlion.freemarker.util.StopPage;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.common.component.SecurityComponent;
import ink.wgink.exceptions.SearchException;
@ -81,6 +82,9 @@ public class TemplateRecordAppController extends DefaultBaseController {
@GetMapping(value = "get/html/{templateRecordId}", produces = "text/html")
public String getHtmlById(@RequestHeader("token") String token, @PathVariable("templateRecordId") String templateRecordId) throws Exception {
TemplateRecordDTO dto = templateRecordService.getTemplateRecordById(templateRecordId);
if(!"1".equals(dto.getTemplateRecordStatus())) {
return StopPage.stopPage;
}
File file = new File(dto.getTemplateRecordPath());
StringBuilder logContent = new StringBuilder();
try {
@ -138,6 +142,9 @@ public class TemplateRecordAppController extends DefaultBaseController {
@GetMapping(value = "get" + ISystemConstant.RELEASE_SUFFIX + "/html/{templateRecordId}", produces = "text/html")
public String getHtmlByIdRelease(@PathVariable("templateRecordId") String templateRecordId) throws Exception {
TemplateRecordDTO dto = templateRecordService.getTemplateRecordById(templateRecordId);
if(!"1".equals(dto.getTemplateRecordStatus())) {
return StopPage.stopPage;
}
File file = new File(dto.getTemplateRecordPath());
StringBuilder logContent = new StringBuilder();
try {

View File

@ -63,4 +63,5 @@ public interface ITemplateRecordDao {
List<TemplateRecordDTO> getTemplateRecordByTemplateId(Map<String, Object> params) throws UpdateException;
void updateStatus(Map<String, Object> params) throws UpdateException;
}

View File

@ -10,7 +10,6 @@ import cn.com.tenlion.freemarker.util.TemplateBuilderUtil;
import cn.com.tenlion.freemarker.util.TemplateCreateData;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.util.concurrent.AbstractService;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SaveException;

View File

@ -4,6 +4,7 @@ import cn.com.tenlion.freemarker.pojo.dtos.templaterecord.TemplateRecordDTO;
import cn.com.tenlion.freemarker.pojo.vos.templaterecord.TemplateRecordVO;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
@ -108,4 +109,5 @@ public interface ITemplateRecordService {
List<TemplateRecordDTO> getTemplateRecordByTemplateId(String templateId) throws SearchException;
SuccessResult updateStatus(String templateRecordId, Boolean templateRecordStatus) throws UpdateException;
}

View File

@ -10,6 +10,7 @@ import com.github.pagehelper.PageInfo;
import ink.wgink.common.base.DefaultBaseService;
import ink.wgink.exceptions.RemoveException;
import ink.wgink.exceptions.SearchException;
import ink.wgink.exceptions.UpdateException;
import ink.wgink.pojo.ListPage;
import ink.wgink.pojo.result.SuccessResult;
import ink.wgink.pojo.result.SuccessResultList;
@ -17,6 +18,8 @@ import ink.wgink.util.map.HashMapUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -94,13 +97,24 @@ public class TemplateRecordServiceImpl extends DefaultBaseService implements ITe
*/
private void removeTemplateRecordInfo(String token, String ids) {
Map<String, Object> params = getHashMap(3);
params.put("templateRecordIds", Arrays.asList(ids.split("_")));
List<String> idsArray = Arrays.asList(ids.split("_"));
params.put("templateRecordIds", idsArray);
if (StringUtils.isBlank(token)) {
setUpdateInfo(params);
} else {
setAppUpdateInfo(token, params);
}
List<TemplateRecordDTO> templateRecordDTOList = listTemplateRecord(params);
templateRecordDao.removeTemplateRecord(params);
/**
* 删除实际的文件
*/
for(TemplateRecordDTO dto : templateRecordDTOList) {
File file = new File(dto.getTemplateRecordPath());
if(file.exists()) {
file.delete();
}
}
}
@Override
@ -161,4 +175,14 @@ public class TemplateRecordServiceImpl extends DefaultBaseService implements ITe
return templateRecordDao.getTemplateRecordByTemplateId(params);
}
@Override
public SuccessResult updateStatus(String templateRecordId, Boolean templateRecordStatus) throws UpdateException {
Map<String, Object> params = HashMapUtil.beanToMap(3);
params.put("templateRecordId", templateRecordId);
params.put("templateRecordStatus", templateRecordStatus ? "1" : "0");
setUpdateInfo(params);
templateRecordDao.updateStatus(params);
return new SuccessResult();
}
}

File diff suppressed because one or more lines are too long

View File

@ -97,6 +97,14 @@ public class TemplateBuilderUtil {
templateMap.put(templateCode, templateConfigDTO);
}
/**
* 静态模板文件删除
* @throws Exception
*/
public void removeFile(String businessId) {
iTemplateRecordStaticService.removeTemplateRecord(businessId);
}
/**
* 静态模板文件生成
* @throws Exception
@ -180,6 +188,7 @@ public class TemplateBuilderUtil {
* 做生成模板记录
*/
TemplateRecordVO recordVo = new TemplateRecordVO();
recordVo.setTemplateRecordStatus(templateCreateData.getPublishStatus() ? "1" : "0");
recordVo.setBusinessContent(templateCreateData.getBusinessContent());
recordVo.setTemplateRecordId(templateCreateData.getBusinessId());
recordVo.setTemplateId(templateConfigDTO.getTemplateConfigId());
@ -195,7 +204,7 @@ public class TemplateBuilderUtil {
recordUrlNginx = recordUrlNginx + outFilePath.replaceAll(Matcher.quoteReplacement(File.separator), "/") + outFileName;
}
recordVo.setTemplateRecordUrlNginx(recordUrlNginx);
iTemplateRecordStaticService.saveTemplateRecord(recordVo);
iTemplateRecordStaticService.saveTemplateRecordByToken(templateCreateData.getToken(), recordVo);
return recordVo;
}

View File

@ -8,6 +8,16 @@ import java.util.Map;
*/
public class TemplateCreateData<T> {
/**
* 移动端用户的token, 后台调用不需要传入
*/
private String token = "";
/**
* 是否发布
*/
private Boolean publishStatus = false;
/**
* 不能为空 模板编码
*/
@ -43,6 +53,22 @@ public class TemplateCreateData<T> {
*/
private String businessContent;
public String getToken() {
return token == null ? "" : token;
}
public void setToken(String token) {
this.token = token;
}
public Boolean getPublishStatus() {
return publishStatus;
}
public void setPublishStatus(Boolean publishStatus) {
this.publishStatus = publishStatus;
}
public String getTemplateCode() {
return templateCode == null ? "" : templateCode;
}

View File

@ -214,7 +214,7 @@
</foreach>
</if>
ORDER BY
t1.template_order
t1.template_order, t1.template_code
</select>
</mapper>

View File

@ -10,10 +10,20 @@
<result column="template_record_path" property="templateRecordPath"/>
<result column="template_record_url" property="templateRecordUrl"/>
<result column="template_record_url_nginx" property="templateRecordUrlNginx"/>
<result column="template_record_status" property="templateRecordStatus"/>
<result column="template_name" property="templateName"/>
<result column="gmt_create" property="gmtCreate"/>
</resultMap>
<update id="updateStatus" parameterType="map">
UPDATE
m_template_record
SET
template_record_status = #{templateRecordStatus}
WHERE
template_record_id = #{templateRecordId}
</update>
<select id="getTemplateRecordByTemplateId" parameterType="map" resultMap="templateRecordDTO">
SELECT
t1.template_id,
@ -22,7 +32,8 @@
t1.template_record_path,
t1.template_record_url,
t1.template_record_id,
t1.template_record_url_nginx
t1.template_record_url_nginx,
t1.template_record_status
FROM
m_template_record t1
WHERE
@ -40,6 +51,7 @@
template_record_path,
template_record_url,
template_record_url_nginx,
template_record_status,
creator,
gmt_create,
modifier,
@ -53,6 +65,7 @@
#{templateRecordPath},
#{templateRecordUrl},
#{templateRecordUrlNginx},
#{templateRecordStatus},
#{creator},
#{gmtCreate},
#{modifier},
@ -62,12 +75,8 @@
</insert>
<update id="removeTemplateRecord" parameterType="map">
UPDATE
DELETE FROM
m_template_record
SET
is_delete = 1,
modifier = #{modifier},
gmt_modified = #{gmtModified}
WHERE
template_record_id IN
<foreach collection="templateRecordIds" index="index" open="(" separator="," close=")">
@ -96,6 +105,9 @@
</if>
<if test="templateRecordUrlNginx != null and templateRecordUrlNginx != ''">
template_record_url_nginx = #{templateRecordUrlNginx},
</if>
<if test="templateRecordStatus != null and templateRecordStatus != ''">
template_record_status = #{templateRecordStatus},
</if>
modifier = #{modifier},
gmt_modified = #{gmtModified}
@ -112,7 +124,8 @@
t1.template_record_url,
t1.template_record_id,
t1.template_record_url_nginx,
t1.gmt_create
t1.gmt_create,
t1.template_record_status
FROM
m_template_record t1
WHERE
@ -134,7 +147,8 @@
t1.template_record_id,
t1.template_record_url_nginx,
t2.template_name,
t1.gmt_create
t1.gmt_create,
t1.template_record_status
FROM
m_template_record t1
LEFT JOIN

View File

@ -66,12 +66,13 @@
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
}).use(['index', 'table', 'laydate', 'common', 'form'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var form = layui.form;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/templaterecord/listpagetemplaterecord';
@ -126,7 +127,7 @@
return rowData;
}
},
{field: 'businessContent', width: 350, title: '业务内容', align:'center',
{field: 'businessContent', width: 300, title: '业务内容', align:'center',
templet: function(row) {
var rowData = row[this.field];
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
@ -171,6 +172,12 @@
return '<a href="' + rowData + '" download="' + templateRecordId + '" target="_blank">右键目标另存为</a>';
}
},
{field: 'templateRecordStatus', width: 150, fixed: 'right', title: '发布开关', align:'center',
templet: function(row) {
var rowData = row[this.field];
return '<input type="checkbox" value="' + rowData + '" '+ ( rowData == 1 ? "checked" : "") + ' templateRecordId="'+ row.templateRecordId +'" lay-filter="templateRecordStatusEvent" name="templateRecordStatus" lay-skin="switch" lay-text="发布|关闭">';
}
},
{field:'templateRecordUrlNginx', width:120, title: '内容预览', fixed: 'right', align:'center',
templet: function(row) {
return '<button lay-event="templateRecordUrlNginxViewEvent" type="button" class="layui-btn layui-btn-xs layui-btn-radius">内容预览</button>';
@ -190,6 +197,20 @@
});
}
// 审核开关
form.on('switch(templateRecordStatusEvent)', function () {
var loadLayerIndex;
var obj = {};
top.restAjax.put(top.restAjax.path('api/templaterecord/updatestatus/{templateRecordId}/{templateRecordStatus}', [$(this).attr("templateRecordId"), this.checked]), obj, null, function(code, data) {
}, function(code, data) {
top.dialog.msg(data.msg);
}, function() {
loadLayerIndex = top.dialog.msg(top.dataMessage.committing, {icon: 16, time: 0, shade: 0.3});
}, function() {
top.dialog.close(loadLayerIndex);
});
});
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {

View File

@ -71,10 +71,12 @@ public class ConfigColumnDTO implements Serializable {
private Integer isDelete;
@ApiModelProperty(name = "configColumnSet", value = "个人自定义的隐藏状态,1:显示,0:隐藏")
private String configColumnSet = "0";
@ApiModelProperty(name = "configColumnName", value = "个人自定义的栏目名称,为空则未设置")
@ApiModelProperty(name = "configColumnSetName", value = "个人自定义的栏目名称,为空则未设置")
private String configColumnSetName;
@ApiModelProperty(name = "configColumnSetOrder", value = "个人自定义的栏目排序,为空则未设置")
private Integer configColumnSetOrder;
@ApiModelProperty(name = "configColumnSetTop", value = "企业自定义的首页置顶,为空则未设置")
private String configColumnSetTop;
@ApiModelProperty(name = "configColumnComment", value = "评论开关")
private String configColumnComment;
@ApiModelProperty(name = "configColumnDispatch", value = "转发开关")
@ -88,6 +90,14 @@ public class ConfigColumnDTO implements Serializable {
@ApiModelProperty(name = "configColumnRole", value = "适用角色")
private String configColumnRole;
public String getConfigColumnSetTop() {
return configColumnSetTop == null ? "" : configColumnSetTop;
}
public void setConfigColumnSetTop(String configColumnSetTop) {
this.configColumnSetTop = configColumnSetTop;
}
public String getConfigColumnRole() {
return configColumnRole == null ? "" : configColumnRole;
}

View File

@ -26,7 +26,9 @@ public class ConfigColumnSetDTO implements Serializable {
private Integer configColumnOrder;
@ApiModelProperty(name = "configColumnIcon", value = "图标")
private String configColumnIcon;
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标")
@ApiModelProperty(name = "configColumnTop", value = "首页置顶")
private String configColumnTop;
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标,5:首页置顶")
private String configColumnSetMode;
@ApiModelProperty(name = "creator", value = "")
private String creator;
@ -39,6 +41,14 @@ public class ConfigColumnSetDTO implements Serializable {
@ApiModelProperty(name = "isDelete", value = "")
private Integer isDelete;
public String getConfigColumnTop() {
return configColumnTop == null ? "" : configColumnTop;
}
public void setConfigColumnTop(String configColumnTop) {
this.configColumnTop = configColumnTop;
}
public Integer getConfigColumnOrder() {
return configColumnOrder;
}

View File

@ -18,7 +18,7 @@ public class ConfigColumnSetDisplayVO {
@ApiModelProperty(name = "configColumnId", value = "栏目ID")
@CheckEmptyAnnotation(name = "栏目ID")
private String configColumnId;
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标(前端无需传入)")
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标,5:首页置顶(前端无需传入)")
private String configColumnSetMode = "1";
public String getConfigColumnId() {

View File

@ -18,7 +18,7 @@ public class ConfigColumnSetIconVO {
@ApiModelProperty(name = "configColumnId", value = "栏目ID")
@CheckEmptyAnnotation(name = "栏目ID")
private String configColumnId;
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标(前端无需传入)")
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标,5:首页置顶(前端无需传入)")
private String configColumnSetMode = "3";
@ApiModelProperty(name = "configColumnIcon", value = "更改的图标")
@CheckEmptyAnnotation(name = "更改的图标")

View File

@ -21,7 +21,7 @@ public class ConfigColumnSetNameVO {
@ApiModelProperty(name = "configColumnName", value = "更名")
@CheckEmptyAnnotation(name = "更改的名字")
private String configColumnName;
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标(前端无需传入)")
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标,5:首页置顶(前端无需传入)")
private String configColumnSetMode = "2";
public String getConfigColumnId() {

View File

@ -22,7 +22,7 @@ public class ConfigColumnSetOrderVO {
@ApiModelProperty(name = "configColumnId", value = "栏目ID")
private String configColumnId;
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标(前端无需传入)")
@ApiModelProperty(name = "configColumnSetMode", value = "设置模式1:隐藏,2:更名,3:排序,4:图标,5:首页置顶(前端无需传入)")
private String configColumnSetMode = "3";
@ApiModelProperty(name = "configColumnOrder", value = "更改的排序")
private Map<String, Integer> configColumnOrder = new HashMap<String, Integer>();

View File

@ -36,6 +36,16 @@ public class TemplateRecordDTO {
private String templateContentText;
@ApiModelProperty(name = "gmtCreate", value = "创建时间")
private String gmtCreate;
@ApiModelProperty(name = "templateRecordStatus", value = "发布状态1:发布,0:不发布")
private String templateRecordStatus;
public String getTemplateRecordStatus() {
return templateRecordStatus == null ? "" : templateRecordStatus;
}
public void setTemplateRecordStatus(String templateRecordStatus) {
this.templateRecordStatus = templateRecordStatus;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate;

View File

@ -33,7 +33,16 @@ public class TemplateRecordVO {
private String templateRecordUrl;
@ApiModelProperty(name = "templateRecordUrlNginx", value = "模板访问全路径")
private String templateRecordUrlNginx;
@ApiModelProperty(name = "templateRecordStatus", value = "发布状态1:发布,0:不发布")
private String templateRecordStatus;
public String getTemplateRecordStatus() {
return templateRecordStatus == null ? "" : templateRecordStatus;
}
public void setTemplateRecordStatus(String templateRecordStatus) {
this.templateRecordStatus = templateRecordStatus;
}
public String getTemplateRecordUrlNginx() {
return templateRecordUrlNginx == null ? "" : templateRecordUrlNginx;
}

View File

@ -48,9 +48,11 @@
<module>module-config-content</module>
<module>interface-config-content</module>
<module>pojo-config-content</module>
<module>interface-project-config</module>
<module>pojo-project-config</module>
<module>module-project-config</module>
<module>interface-news</module>
<module>module-news</module>
<module>pojo-news</module>