|
|
|
|
@@ -2,7 +2,7 @@
|
|
|
|
|
package ${package}.service.impl;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
@@ -14,10 +14,10 @@ import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import org.nl.utils.SecurityUtils;
|
|
|
|
|
import org.nl.wql.core.bean.ResultBean;
|
|
|
|
|
import org.nl.wql.core.bean.WQLObject;
|
|
|
|
|
import org.nl.wql.util.WqlUtil;
|
|
|
|
|
import org.nl.common.utils.SecurityUtils;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
|
|
|
|
|
|
@@ -70,17 +70,17 @@ public class ${className}ServiceImpl implements ${className}Service {
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void create(${className}Dto dto) {
|
|
|
|
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
|
|
|
|
String nickName = SecurityUtils.getNickName();
|
|
|
|
|
String now = DateUtil.now();
|
|
|
|
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
|
|
|
|
String nickName = SecurityUtils.getCurrentNickName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dto.set${pkChangeColName ? cap_first }(IdUtil.getSnowflake(1, 1).nextId());
|
|
|
|
|
dto.setCreate_id(currentUserId);
|
|
|
|
|
dto.setCreate_name(nickName);
|
|
|
|
|
dto.setUpdate_optid(currentUserId);
|
|
|
|
|
dto.setUpdate_optname(nickName);
|
|
|
|
|
dto.setUpdate_time(now);
|
|
|
|
|
dto.setCreate_time(now);
|
|
|
|
|
dto.setUpdate_id(currentUserId);
|
|
|
|
|
dto.setUpdate_name(nickName);
|
|
|
|
|
dto.setUpdate_time(DateUtil.now());
|
|
|
|
|
dto.setCreate_time(DateUtil.now());
|
|
|
|
|
|
|
|
|
|
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
|
|
|
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
|
|
|
|
@@ -93,13 +93,13 @@ public class ${className}ServiceImpl implements ${className}Service {
|
|
|
|
|
${className}Dto entity = this.findById(dto.get${pkChangeColName ? cap_first }());
|
|
|
|
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
|
|
|
|
|
|
|
|
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
|
|
|
|
String nickName = SecurityUtils.getNickName();
|
|
|
|
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
|
|
|
|
String nickName = SecurityUtils.getCurrentNickName();
|
|
|
|
|
|
|
|
|
|
String now = DateUtil.now();
|
|
|
|
|
dto.setUpdate_time(now);
|
|
|
|
|
dto.setUpdate_optid(currentUserId);
|
|
|
|
|
dto.setUpdate_optname(nickName);
|
|
|
|
|
|
|
|
|
|
dto.setUpdate_time(DateUtil.now());
|
|
|
|
|
dto.setUpdate_id(currentUserId);
|
|
|
|
|
dto.setUpdate_name(nickName);
|
|
|
|
|
|
|
|
|
|
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
|
|
|
|
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
|
|
|
|
@@ -109,9 +109,9 @@ public class ${className}ServiceImpl implements ${className}Service {
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
|
|
public void deleteAll(${pkColumnType}[] ids) {
|
|
|
|
|
Long currentUserId = SecurityUtils.getCurrentUserId();
|
|
|
|
|
String nickName = SecurityUtils.getNickName();
|
|
|
|
|
String now = DateUtil.now();
|
|
|
|
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
|
|
|
|
String nickName = SecurityUtils.getCurrentNickName();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WQLObject wo = WQLObject.getWQLObject("${tableName}");
|
|
|
|
|
for (${pkColumnType} ${pkChangeColName}: ids) {
|
|
|
|
|
@@ -120,9 +120,9 @@ public class ${className}ServiceImpl implements ${className}Service {
|
|
|
|
|
param.put("is_delete", "1");
|
|
|
|
|
param.put("update_optid", currentUserId);
|
|
|
|
|
param.put("update_optname", nickName);
|
|
|
|
|
param.put("update_time", now);
|
|
|
|
|
param.put("update_time", DateUtil.now());
|
|
|
|
|
wo.update(param);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|