Ver Fonte

增加需求

peiguo há 3 anos atrás
pai
commit
945dac63b5

+ 84 - 0
admin-ui/app/whepi/lingyun/dialogVaccineImage.js

@@ -0,0 +1,84 @@
+define(function (require) {
+    return function (context) {
+
+        var $dlg, $grid;
+
+        function queryGrid1() {
+            $grid.reload({
+                mtype: 'GET',
+                url: api('/sweepCode/selectVaccineImageByUserId'),
+                queryParams: {userId: context.userId}
+            }, true);
+        }
+
+        return {
+            xtype: 'dialog',
+            dialogId: 'dialogDetail',
+            title: '疫苗凭证记录 >> ' + context.linkman,
+            width: '65%',
+            height: '70%',
+            onOpen: function () {
+                $dlg = $(this);
+            },
+            center: {
+                items: {
+                    onRender: function () {
+                        $grid = $(this);
+                        queryGrid1();
+                    },
+                    toolbar: {
+                        xtype: 'toolbar',
+                        title: '疫苗接种',
+                        items: [
+                            {
+                                text: '删除', iconCls: 'fa fa fa-pencil-square-o fa-lg', onClick: function () {
+                                    var row = $grid.rowData();
+                                    if (row.length == 0) {
+                                        $.yvan.msg('请选择数据');
+                                        return;
+                                    }
+                                    $.yvan.confirm('确定删除勾选的这条凭证信息吗?', {
+                                        yes: function (index) {
+                                            $.yvan.ajax({
+                                                method: 'post',
+                                                url: api('/sweepCode/deleteFile'),
+                                                data: {fileId: row.fileId},
+                                                success: function (data) {
+                                                    $.yvan.msg("删除成功");
+                                                    $grid.reload();
+                                                    queryGrid1();
+                                                }
+                                            });
+                                        }
+                                    });
+                                }
+                            },
+                        ]
+                    },
+                    xtype: 'grid',
+                    idField: "reportDate",
+                    pagination: true,
+                    columns: [[
+                        {field: 'fileId', title: 'fileId', hidden: true},
+                        {field: 'fileName', title: '文件名', maxWidth: 200, align: 'right',},
+                        {field: 'timeCreate', title: '新增时间', align: 'left', formatter: 'tsymd'},
+                        {
+                            field: 'fileUrl', title: '凭证', minWidth: 500, maxWidth: 500,
+                            formatter: function (value) {
+                                return "<img  src='/upload" + value + "'/>";
+                            },
+                        },
+                    ]],
+                }
+            },
+            buttons: [
+                {
+                    text: "关闭", iconCls: "fa fa-times", onClick: function () {
+                        // $dlg.dialog('close');
+                        $dlg.window('close');
+                    }
+                }
+            ]
+        };
+    };
+});

+ 51 - 0
admin-ui/app/whepi/lingyun/lingyunUser.js

@@ -289,6 +289,56 @@ define(function (require) {
                     }
                   },
                   {
+                    name: 'file',
+                    text: '凭证上传',
+                    iconCls: 'fa fa-cloud-upload',
+                    // accept: 'image/jpeg,image/png',
+                    accept: {
+                      title: 'file',
+                      // extensions: 'jpg,mp4,pdf,png,ppt,doc,xls,docx,xlsx,pptx',
+                      // mimeTypes: 'image/jpeg,video/mp4,application/pdf,image/png,application/vnd.ms-powerpoint,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation'
+                      extensions: 'jpg,png',
+                      mimeTypes: 'image/jpeg,image/png'
+                    },
+                    onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      $.yvan.showUploadWindow($(this), {
+                        url: api('/sweepCode/file/uploadVaccine'), //上传路径
+                        param: JSON.stringify({userId: row.userId, userName: row.linkman}),
+                        uploadSuccess: function (file) {
+                          //上传一个文件,成功之后的回调.
+                          //如果有多个文件会回调多次
+                          // console.log(file);
+                        }
+                      });
+                    }
+                  },
+                  {
+                    text: '查看人员凭证', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      if ( row.imgCount <= 0) {
+                        $.yvan.msg('该员工没有上传相关凭证');
+                        return
+                      }
+                      $.yvan.showDialog(this,
+                          require('/app/whepi/lingyun/dialogVaccineImage.js')({
+                            userId: row.userId,
+                            linkman: row.linkman,
+                            confirm: function () {
+                            }
+                          })
+                      );
+                    }
+                  },
+                  {
                     text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
                       var unitId = $form.formGet().unitId;
                       var departmentId = $form.formGet().departmentId;
@@ -374,6 +424,7 @@ define(function (require) {
                 [
                   [
                     {field: 'userId', title: '用户ID', hidden: true},
+                    {field: 'imgCount', hidden: true},
                     {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},

+ 51 - 0
admin-ui/app/whepi/lingyun/lingyunUser2.js

@@ -269,6 +269,56 @@ define(function (require) {
                     }
                   },
                   {
+                    name: 'file',
+                    text: '凭证上传',
+                    iconCls: 'fa fa-cloud-upload',
+                    // accept: 'image/jpeg,image/png',
+                    accept: {
+                      title: 'file',
+                      // extensions: 'jpg,mp4,pdf,png,ppt,doc,xls,docx,xlsx,pptx',
+                      // mimeTypes: 'image/jpeg,video/mp4,application/pdf,image/png,application/vnd.ms-powerpoint,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation'
+                      extensions: 'jpg,png',
+                      mimeTypes: 'image/jpeg,image/png'
+                    },
+                    onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      $.yvan.showUploadWindow($(this), {
+                        url: api('/sweepCode/file/uploadVaccine'), //上传路径
+                        param: JSON.stringify({userId: row.userId, userName: row.linkman}),
+                        uploadSuccess: function (file) {
+                          //上传一个文件,成功之后的回调.
+                          //如果有多个文件会回调多次
+                          // console.log(file);
+                        }
+                      });
+                    }
+                  },
+                  {
+                    text: '查看人员凭证', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      if ( row.imgCount <= 0) {
+                        $.yvan.msg('该员工没有上传相关凭证');
+                        return
+                      }
+                      $.yvan.showDialog(this,
+                          require('/app/whepi/lingyun/dialogVaccineImage.js')({
+                            userId: row.userId,
+                            linkman: row.linkman,
+                            confirm: function () {
+                            }
+                          })
+                      );
+                    }
+                  },
+                  {
                     text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
                       var unitId = $form.formGet().unitId;
                       var departmentId = $form.formGet().departmentId;
@@ -351,6 +401,7 @@ define(function (require) {
                 [
                   [
                     {field: 'userId', title: '用户ID', hidden: true},
+                    {field: 'imgCount', hidden: true},
                     {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},

+ 51 - 0
admin-ui/app/whepi/lingyun/lingyunUser7.js

@@ -290,6 +290,56 @@ define(function (require) {
                     }
                   },
                   {
+                    name: 'file',
+                    text: '凭证上传',
+                    iconCls: 'fa fa-cloud-upload',
+                    // accept: 'image/jpeg,image/png',
+                    accept: {
+                      title: 'file',
+                      // extensions: 'jpg,mp4,pdf,png,ppt,doc,xls,docx,xlsx,pptx',
+                      // mimeTypes: 'image/jpeg,video/mp4,application/pdf,image/png,application/vnd.ms-powerpoint,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation'
+                      extensions: 'jpg,png',
+                      mimeTypes: 'image/jpeg,image/png'
+                    },
+                    onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      $.yvan.showUploadWindow($(this), {
+                        url: api('/sweepCode/file/uploadVaccine'), //上传路径
+                        param: JSON.stringify({userId: row.userId, userName: row.linkman}),
+                        uploadSuccess: function (file) {
+                          //上传一个文件,成功之后的回调.
+                          //如果有多个文件会回调多次
+                          // console.log(file);
+                        }
+                      });
+                    }
+                  },
+                  {
+                    text: '查看人员凭证', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      if ( row.imgCount <= 0) {
+                        $.yvan.msg('该员工没有上传相关凭证');
+                        return
+                      }
+                      $.yvan.showDialog(this,
+                          require('/app/whepi/lingyun/dialogVaccineImage.js')({
+                            userId: row.userId,
+                            linkman: row.linkman,
+                            confirm: function () {
+                            }
+                          })
+                      );
+                    }
+                  },
+                  {
                     text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
                       var unitId = $form.formGet().unitId;
                       var departmentId = $form.formGet().departmentId;
@@ -372,6 +422,7 @@ define(function (require) {
                 [
                   [
                     {field: 'userId', title: '用户ID', hidden: true},
+                    {field: 'imgCount', hidden: true},
                     {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},

+ 12 - 0
whepi-ui/templates/home/ribao.js

@@ -2925,6 +2925,18 @@ function inoculateVacc() {
             $.alert("输入文本不能超过50字")
             return;
         }
+        if (Date.parse(new Date(date.firstTime)) >= Date.parse(new Date(date.secondTime)) && date.firstHospital && date.secondHospital) {
+            $.alert("第一剂疫苗接种时间必须早于第二剂疫苗")
+            return;
+        }
+        if (Date.parse(new Date(date.secondTime)) >= Date.parse(new Date(date.thirdTime)) && date.secondHospital && date.thirdHospital) {
+            $.alert("第二剂疫苗接种时间必须早于第三剂疫苗")
+            return;
+        }
+        if (Date.parse(new Date(date.thirdTime)) >= new Date().format("yyyy-MM-dd") && date.thirdHospital) {
+            $.alert("第三剂疫苗接种时间不能小于今天")
+            return;
+        }
         $("#reason").val("");
     } else {
         $.alert("请选择是否接种新冠疫苗")

+ 1 - 0
whepi-web/build.gradle

@@ -7,6 +7,7 @@ dependencies {
     compile 'com.google.zxing:javase:3.3.0'
     compile 'com.github.binarywang:weixin-java-mp:3.3.0'
     compile 'commons-dbutils:commons-dbutils:1.7'
+    compile 'com.alibaba:fastjson:1.2.74'
     compileOnly 'org.projectlombok:lombok'
 }
 

+ 18 - 0
whepi-web/src/main/java/com/bofeng/dao/SysFileMapper.java

@@ -0,0 +1,18 @@
+package com.bofeng.dao;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.SysFile;
+import com.yvan.PageDb;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface SysFileMapper extends BaseMapper<SysFile> {
+
+    @Select("select * from sys_file where module_id = #{moduleId} and user_id = #{userId}")
+    List<SysFile> selectFileByUserId(PageDb pageDb, @Param("moduleId") Integer moduleId, @Param("userId") Long userId);
+}

+ 2 - 0
whepi-web/src/main/java/com/bofeng/dao/VaccineMapper.java

@@ -20,4 +20,6 @@ public interface VaccineMapper extends BaseMapper<Vaccine> {
     List<Vaccine> selectVaccineByUserId(PageDb pageDb, Map<String, Object> map);
 
     List<Vaccine> exSelectVaccine(Map<String, Object> map);
+
+    int updateVaccineById(Vaccine vaccine);
 }

+ 3 - 1
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLYBM4.java

@@ -73,7 +73,7 @@ public class ExcelRiBaoLYBM4 {
             inoculateStatusStr = "";
         } else if (inoculateStatus == 1) {
             inoculateStatusStr = "是";
-        } else if (inoculateStatus == 2) {
+        } else if (inoculateStatus == 0) {
             inoculateStatusStr = "否";
         }
         return inoculateStatusStr;
@@ -469,4 +469,6 @@ public class ExcelRiBaoLYBM4 {
 
     private Long houseId=0L;
 
+    private Integer imgCount;
+
 }

+ 91 - 0
whepi-web/src/main/java/com/bofeng/entity/SysFile.java

@@ -0,0 +1,91 @@
+package com.bofeng.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 疫苗接种表
+ */
+@Getter
+@Setter
+@TableName("sys_file")
+public class SysFile {
+
+    /**
+     * 文件ID
+     */
+    @TableId("file_id")
+    private Long fileId;
+
+    /**
+     * 模块ID:1疫苗附件
+     */
+    @TableField("module_id")
+    private Integer moduleId;
+
+    /**
+     * 原始文件名称
+     */
+    @TableField("file_name")
+    private String fileName;
+
+    /**
+     * 扩展名
+     */
+    @TableField("file_ext")
+    private String fileExt;
+
+    /**
+     * 文件大小:字节byte
+     */
+    @TableField("file_size")
+    private Long fileSize;
+
+    /**
+     * 下载地址:相对url,无域名
+     */
+    @TableField("file_url")
+    private String fileUrl;
+
+    /**
+     * md5
+     */
+    @TableField("file_md5")
+    private String fileMd5;
+
+    /**
+     * user_id
+     */
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 上传人
+     */
+    @TableField("user_name")
+    private String userName;
+
+    /**
+     * 备注
+     */
+    @TableField("remark")
+    private String remark;
+
+    /**
+     * 新增时间
+     */
+    @TableField("time_create")
+    private Date timeCreate;
+
+    /**
+     * 修改时间
+     */
+    @TableField("time_update")
+    private Date timeUpdate;
+}

+ 10 - 1
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -789,7 +789,7 @@ public class MsReportService {
             return vaccineMapper.insert(vaccine);
         } else {
             vaccine.setTimeUpdate(now);
-            return vaccineMapper.updateById(vaccine);
+            return vaccineMapper.updateVaccineById(vaccine);
         }
     }
 
@@ -807,6 +807,15 @@ public class MsReportService {
             vaccine.setThirdUnit("");
         } else if (vaccine.getInoculateStatus() == 1) {
             vaccine.setReason("");
+            if (vaccine.getFirstHospital() == "" && vaccine.getFirstUnit() == "") {
+                vaccine.setFirstTime(null);
+            }
+            if (vaccine.getSecondHospital() == "" && vaccine.getSecondUnit() == "") {
+                vaccine.setSecondTime(null);
+            }
+            if (vaccine.getThirdHospital() == "" && vaccine.getThirdUnit() == "") {
+                vaccine.setThirdTime(null);
+            }
         }
     }
 }

+ 66 - 0
whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java

@@ -1,20 +1,30 @@
 package com.bofeng.service;
 
 
+import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.bofeng.JwtHelper;
 import com.bofeng.dao.*;
 import com.bofeng.entity.*;
+import com.google.common.base.Strings;
 import com.yvan.PageDb;
 import com.yvan.platform.StringUtils;
+import lombok.val;
+import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.shiro.util.CollectionUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.io.File;
+import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -22,6 +32,8 @@ import java.util.Map;
 @Transactional(readOnly = true)
 public class SweepCodeService {
 
+    @Value("${upload-file-path}")
+    private String uploadFilePath;
     @Autowired
     private SweepCodeMapper sweepCodeMapper;
     @Autowired
@@ -40,6 +52,8 @@ public class SweepCodeService {
     private MsReportMapper msReportMapper;
     @Autowired
     private VaccineMapper vaccineMapper;
+    @Autowired
+    private SysFileMapper sysFileMapper;
 
     public List<SysUptownHouse> selectCode(PageDb pageDb, Map<String, Object> queryParam) {
         List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectCode(pageDb,queryParam);
@@ -505,4 +519,56 @@ public class SweepCodeService {
         map.put("unitType", 7000); // 对应的sql查询中部门大于7000
         return vaccineMapper.exSelectVaccine(map);
     }
+
+    /**
+     * 上传凭证图片
+     * @param file
+     * @param userId
+     * @return
+     */
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public int uploadVaccine(MultipartFile file, Long userId, String userName) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
+        File url = new File(uploadFilePath + "/" + sdf.format(new Date()));
+        if (!url.exists()) {
+            url.mkdirs();
+        }
+
+        try {
+            String fileName = file.getOriginalFilename();
+            String ext = getExt(fileName);
+            Long fileId = IdWorker.getId();
+            String fileUrl = url  + "/" + fileId + "." + ext;
+            file.transferTo(new File(fileUrl));
+            SysFile sysFile = new SysFile();
+            sysFile.setFileId(fileId);
+            sysFile.setModuleId(1);
+            sysFile.setFileName(fileName);
+            sysFile.setFileExt(getExt(fileName));
+            sysFile.setFileSize(file.getSize());
+            sysFile.setFileUrl("/" + sdf.format(new Date())  + "/" + fileId + "." + ext);
+            sysFile.setUserId(userId);
+            sysFile.setUserName(userName);
+            sysFile.setTimeCreate(new Date());
+            sysFile.setTimeUpdate(new Date());
+            sysFileMapper.insert(sysFile);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return 1;
+    }
+
+    /**
+     * 获取文件扩展名
+     */
+    private String getExt(String name) {
+        if (Strings.isNullOrEmpty(name)) {
+            return "";
+        }
+        val pos = name.lastIndexOf(".");
+        if (pos < 0) {
+            return "";
+        }
+        return name.substring(pos + 1).toLowerCase();
+    }
 }

+ 27 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -1,5 +1,6 @@
 package com.bofeng.wx.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.bofeng.JwtHelper;
 import com.bofeng.dao.*;
@@ -10,6 +11,7 @@ import com.bofeng.service.ScanAdminService;
 import com.bofeng.service.ScanService;
 import com.bofeng.service.SweepCodeService;
 import com.bofeng.unit.QRCode;
+import com.google.gson.JsonObject;
 import com.google.zxing.WriterException;
 import com.yvan.Model;
 import com.yvan.PageDb;
@@ -24,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
@@ -65,6 +68,8 @@ public class ScanAdminController {
     private ReturnWorkLyMapper returnWorkLyMapper;
     @Autowired
     private VaccineMapper vaccineMapper;
+    @Autowired
+    private SysFileMapper sysFileMapper;
 
     @ApiOperation("出入查询")
     @PostMapping("/whepi/sweepCode/selectCode")
@@ -257,6 +262,28 @@ public class ScanAdminController {
         return Model.newSuccess(list);
     }
 
+    @ApiOperation("凌云疫苗凭证查询")
+    @GetMapping("/whepi/sweepCode/selectVaccineImageByUserId")
+    public Model<List<SysFile>> selectVaccineImageByUserId(PageDb pageDb,HttpParameterParser parser) {
+        List<SysFile> list = sysFileMapper.selectFileByUserId(pageDb, 1, Long.parseLong(parser.getMap().get("userId").toString()));
+        return Model.newSuccess(pageDb, list);
+    }
+
+    @ApiOperation("凌云疫苗上传附件")
+    @PostMapping("/whepi/sweepCode/file/uploadVaccine")
+    public Model uploadVaccine(HttpParameterParser parser, MultipartFile file) {
+        Map<String, Object> map = JSONObject.parseObject(parser.getMap().get("param").toString());
+        Long userId = Long.parseLong(map.get("userId").toString());
+        String userName = map.get("userName").toString();
+        return Model.newSuccess(sweepCodeService.uploadVaccine(file, userId, userName));
+    }
+
+    @ApiOperation("删除特殊人员的时间")
+    @PostMapping("/whepi/sweepCode/deleteFile")
+    public Model deleteOutUser(@Pd(name = "fileId") Long fileId) {
+        return Model.newSuccess(sysFileMapper.deleteById(fileId));
+    }
+
     @ApiOperation("凌云导出疫苗接种")
     @GetMapping("/whepi/sweepCode/exSelectVaccine")
     @SneakyThrows

+ 7 - 7
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -71,13 +71,13 @@ public class UserOpenController {
                              @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType) throws JsonProcessingException {
         List<UserRole> list = new ArrayList<>();
         if (userId == 0) {
-            UserOpen userOpen = homeService.getUserOpen();
-            if (userOpen == null) {
-                return null;
-            }
-            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//            list = userRoleMapper.getUserRoleByUserId(1228565481837944834L);
-//            UserOpen userOpen = userOpenMapper.selectByUserId(1228565481837944834L);
+//            UserOpen userOpen = homeService.getUserOpen();
+//            if (userOpen == null) {
+//                return null;
+//            }
+//            list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+            list = userRoleMapper.getUserRoleByUserId(1226354442290638849L);// 1226354442290638849L廖丹
+            UserOpen userOpen = userOpenMapper.selectByUserId(1226354442290638849L);
             userId = userOpen.getUserId();
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");

+ 1 - 0
whepi-web/src/main/resources/application-peig.yml

@@ -73,3 +73,4 @@ spring:
     database: 4
     host: localhost
     port: 6379
+upload-file-path: D:\upload

+ 1 - 0
whepi-web/src/main/resources/application-prod.yml

@@ -86,3 +86,4 @@ spring:
     database: 8
     host: localhost
     port: 6379
+upload-file-path: /home/www/upload

+ 1 - 1
whepi-web/src/main/resources/mapper/RbMapper.xml

@@ -167,7 +167,7 @@
         msr.single_num as singleNum,mss.user_name as userName,mss.grender, mss.age,mss.family_status as familyStatus,de.department_name as departmentName,
         mss.medical,mss.temperature,mss.cough,mss.is_contact, mss.is_suspected,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult,mss.temperature_score,mss.is_contact as isContact,mss.is_suspected as isSuspected,
         tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other, tr.auto_local, tr.auto_addr,ur.user_id as userId,suh.house_id as houseId,
-        v.inoculate_status as inoculateStatus,v.reason,v.vaccine_type as vaccineType
+        v.inoculate_status as inoculateStatus,v.reason,(select count(1) from sys_file f where f.user_id = ur.user_id) imgCount,v.vaccine_type as vaccineType
         from sys_uptown_house suh
         left join sys_uptown_home suho on suho.house_id=suh.house_id
         left JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id

+ 19 - 0
whepi-web/src/main/resources/mapper/VaccineMapper.xml

@@ -44,4 +44,23 @@
         </where>
         order by suu.unit_id asc,suho.linkman
     </select>
+
+    <update id="updateVaccineById">
+        UPDATE ms_vaccine
+        SET user_id = #{userId},
+            inoculate_status = #{inoculateStatus},
+            vaccine_type = #{vaccineType},
+            reason = #{reason},
+            first_time = #{firstTime},
+            first_hospital = #{firstHospital},
+            first_unit = #{firstUnit},
+            second_time = #{secondTime},
+            second_hospital = #{secondHospital},
+            second_unit = #{secondUnit},
+            third_time = #{thirdTime},
+            third_hospital = #{thirdHospital},
+            third_unit = #{thirdUnit},
+            time_update = #{timeUpdate}
+        WHERE vac_id = #{vacId}
+    </update>
 </mapper>

+ 1 - 1
yvan-platform/src/main/java/com/yvan/mvc/JztdMvcAutoConfigration.java

@@ -32,7 +32,7 @@ public class JztdMvcAutoConfigration extends WebMvcConfigurerAdapter {
      */
     @Override
     public void addResourceHandlers(ResourceHandlerRegistry registry) {
-        registry.addResourceHandler("/whepi/upload/**").addResourceLocations("file:"+ "/home/www/upload/whepi" + "/upload/");
+        // registry.addResourceHandler("/whepi/upload/**").addResourceLocations("file:"+ "/home/www/upload/whepi" + "/upload/");
     }
 
     /**