forked from sfms3.0/sfms3.0
26 changed files with 702 additions and 433 deletions
@ -0,0 +1,23 @@ |
|||||
|
package com.win.framework.mybatis.core.dataobject; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.FieldFill; |
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.Version; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 基础实体对象 |
||||
|
* |
||||
|
* @author 闻荫源码 |
||||
|
*/ |
||||
|
@Data |
||||
|
public abstract class ConcurrencyDO extends IdDO { |
||||
|
|
||||
|
/** |
||||
|
* 并发乐观锁 |
||||
|
*/ |
||||
|
@Version |
||||
|
@TableField(fill = FieldFill.INSERT) |
||||
|
private Integer ConcurrencyStamp; |
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.win.framework.mybatis.core.dataobject; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* 基础实体对象 |
||||
|
* |
||||
|
* @author 闻荫源码 |
||||
|
*/ |
||||
|
@Data |
||||
|
public abstract class IdDO extends BaseDO { |
||||
|
|
||||
|
/** |
||||
|
* id |
||||
|
*/ |
||||
|
@TableId(type = IdType.AUTO) |
||||
|
private Long id; |
||||
|
|
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
package com.win.framework.mybatis.core.dataobject; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.*; |
||||
|
import lombok.Data; |
||||
|
import org.apache.ibatis.type.JdbcType; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 基础实体对象 |
||||
|
* |
||||
|
* @author 闻荫源码 |
||||
|
*/ |
||||
|
@Data |
||||
|
public abstract class MasterDO extends ConcurrencyDO { |
||||
|
|
||||
|
/** |
||||
|
* 是否可用 |
||||
|
*/ |
||||
|
private String available; |
||||
|
|
||||
|
/** |
||||
|
* 生效时间 |
||||
|
*/ |
||||
|
private LocalDateTime activeTime; |
||||
|
|
||||
|
/** |
||||
|
* 生效时间 |
||||
|
*/ |
||||
|
private LocalDateTime expireTime; |
||||
|
|
||||
|
/** |
||||
|
* 备注 |
||||
|
*/ |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 删除时间 |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT_UPDATE) |
||||
|
private LocalDateTime deletionTime; |
||||
|
|
||||
|
/** |
||||
|
* 删除者,目前使用 SysUser 的 id 编号 |
||||
|
* <p> |
||||
|
* 使用 String 类型的原因是,未来可能会存在非数值的情况,留好拓展性。 |
||||
|
*/ |
||||
|
@TableField(fill = FieldFill.INSERT_UPDATE, jdbcType = JdbcType.VARCHAR) |
||||
|
private String deleterId; |
||||
|
|
||||
|
/** |
||||
|
* 扩展属性 |
||||
|
*/ |
||||
|
private String extraProperties; |
||||
|
|
||||
|
/** |
||||
|
* 地点ID |
||||
|
*/ |
||||
|
private String siteId; |
||||
|
|
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
package com.win.framework.mybatis.core.viewobject; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
|
||||
|
/** |
||||
|
* 基础实体对象 |
||||
|
* |
||||
|
* @author 闻荫源码 |
||||
|
*/ |
||||
|
@Data |
||||
|
public abstract class BaseVO implements Serializable { |
||||
|
|
||||
|
@Schema(description = "id", example = "id") |
||||
|
private Long id; |
||||
|
|
||||
|
@Schema(description = "创建时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime createTime; |
||||
|
|
||||
|
@Schema(description = "最后更新时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime updateTime; |
||||
|
|
||||
|
@Schema(description = "创建者") |
||||
|
private String creator; |
||||
|
|
||||
|
@Schema(description = "更新者") |
||||
|
private String updater; |
||||
|
|
||||
|
@Schema(description = "是否删除") |
||||
|
private Boolean deleted; |
||||
|
|
||||
|
} |
@ -0,0 +1,52 @@ |
|||||
|
package com.win.framework.mybatis.core.viewobject; |
||||
|
|
||||
|
import io.swagger.v3.oas.annotations.media.Schema; |
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import javax.validation.constraints.NotNull; |
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 基础实体对象 |
||||
|
* |
||||
|
* @author 闻荫源码 |
||||
|
*/ |
||||
|
@Data |
||||
|
public abstract class MasterVO extends BaseVO{ |
||||
|
|
||||
|
@Schema(description = "是否可用", requiredMode = Schema.RequiredMode.REQUIRED) |
||||
|
@NotNull(message = "是否可用不能为空") |
||||
|
private String available; |
||||
|
|
||||
|
@Schema(description = "生效时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime activeTime; |
||||
|
|
||||
|
@Schema(description = "失效时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime expireTime; |
||||
|
|
||||
|
@Schema(description = "备注", example = "你猜") |
||||
|
private String remark; |
||||
|
|
||||
|
@Schema(description = "删除时间") |
||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
||||
|
private LocalDateTime deletionTime; |
||||
|
|
||||
|
@Schema(description = "删除者") |
||||
|
private String deleterId; |
||||
|
|
||||
|
@Schema(description = "扩展属性") |
||||
|
private String extraProperties; |
||||
|
|
||||
|
@Schema(description = "地点ID") |
||||
|
private String siteId; |
||||
|
|
||||
|
@Schema(description = "并发乐观锁") |
||||
|
private Integer ConcurrencyStamp; |
||||
|
|
||||
|
} |
@ -1,99 +1,79 @@ |
|||||
package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; |
package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; |
||||
|
|
||||
import org.springframework.stereotype.Service; |
|
||||
import javax.annotation.Resource; |
|
||||
import org.springframework.validation.annotation.Validated; |
|
||||
|
|
||||
import java.util.*; |
import java.util.*; |
||||
|
import javax.validation.*; |
||||
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; |
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; |
||||
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
||||
import ${PageResultClassName}; |
import ${PageResultClassName}; |
||||
|
|
||||
import ${basePackage}.module.${table.moduleName}.convert.${table.businessName}.${table.className}Convert; |
|
||||
import ${basePackage}.module.${table.moduleName}.dal.mysql.${table.businessName}.${table.className}Mapper; |
|
||||
|
|
||||
import static ${ServiceExceptionUtilClassName}.exception; |
|
||||
import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants.*; |
|
||||
|
|
||||
/** |
/** |
||||
* ${table.classComment} Service |
* ${table.classComment} Service 接口 |
||||
* |
* |
||||
* @author ${table.author} |
* @author ${table.author} |
||||
*/ |
*/ |
||||
@Service |
public interface ${table.className}Service { |
||||
@Validated |
|
||||
public class ${table.className}Service { |
/** |
||||
|
* 创建${table.classComment} |
||||
@Resource |
* |
||||
private ${table.className}Mapper ${classNameVar}Mapper; |
* @param createReqVO 创建信息 |
||||
|
* @return 编号 |
||||
|
*/ |
||||
public ${primaryColumn.javaType} create${simpleClassName}(${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO) { |
${primaryColumn.javaType} create${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO); |
||||
// 插入 |
|
||||
${table.className}DO ${classNameVar} = ${table.className}Convert.INSTANCE.convert(createReqVO); |
/** |
||||
${classNameVar}Mapper.insert(${classNameVar}); |
* 更新${table.classComment} |
||||
// 返回 |
* |
||||
return ${classNameVar}.getId(); |
* @param updateReqVO 更新信息 |
||||
} |
*/ |
||||
|
void update${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO); |
||||
public void update${simpleClassName}(${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) { |
|
||||
// 校验存在 |
/** |
||||
validate${simpleClassName}Exists(updateReqVO.getId()); |
* 删除${table.classComment} |
||||
// 更新 |
* |
||||
${table.className}DO updateObj = ${table.className}Convert.INSTANCE.convert(updateReqVO); |
* @param id 编号 |
||||
${classNameVar}Mapper.updateById(updateObj); |
*/ |
||||
} |
void delete${simpleClassName}(${primaryColumn.javaType} id); |
||||
|
|
||||
public void delete${simpleClassName}(${primaryColumn.javaType} id) { |
/** |
||||
// 校验存在 |
* 获得${table.classComment} |
||||
validate${simpleClassName}Exists(id); |
* |
||||
// 删除 |
* @param id 编号 |
||||
${classNameVar}Mapper.deleteById(id); |
* @return ${table.classComment} |
||||
} |
*/ |
||||
|
${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id); |
||||
private void validate${simpleClassName}Exists(${primaryColumn.javaType} id) { |
|
||||
if (${classNameVar}Mapper.selectById(id) == null) { |
/** |
||||
throw exception(${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS); |
* 获得${table.classComment}列表 |
||||
} |
* |
||||
} |
* @param ids 编号 |
||||
|
* @return ${table.classComment}列表 |
||||
public ${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id) { |
*/ |
||||
return ${classNameVar}Mapper.selectById(id); |
List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids); |
||||
} |
|
||||
|
/** |
||||
public List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids) { |
* 获得${table.classComment}分页 |
||||
return ${classNameVar}Mapper.selectBatchIds(ids); |
* |
||||
} |
* @param pageReqVO 分页查询 |
||||
|
* @return ${table.classComment}分页 |
||||
public PageResult<${table.className}DO> get${simpleClassName}Page(${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO) { |
*/ |
||||
return ${classNameVar}Mapper.selectPage(pageReqVO); |
PageResult<${table.className}DO> get${simpleClassName}Page(${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO); |
||||
} |
|
||||
|
/** |
||||
public List<${table.className}DO> get${simpleClassName}List(${sceneEnum.prefixClass}${table.className}ExportReqVO exportReqVO) { |
* 获得${table.classComment}列表, 用于 Excel 导出 |
||||
return ${classNameVar}Mapper.selectList(exportReqVO); |
* |
||||
} |
* @param exportReqVO 查询条件 |
||||
|
* @return ${table.classComment}列表 |
||||
public List<${table.className}ExcelVO> import${table.className}List(List<${table.className}ExcelVO> datas, Integer mode, boolean updatePart) { |
*/ |
||||
if (CollUtil.isEmpty(datas)) { |
List<${table.className}DO> get${simpleClassName}List(${sceneEnum.prefixClass}${table.className}ExportReqVO exportReqVO); |
||||
throw exception(${simpleClassName_underlineCase.toUpperCase()}_IMPORT_LIST_IS_EMPTY); |
|
||||
} |
/** |
||||
|
* 导入${table.classComment}主信息 |
||||
List<${table.className}ExcelVO> errorList = new ArrayList<>(); |
* |
||||
datas.forEach(item -> { |
* @param datas 导入${table.classComment}主信息列表 |
||||
if(errorList == null){ |
* @param mode 导入模式1更新2追加3覆盖 |
||||
// 判断如果不存在,在进行插入 |
* @param updatePart 是否支持更新 |
||||
${table.className}DO obj = ${classNameVar}Mapper.selectByCode(item.getCode()); |
* @return 导入结果 |
||||
if (obj == null&& mode != 3) { |
*/ |
||||
${classNameVar}Mapper.insert(${table.className}Convert.INSTANCE.convert(item)); |
public List<${table.className}ExcelVO> import${table.className}List(List<${table.className}ExcelVO> datas, Integer mode, boolean updatePart); |
||||
} |
|
||||
else if (obj != null && mode != 2) {// 如果存在,判断是否允许更新 |
|
||||
${table.className}DO ${classNameVar}DO = ${table.className}Convert.INSTANCE.convert(item); |
|
||||
${classNameVar}DO.setId(obj.getId()); |
|
||||
${classNameVar}Mapper.updateById(obj); |
|
||||
} |
|
||||
} |
|
||||
}); |
|
||||
|
|
||||
return errorList; |
|
||||
} |
|
||||
} |
} |
||||
|
@ -1,79 +1,99 @@ |
|||||
package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; |
package ${basePackage}.module.${table.moduleName}.service.${table.businessName}; |
||||
|
|
||||
|
import org.springframework.stereotype.Service; |
||||
|
import javax.annotation.Resource; |
||||
|
import org.springframework.validation.annotation.Validated; |
||||
|
|
||||
import java.util.*; |
import java.util.*; |
||||
import javax.validation.*; |
|
||||
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; |
import ${basePackage}.module.${table.moduleName}.controller.${sceneEnum.basePackage}.${table.businessName}.vo.*; |
||||
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
import ${basePackage}.module.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO; |
||||
import ${PageResultClassName}; |
import ${PageResultClassName}; |
||||
|
|
||||
|
import ${basePackage}.module.${table.moduleName}.convert.${table.businessName}.${table.className}Convert; |
||||
|
import ${basePackage}.module.${table.moduleName}.dal.mysql.${table.businessName}.${table.className}Mapper; |
||||
|
|
||||
|
import static ${ServiceExceptionUtilClassName}.exception; |
||||
|
import static ${basePackage}.module.${table.moduleName}.enums.ErrorCodeConstants.*; |
||||
|
|
||||
/** |
/** |
||||
* ${table.classComment} Service 接口 |
* ${table.classComment} Service |
||||
* |
* |
||||
* @author ${table.author} |
* @author ${table.author} |
||||
*/ |
*/ |
||||
public interface ${table.className}Service { |
@Service |
||||
|
@Validated |
||||
/** |
public class ${table.className}Service { |
||||
* 创建${table.classComment} |
|
||||
* |
@Resource |
||||
* @param createReqVO 创建信息 |
private ${table.className}Mapper ${classNameVar}Mapper; |
||||
* @return 编号 |
|
||||
*/ |
|
||||
${primaryColumn.javaType} create${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO); |
public ${primaryColumn.javaType} create${simpleClassName}(${sceneEnum.prefixClass}${table.className}CreateReqVO createReqVO) { |
||||
|
// 插入 |
||||
/** |
${table.className}DO ${classNameVar} = ${table.className}Convert.INSTANCE.convert(createReqVO); |
||||
* 更新${table.classComment} |
${classNameVar}Mapper.insert(${classNameVar}); |
||||
* |
// 返回 |
||||
* @param updateReqVO 更新信息 |
return ${classNameVar}.getId(); |
||||
*/ |
} |
||||
void update${simpleClassName}(@Valid ${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO); |
|
||||
|
public void update${simpleClassName}(${sceneEnum.prefixClass}${table.className}UpdateReqVO updateReqVO) { |
||||
/** |
// 校验存在 |
||||
* 删除${table.classComment} |
validate${simpleClassName}Exists(updateReqVO.getId()); |
||||
* |
// 更新 |
||||
* @param id 编号 |
${table.className}DO updateObj = ${table.className}Convert.INSTANCE.convert(updateReqVO); |
||||
*/ |
${classNameVar}Mapper.updateById(updateObj); |
||||
void delete${simpleClassName}(${primaryColumn.javaType} id); |
} |
||||
|
|
||||
/** |
public void delete${simpleClassName}(${primaryColumn.javaType} id) { |
||||
* 获得${table.classComment} |
// 校验存在 |
||||
* |
validate${simpleClassName}Exists(id); |
||||
* @param id 编号 |
// 删除 |
||||
* @return ${table.classComment} |
${classNameVar}Mapper.deleteById(id); |
||||
*/ |
} |
||||
${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id); |
|
||||
|
private void validate${simpleClassName}Exists(${primaryColumn.javaType} id) { |
||||
/** |
if (${classNameVar}Mapper.selectById(id) == null) { |
||||
* 获得${table.classComment}列表 |
throw exception(${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS); |
||||
* |
} |
||||
* @param ids 编号 |
} |
||||
* @return ${table.classComment}列表 |
|
||||
*/ |
public ${table.className}DO get${simpleClassName}(${primaryColumn.javaType} id) { |
||||
List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids); |
return ${classNameVar}Mapper.selectById(id); |
||||
|
} |
||||
/** |
|
||||
* 获得${table.classComment}分页 |
public List<${table.className}DO> get${simpleClassName}List(Collection<${primaryColumn.javaType}> ids) { |
||||
* |
return ${classNameVar}Mapper.selectBatchIds(ids); |
||||
* @param pageReqVO 分页查询 |
} |
||||
* @return ${table.classComment}分页 |
|
||||
*/ |
public PageResult<${table.className}DO> get${simpleClassName}Page(${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO) { |
||||
PageResult<${table.className}DO> get${simpleClassName}Page(${sceneEnum.prefixClass}${table.className}PageReqVO pageReqVO); |
return ${classNameVar}Mapper.selectPage(pageReqVO); |
||||
|
} |
||||
/** |
|
||||
* 获得${table.classComment}列表, 用于 Excel 导出 |
public List<${table.className}DO> get${simpleClassName}List(${sceneEnum.prefixClass}${table.className}ExportReqVO exportReqVO) { |
||||
* |
return ${classNameVar}Mapper.selectList(exportReqVO); |
||||
* @param exportReqVO 查询条件 |
} |
||||
* @return ${table.classComment}列表 |
|
||||
*/ |
public List<${table.className}ExcelVO> import${table.className}List(List<${table.className}ExcelVO> datas, Integer mode, boolean updatePart) { |
||||
List<${table.className}DO> get${simpleClassName}List(${sceneEnum.prefixClass}${table.className}ExportReqVO exportReqVO); |
if (CollUtil.isEmpty(datas)) { |
||||
|
throw exception(${simpleClassName_underlineCase.toUpperCase()}_IMPORT_LIST_IS_EMPTY); |
||||
/** |
} |
||||
* 导入${table.classComment}主信息 |
|
||||
* |
List<${table.className}ExcelVO> errorList = new ArrayList<>(); |
||||
* @param datas 导入${table.classComment}主信息列表 |
datas.forEach(item -> { |
||||
* @param mode 导入模式1更新2追加3覆盖 |
if(errorList == null){ |
||||
* @param updatePart 是否支持更新 |
// 判断如果不存在,在进行插入 |
||||
* @return 导入结果 |
${table.className}DO obj = ${classNameVar}Mapper.selectByCode(item.getCode()); |
||||
*/ |
if (obj == null&& mode != 3) { |
||||
public List<${table.className}ExcelVO> import${table.className}List(List<${table.className}ExcelVO> datas, Integer mode, boolean updatePart); |
${classNameVar}Mapper.insert(${table.className}Convert.INSTANCE.convert(item)); |
||||
|
} |
||||
|
else if (obj != null && mode != 2) {// 如果存在,判断是否允许更新 |
||||
|
${table.className}DO ${classNameVar}DO = ${table.className}Convert.INSTANCE.convert(item); |
||||
|
${classNameVar}DO.setId(obj.getId()); |
||||
|
${classNameVar}Mapper.updateById(obj); |
||||
|
} |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
return errorList; |
||||
|
} |
||||
} |
} |
||||
|
@ -1,166 +0,0 @@ |
|||||
package com.win.module.wms.controller.purchasereceiptJob.vo; |
|
||||
|
|
||||
import com.win.framework.common.pojo.PageParam; |
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||
import lombok.Data; |
|
||||
import lombok.EqualsAndHashCode; |
|
||||
import lombok.ToString; |
|
||||
import org.springframework.format.annotation.DateTimeFormat; |
|
||||
|
|
||||
import javax.validation.constraints.NotNull; |
|
||||
import java.math.BigDecimal; |
|
||||
import java.time.LocalDateTime; |
|
||||
import java.util.List; |
|
||||
|
|
||||
import static com.win.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
|
||||
|
|
||||
@Schema(description = "管理后台 - 采购收货任务主接收类接收多个任务状态 Response VO") |
|
||||
@Data |
|
||||
@EqualsAndHashCode(callSuper = true) |
|
||||
@ToString(callSuper = true) |
|
||||
public class PurchasereceiptJobMainRespTypesVO extends PageParam { |
|
||||
|
|
||||
@Schema(description = "申请单号") |
|
||||
private String requestNumber; |
|
||||
|
|
||||
@Schema(description = "发货单号") |
|
||||
private String asnNumber; |
|
||||
|
|
||||
@Schema(description = "要货计划单号") |
|
||||
private String ppNumber; |
|
||||
|
|
||||
@Schema(description = "供应商代码") |
|
||||
private String supplierCode; |
|
||||
|
|
||||
@Schema(description = "到月台代码") |
|
||||
private String toDockCode; |
|
||||
|
|
||||
@Schema(description = "承运商") |
|
||||
private String carrierCode; |
|
||||
|
|
||||
@Schema(description = "运输方式") |
|
||||
private String transferMode; |
|
||||
|
|
||||
@Schema(description = "车牌号") |
|
||||
private String vehiclePlateNumber; |
|
||||
|
|
||||
@Schema(description = "从仓库代码") |
|
||||
private String fromWarehouseCode; |
|
||||
|
|
||||
@Schema(description = "到仓库代码") |
|
||||
private String toWarehouseCode; |
|
||||
|
|
||||
@Schema(description = "申请时间") |
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|
||||
private LocalDateTime[] requestTime; |
|
||||
|
|
||||
@Schema(description = "要求截止时间") |
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|
||||
private LocalDateTime[] requestDueTime; |
|
||||
|
|
||||
@Schema(description = "状态") |
|
||||
private String status; |
|
||||
|
|
||||
@Schema(description = "过期时间") |
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|
||||
private LocalDateTime[] expiredTime; |
|
||||
|
|
||||
@Schema(description = "最后更新时间") |
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|
||||
private LocalDateTime[] updateTime; |
|
||||
|
|
||||
@Schema(description = "最后更新者Id") |
|
||||
private String updater; |
|
||||
|
|
||||
@Schema(description = "状态") |
|
||||
private String jobStageStatus; |
|
||||
|
|
||||
@Schema(description = "优先级") |
|
||||
private Integer priority; |
|
||||
|
|
||||
@Schema(description = "优先级增量") |
|
||||
private Integer priorityIncrement; |
|
||||
|
|
||||
@Schema(description = "部门") |
|
||||
private String departmentCode; |
|
||||
|
|
||||
@Schema(description = "岗位") |
|
||||
private String userPositionCode; |
|
||||
|
|
||||
@Schema(description = "承接人用户ID") |
|
||||
private String acceptUserId; |
|
||||
|
|
||||
@Schema(description = "承接时间") |
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|
||||
private LocalDateTime[] acceptTime; |
|
||||
|
|
||||
@Schema(description = "完成人用户ID") |
|
||||
private String completeUserId; |
|
||||
|
|
||||
@Schema(description = "完成时间") |
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|
||||
private LocalDateTime[] completeTime; |
|
||||
|
|
||||
@Schema(description = "从库位类型范围") |
|
||||
private String fromLocationTypes; |
|
||||
|
|
||||
@Schema(description = "到库位类型范围") |
|
||||
private String toLocationTypes; |
|
||||
|
|
||||
@Schema(description = "单据号") |
|
||||
private String number; |
|
||||
|
|
||||
@Schema(description = "业务类型") |
|
||||
private String businessType; |
|
||||
|
|
||||
@Schema(description = "备注") |
|
||||
private String remark; |
|
||||
|
|
||||
@Schema(description = "创建时间") |
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) |
|
||||
private LocalDateTime[] createTime; |
|
||||
|
|
||||
@Schema(description = "创建者id") |
|
||||
private String creator; |
|
||||
|
|
||||
@Schema(description = "允许修改批次") |
|
||||
private String allowModifyBatch; |
|
||||
|
|
||||
@Schema(description = "从库区代码范围") |
|
||||
private String fromAreaCodes; |
|
||||
|
|
||||
@Schema(description = "到库位代码范围") |
|
||||
private String toAreaCodes; |
|
||||
|
|
||||
@Schema(description = "自动完成") |
|
||||
private String autoComplete; |
|
||||
|
|
||||
@Schema(description = "允许修改库位") |
|
||||
private String allowModifyLocation; |
|
||||
|
|
||||
@Schema(description = "允许修改数量") |
|
||||
private String allowModifyQty; |
|
||||
|
|
||||
@Schema(description = "允许大于推荐数量") |
|
||||
private String allowBiggerQty; |
|
||||
|
|
||||
@Schema(description = "允许小于推荐数量") |
|
||||
private String allowSmallerQty; |
|
||||
|
|
||||
@Schema(description = "允许修改库存状态") |
|
||||
private String allowModifyInventoryStatus; |
|
||||
|
|
||||
@Schema(description = "允许连续扫描") |
|
||||
private String allowContinuousScanning; |
|
||||
|
|
||||
@Schema(description = "允许部分完成") |
|
||||
private String allowPartialComplete; |
|
||||
|
|
||||
@Schema(description = "允许修改箱码") |
|
||||
private String allowModifyPackingNumber; |
|
||||
|
|
||||
@Schema(description = "任务状态list可以为空", requiredMode = Schema.RequiredMode.REQUIRED) |
|
||||
private List types; |
|
||||
|
|
||||
|
|
||||
} |
|
@ -0,0 +1,33 @@ |
|||||
|
package com.win.module.wms.enums.order; |
||||
|
|
||||
|
public enum OrderStatusEnum { |
||||
|
|
||||
|
READY(1), // 准备
|
||||
|
PUBLISHED(2), // 发布
|
||||
|
CLOSED(3), // 关闭
|
||||
|
COMPLETED(4), // 已完成
|
||||
|
; |
||||
|
private final Integer code; |
||||
|
|
||||
|
OrderStatusEnum(int code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public int getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 用状态值获取枚举 |
||||
|
* @param status |
||||
|
* @return |
||||
|
*/ |
||||
|
static OrderStatusEnum getJobStatusEnum(int status) { |
||||
|
for (OrderStatusEnum jobStatusEnum : values()) { |
||||
|
if (jobStatusEnum.getCode() == status) { |
||||
|
return jobStatusEnum; |
||||
|
} |
||||
|
} |
||||
|
return READY; |
||||
|
} |
||||
|
} |
@ -0,0 +1,96 @@ |
|||||
|
package com.win.module.wms.enums.order; |
||||
|
|
||||
|
/** |
||||
|
* 订单状态机 |
||||
|
*/ |
||||
|
public class OrderStatusState { |
||||
|
|
||||
|
/** |
||||
|
* 当前状态枚举 |
||||
|
*/ |
||||
|
private OrderStatusEnum orderStatusEnum; |
||||
|
|
||||
|
/** |
||||
|
* 构造函数,默认创建 |
||||
|
*/ |
||||
|
public OrderStatusState() { |
||||
|
this.orderStatusEnum = OrderStatusEnum.READY; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 构造函数,当前状态 |
||||
|
* @param status |
||||
|
*/ |
||||
|
public OrderStatusState(int status) { |
||||
|
this.orderStatusEnum = OrderStatusEnum.getJobStatusEnum(status); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 构造函数,当前状态枚举 |
||||
|
* @param requestStatusEnum |
||||
|
*/ |
||||
|
public OrderStatusState(OrderStatusEnum requestStatusEnum) { |
||||
|
this.orderStatusEnum = requestStatusEnum; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 发布 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean publish() { |
||||
|
if(this.orderStatusEnum.getCode() == OrderStatusEnum.READY.getCode()) { |
||||
|
this.orderStatusEnum = OrderStatusEnum.PUBLISHED; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 下架 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean withdraw() { |
||||
|
if(this.orderStatusEnum.getCode() == OrderStatusEnum.PUBLISHED.getCode()) { |
||||
|
this.orderStatusEnum = OrderStatusEnum.READY; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 关闭 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean close() { |
||||
|
if(this.orderStatusEnum.getCode() == OrderStatusEnum.READY.getCode()) { |
||||
|
this.orderStatusEnum = OrderStatusEnum.CLOSED; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 打开 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean open() { |
||||
|
if(this.orderStatusEnum.getCode() == OrderStatusEnum.CLOSED.getCode()) { |
||||
|
this.orderStatusEnum = OrderStatusEnum.READY; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取可执行的状态机 |
||||
|
* @return |
||||
|
*/ |
||||
|
public OrderStatusEnum getState() { |
||||
|
return orderStatusEnum; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package com.win.module.wms.enums.plan; |
||||
|
|
||||
|
public enum PlanStatusEnum { |
||||
|
|
||||
|
NEW(1), // 新增
|
||||
|
REVIEWING(2), // 审批中
|
||||
|
AGREED(3), // 审批通过
|
||||
|
REFUSED(4), // 审批驳回
|
||||
|
CLOSED(5), // 关闭
|
||||
|
PUBLISHED(6), // 发布
|
||||
|
COMPLETED(7), // 已完成
|
||||
|
; |
||||
|
private final Integer code; |
||||
|
|
||||
|
PlanStatusEnum(int code) { |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
public int getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 用状态值获取枚举 |
||||
|
* @param status |
||||
|
* @return |
||||
|
*/ |
||||
|
static PlanStatusEnum getJobStatusEnum(int status) { |
||||
|
for (PlanStatusEnum jobStatusEnum : values()) { |
||||
|
if (jobStatusEnum.getCode() == status) { |
||||
|
return jobStatusEnum; |
||||
|
} |
||||
|
} |
||||
|
return NEW; |
||||
|
} |
||||
|
} |
@ -0,0 +1,122 @@ |
|||||
|
package com.win.module.wms.enums.plan; |
||||
|
|
||||
|
/** |
||||
|
* 订单状态机 |
||||
|
*/ |
||||
|
public class PlanStatusState { |
||||
|
|
||||
|
/** |
||||
|
* 当前状态枚举 |
||||
|
*/ |
||||
|
private PlanStatusEnum orderStatusEnum; |
||||
|
|
||||
|
/** |
||||
|
* 构造函数,默认创建 |
||||
|
*/ |
||||
|
public PlanStatusState() { |
||||
|
this.orderStatusEnum = PlanStatusEnum.NEW; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 构造函数,当前状态 |
||||
|
* @param status |
||||
|
*/ |
||||
|
public PlanStatusState(int status) { |
||||
|
this.orderStatusEnum = PlanStatusEnum.getJobStatusEnum(status); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 构造函数,当前状态枚举 |
||||
|
* @param requestStatusEnum |
||||
|
*/ |
||||
|
public PlanStatusState(PlanStatusEnum requestStatusEnum) { |
||||
|
this.orderStatusEnum = requestStatusEnum; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 提交 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean submit() { |
||||
|
if(this.orderStatusEnum.getCode() == PlanStatusEnum.NEW.getCode()) { |
||||
|
this.orderStatusEnum = PlanStatusEnum.REVIEWING; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 审批驳回 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean reject() { |
||||
|
if(this.orderStatusEnum.getCode() == PlanStatusEnum.REVIEWING.getCode()) { |
||||
|
this.orderStatusEnum = PlanStatusEnum.REFUSED; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 审批通过 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean agree() { |
||||
|
if(this.orderStatusEnum.getCode() == PlanStatusEnum.REVIEWING.getCode()) { |
||||
|
this.orderStatusEnum = PlanStatusEnum.AGREED; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 关闭 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean close() { |
||||
|
if(this.orderStatusEnum.getCode() == PlanStatusEnum.NEW.getCode() || this.orderStatusEnum.getCode() == PlanStatusEnum.REVIEWING.getCode() || this.orderStatusEnum.getCode() == PlanStatusEnum.AGREED.getCode() || this.orderStatusEnum.getCode() == PlanStatusEnum.PUBLISHED.getCode()) { |
||||
|
this.orderStatusEnum = PlanStatusEnum.CLOSED; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 审批通过 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean resetting() { |
||||
|
if(this.orderStatusEnum.getCode() == PlanStatusEnum.REFUSED.getCode()) { |
||||
|
this.orderStatusEnum = PlanStatusEnum.NEW; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 执行 |
||||
|
* @return |
||||
|
*/ |
||||
|
public boolean execute() { |
||||
|
if(this.orderStatusEnum.getCode() == PlanStatusEnum.PUBLISHED.getCode()) { |
||||
|
this.orderStatusEnum = PlanStatusEnum.COMPLETED; |
||||
|
return Boolean.TRUE; |
||||
|
} else { |
||||
|
return Boolean.FALSE; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取可执行的状态机 |
||||
|
* @return |
||||
|
*/ |
||||
|
public PlanStatusEnum getState() { |
||||
|
return orderStatusEnum; |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue