优化代码生成细节
parent
636e3bce52
commit
6b6658f9a1
|
|
@ -13,6 +13,16 @@ public class ExtBaseEntity extends BaseEntity {
|
|||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 逻辑删除标志:未删除
|
||||
*/
|
||||
public static final int NOT_DELETE = 0;
|
||||
|
||||
/**
|
||||
* 逻辑删除标志:已删除
|
||||
*/
|
||||
public static final int DELETED = 1;
|
||||
|
||||
/**
|
||||
* 逻辑删除标志。true:已删除;false:未删除
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -5,62 +5,61 @@ import org.springframework.stereotype.Component;
|
|||
|
||||
/**
|
||||
* 代码生成相关配置
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "gen")
|
||||
public class GenConfig
|
||||
{
|
||||
/** 作者 */
|
||||
public class GenConfig {
|
||||
/**
|
||||
* 作者
|
||||
*/
|
||||
public static String author;
|
||||
|
||||
/** 生成包路径 */
|
||||
/**
|
||||
* 生成包路径
|
||||
*/
|
||||
public static String packageName;
|
||||
|
||||
/** 自动去除表前缀,默认是false */
|
||||
/**
|
||||
* 自动去除表前缀,默认是false
|
||||
*/
|
||||
public static boolean autoRemovePre;
|
||||
|
||||
/** 表前缀(类名不会包含表前缀) */
|
||||
/**
|
||||
* 表前缀(类名不会包含表前缀)
|
||||
*/
|
||||
public static String tablePrefix;
|
||||
|
||||
public static String getAuthor()
|
||||
{
|
||||
public static String getAuthor() {
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setAuthor(String author)
|
||||
{
|
||||
public void setAuthor(String author) {
|
||||
GenConfig.author = author;
|
||||
}
|
||||
|
||||
public static String getPackageName()
|
||||
{
|
||||
public static String getPackageName() {
|
||||
return packageName;
|
||||
}
|
||||
|
||||
public void setPackageName(String packageName)
|
||||
{
|
||||
public void setPackageName(String packageName) {
|
||||
GenConfig.packageName = packageName;
|
||||
}
|
||||
|
||||
public static boolean getAutoRemovePre()
|
||||
{
|
||||
public static boolean getAutoRemovePre() {
|
||||
return autoRemovePre;
|
||||
}
|
||||
|
||||
public void setAutoRemovePre(boolean autoRemovePre)
|
||||
{
|
||||
public void setAutoRemovePre(boolean autoRemovePre) {
|
||||
GenConfig.autoRemovePre = autoRemovePre;
|
||||
}
|
||||
|
||||
public static String getTablePrefix()
|
||||
{
|
||||
public static String getTablePrefix() {
|
||||
return tablePrefix;
|
||||
}
|
||||
|
||||
public void setTablePrefix(String tablePrefix)
|
||||
{
|
||||
public void setTablePrefix(String tablePrefix) {
|
||||
GenConfig.tablePrefix = tablePrefix;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public interface I${ClassName}Service {
|
|||
* @param ${pkColumn.javaField} ${functionName}主键
|
||||
* @return ${functionName}
|
||||
*/
|
||||
${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||
${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField});
|
||||
|
||||
/**
|
||||
* 查询${functionName}列表
|
||||
|
|
|
|||
|
|
@ -11,14 +11,17 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.mybatis.dynamic.sql.where.condition.IsEqualTo;
|
||||
import org.mybatis.dynamic.sql.where.condition.IsIn;
|
||||
import org.mybatis.dynamic.sql.select.SelectDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
#if($table.sub)
|
||||
import java.util.ArrayList;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ${packageName}.domain.${subClassName};
|
||||
#end
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import ${packageName}.mapper.${ClassName}Mapper;
|
||||
import ${packageName}.domain.${ClassName};
|
||||
import ${packageName}.mapper.${ClassName}DynamicSqlSupport;
|
||||
|
|
@ -61,45 +64,41 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
@Override
|
||||
public List<${ClassName}> select${ClassName}List(${ClassName} ${className})
|
||||
{
|
||||
## return ${className}Mapper.select(SelectDSLCompleter.allRows()); //查询全部字段
|
||||
#set ($whereFuncName = "where")
|
||||
SelectStatementProvider provider = SqlBuilder.select(${ClassName}Mapper.selectList)
|
||||
.from(${ClassName}DynamicSqlSupport.${className})
|
||||
.where(${ClassName}DynamicSqlSupport.deleteFlag, SqlBuilder.isEqualTo(ExtBaseEntity.NOT_DELETE))
|
||||
#set ($conditionFuncName = "isEqualToWhenPresent")
|
||||
return unitInfoMapper.select(dsl -> dsl
|
||||
#foreach ($column in $columns)
|
||||
## where语句是where还是and开头
|
||||
#if (!$foreach.first)
|
||||
#set ($whereFuncName = "and")
|
||||
#end
|
||||
## 查询条件
|
||||
#if ($columne.queryType == "EQ")
|
||||
#set ($conditionFuncName = "isEqualToWhenPresent")
|
||||
#elseif ($columne.queryType == "NE")
|
||||
#set ($conditionFuncName = "isNotEqualToWhenPresent")
|
||||
#elseif ($columne.queryType == "GT")
|
||||
#set ($conditionFuncName = "isGreaterThanWhenPresent")
|
||||
#elseif ($columne.queryType == "GTE")
|
||||
#set ($conditionFuncName = "isGreaterThanOrEqualToWhenPresent")
|
||||
#elseif ($columne.queryType == "LT")
|
||||
#set ($conditionFuncName = "isLessThanWhenPresent")
|
||||
#elseif ($columne.queryType == "LTE")
|
||||
#set ($conditionFuncName = "isLessThanOrEqualToWhenPresent")
|
||||
#elseif ($columne.queryType == "LIKE")
|
||||
#set ($conditionFuncName = "isLikeWhenPresent")
|
||||
#elseif ($columne.queryType == "BETWEEN")
|
||||
#set ($conditionFuncName = "isBetweenWhenPresent")
|
||||
## #elseif ($columne.queryType == "IN")
|
||||
## #set ($conditionFuncName = "isIn")
|
||||
## #elseif ($columne.queryType == "NI")
|
||||
## #set ($conditionFuncName = "isNotIn")
|
||||
#end
|
||||
## 对like条件的特殊处理
|
||||
#if ($columne.queryType == "LIKE")
|
||||
.${whereFuncName}(${ClassName}DynamicSqlSupport.$column.javaField, SqlBuilder.${conditionFuncName}(${className}.get${column.javaFieldUpper}() == null ? null : "%" + ${className}.get${column.javaFieldUpper}() + "%")
|
||||
#else
|
||||
.${whereFuncName}(${ClassName}DynamicSqlSupport.$column.javaField, SqlBuilder.${conditionFuncName}(${className}.get${column.javaFieldUpper}()))
|
||||
#if ($column.isQuery == "1")
|
||||
## 查询条件
|
||||
#if ($column.queryType == "EQ")
|
||||
#set ($conditionFuncName = "isEqualToWhenPresent")
|
||||
#elseif ($column.queryType == "NE")
|
||||
#set ($conditionFuncName = "isNotEqualToWhenPresent")
|
||||
#elseif ($column.queryType == "GT")
|
||||
#set ($conditionFuncName = "isGreaterThanWhenPresent")
|
||||
#elseif ($column.queryType == "GTE")
|
||||
#set ($conditionFuncName = "isGreaterThanOrEqualToWhenPresent")
|
||||
#elseif ($column.queryType == "LT")
|
||||
#set ($conditionFuncName = "isLessThanWhenPresent")
|
||||
#elseif ($column.queryType == "LTE")
|
||||
#set ($conditionFuncName = "isLessThanOrEqualToWhenPresent")
|
||||
#elseif ($column.queryType == "LIKE")
|
||||
#set ($conditionFuncName = "isLikeWhenPresent")
|
||||
#else
|
||||
#set ($conditionFuncName = "isEqualToWhenPresent")
|
||||
#end
|
||||
## 对like条件的特殊处理
|
||||
#if ($column.queryType == "LIKE")
|
||||
.and(${ClassName}DynamicSqlSupport.$column.javaField, SqlBuilder.${conditionFuncName}(${className}.get${column.javaFieldUpper}() == null ? null : "%" + ${className}.get${column.javaFieldUpper}() + "%")
|
||||
#else
|
||||
.and(${ClassName}DynamicSqlSupport.$column.javaField, SqlBuilder.${conditionFuncName}(${className}.get${column.javaFieldUpper}()))
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
);
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return ${className}Mapper.selectMany(provider);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -167,8 +166,14 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
#if($table.sub)
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}s(${pkColumn.javaField}s);
|
||||
#end
|
||||
|
||||
return ${className}Mapper.delete(dsl -> dsl.where(${ClassName}DynamicSqlSupport.${pkColumn.javaField}, SqlBuilder.isIn(${pkColumn.javaField}s)));
|
||||
## return ${className}Mapper.delete(dsl -> dsl.where(${ClassName}DynamicSqlSupport.${pkColumn.javaField}, SqlBuilder.isIn(${pkColumn.javaField}s)));
|
||||
UpdateStatementProvider provider = SqlBuilder.update(UnitInfoDynamicSqlSupport.${className})
|
||||
.set(${ClassName}DynamicSqlSupport.deleteFlag).equalTo(ExtBaseEntity.DELETED)
|
||||
.set(${ClassName}DynamicSqlSupport.updateTime).equalTo(DateUtils.getNowDate())
|
||||
.where(${ClassName}DynamicSqlSupport.unitCode, SqlBuilder.isIn(${pkColumn.javaField}s))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return ${className}Mapper.update(provider);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -186,7 +191,12 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
|||
#if($table.sub)
|
||||
${className}Mapper.delete${subClassName}By${subTableFkClassName}(${pkColumn.javaField});
|
||||
#end
|
||||
return ${className}Mapper.delete(dsl -> dsl.where(${ClassName}DynamicSqlSupport.${pkColumn.javaField}, SqlBuilder.isEqualTo(${pkColumn.javaField})));
|
||||
## return ${className}Mapper.delete(dsl -> dsl.where(${ClassName}DynamicSqlSupport.${pkColumn.javaField}, SqlBuilder.isEqualTo(${pkColumn.javaField})));
|
||||
${ClassName} record = new ${ClassName}();
|
||||
record.set${pkColumn.capJavaField}(${pkColumn.javaField});
|
||||
record.setDeleteFlag(ExtBaseEntity.DELETED);
|
||||
record.setUpdateTime(DateUtils.getNowDate());
|
||||
return ${className}Mapper.updateByPrimaryKey(record);
|
||||
}
|
||||
#if($table.sub)
|
||||
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ const { ${dictsNoSymbol} } = proxy.useDict(${dicts});
|
|||
const ${businessName}List = ref([]);
|
||||
const ${businessName}Options = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
const title = ref("");
|
||||
const isExpandAll = ref(true);
|
||||
|
|
@ -470,5 +470,6 @@ function handleDelete(row) {
|
|||
}).catch(() => {});
|
||||
}
|
||||
|
||||
getList();
|
||||
//页面打开时查询
|
||||
//getList();
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ const ${businessName}List = ref([]);
|
|||
const ${subclassName}List = ref([]);
|
||||
#end
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
#if($table.sub)
|
||||
|
|
@ -586,5 +586,6 @@ function handleExport() {
|
|||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
//页面打开时查询
|
||||
//getList();
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -20,20 +20,17 @@ import com.ruoyi.job.domain.SysJob;
|
|||
|
||||
/**
|
||||
* 定时任务工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class ScheduleUtils
|
||||
{
|
||||
public class ScheduleUtils {
|
||||
/**
|
||||
* 得到quartz任务类
|
||||
*
|
||||
* @param sysJob 执行计划
|
||||
* @return 具体执行任务类
|
||||
*/
|
||||
private static Class<? extends Job> getQuartzJobClass(SysJob sysJob)
|
||||
{
|
||||
private static Class<? extends Job> getQuartzJobClass(SysJob sysJob) {
|
||||
boolean isConcurrent = "0".equals(sysJob.getConcurrent());
|
||||
return isConcurrent ? QuartzJobExecution.class : QuartzDisallowConcurrentExecution.class;
|
||||
}
|
||||
|
|
@ -41,24 +38,21 @@ public class ScheduleUtils
|
|||
/**
|
||||
* 构建任务触发对象
|
||||
*/
|
||||
public static TriggerKey getTriggerKey(Long jobId, String jobGroup)
|
||||
{
|
||||
public static TriggerKey getTriggerKey(Long jobId, String jobGroup) {
|
||||
return TriggerKey.triggerKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建任务键对象
|
||||
*/
|
||||
public static JobKey getJobKey(Long jobId, String jobGroup)
|
||||
{
|
||||
public static JobKey getJobKey(Long jobId, String jobGroup) {
|
||||
return JobKey.jobKey(ScheduleConstants.TASK_CLASS_NAME + jobId, jobGroup);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建定时任务
|
||||
*/
|
||||
public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException
|
||||
{
|
||||
public static void createScheduleJob(Scheduler scheduler, SysJob job) throws SchedulerException, TaskException {
|
||||
Class<? extends Job> jobClass = getQuartzJobClass(job);
|
||||
// 构建job信息
|
||||
Long jobId = job.getJobId();
|
||||
|
|
@ -77,22 +71,19 @@ public class ScheduleUtils
|
|||
jobDetail.getJobDataMap().put(ScheduleConstants.TASK_PROPERTIES, job);
|
||||
|
||||
// 判断是否存在
|
||||
if (scheduler.checkExists(getJobKey(jobId, jobGroup)))
|
||||
{
|
||||
if (scheduler.checkExists(getJobKey(jobId, jobGroup))) {
|
||||
// 防止创建时存在数据问题 先移除,然后在执行创建操作
|
||||
scheduler.deleteJob(getJobKey(jobId, jobGroup));
|
||||
}
|
||||
|
||||
// 判断任务是否过期
|
||||
if (StringUtils.isNotNull(CronUtils.getNextExecution(job.getCronExpression())))
|
||||
{
|
||||
if (StringUtils.isNotNull(CronUtils.getNextExecution(job.getCronExpression()))) {
|
||||
// 执行调度任务
|
||||
scheduler.scheduleJob(jobDetail, trigger);
|
||||
}
|
||||
|
||||
// 暂停任务
|
||||
if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue()))
|
||||
{
|
||||
if (job.getStatus().equals(ScheduleConstants.Status.PAUSE.getValue())) {
|
||||
scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup));
|
||||
}
|
||||
}
|
||||
|
|
@ -101,10 +92,8 @@ public class ScheduleUtils
|
|||
* 设置定时任务策略
|
||||
*/
|
||||
public static CronScheduleBuilder handleCronScheduleMisfirePolicy(SysJob job, CronScheduleBuilder cb)
|
||||
throws TaskException
|
||||
{
|
||||
switch (job.getMisfirePolicy())
|
||||
{
|
||||
throws TaskException {
|
||||
switch (job.getMisfirePolicy()) {
|
||||
case ScheduleConstants.MISFIRE_DEFAULT:
|
||||
return cb;
|
||||
case ScheduleConstants.MISFIRE_IGNORE_MISFIRES:
|
||||
|
|
@ -121,16 +110,14 @@ public class ScheduleUtils
|
|||
|
||||
/**
|
||||
* 检查包名是否为白名单配置
|
||||
*
|
||||
*
|
||||
* @param invokeTarget 目标字符串
|
||||
* @return 结果
|
||||
*/
|
||||
public static boolean whiteList(String invokeTarget)
|
||||
{
|
||||
public static boolean whiteList(String invokeTarget) {
|
||||
String packageName = StringUtils.substringBefore(invokeTarget, "(");
|
||||
int count = StringUtils.countMatches(packageName, ".");
|
||||
if (count > 1)
|
||||
{
|
||||
if (count > 1) {
|
||||
return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR);
|
||||
}
|
||||
Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]);
|
||||
|
|
|
|||
|
|
@ -1,11 +1,5 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.constant.CacheConstants;
|
||||
import com.ruoyi.common.core.constant.UserConstants;
|
||||
import com.ruoyi.common.core.exception.ServiceException;
|
||||
|
|
@ -15,6 +9,12 @@ import com.ruoyi.common.redis.service.RedisService;
|
|||
import com.ruoyi.system.domain.SysConfig;
|
||||
import com.ruoyi.system.mapper.SysConfigMapper;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import jakarta.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 参数配置 服务层实现
|
||||
|
|
@ -172,9 +172,9 @@ public class SysConfigServiceImpl implements ISysConfigService {
|
|||
*/
|
||||
@Override
|
||||
public boolean checkConfigKeyUnique(SysConfig config) {
|
||||
Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
||||
long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId();
|
||||
SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey());
|
||||
if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) {
|
||||
if (StringUtils.isNotNull(info) && info.getConfigId() != configId) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
|
|
|
|||
|
|
@ -15,14 +15,13 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
* 单位信息管理Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* created on 2024-02-02
|
||||
*
|
||||
* @author ryas
|
||||
* created on 2024-02-05
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/UnitInfo")
|
||||
public class UnitInfoController extends BaseController
|
||||
{
|
||||
public class UnitInfoController extends BaseController {
|
||||
@Autowired
|
||||
private IUnitInfoService unitInfoService;
|
||||
|
||||
|
|
@ -31,8 +30,7 @@ public class UnitInfoController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("wms:UnitInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(UnitInfo unitInfo)
|
||||
{
|
||||
public TableDataInfo list(UnitInfo unitInfo) {
|
||||
startPage();
|
||||
List<UnitInfo> list = unitInfoService.selectUnitInfoList(unitInfo);
|
||||
return getDataTable(list);
|
||||
|
|
@ -56,10 +54,9 @@ public class UnitInfoController extends BaseController
|
|||
* 获取单位信息管理详细信息
|
||||
*/
|
||||
@RequiresPermissions("wms:UnitInfo:query")
|
||||
@GetMapping(value = "/{orgCd}")
|
||||
public AjaxResult getInfo(@PathVariable("orgCd") String orgCd)
|
||||
{
|
||||
return success(unitInfoService.selectUnitInfoByOrgCd(orgCd));
|
||||
@GetMapping(value = "/{unitCode}")
|
||||
public AjaxResult getInfo(@PathVariable("unitCode") String unitCode) {
|
||||
return success(unitInfoService.selectUnitInfoByUnitCode(unitCode));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -68,8 +65,7 @@ public class UnitInfoController extends BaseController
|
|||
@RequiresPermissions("wms:UnitInfo:add")
|
||||
@Log(title = "单位信息管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody UnitInfo unitInfo)
|
||||
{
|
||||
public AjaxResult add(@RequestBody UnitInfo unitInfo) {
|
||||
return toAjax(unitInfoService.insertUnitInfo(unitInfo));
|
||||
}
|
||||
|
||||
|
|
@ -79,8 +75,7 @@ public class UnitInfoController extends BaseController
|
|||
@RequiresPermissions("wms:UnitInfo:edit")
|
||||
@Log(title = "单位信息管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody UnitInfo unitInfo)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody UnitInfo unitInfo) {
|
||||
return toAjax(unitInfoService.updateUnitInfo(unitInfo));
|
||||
}
|
||||
|
||||
|
|
@ -89,9 +84,8 @@ public class UnitInfoController extends BaseController
|
|||
*/
|
||||
@RequiresPermissions("wms:UnitInfo:remove")
|
||||
@Log(title = "单位信息管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{orgCds}")
|
||||
public AjaxResult remove(@PathVariable String[] orgCds)
|
||||
{
|
||||
return toAjax(unitInfoService.deleteUnitInfoByOrgCds(orgCds));
|
||||
@DeleteMapping("/{unitCodes}")
|
||||
public AjaxResult remove(@PathVariable String[] unitCodes) {
|
||||
return toAjax(unitInfoService.deleteUnitInfoByUnitCodes(unitCodes));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,54 +9,63 @@ import jakarta.annotation.Generated;
|
|||
* This class corresponds to the database table SF_WMS_M_UNIT_INFO
|
||||
*/
|
||||
public class UnitInfo extends ExtBaseEntity {
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.ORG_CD")
|
||||
private String orgCd;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT")
|
||||
private String unit;
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 单位代码
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CODE")
|
||||
private String unitCode;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 单位名称
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_NAME")
|
||||
private String unitName;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CONV_RATE")
|
||||
private String unitConvRate;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.SRC_CONV_UNIT")
|
||||
private String srcConvUnit;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注1
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_1")
|
||||
private String remark1;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注2
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_2")
|
||||
private String remark2;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注3
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_3")
|
||||
private String remark3;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注4
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_4")
|
||||
private String remark4;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注5
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_5")
|
||||
private String remark5;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.ORG_CD")
|
||||
public String getOrgCd() {
|
||||
return orgCd;
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CODE")
|
||||
public String getUnitCode() {
|
||||
return unitCode;
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.ORG_CD")
|
||||
public void setOrgCd(String orgCd) {
|
||||
this.orgCd = orgCd == null ? null : orgCd.trim();
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT")
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT")
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit == null ? null : unit.trim();
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CODE")
|
||||
public void setUnitCode(String unitCode) {
|
||||
this.unitCode = unitCode == null ? null : unitCode.trim();
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_NAME")
|
||||
|
|
@ -69,26 +78,6 @@ public class UnitInfo extends ExtBaseEntity {
|
|||
this.unitName = unitName == null ? null : unitName.trim();
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CONV_RATE")
|
||||
public String getUnitConvRate() {
|
||||
return unitConvRate;
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CONV_RATE")
|
||||
public void setUnitConvRate(String unitConvRate) {
|
||||
this.unitConvRate = unitConvRate == null ? null : unitConvRate.trim();
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.SRC_CONV_UNIT")
|
||||
public String getSrcConvUnit() {
|
||||
return srcConvUnit;
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.SRC_CONV_UNIT")
|
||||
public void setSrcConvUnit(String srcConvUnit) {
|
||||
this.srcConvUnit = srcConvUnit == null ? null : srcConvUnit.trim();
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_1")
|
||||
public String getRemark1() {
|
||||
return remark1;
|
||||
|
|
|
|||
|
|
@ -10,39 +10,66 @@ public final class UnitInfoDynamicSqlSupport {
|
|||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
public static final UnitInfo unitInfo = new UnitInfo();
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.ORG_CD")
|
||||
public static final SqlColumn<String> orgCd = unitInfo.orgCd;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT")
|
||||
public static final SqlColumn<String> unit = unitInfo.unit;
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 单位代码
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CODE")
|
||||
public static final SqlColumn<String> unitCode = unitInfo.unitCode;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 单位名称
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_NAME")
|
||||
public static final SqlColumn<String> unitName = unitInfo.unitName;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UNIT_CONV_RATE")
|
||||
public static final SqlColumn<String> unitConvRate = unitInfo.unitConvRate;
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.SRC_CONV_UNIT")
|
||||
public static final SqlColumn<String> srcConvUnit = unitInfo.srcConvUnit;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注1
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_1")
|
||||
public static final SqlColumn<String> remark1 = unitInfo.remark1;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注2
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_2")
|
||||
public static final SqlColumn<String> remark2 = unitInfo.remark2;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注3
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_3")
|
||||
public static final SqlColumn<String> remark3 = unitInfo.remark3;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注4
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_4")
|
||||
public static final SqlColumn<String> remark4 = unitInfo.remark4;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 备注5
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.REMARK_5")
|
||||
public static final SqlColumn<String> remark5 = unitInfo.remark5;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 更新次数
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.UPDATE_COUNT")
|
||||
public static final SqlColumn<Integer> updateCount = unitInfo.updateCount;
|
||||
|
||||
/**
|
||||
* Database Column Remarks:
|
||||
* 删除标志
|
||||
*/
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source field: SF_WMS_M_UNIT_INFO.DELETE_FLAG")
|
||||
public static final SqlColumn<Integer> deleteFlag = unitInfo.deleteFlag;
|
||||
|
||||
|
|
@ -83,16 +110,10 @@ public final class UnitInfoDynamicSqlSupport {
|
|||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
public static final class UnitInfo extends AliasableSqlTable<UnitInfo> {
|
||||
public final SqlColumn<String> orgCd = column("ORG_CD", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> unit = column("UNIT", JDBCType.VARCHAR);
|
||||
public final SqlColumn<String> unitCode = column("UNIT_CODE", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> unitName = column("UNIT_NAME", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> unitConvRate = column("UNIT_CONV_RATE", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> srcConvUnit = column("SRC_CONV_UNIT", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> remark1 = column("REMARK_1", JDBCType.VARCHAR);
|
||||
|
||||
public final SqlColumn<String> remark2 = column("REMARK_2", JDBCType.VARCHAR);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,18 @@
|
|||
package com.ruoyi.wms.mapper;
|
||||
|
||||
import static com.ruoyi.wms.mapper.UnitInfoDynamicSqlSupport.*;
|
||||
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||
|
||||
import com.ruoyi.wms.domain.UnitInfo;
|
||||
import jakarta.annotation.Generated;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Result;
|
||||
import org.apache.ibatis.annotations.ResultMap;
|
||||
import org.apache.ibatis.annotations.Results;
|
||||
import org.apache.ibatis.annotations.SelectProvider;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.mybatis.dynamic.sql.BasicColumn;
|
||||
import org.mybatis.dynamic.sql.delete.DeleteDSLCompleter;
|
||||
|
|
@ -13,28 +23,22 @@ import org.mybatis.dynamic.sql.update.UpdateDSL;
|
|||
import org.mybatis.dynamic.sql.update.UpdateDSLCompleter;
|
||||
import org.mybatis.dynamic.sql.update.UpdateModel;
|
||||
import org.mybatis.dynamic.sql.util.SqlProviderAdapter;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.ruoyi.wms.mapper.UnitInfoDynamicSqlSupport.*;
|
||||
import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonCountMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonDeleteMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonInsertMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.CommonUpdateMapper;
|
||||
import org.mybatis.dynamic.sql.util.mybatis3.MyBatis3Utils;
|
||||
|
||||
@Mapper
|
||||
public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, CommonInsertMapper<UnitInfo>, CommonUpdateMapper {
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
BasicColumn[] selectList = BasicColumn.columnList(orgCd, unit, unitName, unitConvRate, srcConvUnit, remark1, remark2, remark3, remark4, remark5, updateCount, deleteFlag, createBy, createTime, updateBy, updateTime, remark);
|
||||
BasicColumn[] selectList = BasicColumn.columnList(unitCode, unitName, remark1, remark2, remark3, remark4, remark5, updateCount, deleteFlag, createBy, createTime, updateBy, updateTime, remark);
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
@SelectProvider(type=SqlProviderAdapter.class, method="select")
|
||||
@Results(id="UnitInfoResult", value = {
|
||||
@Result(column="ORG_CD", property="orgCd", jdbcType=JdbcType.VARCHAR, id=true),
|
||||
@Result(column="UNIT", property="unit", jdbcType=JdbcType.VARCHAR, id=true),
|
||||
@Result(column="UNIT_CODE", property="unitCode", jdbcType=JdbcType.VARCHAR, id=true),
|
||||
@Result(column="UNIT_NAME", property="unitName", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="UNIT_CONV_RATE", property="unitConvRate", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="SRC_CONV_UNIT", property="srcConvUnit", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="REMARK_1", property="remark1", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="REMARK_2", property="remark2", jdbcType=JdbcType.VARCHAR),
|
||||
@Result(column="REMARK_3", property="remark3", jdbcType=JdbcType.VARCHAR),
|
||||
|
|
@ -66,21 +70,17 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int deleteByPrimaryKey(String orgCd_, String unit_) {
|
||||
default int deleteByPrimaryKey(String unitCode_) {
|
||||
return delete(c ->
|
||||
c.where(orgCd, isEqualTo(orgCd_))
|
||||
.and(unit, isEqualTo(unit_))
|
||||
c.where(unitCode, isEqualTo(unitCode_))
|
||||
);
|
||||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int insert(UnitInfo row) {
|
||||
return MyBatis3Utils.insert(this::insert, row, unitInfo, c ->
|
||||
c.map(orgCd).toProperty("orgCd")
|
||||
.map(unit).toProperty("unit")
|
||||
c.map(unitCode).toProperty("unitCode")
|
||||
.map(unitName).toProperty("unitName")
|
||||
.map(unitConvRate).toProperty("unitConvRate")
|
||||
.map(srcConvUnit).toProperty("srcConvUnit")
|
||||
.map(remark1).toProperty("remark1")
|
||||
.map(remark2).toProperty("remark2")
|
||||
.map(remark3).toProperty("remark3")
|
||||
|
|
@ -99,11 +99,8 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int insertMultiple(Collection<UnitInfo> records) {
|
||||
return MyBatis3Utils.insertMultiple(this::insertMultiple, records, unitInfo, c ->
|
||||
c.map(orgCd).toProperty("orgCd")
|
||||
.map(unit).toProperty("unit")
|
||||
c.map(unitCode).toProperty("unitCode")
|
||||
.map(unitName).toProperty("unitName")
|
||||
.map(unitConvRate).toProperty("unitConvRate")
|
||||
.map(srcConvUnit).toProperty("srcConvUnit")
|
||||
.map(remark1).toProperty("remark1")
|
||||
.map(remark2).toProperty("remark2")
|
||||
.map(remark3).toProperty("remark3")
|
||||
|
|
@ -122,11 +119,8 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default int insertSelective(UnitInfo row) {
|
||||
return MyBatis3Utils.insert(this::insert, row, unitInfo, c ->
|
||||
c.map(orgCd).toPropertyWhenPresent("orgCd", row::getOrgCd)
|
||||
.map(unit).toPropertyWhenPresent("unit", row::getUnit)
|
||||
c.map(unitCode).toPropertyWhenPresent("unitCode", row::getUnitCode)
|
||||
.map(unitName).toPropertyWhenPresent("unitName", row::getUnitName)
|
||||
.map(unitConvRate).toPropertyWhenPresent("unitConvRate", row::getUnitConvRate)
|
||||
.map(srcConvUnit).toPropertyWhenPresent("srcConvUnit", row::getSrcConvUnit)
|
||||
.map(remark1).toPropertyWhenPresent("remark1", row::getRemark1)
|
||||
.map(remark2).toPropertyWhenPresent("remark2", row::getRemark2)
|
||||
.map(remark3).toPropertyWhenPresent("remark3", row::getRemark3)
|
||||
|
|
@ -158,10 +152,9 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
}
|
||||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
default Optional<UnitInfo> selectByPrimaryKey(String orgCd_, String unit_) {
|
||||
default Optional<UnitInfo> selectByPrimaryKey(String unitCode_) {
|
||||
return selectOne(c ->
|
||||
c.where(orgCd, isEqualTo(orgCd_))
|
||||
.and(unit, isEqualTo(unit_))
|
||||
c.where(unitCode, isEqualTo(unitCode_))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -172,11 +165,8 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
static UpdateDSL<UpdateModel> updateAllColumns(UnitInfo row, UpdateDSL<UpdateModel> dsl) {
|
||||
return dsl.set(orgCd).equalTo(row::getOrgCd)
|
||||
.set(unit).equalTo(row::getUnit)
|
||||
return dsl.set(unitCode).equalTo(row::getUnitCode)
|
||||
.set(unitName).equalTo(row::getUnitName)
|
||||
.set(unitConvRate).equalTo(row::getUnitConvRate)
|
||||
.set(srcConvUnit).equalTo(row::getSrcConvUnit)
|
||||
.set(remark1).equalTo(row::getRemark1)
|
||||
.set(remark2).equalTo(row::getRemark2)
|
||||
.set(remark3).equalTo(row::getRemark3)
|
||||
|
|
@ -193,11 +183,8 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
|
||||
@Generated(value="org.mybatis.generator.api.MyBatisGenerator", comments="Source Table: SF_WMS_M_UNIT_INFO")
|
||||
static UpdateDSL<UpdateModel> updateSelectiveColumns(UnitInfo row, UpdateDSL<UpdateModel> dsl) {
|
||||
return dsl.set(orgCd).equalToWhenPresent(row::getOrgCd)
|
||||
.set(unit).equalToWhenPresent(row::getUnit)
|
||||
return dsl.set(unitCode).equalToWhenPresent(row::getUnitCode)
|
||||
.set(unitName).equalToWhenPresent(row::getUnitName)
|
||||
.set(unitConvRate).equalToWhenPresent(row::getUnitConvRate)
|
||||
.set(srcConvUnit).equalToWhenPresent(row::getSrcConvUnit)
|
||||
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||
.set(remark2).equalToWhenPresent(row::getRemark2)
|
||||
.set(remark3).equalToWhenPresent(row::getRemark3)
|
||||
|
|
@ -216,8 +203,6 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
default int updateByPrimaryKey(UnitInfo row) {
|
||||
return update(c ->
|
||||
c.set(unitName).equalTo(row::getUnitName)
|
||||
.set(unitConvRate).equalTo(row::getUnitConvRate)
|
||||
.set(srcConvUnit).equalTo(row::getSrcConvUnit)
|
||||
.set(remark1).equalTo(row::getRemark1)
|
||||
.set(remark2).equalTo(row::getRemark2)
|
||||
.set(remark3).equalTo(row::getRemark3)
|
||||
|
|
@ -230,8 +215,7 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
.set(updateBy).equalTo(row::getUpdateBy)
|
||||
.set(updateTime).equalTo(row::getUpdateTime)
|
||||
.set(remark).equalTo(row::getRemark)
|
||||
.where(orgCd, isEqualTo(row::getOrgCd))
|
||||
.and(unit, isEqualTo(row::getUnit))
|
||||
.where(unitCode, isEqualTo(row::getUnitCode))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -239,8 +223,6 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
default int updateByPrimaryKeySelective(UnitInfo row) {
|
||||
return update(c ->
|
||||
c.set(unitName).equalToWhenPresent(row::getUnitName)
|
||||
.set(unitConvRate).equalToWhenPresent(row::getUnitConvRate)
|
||||
.set(srcConvUnit).equalToWhenPresent(row::getSrcConvUnit)
|
||||
.set(remark1).equalToWhenPresent(row::getRemark1)
|
||||
.set(remark2).equalToWhenPresent(row::getRemark2)
|
||||
.set(remark3).equalToWhenPresent(row::getRemark3)
|
||||
|
|
@ -253,8 +235,7 @@ public interface UnitInfoMapper extends CommonCountMapper, CommonDeleteMapper, C
|
|||
.set(updateBy).equalToWhenPresent(row::getUpdateBy)
|
||||
.set(updateTime).equalToWhenPresent(row::getUpdateTime)
|
||||
.set(remark).equalToWhenPresent(row::getRemark)
|
||||
.where(orgCd, isEqualTo(row::getOrgCd))
|
||||
.and(unit, isEqualTo(row::getUnit))
|
||||
.where(unitCode, isEqualTo(row::getUnitCode))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -7,17 +7,17 @@ import java.util.List;
|
|||
/**
|
||||
* 单位信息管理Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* created on 2024-02-02
|
||||
* @author ryas
|
||||
* created on 2024-02-05
|
||||
*/
|
||||
public interface IUnitInfoService {
|
||||
/**
|
||||
* 查询单位信息管理
|
||||
*
|
||||
* @param orgCd 单位信息管理主键
|
||||
* @param unitCode 单位信息管理主键
|
||||
* @return 单位信息管理
|
||||
*/
|
||||
UnitInfo selectUnitInfoByOrgCd(String orgCd);
|
||||
UnitInfo selectUnitInfoByUnitCode(String unitCode);
|
||||
|
||||
/**
|
||||
* 查询单位信息管理列表
|
||||
|
|
@ -46,16 +46,16 @@ public interface IUnitInfoService {
|
|||
/**
|
||||
* 批量删除单位信息管理
|
||||
*
|
||||
* @param orgCds 需要删除的单位信息管理主键集合
|
||||
* @param unitCodes 需要删除的单位信息管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteUnitInfoByOrgCds(String[] orgCds);
|
||||
int deleteUnitInfoByUnitCodes(String[] unitCodes);
|
||||
|
||||
/**
|
||||
* 删除单位信息管理信息
|
||||
*
|
||||
* @param orgCd 单位信息管理主键
|
||||
* @param unitCode 单位信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteUnitInfoByOrgCd(String orgCd);
|
||||
int deleteUnitInfoByUnitCode(String unitCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
package com.ruoyi.wms.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.snowflake.SnowFlakeIdGenerator;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.wms.domain.UnitInfo;
|
||||
import com.ruoyi.wms.mapper.UnitInfoDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.UnitInfoMapper;
|
||||
import com.ruoyi.wms.service.IUnitInfoService;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
|
@ -15,8 +21,8 @@ import java.util.Optional;
|
|||
/**
|
||||
* 单位信息管理Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* created on 2024-02-02
|
||||
* @author ryas
|
||||
* created on 2024-02-05
|
||||
*/
|
||||
@Service
|
||||
public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
|
|
@ -26,12 +32,12 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
|||
/**
|
||||
* 查询单位信息管理
|
||||
*
|
||||
* @param orgCd 单位信息管理主键
|
||||
* @param unitCode 单位信息管理主键
|
||||
* @return 单位信息管理
|
||||
*/
|
||||
@Override
|
||||
public UnitInfo selectUnitInfoByOrgCd(String orgCd) {
|
||||
Optional<UnitInfo> result = unitInfoMapper.selectOne(dsl -> dsl.where(UnitInfoDynamicSqlSupport.orgCd, SqlBuilder.isEqualTo(orgCd)));
|
||||
public UnitInfo selectUnitInfoByUnitCode(String unitCode) {
|
||||
Optional<UnitInfo> result = unitInfoMapper.selectOne(dsl -> dsl.where(UnitInfoDynamicSqlSupport.unitCode, SqlBuilder.isEqualTo(unitCode)));
|
||||
return result.orElse(null);
|
||||
}
|
||||
|
||||
|
|
@ -43,25 +49,14 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
|||
*/
|
||||
@Override
|
||||
public List<UnitInfo> selectUnitInfoList(UnitInfo unitInfo) {
|
||||
return unitInfoMapper.select(dsl -> dsl
|
||||
.where(UnitInfoDynamicSqlSupport.orgCd, SqlBuilder.isEqualToWhenPresent(unitInfo.getOrgCd()))
|
||||
.and(UnitInfoDynamicSqlSupport.unit, SqlBuilder.isEqualToWhenPresent(unitInfo.getUnit()))
|
||||
.and(UnitInfoDynamicSqlSupport.unitName, SqlBuilder.isEqualToWhenPresent(unitInfo.getUnitName()))
|
||||
.and(UnitInfoDynamicSqlSupport.unitConvRate, SqlBuilder.isEqualToWhenPresent(unitInfo.getUnitConvRate()))
|
||||
.and(UnitInfoDynamicSqlSupport.srcConvUnit, SqlBuilder.isEqualToWhenPresent(unitInfo.getSrcConvUnit()))
|
||||
.and(UnitInfoDynamicSqlSupport.remark1, SqlBuilder.isEqualToWhenPresent(unitInfo.getRemark1()))
|
||||
.and(UnitInfoDynamicSqlSupport.remark2, SqlBuilder.isEqualToWhenPresent(unitInfo.getRemark2()))
|
||||
.and(UnitInfoDynamicSqlSupport.remark3, SqlBuilder.isEqualToWhenPresent(unitInfo.getRemark3()))
|
||||
.and(UnitInfoDynamicSqlSupport.remark4, SqlBuilder.isEqualToWhenPresent(unitInfo.getRemark4()))
|
||||
.and(UnitInfoDynamicSqlSupport.remark5, SqlBuilder.isEqualToWhenPresent(unitInfo.getRemark5()))
|
||||
.and(UnitInfoDynamicSqlSupport.updateCount, SqlBuilder.isEqualToWhenPresent(unitInfo.getUpdateCount()))
|
||||
.and(UnitInfoDynamicSqlSupport.deleteFlag, SqlBuilder.isEqualToWhenPresent(unitInfo.getDeleteFlag()))
|
||||
.and(UnitInfoDynamicSqlSupport.createBy, SqlBuilder.isEqualToWhenPresent(unitInfo.getCreateBy()))
|
||||
.and(UnitInfoDynamicSqlSupport.createTime, SqlBuilder.isEqualToWhenPresent(unitInfo.getCreateTime()))
|
||||
.and(UnitInfoDynamicSqlSupport.updateBy, SqlBuilder.isEqualToWhenPresent(unitInfo.getUpdateBy()))
|
||||
.and(UnitInfoDynamicSqlSupport.updateTime, SqlBuilder.isEqualToWhenPresent(unitInfo.getUpdateTime()))
|
||||
.and(UnitInfoDynamicSqlSupport.remark, SqlBuilder.isEqualToWhenPresent(unitInfo.getRemark()))
|
||||
);
|
||||
SelectStatementProvider provider = SqlBuilder.select(UnitInfoMapper.selectList)
|
||||
.from(UnitInfoDynamicSqlSupport.unitInfo)
|
||||
.where(UnitInfoDynamicSqlSupport.deleteFlag, SqlBuilder.isEqualTo(ExtBaseEntity.NOT_DELETE))
|
||||
.and(UnitInfoDynamicSqlSupport.unitCode, SqlBuilder.isEqualToWhenPresent(unitInfo.getUnitCode()))
|
||||
.and(UnitInfoDynamicSqlSupport.unitName, SqlBuilder.isLikeWhenPresent(unitInfo.getUnitName()))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return unitInfoMapper.selectMany(provider);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -72,6 +67,9 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
|||
*/
|
||||
@Override
|
||||
public int insertUnitInfo(UnitInfo unitInfo) {
|
||||
if (StringUtils.isBlank(unitInfo.getUnitCode())) {
|
||||
unitInfo.setUnitCode(SnowFlakeIdGenerator.nextId());
|
||||
}
|
||||
unitInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return unitInfoMapper.insertSelective(unitInfo);
|
||||
}
|
||||
|
|
@ -91,23 +89,32 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
|||
/**
|
||||
* 批量删除单位信息管理
|
||||
*
|
||||
* @param orgCds 需要删除的单位信息管理主键
|
||||
* @param unitCodes 需要删除的单位信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUnitInfoByOrgCds(String[] orgCds) {
|
||||
|
||||
return unitInfoMapper.delete(dsl -> dsl.where(UnitInfoDynamicSqlSupport.orgCd, SqlBuilder.isIn(orgCds)));
|
||||
public int deleteUnitInfoByUnitCodes(String[] unitCodes) {
|
||||
UpdateStatementProvider provider = SqlBuilder.update(UnitInfoDynamicSqlSupport.unitInfo)
|
||||
.set(UnitInfoDynamicSqlSupport.deleteFlag).equalTo(ExtBaseEntity.DELETED)
|
||||
.set(UnitInfoDynamicSqlSupport.updateTime).equalTo(DateUtils.getNowDate())
|
||||
.where(UnitInfoDynamicSqlSupport.unitCode, SqlBuilder.isIn(unitCodes))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return unitInfoMapper.update(provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除单位信息管理信息
|
||||
*
|
||||
* @param orgCd 单位信息管理主键
|
||||
* @param unitCode 单位信息管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUnitInfoByOrgCd(String orgCd) {
|
||||
return unitInfoMapper.delete(dsl -> dsl.where(UnitInfoDynamicSqlSupport.orgCd, SqlBuilder.isEqualTo(orgCd)));
|
||||
public int deleteUnitInfoByUnitCode(String unitCode) {
|
||||
UnitInfo record = new UnitInfo();
|
||||
record.setUnitCode(unitCode);
|
||||
record.setDeleteFlag(ExtBaseEntity.DELETED);
|
||||
record.setUpdateTime(DateUtils.getNowDate());
|
||||
return unitInfoMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询单位信息管理列表
|
||||
export function listUnitInfo(query) {
|
||||
return request({
|
||||
url: '/wms/UnitInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询单位信息管理详细
|
||||
export function getUnitInfo(unitCode) {
|
||||
return request({
|
||||
url: '/wms/UnitInfo/' + unitCode,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增单位信息管理
|
||||
export function addUnitInfo(data) {
|
||||
return request({
|
||||
url: '/wms/UnitInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改单位信息管理
|
||||
export function updateUnitInfo(data) {
|
||||
return request({
|
||||
url: '/wms/UnitInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除单位信息管理
|
||||
export function delUnitInfo(unitCode) {
|
||||
return request({
|
||||
url: '/wms/UnitInfo/' + unitCode,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -7,8 +7,13 @@
|
|||
此后台管理系统基于Ruoyi开源基盘(v{{ version }})
|
||||
</p>
|
||||
<p>
|
||||
已从Ruoyi原本的Java8,SpringBoot2.7.x,SpringCloud2021.x升级到Java21,SpringBoot3.1.x,SpringCloud2022.X
|
||||
已从原本的Ruoyi全面升级:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Java8 -> Java21</li>
|
||||
<li>SpringBoot 2.7 -> SpringBoot 3.1</li>
|
||||
<li>SpringCloud 2020.x -> SpringCloud 2023.0.5</li>
|
||||
</ul>
|
||||
</el-col>
|
||||
|
||||
<el-col :sm="24" :lg="12" style="padding-left: 50px">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,256 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="单位代码" prop="unitCode">
|
||||
<el-input
|
||||
v-model="queryParams.unitCode"
|
||||
placeholder="请输入单位代码"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位名称" prop="unitName">
|
||||
<el-input
|
||||
v-model="queryParams.unitName"
|
||||
placeholder="请输入单位名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Plus"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['wms:UnitInfo:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="Edit"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['wms:UnitInfo:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['wms:UnitInfo:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Download"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['wms:UnitInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="UnitInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="单位代码" align="center" prop="unitCode" />
|
||||
<el-table-column label="单位名称" align="center" prop="unitName" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['wms:UnitInfo:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['wms:UnitInfo:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改单位信息管理对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="UnitInfoRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="单位名称" prop="unitName">
|
||||
<el-input v-model="form.unitName" placeholder="请输入单位名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="UnitInfo">
|
||||
import { listUnitInfo, getUnitInfo, delUnitInfo, addUnitInfo, updateUnitInfo } from "@/api/wms/UnitInfo";
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const UnitInfoList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(false);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
unitCode: null,
|
||||
unitName: null,
|
||||
},
|
||||
rules: {
|
||||
unitName: [
|
||||
{ required: true, message: "单位名称不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询单位信息管理列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listUnitInfo(queryParams.value).then(response => {
|
||||
UnitInfoList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
unitCode: null,
|
||||
unitName: null,
|
||||
remark1: null,
|
||||
remark2: null,
|
||||
remark3: null,
|
||||
remark4: null,
|
||||
remark5: null,
|
||||
updateCount: null,
|
||||
deleteFlag: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null
|
||||
};
|
||||
proxy.resetForm("UnitInfoRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.unitCode);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加单位信息管理";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _unitCode = row.unitCode || ids.value
|
||||
getUnitInfo(_unitCode).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改单位信息管理";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["UnitInfoRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.unitCode != null) {
|
||||
updateUnitInfo(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addUnitInfo(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _unitCodes = row.unitCode || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除单位信息管理编号为"' + _unitCodes + '"的数据项?').then(function() {
|
||||
return delUnitInfo(_unitCodes);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('wms/UnitInfo/export', {
|
||||
...queryParams.value
|
||||
}, `UnitInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
//页面打开时查询
|
||||
//getList();
|
||||
</script>
|
||||
|
|
@ -1,28 +1,28 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9100
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: ruoyi-monitor
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 指定分组
|
||||
# group: DEFAULT_GROUP #默认微服务组
|
||||
group: GROUP_ALL_IN_1 #多模块集成在system模块里的模式
|
||||
# Tomcat
|
||||
server:
|
||||
port: 9100
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
# 应用名称
|
||||
name: ruoyi-monitor
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 指定分组
|
||||
group: DEFAULT_GROUP #默认微服务组
|
||||
# group: GROUP_ALL_IN_1 #多模块集成在system模块里的模式
|
||||
|
|
|
|||
Loading…
Reference in New Issue