|
@@ -8,17 +8,19 @@ import com.zd.common.core.utils.ExcelUtil;
|
|
|
import com.zd.common.core.utils.FileConfigUtils;
|
|
import com.zd.common.core.utils.FileConfigUtils;
|
|
|
import com.zd.common.core.utils.StringUtils;
|
|
import com.zd.common.core.utils.StringUtils;
|
|
|
import com.zd.common.core.web.controller.BaseController;
|
|
import com.zd.common.core.web.controller.BaseController;
|
|
|
-import com.zd.laboratory.domain.LabWhitelist;
|
|
|
|
|
-import com.zd.laboratory.domain.XxpClassify;
|
|
|
|
|
|
|
+import com.zd.laboratory.api.vo.XxpInspectionVo;
|
|
|
|
|
+import com.zd.laboratory.domain.XxpCardInfo;
|
|
|
import com.zd.laboratory.domain.XxpDuty;
|
|
import com.zd.laboratory.domain.XxpDuty;
|
|
|
import com.zd.laboratory.domain.XxpInspection;
|
|
import com.zd.laboratory.domain.XxpInspection;
|
|
|
import com.zd.laboratory.domain.vo.XxpInspectionVO;
|
|
import com.zd.laboratory.domain.vo.XxpInspectionVO;
|
|
|
-import com.zd.laboratory.service.IXxpClassifyService;
|
|
|
|
|
|
|
+import com.zd.laboratory.service.IXxpCardInfoService;
|
|
|
import com.zd.laboratory.service.IXxpInspectionService;
|
|
import com.zd.laboratory.service.IXxpInspectionService;
|
|
|
|
|
+import com.zd.model.constant.HttpStatus;
|
|
|
import com.zd.model.domain.ResultData;
|
|
import com.zd.model.domain.ResultData;
|
|
|
import com.zd.model.domain.per.PerFun;
|
|
import com.zd.model.domain.per.PerFun;
|
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
import com.zd.model.domain.per.PerPrefix;
|
|
|
import com.zd.model.page.TableDataInfo;
|
|
import com.zd.model.page.TableDataInfo;
|
|
|
|
|
+import com.zd.system.api.feign.RemoteUserService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -44,11 +46,18 @@ public class LabXxpInspectionController extends BaseController
|
|
|
private IXxpInspectionService xxpInspectionService;
|
|
private IXxpInspectionService xxpInspectionService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ private IXxpCardInfoService iXxpCardInfoService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FileConfigUtils fileConfigUtils;
|
|
private FileConfigUtils fileConfigUtils;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RemoteUserService remoteUserService;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询巡查列表
|
|
* 查询巡查列表
|
|
|
*/
|
|
*/
|
|
@@ -234,4 +243,54 @@ public class LabXxpInspectionController extends BaseController
|
|
|
});
|
|
});
|
|
|
return ResultData.success(list);
|
|
return ResultData.success(list);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 新增巡查
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "巡查签到")
|
|
|
|
|
+ @PostMapping("/addInspection")
|
|
|
|
|
+ public ResultData addInspection(@RequestBody XxpInspectionVo xxpInspectionVo) {
|
|
|
|
|
+ XxpCardInfo xxpCardInfo=iXxpCardInfoService.selectXxpInfoByCard(xxpInspectionVo.getNum());
|
|
|
|
|
+ if(null==xxpCardInfo){
|
|
|
|
|
+ return ResultData.fail("电子信息牌查询错误");
|
|
|
|
|
+ }
|
|
|
|
|
+ int num=xxpInspectionService.selectNoSignOut(xxpCardInfo.getSubjectId(),xxpInspectionVo.getUserId());
|
|
|
|
|
+ if(num>0){
|
|
|
|
|
+ return ResultData.fail("已签到,请勿重复签到,请签出后再签到!");
|
|
|
|
|
+ }
|
|
|
|
|
+ ResultData resultData=remoteUserService.getUserMapInfoByUserId(xxpInspectionVo.getUserId());
|
|
|
|
|
+ if(null==resultData ||resultData.getCode()!= HttpStatus.SUCCESS){
|
|
|
|
|
+ return ResultData.fail("获取用户信息失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ Object userObj=resultData.getData();
|
|
|
|
|
+ if(null==userObj){
|
|
|
|
|
+ return ResultData.fail("获取用户信息失败");
|
|
|
|
|
+ }
|
|
|
|
|
+ Map<String,Object> map= (Map<String, Object>) userObj;
|
|
|
|
|
+ XxpInspection xxpInspection=new XxpInspection();
|
|
|
|
|
+ xxpInspection.setSubjectId(xxpCardInfo.getSubjectId());
|
|
|
|
|
+ xxpInspection.setSubjectName(xxpCardInfo.getSubjectName());
|
|
|
|
|
+ xxpInspection.setUserImg(String.valueOf(map.get("avatar")));
|
|
|
|
|
+ xxpInspection.setUserName(String.valueOf(map.get("userName")));
|
|
|
|
|
+ xxpInspection.setCreateBy(String.valueOf(map.get("userName")));
|
|
|
|
|
+ xxpInspection.setUserId(Long.parseLong(String.valueOf(map.get("userId"))));
|
|
|
|
|
+ xxpInspection.setDeptId(Long.parseLong(String.valueOf(map.get("deptId"))));
|
|
|
|
|
+ xxpInspection.setDeptName(String.valueOf(map.get("deptName")));
|
|
|
|
|
+ Date date=new Date();
|
|
|
|
|
+ xxpInspection.setCreateTime(date);
|
|
|
|
|
+ xxpInspection.setSignIn(date);
|
|
|
|
|
+ return ResultData.result(xxpInspectionService.insertXxpInspection(xxpInspection));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 修改巡查
|
|
|
|
|
+ */
|
|
|
|
|
+ @ApiOperation(value = "巡查签出")
|
|
|
|
|
+ @PostMapping("/updateInspection")
|
|
|
|
|
+ public ResultData updateInspection(@RequestParam("labId") Long labId,@RequestParam("userId") Long userId) {
|
|
|
|
|
+ return ResultData.result(xxpInspectionService.updateXxpInspectionSignOut(labId,userId));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|