完成检查流程,新增APP端接口

This commit is contained in:
wanggeng 2021-07-19 17:52:54 +08:00
parent 3db28f0129
commit 9ee16f170c
18 changed files with 1303 additions and 107 deletions

View File

@ -14,6 +14,7 @@ import com.cm.common.result.SuccessResultList;
import com.cm.inspection.enums.GridPersonnelTypeEnum;
import com.cm.inspection.pojo.dtos.check.Check2DTO;
import com.cm.inspection.pojo.dtos.check.Check2LogDTO;
import com.cm.inspection.pojo.dtos.check.CheckSimpleWithEnterpriseDTO;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import com.cm.inspection.pojo.dtos.hiddendangerreport.HiddenDangerReportDTO;
import com.cm.inspection.pojo.vos.check.CheckCompleteVO;
@ -62,7 +63,7 @@ public class Check2Controller extends AbstractController {
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{checkId}")
public Check2DTO getCheckById(@PathVariable("checkId") String checkId) throws SearchException {
public Check2DTO get(@PathVariable("checkId") String checkId) throws SearchException {
return check2Service.get(checkId);
}
@ -310,9 +311,31 @@ public class Check2Controller extends AbstractController {
return new SuccessResult();
}
@ApiOperation(value = "检查日志列表", notes = "检查日志列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list-check-log/{checkId}")
public List<Check2LogDTO> listCheckLog(@PathVariable("checkId") String checkId) {
return check2Service.listCheckLog(checkId);
}
@ApiOperation(value = "我的历史列表", notes = "我的历史接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpage-history-of-mine")
public SuccessResultList<List<Check2DTO>> listPageHistoryOfMine(ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPageHistoryOfMine(page);
}
@ApiOperation(value = "检查表列表(简单格式和企业信息)", notes = "检查表列表(简单格式和企业信息)接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list-simple-with-enterprise")
public List<CheckSimpleWithEnterpriseDTO> listSimpleWithEnterprise() {
Map<String, Object> params = requestParams();
return check2Service.listSimpleWithEnterprise(params);
}
}

View File

@ -4,15 +4,21 @@ import com.cm.common.annotation.CheckRequestBodyAnnotation;
import com.cm.common.base.AbstractController;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.exception.ParamsException;
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.enums.CheckTypeEnum;
import com.cm.inspection.enums.GridPersonnelTypeEnum;
import com.cm.inspection.pojo.dtos.check.Check2DTO;
import com.cm.inspection.pojo.dtos.check.Check2LogDTO;
import com.cm.inspection.pojo.vos.check.Check2VO;
import com.cm.inspection.pojo.vos.check.CheckCompleteVO;
import com.cm.inspection.pojo.vos.check.StreetToLeaderVO;
import com.cm.inspection.service.check.ICheck2Service;
import io.swagger.annotations.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -26,13 +32,13 @@ import java.util.Map;
* @Date: 2020-03-25 22:59
* @Version: 1.0
**/
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "检查表接口")
@Api(tags = ISystemConstant.API_TAGS_APP_PREFIX + "检查表2接口")
@RestController
@RequestMapping(ISystemConstant.APP_PREFIX + "/check2")
public class CheckApp2Controller extends AbstractController {
@Autowired
private ICheck2Service checkService;
private ICheck2Service check2Service;
@ApiOperation(value = "新增检查", notes = "新增检查接口")
@ApiImplicitParams({
@ -46,7 +52,7 @@ public class CheckApp2Controller extends AbstractController {
throw new ParamsException("检查项列表为空");
}
check2VO.setCheckType(CheckTypeEnum.CHECK.getValue());
checkService.save(token, check2VO);
check2Service.save(token, check2VO);
return new SuccessResult();
}
@ -62,7 +68,7 @@ public class CheckApp2Controller extends AbstractController {
@PathVariable("checkId") String checkId,
@RequestBody Check2VO check2VO) throws Exception {
check2VO.setCheckType(CheckTypeEnum.RE_CHECK.getValue());
checkService.saveRe(token, checkId, check2VO);
check2Service.saveRe(token, checkId, check2VO);
return new SuccessResult();
}
@ -75,7 +81,224 @@ public class CheckApp2Controller extends AbstractController {
public SuccessResultList<List<Check2DTO>> listPageReCheckOfMine(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return checkService.listPageReCheckOfMine(token, page);
return check2Service.listPageReCheckOfMine(token, page);
}
@ApiOperation(value = "我的街道案件列表", notes = "我的街道案件列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@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-street-of-mine")
public SuccessResultList<List<Check2DTO>> listPageStreetOfMine(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPageStreetOfMine(token, page);
}
@ApiOperation(value = "街道案件完成", notes = "街道案件完成接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-street-complete/{checkId}")
public SuccessResult updateStreetComplete(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateStreetComplete(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "街道案件上报领导", notes = "街道案件上报领导接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-street-to-leader/{checkId}")
@CheckRequestBodyAnnotation
public SuccessResult updateStreetToLeader(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody StreetToLeaderVO streetToLeaderVO) {
if (StringUtils.equals(GridPersonnelTypeEnum.DISTRICT.getValue(), streetToLeaderVO.getLeaderType())) {
if (StringUtils.isBlank(streetToLeaderVO.getLeaderId())) {
throw new ParamsException("领导不能为空");
}
}
check2Service.updateStreetToLeader(token, checkId, streetToLeaderVO);
return new SuccessResult();
}
@ApiOperation(value = "我的旗县区委办局案件列表", notes = "我的旗县区委办局案件列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@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-district-department-of-mine")
public SuccessResultList<List<Check2DTO>> listPageDistrictDepartmentOfMine(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPageDistrictDepartmentOfMine(token, page);
}
@ApiOperation(value = "旗县区委办局案件完成", notes = "旗县区委办局案件完成接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-district-department-complete/{checkId}")
public SuccessResult updateDistrictDepartmentComplete(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateDistrictDepartmentComplete(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "旗县区委办局案件回退", notes = "旗县区委办局案件回退接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-district-department-back/{checkId}")
public SuccessResult updateDistrictDepartmentBack(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateDistrictDepartmentBack(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "我的旗县区案件列表", notes = "我的旗县区案件列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@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-district-of-mine")
public SuccessResultList<List<Check2DTO>> listPageDistrictOfMine(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPageDistrictOfMine(token, page);
}
@ApiOperation(value = "旗县区案件完成", notes = "旗县区案件完成接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-district-complete/{checkId}")
public SuccessResult updateDistrictComplete(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateDistrictComplete(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "旗县区案件回退", notes = "旗县区案件回退接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-district-back/{checkId}")
public SuccessResult updateDistrictBack(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateDistrictBack(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "旗县区案件上报领导", notes = "旗县区案件上报领导接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-district-to-leader/{checkId}")
@CheckRequestBodyAnnotation
public SuccessResult updateDistrictToLeader(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateDistrictToLeader(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "我的市案件列表", notes = "我的市案件列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@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-city-of-mine")
public SuccessResultList<List<Check2DTO>> listPageCityOfMine(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> params = requestParams();
page.setParams(params);
return check2Service.listPageCityOfMine(token, page);
}
@ApiOperation(value = "市案件完成", notes = "市案件完成接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-city-complete/{checkId}")
public SuccessResult updateCityComplete(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateCityComplete(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "市案件回退", notes = "市案件回退接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PutMapping("update-city-back/{checkId}")
public SuccessResult updateCityBack(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId,
@RequestBody CheckCompleteVO checkCompleteVO) {
check2Service.updateCityBack(token, checkId, checkCompleteVO);
return new SuccessResult();
}
@ApiOperation(value = "检查日志列表", notes = "检查日志列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查ID", paramType = "path"),
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("list-check-log/{checkId}")
public List<Check2LogDTO> listCheckLog(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId) {
return check2Service.listCheckLog(checkId);
}
@ApiOperation(value = "检查表详情(通过ID)", notes = "检查表详情(通过ID)接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
@ApiImplicitParam(name = "checkId", value = "检查表ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("get/{checkId}")
public Check2DTO get(@RequestHeader("token") String token,
@PathVariable("checkId") String checkId) throws SearchException {
return check2Service.get(checkId);
}
}

View File

@ -75,8 +75,8 @@ public class GridPersonnelAppController extends AbstractController {
@ApiImplicitParam(name = "gridPersonnelId", value = "网格人员ID", paramType = "path")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("getgridpersonnelbyid/{gridPersonnelId}")
public GridPersonnelDTO getGridPersonnelById(@RequestHeader("token") String token, @PathVariable("gridPersonnelId") String gridPersonnelId) throws SearchException {
@GetMapping("get/{gridPersonnelId}")
public GridPersonnelDTO get(@RequestHeader("token") String token, @PathVariable("gridPersonnelId") String gridPersonnelId) throws SearchException {
return gridPersonnelService.get(gridPersonnelId);
}
@ -85,8 +85,8 @@ public class GridPersonnelAppController extends AbstractController {
@ApiImplicitParam(name = "token", value = "token", paramType = "header")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listgridpersonnel")
public List<GridPersonnelDTO> listGridPersonnel(@RequestHeader("token") String token) throws SearchException {
@GetMapping("list")
public List<GridPersonnelDTO> list(@RequestHeader("token") String token) throws SearchException {
Map<String, Object> params = requestParams();
return gridPersonnelService.list(params);
}
@ -101,8 +101,8 @@ public class GridPersonnelAppController extends AbstractController {
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
})
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("listpagegridpersonnel")
public SuccessResultList<List<GridPersonnelDTO>> listPageGridPersonnel(@RequestHeader("token") String token, ListPage page) throws SearchException, UnsupportedEncodingException {
@GetMapping("listpage")
public SuccessResultList<List<GridPersonnelDTO>> listPage(@RequestHeader("token") String token, ListPage page) throws SearchException, UnsupportedEncodingException {
Map<String, Object> params = requestParams();
page.setParams(params);
return gridPersonnelService.listPage(page);

View File

@ -5,7 +5,6 @@ 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;
@ -98,5 +97,5 @@ public interface ICheck2Dao {
* @return
* @throws SearchException
*/
List<CheckSimpleWithEnterpriseDTO> listCheckSimpleWithEnterprise(Map<String, Object> params) throws SearchException;
List<CheckSimpleWithEnterpriseDTO> listSimpleWithEnterprise(Map<String, Object> params) throws SearchException;
}

View File

@ -1,7 +1,13 @@
package com.cm.inspection.service;
import com.cm.common.base.AbstractService;
import com.cm.common.plugin.oauth.service.user.IUserService;
import com.cm.common.plugin.pojo.bos.UserResourceBO;
import com.cm.common.token.app.AppTokenManager;
import org.apache.commons.lang3.StringUtils;
import java.util.ArrayList;
import java.util.List;
/**
* When you feel like quitting. Think about why you started
@ -27,4 +33,16 @@ public class BaseService extends AbstractService {
return AppTokenManager.getInstance().getToken(token).getUserId();
}
protected List<String> listUserIdsByKeyword(String keyword, IUserService userService) {
if (StringUtils.isBlank(keyword)) {
return null;
}
List<UserResourceBO> userResourceBOs = userService.listResourceByKeywords(keyword);
List<String> userIds = new ArrayList<>();
userResourceBOs.forEach(userResourceBO -> {
userIds.add(userResourceBO.getUserId());
});
return userIds;
}
}

View File

@ -4,6 +4,7 @@ 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.check.Check2LogDTO;
import com.cm.inspection.pojo.dtos.check.CheckSimpleWithEnterpriseDTO;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import com.cm.inspection.pojo.dtos.hiddendangerreport.HiddenDangerReportDTO;
import com.cm.inspection.pojo.vos.check.Check2VO;
@ -133,6 +134,15 @@ public interface ICheck2Service {
*/
SuccessResultList<List<Check2DTO>> listPageStreetOfMine(ListPage page);
/**
* 我的街道案件列表
*
* @param token
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageStreetOfMine(String token, ListPage page);
/**
* 我的旗县区委办局案件列表
*
@ -141,6 +151,15 @@ public interface ICheck2Service {
*/
SuccessResultList<List<Check2DTO>> listPageDistrictDepartmentOfMine(ListPage page);
/**
* 我的旗县区委办局案件列表
*
* @param token
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageDistrictDepartmentOfMine(String token, ListPage page);
/**
* 我的旗县区案件列表
*
@ -149,6 +168,15 @@ public interface ICheck2Service {
*/
SuccessResultList<List<Check2DTO>> listPageDistrictOfMine(ListPage page);
/**
* 我的旗县区案件列表
*
* @param token
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageDistrictOfMine(String token, ListPage page);
/**
* 我的市案件列表
*
@ -157,6 +185,15 @@ public interface ICheck2Service {
*/
SuccessResultList<List<Check2DTO>> listPageCityOfMine(ListPage page);
/**
* 我的市案件列表
*
* @param token
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageCityOfMine(String token, ListPage page);
/**
* 结束街道案件
*
@ -165,6 +202,15 @@ public interface ICheck2Service {
*/
void updateStreetComplete(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 结束街道案件
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateStreetComplete(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 街道案件上报领导
*
@ -173,6 +219,15 @@ public interface ICheck2Service {
*/
void updateStreetToLeader(String checkId, StreetToLeaderVO streetToLeaderVO);
/**
* 街道案件上报领导
*
* @param token
* @param checkId
* @param streetToLeaderVO
*/
void updateStreetToLeader(String token, String checkId, StreetToLeaderVO streetToLeaderVO);
/**
* 旗县区委办局案件完成
*
@ -181,6 +236,15 @@ public interface ICheck2Service {
*/
void updateDistrictDepartmentComplete(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区委办局案件完成
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateDistrictDepartmentComplete(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区委办局案件回退
*
@ -189,6 +253,15 @@ public interface ICheck2Service {
*/
void updateDistrictDepartmentBack(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区委办局案件回退
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateDistrictDepartmentBack(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 检查日志
*
@ -205,6 +278,15 @@ public interface ICheck2Service {
*/
void updateDistrictComplete(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区案件完成
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateDistrictComplete(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区案件回退
*
@ -213,6 +295,15 @@ public interface ICheck2Service {
*/
void updateDistrictBack(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区案件回退
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateDistrictBack(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区案件上报领导
*
@ -221,6 +312,15 @@ public interface ICheck2Service {
*/
void updateDistrictToLeader(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 旗县区案件上报领导
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateDistrictToLeader(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 市案件完成
*
@ -229,6 +329,15 @@ public interface ICheck2Service {
*/
void updateCityComplete(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 市案件完成
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateCityComplete(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 市案件回退
*
@ -236,4 +345,38 @@ public interface ICheck2Service {
* @param checkCompleteVO
*/
void updateCityBack(String checkId, CheckCompleteVO checkCompleteVO);
/**
* 市案件回退
*
* @param token
* @param checkId
* @param checkCompleteVO
*/
void updateCityBack(String token, String checkId, CheckCompleteVO checkCompleteVO);
/**
* 我的历史列表
*
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageHistoryOfMine(ListPage page);
/**
* 我的历史列表
*
* @param token
* @param page
* @return
*/
SuccessResultList<List<Check2DTO>> listPageHistoryOfMine(String token, ListPage page);
/**
* 检查表列表
*
* @param params
* @return
*/
List<CheckSimpleWithEnterpriseDTO> listSimpleWithEnterprise(Map<String, Object> params);
}

View File

@ -5,6 +5,7 @@ import com.cm.common.plugin.oauth.service.user.IUserService;
import com.cm.common.plugin.pojo.bos.UserResourceBO;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResultList;
import com.cm.common.token.app.AppTokenManager;
import com.cm.common.utils.DateUtil;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
@ -12,6 +13,7 @@ import com.cm.inspection.dao.check.ICheck2Dao;
import com.cm.inspection.enums.*;
import com.cm.inspection.pojo.dtos.check.Check2DTO;
import com.cm.inspection.pojo.dtos.check.Check2LogDTO;
import com.cm.inspection.pojo.dtos.check.CheckSimpleWithEnterpriseDTO;
import com.cm.inspection.pojo.dtos.checkitem.CheckItemDTO;
import com.cm.inspection.pojo.dtos.checkitemoption.CheckItemOptionDTO;
import com.cm.inspection.pojo.dtos.enterprise.EnterpriseDTO;
@ -132,11 +134,71 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
public Check2DTO get(String checkId) {
Map<String, Object> params = getHashMap(2);
params.put("checkId", checkId);
return get(params);
Check2DTO check2DTO = get(params);
params.clear();
if (check2DTO != null) {
List<CheckItemDTO> checkItemDTOs = hiddenDangerReportService.listCheckItemByCheckId(checkId);
List<String> checkItemParentIds = new ArrayList<>();
for (CheckItemDTO checkItemDTO : checkItemDTOs) {
setCheckItemParentIds(checkItemParentIds, checkItemDTO);
List<HiddenDangerReportDTO> hiddenDangerReportDTOs = hiddenDangerReportService.listHiddenDangerReportByCheckIdAndCheckItemId(checkId, checkItemDTO.getCheckItemId());
checkItemDTO.setHiddenDangerReports(hiddenDangerReportDTOs);
}
check2DTO.setCheckItems(checkItemDTOs);
if (!checkItemParentIds.isEmpty()) {
params.put("checkItemIds", checkItemParentIds);
setCheckItemParent(params, checkItemDTOs);
}
}
return check2DTO;
}
/**
* 设置上级ID
*
* @param checkItemDTO
* @return
*/
private void setCheckItemParentIds(List<String> checkItemParentIds, CheckItemDTO checkItemDTO) {
if (!StringUtils.isBlank(checkItemDTO.getCheckItemParentId()) && !StringUtils.equals("0", checkItemDTO.getCheckItemParentId())) {
checkItemParentIds.add(checkItemDTO.getCheckItemParentId());
}
}
/**
* 设置上级选项列表
*
* @param params
* @param unPassCheckItem
*/
public void setCheckItemParent(Map<String, Object> params, List<CheckItemDTO> unPassCheckItem) {
List<CheckItemDTO> checkItemDTOs = checkItemService.listCheckItem(params);
List<String> checkItemParentIds = new ArrayList<>();
for (CheckItemDTO checkItemDTO : checkItemDTOs) {
setCheckItemParentIds(checkItemParentIds, checkItemDTO);
}
unPassCheckItem.addAll(checkItemDTOs);
if (!checkItemParentIds.isEmpty()) {
params.put("checkItemIds", checkItemParentIds);
setCheckItemParent(params, unPassCheckItem);
}
}
@Override
public List<Check2DTO> list(Map<String, Object> params) {
if (params.get("reporter") != null) {
String reporter = params.get("reporter").toString();
if (!StringUtils.isBlank(reporter)) {
List<String> userIds = listUserIdsByKeyword(reporter, userService);
if (userIds.isEmpty()) {
return new ArrayList<>();
} else {
params.put("creators", userIds);
}
}
}
List<Check2DTO> check2DTOs = check2Dao.list(params);
setUserInfo(check2DTOs);
return check2DTOs;
@ -152,7 +214,8 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
@Override
public SuccessResultList<List<Check2DTO>> listPageCheckOfMine(ListPage page) {
return null;
page.getParams().put("creator", securityComponent.getCurrentUser().getUserId());
return listPage(page);
}
@Override
@ -187,26 +250,46 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
@Override
public SuccessResultList<List<Check2DTO>> listPageStreetOfMine(ListPage page) {
return listPageOfMine(page);
return listPageOfMine(securityComponent.getCurrentUser().getUserId(), page);
}
@Override
public SuccessResultList<List<Check2DTO>> listPageStreetOfMine(String token, ListPage page) {
return listPageOfMine(AppTokenManager.getInstance().getToken(token).getUserId(), page);
}
@Override
public SuccessResultList<List<Check2DTO>> listPageDistrictDepartmentOfMine(ListPage page) {
return listPageOfMine(page);
return listPageOfMine(securityComponent.getCurrentUser().getUserId(), page);
}
@Override
public SuccessResultList<List<Check2DTO>> listPageDistrictDepartmentOfMine(String token, ListPage page) {
return listPageOfMine(AppTokenManager.getInstance().getToken(token).getUserId(), page);
}
@Override
public SuccessResultList<List<Check2DTO>> listPageDistrictOfMine(ListPage page) {
return listPageOfMine(page);
return listPageOfMine(securityComponent.getCurrentUser().getUserId(), page);
}
@Override
public SuccessResultList<List<Check2DTO>> listPageDistrictOfMine(String token, ListPage page) {
return listPageOfMine(AppTokenManager.getInstance().getToken(token).getUserId(), page);
}
@Override
public SuccessResultList<List<Check2DTO>> listPageCityOfMine(ListPage page) {
return listPageOfMine(page);
return listPageOfMine(securityComponent.getCurrentUser().getUserId(), page);
}
private SuccessResultList<List<Check2DTO>> listPageOfMine(ListPage page) {
List<Task> tasks = processService.listTaskByAssignee(securityComponent.getCurrentUser().getUserId());
@Override
public SuccessResultList<List<Check2DTO>> listPageCityOfMine(String token, ListPage page) {
return listPageOfMine(AppTokenManager.getInstance().getToken(token).getUserId(), page);
}
private SuccessResultList<List<Check2DTO>> listPageOfMine(String userId, ListPage page) {
List<Task> tasks = processService.listTaskByAssignee(userId);
List<String> checkIds = listLastCheckId(tasks);
if (checkIds.isEmpty()) {
return new SuccessResultList<>(new ArrayList<>(), 1, 0L);
@ -217,25 +300,26 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
@Override
public void updateStreetComplete(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
LOG.debug("标记任务为完成状态");
updateCheckIsCompleteInfo(null, checkId, 1);
updateTaskComplete(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
LOG.debug("执行流程");
Map<String, Object> params = getHashMap(4);
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
params.put(CheckProcessParamsEnum.HANDLE_TYPE.getValue(), HandleTypeEnum.HANDLE.getValue());
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
processService.completeByTaskId(task.getId(), params);
LOG.debug("流程完成");
@Override
public void updateStreetComplete(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateTaskComplete(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateStreetToLeader(String checkId, StreetToLeaderVO streetToLeaderVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
updateStreetTaskToLeader(securityComponent.getCurrentUser().getUserId(), checkId, streetToLeaderVO);
}
@Override
public void updateStreetToLeader(String token, String checkId, StreetToLeaderVO streetToLeaderVO) {
updateStreetTaskToLeader(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, streetToLeaderVO);
}
private void updateStreetTaskToLeader(String userId, String checkId, StreetToLeaderVO streetToLeaderVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(userId, CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
@ -248,25 +332,33 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
@Override
public void updateDistrictDepartmentComplete(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
LOG.debug("标记任务为完成状态");
updateCheckIsCompleteInfo(null, checkId, 1);
updateTaskComplete(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
LOG.debug("执行流程");
Map<String, Object> params = getHashMap(4);
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
params.put(CheckProcessParamsEnum.HANDLE_TYPE.getValue(), HandleTypeEnum.HANDLE.getValue());
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
processService.completeByTaskId(task.getId(), params);
LOG.debug("流程完成");
@Override
public void updateDistrictDepartmentComplete(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateTaskComplete(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateDistrictDepartmentBack(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
updateDistrictDepartmentTaskBack(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateDistrictDepartmentBack(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateDistrictDepartmentTaskBack(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
/**
* 旗县区委办局案件回退
*
* @param userId
* @param checkId
* @param checkCompleteVO
*/
private void updateDistrictDepartmentTaskBack(String userId, String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(userId, CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
@ -340,26 +432,33 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
@Override
public void updateDistrictComplete(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
LOG.debug("标记任务为完成状态");
updateCheckIsCompleteInfo(null, checkId, 1);
updateTaskComplete(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
LOG.debug("执行流程");
Map<String, Object> params = getHashMap(4);
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
params.put(CheckProcessParamsEnum.HANDLE_TYPE.getValue(), HandleTypeEnum.HANDLE.getValue());
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
processService.completeByTaskId(task.getId(), params);
LOG.debug("流程完成");
@Override
public void updateDistrictComplete(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateTaskComplete(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateDistrictBack(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
updateDistrictTaskBack(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateDistrictBack(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateDistrictTaskBack(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
/**
* 旗县区管理员案件回退
*
* @param userId
* @param checkId
* @param checkCompleteVO
*/
private void updateDistrictTaskBack(String userId, String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(userId, CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
@ -380,11 +479,26 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
@Override
public void updateDistrictToLeader(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
updateDistrictTaskToLeader(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateDistrictToLeader(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateDistrictTaskToLeader(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
/**
* 旗县区任务上报领导
*
* @param userId
* @param checkId
* @param checkCompleteVO
*/
private void updateDistrictTaskToLeader(String userId, String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(userId, CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
String userId = securityComponent.getCurrentUser().getUserId();
GridPersonnelPO gridPersonnelPO = gridPersonnelService.getLeaderPOByUserId(userId);
if (gridPersonnelPO == null) {
throw new SearchException("上级领导不存在");
@ -401,26 +515,33 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
@Override
public void updateCityComplete(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
LOG.debug("标记任务为完成状态");
updateCheckIsCompleteInfo(null, checkId, 1);
updateTaskComplete(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
LOG.debug("执行流程");
Map<String, Object> params = getHashMap(4);
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
params.put(CheckProcessParamsEnum.HANDLE_TYPE.getValue(), HandleTypeEnum.HANDLE.getValue());
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
processService.completeByTaskId(task.getId(), params);
LOG.debug("流程完成");
@Override
public void updateCityComplete(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateTaskComplete(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateCityBack(String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(securityComponent.getCurrentUser().getUserId(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
updateCityTaskBack(securityComponent.getCurrentUser().getUserId(), checkId, checkCompleteVO);
}
@Override
public void updateCityBack(String token, String checkId, CheckCompleteVO checkCompleteVO) {
updateCityTaskBack(AppTokenManager.getInstance().getToken(token).getUserId(), checkId, checkCompleteVO);
}
/**
* 市案件回退
*
* @param userId
* @param checkId
* @param checkCompleteVO
*/
private void updateCityTaskBack(String userId, String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(userId, CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
@ -439,6 +560,68 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
LOG.debug("流程回退");
}
/**
* 完成任务
*
* @param userId
* @param checkId
* @param checkCompleteVO
*/
private void updateTaskComplete(String userId, String checkId, CheckCompleteVO checkCompleteVO) {
Task task = processService.getTaskByAssigneeAndVariableKeyAndValue(userId, CheckProcessParamsEnum.LAST_CHECK_ID.getValue(), checkId);
if (task == null) {
throw new SearchException("任务不存在");
}
LOG.debug("标记任务为完成状态");
updateCheckIsCompleteInfo(null, checkId, 1);
LOG.debug("执行流程");
Map<String, Object> params = getHashMap(4);
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
params.put(CheckProcessParamsEnum.HANDLE_TYPE.getValue(), HandleTypeEnum.HANDLE.getValue());
params.put(CheckProcessParamsEnum.SUMMARY.getValue(), checkCompleteVO.getSummary());
processService.completeByTaskId(task.getId(), params);
LOG.debug("流程完成");
}
@Override
public SuccessResultList<List<Check2DTO>> listPageHistoryOfMine(ListPage page) {
return listPageHistoryByUserId(securityComponent.getCurrentUser().getUserId(), page);
}
@Override
public SuccessResultList<List<Check2DTO>> listPageHistoryOfMine(String token, ListPage page) {
return listPageHistoryByUserId(AppTokenManager.getInstance().getToken(token).getUserId(), page);
}
@Override
public List<CheckSimpleWithEnterpriseDTO> listSimpleWithEnterprise(Map<String, Object> params) {
return check2Dao.listSimpleWithEnterprise(params);
}
public SuccessResultList<List<Check2DTO>> listPageHistoryByUserId(String userId, ListPage page) {
List<HistoricTaskInstance> historicTaskInstances = processService.listHistoricTaskInstanceByAssignee(userId);
if (historicTaskInstances.isEmpty()) {
return new SuccessResultList<>(new ArrayList<>(), 1, 0L);
}
Set<String> taskIds = new HashSet<>();
historicTaskInstances.forEach(historicTaskInstance -> {
taskIds.add(historicTaskInstance.getId());
});
Set<String> checkIds = new HashSet<>();
List<HistoricVariableInstance> historicVariableInstances = processService.listHistoricVariableInstanceByKeyAndValue(taskIds);
historicVariableInstances.forEach(historicVariableInstance -> {
if (StringUtils.equals(historicVariableInstance.getVariableName(), CheckProcessParamsEnum.LAST_CHECK_ID.getValue())) {
checkIds.add(historicVariableInstance.getValue().toString());
}
});
if (checkIds.isEmpty()) {
return new SuccessResultList<>(new ArrayList<>(), 1, 0L);
}
page.getParams().put("checkIds", new ArrayList<>(checkIds));
return listPage(page);
}
/**
* 上报案件到委办局逻辑查找当前用户上级网格员存在则将案件进行转发否则抛出异常
*
@ -530,6 +713,9 @@ public class Check2ServiceImpl extends BaseService implements ICheck2Service {
Map<String, Object> params = getHashMap(16);
LOG.debug("获取复查流程当前节点任务");
Task task = processService.getTaskByAssigneeAndBusinessKey(grid, businessKey);
if(task == null) {
throw new SearchException("任务不存在");
}
LOG.debug("检查结果是否全部通过");
int isAllPass = saveCheckResult(token, reCheckId, check2VO);
params.put(CheckProcessParamsEnum.IS_ALL_PASS.getValue(), isAllPass);

View File

@ -317,6 +317,22 @@ public interface IProcessService {
*/
List<HistoricTaskInstance> listHistoricTaskInstanceByKeyAndValue(String key, Object value);
/**
* 历史任务实例列表
*
* @param assignee
* @return
*/
List<HistoricTaskInstance> listHistoricTaskInstanceByAssignee(String assignee);
/**
* 历史任务实例列表
*
* @param assigneeIds
* @return
*/
List<HistoricTaskInstance> listHistoricTaskInstanceByAssignees(List<String> assigneeIds);
/**
* 任务历史变量
*

View File

@ -282,6 +282,16 @@ public class ProcessServiceImpl implements IProcessService {
return historyService.createHistoricTaskInstanceQuery().taskVariableValueEquals(key, value).orderByHistoricTaskInstanceStartTime().asc().list();
}
@Override
public List<HistoricTaskInstance> listHistoricTaskInstanceByAssignee(String assignee) {
return historyService.createHistoricTaskInstanceQuery().taskAssignee(assignee).list();
}
@Override
public List<HistoricTaskInstance> listHistoricTaskInstanceByAssignees(List<String> assigneeIds) {
return historyService.createHistoricTaskInstanceQuery().taskAssigneeIds(assigneeIds).list();
}
@Override
public List<HistoricVariableInstance> listHistoricVariableInstanceByKeyAndValue(String taskId) {
return historyService.createHistoricVariableInstanceQuery().taskId(taskId).list();

View File

@ -339,6 +339,13 @@
AND
t1.creator = #{creator}
</if>
<if test="creators != null and creators.size > 0">
AND
t1.creator IN
<foreach collection="creators" index="index" open="(" separator="," close=")">
#{creators[${index}]}
</foreach>
</if>
<if test="checkMonth != null">
AND
LEFT(t1.gmt_create, 7) = #{checkMonth}
@ -515,7 +522,7 @@
</select>
<!-- 检查表列表(简单格式和企业信息) -->
<select id="listCheckSimpleWithEnterprise" resultMap="checkSimpleWithEnterpriseDTO" useCache="true">
<select id="listSimpleWithEnterprise" resultMap="checkSimpleWithEnterpriseDTO" useCache="true">
SELECT
t1.enterprise_id,
jt1.name enterprise_name,

View File

@ -130,7 +130,7 @@
// 初始化内容
function initData() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/check/getcheckbyid/{checkId}', [checkId]), {}, null, function(code, data) {
top.restAjax.get(top.restAjax.path('api/check2/get/{checkId}', [checkId]), {}, null, function(code, data) {
var dataFormData = {
enterpriseId: data.enterpriseId,
enterpriseName: data.nameJoinByEnterpriseId,

View File

@ -336,7 +336,7 @@
div.addEventListener('click', function() {
top.dialog.open({
url: top.restAjax.path('route/check/get-check-item.html?checkId={checkId}', [self.checkId]),
url: top.restAjax.path('route/check2/get-check-item.html?checkId={checkId}', [self.checkId]),
title: '【'+ self.enterpriseName + '】检、复查选项',
width: '600px',
height: '80%',
@ -366,7 +366,7 @@
function initData() {
var loadLayerIndex;
top.restAjax.get(top.restAjax.path('api/check/listchecksimplewithenterprise', []), {
top.restAjax.get(top.restAjax.path('api/check2/list-simple-with-enterprise', []), {
keywords: $('#keywords').val(),
area1: '6aba668e-8ab3-4fbb-8886-b2d468ccf00e',
area2: $('#area2').val() ? $('#area2').val() : '',

View File

@ -22,6 +22,9 @@
<div class="layui-inline search-item-width-100">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline search-item-width-100">
<input type="text" id="reporter" 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">
@ -249,7 +252,7 @@
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: '企业图片',
{field:'photos', width: 200, title: '企业图片', align: 'center',
templet: function(row) {
var photos = '';
if(row.enterpriseFactoryGate) {
@ -378,6 +381,7 @@
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
reporter: $('#reporter').val(),
type: $('#type').val(),
industry: $('#industry').val(),
checkType: $('#checkType').val(),
@ -409,8 +413,8 @@
});
$(document).on('click', '.check-detail', function() {
var checkId = this.dataset.checkid;
var enterpriseName = this.dataset.name;
var checkId = this.dataset.checkId;
var enterpriseName = this.dataset.enterpriseName;
top.dialog.open({
url: top.restAjax.path('route/check2/get-check-item.html?checkId={checkId}', [checkId]),
title: '【'+ enterpriseName + '】检、复查选项',

View File

@ -22,6 +22,9 @@
<div class="layui-inline search-item-width-100">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline search-item-width-100">
<input type="text" id="reporter" 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">
@ -249,7 +252,7 @@
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: '企业图片',
{field:'photos', width: 200, title: '企业图片', align: 'center',
templet: function(row) {
var photos = '';
if(row.enterpriseFactoryGate) {
@ -378,6 +381,7 @@
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
reporter: $('#reporter').val(),
type: $('#type').val(),
industry: $('#industry').val(),
checkType: $('#checkType').val(),
@ -408,8 +412,8 @@
});
$(document).on('click', '.check-detail', function() {
var checkId = this.dataset.checkid;
var enterpriseName = this.dataset.name;
var checkId = this.dataset.checkId;
var enterpriseName = this.dataset.enterpriseName;
top.dialog.open({
url: top.restAjax.path('route/check2/get-check-item.html?checkId={checkId}', [checkId]),
title: '【'+ enterpriseName + '】检、复查选项',

View File

@ -22,6 +22,9 @@
<div class="layui-inline search-item-width-100">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline search-item-width-100">
<input type="text" id="reporter" 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">
@ -249,7 +252,7 @@
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: '企业图片',
{field:'photos', width: 200, title: '企业图片', align: 'center',
templet: function(row) {
var photos = '';
if(row.enterpriseFactoryGate) {
@ -381,6 +384,7 @@
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
reporter: $('#reporter').val(),
type: $('#type').val(),
industry: $('#industry').val(),
checkType: $('#checkType').val(),
@ -434,8 +438,8 @@
});
$(document).on('click', '.check-detail', function() {
var checkId = this.dataset.checkid;
var enterpriseName = this.dataset.name;
var checkId = this.dataset.checkId;
var enterpriseName = this.dataset.enterpriseName;
top.dialog.open({
url: top.restAjax.path('route/check2/get-check-item.html?checkId={checkId}', [checkId]),
title: '【'+ enterpriseName + '】检、复查选项',

View File

@ -0,0 +1,558 @@
<!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 search-item-width-100">
<input type="text" id="reporter" 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="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>
</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-history-of-mine';
// 初始化选择框、单选、复选模板
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],
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: '企业图片', align: 'center',
templet: function(row) {
var photos = '';
if(row.enterpriseFactoryGate) {
var photoArray = row.enterpriseFactoryGate.split(',');
for(var i = 0, item; item = photoArray[i++];) {
photos += '<img class="swiper-slide" src="route/file/downloadfile/false/'+ item +'">';
}
}
if(row.enterpriseWorkplace) {
var photoArray = row.enterpriseWorkplace.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.enterpriseName +'">'+ row.enterpriseName +'</div></td></tr>';
infoDiv += '<tr><td class="col-title">企业类型</td><td class="col-content">'+ row.enterpriseTypeName +'</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.enterpriseIndustryName ? row.enterpriseIndustryName : '-') +'</td></tr>';
infoDiv += '<tr><td class="col-title">作业风险</td><td class="col-content">'+ (row.enterpriseRiskOperationName ? row.enterpriseRiskOperationName : '-') +'</td></tr>';
if(row.enterpriseLng && row.enterpriseLat) {
infoDiv += '<tr><td colspan="2" class="col-content"><div class="col-content-div enterprise-location" title="'+ row.enterpriseAddress +'" data-enterprise-name="'+ row.enterpriseName +'" data-enterprise-id="'+ row.enterpriseId +'" data-enterprise-photos="'+ row.enterpriseFactoryGate +'" data-lng="'+ row.enterpriseLng +'" data-lat="'+ row.enterpriseLat +'"><i class="fa fa-map-marker"></i> '+ (row.enterpriseAddress ? row.enterpriseAddress : '查看企业定位') +'</div></td></tr>';
} else {
infoDiv += '<tr><td colspan="2" class="col-content"><div class="col-content-div" title="'+ row.enterpriseAddress +'">'+ (row.enterpriseAddress ? row.enterpriseAddress : '-') +'</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.enterpriseMaster ? row.enterpriseMaster : '-') +'</td></tr>';
infoDiv += '<tr><td class="col-title">联系电话</td><td class="col-content"><i class="fa fa-mobile-phone"></i> '+ (row.enterprisePhone ? row.enterprisePhone : '-') +'</td></tr>';
infoDiv += '<tr><td class="col-title">从业人数</td><td class="col-content"><i class="fa fa-users"></i> '+ (row.enterpriseEngagedCount ? (row.enterpriseEngagedCount +' 人') : '-') +'</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(row.checkType == 2) {
checkType = '【复查】';
}
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">'+ isComplete +'</td></tr>';
infoDiv += '</table>';
return infoDiv;
}
},
{field:'col5', width: 140, title: '案件上报情况', align: 'center',
templet: function(row) {
var infoDiv = '<table>';
infoDiv += '<tr><td class="col-content">'+ row.creatorName +'</td></tr>';
infoDiv += '<tr><td class="col-content">'+ row.creatorPhone +'</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.enterpriseName +'" data-enterprise-id="'+ row.enterpriseId +'" data-enterprise-photos="'+ row.factoryGateByEnterpriseId +'" style="width: 100%"><i class="fa fa-map-marker"></i> 查看检查位置</div></td></tr>';
}
infoDiv += '</table>';
return infoDiv;
}
},
{field:'col6', width: 100, title: '操作', align: 'center', fixed: 'right',
templet: function(row) {
var infoDiv = '<table>';
infoDiv += '<tr><td class="col-content-opition">' +
'<button class="layui-btn layui-btn-xs layui-btn-primary check-log" data-check-id="'+ row.checkId +'">案件日志</button>' +
'</td></tr>';
infoDiv += '<tr><td class="col-content-opition">' +
'<button class="layui-btn layui-btn-xs layui-btn-primary check-detail" data-check-id="'+ row.checkId +'" data-enterprise-name="'+ row.enterpriseName +'">案件详情</button>' +
'</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(),
reporter: $('#reporter').val(),
type: $('#type').val(),
industry: $('#industry').val(),
checkType: $('#checkType').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() - 130,
});
}
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/check2/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/check2/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 enterpriseName = this.dataset.enterpriseName;
top.dialog.open({
url: top.restAjax.path('route/check2/get-check-item.html?checkId={checkId}', [checkId]),
title: '【'+ enterpriseName + '】检、复查选项',
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/check2/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/check2/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-log', function() {
var checkId = this.dataset.checkId;
top.dialog.open({
url: top.restAjax.path('route/check2/list-check-log.html?checkId={checkId}', [checkId]),
title: '案件日志',
width: '500px',
height: '500px',
onClose: function() {
}
});
})
// 联动事件
// 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>

View File

@ -22,6 +22,9 @@
<div class="layui-inline search-item-width-100">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline search-item-width-100">
<input type="text" id="reporter" 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">
@ -249,7 +252,7 @@
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: '企业图片',
{field:'photos', width: 200, title: '企业图片', align: 'center',
templet: function(row) {
var photos = '';
if(row.enterpriseFactoryGate) {
@ -378,6 +381,7 @@
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
reporter: $('#reporter').val(),
type: $('#type').val(),
industry: $('#industry').val(),
checkType: $('#checkType').val(),
@ -408,8 +412,8 @@
});
$(document).on('click', '.check-detail', function() {
var checkId = this.dataset.checkid;
var enterpriseName = this.dataset.name;
var checkId = this.dataset.checkId;
var enterpriseName = this.dataset.enterpriseName;
top.dialog.open({
url: top.restAjax.path('route/check2/get-check-item.html?checkId={checkId}', [checkId]),
title: '【'+ enterpriseName + '】检、复查选项',

View File

@ -22,6 +22,9 @@
<div class="layui-inline search-item-width-100">
<input type="text" id="keywords" class="layui-input search-item" placeholder="输入关键字">
</div>
<div class="layui-inline search-item-width-100">
<input type="text" id="reporter" 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">
@ -47,13 +50,6 @@
<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>
@ -265,7 +261,7 @@
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: '企业图片',
{field:'photos', width: 200, title: '企业图片', align: 'center',
templet: function(row) {
var photos = '';
if(row.enterpriseFactoryGate) {
@ -388,6 +384,7 @@
url: top.restAjax.path(tableUrl, []),
where: {
keywords: $('#keywords').val(),
reporter: $('#reporter').val(),
type: $('#type').val(),
industry: $('#industry').val(),
checkType: $('#checkType').val(),
@ -401,7 +398,7 @@
page: {
curr: currentPage
},
height: $win.height() - 90,
height: $win.height() - 130,
});
}
// 删除