完善流程

This commit is contained in:
wanggeng888 2021-06-22 17:21:24 +08:00
parent 77cf6624f6
commit 55b22c9c65
9 changed files with 1019 additions and 671 deletions

View File

@ -0,0 +1,135 @@
package com.cm.inspection.controller.apis.check;
import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.ErrorResult;
import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultList;
import com.cm.inspection.pojo.dtos.check.Check2DTO;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import com.cm.inspection.pojo.dtos.hiddendangerreport.HiddenDangerReportDTO;
import com.cm.inspection.service.check.ICheck2Service;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* @ClassName: CheckController
* @Description: 检查表
* @Author: WenG
* @Date: 2020-03-25 22:59
* @Version: 1.0
**/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "检查表接口")
@RestController
@RequestMapping(ISystemConstant.API_PREFIX + "/check2")
public class Check2Controller extends AbstractController {
@Autowired
private ICheck2Service check2Service;
@Autowired
private SecurityComponent securityComponent;
@ApiOperation(value = "删除检查表(id列表)", notes = "删除检查表(id列表)接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "ids", value = "ID列表用下划线分隔", paramType = "path", example = "1_2_3")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@DeleteMapping("remove/{ids}")
public SuccessResult removeCheck(@PathVariable("ids") String ids) throws RemoveException {
check2Service.remove(Arrays.asList(ids.split("\\_")));
return new SuccessResult();
}
@ApiOperation(value = "检查表详情(通过ID)", notes = "检查表详情(通过ID)接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "checkId", value = "检查表ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{checkId}")
public Check2DTO getCheckById(@PathVariable("checkId") String checkId) throws SearchException {
return check2Service.get(checkId);
}
@ApiOperation(value = "检查表列表", notes = "检查表列表接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list")
public List<Check2DTO> listCheck() throws SearchException {
Map<String, Object> params = requestParams();
return check2Service.list(params);
}
@ApiOperation(value = "检查表分页列表", notes = "检查表分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage")
public SuccessResultList<List<Check2DTO>> listPage(ListPage page) throws SearchException {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPage(page);
}
@ApiOperation(value = "检查表分页列表", notes = "检查表分页列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "checkMonth", value = "检查月份yyyy-MM", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage-check-of-mine")
public SuccessResultList<List<Check2DTO>> listPageCheckOfMine(ListPage page) throws SearchException {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPageCheckOfMine(page);
}
@ApiOperation(value = "我的复查项列表", notes = "我的复查项列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"),
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"),
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage-recheck-of-mine")
public SuccessResultList<List<Check2DTO>> listPageReCheckOfMine(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPageReCheckOfMine(page);
}
@ApiOperation(value = "未通过的检查项列表通过检查ID", notes = "未通过的检查项列表通过检查ID接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list-check-item-unpass/{checkId}")
public List<CheckItemDTO> listCheckItemUnPass(@PathVariable("checkId") String checkId) {
return check2Service.listCheckItemUnPass(checkId);
}
@ApiOperation(value = "检查、复查项列表通过检查ID", notes = "检查、复查项列表通过检查ID接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list-check-item/{checkId}")
public List<HiddenDangerReportDTO> listCheckItem(@PathVariable("checkId") String checkId) {
return check2Service.listCheckItem(checkId);
}
}

View File

@ -4,6 +4,7 @@ import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.exception.UpdateException;
import com.cm.inspection.pojo.dtos.check.Check2DTO;
import com.cm.inspection.pojo.dtos.check.CheckDTO;
import com.cm.inspection.pojo.dtos.check.CheckSimpleWithEnterpriseDTO;
import org.springframework.stereotype.Repository;
@ -27,7 +28,7 @@ public interface ICheck2Dao {
* @param params
* @throws SaveException
*/
void saveCheck(Map<String, Object> params) throws SaveException;
void save(Map<String, Object> params) throws SaveException;
/**
* 删除检查表
@ -52,7 +53,7 @@ public interface ICheck2Dao {
* @return
* @throws SearchException
*/
CheckDTO getCheck(Map<String, Object> params) throws SearchException;
Check2DTO get(Map<String, Object> params) throws SearchException;
/**
* 检查表列表
@ -61,7 +62,7 @@ public interface ICheck2Dao {
* @return
* @throws SearchException
*/
List<CheckDTO> listCheck(Map<String, Object> params) throws SearchException;
List<Check2DTO> list(Map<String, Object> params) throws SearchException;
/**
* 统计检查
@ -79,7 +80,7 @@ public interface ICheck2Dao {
* @return
* @throws SearchException
*/
List<CheckDTO> listCheckSimple(Map<String, Object> params) throws SearchException;
List<Check2DTO> listCheckSimple(Map<String, Object> params) throws SearchException;
/**
* 统计企业的检查数

View File

@ -0,0 +1,104 @@
package com.cm.inspection.pojo.dtos.check;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName: CheckDTO
* @Description: 检查表
* @Author: WenG
* @Date: 2020-03-25 22:59
* @Version: 1.0
**/
@Data
@ApiModel
public class Check2DTO implements Serializable {
private static final long serialVersionUID = 8091406036283293185L;
@ApiModelProperty(name = "checkId", value = "主键")
private String checkId;
@ApiModelProperty(name = "enterpriseId", value = "企业ID")
private String enterpriseId;
@ApiModelProperty(name = "enterpriseName", value = "企业名称")
private String enterpriseName;
@ApiModelProperty(name = "enterpriseType", value = "企业类型")
private String enterpriseType;
@ApiModelProperty(name = "enterpriseTypeName", value = "企业类型名称")
private String enterpriseTypeName;
@ApiModelProperty(name = "enterpriseArea1", value = "企业1级地区")
private String enterpriseArea1;
@ApiModelProperty(name = "enterpriseArea1Name", value = "企业1级地区名称")
private String enterpriseArea1Name;
@ApiModelProperty(name = "enterpriseArea2", value = "企业2级区域")
private String enterpriseArea2;
@ApiModelProperty(name = "enterpriseArea2Name", value = "企业2级地区名称")
private String enterpriseArea2Name;
@ApiModelProperty(name = "enterpriseArea3", value = "企业3级区域")
private String enterpriseArea3;
@ApiModelProperty(name = "enterpriseArea3Name", value = "企业3级地区名称")
private String enterpriseArea3Name;
@ApiModelProperty(name = "enterpriseArea4", value = "企业4级区域")
private String enterpriseArea4;
@ApiModelProperty(name = "enterpriseArea4Name", value = "企业4级地区名称")
private String enterpriseArea4Name;
@ApiModelProperty(name = "enterpriseArea5", value = "企业5级区域")
private String enterpriseArea5;
@ApiModelProperty(name = "enterpriseArea5Name", value = "企业5级地区名称")
private String enterpriseArea5Name;
@ApiModelProperty(name = "enterpriseAddress", value = "企业详细地址")
private String enterpriseAddress;
@ApiModelProperty(name = "enterpriseIndustry", value = "企业管理行业")
private String enterpriseIndustry;
@ApiModelProperty(name = "enterpriseIndustryName", value = "企业管理行业字典名称")
private String enterpriseIndustryName;
@ApiModelProperty(name = "enterpriseEngagedCount", value = "企业从业人数")
private String enterpriseEngagedCount;
@ApiModelProperty(name = "enterpriseRiskOperation", value = "企业风险作业")
private String enterpriseRiskOperation;
@ApiModelProperty(name = "enterpriseRiskOperationName", value = "风险作业字典名称")
private String enterpriseRiskOperationName;
@ApiModelProperty(name = "enterpriseMaster", value = "企业负责人")
private String enterpriseMaster;
@ApiModelProperty(name = "enterprisePhone", value = "企业联系电话")
private String enterprisePhone;
@ApiModelProperty(name = "enterpriseLng", value = "企业经度")
private String enterpriseLng;
@ApiModelProperty(name = "enterpriseLat", value = "企业纬度")
private String enterpriseLat;
@ApiModelProperty(name = "enterpriseFactoryGate", value = "经营外贸")
private String enterpriseFactoryGate;
@ApiModelProperty(name = "enterpriseWorkplace", value = "作业场所")
private String enterpriseWorkplace;
@ApiModelProperty(name = "checkType", value = "检查类型")
private Integer checkType;
@ApiModelProperty(name = "taskCheckId", value = "任务检查ID")
private String taskCheckId;
@ApiModelProperty(name = "isCoordination", value = "是否配合")
private Integer isCoordination;
@ApiModelProperty(name = "isComplete", value = "是否完成")
private Integer isComplete;
@ApiModelProperty(name = "rectificationType", value = "整改类型")
private Integer rectificationType;
@ApiModelProperty(name = "immediatelyChangeType", value = "立即改类型")
private Integer immediatelyChangeType;
@ApiModelProperty(name = "rectificationDays", value = "整改天数")
private Integer rectificationDays;
@ApiModelProperty(name = "summary", value = "说明")
private String summary;
@ApiModelProperty(name = "checkLng", value = "检查经度")
private String checkLng;
@ApiModelProperty(name = "checkLat", value = "检查纬度")
private String checkLat;
@ApiModelProperty(name = "gmtCreate", value = "时间")
private String gmtCreate;
@ApiModelProperty(name = "creator", value = "创建人")
private String creator;
@ApiModelProperty(name = "checkItems", value = "检查列表")
private List<CheckItemDTO> checkItems;
}

View File

@ -2,6 +2,7 @@ package com.cm.inspection.pojo.dtos.check;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ -15,6 +16,7 @@ import java.io.Serializable;
* @Date: 2020/8/29 17:28
* @Version: 1.0
**/
@Data
@ApiModel
public class CheckSimpleWithEnterpriseDTO implements Serializable {
@ -66,187 +68,4 @@ public class CheckSimpleWithEnterpriseDTO implements Serializable {
@ApiModelProperty(name = "isComplete", value = "是否完成")
private Integer isComplete;
public String getCheckId() {
return checkId == null ? "" : checkId.trim();
}
public void setCheckId(String checkId) {
this.checkId = checkId;
}
public String getEnterpriseId() {
return enterpriseId == null ? "" : enterpriseId.trim();
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getEnterpriseName() {
return enterpriseName == null ? "" : enterpriseName.trim();
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getEnterpriseArea1() {
return enterpriseArea1 == null ? "" : enterpriseArea1.trim();
}
public void setEnterpriseArea1(String enterpriseArea1) {
this.enterpriseArea1 = enterpriseArea1;
}
public String getEnterpriseArea2() {
return enterpriseArea2 == null ? "" : enterpriseArea2.trim();
}
public void setEnterpriseArea2(String enterpriseArea2) {
this.enterpriseArea2 = enterpriseArea2;
}
public String getEnterpriseArea3() {
return enterpriseArea3 == null ? "" : enterpriseArea3.trim();
}
public void setEnterpriseArea3(String enterpriseArea3) {
this.enterpriseArea3 = enterpriseArea3;
}
public String getEnterpriseArea4() {
return enterpriseArea4 == null ? "" : enterpriseArea4.trim();
}
public void setEnterpriseArea4(String enterpriseArea4) {
this.enterpriseArea4 = enterpriseArea4;
}
public String getEnterpriseArea5() {
return enterpriseArea5 == null ? "" : enterpriseArea5.trim();
}
public void setEnterpriseArea5(String enterpriseArea5) {
this.enterpriseArea5 = enterpriseArea5;
}
public String getEnterpriseIndustryType() {
return enterpriseIndustryType == null ? "" : enterpriseIndustryType.trim();
}
public void setEnterpriseIndustryType(String enterpriseIndustryType) {
this.enterpriseIndustryType = enterpriseIndustryType;
}
public String getEnterpriseIndustry() {
return enterpriseIndustry == null ? "" : enterpriseIndustry.trim();
}
public void setEnterpriseIndustry(String enterpriseIndustry) {
this.enterpriseIndustry = enterpriseIndustry;
}
public String getEnterpriseRiskOperation() {
return enterpriseRiskOperation == null ? "" : enterpriseRiskOperation.trim();
}
public void setEnterpriseRiskOperation(String enterpriseRiskOperation) {
this.enterpriseRiskOperation = enterpriseRiskOperation;
}
public String getEnterpriseMaster() {
return enterpriseMaster == null ? "" : enterpriseMaster.trim();
}
public void setEnterpriseMaster(String enterpriseMaster) {
this.enterpriseMaster = enterpriseMaster;
}
public String getEnterprisePhone() {
return enterprisePhone == null ? "" : enterprisePhone.trim();
}
public void setEnterprisePhone(String enterprisePhone) {
this.enterprisePhone = enterprisePhone;
}
public String getEnterpriseLng() {
return enterpriseLng == null ? "" : enterpriseLng.trim();
}
public void setEnterpriseLng(String enterpriseLng) {
this.enterpriseLng = enterpriseLng;
}
public String getEnterpriseLat() {
return enterpriseLat == null ? "" : enterpriseLat.trim();
}
public void setEnterpriseLat(String enterpriseLat) {
this.enterpriseLat = enterpriseLat;
}
public String getEnterpriseFactoryGate() {
return enterpriseFactoryGate == null ? "" : enterpriseFactoryGate.trim();
}
public void setEnterpriseFactoryGate(String enterpriseFactoryGate) {
this.enterpriseFactoryGate = enterpriseFactoryGate;
}
public String getEnterpriseWorkplace() {
return enterpriseWorkplace == null ? "" : enterpriseWorkplace.trim();
}
public void setEnterpriseWorkplace(String enterpriseWorkplace) {
this.enterpriseWorkplace = enterpriseWorkplace;
}
public String getCheckType() {
return checkType == null ? "" : checkType.trim();
}
public void setCheckType(String checkType) {
this.checkType = checkType;
}
public String getCheckLng() {
return checkLng == null ? "" : checkLng.trim();
}
public void setCheckLng(String checkLng) {
this.checkLng = checkLng;
}
public String getCheckLat() {
return checkLat == null ? "" : checkLat.trim();
}
public void setCheckLat(String checkLat) {
this.checkLat = checkLat;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate.trim();
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public Integer getIsComplete() {
return isComplete;
}
public void setIsComplete(Integer isComplete) {
this.isComplete = isComplete;
}
}

View File

@ -1,427 +0,0 @@
package com.cm.inspection.pojo.dtos.check;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName: CheckDTO
* @Description: 检查表
* @Author: WenG
* @Date: 2020-03-25 22:59
* @Version: 1.0
**/
@ApiModel
public class CheckV2DTO implements Serializable {
private static final long serialVersionUID = 1066469161696590595L;
@ApiModelProperty(name = "checkId", value = "主键")
private String checkId;
@ApiModelProperty(name = "enterpriseId", value = "企业ID")
private String enterpriseId;
@ApiModelProperty(name = "nameJoinByEnterpriseId", value = "企业ID的名称")
private String nameJoinByEnterpriseId;
@ApiModelProperty(name = "typeJoinByEnterpriseId", value = "企业ID的类型")
private String typeJoinByEnterpriseId;
@ApiModelProperty(name = "typeDictionaryName", value = "类型字典名称")
private String typeDictionaryName;
@ApiModelProperty(name = "area1JoinByEnterpriseId", value = "企业ID的1级地区")
private String area1JoinByEnterpriseId;
@ApiModelProperty(name = "area1DictionaryName", value = "企业1级地区名称")
private String area1DictionaryName;
@ApiModelProperty(name = "area2JoinByEnterpriseId", value = "企业ID的2级区域")
private String area2JoinByEnterpriseId;
@ApiModelProperty(name = "area2DictionaryName", value = "企业2级地区名称")
private String area2DictionaryName;
@ApiModelProperty(name = "area3JoinByEnterpriseId", value = "企业ID的3级区域")
private String area3JoinByEnterpriseId;
@ApiModelProperty(name = "area3DictionaryName", value = "企业3级地区名称")
private String area3DictionaryName;
@ApiModelProperty(name = "area4JoinByEnterpriseId", value = "企业ID的4级区域")
private String area4JoinByEnterpriseId;
@ApiModelProperty(name = "area4DictionaryName", value = "企业4级地区名称")
private String area4DictionaryName;
@ApiModelProperty(name = "area5JoinByEnterpriseId", value = "企业ID的5级区域")
private String area5JoinByEnterpriseId;
@ApiModelProperty(name = "area5DictionaryName", value = "企业5级地区名称")
private String area5DictionaryName;
@ApiModelProperty(name = "addressJoinByEnterpriseId", value = "企业ID的详细地址")
private String addressJoinByEnterpriseId;
@ApiModelProperty(name = "industryJoinByEnterpriseId", value = "企业ID的管理行业")
private String industryJoinByEnterpriseId;
@ApiModelProperty(name = "industryDictionaryName", value = "管理行业字典名称")
private String industryDictionaryName;
@ApiModelProperty(name = "engagedCountJoinByEnterpriseId", value = "企业ID的从业人数")
private String engagedCountJoinByEnterpriseId;
@ApiModelProperty(name = "riskOperationJoinByEnterpriseId", value = "企业ID的风险作业")
private String riskOperationJoinByEnterpriseId;
@ApiModelProperty(name = "riskOperationDictionaryName", value = "风险作业字典名称")
private String riskOperationDictionaryName;
@ApiModelProperty(name = "masterJoinByEnterpriseId", value = "企业ID的负责人")
private String masterJoinByEnterpriseId;
@ApiModelProperty(name = "phoneJoinByEnterpriseId", value = "企业ID的联系电话")
private String phoneJoinByEnterpriseId;
@ApiModelProperty(name = "enterpriseLngByEnterpriseId", value = "企业经度")
private String enterpriseLngByEnterpriseId;
@ApiModelProperty(name = "enterpriseLatByEnterpriseId", value = "企业纬度")
private String enterpriseLatByEnterpriseId;
@ApiModelProperty(name = "factoryGateByEnterpriseId", value = "经营外贸")
private String factoryGateByEnterpriseId;
@ApiModelProperty(name = "workplaceByEnterpriseId", value = "作业场所")
private String workplaceByEnterpriseId;
@ApiModelProperty(name = "checkType", value = "检查类型")
private Integer checkType;
@ApiModelProperty(name = "taskCheckId", value = "任务检查ID")
private String taskCheckId;
@ApiModelProperty(name = "isCoordination", value = "是否配合")
private Integer isCoordination;
@ApiModelProperty(name = "isComplete", value = "是否完成")
private Integer isComplete;
@ApiModelProperty(name = "rectificationType", value = "整改类型")
private Integer rectificationType;
@ApiModelProperty(name = "immediatelyChangeType", value = "立即改类型")
private Integer immediatelyChangeType;
@ApiModelProperty(name = "rectificationDays", value = "整改天数")
private Integer rectificationDays;
@ApiModelProperty(name = "summary", value = "说明")
private String summary;
@ApiModelProperty(name = "checkLng", value = "检查经度")
private String checkLng;
@ApiModelProperty(name = "checkLat", value = "检查纬度")
private String checkLat;
@ApiModelProperty(name = "gmtCreate", value = "时间")
private String gmtCreate;
@ApiModelProperty(name = "creator", value = "创建人")
private String creator;
@ApiModelProperty(name = "checkItems", value = "检查列表")
private List<CheckItemDTO> checkItems;
public String getCheckId() {
return checkId == null ? "" : checkId;
}
public void setCheckId(String checkId) {
this.checkId = checkId;
}
public String getEnterpriseId() {
return enterpriseId == null ? "" : enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getNameJoinByEnterpriseId() {
return nameJoinByEnterpriseId == null ? "" : nameJoinByEnterpriseId;
}
public void setNameJoinByEnterpriseId(String nameJoinByEnterpriseId) {
this.nameJoinByEnterpriseId = nameJoinByEnterpriseId;
}
public String getTypeJoinByEnterpriseId() {
return typeJoinByEnterpriseId == null ? "" : typeJoinByEnterpriseId;
}
public void setTypeJoinByEnterpriseId(String typeJoinByEnterpriseId) {
this.typeJoinByEnterpriseId = typeJoinByEnterpriseId;
}
public String getTypeDictionaryName() {
return typeDictionaryName == null ? "" : typeDictionaryName;
}
public void setTypeDictionaryName(String typeDictionaryName) {
this.typeDictionaryName = typeDictionaryName;
}
public String getArea1JoinByEnterpriseId() {
return area1JoinByEnterpriseId == null ? "" : area1JoinByEnterpriseId;
}
public void setArea1JoinByEnterpriseId(String area1JoinByEnterpriseId) {
this.area1JoinByEnterpriseId = area1JoinByEnterpriseId;
}
public String getArea1DictionaryName() {
return area1DictionaryName == null ? "" : area1DictionaryName;
}
public void setArea1DictionaryName(String area1DictionaryName) {
this.area1DictionaryName = area1DictionaryName;
}
public String getArea2JoinByEnterpriseId() {
return area2JoinByEnterpriseId == null ? "" : area2JoinByEnterpriseId;
}
public void setArea2JoinByEnterpriseId(String area2JoinByEnterpriseId) {
this.area2JoinByEnterpriseId = area2JoinByEnterpriseId;
}
public String getArea2DictionaryName() {
return area2DictionaryName == null ? "" : area2DictionaryName;
}
public void setArea2DictionaryName(String area2DictionaryName) {
this.area2DictionaryName = area2DictionaryName;
}
public String getArea3JoinByEnterpriseId() {
return area3JoinByEnterpriseId == null ? "" : area3JoinByEnterpriseId;
}
public void setArea3JoinByEnterpriseId(String area3JoinByEnterpriseId) {
this.area3JoinByEnterpriseId = area3JoinByEnterpriseId;
}
public String getArea3DictionaryName() {
return area3DictionaryName == null ? "" : area3DictionaryName;
}
public void setArea3DictionaryName(String area3DictionaryName) {
this.area3DictionaryName = area3DictionaryName;
}
public String getArea4JoinByEnterpriseId() {
return area4JoinByEnterpriseId == null ? "" : area4JoinByEnterpriseId;
}
public void setArea4JoinByEnterpriseId(String area4JoinByEnterpriseId) {
this.area4JoinByEnterpriseId = area4JoinByEnterpriseId;
}
public String getArea4DictionaryName() {
return area4DictionaryName == null ? "" : area4DictionaryName;
}
public void setArea4DictionaryName(String area4DictionaryName) {
this.area4DictionaryName = area4DictionaryName;
}
public String getArea5JoinByEnterpriseId() {
return area5JoinByEnterpriseId == null ? "" : area5JoinByEnterpriseId;
}
public void setArea5JoinByEnterpriseId(String area5JoinByEnterpriseId) {
this.area5JoinByEnterpriseId = area5JoinByEnterpriseId;
}
public String getArea5DictionaryName() {
return area5DictionaryName == null ? "" : area5DictionaryName;
}
public void setArea5DictionaryName(String area5DictionaryName) {
this.area5DictionaryName = area5DictionaryName;
}
public String getAddressJoinByEnterpriseId() {
return addressJoinByEnterpriseId == null ? "" : addressJoinByEnterpriseId;
}
public void setAddressJoinByEnterpriseId(String addressJoinByEnterpriseId) {
this.addressJoinByEnterpriseId = addressJoinByEnterpriseId;
}
public String getIndustryJoinByEnterpriseId() {
return industryJoinByEnterpriseId == null ? "" : industryJoinByEnterpriseId;
}
public void setIndustryJoinByEnterpriseId(String industryJoinByEnterpriseId) {
this.industryJoinByEnterpriseId = industryJoinByEnterpriseId;
}
public String getIndustryDictionaryName() {
return industryDictionaryName == null ? "" : industryDictionaryName;
}
public void setIndustryDictionaryName(String industryDictionaryName) {
this.industryDictionaryName = industryDictionaryName;
}
public String getEngagedCountJoinByEnterpriseId() {
return engagedCountJoinByEnterpriseId == null ? "" : engagedCountJoinByEnterpriseId;
}
public void setEngagedCountJoinByEnterpriseId(String engagedCountJoinByEnterpriseId) {
this.engagedCountJoinByEnterpriseId = engagedCountJoinByEnterpriseId;
}
public String getRiskOperationJoinByEnterpriseId() {
return riskOperationJoinByEnterpriseId == null ? "" : riskOperationJoinByEnterpriseId;
}
public void setRiskOperationJoinByEnterpriseId(String riskOperationJoinByEnterpriseId) {
this.riskOperationJoinByEnterpriseId = riskOperationJoinByEnterpriseId;
}
public String getRiskOperationDictionaryName() {
return riskOperationDictionaryName == null ? "" : riskOperationDictionaryName;
}
public void setRiskOperationDictionaryName(String riskOperationDictionaryName) {
this.riskOperationDictionaryName = riskOperationDictionaryName;
}
public String getMasterJoinByEnterpriseId() {
return masterJoinByEnterpriseId == null ? "" : masterJoinByEnterpriseId;
}
public void setMasterJoinByEnterpriseId(String masterJoinByEnterpriseId) {
this.masterJoinByEnterpriseId = masterJoinByEnterpriseId;
}
public String getPhoneJoinByEnterpriseId() {
return phoneJoinByEnterpriseId == null ? "" : phoneJoinByEnterpriseId;
}
public void setPhoneJoinByEnterpriseId(String phoneJoinByEnterpriseId) {
this.phoneJoinByEnterpriseId = phoneJoinByEnterpriseId;
}
public String getEnterpriseLngByEnterpriseId() {
return enterpriseLngByEnterpriseId == null ? "" : enterpriseLngByEnterpriseId;
}
public void setEnterpriseLngByEnterpriseId(String enterpriseLngByEnterpriseId) {
this.enterpriseLngByEnterpriseId = enterpriseLngByEnterpriseId;
}
public String getEnterpriseLatByEnterpriseId() {
return enterpriseLatByEnterpriseId == null ? "" : enterpriseLatByEnterpriseId;
}
public void setEnterpriseLatByEnterpriseId(String enterpriseLatByEnterpriseId) {
this.enterpriseLatByEnterpriseId = enterpriseLatByEnterpriseId;
}
public String getFactoryGateByEnterpriseId() {
return factoryGateByEnterpriseId == null ? "" : factoryGateByEnterpriseId;
}
public void setFactoryGateByEnterpriseId(String factoryGateByEnterpriseId) {
this.factoryGateByEnterpriseId = factoryGateByEnterpriseId;
}
public String getWorkplaceByEnterpriseId() {
return workplaceByEnterpriseId == null ? "" : workplaceByEnterpriseId;
}
public void setWorkplaceByEnterpriseId(String workplaceByEnterpriseId) {
this.workplaceByEnterpriseId = workplaceByEnterpriseId;
}
public Integer getCheckType() {
return checkType;
}
public void setCheckType(Integer checkType) {
this.checkType = checkType;
}
public String getTaskCheckId() {
return taskCheckId == null ? "" : taskCheckId.trim();
}
public void setTaskCheckId(String taskCheckId) {
this.taskCheckId = taskCheckId;
}
public Integer getIsCoordination() {
return isCoordination;
}
public void setIsCoordination(Integer isCoordination) {
this.isCoordination = isCoordination;
}
public Integer getIsComplete() {
return isComplete;
}
public void setIsComplete(Integer isComplete) {
this.isComplete = isComplete;
}
public Integer getRectificationType() {
return rectificationType;
}
public void setRectificationType(Integer rectificationType) {
this.rectificationType = rectificationType;
}
public Integer getImmediatelyChangeType() {
return immediatelyChangeType;
}
public void setImmediatelyChangeType(Integer immediatelyChangeType) {
this.immediatelyChangeType = immediatelyChangeType;
}
public Integer getRectificationDays() {
return rectificationDays;
}
public void setRectificationDays(Integer rectificationDays) {
this.rectificationDays = rectificationDays;
}
public String getSummary() {
return summary == null ? "" : summary;
}
public void setSummary(String summary) {
this.summary = summary;
}
public String getCheckLng() {
return checkLng == null ? "" : checkLng;
}
public void setCheckLng(String checkLng) {
this.checkLng = checkLng;
}
public String getCheckLat() {
return checkLat == null ? "" : checkLat;
}
public void setCheckLat(String checkLat) {
this.checkLat = checkLat;
}
public String getGmtCreate() {
return gmtCreate == null ? "" : gmtCreate;
}
public void setGmtCreate(String gmtCreate) {
this.gmtCreate = gmtCreate;
}
public String getCreator() {
return creator == null ? "" : creator.trim();
}
public void setCreator(String creator) {
this.creator = creator;
}
public List<CheckItemDTO> getCheckItems() {
if (checkItems == null) {
return new ArrayList<>();
}
return checkItems;
}
public void setCheckItems(List<CheckItemDTO> checkItems) {
this.checkItems = checkItems;
}
}

View File

@ -1,7 +1,15 @@
package com.cm.inspection.service.check;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResultList;
import com.cm.inspection.pojo.dtos.check.Check2DTO;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import com.cm.inspection.pojo.dtos.hiddendangerreport.HiddenDangerReportDTO;
import com.cm.inspection.pojo.vos.check.Check2VO;
import java.util.List;
import java.util.Map;
/**
* @ClassName: ICheckService
* @Description: 检查表
@ -19,6 +27,7 @@ public interface ICheck2Service {
*
* @param token
* @param check2VO
* @throws Exception
*/
void save(String token, Check2VO check2VO) throws Exception;
@ -32,5 +41,75 @@ public interface ICheck2Service {
*/
void saveRe(String token, String checkId, Check2VO check2VO) throws Exception;
/**
* 删除
*
* @param ids
* @return
*/
void remove(List<String> ids);
/**
* 详情
*
* @param params
* @return
*/
Check2DTO get(Map<String, Object> params);
/**
* 详情
*
* @param checkId
* @return
*/
Check2DTO get(String checkId);
/**
* 列表
*
* @param params
* @return
*/
List<Check2DTO> list(Map<String, Object> params);
/**
* 分页列表
*
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPage(ListPage page);
/**
* 我的检查列表
*
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageCheckOfMine(ListPage page);
/**
* 我的复查列表
*
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageReCheckOfMine(ListPage page);
/**
* 未通过的检查项列表
*
* @param checkId
* @return
*/
List<CheckItemDTO> listCheckItemUnPass(String checkId);
/**
* 检查项列表
*
* @param checkId
* @return
*/
List<HiddenDangerReportDTO> listCheckItem(String checkId);
}

View File

@ -1,6 +1,8 @@
package com.cm.inspection.service.check.impl;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.inspection.dao.check.ICheck2Dao;
@ -8,8 +10,11 @@ import com.cm.inspection.enums.CheckProcessParamsEnum;
import com.cm.inspection.enums.CheckTypeEnum;
import com.cm.inspection.enums.GridPersonnelTypeEnum;
import com.cm.inspection.enums.HiddenDangerReportTypeEnum;
import com.cm.inspection.pojo.dtos.check.Check2DTO;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import com.cm.inspection.pojo.dtos.checkitemoption.CheckItemOptionDTO;
import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO;
import com.cm.inspection.pojo.dtos.hiddendangerreport.HiddenDangerReportDTO;
import com.cm.inspection.pojo.dtos.industrycheckitem.IndustryCheckItemDTO;
import com.cm.inspection.pojo.vos.check.Check2VO;
import com.cm.inspection.pojo.vos.hiddendangerreport.HiddenDangerReportVO;
@ -23,6 +28,8 @@ import com.cm.inspection.service.hiddendangerreport.IHiddenDangerReportService;
import com.cm.inspection.service.industrycheckitem.IIndustryCheckItemService;
import com.cm.inspection.service.process.IProcessService;
import com.cm.inspection.service.taskcheck.ITaskCheckService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -71,7 +78,7 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
params.put("checkId", checkId);
setSaveInfo(token, params);
LOG.debug("保存检查记录");
check2Dao.saveCheck(params);
check2Dao.save(params);
String grid = params.get("creator").toString();
startCheckProcess(token, checkId, grid, check2VO);
}
@ -89,12 +96,64 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
throw new SearchException("上级领导不存在,请联系管理员");
}
LOG.debug("保存复查记录");
check2Dao.saveCheck(params);
check2Dao.save(params);
LOG.debug("标记之前的检查为完成状态");
updateCheckIsCompleteInfo(token, checkId, 1);
reCheckProcess(token, reCheckId, checkId, grid, leaderId, check2VO);
}
@Override
public void remove(List<String> ids) {
Map<String, Object> params = getHashMap(2);
params.put("ids", ids);
check2Dao.removeCheck(params);
}
@Override
public Check2DTO get(Map<String, Object> params) {
return check2Dao.get(params);
}
@Override
public Check2DTO get(String checkId) {
Map<String, Object> params = getHashMap(2);
params.put("checkId", checkId);
return get(params);
}
@Override
public List<Check2DTO> list(Map<String, Object> params) {
return check2Dao.list(params);
}
@Override
public SuccessResultList<List<Check2DTO>> listPage(ListPage page) {
PageHelper.startPage(page.getPage(), page.getRows());
List<Check2DTO> check2DTOs = list(page.getParams());
PageInfo<Check2DTO> pageInfo = new PageInfo<>(check2DTOs);
return new SuccessResultList<>(check2DTOs, pageInfo.getPageNum(), pageInfo.getTotal());
}
@Override
public SuccessResultList<List<Check2DTO>> listPageCheckOfMine(ListPage page) {
return null;
}
@Override
public SuccessResultList<List<Check2DTO>> listPageReCheckOfMine(ListPage page) {
return null;
}
@Override
public List<CheckItemDTO> listCheckItemUnPass(String checkId) {
return null;
}
@Override
public List<HiddenDangerReportDTO> listCheckItem(String checkId) {
return null;
}
/**
* 开启检查流程
*

View File

@ -4,34 +4,34 @@
<cache flushInterval="3600000"/>
<resultMap id="checkDTO" type="com.cm.inspection.pojo.dtos.check.CheckDTO">
<resultMap id="check2DTO" type="com.cm.inspection.pojo.dtos.check.Check2DTO">
<id column="check_id" property="checkId"/>
<result column="enterprise_id" property="enterpriseId"/>
<result column="name_join_by_enterprise_id" property="nameJoinByEnterpriseId"/>
<result column="type_join_by_enterprise_id" property="typeJoinByEnterpriseId"/>
<result column="type_dictionary_name" property="typeDictionaryName"/>
<result column="area1_join_by_enterprise_id" property="area1JoinByEnterpriseId"/>
<result column="area1_dictionary_name" property="area1DictionaryName"/>
<result column="area2_join_by_enterprise_id" property="area2JoinByEnterpriseId"/>
<result column="area2_dictionary_name" property="area2DictionaryName"/>
<result column="area3_join_by_enterprise_id" property="area3JoinByEnterpriseId"/>
<result column="area3_dictionary_name" property="area3DictionaryName"/>
<result column="area4_join_by_enterprise_id" property="area4JoinByEnterpriseId"/>
<result column="area4_dictionary_name" property="area4DictionaryName"/>
<result column="area5_join_by_enterprise_id" property="area5JoinByEnterpriseId"/>
<result column="area5_dictionary_name" property="area5DictionaryName"/>
<result column="address_join_by_enterprise_id" property="addressJoinByEnterpriseId"/>
<result column="industry_join_by_enterprise_id" property="industryJoinByEnterpriseId"/>
<result column="industry_dictionary_name" property="industryDictionaryName"/>
<result column="engaged_count_join_by_enterprise_id" property="engagedCountJoinByEnterpriseId"/>
<result column="risk_operation_join_by_enterprise_id" property="riskOperationJoinByEnterpriseId"/>
<result column="risk_operation_dictionary_name" property="riskOperationDictionaryName"/>
<result column="master_join_by_enterprise_id" property="masterJoinByEnterpriseId"/>
<result column="phone_join_by_enterprise_id" property="phoneJoinByEnterpriseId"/>
<result column="enterprise_lng_by_enterprise_id" property="enterpriseLngByEnterpriseId"/>
<result column="enterprise_lat_by_enterprise_id" property="enterpriseLatByEnterpriseId"/>
<result column="factory_gate_by_enterprise_id" property="factoryGateByEnterpriseId"/>
<result column="workplace_by_enterprise_id" property="workplaceByEnterpriseId"/>
<result column="enterprise_name" property="enterpriseName"/>
<result column="enterprise_type" property="enterpriseType"/>
<result column="enterprise_type_name" property="enterpriseTypeName"/>
<result column="enterprise_area1" property="enterpriseArea1"/>
<result column="enterprise_area1_name" property="enterpriseArea1Name"/>
<result column="enterprise_area2" property="enterpriseArea2"/>
<result column="enterprise_area2_name" property="enterpriseArea2Name"/>
<result column="enterprise_area3" property="enterpriseArea3"/>
<result column="enterprise_area3_name" property="enterpriseArea3Name"/>
<result column="enterprise_area4" property="enterpriseArea4"/>
<result column="enterprise_area4_name" property="enterpriseArea4Name"/>
<result column="enterprise_area5" property="enterpriseArea5"/>
<result column="enterprise_area5_name" property="enterpriseArea5Name"/>
<result column="enterprise_address" property="enterpriseAddress"/>
<result column="enterprise_industry" property="enterpriseIndustry"/>
<result column="enterprise_industry_name" property="enterpriseIndustryName"/>
<result column="enterprise_engaged_count" property="enterpriseEngagedCount"/>
<result column="enterprise_risk_operation" property="enterpriseRiskOperation"/>
<result column="enterprise_risk_operation_name" property="enterpriseRiskOperationName"/>
<result column="enterprise_master" property="enterpriseMaster"/>
<result column="enterprise_phone" property="enterprisePhone"/>
<result column="enterprise_lng" property="enterpriseLng"/>
<result column="enterprise_lat" property="enterpriseLat"/>
<result column="enterprise_factory_gate" property="enterpriseFactoryGate"/>
<result column="enterprise_workplace" property="enterpriseWorkplace"/>
<result column="check_type" property="checkType"/>
<result column="task_check_id" property="taskCheckId"/>
<result column="rectification_type" property="rectificationType"/>
@ -72,7 +72,7 @@
</resultMap>
<!-- 新增检查表 -->
<insert id="saveCheck" parameterType="map" flushCache="true">
<insert id="save" parameterType="map" flushCache="true">
INSERT INTO gen_check(
check_id,
enterprise_id,
@ -172,7 +172,7 @@
</update>
<!-- 检查表详情 -->
<select id="getCheck" parameterType="map" resultMap="checkDTO" useCache="true">
<select id="get" parameterType="map" resultMap="check2DTO" useCache="true">
SELECT
t1.enterprise_id,
jt1.name name_join_by_enterprise_id,
@ -207,34 +207,34 @@
</select>
<!-- 检查表列表 -->
<select id="listCheck" parameterType="map" resultMap="checkDTO" useCache="true">
<select id="list" parameterType="map" resultMap="check2DTO" useCache="true">
SELECT
t1.enterprise_id,
jt1.name name_join_by_enterprise_id,
jt1.type type_join_by_enterprise_id,
dt1.dictionary_name type_dictionary_name,
jt1.area1 area1_join_by_enterprise_id,
jt1.area1_dictionary_name area1_dictionary_name,
jt1.area2 area2_join_by_enterprise_id,
jt1.area2_dictionary_name area2_dictionary_name,
jt1.area3 area3_join_by_enterprise_id,
jt1.area3_dictionary_name area3_dictionary_name,
jt1.area4 area4_join_by_enterprise_id,
jt1.area4_dictionary_name area4_dictionary_name,
jt1.area5 area5_join_by_enterprise_id,
jt1.area5_dictionary_name area5_dictionary_name,
jt1.address address_join_by_enterprise_id,
jt1.industry industry_join_by_enterprise_id,
dt2.dictionary_name industry_dictionary_name,
jt1.engaged_count engaged_count_join_by_enterprise_id,
jt1.risk_operation risk_operation_join_by_enterprise_id,
dt3.dictionary_name risk_operation_dictionary_name,
jt1.master master_join_by_enterprise_id,
jt1.phone phone_join_by_enterprise_id,
jt1.enterprise_lng enterprise_lng_by_enterprise_id,
jt1.enterprise_lat enterprise_lat_by_enterprise_id,
jt1.factory_gate factory_gate_by_enterprise_id,
jt1.workplace workplace_by_enterprise_id,
jt1.name enterprise_name,
jt1.type enterprise_type,
dt1.dictionary_name enterprise_type_name,
jt1.area1 enterprise_area1,
jt1.area1_dictionary_name enterprise_area1_name,
jt1.area2 enterprise_area2,
jt1.area2_dictionary_name enterprise_area2_name,
jt1.area3 enterprise_area3,
jt1.area3_dictionary_name enterprise_area3_name,
jt1.area4 enterprise_area4,
jt1.area4_dictionary_name enterprise_area4_name,
jt1.area5 enterprise_area5,
jt1.area5_dictionary_name enterprise_area5_name,
jt1.address enterprise_address,
jt1.industry enterprise_industry,
dt2.dictionary_name enterprise_industry_name,
jt1.engaged_count enterprise_engaged_count,
jt1.risk_operation enterprise_risk_operation,
dt3.dictionary_name enterprise_risk_operation_name,
jt1.master enterprise_master,
jt1.phone enterprise_phone,
jt1.enterprise_lng enterprise_lng,
jt1.enterprise_lat enterprise_lat,
jt1.factory_gate enterprise_factory_gate,
jt1.workplace enterprise_workplace,
t1.check_type,
t1.task_check_id,
t1.is_coordination,
@ -431,7 +431,7 @@
</select>
<!-- 检查列表(简单格式) -->
<select id="listCheckSimple" parameterType="map" resultMap="checkDTO" useCache="true">
<select id="listCheckSimple" parameterType="map" resultMap="check2DTO" useCache="true">
SELECT
*
FROM

View File

@ -0,0 +1,578 @@
<!doctype html>
<html lang="en">
<head>
<base href="/inspection/">
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
<link rel="stylesheet" href="assets/js/vendor/swiper3/css/swiper.min.css" media="all">
<link rel="stylesheet" href="assets/css/list-css.css" media="all">
</head>
<body>
<div class="layui-fluid layui-anim layui-anim-fadein">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline search-item-width-100">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline layui-form search-item" id="typeSelectTemplateBox" lay-filter="typeSelectTemplateBox"></div>
<script id="typeSelectTemplate" type="text/html">
<select id="type" name="type">
<option value="">企业类型</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline layui-form search-item" id="industrySelectTemplateBox" lay-filter="industrySelectTemplateBox"></div>
<script id="industrySelectTemplate" type="text/html">
<select id="industry" name="industry">
<option value="">管理行业</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline layui-form search-item">
<select id="checkType" name="checkType">
<option value="">检查类型</option>
<option value="1">检查</option>
<option value="2">复查</option>
</select>
</div>
<div class="layui-inline layui-form search-item">
<select name="isCoordination" id="isCoordination">
<option value="">是否配合</option>
<option value="0">不配合</option>
<option value="1">配合</option>
</select>
</div>
<div class="layui-inline layui-form search-item">
<select name="isComplete" id="isComplete">
<option value="">是否完成</option>
<option value="0">未完成</option>
<option value="1">完成</option>
</select>
</div>
</div>
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
<div class="layui-inline layui-form search-item" id="area1SelectTemplateBox" lay-filter="area1SelectTemplateBox"></div>
<script id="area1SelectTemplate" type="text/html">
<select id="area1" name="area1" lay-filter="area1" lay-search>
<option value="">选择省</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline layui-form search-item" id="area2SelectTemplateBox" lay-filter="area2SelectTemplateBox"></div>
<script id="area2SelectTemplate" type="text/html">
<select id="area2" name="area2" lay-filter="area2" lay-search>
<option value=""></option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline layui-form search-item" id="area3SelectTemplateBox" lay-filter="area3SelectTemplateBox"></div>
<script id="area3SelectTemplate" type="text/html">
<select id="area3" name="area3" lay-filter="area3" lay-search>
<option value="">旗县区</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline layui-form search-item" id="area4SelectTemplateBox" lay-filter="area4SelectTemplateBox"></div>
<script id="area4SelectTemplate" type="text/html">
<select id="area4" name="area4" lay-filter="area4" lay-search>
<option value="">乡镇街道</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
{{# } }}
</select>
</script>
<div class="layui-inline layui-form search-item" id="area5SelectTemplateBox" lay-filter="area5SelectTemplateBox"></div>
<script id="area5SelectTemplate" type="text/html">
<select id="area5" name="area5" lay-filter="area5" lay-search>
<option value="">村社区</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dictionaryId}}">{{item.dictionaryName}}</option>
{{# } }}
</select>
</script>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
<script type="text/html" id="headerToolBar">
<div class="layui-btn-group">
<button type="button" class="layui-btn layui-btn-sm" lay-event="saveEvent">
<i class="fa fa-lg fa-plus"></i> 新增
</button>
<button type="button" class="layui-btn layui-btn-danger layui-btn-sm" lay-event="removeEvent">
<i class="fa fa-lg fa-trash"></i> 删除
</button>
</div>
</script>
</div>
</div>
</div>
</div>
</div>
<script src="assets/js/vendor/swiper3/js/swiper.min.js"></script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var form = layui.form;
var laytpl = layui.laytpl;
var common = layui.common;
var resizeTimeout = null;
var tableUrl = 'api/check2/listpage?checkType=1';
// 初始化选择框、单选、复选模板
function initSelectRadioCheckboxTemplate(templateId, templateBoxId, data, callback) {
laytpl(document.getElementById(templateId).innerHTML).render(data, function(html) {
document.getElementById(templateBoxId).innerHTML = html;
});
form.render('select', templateBoxId);
}
// 初始化1级区域下拉选择
function initArea1Select() {
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/81583ade-5466-49aa-b7b6-c643c131ea34', []), {}, null, function(code, data, args) {
initSelectRadioCheckboxTemplate('area1SelectTemplate', 'area1SelectTemplateBox', data);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化2级区域下拉选择
function initArea2Select(area1) {
if(!area1) {
initSelectRadioCheckboxTemplate('area2SelectTemplate', 'area2SelectTemplateBox', []);
return;
}
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area1}', [area1]), {}, null, function(code, data, args) {
initSelectRadioCheckboxTemplate('area2SelectTemplate', 'area2SelectTemplateBox', data);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化3级区域下拉选择
function initArea3Select(area2) {
$('#area3Box').show();
if(!area2) {
initSelectRadioCheckboxTemplate('area3SelectTemplate', 'area3SelectTemplateBox', []);
return;
}
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area2}', [area2]), {}, null, function(code, data, args) {
initSelectRadioCheckboxTemplate('area3SelectTemplate', 'area3SelectTemplateBox', data);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化4级区域下拉选择
function initArea4Select(area3) {
if(!area3) {
initSelectRadioCheckboxTemplate('area4SelectTemplate', 'area4SelectTemplateBox', []);
return;
}
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area3}', [area3]), {}, null, function(code, data, args) {
initSelectRadioCheckboxTemplate('area4SelectTemplate', 'area4SelectTemplateBox', data);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
// 初始化5级区域下拉选择
function initArea5Select(area4) {
$('#area5Box').show();
if(!area4) {
initSelectRadioCheckboxTemplate('area5SelectTemplate', 'area5SelectTemplateBox', []);
return;
}
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/{area4}', [area4]), {}, null, function(code, data, args) {
initSelectRadioCheckboxTemplate('area5SelectTemplate', 'area5SelectTemplateBox', data);
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initArea1Select();
initArea2Select();
initArea3Select();
initArea4Select();
initArea5Select();
// 初始化企业类型下拉选择
function initTypeSelect() {
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/612415f3-0ebb-4bc2-b713-e9fb1acc7f76', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('typeSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('typeSelectTemplateBox').innerHTML = html;
});
form.render('select', 'typeSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initTypeSelect();
// 初始化管理行业下拉选择
function initIndustrySelect() {
top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/b97630ab-45b7-45bc-a624-507d4df952ff', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('industrySelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('industrySelectTemplateBox').innerHTML = html;
});
form.render('select', 'industrySelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initIndustrySelect();
// 初始化表格
function initTable() {
table.render({
elem: '#dataTable',
id: 'dataTable',
url: top.restAjax.path(tableUrl, []),
width: admin.screen() > 1 ? '100%' : '',
height: $win.height() - 130,
limit: 20,
limits: [20, 40, 60, 80, 100, 200],
toolbar: '#headerToolBar',
request: {
pageName: 'page',
limitName: 'rows'
},
cols: [[
{type:'checkbox', fixed: 'left'},
{field:'rowNum', width:80, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
{field:'photos', width: 200, title: '企业图片',
templet: function(row) {
var photos = '';
if(row.factoryGateByEnterpriseId) {
var photoArray = row.factoryGateByEnterpriseId.split(',');
for(var i = 0, item; item = photoArray[i++];) {
photos += '<img class="swiper-slide" src="route/file/downloadfile/false/'+ item +'">';
}
}
if(row.workplaceByEnterpriseId) {
var photoArray = row.workplaceByEnterpriseId.split(',');
for(var i = 0, item; item = photoArray[i++];) {
photos += '<img class="swiper-slide" src="route/file/downloadfile/false/'+ item +'">';
}
}
if(!photos) {
photos = '<img class="swiper-slide" src="assets/images/nonephoto.jpg">';
}
var photoDiv = '<div id="photo_'+ row.checkId +'" class="swiper-container enterprise-photos-box"><div class="swiper-wrapper">'+ photos +'</div></div>';
setTimeout(function() {
new Swiper('#photo_'+ row.checkId, {
autoplay: 3000
})
}, 50);
return photoDiv;
}
},
{field:'col1', width: 300, title: '检查企业', align: 'center',
templet: function(row) {
var infoDiv = '<table>';
infoDiv += '<tr><td colspan="2" class="col-content">'+ row.gmtCreate +'</td></tr>';
infoDiv += '<tr><td class="col-title">企业名称</td><td class="col-content"><div class="col-content-name" title="'+ row.nameJoinByEnterpriseId +'">'+ row.nameJoinByEnterpriseId +'</div></td></tr>';
infoDiv += '<tr><td class="col-title">企业类型</td><td class="col-content">'+ row.typeDictionaryName +'</td></tr>';
infoDiv += '</table>';
return infoDiv;
}
},
{field:'col2', width: 400, title: '行业风险', align: 'center',
templet: function(row) {
var infoDiv = '<table>';
infoDiv += '<tr><td class="col-title">管理行业</td><td class="col-content">'+ (row.industryDictionaryName ? row.industryDictionaryName : '-') +'</td></tr>';
infoDiv += '<tr><td class="col-title">作业风险</td><td class="col-content">'+ (row.riskOperationDictionaryName ? row.riskOperationDictionaryName : '-') +'</td></tr>';
if(row.enterpriseLngByEnterpriseId && row.enterpriseLatByEnterpriseId) {
infoDiv += '<tr><td colspan="2" class="col-content"><div class="col-content-div enterprise-location" title="'+ row.addressJoinByEnterpriseId +'" data-enterprise-name="'+ row.nameJoinByEnterpriseId +'" data-enterprise-id="'+ row.enterpriseId +'" data-enterprise-photos="'+ row.factoryGateByEnterpriseId +'" data-lng="'+ row.enterpriseLngByEnterpriseId +'" data-lat="'+ row.enterpriseLatByEnterpriseId +'"><i class="fa fa-map-marker"></i> '+ (row.addressJoinByEnterpriseId ? row.addressJoinByEnterpriseId : '查看企业定位') +'</div></td></tr>';
} else {
infoDiv += '<tr><td colspan="2" class="col-content"><div class="col-content-div" title="'+ row.addressJoinByEnterpriseId +'">'+ (row.addressJoinByEnterpriseId ? row.addressJoinByEnterpriseId : '-') +'</div></td></tr>';
}
infoDiv += '</table>';
return infoDiv;
}
},
{field:'col3', width: 240, title: '人员信息', align: 'center',
templet: function(row) {
var infoDiv = '<table>';
infoDiv += '<tr><td class="col-title">负责人</td><td class="col-content"><i class="fa fa-user-circle"></i> '+ (row.masterJoinByEnterpriseId ? row.masterJoinByEnterpriseId : '-') +'</td></tr>';
infoDiv += '<tr><td class="col-title">联系电话</td><td class="col-content"><i class="fa fa-mobile-phone"></i> '+ (row.phoneJoinByEnterpriseId ? row.phoneJoinByEnterpriseId : '-') +'</td></tr>';
infoDiv += '<tr><td class="col-title">从业人数</td><td class="col-content"><i class="fa fa-users"></i> '+ (row.engagedCountJoinByEnterpriseId ? (row.engagedCountJoinByEnterpriseId +' 人') : '-') +'</td></tr>';
infoDiv += '</table>';
return infoDiv;
}
},
{field:'col4', width: 100, title: '状态', align: 'center',
templet: function(row) {
var checkType = '【无检查类型】';
if(row.checkType == 1) {
checkType = '【检查】';
} else if(rowData == 2) {
checkType = '【复查】';
}
var isCoordination = '<span style="color: #FF5722;">【不配合】</span>';
if(row.isCoordination == 1) {
isCoordination = '<span style="color: #009688;">【配合】</span>';
}
var isComplete = '<span style="color: #FF5722;">【未完成】</span>';
if(row.isComplete == 1) {
isComplete = '<span style="color: #009688;">【完成】</span>'
}
var infoDiv = '<table>';
infoDiv += '<tr><td class="col-content">'+ checkType +'</td></tr>';
infoDiv += '<tr><td class="col-content">'+ isCoordination +'</td></tr>';
infoDiv += '<tr><td class="col-content">'+ isComplete +'</td></tr>';
infoDiv += '</table>';
return infoDiv;
}
},
{field:'col5', width: 120, title: '操作', align: 'center',
templet: function(row) {
var isCoordinationBtn = '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs check-detail" data-checkid="'+ row.checkId +'" data-name="'+ row.nameJoinByEnterpriseId +'"><i class="fa fa-lg fa-search"></i> 检查项</button>';
if(row.isCoordination != 1) {
isCoordinationBtn = '不配合';
}
var infoDiv = '<table>';
infoDiv += '<tr><td class="col-content">'+ isCoordinationBtn +'</td></tr>';
if(row.checkLng && row.checkLat) {
infoDiv += '<tr><td class="col-content-opition"><div class="col-content-div check-location" data-lng="'+ row.checkLng +'" data-lat="'+ row.checkLat +'" data-enterprise-name="'+ row.nameJoinByEnterpriseId +'" data-enterprise-id="'+ row.enterpriseId +'" data-enterprise-photos="'+ row.factoryGateByEnterpriseId +'"><i class="fa fa-map-marker"></i> 查看检查位置</div></td></tr>';
}
infoDiv += '</table>';
return infoDiv;
}
},
]],
page: true,
parseData: function(data) {
return {
'code': 0,
'msg': '',
'count': data.total,
'data': data.rows
};
}
});
}
// 重载表格
function reloadTable(currentPage) {
table.reload('dataTable', {
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
type: $('#type').val(),
industry: $('#industry').val(),
checkType: $('#checkType').val(),
isCoordination: $('#isCoordination').val(),
isComplete: $('#isComplete').val(),
area1: $('#area1').val(),
area2: $('#area2').val(),
area3: $('#area3').val(),
area4: $('#area4').val(),
area5: $('#area5').val(),
},
page: {
curr: currentPage
},
height: $win.height() - 90,
});
}
// 删除
function removeData(ids) {
top.dialog.msg(top.dataMessage.delete, {
time: 0,
btn: [top.dataMessage.button.yes, top.dataMessage.button.no],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
var layIndex;
top.restAjax.delete(top.restAjax.path('api/check/removecheck/{ids}', [ids]), {}, null, function (code, data) {
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000});
reloadTable();
}, function (code, data) {
top.dialog.msg(data.msg);
}, function () {
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
}, function () {
top.dialog.close(layIndex);
});
}
});
}
initTable();
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);
resizeTimeout = setTimeout(function() {
reloadTable();
}, 500);
});
// 事件 - 搜索
$(document).on('click', '#search', function() {
reloadTable(1);
});
// 事件 - 增删改
table.on('toolbar(dataTable)', function(obj) {
var layEvent = obj.event;
var checkStatus = table.checkStatus('dataTable');
var checkDatas = checkStatus.data;
if(layEvent === 'saveEvent') {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/check/save-check.html', []),
end: function() {
reloadTable();
}
});
} else if(layEvent === 'updateEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectEdit);
} else if(checkDatas.length > 1) {
top.dialog.msg(top.dataMessage.table.selectOneEdit);
} else {
layer.open({
type: 2,
title: false,
closeBtn: 0,
area: ['100%', '100%'],
shadeClose: true,
anim: 2,
content: top.restAjax.path('route/check/update-check.html?checkId={checkId}', [checkDatas[0].checkId]),
end: function() {
reloadTable();
}
});
}
} else if(layEvent === 'removeEvent') {
if(checkDatas.length === 0) {
top.dialog.msg(top.dataMessage.table.selectDelete);
} else {
var ids = '';
for(var i = 0, item; item = checkDatas[i++];) {
if(i > 1) {
ids += '_';
}
ids += item['checkId'];
}
removeData(ids);
}
}
});
$(document).on('click', '.check-detail', function() {
var checkId = this.dataset.checkid;
var nameJoinByEnterpriseId = this.dataset.name;
top.dialog.open({
url: top.restAjax.path('route/check/get-check-item.html?checkId={checkId}', [checkId]),
title: '【'+ nameJoinByEnterpriseId + '】检、复查选项',
width: '80%',
height: '80%',
onClose: function() {}
});
});
$(document).on('click', '.enterprise-location', function() {
var lng = this.dataset.lng;
var lat = this.dataset.lat;
if(lng && lat) {
top.dialog.dialogData.enterpriseCheckData = {
enterpriseId: this.dataset.enterpriseId,
enterpriseName: this.dataset.enterpriseName,
photoArray: this.dataset.photoArray,
}
top.dialog.open({
url: top.restAjax.path('route/check/get-map-location.html?lng={lng}&lat={lat}', [lng, lat]),
title: '企业位置信息',
width: '80%',
height: '80%',
onClose: function() {
top.dialog.dialogData.enterpriseCheckData = null;
}
});
} else {
top.dialog.msg('暂无定位信息');
}
});
$(document).on('click', '.check-location', function() {
var lng = this.dataset.lng;
var lat = this.dataset.lat;
if(lng && lat) {
top.dialog.dialogData.enterpriseCheckData = {
enterpriseId: this.dataset.enterpriseId,
enterpriseName: this.dataset.enterpriseName,
photoArray: this.dataset.photoArray,
}
top.dialog.open({
url: top.restAjax.path('route/check/get-map-location.html?lng={lng}&lat={lat}', [lng, lat]),
title: '检查位置信息',
width: '80%',
height: '80%',
onClose: function() {
top.dialog.dialogData.enterpriseCheckData = null;
}
});
} else {
top.dialog.msg('暂无检查定位信息');
}
});
// 联动事件
// area1 选择事件
// form.on('select(area1)', function(data) {
// initArea2Select(data.value);
// initArea3Select();
// initArea4Select();
// initArea5Select();
// });
initArea2Select('6aba668e-8ab3-4fbb-8886-b2d468ccf00e');
// area2 选择事件
form.on('select(area2)', function(data) {
initArea3Select(data.value);
initArea4Select();
initArea5Select();
});
// area3 选择事件
form.on('select(area3)', function(data) {
initArea4Select(data.value);
initArea5Select();
});
// area4 选择事件
form.on('select(area4)', function(data) {
initArea5Select(data.value);
});
});
</script>
</body>
</html>