PC新增安全检查
This commit is contained in:
parent
613520bfa8
commit
f3be062ec3
|
|
@ -10,7 +10,7 @@ public class HiddenDanger {
|
|||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 隐患id
|
||||
|
|
@ -96,11 +96,11 @@ public class HiddenDanger {
|
|||
this.bookentcheckdetailid = bookentcheckdetailid;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,236 @@
|
|||
package com.rzyc.bean.check.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @author dong
|
||||
* @date 2023-11-16 16:11
|
||||
* @Version V1.0
|
||||
*/
|
||||
@ApiModel("新增安全检查")
|
||||
public class MinProgramCheckAddPcDto {
|
||||
|
||||
@NotNull(message = "检查不能为空")
|
||||
private String bookEntCheckId;
|
||||
|
||||
@NotNull(message = "企业不能为空")
|
||||
private String baseEntId;
|
||||
|
||||
private String checkSite;
|
||||
|
||||
private String begCheckDate;
|
||||
|
||||
private String checkUniy;
|
||||
|
||||
private String zhiFaRen;
|
||||
|
||||
private String rectifyTime;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String checkDetails;
|
||||
|
||||
private String pCheckDetails;
|
||||
|
||||
private String sysUserId;
|
||||
|
||||
private String chkbillid;
|
||||
|
||||
private String checkUser;
|
||||
|
||||
private String otherEntHTs;
|
||||
|
||||
private String taskId;
|
||||
|
||||
private String listfactorid;
|
||||
|
||||
private String worktitle;
|
||||
|
||||
private String miniWork;
|
||||
|
||||
private String miniWorkUnitIds;
|
||||
|
||||
private Integer notSign;
|
||||
|
||||
private String longitude;
|
||||
|
||||
private String latitude;
|
||||
|
||||
public String getBookEntCheckId() {
|
||||
return bookEntCheckId;
|
||||
}
|
||||
|
||||
public void setBookEntCheckId(String bookEntCheckId) {
|
||||
this.bookEntCheckId = bookEntCheckId;
|
||||
}
|
||||
|
||||
public String getBaseEntId() {
|
||||
return baseEntId;
|
||||
}
|
||||
|
||||
public void setBaseEntId(String baseEntId) {
|
||||
this.baseEntId = baseEntId;
|
||||
}
|
||||
|
||||
public String getCheckSite() {
|
||||
return checkSite;
|
||||
}
|
||||
|
||||
public void setCheckSite(String checkSite) {
|
||||
this.checkSite = checkSite;
|
||||
}
|
||||
|
||||
public String getBegCheckDate() {
|
||||
return begCheckDate;
|
||||
}
|
||||
|
||||
public void setBegCheckDate(String begCheckDate) {
|
||||
this.begCheckDate = begCheckDate;
|
||||
}
|
||||
|
||||
public String getCheckUniy() {
|
||||
return checkUniy;
|
||||
}
|
||||
|
||||
public void setCheckUniy(String checkUniy) {
|
||||
this.checkUniy = checkUniy;
|
||||
}
|
||||
|
||||
public String getZhiFaRen() {
|
||||
return zhiFaRen;
|
||||
}
|
||||
|
||||
public void setZhiFaRen(String zhiFaRen) {
|
||||
this.zhiFaRen = zhiFaRen;
|
||||
}
|
||||
|
||||
public String getRectifyTime() {
|
||||
return rectifyTime;
|
||||
}
|
||||
|
||||
public void setRectifyTime(String rectifyTime) {
|
||||
this.rectifyTime = rectifyTime;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getCheckDetails() {
|
||||
return checkDetails;
|
||||
}
|
||||
|
||||
public void setCheckDetails(String checkDetails) {
|
||||
this.checkDetails = checkDetails;
|
||||
}
|
||||
|
||||
public String getpCheckDetails() {
|
||||
return pCheckDetails;
|
||||
}
|
||||
|
||||
public void setpCheckDetails(String pCheckDetails) {
|
||||
this.pCheckDetails = pCheckDetails;
|
||||
}
|
||||
|
||||
public String getSysUserId() {
|
||||
return sysUserId;
|
||||
}
|
||||
|
||||
public void setSysUserId(String sysUserId) {
|
||||
this.sysUserId = sysUserId;
|
||||
}
|
||||
|
||||
public String getChkbillid() {
|
||||
return chkbillid;
|
||||
}
|
||||
|
||||
public void setChkbillid(String chkbillid) {
|
||||
this.chkbillid = chkbillid;
|
||||
}
|
||||
|
||||
public String getCheckUser() {
|
||||
return checkUser;
|
||||
}
|
||||
|
||||
public void setCheckUser(String checkUser) {
|
||||
this.checkUser = checkUser;
|
||||
}
|
||||
|
||||
public String getOtherEntHTs() {
|
||||
return otherEntHTs;
|
||||
}
|
||||
|
||||
public void setOtherEntHTs(String otherEntHTs) {
|
||||
this.otherEntHTs = otherEntHTs;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getListfactorid() {
|
||||
return listfactorid;
|
||||
}
|
||||
|
||||
public void setListfactorid(String listfactorid) {
|
||||
this.listfactorid = listfactorid;
|
||||
}
|
||||
|
||||
public String getWorktitle() {
|
||||
return worktitle;
|
||||
}
|
||||
|
||||
public void setWorktitle(String worktitle) {
|
||||
this.worktitle = worktitle;
|
||||
}
|
||||
|
||||
public String getMiniWork() {
|
||||
return miniWork;
|
||||
}
|
||||
|
||||
public void setMiniWork(String miniWork) {
|
||||
this.miniWork = miniWork;
|
||||
}
|
||||
|
||||
public String getMiniWorkUnitIds() {
|
||||
return miniWorkUnitIds;
|
||||
}
|
||||
|
||||
public void setMiniWorkUnitIds(String miniWorkUnitIds) {
|
||||
this.miniWorkUnitIds = miniWorkUnitIds;
|
||||
}
|
||||
|
||||
public Integer getNotSign() {
|
||||
return notSign;
|
||||
}
|
||||
|
||||
public void setNotSign(Integer notSign) {
|
||||
this.notSign = notSign;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
}
|
||||
|
|
@ -1214,7 +1214,6 @@ public class DataController extends com.rzyc.controller.BaseController {
|
|||
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.rzyc.bean.SysEnterpriseDo;
|
|||
import com.rzyc.bean.check.*;
|
||||
import com.rzyc.bean.check.dto.ListQuotaDto;
|
||||
import com.rzyc.bean.check.dto.ListWorkDto;
|
||||
import com.rzyc.bean.check.dto.MinProgramCheckAddPcDto;
|
||||
import com.rzyc.bean.check.dto.WorkPageDto;
|
||||
import com.rzyc.bean.check.vo.WorkPageVo;
|
||||
import com.rzyc.bean.ent.MinCompaniesDto;
|
||||
|
|
@ -334,7 +335,7 @@ public class MinWorkController extends BaseController{
|
|||
@ApiOperation(value = "小程序查询最小工作单元检查项", notes = "小程序查询最小工作单元检查项")
|
||||
@PostMapping("/getMinWorkUnitCheckItem")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "categoryId", value = "最小单位分类Id", required = true, dataType = "string"),
|
||||
@ApiImplicitParam(name = "minCategory", value = "最小单位分类Id", required = true, dataType = "string"),
|
||||
})
|
||||
@ResponseBody
|
||||
public SingleResult getMinWorkUnitCheckItem(String minCategory){
|
||||
|
|
@ -882,7 +883,7 @@ public class MinWorkController extends BaseController{
|
|||
if(null != checkDetail.getHiddenDangers() && checkDetail.getHiddenDangers().size() > 0){
|
||||
rectifytime = checkDetail.getHiddenDangers().get(0).getRectifytime();
|
||||
for (HiddenDanger hiddenDanger : checkDetail.getHiddenDangers()){
|
||||
hiddenDanger.setId(1);
|
||||
hiddenDanger.setId("1");
|
||||
hiddenDanger.setIndexid(1);
|
||||
hiddenDanger.setDangerdescid(hiddenDanger.getBookenthtid());
|
||||
hiddenDanger.setBookentcheckdetailid(hiddenDanger.getBookenthtid());
|
||||
|
|
@ -1118,6 +1119,179 @@ public class MinWorkController extends BaseController{
|
|||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序政府端上报检查
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@ApiOperation(value = "小程序政府端上报检查", notes = "小程序政府端上报检查")
|
||||
@PostMapping(value = "/minProgramCheckAddPc")
|
||||
@ResponseBody
|
||||
@Transactional
|
||||
public SingleResult minProgramCheckAddPc(@Valid @RequestBody MinProgramCheckAddPcDto minProgramCheckAddPcDto,HttpServletRequest httpServletRequest) throws Exception {
|
||||
SingleResult result = new SingleResult();
|
||||
|
||||
String bookEntCheckId = minProgramCheckAddPcDto.getBookEntCheckId();
|
||||
String baseEntId = minProgramCheckAddPcDto.getBaseEntId();
|
||||
String checkSite = minProgramCheckAddPcDto.getCheckSite();
|
||||
String begCheckDate = minProgramCheckAddPcDto.getBegCheckDate();
|
||||
String checkUniy = minProgramCheckAddPcDto.getCheckUniy();
|
||||
String zhiFaRen = minProgramCheckAddPcDto.getZhiFaRen();
|
||||
String rectifyTime = minProgramCheckAddPcDto.getRectifyTime();
|
||||
String remark = minProgramCheckAddPcDto.getRemark();
|
||||
String checkDetails = minProgramCheckAddPcDto.getCheckDetails();
|
||||
String pCheckDetails = minProgramCheckAddPcDto.getpCheckDetails();
|
||||
String sysUserId = minProgramCheckAddPcDto.getSysUserId();
|
||||
String chkbillid = minProgramCheckAddPcDto.getChkbillid();
|
||||
String checkUser = minProgramCheckAddPcDto.getCheckUser();
|
||||
String otherEntHTs = minProgramCheckAddPcDto.getOtherEntHTs();
|
||||
String taskId = minProgramCheckAddPcDto.getTaskId();
|
||||
String listfactorid = minProgramCheckAddPcDto.getListfactorid();
|
||||
String worktitle = minProgramCheckAddPcDto.getWorktitle();
|
||||
String miniWork = minProgramCheckAddPcDto.getMiniWork();
|
||||
String miniWorkUnitIds = minProgramCheckAddPcDto.getMiniWorkUnitIds();
|
||||
Integer notSign = minProgramCheckAddPcDto.getNotSign();
|
||||
String longitude = minProgramCheckAddPcDto.getLongitude();
|
||||
String latitude = minProgramCheckAddPcDto.getLatitude();
|
||||
|
||||
|
||||
SysEnterprise sysEnterprise = sysEnterpriseMapper.selectByPrimaryKey(minProgramCheckAddPcDto.getBaseEntId());
|
||||
if(null != sysEnterprise){
|
||||
|
||||
if(null == notSign){
|
||||
notSign = 1;
|
||||
}
|
||||
String checkType = "日常";
|
||||
String chkbillName = "";
|
||||
if(StringUtils.isNotBlank(chkbillid)){
|
||||
ChkGovBill chkGovBill = chkGovBillMapper.selectByPrimaryKey(chkbillid);
|
||||
if(null != chkGovBill){
|
||||
checkType = chkGovBill.getChkGovType();
|
||||
chkbillName = chkGovBill.getChkbillname();
|
||||
}
|
||||
}
|
||||
SysUser sysUser = super.getUser(sysUserId);
|
||||
//隐患来源
|
||||
String htsource = super.getUnitName(sysUserId);
|
||||
BookEntCheck bookEntCheck = new BookEntCheck();
|
||||
bookEntCheck.setBookentcheckid(bookEntCheckId);
|
||||
bookEntCheck.setBaseentid(baseEntId);
|
||||
bookEntCheck.setIstotrouble("否");
|
||||
bookEntCheck.setBookcheckscores(0);
|
||||
bookEntCheck.setChkbillid(chkbillid);
|
||||
bookEntCheck.setChkbillName(chkbillName);
|
||||
bookEntCheck.setChecksite(sysEnterprise.getEntname());
|
||||
bookEntCheck.setBegcheckdate(new Date());
|
||||
bookEntCheck.setEndcheckdate(new Date());
|
||||
bookEntCheck.setCheckuniy(sysUser.getSysunitorentid());
|
||||
bookEntCheck.setZhifaren(sysUser.getChinaname());
|
||||
bookEntCheck.setChecktype(checkType);
|
||||
bookEntCheck.setModifiedby(sysUser.getSysuserid());
|
||||
bookEntCheck.setRemark(remark);
|
||||
bookEntCheck.setModifiedon(new Date());
|
||||
bookEntCheck.setCreatedby(sysUser.getSysuserid());
|
||||
bookEntCheck.setCreatedon(new Date());
|
||||
|
||||
// bookEntCheck.setLongitude(new BigDecimal(longitude));
|
||||
// bookEntCheck.setLatitude(new BigDecimal(latitude));
|
||||
//这里判断是否为最小单位检查
|
||||
if ("[]" .equals(miniWorkUnitIds)){
|
||||
bookEntCheck.setMinUnitCheck(2);
|
||||
}else {
|
||||
bookEntCheck.setChkbillName(bookEntCheck.getChecksite() + "最小工作单元检查");
|
||||
bookEntCheck.setMinUnitCheck(1);
|
||||
}
|
||||
bookEntCheckMapper.insert(bookEntCheck);//保存检查记录
|
||||
|
||||
//如果检查人员id为空 则把当前id加上 否则判断检查人员是否包含当前用户id 不包含 则把当前登录用户id加入
|
||||
/* if(StringUtils.isNotBlank(checkUser)){
|
||||
if(checkUser.contains(sysUserId)){
|
||||
checkUser+= ","+sysUserId;
|
||||
}
|
||||
}else{
|
||||
checkUser = sysUserId;
|
||||
}*/
|
||||
|
||||
//保存检查人员签名
|
||||
if(StringUtils.isNotBlank(checkUser)){
|
||||
this.addChkPerson(bookEntCheckId,checkUser,zhiFaRen,sysUserId,sysUser);
|
||||
}
|
||||
|
||||
//保存检查项
|
||||
Integer sendMsgStatus = this.saveCheckItem(checkDetails,pCheckDetails,bookEntCheckId,rectifyTime,checkUniy,begCheckDate,zhiFaRen,sysEnterprise,htsource,sysUserId,sysUser);
|
||||
|
||||
//保存其他隐患
|
||||
sendMsgStatus = this.saveOtherEntHT(otherEntHTs,baseEntId,bookEntCheckId,begCheckDate,zhiFaRen,sysEnterprise.getLegalrepre(),rectifyTime,htsource,sendMsgStatus,sysUserId,sysUser);
|
||||
|
||||
if(StringUtils.isBlank(worktitle)){
|
||||
worktitle = sysEnterprise.getEntname() +"检查";
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(miniWorkUnitIds)){
|
||||
List<String> minWorkIds = JSON.parseArray(miniWorkUnitIds,String.class);
|
||||
for (String m:minWorkIds) {
|
||||
MinCheckUnitIds minCheckUnitIds = new MinCheckUnitIds();
|
||||
minCheckUnitIds.setId(RandomNumber.getUUid());
|
||||
minCheckUnitIds.setCreateTime(new Date());
|
||||
minCheckUnitIds.setMinWorkCheckId(bookEntCheck.getBookentcheckid());
|
||||
minCheckUnitIds.setMinWorkUnitId(m);
|
||||
minCheckUnitIdsMapper.insert(minCheckUnitIds);
|
||||
}
|
||||
}
|
||||
|
||||
//通过任务id新增履职记录
|
||||
// super.closeTask(taskId,worktitle,sysUserId,bookEntCheckId,sysUser);
|
||||
//自动关联到检查清单
|
||||
String year = Calendar.getInstance().get(Calendar.YEAR)+"";
|
||||
if(StringUtils.isBlank(worktitle)){
|
||||
worktitle = "<"+sysEnterprise.getEntname()+">"+DateUtils.getNowDateTimeStr()+"安全检查。";
|
||||
}
|
||||
|
||||
List<ListFactor> listFactors = listFactorMapper.userCheckFactor(sysUser.getSystitle(),year, FactorType.CHECK.getType());
|
||||
if(null != listFactors){
|
||||
for (ListFactor listFactor : listFactors){
|
||||
addCheckList(listFactor.getListfactorid(),worktitle,sysUserId,bookEntCheckId,sysUser);
|
||||
}
|
||||
}
|
||||
|
||||
//如果推送消息状态为1 则推送消息
|
||||
if(1 == sendMsgStatus){
|
||||
|
||||
//发送短信
|
||||
SendSMS.findDanger(sysEnterprise.getLrlinktel());
|
||||
|
||||
SendMessage sendMessage = new SendMessage(sysUserId,baseEntId,1);
|
||||
Thread thread = new Thread(sendMessage);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
|
||||
//调用扣分接口
|
||||
// super.subGrade(sysEnterprise.getSysenterpriseid(),bookEntCheckId);
|
||||
|
||||
//修改分数
|
||||
changeEntRiskLevel(sysEnterprise.getSysenterpriseid());
|
||||
|
||||
//保存提醒消息
|
||||
/* this.sendEntMsg(sysUser,bookEntCheckId,baseEntId);*/
|
||||
|
||||
//如果检查记录企业未签名 在新增一个通知
|
||||
if(2 == notSign){
|
||||
addCheckNotice(sysEnterprise,bookEntCheck.getBookentcheckid());
|
||||
}
|
||||
|
||||
//添加日志
|
||||
super.addLog(sysUserId,baseEntId,"BookEntCheck",bookEntCheckId,"增加",JSONArray.toJSONString(httpServletRequest.getParameterMap()));
|
||||
result.setMessage("新增检查成功");
|
||||
}else{
|
||||
result.setCode(Code.EX_PARAM.getCode());
|
||||
result.setMessage(Message.EX_PARAM);
|
||||
}
|
||||
return result;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1218,6 +1392,7 @@ public class MinWorkController extends BaseController{
|
|||
for(BookEntCheckDetailWithBLOBs checkDetail : entcheckDetails){
|
||||
ChkBillDetailWithBLOBs billDetail = chkBillDetailMapper.selectByPrimaryKey(checkDetail.getChkbilldetailid());
|
||||
if(null != billDetail){
|
||||
checkDetail.setBookentcheckdetailid(RandomNumber.getUUid());
|
||||
checkDetail.setCheckitemno(checkItemIndex);
|
||||
checkDetail.setChkbilldetailid(billDetail.getChkbilldetailid());
|
||||
checkDetail.setCheckobjectname(billDetail.getCheckobjectname());
|
||||
|
|
@ -1257,7 +1432,7 @@ public class MinWorkController extends BaseController{
|
|||
List<HiddenDanger> hiddenDangers = checkDetail.getHiddenDangers();
|
||||
if(null != hiddenDangers && hiddenDangers.size() > 0){
|
||||
for (HiddenDanger hiddenDanger : hiddenDangers){
|
||||
if(null == hiddenDanger.getId()){
|
||||
// if(null == hiddenDanger.getId()){
|
||||
//隐患类型
|
||||
String htlevel = "一般隐患";
|
||||
if(StringUtils.isNotBlank(billDetail.getHazardtype())){
|
||||
|
|
@ -1317,7 +1492,7 @@ public class MinWorkController extends BaseController{
|
|||
relation.setModifiedby(sysUser.getSysuserid());
|
||||
relation.setModifiedon(new Date());
|
||||
relations.add(relation);
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user