소스 검색

[CODE]: 基础资料仓库添加字段

maxianghua 4 년 전
부모
커밋
0d8cb3f8b9

+ 39 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/domain/TWarehouse.java

@@ -35,6 +35,18 @@ public class TWarehouse extends BaseEntity
     @Excel(name = "库容")
     private BigDecimal fTotalgross;
 
+    /** 联系人 */
+    @Excel(name = "联系人")
+    private String fContacts;
+
+    /** 电话 */
+    @Excel(name = "电话")
+    private String fTel;
+
+    /** 是否计费 */
+    @Excel(name = "是否计费:0 计费,1 不计费 ")
+    private Long fCharg;
+
     /** 状态,默认 T ,正常T 停用F 下拉选择 */
     @Excel(name = "状态,默认 T ,正常T 停用F 下拉选择")
     private String fStatus;
@@ -106,6 +118,30 @@ public class TWarehouse extends BaseEntity
         return delFlag;
     }
 
+    public String getfContacts() {
+        return fContacts;
+    }
+
+    public void setfContacts(String fContacts) {
+        this.fContacts = fContacts;
+    }
+
+    public String getfTel() {
+        return fTel;
+    }
+
+    public void setfTel(String fTel) {
+        this.fTel = fTel;
+    }
+
+    public Long getfCharg() {
+        return fCharg;
+    }
+
+    public void setfCharg(Long fCharg) {
+        this.fCharg = fCharg;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -114,6 +150,9 @@ public class TWarehouse extends BaseEntity
                 .append("fName", getfName())
                 .append("fAddr", getfAddr())
                 .append("fTotalgross", getfTotalgross())
+                .append("fContacts", getfContacts())
+                .append("fTel", getfTel())
+                .append("fCharg", getfCharg())
                 .append("fStatus", getfStatus())
                 .append("delFlag", getDelFlag())
                 .append("createBy", getCreateBy())

+ 4 - 0
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseAreaServiceImpl.java

@@ -11,6 +11,8 @@ import com.ruoyi.warehouseBusiness.mapper.TWarehouseBillsMapper;
 import com.ruoyi.warehouseBusiness.mapper.TWarehousebillsitemsMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
 
 import java.util.List;
 
@@ -82,6 +84,7 @@ public class TWarehouseAreaServiceImpl implements ITWarehouseAreaService {
      * @return 结果
      */
     @Override
+    @Transactional
     public AjaxResult deleteTWarehouseAreaByIds(Long[] fId) {
         //  tWarehouseAreaMapper.deleteTWarehouseAreaByIds(fId);
         for(Long id:fId){
@@ -89,6 +92,7 @@ public class TWarehouseAreaServiceImpl implements ITWarehouseAreaService {
             tWarehousebillsitems.setfWarehouselocid(id);
             List<TWarehousebillsitems> warehousebillsitemsList1 =tWarehousebillsitemsMapper.selectTWarehousebillsitemsList(tWarehousebillsitems);
             if(warehousebillsitemsList1!=null && !warehousebillsitemsList1.isEmpty()){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                 return AjaxResult.error("库区有货物不可删除");
             }
             tWarehouseAreaMapper.deleteTWarehouseAreaById(id);

+ 7 - 1
ruoyi-warehouse/src/main/java/com/ruoyi/basicData/service/impl/TWarehouseServiceImpl.java

@@ -99,7 +99,7 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
         if (StringUtils.isEmpty(tWarehouse)) {
             return AjaxResult.error("提交失败:仓库信息为空");
         }
-        if ( StringUtils.isEmpty(tWarehouseArea) ) {
+        if ( StringUtils.isEmpty(tWarehouseArea) && !"[{}]".equals(tWarehouseArea) ) {
             return AjaxResult.error("提交失败:库区为空");
         }
         Long fPid = null;
@@ -128,6 +128,12 @@ public class TWarehouseServiceImpl implements ITWarehouseService {
             tWarehouseAreaMapper.deleteTWarehouseAreaByTWarehoused(fPid);
         }
         for (TWarehouseArea cc : tWarehouseAreaList) {
+            if( StringUtils.isNull(cc.getfNo())  ||
+                StringUtils.isNull(cc.getfName()) ||
+                StringUtils.isNull(cc.getfAddr()) ){
+                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+                return AjaxResult.error("请完善库区明细信息");
+            }
             cc.setfWarehouseid(fPid);
             cc.setfStatus("0");
             cc.setCreateBy(loginUser.getUser().getUserName());

+ 16 - 1
ruoyi-warehouse/src/main/resources/mapper/basicData/TWarehouseMapper.xml

@@ -10,6 +10,9 @@
         <result property="fName"    column="f_name"    />
         <result property="fAddr"    column="f_addr"    />
         <result property="fTotalgross"    column="f_totalgross"    />
+        <result property="fContacts"    column="f_contacts"    />
+        <result property="fTel"    column="f_tel"    />
+        <result property="fCharg"    column="f_charg"    />
         <result property="fStatus"    column="f_status"    />
         <result property="delFlag"    column="del_flag"    />
         <result property="createBy"    column="create_by"    />
@@ -20,7 +23,7 @@
     </resultMap>
 
     <sql id="selectTWarehouseVo">
-        select f_id, f_no, f_name, f_addr, f_totalgross, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_warehouse
+        select f_id, f_no, f_name, f_addr, f_totalgross,f_contacts, f_tel, f_charg, f_status, del_flag, create_by, create_time, update_by, update_time, remark from t_warehouse
     </sql>
 
     <select id="selectTWarehouseList" parameterType="TWarehouse" resultMap="TWarehouseResult">
@@ -30,6 +33,9 @@
             <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
             <if test="fAddr != null  and fAddr != ''"> and f_addr like concat('%', #{fAddr}, '%')</if>
             <if test="fTotalgross != null "> and f_totalgross like concat('%', #{fTotalgross}, '%')</if>
+            <if test="fContacts != null  and fContacts != ''"> and f_contacts = #{fContacts}</if>
+            <if test="fTel != null  and fTel != ''"> and f_tel = #{fTel}</if>
+            <if test="fCharg != null "> and f_charg = #{fCharg}</if>
             <if test="fStatus != null  and fStatus != ''"> and f_status = #{fStatus}</if>
         </where>
     </select>
@@ -46,6 +52,9 @@
             <if test="fName != null and fName != ''">f_name,</if>
             <if test="fAddr != null and fAddr != ''">f_addr,</if>
             <if test="fTotalgross != null">f_totalgross,</if>
+            <if test="fContacts != null">f_contacts,</if>
+            <if test="fTel != null">f_tel,</if>
+            <if test="fCharg != null">f_charg,</if>
             <if test="fStatus != null">f_status,</if>
             <if test="delFlag != null">del_flag,</if>
             <if test="createBy != null">create_by,</if>
@@ -59,6 +68,9 @@
             <if test="fName != null and fName != ''">#{fName},</if>
             <if test="fAddr != null and fAddr != ''">#{fAddr},</if>
             <if test="fTotalgross != null">#{fTotalgross},</if>
+            <if test="fContacts != null">#{fContacts},</if>
+            <if test="fTel != null">#{fTel},</if>
+            <if test="fCharg != null">#{fCharg},</if>
             <if test="fStatus != null">#{fStatus},</if>
             <if test="delFlag != null">#{delFlag},</if>
             <if test="createBy != null">#{createBy},</if>
@@ -76,6 +88,9 @@
             <if test="fName != null and fName != ''">f_name = #{fName},</if>
             <if test="fAddr != null and fAddr != ''">f_addr = #{fAddr},</if>
             <if test="fTotalgross != null">f_totalgross = #{fTotalgross},</if>
+            <if test="fContacts != null">f_contacts = #{fContacts},</if>
+            <if test="fTel != null">f_tel = #{fTel},</if>
+            <if test="fCharg != null">f_charg = #{fCharg},</if>
             <if test="fStatus != null">f_status = #{fStatus},</if>
             <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="createBy != null">create_by = #{createBy},</if>