Browse Source

修改样式,修改文件上传,WOfa新增返回字段

wrh 2 years ago
parent
commit
4f887e4d1f

+ 9 - 5
nngkxxdp/src/main/java/com/example/nngkxxdp/service/impl/FoodServiceImpl.java

@@ -55,7 +55,9 @@ public class FoodServiceImpl implements FoodService {
         if (Blank.isNotEmpty(files)) {
             File pathFile = new File(location);
             if (!pathFile.isDirectory()) {
-                pathFile.mkdirs();
+                if (!pathFile.mkdirs()) {
+                    return SendUtil.send(false, ConstStr.ADD_FAILED, "");
+                }
             }
             ArrayList<String> picPathList = new ArrayList<>();
             for (MultipartFile file : files) {
@@ -136,7 +138,9 @@ public class FoodServiceImpl implements FoodService {
         if (Blank.isNotEmpty(files)) {
             File pathFile = new File(location);
             if (!pathFile.isDirectory()) {
-                pathFile.mkdirs();
+                if (!pathFile.mkdirs()) {
+                    return SendUtil.send(false, ConstStr.UPDATEUSER_FAILED, "");
+                }
             }
             for (MultipartFile file : files) {
                 //获取上传过来的文件名
@@ -144,20 +148,20 @@ public class FoodServiceImpl implements FoodService {
                 file.transferTo(temporaryFile);
                 String type = FileTypeUtil.getType(temporaryFile);
                 if (!(type.equals("jpg") || type.equals("png") || type.equals("bmp"))) {
-                    return SendUtil.send(false, ConstStr.ADD_FAILED, "上传的格式必须是jpg或png或bmp");
+                    return SendUtil.send(false, ConstStr.UPDATEUSER_FAILED, "上传的格式必须是jpg或png或bmp");
                 }
                 String newName = (new Date()).getTime() + ((int) (Math.random() * 9000) + 1000) + "." + type;
                 String filePath = location + newName;
                 File newFile = new File(filePath);
                 if (!temporaryFile.renameTo(newFile)) {
-                    return SendUtil.send(false, ConstStr.ADD_FAILED, "");
+                    return SendUtil.send(false, ConstStr.UPDATEUSER_FAILED, "");
                 }
                 // 增加数据到s_file表
                 SFile sFile = new SFile();
                 sFile.setPath(newName);
                 sFile.setSuffix(type);
                 if (fileDao.addFile(sFile) <= 0) {
-                    return SendUtil.send(false, ConstStr.ADD_FAILED, "");
+                    return SendUtil.send(false, ConstStr.UPDATEUSER_FAILED, "");
                 }
                 newPicList.add(sFile.getId().toString());
             }

+ 6 - 2
nngkxxdp/src/main/resources/mapper/WOfaDao.xml

@@ -17,14 +17,18 @@
         id,
         w_name AS wName,
         update_time AS updateTime,
-        w_type AS wType
+        w_type AS wType,
+        staff_name AS staffName,
+        staff_phone AS staffPhone,
+        lead_name AS leadName,
+        lead_phone AS leadPhone
         FROM w_ofa
         <where>
             <if test="wName != null">
                 AND w_name LIKE CONCAT('%', #{wName}, '%')
             </if>
         </where>
-        ORDER BY w_type
+        ORDER BY w_type, update_time Desc
         LIMIT #{startRows},#{limit}
     </select>
 

+ 43 - 11
nngkxxdp/src/main/resources/static/naqwzsjtj/naqwzsjtj/src/views/newMediaMatrix/WOfa.vue

@@ -1,14 +1,13 @@
 <template>
     <div class="yxnaContent">
         <!--操作栏-->
-        <div style="display: flex;justify-content: space-between;margin-bottom: 10px">
+        <div style="display: flex; justify-content: space-between; margin-bottom: 10px">
             <div>
-                <el-button type="primary" class="add" @click="upload.open = true;upload.fileList = []">导入
-                </el-button>
+                <el-button type="primary" class="add" @click="upload.open = true;upload.fileList = [];">导入</el-button>
             </div>
             <div style="display: flex">
                 <el-input v-model.trim="query.wName" clearable placeholder="请输入公众号名称"
-                    style="margin: 0 10px;width: 200px" />
+                    style="margin: 0 10px; width: 200px" />
                 <el-button type="primary" class="search" @click="searchData">搜索</el-button>
                 <el-button type="primary" class="search" @click="reset" style="margin-left: 5px">重置</el-button>
             </div>
@@ -23,7 +22,11 @@
                 </template>
             </el-table-column>
             <el-table-column prop="wname" label="公众号名称" />
-            <el-table-column prop="wtype" :show-overflow-tooltip="true" label="类型" />
+            <el-table-column prop="wtype" label="类型" />
+            <el-table-column prop="staffName" label="工作人员" />
+            <el-table-column prop="staffPhone" label="工作人员电话" />
+            <el-table-column prop="leadName" label="领导" />
+            <el-table-column prop="leadPhone" label="领导电话" />
             <el-table-column prop="updateTime" label="最近更新时间" />
             <el-table-column label="操作" width="150">
                 <template slot-scope="scope">
@@ -41,22 +44,52 @@
         <!-- 编辑 -->
         <el-dialog :visible.sync="workDialog" width="80%" class="detailDialog" :close-on-click-modal="false" top="40px">
             <div slot="title">
-                <div class="addTitle">{{workTitle}}</div>
+                <div class="addTitle">{{ workTitle }}</div>
             </div>
-            <div style="height:65vh;overflow: auto;padding-right: 20px">
+            <div style="height: 65vh; overflow: auto; padding-right: 20px">
                 <el-form :model="postManagement" label-width="140px">
                     <el-row>
                         <el-col :span="12">
                             <el-form-item label="公众号名称" prop="wname">
-                                <el-input v-model="postManagement.wname" disabled>
-                                </el-input>
+                                <el-input v-model="postManagement.wname" disabled> </el-input>
                             </el-form-item>
                         </el-col>
                     </el-row>
                     <el-row>
                         <el-col :span="12">
                             <el-form-item label="类型" prop="wtype">
-                                <el-input v-model="postManagement.wtype" disabled>
+                                <el-input v-model="postManagement.wtype" disabled> </el-input>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="工作人员" prop="staffName">
+                                <el-input v-model="postManagement.staffName" disabled>
+                                </el-input>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="工作人员电话" prop="staffPhone">
+                                <el-input v-model="postManagement.staffPhone" disabled>
+                                </el-input>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="领导" prop="leadName">
+                                <el-input v-model="postManagement.leadName" disabled>
+                                </el-input>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                    <el-row>
+                        <el-col :span="12">
+                            <el-form-item label="领导电话" prop="leadPhone">
+                                <el-input v-model="postManagement.leadPhone" disabled>
                                 </el-input>
                             </el-form-item>
                         </el-col>
@@ -357,7 +390,6 @@
         height: 100px;
     }
 
-
     /deep/ .el-dialog__title {
         font-size: 14px;
     }