基础资料完善
parent
95bb20b1d1
commit
ae327d231f
|
|
@ -63,6 +63,7 @@ public class AdminCacheConst extends CacheKeyConst {
|
||||||
public static final String ITEM_ENTITY = "item_cache";
|
public static final String ITEM_ENTITY = "item_cache";
|
||||||
public static final String STOCK_ENTITY = "stock_cache";
|
public static final String STOCK_ENTITY = "stock_cache";
|
||||||
public static final String ADDRESS_ENTITY = "address_cache";
|
public static final String ADDRESS_ENTITY = "address_cache";
|
||||||
|
public static final String CUSTOMER_ENTITY = "customer_cache";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,8 @@
|
||||||
package net.lab1024.sa.admin.module.business.base.address.domain.form;
|
package net.lab1024.sa.admin.module.business.base.address.domain.form;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
|
||||||
public class AddressSelect {
|
public class AddressSelect {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,9 @@ import org.springframework.stereotype.Component;
|
||||||
/**
|
/**
|
||||||
* 库区信息 Dao
|
* 库区信息 Dao
|
||||||
*
|
*
|
||||||
* @Author hj
|
* @author hj
|
||||||
* @Date 2025-03-11 11:12:36
|
* @since 2025-03-11 11:12:36
|
||||||
* @Copyright 友仓
|
* copyright 友仓
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
|
|
@ -27,9 +27,9 @@ public interface AreaDao extends BaseMapper<AreaEntity> {
|
||||||
/**
|
/**
|
||||||
* 分页 查询
|
* 分页 查询
|
||||||
*
|
*
|
||||||
* @param page
|
* @param page 分页
|
||||||
* @param queryForm
|
* @param queryForm 查询参数
|
||||||
* @return
|
* @return List<AreaVO>
|
||||||
*/
|
*/
|
||||||
List<AreaVO> queryPage(Page page, @Param("queryForm") AreaQueryForm queryForm);
|
List<AreaVO> queryPage(Page page, @Param("queryForm") AreaQueryForm queryForm);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ public class AreaAddForm {
|
||||||
@NotBlank(message = "库区名称 不能为空")
|
@NotBlank(message = "库区名称 不能为空")
|
||||||
private String areaName;
|
private String areaName;
|
||||||
|
|
||||||
@Schema(description = "禁用状态")
|
@Schema(description = "是否启用")
|
||||||
@NotNull(message = "禁用状态不能为空")
|
@NotNull(message = "启用状态不能为空")
|
||||||
private Boolean disabledFlag;
|
private Boolean disabledFlag;
|
||||||
|
|
||||||
@Schema(description = "备注|可选")
|
@Schema(description = "备注|可选")
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class AreaQueryForm extends PageParam {
|
public class AreaQueryForm extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "库区ID")
|
@Schema(description = "库区")
|
||||||
private Long areaId;
|
private Long areaId;
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
@Schema(description = "是否启用")
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ import org.springframework.stereotype.Service;
|
||||||
/**
|
/**
|
||||||
* 库区信息 Manager
|
* 库区信息 Manager
|
||||||
*
|
*
|
||||||
* @Author hj
|
* @author hj
|
||||||
* @Date 2025-03-11 11:12:36
|
* @since 2025-03-11 11:12:36
|
||||||
* @Copyright 友仓
|
* copyright 友仓
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,7 @@ import net.lab1024.sa.admin.module.business.base.area.domain.form.AreaQueryForm;
|
||||||
import net.lab1024.sa.admin.module.business.base.area.domain.form.AreaSelect;
|
import net.lab1024.sa.admin.module.business.base.area.domain.form.AreaSelect;
|
||||||
import net.lab1024.sa.admin.module.business.base.area.domain.vo.AreaVO;
|
import net.lab1024.sa.admin.module.business.base.area.domain.vo.AreaVO;
|
||||||
import net.lab1024.sa.admin.module.business.base.area.manager.AreaManager;
|
import net.lab1024.sa.admin.module.business.base.area.manager.AreaManager;
|
||||||
import net.lab1024.sa.admin.module.business.base.location.domain.entity.LocationEntity;
|
|
||||||
import net.lab1024.sa.base.common.domain.PageResult;
|
import net.lab1024.sa.base.common.domain.PageResult;
|
||||||
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
|
||||||
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.controller;
|
||||||
|
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.entity.CustomerEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerAddForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerSelect;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerUpdateForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.vo.CustomerVO;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.service.CustomerQueryService;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.service.CustomerService;
|
||||||
|
import net.lab1024.sa.base.common.domain.RequestUser;
|
||||||
|
import net.lab1024.sa.base.common.domain.ValidateList;
|
||||||
|
import net.lab1024.sa.base.common.util.SmartRequestUtil;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||||
|
import net.lab1024.sa.base.common.domain.PageResult;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 Controller
|
||||||
|
*
|
||||||
|
* @author 霍锦
|
||||||
|
* @since 2025-03-25 10:42:33
|
||||||
|
* copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Tag(name = "客户管理")
|
||||||
|
public class CustomerController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomerService customerService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomerQueryService customerQueryService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询 @author 霍锦")
|
||||||
|
@PostMapping("/customer/queryPage")
|
||||||
|
@SaCheckPermission("customer:query")
|
||||||
|
public ResponseDTO<PageResult<CustomerVO>> queryPage(@RequestBody @Valid CustomerQueryForm queryForm) {
|
||||||
|
return ResponseDTO.ok(customerQueryService.queryPage(queryForm));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加 @author 霍锦")
|
||||||
|
@PostMapping("/customer/add")
|
||||||
|
@SaCheckPermission("customer:add")
|
||||||
|
public ResponseDTO<String> add(@RequestBody @Valid CustomerAddForm addForm) {
|
||||||
|
RequestUser requestUser = SmartRequestUtil.getRequestUser();
|
||||||
|
addForm.setCreateUserId(requestUser.getUserId());
|
||||||
|
addForm.setCreateUserName(requestUser.getUserName());
|
||||||
|
return customerService.add(addForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "更新 @author 霍锦")
|
||||||
|
@PostMapping("/customer/update")
|
||||||
|
@SaCheckPermission("customer:update")
|
||||||
|
public ResponseDTO<String> update(@RequestBody @Valid CustomerUpdateForm updateForm) {
|
||||||
|
return customerService.update(updateForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除 @author 霍锦")
|
||||||
|
@PostMapping("/customer/batchDelete")
|
||||||
|
@SaCheckPermission("customer:batchDelete")
|
||||||
|
public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
|
||||||
|
return customerService.batchDelete(idList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "单个删除 @author 霍锦")
|
||||||
|
@GetMapping("/customer/delete")
|
||||||
|
@SaCheckPermission("customer:delete")
|
||||||
|
public ResponseDTO<String> delete(@RequestParam Long customerId) {
|
||||||
|
return customerService.delete(customerId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "客户下拉查询")
|
||||||
|
@PostMapping("/customer/queryCustomer")
|
||||||
|
public ResponseDTO<List<CustomerEntity>> queryCustomer(@RequestBody CustomerSelect customerSelect) {
|
||||||
|
return ResponseDTO.ok(customerQueryService.queryCustomer(customerSelect));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.entity.CustomerEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.vo.CustomerVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 Dao
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-25 10:42:33
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface CustomerDao extends BaseMapper<CustomerEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页 查询
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param queryForm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CustomerVO> queryPage(Page page, @Param("queryForm") CustomerQueryForm queryForm);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.domain.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 实体类
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-25 10:42:33
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName("t_customer")
|
||||||
|
public class CustomerEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户代码
|
||||||
|
*/
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户名称
|
||||||
|
*/
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人
|
||||||
|
*/
|
||||||
|
private String person;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电话
|
||||||
|
*/
|
||||||
|
private String telephone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用
|
||||||
|
*/
|
||||||
|
private Boolean disabledFlag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人ID
|
||||||
|
*/
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.domain.form;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 新建表单
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-25 10:42:33
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CustomerAddForm {
|
||||||
|
|
||||||
|
@Schema(description = "客户代码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "客户代码 不能为空")
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "客户名称 不能为空")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@Schema(description = "联系人")
|
||||||
|
private String person;
|
||||||
|
|
||||||
|
@Schema(description = "电话")
|
||||||
|
private String telephone;
|
||||||
|
|
||||||
|
@Schema(description = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
@NotNull(message = "启用不能为空")
|
||||||
|
private Boolean disabledFlag;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(hidden = true)
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
@Schema(hidden = true)
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.domain.form;
|
||||||
|
|
||||||
|
import net.lab1024.sa.base.common.domain.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 分页查询表单
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-25 10:42:33
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class CustomerQueryForm extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "客户")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private Boolean disabledFlag;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.domain.form;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CustomerSelect {
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
Boolean disabledFlag;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.domain.form;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 更新表单
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-25 10:42:33
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CustomerUpdateForm extends CustomerAddForm{
|
||||||
|
|
||||||
|
@Schema(description = "客户id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "客户id 不能为空")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 列表VO
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-25 10:42:33
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class CustomerVO {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "客户id")
|
||||||
|
private Long customerId;
|
||||||
|
|
||||||
|
@Schema(description = "客户代码")
|
||||||
|
private String customerCode;
|
||||||
|
|
||||||
|
@Schema(description = "客户名称")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
@Schema(description = "联系人")
|
||||||
|
private String person;
|
||||||
|
|
||||||
|
@Schema(description = "电话")
|
||||||
|
private String telephone;
|
||||||
|
|
||||||
|
@Schema(description = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private Boolean disabledFlag;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.manager;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import net.lab1024.sa.admin.constant.AdminCacheConst;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.entity.CustomerEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.dao.CustomerDao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 Manager
|
||||||
|
*
|
||||||
|
* @author 霍锦
|
||||||
|
* @since 2025-03-25 10:42:33
|
||||||
|
* copyright 友仓
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class CustomerManager extends ServiceImpl<CustomerDao, CustomerEntity> {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomerDao customerDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类目id 移除缓存
|
||||||
|
*/
|
||||||
|
@CacheEvict(value = {AdminCacheConst.Base.CUSTOMER_ENTITY}, allEntries = true)
|
||||||
|
public void removeCache() {
|
||||||
|
log.info("clear CUSTOMER_ENTITY");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查詢类目
|
||||||
|
*/
|
||||||
|
@Cacheable(AdminCacheConst.Base.CUSTOMER_ENTITY)
|
||||||
|
public CustomerEntity queryCustomer(Long customerId) {
|
||||||
|
return customerDao.selectById(customerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.area.domain.entity.AreaEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.area.domain.form.AreaSelect;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.dao.CustomerDao;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.entity.CustomerEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerSelect;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.vo.CustomerVO;
|
||||||
|
import net.lab1024.sa.base.common.domain.PageResult;
|
||||||
|
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CustomerQueryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomerDao customerDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param queryForm 查询参数
|
||||||
|
* @return PageResult<CustomerVO>
|
||||||
|
*/
|
||||||
|
public PageResult<CustomerVO> queryPage(CustomerQueryForm queryForm) {
|
||||||
|
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||||
|
List<CustomerVO> list = customerDao.queryPage(page, queryForm);
|
||||||
|
return SmartPageUtil.convert2PageResult(page, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有客户信息
|
||||||
|
*
|
||||||
|
* @return List<CustomerEntity>
|
||||||
|
*/
|
||||||
|
public List<CustomerEntity> queryCustomer(CustomerSelect customerSelect) {
|
||||||
|
LambdaQueryWrapper<CustomerEntity> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//是否启用
|
||||||
|
if (customerSelect.getDisabledFlag() != null) {
|
||||||
|
queryWrapper.eq(CustomerEntity::getDisabledFlag, customerSelect.getDisabledFlag());
|
||||||
|
}
|
||||||
|
return customerDao.selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,87 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.base.customer.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.dao.CustomerDao;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.entity.CustomerEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerAddForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.domain.form.CustomerUpdateForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.base.customer.manager.CustomerManager;
|
||||||
|
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||||
|
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户管理 Service
|
||||||
|
*
|
||||||
|
* @author 霍锦
|
||||||
|
* @since 2025-03-25 10:42:33
|
||||||
|
* copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CustomerService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomerDao customerDao;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CustomerManager customerManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param addForm 添加参数
|
||||||
|
* @return ResponseDTO<String>
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> add(CustomerAddForm addForm) {
|
||||||
|
CustomerEntity customerEntity = SmartBeanUtil.copy(addForm, CustomerEntity.class);
|
||||||
|
customerDao.insert(customerEntity);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
*
|
||||||
|
* @param updateForm 更新参数
|
||||||
|
* @return ResponseDTO<String>
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> update(CustomerUpdateForm updateForm) {
|
||||||
|
CustomerEntity customerEntity = SmartBeanUtil.copy(updateForm, CustomerEntity.class);
|
||||||
|
customerDao.updateById(customerEntity);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param idList id集合
|
||||||
|
* @return ResponseDTO<String>
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> batchDelete(List<Long> idList) {
|
||||||
|
if (CollectionUtils.isEmpty(idList)) {
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
customerManager.removeBatchByIds(idList);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单个删除
|
||||||
|
*
|
||||||
|
* @param customerId id
|
||||||
|
* @return ResponseDTO<String>
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> delete(Long customerId) {
|
||||||
|
if (null == customerId) {
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
customerDao.deleteById(customerId);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
# 默认是按前端工程文件的 /views/business 文件夹的路径作为前端组件路径,如果你没把生成的 .vue 前端代码放在 /views/business 下,
|
||||||
|
# 那就根据自己实际情况修改下面 SQL 的 path,component 字段值,避免执行 SQL 后菜单无法访问。
|
||||||
|
# 如果你一切都是按照默认,那么下面的 SQL 基本不用改
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, path, component, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, create_user_id )
|
||||||
|
VALUES ( '客户管理', 2, 0, '/customer/list', '/business/customer/customer-list.vue', false, false, true, false, 1, 1 );
|
||||||
|
|
||||||
|
# 按菜单名称查询该菜单的 menu_id 作为按钮权限的 父菜单ID 与 功能点关联菜单ID
|
||||||
|
SET @parent_id = NULL;
|
||||||
|
SELECT t_menu.menu_id INTO @parent_id FROM t_menu WHERE t_menu.menu_name = '客户管理';
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '查询', 3, @parent_id, false, false, true, false, 'customer:query', 1, @parent_id, 1 );
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '添加', 3, @parent_id, false, false, true, false, 'customer:add', 1, @parent_id, 1 );
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '更新', 3, @parent_id, false, false, true, false, 'customer:update', 1, @parent_id, 1 );
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '删除', 3, @parent_id, false, false, true, false, 'customer:delete', 1, @parent_id, 1 );
|
||||||
|
|
@ -44,7 +44,7 @@ public class ItemAddForm {
|
||||||
private BigDecimal packFactor;
|
private BigDecimal packFactor;
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
@Schema(description = "是否启用")
|
||||||
@NotNull(message = "禁用状态不能为空")
|
@NotNull(message = "启用状态不能为空")
|
||||||
private Boolean disabledFlag;
|
private Boolean disabledFlag;
|
||||||
|
|
||||||
@Schema(hidden = true)
|
@Schema(hidden = true)
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ public class LocationAddForm {
|
||||||
@NotNull(message = "库区 不能为空")
|
@NotNull(message = "库区 不能为空")
|
||||||
private Long areaId;
|
private Long areaId;
|
||||||
|
|
||||||
@Schema(description = "禁用状态")
|
@Schema(description = "是否启用")
|
||||||
@NotNull(message = "禁用状态不能为空")
|
@NotNull(message = "启用状态不能为空")
|
||||||
private Boolean disabledFlag;
|
private Boolean disabledFlag;
|
||||||
|
|
||||||
@Schema(hidden = true)
|
@Schema(hidden = true)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.controller;
|
||||||
|
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.form.AsnAddForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.form.AsnQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.form.AsnUpdateForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.vo.AsnVO;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.service.AsnService;
|
||||||
|
import net.lab1024.sa.base.common.domain.ValidateList;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||||
|
import net.lab1024.sa.base.common.domain.PageResult;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 Controller
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@Tag(name = "入库单")
|
||||||
|
public class AsnController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AsnService asnService;
|
||||||
|
|
||||||
|
@Operation(summary = "分页查询 @author 霍锦")
|
||||||
|
@PostMapping("/asn/queryPage")
|
||||||
|
@SaCheckPermission("asn:query")
|
||||||
|
public ResponseDTO<PageResult<AsnVO>> queryPage(@RequestBody @Valid AsnQueryForm queryForm) {
|
||||||
|
return ResponseDTO.ok(asnService.queryPage(queryForm));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "添加 @author 霍锦")
|
||||||
|
@PostMapping("/asn/add")
|
||||||
|
@SaCheckPermission("asn:add")
|
||||||
|
public ResponseDTO<String> add(@RequestBody @Valid AsnAddForm addForm) {
|
||||||
|
return asnService.add(addForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "更新 @author 霍锦")
|
||||||
|
@PostMapping("/asn/update")
|
||||||
|
@SaCheckPermission("asn:update")
|
||||||
|
public ResponseDTO<String> update(@RequestBody @Valid AsnUpdateForm updateForm) {
|
||||||
|
return asnService.update(updateForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "批量删除 @author 霍锦")
|
||||||
|
@PostMapping("/asn/batchDelete")
|
||||||
|
@SaCheckPermission("asn:delete")
|
||||||
|
public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
|
||||||
|
return asnService.batchDelete(idList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "单个删除 @author 霍锦")
|
||||||
|
@GetMapping("/asn/delete/{asnId}")
|
||||||
|
@SaCheckPermission("asn:delete")
|
||||||
|
public ResponseDTO<String> batchDelete(@PathVariable Long asnId) {
|
||||||
|
return asnService.delete(asnId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.entity.AsnEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.form.AsnQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.vo.AsnVO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 Dao
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface AsnDao extends BaseMapper<AsnEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页 查询
|
||||||
|
*
|
||||||
|
* @param page
|
||||||
|
* @param queryForm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<AsnVO> queryPage(Page page, @Param("queryForm") AsnQueryForm queryForm);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.domain.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 实体类
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@TableName("t_asn")
|
||||||
|
public class AsnEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long asnId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单号
|
||||||
|
*/
|
||||||
|
private String asnNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户订单号
|
||||||
|
*/
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单据类型
|
||||||
|
*/
|
||||||
|
private String orderType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货地址
|
||||||
|
*/
|
||||||
|
private Long addressId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单数量
|
||||||
|
*/
|
||||||
|
private BigDecimal orderQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收货数量
|
||||||
|
*/
|
||||||
|
private BigDecimal receivedQuantity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单日期
|
||||||
|
*/
|
||||||
|
private LocalDate orderDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人ID
|
||||||
|
*/
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.domain.form;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 新建表单
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AsnAddForm {
|
||||||
|
|
||||||
|
@Schema(description = "入库单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "入库单号 不能为空")
|
||||||
|
private String asnNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客户订单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "客户订单号 不能为空")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "单据类型")
|
||||||
|
private String orderType;
|
||||||
|
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "收货地址", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "收货地址 不能为空")
|
||||||
|
private Long addressId;
|
||||||
|
|
||||||
|
@Schema(description = "订单日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "订单日期 不能为空")
|
||||||
|
private LocalDate orderDate;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "创建时间 不能为空")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建人ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "创建人ID 不能为空")
|
||||||
|
private Long createUserId;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotBlank(message = "创建人 不能为空")
|
||||||
|
private String createUserName;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "更新时间 不能为空")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.domain.form;
|
||||||
|
|
||||||
|
import net.lab1024.sa.base.common.domain.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 分页查询表单
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
public class AsnQueryForm extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "客户订单号")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.domain.form;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 更新表单
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AsnUpdateForm {
|
||||||
|
|
||||||
|
@Schema(description = "入库单id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "入库单id 不能为空")
|
||||||
|
private Long asnId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.domain.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 列表VO
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class AsnVO {
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "入库单id")
|
||||||
|
private Long asnId;
|
||||||
|
|
||||||
|
@Schema(description = "入库单号")
|
||||||
|
private String asnNumber;
|
||||||
|
|
||||||
|
@Schema(description = "客户订单号")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "单据类型")
|
||||||
|
private String orderType;
|
||||||
|
|
||||||
|
@Schema(description = "状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Schema(description = "收货地址")
|
||||||
|
private Long addressId;
|
||||||
|
|
||||||
|
@Schema(description = "订单数量")
|
||||||
|
private BigDecimal orderQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "收货数量")
|
||||||
|
private BigDecimal receivedQuantity;
|
||||||
|
|
||||||
|
@Schema(description = "订单日期")
|
||||||
|
private LocalDate orderDate;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.manager;
|
||||||
|
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.entity.AsnEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.dao.AsnDao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 Manager
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AsnManager extends ServiceImpl<AsnDao, AsnEntity> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?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="net.lab1024.sa.admin.module.business.asn.dao.AsnDao">
|
||||||
|
|
||||||
|
<!-- 查询结果列 -->
|
||||||
|
<sql id="base_columns">
|
||||||
|
t_asn.asn_id,
|
||||||
|
t_asn.asn_number,
|
||||||
|
t_asn.customer_number,
|
||||||
|
t_asn.order_type,
|
||||||
|
t_asn.status,
|
||||||
|
t_asn.address_id,
|
||||||
|
t_asn.order_quantity,
|
||||||
|
t_asn.received_quantity,
|
||||||
|
t_asn.order_date,
|
||||||
|
t_asn.create_time,
|
||||||
|
t_asn.create_user_id,
|
||||||
|
t_asn.create_user_name,
|
||||||
|
t_asn.update_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.asn.domain.vo.AsnVO">
|
||||||
|
SELECT
|
||||||
|
<include refid="base_columns"/>
|
||||||
|
FROM t_asn
|
||||||
|
<where>
|
||||||
|
<!--客户订单号-->
|
||||||
|
<if test="queryForm.customerNumber != null and queryForm.customerNumber != ''">
|
||||||
|
AND INSTR(t_asn.customer_number,#{queryForm.customerNumber})
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,94 @@
|
||||||
|
package net.lab1024.sa.admin.module.business.receive.asn.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.dao.AsnDao;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.entity.AsnEntity;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.form.AsnAddForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.form.AsnQueryForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.form.AsnUpdateForm;
|
||||||
|
import net.lab1024.sa.admin.module.business.asn.domain.vo.AsnVO;
|
||||||
|
import net.lab1024.sa.base.common.util.SmartBeanUtil;
|
||||||
|
import net.lab1024.sa.base.common.util.SmartPageUtil;
|
||||||
|
import net.lab1024.sa.base.common.domain.ResponseDTO;
|
||||||
|
import net.lab1024.sa.base.common.domain.PageResult;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库单 Service
|
||||||
|
*
|
||||||
|
* @Author 霍锦
|
||||||
|
* @Date 2025-03-26 15:10:02
|
||||||
|
* @Copyright 友仓
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AsnService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AsnDao asnDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param queryForm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageResult<AsnVO> queryPage(AsnQueryForm queryForm) {
|
||||||
|
Page<?> page = SmartPageUtil.convert2PageQuery(queryForm);
|
||||||
|
List<AsnVO> list = asnDao.queryPage(page, queryForm);
|
||||||
|
PageResult<AsnVO> pageResult = SmartPageUtil.convert2PageResult(page, list);
|
||||||
|
return pageResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> add(AsnAddForm addForm) {
|
||||||
|
AsnEntity asnEntity = SmartBeanUtil.copy(addForm, AsnEntity.class);
|
||||||
|
asnDao.insert(asnEntity);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新
|
||||||
|
*
|
||||||
|
* @param updateForm
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> update(AsnUpdateForm updateForm) {
|
||||||
|
AsnEntity asnEntity = SmartBeanUtil.copy(updateForm, AsnEntity.class);
|
||||||
|
asnDao.updateById(asnEntity);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param idList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> batchDelete(List<Long> idList) {
|
||||||
|
if (CollectionUtils.isEmpty(idList)){
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
asnDao.deleteBatchIds(idList);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单个删除
|
||||||
|
*/
|
||||||
|
public ResponseDTO<String> delete(Long asnId) {
|
||||||
|
if (null == asnId){
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
asnDao.deleteById(asnId);
|
||||||
|
return ResponseDTO.ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
# 默认是按前端工程文件的 /views/business 文件夹的路径作为前端组件路径,如果你没把生成的 .vue 前端代码放在 /views/business 下,
|
||||||
|
# 那就根据自己实际情况修改下面 SQL 的 path,component 字段值,避免执行 SQL 后菜单无法访问。
|
||||||
|
# 如果你一切都是按照默认,那么下面的 SQL 基本不用改
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, path, component, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, create_user_id )
|
||||||
|
VALUES ( '入库单', 2, 0, '/asn/list', '/business/asn/asn-list.vue', false, false, true, false, 1, 1 );
|
||||||
|
|
||||||
|
# 按菜单名称查询该菜单的 menu_id 作为按钮权限的 父菜单ID 与 功能点关联菜单ID
|
||||||
|
SET @parent_id = NULL;
|
||||||
|
SELECT t_menu.menu_id INTO @parent_id FROM t_menu WHERE t_menu.menu_name = '入库单';
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '查询', 3, @parent_id, false, false, true, false, 'asn:query', 1, @parent_id, 1 );
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '添加', 3, @parent_id, false, false, true, false, 'asn:add', 1, @parent_id, 1 );
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '更新', 3, @parent_id, false, false, true, false, 'asn:update', 1, @parent_id, 1 );
|
||||||
|
|
||||||
|
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||||
|
VALUES ( '删除', 3, @parent_id, false, false, true, false, 'asn:delete', 1, @parent_id, 1 );
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?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="net.lab1024.sa.admin.module.business.base.customer.dao.CustomerDao">
|
||||||
|
|
||||||
|
<!-- 查询结果列 -->
|
||||||
|
<sql id="base_columns">
|
||||||
|
t_customer.customer_id,
|
||||||
|
t_customer.customer_code,
|
||||||
|
t_customer.customer_name,
|
||||||
|
t_customer.person,
|
||||||
|
t_customer.telephone,
|
||||||
|
t_customer.address,
|
||||||
|
t_customer.remark,
|
||||||
|
t_customer.disabled_flag,
|
||||||
|
t_customer.create_time,
|
||||||
|
t_customer.create_user_id,
|
||||||
|
t_customer.create_user_name,
|
||||||
|
t_customer.update_time
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="queryPage" resultType="net.lab1024.sa.admin.module.business.base.customer.domain.vo.CustomerVO">
|
||||||
|
SELECT
|
||||||
|
<include refid="base_columns"/>
|
||||||
|
FROM t_customer
|
||||||
|
<where>
|
||||||
|
<!--客户-->
|
||||||
|
<if test="queryForm.customerId != null ">
|
||||||
|
AND t_customer.customer_id=#{queryForm.customerId}
|
||||||
|
</if>
|
||||||
|
<!--是否启用-->
|
||||||
|
<if test="queryForm.disabledFlag != null">
|
||||||
|
AND t_customer.disabled_flag=#{queryForm.disabledFlag}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue