fix: 基础框架修改,去除不要代码
This commit is contained in:
@@ -228,6 +228,9 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
||||
menu.setPid(resources.getPid());
|
||||
menu.setMenu_sort(resources.getMenu_sort());
|
||||
menu.setCache(resources.getCache());
|
||||
menu.setEn_title(resources.getEn_title());
|
||||
menu.setZh_title(resources.getZh_title());
|
||||
menu.setIn_title(resources.getIn_title());
|
||||
menu.setHidden(resources.getHidden());
|
||||
menu.setComponent_name(resources.getComponent_name());
|
||||
menu.setPermission(resources.getPermission());
|
||||
|
||||
@@ -32,14 +32,12 @@ public class MdBaseClassstandardController {
|
||||
|
||||
@GetMapping
|
||||
@Log("查询基础分类")
|
||||
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||
return new ResponseEntity<>(TableDataInfo.build(mdBaseClassstandardService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增基础分类")
|
||||
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdBaseClassstandard entity){
|
||||
mdBaseClassstandardService.create(entity);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
@@ -47,14 +45,12 @@ public class MdBaseClassstandardController {
|
||||
|
||||
@PutMapping
|
||||
@Log("修改基础分类")
|
||||
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MdBaseClassstandard entity){
|
||||
mdBaseClassstandardService.update(entity);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除基础分类")
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody List<String> ids) {
|
||||
mdBaseClassstandardService.deleteAll(ids);
|
||||
@@ -63,14 +59,12 @@ public class MdBaseClassstandardController {
|
||||
|
||||
@GetMapping("/getClassName")
|
||||
@Log("获取分类名称下拉框")
|
||||
|
||||
public ResponseEntity<Object> getClassName() {
|
||||
return new ResponseEntity<>(mdBaseClassstandardService.getClassName(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/loadClass")
|
||||
@Log("查询基础类型")
|
||||
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(mdBaseClassstandardService.loadClass(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.nl.wms.basedata.master.customer.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata.master.customer.service.ICustomerbaseService;
|
||||
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
|
||||
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;
|
||||
import java.util.Set;
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/customerbase")
|
||||
public class CustomerbaseController {
|
||||
|
||||
@Autowired
|
||||
private ICustomerbaseService customerbaseService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询客户信息管理")
|
||||
//@SaCheckPermission("@el.check('customerbase:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||
return new ResponseEntity<>(TableDataInfo.build(customerbaseService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增客户信息管理")
|
||||
//@SaCheckPermission("@el.check('customerbase:add')")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Customerbase entity){
|
||||
customerbaseService.create(entity);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改客户信息管理")
|
||||
//@SaCheckPermission("@el.check('customerbase:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Customerbase entity){
|
||||
customerbaseService.update(entity);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除客户信息管理")
|
||||
//@SaCheckPermission("@el.check('customerbase:del')")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
customerbaseService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.nl.wms.basedata.master.customer.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
public interface ICustomerbaseService extends IService<Customerbase> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<Customerbase>
|
||||
*/
|
||||
IPage<Customerbase> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
void create(Customerbase entity);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param entity /
|
||||
*/
|
||||
void update(Customerbase entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package org.nl.wms.basedata.master.customer.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_cs_customerbase")
|
||||
public class Customerbase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "cust_id", type = IdType.NONE)
|
||||
/** 客户标识 */
|
||||
private String cust_id;
|
||||
|
||||
/** 客户编码 */
|
||||
private String cust_code;
|
||||
|
||||
/** 客户名称 */
|
||||
private String cust_name;
|
||||
|
||||
/** 客户简称 */
|
||||
private String cust_simple_name;
|
||||
|
||||
/** 国家 */
|
||||
private String country;
|
||||
|
||||
/** 省份 */
|
||||
private String state;
|
||||
|
||||
/** 城市 */
|
||||
private String city;
|
||||
|
||||
/** 传真 */
|
||||
private String faxnumber;
|
||||
|
||||
/** 邮箱 */
|
||||
private String webSite;
|
||||
|
||||
/** 法人代表 */
|
||||
private String jurid_name;
|
||||
|
||||
/** 税务登记号 */
|
||||
private String tax_no;
|
||||
|
||||
/** 工商注册号 */
|
||||
private String register_no;
|
||||
|
||||
/** 经营许可证号 */
|
||||
private String manage_lice_no;
|
||||
|
||||
/** 营业执照 */
|
||||
private String busi_char_name;
|
||||
|
||||
/** 行政区划 */
|
||||
private String area_id;
|
||||
|
||||
/** 邮政编码 */
|
||||
private String zip_code;
|
||||
|
||||
/** 公司电话 */
|
||||
private String corp_tele_no;
|
||||
|
||||
/** 公司地址 */
|
||||
private String corp_address;
|
||||
|
||||
/** 业务员 */
|
||||
private String sales_owner;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 启用时间 */
|
||||
private String is_used_time;
|
||||
|
||||
/** 是否启用 */
|
||||
private String is_used;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 外部标识 */
|
||||
private String ext_id;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 分类标识 */
|
||||
private String class_id;
|
||||
|
||||
/** 分类编码 */
|
||||
private String class_code;
|
||||
|
||||
/** 分类名称 */
|
||||
private String class_name;
|
||||
|
||||
/** 子卷打印模板号 */
|
||||
private String zj_print_no;
|
||||
|
||||
/** 包装打印模板号 */
|
||||
private String bz_print_no;
|
||||
|
||||
/** 送货单打印模板号 */
|
||||
private String shd_print_no;
|
||||
|
||||
/** 送货单明细数 */
|
||||
private String shd_dtl_num;
|
||||
|
||||
/** is_auto_table */
|
||||
private String is_auto_table;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.wms.basedata.master.customer.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
public interface CustomerbaseMapper extends BaseMapper<Customerbase> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.basedata.master.customer.service.dao.mapper.CustomerbaseMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,130 @@
|
||||
package org.nl.wms.basedata.master.customer.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Data
|
||||
public class CustomerbaseDto implements Serializable {
|
||||
|
||||
/** 客户标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private String cust_id;
|
||||
|
||||
/** 客户编码 */
|
||||
private String cust_code;
|
||||
|
||||
/** 客户名称 */
|
||||
private String cust_name;
|
||||
|
||||
/** 客户简称 */
|
||||
private String cust_simple_name;
|
||||
|
||||
/** 国家 */
|
||||
private String country;
|
||||
|
||||
/** 省份 */
|
||||
private String state;
|
||||
|
||||
/** 城市 */
|
||||
private String city;
|
||||
|
||||
/** 传真 */
|
||||
private String faxnumber;
|
||||
|
||||
/** 邮箱 */
|
||||
private String webSite;
|
||||
|
||||
/** 法人代表 */
|
||||
private String jurid_name;
|
||||
|
||||
/** 税务登记号 */
|
||||
private String tax_no;
|
||||
|
||||
/** 工商注册号 */
|
||||
private String register_no;
|
||||
|
||||
/** 经营许可证号 */
|
||||
private String manage_lice_no;
|
||||
|
||||
/** 营业执照 */
|
||||
private String busi_char_name;
|
||||
|
||||
/** 行政区划 */
|
||||
private Long area_id;
|
||||
|
||||
/** 邮政编码 */
|
||||
private String zip_code;
|
||||
|
||||
/** 公司电话 */
|
||||
private String corp_tele_no;
|
||||
|
||||
/** 公司地址 */
|
||||
private String corp_address;
|
||||
|
||||
/** 业务员 */
|
||||
private String sales_owner;
|
||||
|
||||
/** 创建人 */
|
||||
private Long create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private Long update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 启用时间 */
|
||||
private String is_used_time;
|
||||
|
||||
/** 是否启用 */
|
||||
private String is_used;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 外部标识 */
|
||||
private String ext_id;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 分类标识 */
|
||||
private Long class_id;
|
||||
|
||||
/** 分类编码 */
|
||||
private String class_code;
|
||||
|
||||
/** 分类名称 */
|
||||
private String class_name;
|
||||
|
||||
/** 子卷打印模板号 */
|
||||
private String zj_print_no;
|
||||
|
||||
/** 包装打印模板号 */
|
||||
private String bz_print_no;
|
||||
|
||||
/** 送货单打印模板号 */
|
||||
private String shd_print_no;
|
||||
|
||||
/** 送货单明细数 */
|
||||
private String shd_dtl_num;
|
||||
|
||||
private String is_auto_table;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.wms.basedata.master.customer.service.dto;
|
||||
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
public class CustomerbaseQuery extends BaseQuery<Customerbase> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package org.nl.wms.basedata.master.customer.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.wms.basedata.master.customer.service.ICustomerbaseService;
|
||||
import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
|
||||
import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class CustomerbaseServiceImpl extends ServiceImpl<CustomerbaseMapper, Customerbase> implements ICustomerbaseService {
|
||||
|
||||
@Autowired
|
||||
private CustomerbaseMapper customerbaseMapper;
|
||||
|
||||
@Override
|
||||
public IPage<Customerbase> queryAll(Map whereJson, PageQuery page){
|
||||
String o = ObjectUtil.isEmpty(whereJson.get("search")) ? null : (String)whereJson.get("search");
|
||||
LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(o != null, Customerbase::getCust_code, o)
|
||||
.or(o != null)
|
||||
.like(o != null, Customerbase::getCust_name, o);
|
||||
IPage<Customerbase> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
customerbaseMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(Customerbase entity) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
entity.setCust_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
entity.setUpdate_optid(currentUserId);
|
||||
entity.setUpdate_optname(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
customerbaseMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Customerbase entity) {
|
||||
Customerbase dto = customerbaseMapper.selectById(entity.getCust_id());
|
||||
if (dto == null) {
|
||||
throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_optid(currentUserId);
|
||||
entity.setUpdate_optname(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
|
||||
customerbaseMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Set<String> ids) {
|
||||
// 真删除
|
||||
customerbaseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package org.nl.wms.basedata.master.unit.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.base.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.nl.wms.basedata.master.unit.service.IMeasureunitService;
|
||||
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
|
||||
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;
|
||||
import java.util.Set;
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/measureunit")
|
||||
public class MeasureunitController {
|
||||
|
||||
@Autowired
|
||||
private IMeasureunitService measureunitService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询计量单位")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||
return new ResponseEntity<>(TableDataInfo.build(measureunitService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增计量单位")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Measureunit entity){
|
||||
measureunitService.create(entity);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改计量单位")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Measureunit entity){
|
||||
measureunitService.update(entity);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除计量单位")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
measureunitService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.nl.wms.basedata.master.unit.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务接口
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
public interface IMeasureunitService extends IService<Measureunit> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param whereJson 条件
|
||||
* @param pageable 分页参数
|
||||
* @return IPage<Measureunit>
|
||||
*/
|
||||
IPage<Measureunit> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param entity /
|
||||
*/
|
||||
void create(Measureunit entity);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param entity /
|
||||
*/
|
||||
void update(Measureunit entity);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Set<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.nl.wms.basedata.master.unit.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_pb_measureunit")
|
||||
public class Measureunit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "measure_unit_id", type = IdType.NONE)
|
||||
/** 计量单位标识 */
|
||||
private String measure_unit_id;
|
||||
|
||||
/** 编码 */
|
||||
private String unit_code;
|
||||
|
||||
/** 名称 */
|
||||
private String unit_name;
|
||||
|
||||
/** 数据精度 */
|
||||
private BigDecimal qty_precision;
|
||||
|
||||
/** 是否启用 */
|
||||
private String is_used;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 外部标识 */
|
||||
private String ext_id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.wms.basedata.master.unit.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
public interface MeasureunitMapper extends BaseMapper<Measureunit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.basedata.master.unit.service.dao.mapper.MeasureunitMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,58 @@
|
||||
package org.nl.wms.basedata.master.unit.service.dto;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description /
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Data
|
||||
public class MeasureunitDto implements Serializable {
|
||||
|
||||
/** 计量单位标识 */
|
||||
/** 防止精度丢失 */
|
||||
@JsonSerialize(using= ToStringSerializer.class)
|
||||
private String measure_unit_id;
|
||||
|
||||
/** 编码 */
|
||||
private String unit_code;
|
||||
|
||||
/** 名称 */
|
||||
private String unit_name;
|
||||
|
||||
/** 数据精度 */
|
||||
private BigDecimal qty_precision;
|
||||
|
||||
/** 是否启用 */
|
||||
private String is_used;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 修改人 */
|
||||
private String update_optid;
|
||||
|
||||
/** 修改人姓名 */
|
||||
private String update_optname;
|
||||
|
||||
/** 修改时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 是否删除 */
|
||||
private String is_delete;
|
||||
|
||||
/** 外部标识 */
|
||||
private String ext_id;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.nl.wms.basedata.master.unit.service.dto;
|
||||
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
|
||||
|
||||
/**
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
public class MeasureunitQuery extends BaseQuery<Measureunit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package org.nl.wms.basedata.master.unit.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.wms.basedata.master.unit.service.IMeasureunitService;
|
||||
import org.nl.wms.basedata.master.unit.service.dao.Measureunit;
|
||||
import org.nl.wms.basedata.master.unit.service.dao.mapper.MeasureunitMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @description 服务实现
|
||||
* @author lyd
|
||||
* @date 2024-03-25
|
||||
**/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class MeasureunitServiceImpl extends ServiceImpl<MeasureunitMapper, Measureunit> implements IMeasureunitService {
|
||||
|
||||
@Autowired
|
||||
private MeasureunitMapper measureunitMapper;
|
||||
|
||||
@Override
|
||||
public IPage<Measureunit> queryAll(Map whereJson, PageQuery page){
|
||||
String o = ObjectUtil.isEmpty(whereJson.get("search")) ? null : (String)whereJson.get("search");
|
||||
LambdaQueryWrapper<Measureunit> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(o != null, Measureunit::getUnit_code, o)
|
||||
.or(o != null)
|
||||
.like(o != null, Measureunit::getUnit_name, o);
|
||||
IPage<Measureunit> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
measureunitMapper.selectPage(pages, lam);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(Measureunit entity) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
entity.setMeasure_unit_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setCreate_id(currentUserId);
|
||||
entity.setCreate_name(nickName);
|
||||
entity.setCreate_time(now);
|
||||
entity.setUpdate_optid(currentUserId);
|
||||
entity.setUpdate_optname(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
measureunitMapper.insert(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Measureunit entity) {
|
||||
Measureunit dto = measureunitMapper.selectById(entity.getMeasure_unit_id());
|
||||
if (dto == null) throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
entity.setUpdate_optid(currentUserId);
|
||||
entity.setUpdate_optname(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
|
||||
measureunitMapper.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Set<String> ids) {
|
||||
// 真删除
|
||||
measureunitMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
|
||||
Reference in New Issue
Block a user