Browse Source

Merge branch 'dev' of humingfen/patient-co-management into dev

huangwenjie 7 years ago
parent
commit
e263c802ef

+ 7 - 0
patient-co-manage/wlyy-manage/pom.xml

@ -270,6 +270,13 @@
            <artifactId>elasticsearch-sql</artifactId>
            <artifactId>elasticsearch-sql</artifactId>
            <version>2.4.1.0</version>
            <version>2.4.1.0</version>
        </dependency>
        </dependency>
        <!--fastdfs start-->
        <dependency>
            <groupId>org.csource</groupId>
            <artifactId>fastdfs_lib</artifactId>
            <version>1.2.17</version>
        </dependency>
        <!--fastdfs end-->
        <!--        <dependency>
        <!--        <dependency>
                    <groupId>com.yihu</groupId>
                    <groupId>com.yihu</groupId>
                    <artifactId>jave-ffmpegjave</artifactId>
                    <artifactId>jave-ffmpegjave</artifactId>

+ 27 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/FastDFSConfig.java

@ -0,0 +1,27 @@
package com.yihu.wlyy.config;
import com.yihu.wlyy.util.fastdfs.FastDFSClientPool;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * @author Sand
 * @version 1.0
 * @created 2018.6.29 16:08
 */
@Configuration
public class FastDFSConfig {
    @Bean
    public FastDFSClientPool fastDFSClientPool(){
        FastDFSClientPool clientPool = FastDFSClientPool.getInstance();
        return clientPool;
    }
    @Bean
    public FastDFSUtil fastDFSUtil(){
        FastDFSUtil util = new FastDFSUtil();
        return util;
    }
}

+ 20 - 26
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/healthbank/ActivityController.java

@ -1,13 +1,15 @@
package com.yihu.wlyy.controller.manager.healthbank;
package com.yihu.wlyy.controller.manager.healthbank;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.manager.healthbank.ActivityService;
import com.yihu.wlyy.service.manager.healthbank.ActivityService;
import com.yihu.wlyy.util.fastdfs.FastDFSUtil;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestParam;
@ -16,12 +18,8 @@ import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.io.InputStream;
import java.util.Map;
import java.util.Map;
import java.util.Random;
/**
/**
 * Created by humingfen on 2018/6/19.
 * Created by humingfen on 2018/6/19.
@ -34,6 +32,8 @@ public class ActivityController extends BaseController {
    @Autowired
    @Autowired
    private ActivityService activityService;
    private ActivityService activityService;
    @ApiParam
    FastDFSUtil fastDFSUtil;
    @RequestMapping(value = "initial", method = RequestMethod.GET)
    @RequestMapping(value = "initial", method = RequestMethod.GET)
    public String initListPage(){
    public String initListPage(){
@ -106,38 +106,32 @@ public class ActivityController extends BaseController {
    @RequestMapping(value = "upload", produces = "application/json;charset=UTF-8")
    @RequestMapping(value = "upload", produces = "application/json;charset=UTF-8")
    @ResponseBody
    @ResponseBody
    public String upload(@RequestParam(value = "file") MultipartFile file, HttpServletRequest request) throws IOException {
    public String upload(@RequestParam(value = "file") MultipartFile file, HttpServletRequest request) throws Exception {
        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
        // 创建文件夹
        String rootpath = request.getSession().getServletContext().getRealPath("/");
        File folder = new File(rootpath + "/image/");
        if (!folder.exists()) {
            folder.mkdirs();
        }
        String fileName = null;
        String newFileName = null;
        String tempPaths = null;
        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
            // 上传文件
            MultipartFile mf = entity.getValue();
            MultipartFile mf = entity.getValue();
            fileName = mf.getOriginalFilename();
            InputStream inputStream  = mf.getInputStream();
            String fileName = mf.getOriginalFilename();
            //文件后缀
            String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
            String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase();
            // 重命名文件
            SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
            newFileName = df.format(new Date()) + "_" + new Random().nextInt(1000) + "." + fileExt;
            File uploadFile = new File(rootpath + "/image/" + newFileName);
            // 拷贝文件流到指定文件路径
            FileCopyUtils.copy(mf.getBytes(), uploadFile);
            //文件名称
            String newFileName = mf.getOriginalFilename().substring(0,mf.getOriginalFilename().lastIndexOf("."));
            //上传到fastdfs
            ObjectNode imgNode = fastDFSUtil.upload(inputStream, fileExt, newFileName);
            com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(imgNode.toString());
            tempPaths = json.getString("fid");
        }
        }
        JSONObject json = new JSONObject();
        JSONObject json = new JSONObject();
        json.put("status", 200);
        json.put("status", 200);
        json.put("msg", "上传成功");
        json.put("msg", "上传成功");
        // 图片标识对象的HTTP链接
        // 图片标识对象的HTTP链接
        json.put("urls", String.join(",", "/image/" + newFileName));
        json.put("urls", tempPaths);
        return json.toString();
        return json.toString();
    }
    }
    /*@RequestMapping(value = "delete")
    @RequestMapping(value = "delete")
    @ResponseBody
    @ResponseBody
    public String delete(String id) {
    public String delete(String id) {
        try {
        try {
@ -148,5 +142,5 @@ public class ActivityController extends BaseController {
            error(ex);
            error(ex);
            return error(-1,"操作失败!");
            return error(-1,"操作失败!");
        }
        }
    }*/
    }
}
}

+ 13 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/healthbank/ActivityService.java

@ -67,4 +67,17 @@ public class ActivityService {
        }
        }
        return JSONObject.parseObject(response);
        return JSONObject.parseObject(response);
    }
    }
    public JSONObject delete(String jsonData) {
        String url = baseUrl + "batchActivity";
        String response = "";
        Map<String,String> params = new HashMap<>();
        params.put("ids",jsonData);
        try {
            response = httpClientUtil.httpPost(url,params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
}
}

+ 129 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/fastdfs/FastDFSClientPool.java

@ -0,0 +1,129 @@
package com.yihu.wlyy.util.fastdfs;
import org.csource.fastdfs.ClientGlobal;
import org.csource.fastdfs.StorageClient;
import org.csource.fastdfs.TrackerClient;
import org.csource.fastdfs.TrackerServer;
import java.util.HashMap;
import java.util.Map;
public class FastDFSClientPool {
    private static volatile FastDFSClientPool pool;
    private Map<StorageClient, Boolean> map;
    private int maxPoolSize = 20;
    private int waitTime = 500;
    private int initPoolSize = 5;
    static {
        try {
            String basePath = FastDFSClientPool.class.getResource("/").getPath();
            ClientGlobal.init(FastDFSUtil.class.getResource("/config/fdfs_client.conf").getPath());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    private FastDFSClientPool() {
        init();
    }
    public static FastDFSClientPool getInstance() {
        if (pool == null) {
            synchronized (FastDFSClientPool.class) {
                if(pool == null) {
                    pool = new FastDFSClientPool();
                }
            }
        }
        System.out.println("FastDFSClientPool:"+pool.toString());
        return pool;
    }
    private void init() {
        try {
            map = new HashMap<StorageClient, Boolean>();
            //不做初始缓存
//            for (int i = 0; i < initPoolSize; i++) {
//                map.put(getNewStorageClient(), true);
//            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public TrackerServer getTrackerServer(){
        try {
            TrackerClient tracker = new TrackerClient();
            return tracker.getConnection();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    private StorageClient getNewStorageClient() {
        try {
            TrackerClient tracker = new TrackerClient();
            TrackerServer trackerServer = tracker.getConnection();
            StorageClient client = new StorageClient(trackerServer, null);
            return client;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
    public void releaseStorageClient(StorageClient client) {
        if (client == null) {
            return;
        }
        try {
            if(map.containsKey(client)) {
                map.put(client, true);
            } else {
                client =null;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    public synchronized StorageClient getStorageClient() {
        StorageClient client = null;
        try {
            for (Map.Entry<StorageClient, Boolean> entry : map.entrySet()) {
                if (entry.getValue()) {
                    client = entry.getKey();
                    System.out.println("从缓存中获得fastdfs client");
                    map.put(client, false);
                    break;
                }
            }
            if (client == null) {
                if(map.size()<maxPoolSize) {
                    System.out.println("创建新fastdfs client:");
                    client = getNewStorageClient();
                    map.put(client, false);
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return client;
    }
}

+ 283 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/fastdfs/FastDFSUtil.java

@ -0,0 +1,283 @@
package com.yihu.wlyy.util.fastdfs;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.csource.common.MyException;
import org.csource.common.NameValuePair;
import org.csource.fastdfs.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetSocketAddress;
/**
 * FastDFS 客户端工具.
 *
 * @author szx
 */
public class FastDFSUtil {
    public final static String GroupField = "groupName";
    public final static String RemoteFileField = "remoteFileName";
    public final static String FileIdField = "fid";
    public final static String FileUrlField = "fileUrl";
//    static TrackerClient tracker;
//    static TrackerServer trackerServer;
//    static StorageServer storageServer;
//    static StorageClient client;
//
//    static {
//        try {
//            XEnvironmentOption environmentOption = ServiceFactory.getService(Services.EnvironmentOption);
//            String basePath = FastDFSUtil.class.getResource("/").getPath();
//            String configFile = basePath + environmentOption.getOption(EnvironmentOptions.FastDFSConfig);
//
//            ClientGlobal.init(configFile);
//
//            tracker = new TrackerClient();
//            trackerServer = tracker.getConnection();
//            storageServer = null;
//            client = new StorageClient(trackerServer, storageServer);
//        } catch (FileNotFoundException e) {
//            LogService.getLogger(FastDFSUtil.class).fatal("FastDFS配置文件打开失败: " + e.getMessage());
//        } catch (IOException e) {
//            LogService.getLogger(FastDFSUtil.class).fatal("FastDFS初始化失败: " + e.getMessage());
//        } catch (MyException e) {
//            LogService.getLogger(FastDFSUtil.class).fatal("FastDFS初始化失败: " + e.getMessage());
//        }
//    }
    final static int BUFFER_SIZE = 4096;
    /**
     * 以输入流的方式上传文件
     * InputStream in = new FileInputStream("C://Desert.jpg");
     * ObjectNode msg = FileUtil.upload(in,"jpg", "沙漠");
     * in.close();
     *
     * @param in                输入流
     * @param fileExtension   文件扩展名,不要带“.”
     * @param description             文件名称(中文)
     * @return 返回值的格式如下:
     * {
     *      "groupName": "healthArchiveGroup",
     *      "remoteFileName": "/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fid": "group1/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fileURL": "http://172.19.103.13/healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
     * }
     *
     * groupName 及 remoteFileName 可以用于查询在 fastDFS 中文件的信息,如果只是图片显示,可以忽略这两个值。
     * fid 保存了在 fastDFS 上的完整路径,为了避免将来服务器域名发生变更,最好使用本值.服务器的域名另外配置。
     * fileURL 保存了完整的 web 访问路径,为了避免将来服务器域名发生变更,最好不要直接使用本值。
     * 如果需要在下载时,可以显示原始文件名,请在访问file_url时,增加 attname 参数,如:
     *
     * http://host/healthArchiveGroup/M00/00/00/rBFuH1XdIseAUTZZAA1rIuRd3Es062.jpg?attname=a.jpg
     *
     * @throws Exception
     */
    public static ObjectNode upload(InputStream in, String fileExtension,
                                    String description) throws Exception {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            NameValuePair[] fileMetaData;
            fileMetaData = new NameValuePair[1];
            fileMetaData[0] = new NameValuePair("description", description == null ? "" : description);
            ObjectMapper objectMapper = new ObjectMapper();
            ObjectNode message = objectMapper.createObjectNode();
            ByteArrayOutputStream swapStream = new ByteArrayOutputStream();
            byte[] buff = new byte[BUFFER_SIZE]; //buff用于存放循环读取的临时数据
            int rc = 0;
            while ((rc = in.read(buff, 0, BUFFER_SIZE)) > 0) {
                swapStream.write(buff, 0, rc);
            }
            byte[] fileBuffer = swapStream.toByteArray(); //in_b为转换之后的结果
            TrackerServer trackerServer = FastDFSClientPool.getInstance().getTrackerServer();
            String[] results = client.upload_file(fileBuffer, fileExtension, fileMetaData);
            if (results != null) {
                String fileId;
                int ts;
                String token;
                String fileURl;
                InetSocketAddress socketAddress;
                String groupName = results[0];
                String remoteFile = results[1];
                message.put(GroupField, groupName);
                message.put(RemoteFileField, remoteFile);
                fileId = groupName + StorageClient1.SPLIT_GROUP_NAME_AND_FILENAME_SEPERATOR + remoteFile;
                message.put(FileIdField, fileId);
                socketAddress = trackerServer.getInetSocketAddress();
                fileURl = "http://" + socketAddress.getAddress().getHostAddress();
                if (ClientGlobal.g_tracker_http_port != 80) {
                    fileURl += ":" + ClientGlobal.g_tracker_http_port;
                }
                fileURl += "/" + fileId;
                if (ClientGlobal.g_anti_steal_token) {
                    ts = (int) (System.currentTimeMillis() / 1000);
                    token = ProtoCommon.getToken(fileId, ts, ClientGlobal.g_secret_key);
                    fileURl += "?token=" + token + "&ts=" + ts;
                }
                message.put(FileUrlField, fileURl);
                return message;
            } else {
                return null;
            }
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 上传本地文件
     * ObjectNode  a = FileUtil.upload("C://Desert.jpg", "沙漠");
     * System.out.println(a.toString());
     *
     * @param fileName 本地文件的绝对路径,如 C://Desert.jpg
     * @param description    文件备注, 可以为空
     * @return {"groupName":"group1","remoteFileName":"/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
     * {
     *      "groupName": "healthArchiveGroup",
     *      "remoteFileName": "/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fid": "group1/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg",
     *      "fileURL": "http://172.19.103.13/healthArchiveGroup/M00/00/24/rBFuH1XdQC6AP3CDAAzodQCbVVc052.jpg"
     * }
     *
     * groupName 及 remoteFileName 可以用于查询在 fastDFS 中文件的信息,如果只是图片显示,可以忽略这两个值。
     * fid 保存了在 fastDFS 上的完整路径,为了避免将来服务器域名发生变更,最好使用本值.服务器的域名另外配置。
     * fileURL 保存了完整的 web 访问路径,为了避免将来服务器域名发生变更,最好不要直接使用本值。
     * 如果需要在下载时,可以显示原始文件名,请在访问file_url时,增加 attname 参数,如:
     *
     * http://host/healthArchiveGroup/M00/00/00/rBFuH1XdIseAUTZZAA1rIuRd3Es062.jpg?attname=a.jpg
     *
     * @throws Exception
     */
    public static ObjectNode upload(String fileName, String description) throws Exception {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            NameValuePair[] meta_list;
            meta_list = new NameValuePair[1];
            meta_list[0] = new NameValuePair("description", description == null ? "" : description);
            ObjectMapper objectMapper = new ObjectMapper();
            ObjectNode message = objectMapper.createObjectNode();
            String fileExtName = "";
            if (fileName.contains(".")) {
                fileExtName = fileName.substring(fileName.lastIndexOf(".") + 1);
            } else {
                throw new RuntimeException("上传失败, 文件缺失扩展名.");
            }
            TrackerServer trackerServer = FastDFSClientPool.getInstance().getTrackerServer();
            String[] results = client.upload_file(fileName, fileExtName, meta_list);
            if (results != null) {
                String fileId;
                int ts;
                String token;
                String fileUrl;
                InetSocketAddress inetSockAddr;
                String groupName = results[0];
                String remoteFileName = results[1];
                message.put(GroupField, groupName);
                message.put(RemoteFileField, remoteFileName);
                fileId = groupName + StorageClient1.SPLIT_GROUP_NAME_AND_FILENAME_SEPERATOR + remoteFileName;
                message.put(FileIdField, fileId);
                inetSockAddr = trackerServer.getInetSocketAddress();
                fileUrl = "http://" + inetSockAddr.getAddress().getHostAddress();
                if (ClientGlobal.g_tracker_http_port != 80) {
                    fileUrl += ":" + ClientGlobal.g_tracker_http_port;
                }
                fileUrl += "/" + fileId;
                if (ClientGlobal.g_anti_steal_token) {
                    ts = (int) (System.currentTimeMillis() / 1000);
                    token = ProtoCommon.getToken(fileId, ts, ClientGlobal.g_secret_key);
                    fileUrl += "?token=" + token + "&ts=" + ts;
                }
                message.put(FileUrlField, fileUrl);
                return message;
            } else {
                return null;
            }
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 下载文件, 返回文件字节数组.
     *
     * @param groupName      在fastdfs上的卷名
     * @param remoteFileName 在fastdfs上的路径
     * @return 文件的字节码
     * @throws Exception
     */
    public static byte[] download(String groupName, String remoteFileName) throws Exception {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            byte[] b = client.download_file(groupName, remoteFileName);
            return b;
        }
        finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 下载文件到本地路径上.
     *
     * @param groupName          在 fastDFS 上的卷名
     * @param remoteFileName    在 fastDFS 上的路径
     * @param localPath          本地路径
     *
     * @return 是否下载成功
     */
    public static String download(String groupName, String remoteFileName, String localPath) throws IOException, MyException {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            String localFileName = localPath + "\\" + remoteFileName.replaceAll("/", "_");
            client.download_file(groupName, remoteFileName, 0, 0, localFileName);
            return localFileName;
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
    /**
     * 删除文件。
     *
     * @param groupName
     * @param remoteFileName
     */
    public static void delete(String groupName, String remoteFileName) throws IOException, MyException {
        StorageClient client = FastDFSClientPool.getInstance().getStorageClient();
        try {
            client.delete_file(groupName, remoteFileName);
        }finally {
            FastDFSClientPool.getInstance().releaseStorageClient(client);
        }
    }
}

+ 20 - 0
patient-co-manage/wlyy-manage/src/main/resources/config/fdfs_client.conf

@ -0,0 +1,20 @@
connect_timeout = 2
network_timeout = 30
charset = ISO8859-1
http.tracker_http_port = 80
http.anti_steal_token = no
http.secret_key = FastDFS1234567890
#-------------开发环境---------------#
#tracker_server = 172.19.103.54:22122
#-------------测试环境---------------#
tracker_server = 172.19.103.54:22122
#-------------正式环境---------------#
#外网项目地址
#tracker_server = 192.168.120.172:22122
#网闸
#tracker_server = 59.61.92.90:9055
#内网项目地址
#tracker_server = 10.95.22.139:22122

+ 2 - 2
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_list_js.jsp

@ -112,9 +112,9 @@
                                    <sec:authorize url="/admin/activity/update">
                                    <sec:authorize url="/admin/activity/update">
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "activity:info:edit", row.id) + '">编辑</a>';
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "activity:info:edit", row.id) + '">编辑</a>';
                                    </sec:authorize>
                                    </sec:authorize>
                                    <%--<sec:authorize url="/admin/activity/delete">
                                    <sec:authorize url="/admin/activity/delete">
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "activity:info:del", row.id) + '">删除</a>';
                                    html += '<a  style="margin-left:10px;"href="javascript:void(0)" onclick="javascript:' + Util.format("$.publish('{0}',['{1}'])", "activity:info:del", row.id) + '">删除</a>';
                                    </sec:authorize>--%>
                                    </sec:authorize>
                                    return html;
                                    return html;
                                }
                                }
                            }
                            }

+ 4 - 2
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/healthbank/activity_modify_js.jsp

@ -129,8 +129,10 @@
                                $("#inp_status").ligerComboBox("selectValue",data.status);
                                $("#inp_status").ligerComboBox("selectValue",data.status);
                                $("#inp_isFlag").ligerComboBox("selectValue",data.isFlag);
                                $("#inp_isFlag").ligerComboBox("selectValue",data.isFlag);
                                $("#inp_areaType").ligerComboBox("selectValue",data.areaType);
                                $("#inp_areaType").ligerComboBox("selectValue",data.areaType);
                                var length = data.img.split(',').length;
                                $('#img_upload').after('<li id="url">'+length+'张图片</li>');
                                if(data.img != null) {
                                    var length = data.img.split(',').length;
                                    $('#img_upload').after('<li id="url">' + length + '张图片</li>');
                                }
                            } else {
                            } else {
                                $.Notice.error(result.msg);
                                $.Notice.error(result.msg);
                            }
                            }