add:仓库、库区
This commit is contained in:
@@ -4,15 +4,14 @@ package org.nl.wms.storage_manage.database.controller;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.database.dto.StorQuery;
|
||||
import org.nl.wms.storage_manage.database.service.IStIvtBsrealstorattrService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -46,4 +45,32 @@ public class StIvtBsrealstorattrController {
|
||||
return new ResponseEntity<>(iStIvtBsrealstorattrService.getStor(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增仓库")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StIvtBsrealstorattr whereJson) {
|
||||
iStIvtBsrealstorattrService.create(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改仓库")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StIvtBsrealstorattr dao) {
|
||||
iStIvtBsrealstorattrService.update(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除仓库")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
iStIvtBsrealstorattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改仓库管理状态")
|
||||
public ResponseEntity<Object> changeActive(@Validated @RequestBody StIvtBsrealstorattr dao) {
|
||||
iStIvtBsrealstorattrService.changeActive(dao);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package org.nl.wms.storage_manage.database.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtSectattr;
|
||||
import org.nl.wms.storage_manage.database.dto.SectQuery;
|
||||
import org.nl.wms.storage_manage.database.service.IStIvtSectattrService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -16,4 +25,44 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/api/stIvtSectattr")
|
||||
public class StIvtSectattrController {
|
||||
|
||||
/**
|
||||
* 库区服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtSectattrService iStIvtSectattrService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询库区")
|
||||
public ResponseEntity<Object> query(SectQuery query, PageQuery page){
|
||||
return new ResponseEntity<>(iStIvtSectattrService.pageQuery(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增库区")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StIvtSectattr dao) {
|
||||
iStIvtSectattrService.create(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改库区")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StIvtSectattr dao) {
|
||||
iStIvtSectattrService.update(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除库区")
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
iStIvtSectattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改库区管理状态")
|
||||
public ResponseEntity<Object> changeActive(@Validated @RequestBody StIvtSectattr dao) {
|
||||
iStIvtSectattrService.changeActive(dao);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package org.nl.wms.storage_manage.database.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtBsrealstorattr;
|
||||
|
||||
/**
|
||||
* 仓库查询条件
|
||||
* @author LXY
|
||||
* @Date 2023/11/10 14:49
|
||||
*/
|
||||
@Data
|
||||
public class SectQuery extends BaseQuery<StIvtBsrealstorattr> {
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
|
||||
/**
|
||||
* 仓库id
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("stor_code", QParam.builder().k(new String[]{"stor_code"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,13 @@
|
||||
package org.nl.wms.storage_manage.database.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtSectattr;
|
||||
import org.nl.wms.storage_manage.database.dto.SectQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +19,11 @@ import org.nl.wms.storage_manage.database.dao.StIvtSectattr;
|
||||
*/
|
||||
public interface StIvtSectattrMapper extends BaseMapper<StIvtSectattr> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query:查询条件
|
||||
* @param pageQuery 分页
|
||||
* @return List<Map>
|
||||
*/
|
||||
List<Map> getPageQuery( @Param("query") SectQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
is_delete = '0'
|
||||
|
||||
<if test="query.stor_code != null and query.stor_code != ''">
|
||||
and stor_code LIKE '%${query.stor_code}%'
|
||||
and (stor_code LIKE '%${query.stor_code}%'
|
||||
or stor_name LIKE '%${query.stor_code}%')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
@@ -2,4 +2,27 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.storage_manage.database.mapper.StIvtSectattrMapper">
|
||||
|
||||
<select id="getPageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
sect.*,
|
||||
attr.stor_name
|
||||
FROM
|
||||
st_ivt_sectattr sect
|
||||
LEFT JOIN st_ivt_bsrealstorattr attr ON sect.stor_id = attr.stor_id
|
||||
<where>
|
||||
sect.is_delete = '0'
|
||||
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
and sect.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
|
||||
<if test="query.sect_code != null and query.sect_code != ''">
|
||||
and (sect.sect_code LIKE '%${query.sect_code}%'
|
||||
or sect.sect_name LIKE '%${query.sect_code}%')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -40,4 +40,29 @@ public interface IStIvtBsrealstorattrService extends IService<StIvtBsrealstoratt
|
||||
* @return JSONObject
|
||||
*/
|
||||
List<JSONObject> getStor(Map whereJson);
|
||||
|
||||
/**
|
||||
* 新增仓库
|
||||
* @param dao: 仓库实体类
|
||||
*
|
||||
*/
|
||||
void create(StIvtBsrealstorattr dao);
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
* @param dao:仓库实体类
|
||||
*/
|
||||
void update(StIvtBsrealstorattr dao);
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
* @param ids:标识
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param dao: 仓库实体类
|
||||
*/
|
||||
void changeActive(StIvtBsrealstorattr dao);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package org.nl.wms.storage_manage.database.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtSectattr;
|
||||
import org.nl.wms.storage_manage.database.dto.SectQuery;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +15,35 @@ import org.nl.wms.storage_manage.database.dao.StIvtSectattr;
|
||||
*/
|
||||
public interface IStIvtSectattrService extends IService<StIvtSectattr> {
|
||||
|
||||
/**
|
||||
* 查询库区
|
||||
* @param query 查询条件
|
||||
* @param page 分页查询
|
||||
* @return Object
|
||||
*/
|
||||
Object pageQuery(SectQuery query, PageQuery page);
|
||||
|
||||
/**
|
||||
* 新增库区
|
||||
* @param dao:库区实体
|
||||
*/
|
||||
void create(StIvtSectattr dao);
|
||||
|
||||
/**
|
||||
* 修改库区
|
||||
* @param dao: 库区实体
|
||||
*/
|
||||
void update(StIvtSectattr dao);
|
||||
|
||||
/**
|
||||
* 删除库区
|
||||
* @param ids
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* @param dao
|
||||
*/
|
||||
void changeActive(StIvtSectattr dao);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,26 @@
|
||||
package org.nl.wms.storage_manage.database.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.database.dto.StorQuery;
|
||||
import org.nl.wms.storage_manage.database.mapper.StIvtBsrealstorattrMapper;
|
||||
import org.nl.wms.storage_manage.database.service.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -28,6 +36,7 @@ import java.util.Map;
|
||||
@Service
|
||||
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstorattrMapper, StIvtBsrealstorattr> implements IStIvtBsrealstorattrService {
|
||||
|
||||
|
||||
@Override
|
||||
public StIvtBsrealstorattr getById(Long storId) {
|
||||
if (ObjectUtil.isEmpty(this.baseMapper.selectById(storId))) {
|
||||
@@ -52,4 +61,80 @@ public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstora
|
||||
public List<JSONObject> getStor(Map whereJson) {
|
||||
return this.baseMapper.getStor(whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(StIvtBsrealstorattr dao) {
|
||||
StIvtBsrealstorattr isDao = this.getOne(
|
||||
new QueryWrapper<StIvtBsrealstorattr>().lambda()
|
||||
.eq(StIvtBsrealstorattr::getStor_code, dao.getStor_code())
|
||||
.eq(StIvtBsrealstorattr::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(isDao)) {
|
||||
throw new BadRequestException("已存在相同编码的仓库【"+dao.getStor_code()+"】");
|
||||
}
|
||||
|
||||
dao.setStor_id(IdUtil.getStringId());
|
||||
dao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setCreate_time(DateUtil.now());
|
||||
|
||||
dao.setSyscompanyid(IOSEnum.IS_NOTANDYES.code("否"));
|
||||
dao.setSysdeptid(IOSEnum.IS_NOTANDYES.code("否"));
|
||||
dao.setSysownerid(IOSEnum.IS_NOTANDYES.code("否"));
|
||||
|
||||
this.save(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(StIvtBsrealstorattr dao) {
|
||||
StIvtBsrealstorattr isDao = this.getById(dao.getStor_id());
|
||||
|
||||
if (isDao == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
|
||||
this.updateById(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
for (Long storId : ids) {
|
||||
this.update(
|
||||
new UpdateWrapper<StIvtBsrealstorattr>().lambda()
|
||||
.set(StIvtBsrealstorattr::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"))
|
||||
.set(StIvtBsrealstorattr::getUpdate_optid, SecurityUtils.getCurrentUserId())
|
||||
.set(StIvtBsrealstorattr::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||
.set(StIvtBsrealstorattr::getUpdate_time, DateUtil.now())
|
||||
.eq(StIvtBsrealstorattr::getStor_id, storId)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeActive(StIvtBsrealstorattr dao) {
|
||||
|
||||
String isUsed = IOSEnum.IS_NOTANDYES.code("是");
|
||||
if (StrUtil.equals(IOSEnum.IS_NOTANDYES.code("是"), dao.getIs_used())) {
|
||||
isUsed = IOSEnum.IS_NOTANDYES.code("否");
|
||||
}
|
||||
|
||||
dao.setIs_used(isUsed);
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
this.updateById(dao);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,31 @@
|
||||
package org.nl.wms.storage_manage.database.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.storage_manage.database.dao.StIvtSectattr;
|
||||
import org.nl.wms.storage_manage.database.dto.SectQuery;
|
||||
import org.nl.wms.storage_manage.database.mapper.StIvtSectattrMapper;
|
||||
import org.nl.wms.storage_manage.database.service.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.storage_manage.database.service.IStIvtSectattrService;
|
||||
import org.nl.wms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -17,4 +38,100 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements IStIvtSectattrService {
|
||||
|
||||
/**
|
||||
* 仓库服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtBsrealstorattrService iStIvtBsrealstorattrService;
|
||||
|
||||
@Override
|
||||
public Object pageQuery(SectQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
page.setOrderBy("create_time DESC");
|
||||
List<Map> mst_detail = this.baseMapper.getPageQuery(query, pageQuery);
|
||||
|
||||
TableDataInfo<Map> build = TableDataInfo.build(mst_detail);
|
||||
build.setTotalElements(page.getTotal());
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(StIvtSectattr dao) {
|
||||
|
||||
StIvtSectattr isDao = this.getOne(
|
||||
new QueryWrapper<StIvtSectattr>().lambda()
|
||||
.eq(StIvtSectattr::getSect_code, dao.getSect_code())
|
||||
.eq(StIvtSectattr::getIs_delete, IOSEnum.IS_NOTANDYES.code("否"))
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(isDao)) {
|
||||
throw new BadRequestException("已存在相同编码的仓库【"+dao.getSect_code()+"】");
|
||||
}
|
||||
|
||||
dao.setSect_id(IdUtil.getStringId());
|
||||
dao.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setCreate_time(DateUtil.now());
|
||||
|
||||
StIvtBsrealstorattr attrDao = iStIvtBsrealstorattrService.getById(dao.getStor_id());
|
||||
dao.setStor_type(attrDao.getStor_type_scode());
|
||||
this.save(dao);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(StIvtSectattr dao) {
|
||||
|
||||
StIvtSectattr isDao = this.getById(dao.getSect_id());
|
||||
|
||||
if (isDao == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
dao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
|
||||
StIvtBsrealstorattr attrDao = iStIvtBsrealstorattrService.getById(dao.getStor_id());
|
||||
dao.setStor_type(attrDao.getStor_type_scode());
|
||||
|
||||
this.updateById(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
for (Long sectId : ids) {
|
||||
this.update(
|
||||
new UpdateWrapper<StIvtSectattr>().lambda()
|
||||
.set(StIvtSectattr::getIs_delete, IOSEnum.IS_NOTANDYES.code("是"))
|
||||
.set(StIvtSectattr::getUpdate_optid, SecurityUtils.getCurrentUserId())
|
||||
.set(StIvtSectattr::getUpdate_optname, SecurityUtils.getCurrentNickName())
|
||||
.set(StIvtSectattr::getUpdate_time, DateUtil.now())
|
||||
.eq(StIvtSectattr::getSect_id, sectId)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeActive(StIvtSectattr dao) {
|
||||
|
||||
String isUsed = IOSEnum.IS_NOTANDYES.code("是");
|
||||
if (StrUtil.equals(IOSEnum.IS_NOTANDYES.code("是"), dao.getIs_used())) {
|
||||
isUsed = IOSEnum.IS_NOTANDYES.code("否");
|
||||
}
|
||||
|
||||
dao.setIs_used(isUsed);
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
this.updateById(dao);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user