Browse Source

新增仓库库区

zouzhuo 3 years ago
parent
commit
8d9de465bf

+ 14 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/domain/TWarehouseAgreement.java

@@ -137,6 +137,20 @@ public class TWarehouseAgreement extends BaseEntity {
     @Excel(name = "类型名称")
     private String fBilltypeName;
 
+    /**
+     * 仓库库区
+     */
+    @Excel(name = "仓库库区")
+    private String fWarehouseInformation;
+
+    public String getfWarehouseInformation() {
+        return fWarehouseInformation;
+    }
+
+    public void setfWarehouseInformation(String fWarehouseInformation) {
+        this.fWarehouseInformation = fWarehouseInformation;
+    }
+
     public String getfBilltypeName() {
         return fBilltypeName;
     }

+ 13 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/warehouseBusiness/service/impl/TWarehouseAgreementServiceImpl.java

@@ -14,6 +14,7 @@ import com.ruoyi.basicData.mapper.TFeesMapper;
 import com.ruoyi.basicData.mapper.TGoodsMapper;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.entity.TWarehouse;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -179,7 +180,7 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
      */
     @Override
     @Transactional
-    public AjaxResult insertTWarehouseAgreement(String agreement, String agreementitems, LoginUser loginUser, int fFeetypeid) {
+    public AjaxResult insertTWarehouseAgreement(String agreement, String agreementitems, String[] warehouse, LoginUser loginUser, int fFeetypeid) {
         Long fPid = null;
         Map<String, Object> map = new HashMap<>();
         TWarehouseAgreement tWarehouseAgreement = JSONArray.parseObject(agreement, TWarehouseAgreement.class);
@@ -196,6 +197,17 @@ public class TWarehouseAgreementServiceImpl implements ITWarehouseAgreementServi
             tWarehouseAgreement.setfBillstatus("2"); // 暂存
             tWarehouseAgreementMapper.insertTWarehouseAgreement(tWarehouseAgreement);
             fPid = tWarehouseAgreement.getfId();
+
+            //仓库选择 f_warehouse_information
+            String wares = StringUtils.join(warehouse, ",");
+            TWarehouseAgreement twarehouse = JSONArray.parseObject(wares, TWarehouseAgreement.class);
+            List<TWarehouseAgreement> tWarehouses = new ArrayList<>();
+            for (TWarehouseAgreement tWarehouseone : tWarehouses) {
+                tWarehouseone.setfWarehouseInformation(String.valueOf(twarehouse));
+            }
+            tWarehouseAgreementMapper.insertTWarehouseAgreement(twarehouse);
+
+
         } else {
             fPid = tWarehouseAgreement.getfId();
             tWarehouseAgreement.setfBillstatus("2");

+ 5 - 1
ruoyi-warehouse/src/main/resources/mapper/warehouseBusiness/TWarehouseAgreementMapper.xml

@@ -30,6 +30,7 @@
         <result property="fDc" column="f_dc"/>
         <result property="fBilltype" column="f_billtype"/>
         <result property="fBilltypeName" column="f_billtype_name"/>
+        <result property="fWarehouseBnformation" column="f_warehouse_information"/>
     </resultMap>
 
     <sql id="selectTWarehouseAgreementVo">
@@ -57,7 +58,8 @@
                f_task_type,
                f_dc,
                f_billtype,
-               f_billtype_name
+               f_billtype_name,
+               f_warehouse_information
         from t_warehouse_agreement
     </sql>
 
@@ -166,6 +168,7 @@
             <if test="fDc != null">f_dc,</if>
             <if test="fBilltype != null">f_billtype,</if>
             <if test="fBilltypeName != null">f_billtype_name,</if>
+            <if test="fWarehouseInformation != null">f_warehouse_information,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="fBillno != null and fBillno != ''">#{fBillno},</if>
@@ -192,6 +195,7 @@
             <if test="fDc != null">#{fDc},</if>
             <if test="fBilltype != null">#{fBilltype},</if>
             <if test="fBilltypeName != null">#{fBilltypeName},</if>
+            <if test="fWarehouseInformation != null">#{fWarehouseInformation}</if>
         </trim>
     </insert>