add:仓库基础信息
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
package org.nl.wms.base_manage.bsrealstorattr.controller;
|
||||
|
||||
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dto.StorQuery;
|
||||
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.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/stIvtBsrealstorattr")
|
||||
public class StIvtBsrealstorattrController {
|
||||
|
||||
/**
|
||||
* 仓库服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtBsrealstorattrService iStIvtBsrealstorattrService;
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(StorQuery query, PageQuery page){
|
||||
return new ResponseEntity<>(iStIvtBsrealstorattrService.pageQuery(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getStor")
|
||||
public ResponseEntity<Object> queryStor(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iStIvtBsrealstorattrService.getStor(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StIvtBsrealstorattr whereJson) {
|
||||
iStIvtBsrealstorattrService.create(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StIvtBsrealstorattr dao) {
|
||||
iStIvtBsrealstorattrService.update(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
iStIvtBsrealstorattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
public ResponseEntity<Object> changeActive(@Validated @RequestBody StIvtBsrealstorattr dao) {
|
||||
iStIvtBsrealstorattrService.changeActive(dao);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package org.nl.wms.base_manage.bsrealstorattr.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dto.StorQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
public interface IStIvtBsrealstorattrService extends IService<StIvtBsrealstorattr> {
|
||||
|
||||
/**
|
||||
* 根据仓库id搜索
|
||||
* @param storId /
|
||||
* @return StIvtBsrealstorattr 实体类对象
|
||||
*/
|
||||
StIvtBsrealstorattr getById(Long storId);
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query 查询条件
|
||||
* @param page 分页查询
|
||||
* @return Object
|
||||
*/
|
||||
Object pageQuery(StorQuery query, PageQuery page);
|
||||
|
||||
/**
|
||||
* 获取仓库下拉框
|
||||
* @param whereJson : 查询条件
|
||||
* @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);
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package org.nl.wms.base_manage.bsrealstorattr.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("st_ivt_bsrealstorattr")
|
||||
public class StIvtBsrealstorattr implements Serializable {
|
||||
|
||||
private static final Long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
@TableId
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 仓库简称
|
||||
*/
|
||||
private String simple_name;
|
||||
|
||||
/**
|
||||
* 仓库容量
|
||||
*/
|
||||
private BigDecimal stor_capacity;
|
||||
|
||||
/**
|
||||
* 总面积
|
||||
*/
|
||||
private BigDecimal total_area;
|
||||
|
||||
/**
|
||||
* 仓库性质
|
||||
*/
|
||||
private String stor_type_scode;
|
||||
|
||||
/**
|
||||
* 是否允许红冲
|
||||
*/
|
||||
private Boolean is_reversed;
|
||||
|
||||
/**
|
||||
* 是否移出业务自动确认
|
||||
*/
|
||||
private Boolean is_mvout_auto_cfm;
|
||||
|
||||
/**
|
||||
* 是否移入业务自动确认
|
||||
*/
|
||||
private Boolean is_mvin_auto_cfm;
|
||||
|
||||
/**
|
||||
* 地区
|
||||
*/
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 仓库地址
|
||||
*/
|
||||
private String storea_ddress;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String principal;
|
||||
|
||||
/**
|
||||
* 办公电话
|
||||
*/
|
||||
private String office_phone;
|
||||
|
||||
/**
|
||||
* 负责人手机
|
||||
*/
|
||||
private String mobile_no;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private BigDecimal order_index;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String whstate_scode;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean is_used;
|
||||
|
||||
/**
|
||||
* 物料基本分类
|
||||
*/
|
||||
private String base_class_id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 拥有者ID
|
||||
*/
|
||||
private String sysownerid;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private String sysdeptid;
|
||||
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
private String syscompanyid;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String depart_name;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String company_name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.nl.wms.base_manage.bsrealstorattr.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dto.StorQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
public interface StIvtBsrealstorattrMapper extends BaseMapper<StIvtBsrealstorattr> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query:查询条件
|
||||
* @param pageQuery 分页
|
||||
* @return List<Map>
|
||||
*/
|
||||
List<Map> getPageQuery(@Param("query") StorQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 获取仓库下拉框
|
||||
* @param whereJson:查询条件
|
||||
* @return List<JSONObject>
|
||||
*/
|
||||
List<JSONObject> getStor(Map whereJson);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.base_manage.bsrealstorattr.service.dao.mapper.StIvtBsrealstorattrMapper">
|
||||
|
||||
<select id="getPageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
st_ivt_bsrealstorattr
|
||||
<where>
|
||||
<if test="query.stor_code != null and query.stor_code != ''">
|
||||
and (stor_code LIKE '%${query.stor_code}%'
|
||||
or stor_name LIKE '%${query.stor_code}%')
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getStor" resultType="com.alibaba.fastjson.JSONObject">
|
||||
SELECT
|
||||
CONVERT(stor_id , CHAR ) AS stor_id,
|
||||
stor_name
|
||||
FROM
|
||||
st_ivt_bsrealstorattr
|
||||
<where>
|
||||
is_used = '1'
|
||||
|
||||
<if test="is_materialstore != null and is_materialstore != ''">
|
||||
and is_materialstore = #{is_materialstore}
|
||||
</if>
|
||||
|
||||
<if test="is_virtualstore != null and is_virtualstore != ''">
|
||||
and is_virtualstore = #{is_virtualstore}
|
||||
</if>
|
||||
|
||||
<if test="is_semi_finished != null and is_semi_finished != ''">
|
||||
and is_semi_finished = #{is_semi_finished}
|
||||
</if>
|
||||
|
||||
<if test="is_productstore != null and is_productstore != ''">
|
||||
and is_productstore = #{is_productstore}
|
||||
</if>
|
||||
|
||||
<if test="is_attachment != null and is_attachment != ''">
|
||||
and is_attachment = #{is_attachment}
|
||||
</if>
|
||||
|
||||
<if test="is_reversed != null and is_reversed != ''">
|
||||
and is_reversed = #{is_reversed}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.nl.wms.base_manage.bsrealstorattr.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.entity.BaseQuery;
|
||||
import org.nl.common.domain.entity.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dao.StIvtBsrealstorattr;
|
||||
|
||||
/**
|
||||
* 仓库查询条件
|
||||
* @author LXY
|
||||
* @Date 2023/11/10 14:49
|
||||
*/
|
||||
@Data
|
||||
public class StorQuery extends BaseQuery<StIvtBsrealstorattr> {
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("stor_code", QParam.builder().k(new String[]{"stor_code"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package org.nl.wms.base_manage.bsrealstorattr.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dao.mapper.StIvtBsrealstorattrMapper;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dto.StorQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 实物库属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@Service
|
||||
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstorattrMapper, StIvtBsrealstorattr> implements IStIvtBsrealstorattrService {
|
||||
|
||||
|
||||
@Override
|
||||
public StIvtBsrealstorattr getById(Long storId) {
|
||||
if (ObjectUtil.isEmpty(this.baseMapper.selectById(storId))) {
|
||||
throw new BadRequestException("仓库不存在,请检查!");
|
||||
}
|
||||
|
||||
return this.baseMapper.selectById(storId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object pageQuery(StorQuery 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
|
||||
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())
|
||||
);
|
||||
|
||||
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_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setCreate_time(DateUtil.now());
|
||||
|
||||
dao.setSyscompanyid("0");
|
||||
dao.setSysdeptid("0");
|
||||
dao.setSysownerid("0");
|
||||
|
||||
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_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
|
||||
this.updateById(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
for (Long storId : ids) {
|
||||
this.removeById(storId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeActive(StIvtBsrealstorattr dao) {
|
||||
dao.setIs_used(dao.getIs_used());
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
this.updateById(dao);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package org.nl.wms.base_manage.sect.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.base_manage.sect.service.IStIvtSectattrService;
|
||||
import org.nl.wms.base_manage.sect.service.dao.StIvtSectattr;
|
||||
import org.nl.wms.base_manage.sect.service.dto.SectQuery;
|
||||
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.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/stIvtSectattr")
|
||||
public class StIvtSectattrController {
|
||||
|
||||
/**
|
||||
* 库区服务
|
||||
*/
|
||||
@Autowired
|
||||
private IStIvtSectattrService iStIvtSectattrService;
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(SectQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(iStIvtSectattrService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StIvtSectattr dao) {
|
||||
iStIvtSectattrService.create(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StIvtSectattr dao) {
|
||||
iStIvtSectattrService.update(dao);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
iStIvtSectattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
public ResponseEntity<Object> changeActive(@Validated @RequestBody StIvtSectattr dao) {
|
||||
iStIvtSectattrService.changeActive(dao);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@GetMapping("/getSect")
|
||||
//("查询库区下拉框")
|
||||
public ResponseEntity<Object> querySect() {
|
||||
List<Map> list = iStIvtSectattrService.getSect(new JSONObject());
|
||||
return new ResponseEntity<>(TableDataInfo.build(list), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.nl.wms.base_manage.sect.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.base_manage.sect.service.dao.StIvtSectattr;
|
||||
import org.nl.wms.base_manage.sect.service.dto.SectQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
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);
|
||||
|
||||
/**
|
||||
* 查询库区下拉选
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
List<Map> getSect(JSONObject json);
|
||||
}
|
||||
@@ -0,0 +1,185 @@
|
||||
package org.nl.wms.base_manage.sect.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("st_ivt_sectattr")
|
||||
public class StIvtSectattr implements Serializable {
|
||||
|
||||
private static final Long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
@TableId
|
||||
private String sect_id;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String sect_name;
|
||||
|
||||
/**
|
||||
* 库区简称
|
||||
*/
|
||||
private String simple_name;
|
||||
|
||||
/**
|
||||
* 库区类型
|
||||
*/
|
||||
private String sect_type_attr;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库类型
|
||||
*/
|
||||
private String stor_type;
|
||||
|
||||
/**
|
||||
* 容量
|
||||
*/
|
||||
private BigDecimal capacity;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 深度
|
||||
*/
|
||||
private BigDecimal zdepth;
|
||||
|
||||
/**
|
||||
* 起始X坐标
|
||||
*/
|
||||
private BigDecimal xqty;
|
||||
|
||||
/**
|
||||
* 起始Y坐标
|
||||
*/
|
||||
private BigDecimal yqty;
|
||||
|
||||
/**
|
||||
* 起始Z坐标
|
||||
*/
|
||||
private BigDecimal zqty;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String sect_manager_name;
|
||||
|
||||
/**
|
||||
* 负责人电话
|
||||
*/
|
||||
private String mobile_no;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_id;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_name;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 背景色
|
||||
*/
|
||||
private String back_ground_color;
|
||||
|
||||
/**
|
||||
* 前景色
|
||||
*/
|
||||
private String front_ground_color;
|
||||
|
||||
/**
|
||||
* 背景图片
|
||||
*/
|
||||
private String back_ground_pic;
|
||||
|
||||
/**
|
||||
* 字体显示方向
|
||||
*/
|
||||
private String font_direction_scode;
|
||||
|
||||
/**
|
||||
* 所在楼层
|
||||
*/
|
||||
private BigDecimal floor_no;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.base_manage.sect.service.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.wms.base_manage.sect.service.dao.StIvtSectattr;
|
||||
import org.nl.wms.base_manage.sect.service.dto.SectQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
public interface StIvtSectattrMapper extends BaseMapper<StIvtSectattr> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param query:查询条件
|
||||
* @param pageQuery 分页
|
||||
* @return List<Map>
|
||||
*/
|
||||
List<Map> getPageQuery(@Param("query") SectQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
|
||||
List<Map<String, String>> getSectByStorQuery(Map<String,Object> query);
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.base_manage.sect.service.dao.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.search != null and query.search != ''">
|
||||
and (sect.sect_code LIKE '%${query.search}%'
|
||||
or sect.sect_name LIKE '%${query.search}%')
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="getSectByStorQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
sect.sect_name,
|
||||
sect.sect_id,
|
||||
sect.sect_code,
|
||||
stor.stor_name,
|
||||
stor.stor_id,
|
||||
stor.stor_code
|
||||
FROM
|
||||
st_ivt_sectattr sect
|
||||
LEFT JOIN st_ivt_bsrealstorattr stor ON sect.stor_id = stor.stor_id
|
||||
WHERE
|
||||
stor.is_used = '1'
|
||||
<if test="is_virtualstore != null and is_virtualstore != ''">
|
||||
and stor.is_virtualstore = #{is_virtualstore}
|
||||
</if>
|
||||
<if test="is_semi_finished != null and is_semi_finished != ''">
|
||||
and stor.is_semi_finished = #{is_semi_finished}
|
||||
</if>
|
||||
<if test="is_productstore != null and is_productstore != ''">
|
||||
and stor.is_productstore = #{is_productstore}
|
||||
</if>
|
||||
<if test="is_attachment != null and is_attachment != ''">
|
||||
and stor.is_attachment = #{is_attachment}
|
||||
</if>
|
||||
<if test="is_reversed != null and is_reversed != ''">
|
||||
and stor.is_reversed = #{is_reversed}
|
||||
</if>
|
||||
<if test="stor_id != null and stor_id != ''">
|
||||
and stor.stor_id = #{stor_id}
|
||||
</if>
|
||||
<if test="stor_id != null and stor_id != ''">
|
||||
and stor.stor_id = #{stor_id}
|
||||
</if>
|
||||
<if test="stor_id != null and stor_id != ''">
|
||||
and stor.stor_id = #{stor_id}
|
||||
</if>
|
||||
<if test="sect_type_attr != null and stor_id != ''">
|
||||
and st_ivt_sectattr.sect_type_attr = #{sect_type_attr}
|
||||
</if>
|
||||
<if test="stor_type != null and stor_type != ''">
|
||||
and stor.stor_type = #{stor_type}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.nl.wms.base_manage.sect.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.entity.BaseQuery;
|
||||
import org.nl.common.domain.entity.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.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;
|
||||
|
||||
private String search;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("stor_code", QParam.builder().k(new String[]{"stor_code"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
package org.nl.wms.base_manage.sect.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.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.IStIvtBsrealstorattrService;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.dao.StIvtBsrealstorattr;
|
||||
import org.nl.wms.base_manage.sect.service.IStIvtSectattrService;
|
||||
import org.nl.wms.base_manage.sect.service.dao.StIvtSectattr;
|
||||
import org.nl.wms.base_manage.sect.service.dao.mapper.StIvtSectattrMapper;
|
||||
import org.nl.wms.base_manage.sect.service.dto.SectQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 库区属性表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @since 2024-01-16
|
||||
*/
|
||||
@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, "0")
|
||||
);
|
||||
|
||||
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_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_name(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_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_name(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, "1")
|
||||
.set(StIvtSectattr::getUpdate_id, SecurityUtils.getCurrentUserId())
|
||||
.set(StIvtSectattr::getUpdate_name, 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 = "1";
|
||||
if (StrUtil.equals("1", dao.getIs_used())) {
|
||||
isUsed = "0";
|
||||
}
|
||||
|
||||
dao.setIs_used(isUsed);
|
||||
dao.setUpdate_time(DateUtil.now());
|
||||
dao.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
dao.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
this.updateById(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map> getSect(JSONObject json) {
|
||||
List<Map<String, String>> sects = this.baseMapper.getSectByStorQuery(json);
|
||||
Map<String, List<Map<String, String>>> groupBy_stor_id = sects.stream().collect(Collectors.groupingBy(a -> (String)((Map)a).get("stor_id")));
|
||||
List stor_ja = new ArrayList<>();
|
||||
for (Map.Entry<String, List<Map<String, String>>> entry : groupBy_stor_id.entrySet()) {
|
||||
Map stor_cas = new HashMap<>();
|
||||
List<Map<String, String>> sectList = entry.getValue();
|
||||
stor_cas.put("value", entry.getKey());
|
||||
stor_cas.put("label", sectList.get(0).get("stor_name"));
|
||||
List sect_ja = new ArrayList<>();
|
||||
for (Map<String, String> map : sectList) {
|
||||
Map sect_cas = new HashMap<>();
|
||||
sect_cas.put("value", String.valueOf(map.get("sect_id")));
|
||||
sect_cas.put("label", map.get("sect_name"));
|
||||
sect_ja.add(sect_cas);
|
||||
}
|
||||
stor_cas.put("children", sect_ja);
|
||||
stor_ja.add(stor_cas);
|
||||
}
|
||||
return stor_ja;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,64 @@
|
||||
package org.nl.wms.stor_manage.struct.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位属性表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/stIvtStructattr")
|
||||
public class StIvtStructattrController {
|
||||
|
||||
}
|
||||
|
||||
package org.nl.wms.stor_manage.struct.controller;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.stor_manage.struct.service.IStIvtStructattrService;
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.nl.wms.stor_manage.struct.service.dto.StructattrQuery;
|
||||
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>
|
||||
* 仓位属性表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-04-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/structattr")
|
||||
public class StIvtStructattrController {
|
||||
|
||||
@Autowired
|
||||
private IStIvtStructattrService structattrService;
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> query(StructattrQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(structattrService.pageQuery(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody StIvtStructattr dto) {
|
||||
dto.setId(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
structattrService.save(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StIvtStructattr dto) {
|
||||
structattrService.updateById(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
structattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
public ResponseEntity<Object> changeActive(@RequestBody StIvtStructattr dto) {
|
||||
structattrService.changeActive(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.stor_manage.struct.service;
|
||||
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.stor_manage.struct.service.dto.StructattrQuery;
|
||||
|
||||
@@ -25,4 +26,9 @@ public interface IStIvtStructattrService extends IService<StIvtStructattr> {
|
||||
List<Map<String, Object>> getByQuery(StructattrQuery query);
|
||||
|
||||
void changeStruct(String struct_code,String vehicle_code,String task_type);
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
Object pageQuery(StructattrQuery query, PageQuery page);
|
||||
|
||||
void changeActive(StIvtStructattr dto);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.nl.wms.stor_manage.struct.service.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
package org.nl.wms.stor_manage.struct.service.dao.mapper;
|
||||
|
||||
import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.stor_manage.struct.service.dto.StructattrQuery;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +19,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface StIvtStructattrMapper extends BaseMapper<StIvtStructattr> {
|
||||
|
||||
List<Map> getPageQuery(@Param("query") StructattrQuery query, PageQuery pageQuery);
|
||||
}
|
||||
|
||||
@@ -2,4 +2,38 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.stor_manage.struct.service.dao.mapper.StIvtStructattrMapper">
|
||||
|
||||
<select id="getPageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
struct.*,
|
||||
sect.sect_name,
|
||||
stor.stor_name
|
||||
FROM
|
||||
st_ivt_structattr struct
|
||||
left join st_ivt_sectattr sect on sect.sect_id = struct.sect_code
|
||||
left join st_ivt_bsrealstorattr stor on sect.stor_id = stor.stor_id
|
||||
<where>
|
||||
<if test="query.is_used == true">
|
||||
and struct.is_used = '0'
|
||||
</if>
|
||||
<if test="query.is_used == false">
|
||||
and struct.is_used = '1'
|
||||
</if>
|
||||
<if test="query.is_used == null and query.is_used == ''">
|
||||
and struct.is_used = #{query.is_used}
|
||||
</if>
|
||||
<if test="query.stor_code != null and query.stor_code != ''">
|
||||
and struct.stor_code = #{query.stor_code}
|
||||
</if>
|
||||
<if test="query.sect_code != null and query.sect_code != ''">
|
||||
and struct.sect_code = #{query.sect_code}
|
||||
</if>
|
||||
<if test="query.lock_type != null and query.lock_type != ''">
|
||||
and struct.lock_type = #{query.lock_type}
|
||||
</if>
|
||||
<if test="query.search != null and query.search != ''">
|
||||
and (struct.struct_code LIKE '%${query.search}%'
|
||||
or struct.struct_name LIKE '%${query.search}%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -14,9 +14,13 @@ import org.nl.wms.stor_manage.struct.service.dao.StIvtStructattr;
|
||||
public class StructattrQuery extends BaseQuery<StIvtStructattr> {
|
||||
|
||||
private String search;
|
||||
private String stor_code;
|
||||
private String sect_code;
|
||||
private String lock_type;
|
||||
private Boolean is_used;
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("search", QParam.builder().k(new String[]{"unit_name"}).type(QueryTEnum.LK).build());
|
||||
super.doP.put("search", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ package org.nl.wms.stor_manage.struct.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.entity.PageQuery;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.wms.base_manage.vehicle.vehicleMater.service.IMdPbVehicleMaterService;
|
||||
@@ -37,11 +41,6 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
@Autowired
|
||||
private IStIvtStructivtflowService structivtflowService;
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getByQuery(StructattrQuery query) {
|
||||
List<Map<String, Object>> maps = this.listMaps(query.build());
|
||||
return maps;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
Boolean in = StatusEnum.TASK_TYPE_IN.check("10");
|
||||
@@ -78,4 +77,33 @@ public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMappe
|
||||
structivtflowService.saveBatch(records);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Map<String, Object>> getByQuery(StructattrQuery query) {
|
||||
List<Map<String, Object>> maps = this.listMaps(query.build());
|
||||
return maps;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Long[] ids) {
|
||||
for (Long id : ids) {
|
||||
this.removeById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object pageQuery(StructattrQuery 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
|
||||
public void changeActive(StIvtStructattr dto) {
|
||||
dto.setIs_used(dto.getIs_used());
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user