xiachuang 1 year ago
parent
commit
f4e33d9f2a

+ 2 - 1
.gitignore

@@ -33,4 +33,5 @@ build/
 .vscode/
 
 ### logs ###
-logs/
+logs/
+/src/test/resources/generator/generatorConfig.xml

+ 2 - 7
pom.xml

@@ -117,13 +117,8 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-resources-plugin</artifactId>
-                <configuration><encoding>UTF-8</encoding>
-                    <!-- 过滤后缀为pem、pfx的证书文件 -->
-                    <nonFilteredFileExtensions>
-                        <nonFilteredFileExtension>cer</nonFilteredFileExtension>
-                        <nonFilteredFileExtension>pem</nonFilteredFileExtension>
-                        <nonFilteredFileExtension>pfx</nonFilteredFileExtension>
-                    </nonFilteredFileExtensions>
+                <configuration>
+                    <encoding>UTF-8</encoding>
                 </configuration>
             </plugin>
 

+ 42 - 0
src/main/java/cn/superdesk/app/inventory/common/enums/InventoryOperationTypeEnum.java

@@ -0,0 +1,42 @@
+package cn.superdesk.app.inventory.common.enums;
+
+/**
+ * @author xc
+ * @since 2023/11/21 09:05
+ */
+public enum InventoryOperationTypeEnum {
+    采购入库(1, "采购入库"),
+    采购退货(2, "采购退货"),
+    调拨入库(3, "调拨入库"),
+    调拨出库(4, "调拨出库"),
+    其他入库(5, "其他入库"),
+    其他出库(6, "其他出库"),
+    ;
+
+
+    private final Integer code;
+    private final String desc;
+
+
+    InventoryOperationTypeEnum(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public static InventoryOperationTypeEnum getByCode(Integer code) {
+        for (InventoryOperationTypeEnum value : InventoryOperationTypeEnum.values()) {
+            if (value.getCode().equals(code)) {
+                return value;
+            }
+        }
+        return null;
+    }
+}

+ 200 - 0
src/main/java/cn/superdesk/app/inventory/dao/entity/InventoryOperationDetailEntity.java

@@ -0,0 +1,200 @@
+package cn.superdesk.app.inventory.dao.entity;
+
+import cn.superdesk.libs.mybatis.core.BaseEntity;
+import javax.persistence.*;
+
+@Table(name = "tb_inventory_operation_detail")
+public class InventoryOperationDetailEntity extends BaseEntity {
+    /**
+     * 自增主键
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 单据号
+     */
+    @Column(name = "doc_no")
+    private String docNo;
+
+    /**
+     * 商品id
+     */
+    @Column(name = "product_id")
+    private Integer productId;
+
+    /**
+     * 商品名称
+     */
+    @Column(name = "product_name")
+    private String productName;
+
+    /**
+     * 商品条形码
+     */
+    @Column(name = "product_code")
+    private String productCode;
+
+    /**
+     * 库存变动数
+     */
+    @Column(name = "inventory_change_quantity")
+    private Integer inventoryChangeQuantity;
+
+    /**
+     * 变动前库存数
+     */
+    @Column(name = "quantity_before_update")
+    private Integer quantityBeforeUpdate;
+
+    /**
+     * 变动后库存
+     */
+    @Column(name = "quantity_after_update")
+    private Integer quantityAfterUpdate;
+
+    /**
+     * 获取自增主键
+     *
+     * @return id - 自增主键
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 设置自增主键
+     *
+     * @param id 自增主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取单据号
+     *
+     * @return doc_no - 单据号
+     */
+    public String getDocNo() {
+        return docNo;
+    }
+
+    /**
+     * 设置单据号
+     *
+     * @param docNo 单据号
+     */
+    public void setDocNo(String docNo) {
+        this.docNo = docNo;
+    }
+
+    /**
+     * 获取商品id
+     *
+     * @return product_id - 商品id
+     */
+    public Integer getProductId() {
+        return productId;
+    }
+
+    /**
+     * 设置商品id
+     *
+     * @param productId 商品id
+     */
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    /**
+     * 获取商品名称
+     *
+     * @return product_name - 商品名称
+     */
+    public String getProductName() {
+        return productName;
+    }
+
+    /**
+     * 设置商品名称
+     *
+     * @param productName 商品名称
+     */
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    /**
+     * 获取商品条形码
+     *
+     * @return product_code - 商品条形码
+     */
+    public String getProductCode() {
+        return productCode;
+    }
+
+    /**
+     * 设置商品条形码
+     *
+     * @param productCode 商品条形码
+     */
+    public void setProductCode(String productCode) {
+        this.productCode = productCode;
+    }
+
+    /**
+     * 获取库存变动数
+     *
+     * @return inventory_change_quantity - 库存变动数
+     */
+    public Integer getInventoryChangeQuantity() {
+        return inventoryChangeQuantity;
+    }
+
+    /**
+     * 设置库存变动数
+     *
+     * @param inventoryChangeQuantity 库存变动数
+     */
+    public void setInventoryChangeQuantity(Integer inventoryChangeQuantity) {
+        this.inventoryChangeQuantity = inventoryChangeQuantity;
+    }
+
+    /**
+     * 获取变动前库存数
+     *
+     * @return quantity_before_update - 变动前库存数
+     */
+    public Integer getQuantityBeforeUpdate() {
+        return quantityBeforeUpdate;
+    }
+
+    /**
+     * 设置变动前库存数
+     *
+     * @param quantityBeforeUpdate 变动前库存数
+     */
+    public void setQuantityBeforeUpdate(Integer quantityBeforeUpdate) {
+        this.quantityBeforeUpdate = quantityBeforeUpdate;
+    }
+
+    /**
+     * 获取变动后库存
+     *
+     * @return quantity_after_update - 变动后库存
+     */
+    public Integer getQuantityAfterUpdate() {
+        return quantityAfterUpdate;
+    }
+
+    /**
+     * 设置变动后库存
+     *
+     * @param quantityAfterUpdate 变动后库存
+     */
+    public void setQuantityAfterUpdate(Integer quantityAfterUpdate) {
+        this.quantityAfterUpdate = quantityAfterUpdate;
+    }
+}

+ 344 - 0
src/main/java/cn/superdesk/app/inventory/dao/entity/InventoryOperationEntity.java

@@ -0,0 +1,344 @@
+package cn.superdesk.app.inventory.dao.entity;
+
+import cn.superdesk.libs.mybatis.core.BaseEntity;
+import java.util.Date;
+import javax.persistence.*;
+
+@Table(name = "tb_inventory_operation")
+public class InventoryOperationEntity extends BaseEntity {
+    /**
+     * 自增主键
+     */
+    @Id
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    private Integer id;
+
+    /**
+     * 运营中心id
+     */
+    @Column(name = "comp_id")
+    private Integer compId;
+
+    /**
+     * 运营中心名称
+     */
+    @Column(name = "comp_name")
+    private String compName;
+
+    /**
+     * 项目id
+     */
+    @Column(name = "org_id")
+    private Integer orgId;
+
+    /**
+     * 项目名称
+     */
+    @Column(name = "org_name")
+    private String orgName;
+
+    /**
+     * 单据号
+     */
+    @Column(name = "doc_no")
+    private String docNo;
+
+    /**
+     * 商户id
+     */
+    @Column(name = "merchant_id")
+    private Integer merchantId;
+
+    /**
+     * 商户名称
+     */
+    @Column(name = "merchant_name")
+    private Integer merchantName;
+
+    /**
+     * 操作类型
+     */
+    @Column(name = "operation_type")
+    private Integer operationType;
+
+    /**
+     * 商品品类数
+     */
+    @Column(name = "category_count")
+    private Integer categoryCount;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 操作人id
+     */
+    @Column(name = "operator_id")
+    private Integer operatorId;
+
+    /**
+     * 操作人姓名
+     */
+    @Column(name = "operator_name")
+    private String operatorName;
+
+    /**
+     * 创建时间
+     */
+    @Column(name = "create_time")
+    private Date createTime;
+
+    /**
+     * 获取自增主键
+     *
+     * @return id - 自增主键
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * 设置自增主键
+     *
+     * @param id 自增主键
+     */
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    /**
+     * 获取运营中心id
+     *
+     * @return comp_id - 运营中心id
+     */
+    public Integer getCompId() {
+        return compId;
+    }
+
+    /**
+     * 设置运营中心id
+     *
+     * @param compId 运营中心id
+     */
+    public void setCompId(Integer compId) {
+        this.compId = compId;
+    }
+
+    /**
+     * 获取运营中心名称
+     *
+     * @return comp_name - 运营中心名称
+     */
+    public String getCompName() {
+        return compName;
+    }
+
+    /**
+     * 设置运营中心名称
+     *
+     * @param compName 运营中心名称
+     */
+    public void setCompName(String compName) {
+        this.compName = compName;
+    }
+
+    /**
+     * 获取项目id
+     *
+     * @return org_id - 项目id
+     */
+    public Integer getOrgId() {
+        return orgId;
+    }
+
+    /**
+     * 设置项目id
+     *
+     * @param orgId 项目id
+     */
+    public void setOrgId(Integer orgId) {
+        this.orgId = orgId;
+    }
+
+    /**
+     * 获取项目名称
+     *
+     * @return org_name - 项目名称
+     */
+    public String getOrgName() {
+        return orgName;
+    }
+
+    /**
+     * 设置项目名称
+     *
+     * @param orgName 项目名称
+     */
+    public void setOrgName(String orgName) {
+        this.orgName = orgName;
+    }
+
+    /**
+     * 获取单据号
+     *
+     * @return doc_no - 单据号
+     */
+    public String getDocNo() {
+        return docNo;
+    }
+
+    /**
+     * 设置单据号
+     *
+     * @param docNo 单据号
+     */
+    public void setDocNo(String docNo) {
+        this.docNo = docNo;
+    }
+
+    /**
+     * 获取商户id
+     *
+     * @return merchant_id - 商户id
+     */
+    public Integer getMerchantId() {
+        return merchantId;
+    }
+
+    /**
+     * 设置商户id
+     *
+     * @param merchantId 商户id
+     */
+    public void setMerchantId(Integer merchantId) {
+        this.merchantId = merchantId;
+    }
+
+    /**
+     * 获取商户名称
+     *
+     * @return merchant_name - 商户名称
+     */
+    public Integer getMerchantName() {
+        return merchantName;
+    }
+
+    /**
+     * 设置商户名称
+     *
+     * @param merchantName 商户名称
+     */
+    public void setMerchantName(Integer merchantName) {
+        this.merchantName = merchantName;
+    }
+
+    /**
+     * 获取操作类型
+     *
+     * @return operation_type - 操作类型
+     */
+    public Integer getOperationType() {
+        return operationType;
+    }
+
+    /**
+     * 设置操作类型
+     *
+     * @param operationType 操作类型
+     */
+    public void setOperationType(Integer operationType) {
+        this.operationType = operationType;
+    }
+
+    /**
+     * 获取商品品类数
+     *
+     * @return category_count - 商品品类数
+     */
+    public Integer getCategoryCount() {
+        return categoryCount;
+    }
+
+    /**
+     * 设置商品品类数
+     *
+     * @param categoryCount 商品品类数
+     */
+    public void setCategoryCount(Integer categoryCount) {
+        this.categoryCount = categoryCount;
+    }
+
+    /**
+     * 获取备注
+     *
+     * @return remark - 备注
+     */
+    public String getRemark() {
+        return remark;
+    }
+
+    /**
+     * 设置备注
+     *
+     * @param remark 备注
+     */
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    /**
+     * 获取操作人id
+     *
+     * @return operator_id - 操作人id
+     */
+    public Integer getOperatorId() {
+        return operatorId;
+    }
+
+    /**
+     * 设置操作人id
+     *
+     * @param operatorId 操作人id
+     */
+    public void setOperatorId(Integer operatorId) {
+        this.operatorId = operatorId;
+    }
+
+    /**
+     * 获取操作人姓名
+     *
+     * @return operator_name - 操作人姓名
+     */
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    /**
+     * 设置操作人姓名
+     *
+     * @param operatorName 操作人姓名
+     */
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    /**
+     * 获取创建时间
+     *
+     * @return create_time - 创建时间
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * 设置创建时间
+     *
+     * @param createTime 创建时间
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 7 - 0
src/main/java/cn/superdesk/app/inventory/dao/mapper/InventoryOperationDetailEntityMapper.java

@@ -0,0 +1,7 @@
+package cn.superdesk.app.inventory.dao.mapper;
+
+import cn.superdesk.app.base.dao.CustomBaseMapper;
+import cn.superdesk.app.inventory.dao.entity.InventoryOperationDetailEntity;
+
+public interface InventoryOperationDetailEntityMapper extends CustomBaseMapper<InventoryOperationDetailEntity> {
+}

+ 7 - 0
src/main/java/cn/superdesk/app/inventory/dao/mapper/InventoryOperationEntityMapper.java

@@ -0,0 +1,7 @@
+package cn.superdesk.app.inventory.dao.mapper;
+
+import cn.superdesk.app.base.dao.CustomBaseMapper;
+import cn.superdesk.app.inventory.dao.entity.InventoryOperationEntity;
+
+public interface InventoryOperationEntityMapper extends CustomBaseMapper<InventoryOperationEntity> {
+}

+ 17 - 0
src/main/resources/mapper/InventoryOperationDetailEntityMapper.xml

@@ -0,0 +1,17 @@
+<?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="cn.superdesk.app.inventory.dao.mapper.InventoryOperationDetailEntityMapper" >
+  <resultMap id="BaseResultMap" type="cn.superdesk.app.inventory.dao.entity.InventoryOperationDetailEntity" >
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <id column="id" property="id" jdbcType="INTEGER" />
+    <result column="doc_no" property="docNo" jdbcType="VARCHAR" />
+    <result column="product_id" property="productId" jdbcType="INTEGER" />
+    <result column="product_name" property="productName" jdbcType="VARCHAR" />
+    <result column="product_code" property="productCode" jdbcType="VARCHAR" />
+    <result column="inventory_change_quantity" property="inventoryChangeQuantity" jdbcType="INTEGER" />
+    <result column="quantity_before_update" property="quantityBeforeUpdate" jdbcType="INTEGER" />
+    <result column="quantity_after_update" property="quantityAfterUpdate" jdbcType="INTEGER" />
+  </resultMap>
+</mapper>

+ 23 - 0
src/main/resources/mapper/InventoryOperationEntityMapper.xml

@@ -0,0 +1,23 @@
+<?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="cn.superdesk.app.inventory.dao.mapper.InventoryOperationEntityMapper" >
+  <resultMap id="BaseResultMap" type="cn.superdesk.app.inventory.dao.entity.InventoryOperationEntity" >
+    <!--
+      WARNING - @mbg.generated
+    -->
+    <id column="id" property="id" jdbcType="INTEGER" />
+    <result column="comp_id" property="compId" jdbcType="INTEGER" />
+    <result column="comp_name" property="compName" jdbcType="VARCHAR" />
+    <result column="org_id" property="orgId" jdbcType="INTEGER" />
+    <result column="org_name" property="orgName" jdbcType="VARCHAR" />
+    <result column="doc_no" property="docNo" jdbcType="VARCHAR" />
+    <result column="merchant_id" property="merchantId" jdbcType="INTEGER" />
+    <result column="merchant_name" property="merchantName" jdbcType="INTEGER" />
+    <result column="operation_type" property="operationType" jdbcType="TINYINT" />
+    <result column="category_count" property="categoryCount" jdbcType="INTEGER" />
+    <result column="remark" property="remark" jdbcType="VARCHAR" />
+    <result column="operator_id" property="operatorId" jdbcType="INTEGER" />
+    <result column="operator_name" property="operatorName" jdbcType="VARCHAR" />
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+</mapper>

+ 0 - 55
src/test/resources/generator/generatorConfig.xml

@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE generatorConfiguration
-        PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
-        "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
-
-<generatorConfiguration>
-
-    <context id="Mysql" targetRuntime="MyBatis3Simple"
-             defaultModelType="flat">
-
-        <!--property*,-->
-        <property name="beginningDelimiter" value="`"/>
-        <property name="endingDelimiter" value="`"/>
-
-        <!--plugin*,-->
-        <!-- 为继承的BaseMapper接口添加对应的实现类 -->
-        <plugin type="tk.mybatis.mapper.generator.MapperPlugin">
-            <property name="mappers" value="cn.superdesk.app.base.dao.CustomBaseMapper"/>
-        </plugin>
-
-        <!--commentGenerator?,-->
-        <!--<commentGenerator type="mybatis.generator.MyCommentGenerator"></commentGenerator>-->
-        <!--jdbcConnection,-->
-        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
-                        connectionURL="jdbc:mysql://112.74.48.214:53307/flashdeliver_dev?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull&amp;tinyInt1isBit=false&amp;useSSL=false"
-                        userId="root"
-                        password="service_newbak2019">
-        </jdbcConnection>
-
-        <!--javaTypeResolver?,-->
-        <javaTypeResolver type="mybatis.generator.MyJavaTypeResolver"></javaTypeResolver>
-
-        <!--javaModelGenerator,-->
-        <javaModelGenerator targetPackage="cn.superdesk.app.inventory.dao.entity"
-                            targetProject="/Users/story/Developer/java/superdesk-inventory-management/src/main/java">
-            <property name="rootClass" value="cn.superdesk.libs.mybatis.core.BaseEntity"/>
-        </javaModelGenerator>
-
-        <!--sqlMapGenerator?,-->
-        <sqlMapGenerator targetPackage="mapper"
-                         targetProject="/Users/story/Developer/java/superdesk-inventory-management/src/main/resources"/>
-
-        <!--javaClientGenerator?,-->
-        <javaClientGenerator targetPackage="cn.superdesk.app.inventory.dao.mapper"
-                             targetProject="/Users/story/Developer/java/superdesk-inventory-management/src/main/java"
-                             type="XMLMAPPER"/>
-
-        <!--table+-->
-        <table tableName="ims_flashdeliver_product_inventory" domainObjectName="ProductInventoryEntity">
-            <generatedKey column="id" sqlStatement="Mysql" identity="true"/>
-        </table>
-        
-    </context>
-
-</generatorConfiguration>