修改请假逻辑
This commit is contained in:
parent
06e323d0e1
commit
d000ece115
@ -0,0 +1,45 @@
|
||||
package com.cm.systemcity.config.properties;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "consts-id")
|
||||
public class ConstsIdProperties {
|
||||
|
||||
private Department department;
|
||||
private Role role;
|
||||
|
||||
public Department getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(Department department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public Role getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(Role role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public static class Department {
|
||||
private String ga;
|
||||
|
||||
public String getGa() {
|
||||
return ga;
|
||||
}
|
||||
|
||||
public void setGa(String ga) {
|
||||
this.ga = ga;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Role {
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -31,4 +31,13 @@ public interface ISystemCityConsts {
|
||||
*/
|
||||
String WSQ_DEPARTMENT_ID = "52fecef4-f0f5-4077-999c-39db09872718";
|
||||
|
||||
/**
|
||||
* 请假外出市五区外
|
||||
*/
|
||||
String LEAVE_OUTGOING_CITY5_OUTER = "0d9e9d33-286b-4b4c-9e5c-8155592326fe";
|
||||
/**
|
||||
* 请假外出市五区内
|
||||
*/
|
||||
String LEAVE_OUTGOING_CITY5_INNER = "af6ecb02-58df-412b-8bbe-25b7cdc640d6";
|
||||
|
||||
}
|
||||
|
@ -78,6 +78,23 @@ public class ConfigController extends AbstractController {
|
||||
throw new ParamsException("专管员签退截止时间不能为空");
|
||||
}
|
||||
params.put("nSignOutEnd", configVO.getnSignOutEnd());
|
||||
// 公安打卡设置
|
||||
if (StringUtils.isBlank(configVO.getGaSignInStr())) {
|
||||
throw new ParamsException("公安签到开始时间不能为空");
|
||||
}
|
||||
params.put("gaSignInStr", configVO.getGaSignInStr());
|
||||
if (StringUtils.isBlank(configVO.getGaSignInEnd())) {
|
||||
throw new ParamsException("公安签到截止时间不能为空");
|
||||
}
|
||||
params.put("gaSignInEnd", configVO.getGaSignInEnd());
|
||||
if (StringUtils.isBlank(configVO.getGaSignOutStr())) {
|
||||
throw new ParamsException("公安签退开始时间不能为空");
|
||||
}
|
||||
params.put("gaSignOutStr", configVO.getGaSignOutStr());
|
||||
if (StringUtils.isBlank(configVO.getGaSignOutEnd())) {
|
||||
throw new ParamsException("公安签退截止时间不能为空");
|
||||
}
|
||||
params.put("gaSignOutEnd", configVO.getGaSignOutEnd());
|
||||
// 不记录轨迹时间设置
|
||||
if (StringUtils.isBlank(configVO.getPositionRecordStr())) {
|
||||
throw new ParamsException("网格员不记录轨迹开始时间不能为空");
|
||||
|
@ -8,15 +8,13 @@ import com.cm.common.result.ErrorResult;
|
||||
import com.cm.common.result.SuccessResult;
|
||||
import com.cm.common.result.SuccessResultList;
|
||||
import com.cm.common.utils.DateUtil;
|
||||
import com.cm.systemcity.consts.ISystemCityConsts;
|
||||
import com.cm.systemcity.pojo.dtos.leave.LeaveDTO;
|
||||
import com.cm.systemcity.pojo.dtos.leave.LeaveDetailDTO;
|
||||
import com.cm.systemcity.pojo.vos.leave.LeaveApprovalVO;
|
||||
import com.cm.systemcity.pojo.vos.leave.LeaveVO;
|
||||
import com.cm.systemcity.service.BaseService;
|
||||
import com.cm.systemcity.service.leave.ILeaveService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -48,6 +46,13 @@ public class LeaveController extends AbstractController {
|
||||
return leaveService.listPageLeaveDetail(page);
|
||||
}
|
||||
|
||||
@GetMapping("list-page-leave-detail2")
|
||||
public SuccessResultList<List<LeaveDTO>> listPageLeaveDetail2(ListPage page) throws SearchException {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return leaveService.listPageLeaveDetail2(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "请假新增", notes = "请假新增接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PostMapping("saveleave")
|
||||
@ -90,10 +95,40 @@ public class LeaveController extends AbstractController {
|
||||
@PutMapping("updateleaveofapproval/{leaveId}")
|
||||
public SuccessResult updateLeaveOfApproval(@PathVariable("leaveId") String leaveId, @RequestBody Map<String, Object> params) throws ParamsException, UpdateException {
|
||||
params.put("leaveId", leaveId);
|
||||
if (params.get("leaveState") == null || "".equals(params.get("leaveState").toString())) {
|
||||
if (params.get("approverState") == null) {
|
||||
throw new ParamsException("审批失败:审批状态丢失");
|
||||
}
|
||||
return leaveService.updateLeaveOfApproval(params);
|
||||
Integer approverState = Integer.parseInt(params.get("approverState").toString());
|
||||
if (approverState != 1 && approverState != 2) {
|
||||
throw new ParamsException("审批失败:审批状态错误");
|
||||
}
|
||||
if (approverState == 2 && (params.get("approverRefuseSummary") == null || StringUtils.isBlank(params.get("approverRefuseSummary").toString()))) {
|
||||
throw new ParamsException("审批失败:审批意见不能为空");
|
||||
}
|
||||
String approverRefuseSummary = params.get("approverRefuseSummary").toString();
|
||||
return leaveService.updateLeaveOfApproval(leaveId, approverState, approverRefuseSummary);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "请假2级审批", notes = "请假2级审批接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "leaveId", value = "请假ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("updateleaveofapproval2/{leaveId}")
|
||||
public SuccessResult updateLeaveOfApproval2(@PathVariable("leaveId") String leaveId, @RequestBody Map<String, Object> params) throws ParamsException, UpdateException {
|
||||
params.put("leaveId", leaveId);
|
||||
if (params.get("approver2State") == null) {
|
||||
throw new ParamsException("审批失败:审批状态丢失");
|
||||
}
|
||||
Integer approver2State = Integer.parseInt(params.get("approver2State").toString());
|
||||
if (approver2State != 1 && approver2State != 2) {
|
||||
throw new ParamsException("审批失败:审批状态错误");
|
||||
}
|
||||
if (approver2State == 2 && (params.get("approver2RefuseSummary") == null || StringUtils.isBlank(params.get("approver2RefuseSummary").toString()))) {
|
||||
throw new ParamsException("审批失败:审批意见不能为空");
|
||||
}
|
||||
String approver2RefuseSummary = params.get("approver2RefuseSummary").toString();
|
||||
return leaveService.updateLeaveOfApproval2(leaveId, approver2State, approver2RefuseSummary);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,10 +168,19 @@ public class LeaveController extends AbstractController {
|
||||
}
|
||||
params.put("leaveTimeLong", leaveVO.getLeaveTimeLong());
|
||||
|
||||
if (leaveVO.getIsSelf() == 0 && StringUtils.equals(leaveVO.getLeaveType(), ISystemCityConsts.LEAVE_OUTGOING_CITY5_OUTER)) {
|
||||
if (StringUtils.isBlank(leaveVO.getOutgoingLng()) || StringUtils.isBlank(leaveVO.getOutgoingLat())) {
|
||||
throw new ParamsException("外出经纬度不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(leaveVO.getOutgoingLocation())) {
|
||||
throw new ParamsException("外出地点不能为空");
|
||||
}
|
||||
params.put("outgoingLocation", leaveVO.getOutgoingLocation());
|
||||
params.put("outgoingLat", leaveVO.getOutgoingLat());
|
||||
params.put("outgoingLng", leaveVO.getOutgoingLng());
|
||||
}
|
||||
params.put("leaveState", "0");
|
||||
|
||||
params.put("approverId", "");
|
||||
|
||||
params.put("approverName", "");
|
||||
|
||||
}
|
||||
|
@ -1,13 +1,21 @@
|
||||
package com.cm.systemcity.controller.app.config;
|
||||
|
||||
import com.cm.common.base.AbstractController;
|
||||
import com.cm.common.component.SecurityComponent;
|
||||
import com.cm.common.constants.ISystemConstant;
|
||||
import com.cm.common.pojo.bos.UserInfoBO;
|
||||
import com.cm.common.result.ErrorResult;
|
||||
import com.cm.common.token.app.AppTokenManager;
|
||||
import com.cm.common.token.app.entity.AppToken;
|
||||
import com.cm.common.token.app.entity.AppTokenUser;
|
||||
import com.cm.systemcity.manager.CacheManager;
|
||||
import com.cm.systemcity.pojo.dtos.config.PunchTimeDTO;
|
||||
import com.cm.systemcity.pojo.dtos.config.PunchTimeDTOV2;
|
||||
import com.cm.systemcity.service.user.CityUserService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -28,13 +36,17 @@ import java.util.Map;
|
||||
@RequestMapping(ISystemConstant.APP_PREFIX + "/config")
|
||||
public class ConfigAppController extends AbstractController {
|
||||
|
||||
@Autowired
|
||||
private CityUserService cityUserService;
|
||||
|
||||
@ApiOperation(value = "获取打卡时间", notes = "获取打卡时间接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "token", value = "token", paramType = "header"),
|
||||
})
|
||||
@ApiImplicitParams({@ApiImplicitParam(name = "token", value = "token", paramType = "header"),})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("getpunchtime")
|
||||
public PunchTimeDTOV2 getPunchTime() {
|
||||
public PunchTimeDTOV2 getPunchTime(@RequestHeader("token") String token) {
|
||||
AppToken appToken = AppTokenManager.getInstance().getToken(token);
|
||||
AppTokenUser appTokenUser = appToken.getAppTokenUser();
|
||||
|
||||
Map<String, Object> config = CacheManager.getInstance().getConfig();
|
||||
PunchTimeDTOV2 punchTimeDTOV2 = new PunchTimeDTOV2();
|
||||
punchTimeDTOV2.setSignInStr(config.get("signInStr").toString());
|
||||
@ -45,6 +57,14 @@ public class ConfigAppController extends AbstractController {
|
||||
punchTimeDTOV2.setnSignInEnd(config.get("nSignInEnd").toString());
|
||||
punchTimeDTOV2.setnSignOutStr(config.get("nSignOutStr").toString());
|
||||
punchTimeDTOV2.setnSignOutEnd(config.get("nSignOutEnd").toString());
|
||||
boolean isGa = cityUserService.isGaUser(appTokenUser.getId());
|
||||
punchTimeDTOV2.setGa(isGa);
|
||||
if (isGa) {
|
||||
punchTimeDTOV2.setGaSignInStr(config.get("gaSignInStr").toString());
|
||||
punchTimeDTOV2.setGaSignInEnd(config.get("gaSignInEnd").toString());
|
||||
punchTimeDTOV2.setGaSignOutStr(config.get("gaSignOutStr").toString());
|
||||
punchTimeDTOV2.setGaSignOutEnd(config.get("gaSignOutEnd").toString());
|
||||
}
|
||||
punchTimeDTOV2.setPositionRecordSrt(config.get("positionRecordStr").toString());
|
||||
punchTimeDTOV2.setPositionRecordEnd(config.get("positionRecordEnd").toString());
|
||||
punchTimeDTOV2.setnPositionRecordStr(config.get("nPositionRecordStr").toString());
|
||||
|
@ -7,6 +7,7 @@ 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.systemcity.consts.ISystemCityConsts;
|
||||
import com.cm.systemcity.pojo.dtos.leave.LeaveDTO;
|
||||
import com.cm.systemcity.pojo.vos.leave.LeaveApprovalVO;
|
||||
import com.cm.systemcity.pojo.vos.leave.LeaveVO;
|
||||
@ -78,13 +79,27 @@ public class LeaveAppController extends AbstractController {
|
||||
throw new ParamsException("请假时长不能为空");
|
||||
}
|
||||
params.put("leaveTimeLong", leaveVO.getLeaveTimeLong());
|
||||
params.put("leaveImg", leaveVO.getLeaveImg());
|
||||
params.put("leaveTypeName", leaveVO.getLeaveTypeName());
|
||||
params.put("isSelf", leaveVO.getIsSelf());
|
||||
|
||||
params.put("leaveState", "0");
|
||||
if (leaveVO.getIsSelf() == 0 && StringUtils.equals(leaveVO.getLeaveType(), ISystemCityConsts.LEAVE_OUTGOING_CITY5_OUTER)) {
|
||||
if (StringUtils.isBlank(leaveVO.getOutgoingLng()) || StringUtils.isBlank(leaveVO.getOutgoingLat())) {
|
||||
throw new ParamsException("外出经纬度不能为空");
|
||||
}
|
||||
if (StringUtils.isBlank(leaveVO.getOutgoingLocation())) {
|
||||
throw new ParamsException("外出地点不能为空");
|
||||
}
|
||||
params.put("outgoingLocation", leaveVO.getOutgoingLocation());
|
||||
params.put("outgoingLat", leaveVO.getOutgoingLat());
|
||||
params.put("outgoingLng", leaveVO.getOutgoingLng());
|
||||
}
|
||||
|
||||
params.put("leaveState", 0);
|
||||
params.put("approverId", "");
|
||||
|
||||
params.put("approverName", "");
|
||||
|
||||
params.put("approverState", 0);
|
||||
params.put("approver2State", 0);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "请假审批", notes = "请假审批接口")
|
||||
@ -95,14 +110,18 @@ public class LeaveAppController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("updateleaveofapproval/{leaveId}")
|
||||
public SuccessResult updateLeaveOfApproval(@RequestHeader("token") String token, @PathVariable("leaveId") String leaveId, @RequestBody LeaveApprovalVO leaveApprovalVO) throws ParamsException, UpdateException, SearchException {
|
||||
Map<String, Object> params = getParams();
|
||||
params.put("leaveId", leaveId);
|
||||
if (leaveApprovalVO.getLeaveState() == null) {
|
||||
throw new ParamsException("审批状态不能为空");
|
||||
Integer approverState = leaveApprovalVO.getApproverState();
|
||||
if (approverState == null) {
|
||||
throw new ParamsException("审批失败:审批状态丢失");
|
||||
}
|
||||
params.put("leaveState", leaveApprovalVO.getLeaveState());
|
||||
params.put("leaveRefuseSummary", leaveApprovalVO.getLeaveRefuseSummary());
|
||||
return leaveService.updateLeaveOfApproval(token, params);
|
||||
if (approverState != 1 && approverState != 2) {
|
||||
throw new ParamsException("审批失败:审批状态错误");
|
||||
}
|
||||
String approverRefuseSummary = leaveApprovalVO.getApproverRefuseSummary();
|
||||
if (approverState == 2 && StringUtils.isBlank(approverRefuseSummary)) {
|
||||
throw new ParamsException("审批失败:审批意见不能为空");
|
||||
}
|
||||
return leaveService.updateLeaveOfApproval(token, leaveId, approverState, approverRefuseSummary);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "请假列表", notes = "请假列表接口")
|
||||
|
12
src/main/java/com/cm/systemcity/dao/user/ICityUserDao.java
Normal file
12
src/main/java/com/cm/systemcity/dao/user/ICityUserDao.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.cm.systemcity.dao.user;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Repository
|
||||
public interface ICityUserDao {
|
||||
|
||||
Integer countDepartmentUser(Map<String, Object> params);
|
||||
|
||||
}
|
@ -27,6 +27,16 @@ public class PunchTimeDTOV2 {
|
||||
private String nSignOutStr;
|
||||
@ApiModelProperty(name = "nSignOutEnd", value = "专管员签退截止时间")
|
||||
private String nSignOutEnd;
|
||||
@ApiModelProperty(name = "isGa", value = "是否公安")
|
||||
private Boolean isGa;
|
||||
@ApiModelProperty(name = "gaSignInStr", value = "公安签到开始时间")
|
||||
private String gaSignInStr;
|
||||
@ApiModelProperty(name = "gaSignInEnd", value = "公安签到截止时间")
|
||||
private String gaSignInEnd;
|
||||
@ApiModelProperty(name = "gaSignOutStr", value = "公安签退开始时间")
|
||||
private String gaSignOutStr;
|
||||
@ApiModelProperty(name = "gaSignOutEnd", value = "公安签退截止时间")
|
||||
private String gaSignOutEnd;
|
||||
@ApiModelProperty(name = "positionRecordSrt", value = "网格员不记录轨迹开始时间")
|
||||
private String positionRecordSrt;
|
||||
@ApiModelProperty(name = "positionRecordEnd", value = "网格员不记录轨迹截止时间")
|
||||
@ -100,6 +110,46 @@ public class PunchTimeDTOV2 {
|
||||
this.nSignOutEnd = nSignOutEnd;
|
||||
}
|
||||
|
||||
public Boolean getGa() {
|
||||
return isGa;
|
||||
}
|
||||
|
||||
public void setGa(Boolean ga) {
|
||||
isGa = ga;
|
||||
}
|
||||
|
||||
public String getGaSignInStr() {
|
||||
return gaSignInStr;
|
||||
}
|
||||
|
||||
public void setGaSignInStr(String gaSignInStr) {
|
||||
this.gaSignInStr = gaSignInStr;
|
||||
}
|
||||
|
||||
public String getGaSignInEnd() {
|
||||
return gaSignInEnd;
|
||||
}
|
||||
|
||||
public void setGaSignInEnd(String gaSignInEnd) {
|
||||
this.gaSignInEnd = gaSignInEnd;
|
||||
}
|
||||
|
||||
public String getGaSignOutStr() {
|
||||
return gaSignOutStr;
|
||||
}
|
||||
|
||||
public void setGaSignOutStr(String gaSignOutStr) {
|
||||
this.gaSignOutStr = gaSignOutStr;
|
||||
}
|
||||
|
||||
public String getGaSignOutEnd() {
|
||||
return gaSignOutEnd;
|
||||
}
|
||||
|
||||
public void setGaSignOutEnd(String gaSignOutEnd) {
|
||||
this.gaSignOutEnd = gaSignOutEnd;
|
||||
}
|
||||
|
||||
public String getPositionRecordSrt() {
|
||||
return positionRecordSrt == null ? "" : positionRecordSrt;
|
||||
}
|
||||
|
@ -24,20 +24,44 @@ public class LeaveDTO {
|
||||
private String leaveTimeApm;
|
||||
@ApiModelProperty(name = "leaveType", value = "请假类型")
|
||||
private String leaveType;
|
||||
@ApiModelProperty(name = "leaveTypeName", value = "请假类型名称")
|
||||
private String leaveTypeName;
|
||||
@ApiModelProperty(name = "leaveSummary", value = "请假说明")
|
||||
private String leaveSummary;
|
||||
@ApiModelProperty(name = "leaveTimeLong", value = "请假时长")
|
||||
private String leaveTimeLong;
|
||||
@ApiModelProperty(name = "leaveState", value = "请假状态")
|
||||
private Integer leaveState;
|
||||
@ApiModelProperty(name = "leaveImg", value = "请假条")
|
||||
private String leaveImg;
|
||||
@ApiModelProperty(name = "leaveUserId", value = "请假人ID")
|
||||
private String leaveUserId;
|
||||
@ApiModelProperty(name = "leaveUserName", value = "请假人名称")
|
||||
private String leaveUserName;
|
||||
@ApiModelProperty(name = "isSelf", value = "是否私假")
|
||||
private Integer isSelf;
|
||||
@ApiModelProperty(name = "outgoingLocation", value = "外出地点")
|
||||
private String outgoingLocation;
|
||||
@ApiModelProperty(name = "outgoingLng", value = "外出经度")
|
||||
private String outgoingLng;
|
||||
@ApiModelProperty(name = "outgoingLat", value = "外出纬度")
|
||||
private String outgoingLat;
|
||||
@ApiModelProperty(name = "approverId", value = "审批人")
|
||||
private String approverId;
|
||||
@ApiModelProperty(name = "approverName", value = "审批人姓名")
|
||||
private String approverName;
|
||||
@ApiModelProperty(name = "approverState", value = "审批状态")
|
||||
private Integer approverState;
|
||||
@ApiModelProperty(name = "approverRefuseSummary", value = "审批意见")
|
||||
private String approverRefuseSummary;
|
||||
@ApiModelProperty(name = "approver2Id", value = "审批人2")
|
||||
private String approver2Id;
|
||||
@ApiModelProperty(name = "approver2Name", value = "审批人2姓名")
|
||||
private String approver2Name;
|
||||
@ApiModelProperty(name = "approver2State", value = "审批2状态")
|
||||
private Integer approver2State;
|
||||
@ApiModelProperty(name = "approver2RefuseSummary", value = "审批2意见")
|
||||
private String approver2RefuseSummary;
|
||||
@ApiModelProperty(name = "leaveRefuseSummary", value = "拒绝意见")
|
||||
private String leaveRefuseSummary;
|
||||
@ApiModelProperty(name = "userPhone", value = "用户电话")
|
||||
@ -85,6 +109,14 @@ public class LeaveDTO {
|
||||
this.leaveType = leaveType;
|
||||
}
|
||||
|
||||
public String getLeaveTypeName() {
|
||||
return leaveTypeName;
|
||||
}
|
||||
|
||||
public void setLeaveTypeName(String leaveTypeName) {
|
||||
this.leaveTypeName = leaveTypeName;
|
||||
}
|
||||
|
||||
public String getLeaveSummary() {
|
||||
return leaveSummary == null ? "" : leaveSummary.trim();
|
||||
}
|
||||
@ -109,6 +141,14 @@ public class LeaveDTO {
|
||||
this.leaveState = leaveState;
|
||||
}
|
||||
|
||||
public String getLeaveImg() {
|
||||
return leaveImg;
|
||||
}
|
||||
|
||||
public void setLeaveImg(String leaveImg) {
|
||||
this.leaveImg = leaveImg;
|
||||
}
|
||||
|
||||
public String getLeaveUserId() {
|
||||
return leaveUserId == null ? "" : leaveUserId.trim();
|
||||
}
|
||||
@ -125,6 +165,38 @@ public class LeaveDTO {
|
||||
this.leaveUserName = leaveUserName;
|
||||
}
|
||||
|
||||
public Integer getIsSelf() {
|
||||
return isSelf;
|
||||
}
|
||||
|
||||
public void setIsSelf(Integer isSelf) {
|
||||
this.isSelf = isSelf;
|
||||
}
|
||||
|
||||
public String getOutgoingLocation() {
|
||||
return outgoingLocation;
|
||||
}
|
||||
|
||||
public void setOutgoingLocation(String outgoingLocation) {
|
||||
this.outgoingLocation = outgoingLocation;
|
||||
}
|
||||
|
||||
public String getOutgoingLng() {
|
||||
return outgoingLng;
|
||||
}
|
||||
|
||||
public void setOutgoingLng(String outgoingLng) {
|
||||
this.outgoingLng = outgoingLng;
|
||||
}
|
||||
|
||||
public String getOutgoingLat() {
|
||||
return outgoingLat;
|
||||
}
|
||||
|
||||
public void setOutgoingLat(String outgoingLat) {
|
||||
this.outgoingLat = outgoingLat;
|
||||
}
|
||||
|
||||
public String getApproverId() {
|
||||
return approverId == null ? "" : approverId.trim();
|
||||
}
|
||||
@ -141,6 +213,54 @@ public class LeaveDTO {
|
||||
this.approverName = approverName;
|
||||
}
|
||||
|
||||
public Integer getApproverState() {
|
||||
return approverState;
|
||||
}
|
||||
|
||||
public void setApproverState(Integer approverState) {
|
||||
this.approverState = approverState;
|
||||
}
|
||||
|
||||
public String getApproverRefuseSummary() {
|
||||
return approverRefuseSummary;
|
||||
}
|
||||
|
||||
public void setApproverRefuseSummary(String approverRefuseSummary) {
|
||||
this.approverRefuseSummary = approverRefuseSummary;
|
||||
}
|
||||
|
||||
public String getApprover2Id() {
|
||||
return approver2Id;
|
||||
}
|
||||
|
||||
public void setApprover2Id(String approver2Id) {
|
||||
this.approver2Id = approver2Id;
|
||||
}
|
||||
|
||||
public String getApprover2Name() {
|
||||
return approver2Name;
|
||||
}
|
||||
|
||||
public void setApprover2Name(String approver2Name) {
|
||||
this.approver2Name = approver2Name;
|
||||
}
|
||||
|
||||
public Integer getApprover2State() {
|
||||
return approver2State;
|
||||
}
|
||||
|
||||
public void setApprover2State(Integer approver2State) {
|
||||
this.approver2State = approver2State;
|
||||
}
|
||||
|
||||
public String getApprover2RefuseSummary() {
|
||||
return approver2RefuseSummary;
|
||||
}
|
||||
|
||||
public void setApprover2RefuseSummary(String approver2RefuseSummary) {
|
||||
this.approver2RefuseSummary = approver2RefuseSummary;
|
||||
}
|
||||
|
||||
public String getLeaveRefuseSummary() {
|
||||
return leaveRefuseSummary == null ? "" : leaveRefuseSummary.trim();
|
||||
}
|
||||
@ -167,38 +287,24 @@ public class LeaveDTO {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"leaveId\":")
|
||||
.append("\"").append(leaveId).append("\"");
|
||||
sb.append(",\"leaveTime\":")
|
||||
.append("\"").append(leaveTime).append("\"");
|
||||
sb.append(",\"leaveTimeEnd\":")
|
||||
.append("\"").append(leaveTimeEnd).append("\"");
|
||||
sb.append(",\"leaveTimeApm\":")
|
||||
.append("\"").append(leaveTimeApm).append("\"");
|
||||
sb.append(",\"leaveType\":")
|
||||
.append("\"").append(leaveType).append("\"");
|
||||
sb.append(",\"leaveSummary\":")
|
||||
.append("\"").append(leaveSummary).append("\"");
|
||||
sb.append(",\"leaveTimeLong\":")
|
||||
.append("\"").append(leaveTimeLong).append("\"");
|
||||
sb.append(",\"leaveState\":")
|
||||
.append(leaveState);
|
||||
sb.append(",\"leaveUserId\":")
|
||||
.append("\"").append(leaveUserId).append("\"");
|
||||
sb.append(",\"leaveUserName\":")
|
||||
.append("\"").append(leaveUserName).append("\"");
|
||||
sb.append(",\"approverId\":")
|
||||
.append("\"").append(approverId).append("\"");
|
||||
sb.append(",\"approverName\":")
|
||||
.append("\"").append(approverName).append("\"");
|
||||
sb.append(",\"leaveRefuseSummary\":")
|
||||
.append("\"").append(leaveRefuseSummary).append("\"");
|
||||
sb.append(",\"userPhone\":")
|
||||
.append("\"").append(userPhone).append("\"");
|
||||
sb.append(",\"userAvatar\":")
|
||||
.append("\"").append(userAvatar).append("\"");
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
return "LeaveDTO{" +
|
||||
"leaveId='" + leaveId + '\'' +
|
||||
", leaveTime='" + leaveTime + '\'' +
|
||||
", leaveTimeEnd='" + leaveTimeEnd + '\'' +
|
||||
", leaveTimeApm='" + leaveTimeApm + '\'' +
|
||||
", leaveType='" + leaveType + '\'' +
|
||||
", leaveTypeName='" + leaveTypeName + '\'' +
|
||||
", leaveSummary='" + leaveSummary + '\'' +
|
||||
", leaveTimeLong='" + leaveTimeLong + '\'' +
|
||||
", leaveState=" + leaveState +
|
||||
", leaveImg=" + leaveImg +
|
||||
", leaveUserId='" + leaveUserId + '\'' +
|
||||
", leaveUserName='" + leaveUserName + '\'' +
|
||||
", approverId='" + approverId + '\'' +
|
||||
", approverName='" + approverName + '\'' +
|
||||
", leaveRefuseSummary='" + leaveRefuseSummary + '\'' +
|
||||
", userPhone='" + userPhone + '\'' +
|
||||
", userAvatar='" + userAvatar + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -32,6 +32,14 @@ public class ConfigVOV2 {
|
||||
private String nSignOutStr;
|
||||
@ApiModelProperty(name = "nSignOutEnd", value = "专管员签退截止时间")
|
||||
private String nSignOutEnd;
|
||||
@ApiModelProperty(name = "gaSignInStr", value = "公安签到开始时间")
|
||||
private String gaSignInStr;
|
||||
@ApiModelProperty(name = "gaSignInEnd", value = "公安签到截止时间")
|
||||
private String gaSignInEnd;
|
||||
@ApiModelProperty(name = "gaSignOutStr", value = "公安签退开始时间")
|
||||
private String gaSignOutStr;
|
||||
@ApiModelProperty(name = "gaSignOutEnd", value = "公安签退截止时间")
|
||||
private String gaSignOutEnd;
|
||||
@ApiModelProperty(name = "positionRecordStr", value = "网格员不记录轨迹开始时间")
|
||||
private String positionRecordStr;
|
||||
@ApiModelProperty(name = "positionRecordEnd", value = "网格员不记录轨迹截止时间")
|
||||
@ -121,6 +129,38 @@ public class ConfigVOV2 {
|
||||
this.nSignOutEnd = nSignOutEnd;
|
||||
}
|
||||
|
||||
public String getGaSignInStr() {
|
||||
return gaSignInStr;
|
||||
}
|
||||
|
||||
public void setGaSignInStr(String gaSignInStr) {
|
||||
this.gaSignInStr = gaSignInStr;
|
||||
}
|
||||
|
||||
public String getGaSignInEnd() {
|
||||
return gaSignInEnd;
|
||||
}
|
||||
|
||||
public void setGaSignInEnd(String gaSignInEnd) {
|
||||
this.gaSignInEnd = gaSignInEnd;
|
||||
}
|
||||
|
||||
public String getGaSignOutStr() {
|
||||
return gaSignOutStr;
|
||||
}
|
||||
|
||||
public void setGaSignOutStr(String gaSignOutStr) {
|
||||
this.gaSignOutStr = gaSignOutStr;
|
||||
}
|
||||
|
||||
public String getGaSignOutEnd() {
|
||||
return gaSignOutEnd;
|
||||
}
|
||||
|
||||
public void setGaSignOutEnd(String gaSignOutEnd) {
|
||||
this.gaSignOutEnd = gaSignOutEnd;
|
||||
}
|
||||
|
||||
public String getPositionRecordStr() {
|
||||
return positionRecordStr == null ? "" : positionRecordStr;
|
||||
}
|
||||
|
@ -13,35 +13,24 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
@ApiModel
|
||||
public class LeaveApprovalVO {
|
||||
|
||||
@ApiModelProperty(name = "leaveType", value = "审批状态")
|
||||
private Integer leaveState;
|
||||
@ApiModelProperty(name = "leaveSummary", value = "拒绝理由")
|
||||
private String leaveRefuseSummary;
|
||||
@ApiModelProperty(name = "approverState", value = "审批状态")
|
||||
private Integer approverState;
|
||||
@ApiModelProperty(name = "approverRefuseSummary", value = "拒绝理由")
|
||||
private String approverRefuseSummary;
|
||||
|
||||
public Integer getLeaveState() {
|
||||
return leaveState;
|
||||
public Integer getApproverState() {
|
||||
return approverState;
|
||||
}
|
||||
|
||||
public void setLeaveState(Integer leaveState) {
|
||||
this.leaveState = leaveState;
|
||||
public void setApproverState(Integer approverState) {
|
||||
this.approverState = approverState;
|
||||
}
|
||||
|
||||
public String getLeaveRefuseSummary() {
|
||||
return leaveRefuseSummary == null ? "" : leaveRefuseSummary.trim();
|
||||
public String getApproverRefuseSummary() {
|
||||
return approverRefuseSummary == null ? "" : approverRefuseSummary;
|
||||
}
|
||||
|
||||
public void setLeaveRefuseSummary(String leaveRefuseSummary) {
|
||||
this.leaveRefuseSummary = leaveRefuseSummary;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"leaveState\":")
|
||||
.append("\"").append(leaveState).append("\"");
|
||||
sb.append(",\"leaveRefuseSummary\":")
|
||||
.append("\"").append(leaveRefuseSummary).append("\"");
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
public void setApproverRefuseSummary(String approverRefuseSummary) {
|
||||
this.approverRefuseSummary = approverRefuseSummary;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package com.cm.systemcity.pojo.vos.leave;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.commons.text.StringEscapeUtils;
|
||||
@ -20,10 +21,22 @@ public class LeaveVO {
|
||||
private String leaveTimeApm;
|
||||
@ApiModelProperty(name = "leaveType", value = "请假类型")
|
||||
private String leaveType;
|
||||
@ApiModelProperty(name = "leaveTypeName", value = "请假类型名称")
|
||||
private String leaveTypeName;
|
||||
@ApiModelProperty(name = "leaveSummary", value = "请假说明")
|
||||
private String leaveSummary;
|
||||
@ApiModelProperty(name = "leaveTimeLong", value = "请假时长")
|
||||
private String leaveTimeLong;
|
||||
@ApiModelProperty(name = "leaveImg", value = "请假图片")
|
||||
private String leaveImg;
|
||||
@ApiModelProperty(name = "isSelf", value = "是否私假")
|
||||
private Integer isSelf;
|
||||
@ApiModelProperty(name = "outgoingLocation", value = "外出地点")
|
||||
private String outgoingLocation;
|
||||
@ApiModelProperty(name = "outgoingLng", value = "外出经度")
|
||||
private String outgoingLng;
|
||||
@ApiModelProperty(name = "outgoingLat", value = "外出维度")
|
||||
private String outgoingLat;
|
||||
|
||||
public String getLeaveTime() {
|
||||
return leaveTime == null ? "" : leaveTime.trim();
|
||||
@ -49,6 +62,14 @@ public class LeaveVO {
|
||||
this.leaveType = leaveType;
|
||||
}
|
||||
|
||||
public String getLeaveTypeName() {
|
||||
return leaveTypeName;
|
||||
}
|
||||
|
||||
public void setLeaveTypeName(String leaveTypeName) {
|
||||
this.leaveTypeName = leaveTypeName;
|
||||
}
|
||||
|
||||
public String getLeaveSummary() {
|
||||
return leaveSummary;
|
||||
}
|
||||
@ -65,20 +86,43 @@ public class LeaveVO {
|
||||
this.leaveTimeLong = leaveTimeLong;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"leaveTime\":")
|
||||
.append("\"").append(leaveTime).append("\"");
|
||||
sb.append(",\"leaveTimeApm\":")
|
||||
.append("\"").append(leaveTimeApm).append("\"");
|
||||
sb.append(",\"leaveType\":")
|
||||
.append("\"").append(leaveType).append("\"");
|
||||
sb.append(",\"leaveSummary\":")
|
||||
.append("\"").append(leaveSummary).append("\"");
|
||||
sb.append(",\"leaveTimeLong\":")
|
||||
.append("\"").append(leaveTimeLong).append("\"");
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
public String getLeaveImg() {
|
||||
return leaveImg;
|
||||
}
|
||||
|
||||
public void setLeaveImg(String leaveImg) {
|
||||
this.leaveImg = leaveImg;
|
||||
}
|
||||
|
||||
public Integer getIsSelf() {
|
||||
return isSelf;
|
||||
}
|
||||
|
||||
public void setIsSelf(Integer isSelf) {
|
||||
this.isSelf = isSelf;
|
||||
}
|
||||
|
||||
public String getOutgoingLocation() {
|
||||
return outgoingLocation;
|
||||
}
|
||||
|
||||
public void setOutgoingLocation(String outgoingLocation) {
|
||||
this.outgoingLocation = outgoingLocation;
|
||||
}
|
||||
|
||||
public String getOutgoingLng() {
|
||||
return outgoingLng;
|
||||
}
|
||||
|
||||
public void setOutgoingLng(String outgoingLng) {
|
||||
this.outgoingLng = outgoingLng;
|
||||
}
|
||||
|
||||
public String getOutgoingLat() {
|
||||
return outgoingLat;
|
||||
}
|
||||
|
||||
public void setOutgoingLat(String outgoingLat) {
|
||||
this.outgoingLat = outgoingLat;
|
||||
}
|
||||
}
|
@ -75,8 +75,23 @@ public interface ILeaveService {
|
||||
* @return
|
||||
* @throws UpdateException
|
||||
*/
|
||||
@Deprecated
|
||||
SuccessResult updateLeaveOfApproval(Map<String, Object> params) throws UpdateException;
|
||||
|
||||
SuccessResult updateLeaveOfApproval(String leaveId, Integer approverState, String approverRefuseSummary);
|
||||
|
||||
|
||||
/**
|
||||
* 2级审批
|
||||
*
|
||||
* @param leaveId
|
||||
* @param approver2State
|
||||
* @param approver2RefuseSummary
|
||||
* @return
|
||||
*/
|
||||
SuccessResult updateLeaveOfApproval2(String leaveId, Integer approver2State, String approver2RefuseSummary);
|
||||
|
||||
|
||||
/**
|
||||
* 请假审批
|
||||
*
|
||||
@ -85,8 +100,12 @@ public interface ILeaveService {
|
||||
* @return
|
||||
* @throws UpdateException
|
||||
*/
|
||||
@Deprecated
|
||||
SuccessResult updateLeaveOfApproval(String token, Map<String, Object> params) throws UpdateException, SearchException;
|
||||
|
||||
SuccessResult updateLeaveOfApproval(String token, String leaveId, Integer approverState, String approverRefuseSummary);
|
||||
|
||||
|
||||
/**
|
||||
* 全部请假列表
|
||||
*
|
||||
@ -169,6 +188,15 @@ public interface ILeaveService {
|
||||
*/
|
||||
SuccessResultList<List<LeaveDTO>> listPageLeaveDetail(ListPage page) throws SearchException;
|
||||
|
||||
/**
|
||||
* 2级分页请假详情列表
|
||||
*
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<LeaveDTO>> listPageLeaveDetail2(ListPage page);
|
||||
|
||||
|
||||
/**
|
||||
* 导出(EXCEL)请教记录
|
||||
*
|
||||
@ -194,4 +222,7 @@ public interface ILeaveService {
|
||||
* @throws SearchException
|
||||
*/
|
||||
Integer countUserLeave(Map<String, Object> params) throws SearchException;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import com.cm.common.token.app.AppTokenManager;
|
||||
import com.cm.common.token.app.entity.AppTokenUser;
|
||||
import com.cm.common.utils.DateUtil;
|
||||
import com.cm.common.utils.UUIDUtil;
|
||||
import com.cm.systemcity.consts.ISystemCityConsts;
|
||||
import com.cm.systemcity.dao.leave.ILeaveDao;
|
||||
import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossDTO;
|
||||
import com.cm.systemcity.pojo.dtos.leave.LeaveDTO;
|
||||
@ -118,6 +119,14 @@ public class LeaveServiceImpl extends BaseService implements ILeaveService {
|
||||
DateTime leaveTimeEndDateTime = leaveTimeDateTime.plusHours((int) (24 * Double.parseDouble(leaveTimeLong)));
|
||||
params.put("leaveTimeEnd", leaveTimeEndDateTime.toString(dateTimeFormatter));
|
||||
|
||||
// 如果是市五区内,直接不过
|
||||
if(StringUtils.equals(params.get("leaveType").toString(), ISystemCityConsts.LEAVE_OUTGOING_CITY5_INNER)) {
|
||||
params.put("leaveState", 2);
|
||||
params.put("approverId", "1");
|
||||
params.put("approverName", "系统");
|
||||
params.put("approverState", 2);
|
||||
params.put("approverRefuseSummary", "不通过");
|
||||
}
|
||||
setSaveInfo(token, params);
|
||||
leaveDao.saveLeave(params);
|
||||
|
||||
@ -144,6 +153,39 @@ public class LeaveServiceImpl extends BaseService implements ILeaveService {
|
||||
@Override
|
||||
public SuccessResult updateLeaveOfApproval(Map<String, Object> params) throws UpdateException {
|
||||
setUpdateInfo(params);
|
||||
params.put("leaveState", 0);
|
||||
leaveDao.updateLeaveOfApproval(params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult updateLeaveOfApproval(String leaveId, Integer approverState, String approverRefuseSummary) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
setUpdateInfo(params);
|
||||
// 如果不通过,直接设置不通过
|
||||
if (approverState == 2) {
|
||||
params.put("leaveState", 2);
|
||||
params.put("leaveRefuseSummary", approverRefuseSummary);
|
||||
}
|
||||
params.put("approverState", approverState);
|
||||
params.put("approverRefuseSummary", approverRefuseSummary);
|
||||
params.put("leaveId", leaveId);
|
||||
leaveDao.updateLeaveOfApproval(params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult updateLeaveOfApproval2(String leaveId, Integer approver2State, String approver2RefuseSummary) {
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
// 2级审批最终决定请假状态
|
||||
params.put("leaveState", approver2State);
|
||||
params.put("leaveRefuseSummary", approver2RefuseSummary);
|
||||
params.put("approver2Id", currentUser.getUserId());
|
||||
params.put("approver2Name", currentUser.getUserName());
|
||||
params.put("approver2State", approver2State);
|
||||
params.put("approver2RefuseSummary", approver2RefuseSummary);
|
||||
params.put("leaveId", leaveId);
|
||||
leaveDao.updateLeaveOfApproval(params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
@ -151,6 +193,8 @@ public class LeaveServiceImpl extends BaseService implements ILeaveService {
|
||||
@Override
|
||||
public SuccessResult updateLeaveOfApproval(String token, Map<String, Object> params) throws UpdateException, SearchException {
|
||||
setUpdateInfo(token, params);
|
||||
params.put("approverState", 0);
|
||||
params.put("approver2State", 0);
|
||||
leaveDao.updateLeaveOfApproval(params);
|
||||
String leaveId = params.get("leaveId").toString();
|
||||
params.clear();
|
||||
@ -164,6 +208,22 @@ public class LeaveServiceImpl extends BaseService implements ILeaveService {
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResult updateLeaveOfApproval(String token, String leaveId, Integer approverState, String approverRefuseSummary) {
|
||||
Map<String, Object> params = getHashMap(2);
|
||||
setUpdateInfo(token, params);
|
||||
// 如果不通过,直接设置不通过
|
||||
if (approverState == 2) {
|
||||
params.put("leaveState", 2);
|
||||
params.put("leaveRefuseSummary", approverRefuseSummary);
|
||||
}
|
||||
params.put("approverState", approverState);
|
||||
params.put("approverRefuseSummary", approverRefuseSummary);
|
||||
params.put("leaveId", leaveId);
|
||||
leaveDao.updateLeaveOfApproval(params);
|
||||
return new SuccessResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LeaveDTO> listLeaveAll(Map<String, Object> params) throws SearchException {
|
||||
List<LeaveDTO> leaveDTOs = leaveDao.listLeave(params);
|
||||
@ -236,7 +296,7 @@ public class LeaveServiceImpl extends BaseService implements ILeaveService {
|
||||
Map<String, Object> query = page.getParams();
|
||||
// 如果为admin管理员 查看所有数据 其次 向谁请假 谁可以看到
|
||||
UserInfoBO currentUser = securityComponent.getCurrentUser();
|
||||
if("1".equals(currentUser.getUserId())){
|
||||
if ("1".equals(currentUser.getUserId())) {
|
||||
query.put("approverId", "");
|
||||
} else {
|
||||
query.put("approverId", currentUser.getUserId());
|
||||
@ -247,6 +307,16 @@ public class LeaveServiceImpl extends BaseService implements ILeaveService {
|
||||
return new SuccessResultList<>(list, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<LeaveDTO>> listPageLeaveDetail2(ListPage page) {
|
||||
// 1级审批通过的请假列表
|
||||
page.getParams().put("approverState", 1);
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<LeaveDTO> list = leaveDao.listLeave(page.getParams());
|
||||
PageInfo<LeaveDTO> pageInfo = new PageInfo<>(list);
|
||||
return new SuccessResultList<>(list, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void listLeaveDetailToExcel(HttpServletResponse response, Map<String, Object> params) throws SearchException, IOException {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
|
@ -682,6 +682,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
|
||||
@Override
|
||||
public SuccessResultList<List<ReportCaseHandleDTO>> listPageReportCaseHandle(ListPage page) throws SearchException {
|
||||
setNPersonAreaParams(page.getParams());
|
||||
page.getParams().put("caseStatus", 3);
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<ReportCaseHandleDTO> reportCaseHandleDTOs = reportCaseDao.listPageReportCaseHandle(page.getParams());
|
||||
PageInfo<ReportCaseHandleDTO> pageInfo = new PageInfo<>(reportCaseHandleDTOs);
|
||||
@ -787,6 +788,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer
|
||||
@Override
|
||||
public SuccessResultList<List<ReportCaseInspectDTO>> listPageReportCaseInspect(ListPage page) throws SearchException {
|
||||
setNPersonAreaParams(page.getParams());
|
||||
page.getParams().put("caseStatus", 4);
|
||||
PageHelper.startPage(page.getPage(), page.getRows());
|
||||
List<ReportCaseInspectDTO> reportCaseInspectDTOs = reportCaseDao.listPageReportCaseInspect(page.getParams());
|
||||
PageInfo<ReportCaseInspectDTO> pageInfo = new PageInfo<>(reportCaseInspectDTOs);
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.cm.systemcity.service.user;
|
||||
|
||||
import com.cm.common.exception.base.SystemException;
|
||||
import com.cm.systemcity.config.properties.ConstsIdProperties;
|
||||
import com.cm.systemcity.dao.user.ICityUserDao;
|
||||
import com.cm.systemcity.service.BaseService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class CityUserService extends BaseService {
|
||||
|
||||
@Autowired
|
||||
private ConstsIdProperties constsIdProperties;
|
||||
@Autowired
|
||||
private ICityUserDao cityUserDao;
|
||||
|
||||
/**
|
||||
* 是否是公安局人员
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public boolean isGaUser(String userId) {
|
||||
String departmentGaId = constsIdProperties.getDepartment().getGa();
|
||||
if (StringUtils.isBlank(departmentGaId)) {
|
||||
throw new SystemException("未配置 consts-id:department-ga");
|
||||
}
|
||||
Map<String, Object> params = getHashMap(4);
|
||||
params.put("userId", userId);
|
||||
params.put("departmentId", departmentGaId);
|
||||
Integer count = cityUserDao.countDepartmentUser(params);
|
||||
return count != null && count > 0;
|
||||
}
|
||||
|
||||
}
|
@ -986,10 +986,16 @@ public class UserLocationServiceImpl extends BaseService implements IUserLocatio
|
||||
String amEndTime = String.format("%s %s", day, config.get("amEndPunchTime").toString());
|
||||
String pmStartTime = String.format("%s %s", day, config.get("pmStartPunchTime").toString());
|
||||
String pmEndTime = String.format("%s %s", day, config.get("pmEndPunchTime").toString());*/
|
||||
String amStartTime = String.format("%s %s", day, config.get("signInEnd").toString());
|
||||
// 第一次调整
|
||||
// String amStartTime = String.format("%s %s", day, config.get("signInEnd").toString());
|
||||
// String amEndTime = String.format("%s %s", day, config.get("positionRecordStr").toString());
|
||||
// String pmStartTime = String.format("%s %s", day, config.get("positionRecordEnd").toString());
|
||||
// String pmEndTime = String.format("%s %s", day, config.get("signOutStr").toString());
|
||||
// 第二次调整
|
||||
String amStartTime = String.format("%s %s", day, "07:00:00");
|
||||
String amEndTime = String.format("%s %s", day, config.get("positionRecordStr").toString());
|
||||
String pmStartTime = String.format("%s %s", day, config.get("positionRecordEnd").toString());
|
||||
String pmEndTime = String.format("%s %s", day, config.get("signOutStr").toString());
|
||||
String pmEndTime = String.format("%s %s", day, "19:00:00");
|
||||
// 上午开始上班时间
|
||||
DateTime amStartWorkTime = DateTimeFormat.forPattern(DATETIME_FORMATTER).parseDateTime(amStartTime);
|
||||
// 上午结束上班时间
|
||||
|
@ -7,6 +7,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.common.plugin.oauth.service.department.IDepartmentService;
|
||||
import com.cm.common.pojo.ListPage;
|
||||
import com.cm.common.result.SuccessResult;
|
||||
import com.cm.common.result.SuccessResultData;
|
||||
@ -21,6 +22,7 @@ import com.cm.systemcity.manager.SignManager;
|
||||
import com.cm.systemcity.pojo.dtos.usersignin.*;
|
||||
import com.cm.systemcity.service.BaseService;
|
||||
import com.cm.systemcity.service.communityboss.ICommunityBossService;
|
||||
import com.cm.systemcity.service.user.CityUserService;
|
||||
import com.cm.systemcity.service.usersignin.IUserSigninService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@ -52,6 +54,8 @@ public class UserSigninServiceImpl extends BaseService implements IUserSigninSer
|
||||
private SecurityComponent securityComponent;
|
||||
@Autowired
|
||||
private ICommunityBossService communityBossService;
|
||||
@Autowired
|
||||
private CityUserService cityUserService;
|
||||
|
||||
@Override
|
||||
public SuccessResult saveUserSignin(Map<String, Object> params) throws SaveException, SearchException {
|
||||
@ -84,7 +88,11 @@ public class UserSigninServiceImpl extends BaseService implements IUserSigninSer
|
||||
String signInStr = "signInStr";
|
||||
String signInEnd = "signInEnd";
|
||||
boolean hasNRole = hasNRole(appTokenUser.getRoles());
|
||||
if (hasNRole) {
|
||||
boolean isGa = cityUserService.isGaUser(appTokenUser.getId());
|
||||
if (isGa) {
|
||||
signInStr = "gaSignInStr";
|
||||
signInEnd = "gaSignInEnd";
|
||||
} else if (hasNRole) {
|
||||
signInStr = "nSignInStr";
|
||||
signInEnd = "nSignInEnd";
|
||||
}
|
||||
@ -169,21 +177,21 @@ public class UserSigninServiceImpl extends BaseService implements IUserSigninSer
|
||||
params.put("startDate", params.get("startDate").toString() + " 00:00:00");
|
||||
params.put("endDate", params.get("endDate").toString() + " 23:59:59");
|
||||
// 查询五级网格员
|
||||
if(params.get("userType") != null && "4".equals(params.get("userType").toString())){
|
||||
if (params.get("userType") != null && "4".equals(params.get("userType").toString())) {
|
||||
params.put("communityBossLevel", "4");
|
||||
List<Map<String, Object>> gridDaySignInList = userSigninDao.listGridUserSignIn(params);
|
||||
for(Map<String, Object> item : gridDaySignInList){
|
||||
item.put("gmtCreate", item.get("gmtCreate").toString().substring(0,19));
|
||||
for (Map<String, Object> item : gridDaySignInList) {
|
||||
item.put("gmtCreate", item.get("gmtCreate").toString().substring(0, 19));
|
||||
}
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(gridDaySignInList);
|
||||
return new SuccessResultList<>(gridDaySignInList, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
}
|
||||
// 查询专管员
|
||||
if(params.get("userType") != null && "N".equals(params.get("userType").toString())){
|
||||
if (params.get("userType") != null && "N".equals(params.get("userType").toString())) {
|
||||
params.put("roleId", "bc405346-8714-4ded-89ac-9cc4d755f66a");
|
||||
List<Map<String, Object>> nDaySignInList = userSigninDao.listNUserSignIn(params);
|
||||
for(Map<String, Object> item : nDaySignInList){
|
||||
item.put("gmtCreate", item.get("gmtCreate").toString().substring(0,19));
|
||||
for (Map<String, Object> item : nDaySignInList) {
|
||||
item.put("gmtCreate", item.get("gmtCreate").toString().substring(0, 19));
|
||||
}
|
||||
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(nDaySignInList);
|
||||
return new SuccessResultList<>(nDaySignInList, pageInfo.getPageNum(), pageInfo.getTotal());
|
||||
@ -202,7 +210,7 @@ public class UserSigninServiceImpl extends BaseService implements IUserSigninSer
|
||||
@Override
|
||||
public SuccessResultData<UserSigninStatusDTO> getCheckUserSignin(String token, Map<String, Object> params) throws SearchException {
|
||||
UserSigninStatusDTO userSigninStatusDTO = new UserSigninStatusDTO();
|
||||
try{
|
||||
try {
|
||||
AppTokenUser appTokenUser = AppTokenManager.getInstance().getToken(token).getAppTokenUser();
|
||||
UserSigninDTO userSigninDTO = checkUserSignIn(appTokenUser.getId(), hasNRole(appTokenUser.getRoles()) ? null : DateUtil.getAmPm());
|
||||
userSigninStatusDTO = new UserSigninStatusDTO();
|
||||
@ -212,7 +220,7 @@ public class UserSigninServiceImpl extends BaseService implements IUserSigninSer
|
||||
userSigninStatusDTO.setSignIn(Boolean.TRUE);
|
||||
userSigninStatusDTO.setLate(StringUtils.equals("0", userSigninDTO.getIsLate()) ? Boolean.FALSE : Boolean.TRUE);
|
||||
}
|
||||
} catch (NullPointerException e){
|
||||
} catch (NullPointerException e) {
|
||||
LOG.error(token);
|
||||
return new SuccessResultData<>(userSigninStatusDTO);
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ import com.cm.systemcity.manager.SignManager;
|
||||
import com.cm.systemcity.pojo.dtos.usersignout.*;
|
||||
import com.cm.systemcity.service.BaseService;
|
||||
import com.cm.systemcity.service.communityboss.ICommunityBossService;
|
||||
import com.cm.systemcity.service.user.CityUserService;
|
||||
import com.cm.systemcity.service.usersignout.IUserSignoutService;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
@ -51,6 +52,8 @@ public class UserSignoutServiceImpl extends BaseService implements IUserSignoutS
|
||||
private SecurityComponent securityComponent;
|
||||
@Autowired
|
||||
private ICommunityBossService communityBossService;
|
||||
@Autowired
|
||||
private CityUserService cityUserService;
|
||||
|
||||
@Override
|
||||
public SuccessResult saveUserSignout(Map<String, Object> params) throws SaveException, SearchException {
|
||||
@ -83,7 +86,11 @@ public class UserSignoutServiceImpl extends BaseService implements IUserSignoutS
|
||||
String signOutStr = "signOutStr";
|
||||
String signOutEnd = "signOutEnd";
|
||||
boolean hasNRole = hasNRole(appTokenUser.getRoles());
|
||||
if (hasNRole) {
|
||||
boolean isGa = cityUserService.isGaUser(appTokenUser.getId());
|
||||
if (isGa) {
|
||||
signOutStr = "gaSignOutStr";
|
||||
signOutEnd = "gaSignOutEnd";
|
||||
} else if (hasNRole) {
|
||||
signOutStr = "nSignOutStr";
|
||||
signOutEnd = "nSignOutEnd";
|
||||
}
|
||||
|
@ -147,4 +147,10 @@ socket:
|
||||
delay-ping-seconds: 3
|
||||
send-client-info-active: false
|
||||
# 上报服务器数据时间
|
||||
send-client-info-second: 30
|
||||
send-client-info-second: 30
|
||||
|
||||
consts-id:
|
||||
# 组织机构
|
||||
department:
|
||||
# 公安
|
||||
ga: 2da5c4db-209b-4c28-bf35-153535fdfc78
|
||||
|
@ -378,7 +378,9 @@
|
||||
t1.community_boss_level,
|
||||
t1.area_id,
|
||||
t1.area_name,
|
||||
t1.grid_summary
|
||||
t1.grid_summary,
|
||||
t4.user_name,
|
||||
t4.user_phone
|
||||
) mt1
|
||||
WHERE
|
||||
1 = 1
|
||||
|
@ -8,13 +8,25 @@
|
||||
<result property="leaveTimeEnd" column="leave_time_end"/>
|
||||
<result property="leaveTimeApm" column="leave_time_apm"/>
|
||||
<result property="leaveType" column="leave_type"/>
|
||||
<result property="leaveTypeName" column="leave_type_name"/>
|
||||
<result property="leaveSummary" column="leave_summary"/>
|
||||
<result property="leaveTimeLong" column="leave_time_long"/>
|
||||
<result property="leaveState" column="leave_state"/>
|
||||
<result property="leaveImg" column="leave_img"/>
|
||||
<result property="leaveUserId" column="creator"/>
|
||||
<result property="leaveUserName" column="leave_user_name"/>
|
||||
<result property="isSelf" column="is_self"/>
|
||||
<result property="outgoingLocation" column="outgoing_location"/>
|
||||
<result property="outgoingLng" column="outgoing_lng"/>
|
||||
<result property="outgoingLat" column="outgoing_lat"/>
|
||||
<result property="approverId" column="approver_id"/>
|
||||
<result property="approverName" column="approver_name"/>
|
||||
<result property="approverState" column="approver_state"/>
|
||||
<result property="approverRefuseSummary" column="approver_refuse_summary"/>
|
||||
<result property="approver2Id" column="approver2_id"/>
|
||||
<result property="approver2Name" column="approver2_name"/>
|
||||
<result property="approver2State" column="approver2_state"/>
|
||||
<result property="approver2RefuseSummary" column="approver2_refuse_summary"/>
|
||||
<result property="leaveRefuseSummary" column="leave_refuse_summary"/>
|
||||
<result property="userPhone" column="user_phone"/>
|
||||
<result property="userAvatar" column="user_avatar"/>
|
||||
@ -40,11 +52,20 @@
|
||||
leave_time_end,
|
||||
leave_time_apm,
|
||||
leave_type,
|
||||
leave_type_name,
|
||||
leave_summary,
|
||||
leave_time_long,
|
||||
leave_state,
|
||||
leave_img,
|
||||
is_self,
|
||||
outgoing_location,
|
||||
outgoing_lng,
|
||||
outgoing_lat,
|
||||
approver_id,
|
||||
approver_name,
|
||||
approver_state,
|
||||
approver_refuse_summary,
|
||||
approver2_state,
|
||||
creator,
|
||||
gmt_create,
|
||||
modifier,
|
||||
@ -56,11 +77,20 @@
|
||||
#{leaveTimeEnd},
|
||||
#{leaveTimeApm},
|
||||
#{leaveType},
|
||||
#{leaveTypeName},
|
||||
#{leaveSummary},
|
||||
#{leaveTimeLong},
|
||||
#{leaveState},
|
||||
#{leaveImg},
|
||||
#{isSelf},
|
||||
#{outgoingLocation},
|
||||
#{outgoingLng},
|
||||
#{outgoingLat},
|
||||
#{approverId},
|
||||
#{approverName},
|
||||
#{approverState},
|
||||
#{approverRefuseSummary},
|
||||
#{approver2State},
|
||||
#{creator},
|
||||
#{gmtCreate},
|
||||
#{modifier},
|
||||
@ -101,6 +131,9 @@
|
||||
<if test="leaveType != null">
|
||||
leave_type = #{leaveType},
|
||||
</if>
|
||||
<if test="leaveTypeName != null">
|
||||
leave_type_name = #{leaveTypeName},
|
||||
</if>
|
||||
<if test="leaveSummary != null and leaveSummary != ''">
|
||||
leave_summary = #{leaveSummary},
|
||||
</if>
|
||||
@ -110,6 +143,9 @@
|
||||
<if test="leaveTimeLong != null">
|
||||
leave_time_long = #{leaveTimeLong},
|
||||
</if>
|
||||
<if test="leaveImg != null">
|
||||
leave_img = #{leaveImg},
|
||||
</if>
|
||||
<if test="leaveState != null">
|
||||
leave_state = #{leaveState},
|
||||
</if>
|
||||
@ -135,6 +171,24 @@
|
||||
</if>
|
||||
<if test="leaveRefuseSummary != null and leaveRefuseSummary != ''">
|
||||
leave_refuse_summary = #{leaveRefuseSummary},
|
||||
</if>
|
||||
<if test="approverState != null">
|
||||
approver_state = #{approverState},
|
||||
</if>
|
||||
<if test="approverRefuseSummary != null and approverRefuseSummary != ''">
|
||||
approver_refuse_summary = #{approverRefuseSummary},
|
||||
</if>
|
||||
<if test="approver2Id != null and approver2Id != ''">
|
||||
approver2_id = #{approver2Id},
|
||||
</if>
|
||||
<if test="approver2Name != null and approver2Name != ''">
|
||||
approver2_name = #{approver2Name},
|
||||
</if>
|
||||
<if test="approver2State != null">
|
||||
approver2_state = #{approver2State},
|
||||
</if>
|
||||
<if test="approver2RefuseSummary != null and approver2RefuseSummary != ''">
|
||||
approver2_refuse_summary = #{approver2RefuseSummary},
|
||||
</if>
|
||||
modifier = #{modifier},
|
||||
gmt_modified = #{gmtModified}
|
||||
@ -154,6 +208,10 @@
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND t2.is_delete = 0
|
||||
<if test="approverState != null">
|
||||
AND
|
||||
t1.approver_state = #{approverState}
|
||||
</if>
|
||||
<if test="approverId != null and approverId != ''">
|
||||
AND t1.approver_id = #{approverId}
|
||||
</if>
|
||||
@ -175,6 +233,10 @@
|
||||
t2.user_username like concat('%', concat(#{keywords}, '%'))
|
||||
)
|
||||
</if>
|
||||
<if test="creator != null and creator != ''">
|
||||
AND
|
||||
t1.creator = #{creator}
|
||||
</if>
|
||||
order by t1.gmt_create desc
|
||||
</select>
|
||||
|
||||
@ -230,13 +292,21 @@
|
||||
SELECT
|
||||
t1.leave_id,
|
||||
t1.leave_type,
|
||||
t1.leave_type_name,
|
||||
t1.leave_time,
|
||||
t1.leave_time_end,
|
||||
t1.leave_time_long,
|
||||
t1.leave_state,
|
||||
t1.leave_img,
|
||||
t1.leave_summary,
|
||||
t1.approver_id,
|
||||
t1.approver_name,
|
||||
t1.approver_state,
|
||||
t1.approver_refuse_summary,
|
||||
t1.approver2_id,
|
||||
t1.approver2_name,
|
||||
t1.approver2_state,
|
||||
t1.approver2_refuse_summary,
|
||||
t1.leave_refuse_summary,
|
||||
LEFT ( t1.gmt_create, 19 ) gmt_create,
|
||||
t1.creator,
|
||||
@ -300,10 +370,12 @@
|
||||
GROUP BY
|
||||
t1.leave_id,
|
||||
t1.leave_type,
|
||||
t1.leave_type_name,
|
||||
t1.leave_time,
|
||||
t1.leave_time_end,
|
||||
t1.leave_time_long,
|
||||
t1.leave_state,
|
||||
t1.leave_img,
|
||||
t1.leave_summary,
|
||||
t1.approver_id,
|
||||
t1.approver_name,
|
||||
|
@ -497,6 +497,46 @@
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
AND (
|
||||
t1.creator IN (
|
||||
SELECT
|
||||
sdu.user_id
|
||||
FROM
|
||||
sys_department_user sdu
|
||||
INNER JOIN
|
||||
sys_user su
|
||||
ON
|
||||
sdu.user_id = su.user_id
|
||||
AND
|
||||
su.is_delete = 0
|
||||
INNER JOIN
|
||||
sys_department sd
|
||||
ON
|
||||
sdu.department_id = sd.department_id
|
||||
WHERE
|
||||
sdu.department_id = #{departmentId}
|
||||
)
|
||||
OR
|
||||
t1.report_case_id IN (
|
||||
SELECT
|
||||
st1.case_id
|
||||
FROM
|
||||
city_report_case_assign st1
|
||||
WHERE
|
||||
st1.is_delete = 0
|
||||
AND
|
||||
st1.handle_user_id IN (
|
||||
SELECT
|
||||
sst1.user_id
|
||||
FROM
|
||||
sys_department_user sst1
|
||||
WHERE
|
||||
sst1.department_id = #{departmentId}
|
||||
)
|
||||
)
|
||||
)
|
||||
</if>
|
||||
ORDER BY t1.gmt_create DESC
|
||||
</select>
|
||||
|
||||
@ -912,7 +952,6 @@
|
||||
INNER JOIN city_report_case_assign t2 ON t1.report_case_id = t2.case_id AND t2.is_delete = 0
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND t1.case_status = 3
|
||||
<if test="handleUserId != null and handleUserId != ''">
|
||||
AND t2.handle_user_id = #{handleUserId}
|
||||
</if>
|
||||
@ -990,6 +1029,47 @@
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
AND (
|
||||
t1.creator IN (
|
||||
SELECT
|
||||
sdu.user_id
|
||||
FROM
|
||||
sys_department_user sdu
|
||||
INNER JOIN
|
||||
sys_user su
|
||||
ON
|
||||
sdu.user_id = su.user_id
|
||||
AND
|
||||
su.is_delete = 0
|
||||
INNER JOIN
|
||||
sys_department sd
|
||||
ON
|
||||
sdu.department_id = sd.department_id
|
||||
WHERE
|
||||
sdu.department_id = #{departmentId}
|
||||
)
|
||||
OR
|
||||
t2.handle_user_id IN (
|
||||
SELECT
|
||||
sdu.user_id
|
||||
FROM
|
||||
sys_department_user sdu
|
||||
INNER JOIN
|
||||
sys_user su
|
||||
ON
|
||||
sdu.user_id = su.user_id
|
||||
AND
|
||||
su.is_delete = 0
|
||||
INNER JOIN
|
||||
sys_department sd
|
||||
ON
|
||||
sdu.department_id = sd.department_id
|
||||
WHERE
|
||||
sdu.department_id = #{departmentId}
|
||||
)
|
||||
)
|
||||
</if>
|
||||
ORDER BY t1.gmt_modified DESC
|
||||
</select>
|
||||
|
||||
@ -1111,7 +1191,6 @@
|
||||
city_report_case_handle t2 ON t1.report_case_id = t2.case_id AND t2.is_delete = 0
|
||||
WHERE
|
||||
t1.is_delete = 0
|
||||
AND t1.case_status = 4
|
||||
<if test="reporterId != null and reportedId != ''">
|
||||
AND t1.creator = #{reporterId}
|
||||
</if>
|
||||
@ -1180,6 +1259,47 @@
|
||||
)
|
||||
)
|
||||
</if>
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
AND (
|
||||
t1.creator IN (
|
||||
SELECT
|
||||
sdu.user_id
|
||||
FROM
|
||||
sys_department_user sdu
|
||||
INNER JOIN
|
||||
sys_user su
|
||||
ON
|
||||
sdu.user_id = su.user_id
|
||||
AND
|
||||
su.is_delete = 0
|
||||
INNER JOIN
|
||||
sys_department sd
|
||||
ON
|
||||
sdu.department_id = sd.department_id
|
||||
WHERE
|
||||
sdu.department_id = #{departmentId}
|
||||
)
|
||||
OR
|
||||
t2.creator IN (
|
||||
SELECT
|
||||
sdu.user_id
|
||||
FROM
|
||||
sys_department_user sdu
|
||||
INNER JOIN
|
||||
sys_user su
|
||||
ON
|
||||
sdu.user_id = su.user_id
|
||||
AND
|
||||
su.is_delete = 0
|
||||
INNER JOIN
|
||||
sys_department sd
|
||||
ON
|
||||
sdu.department_id = sd.department_id
|
||||
WHERE
|
||||
sdu.department_id = #{departmentId}
|
||||
)
|
||||
)
|
||||
</if>
|
||||
ORDER BY
|
||||
t1.gmt_modified DESC
|
||||
</select>
|
||||
|
32
src/main/resources/mybatis/mapper/user/city-user-mapper.xml
Normal file
32
src/main/resources/mybatis/mapper/user/city-user-mapper.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cm.systemcity.dao.user.ICityUserDao">
|
||||
|
||||
<select id="countDepartmentUser" parameterType="map" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
sys_department_user sdu
|
||||
INNER JOIN
|
||||
sys_department sd
|
||||
ON
|
||||
sdu.department_id = sd.department_id
|
||||
INNER JOIN
|
||||
sys_user su
|
||||
ON
|
||||
sdu.user_id = su.user_id
|
||||
WHERE
|
||||
sd.is_delete = 0
|
||||
AND
|
||||
su.is_delete = 0
|
||||
<if test="userId != null and userId != ''">
|
||||
AND
|
||||
sdu.user_id = #{userId}
|
||||
</if>
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
AND
|
||||
sdu.department_id = #{departmentId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
263
src/main/resources/static/route/assessment/list_day_ga.html
Normal file
263
src/main/resources/static/route/assessment/list_day_ga.html
Normal file
@ -0,0 +1,263 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/servicecity/">
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.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">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="姓名" style="height: 38px;width: 150px;" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="showDay" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
<button type="button" id="exportTable" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-share"></i> 导出Excel
|
||||
</button>
|
||||
<button type="button" id="updateDataBtn" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-refresh"></i> 数据有出入?更新数据
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laytpl', 'form','laydate'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var laytpl = layui.laytpl;
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
var tableUrl = 'api/assessment/listpageusersignindaystatus';
|
||||
var dataLoading = false;
|
||||
|
||||
function initData(){
|
||||
$('#areaSelectTemplateBox').show();
|
||||
$('#deptSelectTemplateBox').hide();
|
||||
setTimeout(function(){
|
||||
initTable();
|
||||
},500);
|
||||
}
|
||||
initData();
|
||||
|
||||
$(document).on('click', '#search', function() {
|
||||
if(dataLoading){
|
||||
layer.msg('数据加载中,请稍等...');
|
||||
return;
|
||||
}
|
||||
reloadTable();
|
||||
});
|
||||
|
||||
$(document).on('click', '#exportTable', function() {
|
||||
top.dialog.confirm('确定导出数据?', function(index) {
|
||||
top.dialog.close(index);
|
||||
window.open(getParamsUrl(top.restAjax.path('api/assessment/listusersignindaystatustoexcel', [])), '_blank');
|
||||
});
|
||||
});
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
dataLoading = true;
|
||||
var whereParam = {
|
||||
keywords : $('#keywords').val(),
|
||||
showDay : $('#showDay').val(),
|
||||
userType : 1,
|
||||
departmentId : '2da5c4db-209b-4c28-bf35-153535fdfc78'
|
||||
};
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where : whereParam,
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 95,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [[
|
||||
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'userName', width: 200, title: '人员名称', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{width: 250, title: '部门/社区', align:'left',
|
||||
templet: function(row) {
|
||||
if(row['departmentNames'] != ''){
|
||||
return row['departmentNames'];
|
||||
}
|
||||
if(row['communityNames'] != ''){
|
||||
return row['areaName'] + '(' + row['communityNames'] + ')'
|
||||
}
|
||||
return '';
|
||||
}
|
||||
},
|
||||
{width: 120, title: '签到情况(次)', align:'center',
|
||||
templet: function(row) {
|
||||
return row.signinCount + row.signoutCount;
|
||||
}
|
||||
},
|
||||
{field: 'leaveTimeSum', width: 100, title: '请假天数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'isAbsenteeism', width: 100, title: '是否旷工', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == '1'){
|
||||
return '<span style="color: red">是</span>'
|
||||
}
|
||||
if(rowData == '0'){
|
||||
return '否'
|
||||
}
|
||||
return '-'
|
||||
}
|
||||
},
|
||||
{field: 'outOfContactOneHourCount', width: 180, title: '失联超1小时情况(次)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'contactHour', width: 130, title: '工作时长(小时)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'workDistance', width: 120, title: '工作里程(KM)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'deductionPercent', width: 150, title: '绩效扣除比例(%)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
},
|
||||
done: function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
dataLoading = true;
|
||||
var whereParam = {
|
||||
keywords : $('#keywords').val(),
|
||||
showDay : $('#showDay').val(),
|
||||
userType : 1,
|
||||
departmentId : '2da5c4db-209b-4c28-bf35-153535fdfc78'
|
||||
};
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where : whereParam,
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 140,
|
||||
done:function(res){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化时间
|
||||
function initDateTime(){
|
||||
laydate.render({
|
||||
format : 'yyyy-MM-dd',
|
||||
elem: '#showDay'
|
||||
,value: new Date()
|
||||
});
|
||||
}
|
||||
initDateTime();
|
||||
|
||||
$(document).on('click', '#updateDataBtn', function() {
|
||||
if($('#showDay').val() == ''){
|
||||
return;
|
||||
}
|
||||
top.dialog.confirm('确定更新吗?', function(index) {
|
||||
top.dialog.close(index);
|
||||
var loadLayerIndex;
|
||||
top.restAjax.put('api/assessment/updateassessment?startDay='+ $('#showDay').val() +'&endDay='+ $('#showDay').val(), {}, null, function(code, data) {
|
||||
top.dialog.msg('更新成功');
|
||||
reloadTable();
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
loadLayerIndex = layer.load(2,{shade:0.3});
|
||||
}, function() {
|
||||
layer.close(loadLayerIndex)
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
258
src/main/resources/static/route/assessment/list_history_ga.html
Normal file
258
src/main/resources/static/route/assessment/list_history_ga.html
Normal file
@ -0,0 +1,258 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/servicecity/">
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.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">
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
<!--<button type="button" id="exportTable" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-share"></i> 导出Excel
|
||||
</button>-->
|
||||
</div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laytpl', 'form','laydate'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var laytpl = layui.laytpl;
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
var tableUrl = 'api/assessment/list-user-sign-history';
|
||||
var dataLoading = false;
|
||||
// 默认为0 1专管员2网格员
|
||||
var userType = '1';
|
||||
|
||||
function init(){
|
||||
laydate.render({
|
||||
elem: '#startTime'
|
||||
,value: getMonthStartDay(new Date())
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime'
|
||||
,value: new Date()
|
||||
});
|
||||
$('#communitySelectTemplateBox').hide();
|
||||
initTable();
|
||||
}
|
||||
init();
|
||||
|
||||
form.on('select(changeArea)',function(data){
|
||||
if(data.value == ''){
|
||||
userType = '0';
|
||||
$('#communityId').val('');
|
||||
$('#communitySelectTemplateBox').hide();
|
||||
$('#deptSelectTemplateBox').show();
|
||||
} else {
|
||||
userType = '2';
|
||||
$('#departmentId').val('');
|
||||
$('#deptSelectTemplateBox').hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
dataLoading = true;
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 95,
|
||||
toolbar: true,
|
||||
defaultToolbar: ['exports'],
|
||||
where:{
|
||||
userType : userType,
|
||||
departmentId : '2da5c4db-209b-4c28-bf35-153535fdfc78'
|
||||
},
|
||||
cols: [[
|
||||
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'userName', width: 250, title: '姓名', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData + ' [' + row['userAccount'] + ']';
|
||||
}
|
||||
},
|
||||
{field: 'location', width: 200, title: '街道社区/职能部门', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'signInCount', width: 120, title: '签到次数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'signOutCount', width: 120, title: '签退次数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'leaveCount', width: 100, title: '请假次数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},/*
|
||||
{field: 'absenteeismCount', width: 100, title: '旷工次数', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},*/
|
||||
{field: 'outOfContactOneHourCount', width: 180, title: '失联超1小时情况(次)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'contactHour', width: 130, title: '工作时长(小时)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'workDistance', width: 120, title: '工作里程(KM)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'deductionPercent', width: 150, title: '绩效扣除比例(%)', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData === '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
]],
|
||||
page: false,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
},
|
||||
done: function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
dataLoading = true;
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where:{
|
||||
userType : userType,
|
||||
departmentId : '2da5c4db-209b-4c28-bf35-153535fdfc78',
|
||||
startTime : $('#startTime').val(),
|
||||
endTime : $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 140,
|
||||
done:function(res){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取本月第一天日期
|
||||
function getMonthStartDay(date) {
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
month = month >= 10 ? month : ('0'+ month);
|
||||
return year +'-'+ month +'-01';
|
||||
}
|
||||
|
||||
$(document).on('click', '#search', function() {
|
||||
if(dataLoading){
|
||||
layer.msg('数据加载中,请稍等...');
|
||||
return;
|
||||
}
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
$(document).on('click', '#exportTable', function() {
|
||||
/*top.dialog.confirm('确定导出数据?', function(index) {
|
||||
top.dialog.close(index);
|
||||
window.open(getParamsUrl(top.restAjax.path('api/assessment/listusersigninhistorystatustoexcel', [])), '_blank');
|
||||
});*/
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -21,7 +21,7 @@
|
||||
<body>
|
||||
<div id="content" class="layui-fluid layui-animlayui-anim layui-anim-fadein">
|
||||
<form class="layui-form layui-form-pane" lay-filter="dataForm">
|
||||
<div class="layui-row layui-col-space1">
|
||||
<div class="layui-row layui-col-space10">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">【网格员】打卡设置</div>
|
||||
@ -114,7 +114,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row layui-col-space1">
|
||||
<div class="layui-row layui-col-space10">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">【专管员】打卡设置</div>
|
||||
@ -197,6 +197,52 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="layui-row layui-col-space10">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">【公安局】打卡设置</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label strong-text">签到开始</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="gaSignInStr" placeholder="点击选择时间" style="cursor: pointer;"
|
||||
lay-verify readonly="readonly" autocomplete="off" class="layui-input date-hour">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label strong-text">签到截止</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="gaSignInEnd" placeholder="点击选择时间" style="cursor: pointer;"
|
||||
lay-verify readonly="readonly" autocomplete="off" class="layui-input date-hour">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label strong-text">签退开始</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="gaSignOutStr" placeholder="点击选择时间" style="cursor: pointer;"
|
||||
lay-verify readonly="readonly" autocomplete="off" class="layui-input date-hour">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md6">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label strong-text">签退截止</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="gaSignOutEnd" placeholder="点击选择时间" style="cursor: pointer;"
|
||||
lay-verify readonly="readonly" autocomplete="off" class="layui-input date-hour">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-row">
|
||||
|
@ -28,7 +28,7 @@
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="请假人姓名|手机号" style="height: 38px;width: 150px;" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline" style="width: 150px;">
|
||||
<select id="leaveState" name="leaveState">
|
||||
<select id="approverState" name="approverState">
|
||||
<option value="">审批状态</option>
|
||||
<option value="0">待审批</option>
|
||||
<option value="1">同意</option>
|
||||
@ -130,16 +130,25 @@
|
||||
return rowData + '【' + row['userPhone'] + '】';
|
||||
}
|
||||
},
|
||||
{field: 'leaveType', width: 100, title: '请假缘由', align:'center',fixed: 'left',
|
||||
{field: 'isSelf', width: 100, title: '公私假', align:'center',fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == 'ill'){
|
||||
return '病假'
|
||||
if(rowData === 0) {
|
||||
return '公假';
|
||||
}
|
||||
if(rowData == 'busy'){
|
||||
return '事假'
|
||||
if(rowData === 1) {
|
||||
return '私假';
|
||||
}
|
||||
return '-';
|
||||
return '错误'
|
||||
}
|
||||
},
|
||||
{field: 'leaveTypeName', width: 100, title: '请假缘由', align:'center',fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'leaveTime', width: 180, title: '请假时间', align:'center',
|
||||
@ -169,7 +178,7 @@
|
||||
return rowData + '天';
|
||||
}
|
||||
},
|
||||
{field: 'leaveSummary', width: 200, title: '详细请假原因', align:'left',
|
||||
{field: 'leaveSummary', width: 200, title: '详细请假原因', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
@ -178,13 +187,22 @@
|
||||
return '<span style="color: #1E9FFF">' + rowData + '</span>';
|
||||
}
|
||||
},
|
||||
{field: 'approverName', width: 100, title: '审批人', align:'center',
|
||||
{field: 'outgoingLocation', width: 200, title: '外出地点', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
return `<a href="javascript:void(0);" lay-event="showOutgoingEvent">${rowData}</a>`;
|
||||
}
|
||||
},
|
||||
{field: 'leaveImg', width: 100, title: '请假条', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event="leaveImgEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'leaveState', width: 100, title: '当前状态', align:'center',
|
||||
@ -211,8 +229,77 @@
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{width: 140, title: '操作按钮', align:'center',
|
||||
{field: 'approverName', width: 100, title: '1级审批人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'approverState', width: 120, title: '1级审批状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == '0'){
|
||||
return '<span style="color: #aa7700">待审批</span>'
|
||||
}
|
||||
if(rowData == '1') {
|
||||
return '<span style="color: #00a0e9">同意</span>'
|
||||
}
|
||||
if(rowData == '2') {
|
||||
return '<span style="color: red">不同意</span>'
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{field: 'approverRefuseSummary', width: 120, title: '1级审批意见', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'approver2State', width: 120, title: '2级审批状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == '0'){
|
||||
return '<span style="color: #aa7700">待审批</span>'
|
||||
}
|
||||
if(rowData == '1') {
|
||||
return '<span style="color: #00a0e9">同意</span>'
|
||||
}
|
||||
if(rowData == '2') {
|
||||
return '<span style="color: red">不同意</span>'
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{field: 'approver2RefuseSummary', width: 120, title: '2级审批意见', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'approver2Name', width: 120, title: '2级审批人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{width: 140, title: '操作按钮', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
if(row.approverState === 1 || row.approverState === 2) {
|
||||
return '-';
|
||||
}
|
||||
var dom = '';
|
||||
dom += '<div class="layui-btn-group">';
|
||||
dom += '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="passEvent">' +
|
||||
@ -247,7 +334,7 @@
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where :{
|
||||
keywords : $('#keywords').val(),
|
||||
leaveState : $('#leaveState').val(),
|
||||
approverState : $('#approverState').val(),
|
||||
startTime : $('#startTime').val(),
|
||||
endTime : $('#endTime').val()
|
||||
},
|
||||
@ -277,7 +364,7 @@
|
||||
yes : function(){
|
||||
var loadIndex = layer.load(1);
|
||||
top.restAjax.put(top.restAjax.path('api/leave/updateleaveofapproval/{arg}', [obj.data.leaveId]),
|
||||
{leaveRefuseSummary : $('#leaveRefuseSummary').val(), leaveState : '1'}, null, function(code, data) {
|
||||
{approverRefuseSummary : $('#leaveRefuseSummary').val(), approverState : '1'}, null, function(code, data) {
|
||||
layer.close(passPopIndex);
|
||||
layer.close(loadIndex);
|
||||
top.dialog.msg('审批完成');
|
||||
@ -311,7 +398,7 @@
|
||||
yes : function(){
|
||||
var loadIndex = layer.load(1);
|
||||
top.restAjax.put(top.restAjax.path('api/leave/updateleaveofapproval/{arg}', [obj.data.leaveId]),
|
||||
{leaveRefuseSummary : $('#leaveRefuseSummary').val(), leaveState : '2'}, null,
|
||||
{approverRefuseSummary : $('#leaveRefuseSummary').val(), approverState : '2'}, null,
|
||||
function(code, data) {
|
||||
layer.close(passPopIndex);
|
||||
layer.close(loadIndex);
|
||||
@ -330,6 +417,32 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'leaveImgEvent') {
|
||||
let data = obj.data;
|
||||
let fileIds = data.leaveImg.split(',');
|
||||
let files = [];
|
||||
$.each(fileIds, function(index, item) {
|
||||
files.push({
|
||||
alt: index,
|
||||
pid: item,
|
||||
src: `route/file/downloadfile/true/${item}`,
|
||||
thumb: `route/file/downloadfile/true/${item}`
|
||||
})
|
||||
})
|
||||
layer.photos({
|
||||
photos: {
|
||||
title: `${data.leaveUserName}的请假条`,
|
||||
id: data.leaveId,
|
||||
start: 0,
|
||||
data: files
|
||||
},
|
||||
anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机
|
||||
});
|
||||
}
|
||||
if(obj.event === 'showOutgoingEvent') {
|
||||
let data = obj.data;
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#search', function() {
|
||||
|
445
src/main/resources/static/route/leave/list2.html
Normal file
445
src/main/resources/static/route/leave/list2.html
Normal file
@ -0,0 +1,445 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<base href="/servicecity/">
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.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">
|
||||
<style>
|
||||
.un-pass-class .layui-layer-btn .layui-layer-btn0{
|
||||
background-color: #FF5722;
|
||||
color: #ffffff;
|
||||
border: 1px solid #dedede;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="keywords" class="layui-input search-item" placeholder="请假人姓名|手机号" style="height: 38px;width: 150px;" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline" style="width: 150px;">
|
||||
<select id="approver2State" name="approver2State">
|
||||
<option value="">审批状态</option>
|
||||
<option value="0">待审批</option>
|
||||
<option value="1">同意</option>
|
||||
<option value="2">不同意</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="开始时间" style="height: 38px;width: 120px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="截止时间" style="height: 38px;width: 120px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<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 id="pass-div-box" type="text/html">
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12 layui-col-sm12">
|
||||
<div class="layui-form">
|
||||
<div class="">
|
||||
<textarea id="leaveRefuseSummary" name="leaveRefuseSummary" autocomplete="off" maxlength="255"
|
||||
placeholder="请填写审批意见" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laytpl', 'form','laydate'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var laytpl = layui.laytpl;
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
var tableUrl = 'api/leave/list-page-leave-detail2';
|
||||
var dataLoading = false;
|
||||
|
||||
function init() {
|
||||
laydate.render({
|
||||
elem: '#startTime'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime'
|
||||
});
|
||||
initTable();
|
||||
}
|
||||
init();
|
||||
|
||||
function initTable() {
|
||||
dataLoading = true;
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 100,
|
||||
limit: 20,
|
||||
limits: [20, 40, 60, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [[
|
||||
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{field: 'userAvatar', width: 60, title: '头像', align:'center',fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '<img style="width: 30px;height: 30px;" src="assets/images/profile-photo.jpg"/>';
|
||||
} else {
|
||||
return '<img style="width: 30px;height: 30px;" src="route/file/downloadfile/false/'+ rowData +'"/>';
|
||||
}
|
||||
}
|
||||
},
|
||||
{field: 'leaveUserName', width: 200, title: '请假人', align:'center',fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData + '【' + row['userPhone'] + '】';
|
||||
}
|
||||
},
|
||||
{field: 'isSelf', width: 100, title: '公私假', align:'center',fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData === 0) {
|
||||
return '公假';
|
||||
}
|
||||
if(rowData === 1) {
|
||||
return '私假';
|
||||
}
|
||||
return '错误'
|
||||
}
|
||||
},
|
||||
{field: 'leaveTypeName', width: 100, title: '请假缘由', align:'center',fixed: 'left',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'leaveTime', width: 180, title: '请假时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'leaveTimeEnd', width: 180, title: '结束时间', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'leaveTimeLong', width: 100, title: '请假时长', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData + '天';
|
||||
}
|
||||
},
|
||||
{field: 'leaveSummary', width: 200, title: '详细请假原因', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return '<span style="color: #1E9FFF">' + rowData + '</span>';
|
||||
}
|
||||
},
|
||||
{field: 'leaveImg', width: 100, title: '请假条', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return '<button type="button" class="layui-btn layui-btn-xs layui-btn-normal" lay-event="leaveImgEvent">查看</button>';
|
||||
}
|
||||
},
|
||||
{field: 'leaveState', width: 100, title: '当前状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == '0'){
|
||||
return '<span style="color: #aa7700">待审批</span>'
|
||||
}
|
||||
if(rowData == '1'){
|
||||
return '<span style="color: #00a0e9">同意</span>'
|
||||
}
|
||||
if(rowData == '2'){
|
||||
return '<span style="color: red">不同意</span>'
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{field: 'leaveRefuseSummary', width: 120, title: '审批意见', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'approverName', width: 100, title: '1级审批人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'approverState', width: 120, title: '1级审批状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == '0'){
|
||||
return '<span style="color: #aa7700">待审批</span>'
|
||||
}
|
||||
if(rowData == '1') {
|
||||
return '<span style="color: #00a0e9">同意</span>'
|
||||
}
|
||||
if(rowData == '2') {
|
||||
return '<span style="color: red">不同意</span>'
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{field: 'approverRefuseSummary', width: 120, title: '1级审批意见', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'approver2State', width: 120, title: '2级审批状态', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(rowData == '0'){
|
||||
return '<span style="color: #aa7700">待审批</span>'
|
||||
}
|
||||
if(rowData == '1') {
|
||||
return '<span style="color: #00a0e9">同意</span>'
|
||||
}
|
||||
if(rowData == '2') {
|
||||
return '<span style="color: red">不同意</span>'
|
||||
}
|
||||
return '-';
|
||||
}
|
||||
},
|
||||
{field: 'approver2RefuseSummary', width: 120, title: '2级审批意见', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{field: 'approver2Name', width: 120, title: '2级审批人', align:'center',
|
||||
templet: function(row) {
|
||||
var rowData = row[this.field];
|
||||
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||
return '-';
|
||||
}
|
||||
return rowData;
|
||||
}
|
||||
},
|
||||
{width: 140, title: '操作按钮', align:'center', fixed: 'right',
|
||||
templet: function(row) {
|
||||
if(row.approver2State === 1 || row.approver2State === 2) {
|
||||
return '-';
|
||||
}
|
||||
var dom = '';
|
||||
dom += '<div class="layui-btn-group">';
|
||||
dom += '<button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="passEvent">' +
|
||||
'<i class="fa fa-legal"></i>同意</button>';
|
||||
dom += '<button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="unPassEvent">' +
|
||||
'<i class="fa fa-exclamation-triangle"></i>不同意</button>';
|
||||
dom += '</div>';
|
||||
return dom;
|
||||
}
|
||||
},
|
||||
|
||||
]],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
},
|
||||
done: function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
dataLoading = true;
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(tableUrl, []),
|
||||
where :{
|
||||
keywords : $('#keywords').val(),
|
||||
approver2State : $('#approver2State').val(),
|
||||
startTime : $('#startTime').val(),
|
||||
endTime : $('#endTime').val()
|
||||
},
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 100,
|
||||
done:function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
if (obj.event === 'passEvent') {
|
||||
var passPopIndex = layer.open({
|
||||
type: 1,
|
||||
title: '<span style="color: #cc0000">*</span>请假审批(同意)',
|
||||
closeBtn: 1,
|
||||
offset: '150px',
|
||||
area: ['40%', '30%'],
|
||||
shadeClose: false,
|
||||
anim: 2,
|
||||
content: $('#pass-div-box').html(),
|
||||
btn: ['确定', '取消'],
|
||||
btnAlign : 'c',
|
||||
yes : function(){
|
||||
var loadIndex = layer.load(1);
|
||||
top.restAjax.put(top.restAjax.path('api/leave/updateleaveofapproval2/{arg}', [obj.data.leaveId]),
|
||||
{approver2RefuseSummary : $('#leaveRefuseSummary').val(), approver2State : '1'}, null, function(code, data) {
|
||||
layer.close(passPopIndex);
|
||||
layer.close(loadIndex);
|
||||
top.dialog.msg('审批完成');
|
||||
reloadTable();
|
||||
}, function(){
|
||||
layer.close(loadIndex);
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
btn2 : function(){
|
||||
layer.close(passPopIndex);
|
||||
},
|
||||
success : function(){
|
||||
$('#leaveRefuseSummary').val('同意');
|
||||
}
|
||||
});
|
||||
}
|
||||
if (obj.event === 'unPassEvent') {
|
||||
var passPopIndex = layer.open({
|
||||
type: 1,
|
||||
title: '<span style="color: #cc0000">*</span>请假审批(不同意)',
|
||||
skin: 'un-pass-class',
|
||||
offset: '150px',
|
||||
closeBtn: 1,
|
||||
area: ['40%', '30%'],
|
||||
shadeClose: false,
|
||||
anim: 2,
|
||||
content: $('#pass-div-box').html(),
|
||||
btn: ['确定', '取消'],
|
||||
btnAlign : 'c',
|
||||
yes : function(){
|
||||
var loadIndex = layer.load(1);
|
||||
top.restAjax.put(top.restAjax.path('api/leave/updateleaveofapproval2/{arg}', [obj.data.leaveId]),
|
||||
{approver2RefuseSummary : $('#leaveRefuseSummary').val(), approver2State : '2'}, null,
|
||||
function(code, data) {
|
||||
layer.close(passPopIndex);
|
||||
layer.close(loadIndex);
|
||||
top.dialog.msg('审批完成');
|
||||
reloadTable();
|
||||
}, function(){
|
||||
layer.close(loadIndex);
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
btn2 : function(){
|
||||
layer.close(passPopIndex);
|
||||
},
|
||||
success : function(){
|
||||
$('#leaveRefuseSummary').val('不同意');
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'leaveImgEvent') {
|
||||
let data = obj.data;
|
||||
let fileIds = data.leaveImg.split(',');
|
||||
let files = [];
|
||||
$.each(fileIds, function(index, item) {
|
||||
files.push({
|
||||
alt: index,
|
||||
pid: item,
|
||||
src: `route/file/downloadfile/true/${item}`,
|
||||
thumb: `route/file/downloadfile/true/${item}`
|
||||
})
|
||||
})
|
||||
layer.photos({
|
||||
photos: {
|
||||
title: `${data.leaveUserName}的请假条`,
|
||||
id: data.leaveId,
|
||||
start: 0,
|
||||
data: files
|
||||
},
|
||||
anim: 5 //0-6的选择,指定弹出图片动画类型,默认随机
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#search', function() {
|
||||
if(dataLoading){
|
||||
layer.msg('数据加载中,请稍等...');
|
||||
return;
|
||||
}
|
||||
reloadTable(1);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,477 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<base href="/servicecity/">
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
|
||||
<!-- 图片 -->
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/swiper3/css/swiper.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<!-- 图片 -->
|
||||
<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">
|
||||
<style>
|
||||
.layui-table-cell{
|
||||
height: auto;
|
||||
}
|
||||
.layui-table-body td{
|
||||
height: 210px;
|
||||
}
|
||||
.layui-table img{
|
||||
max-width: 100%;
|
||||
}
|
||||
.info-row {border-bottom: 1px dotted;}
|
||||
.info-row:last-child {border: none;}
|
||||
.info-row .col-left {width:30%;height:28px;text-align:center;border-right:1px dotted;display:inline-block;padding:5px;vertical-align:top;}
|
||||
.info-row .col-right {width:70%;display:inline-block;padding:5px;vertical-align:top;}
|
||||
.info-row .col-line {width:100%;color:black;text-align:center;display:block;padding:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||
.info-row .col-line .fa {color: red; margin-right: 5px;}
|
||||
.info-row .col-content {width:100%;display:inline-block;padding:5px;height:86px;overflow:auto;white-space:normal;word-break:break-all;word-wrap:break-word;vertical-align:top;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="caseNumber" class="layui-input search-item" placeholder="案件编号" style="height: 38px;width:150px;" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 150px;"></div>
|
||||
<script id="caseTypeSelectTemplate" type="text/html">
|
||||
<select id="caseTypeId" name="caseTypeId" lay-filter="changeCaseType">
|
||||
<option value="">案件类型</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dictId}}">{{item.dictName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<div class="layui-inline" id="childCaseTypeSelectTemplateBox" style="width: 150px;"></div>
|
||||
<script id="childCaseTypeSelectTemplate" type="text/html">
|
||||
<select id="childCaseTypeId" name="childCaseTypeId">
|
||||
<option value="">案件子类型</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dictId}}">{{item.dictName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
<!--<button type="button" id="deleteTableData" class="layui-btn layui-btn-danger layui-btn-sm">
|
||||
<i class="fa fa-lg fa-trash"></i> 批量删除
|
||||
</button>-->
|
||||
</div>
|
||||
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<!-- 图片 -->
|
||||
<script type="text/javascript" src="assets/js/vendor/swiper3/js/swiper.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<!-- 图片 -->
|
||||
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laytpl', 'form','laydate'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var laytpl = layui.laytpl;
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
// var departmentId = top.restAjax.params(window.location.href).departmentId;
|
||||
var departmentId = '2da5c4db-209b-4c28-bf35-153535fdfc78';
|
||||
var tableUrl = 'api/reportcase/listpagereportcasehandle';
|
||||
var dataLoading = false;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
dataLoading = true;
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(getParamsUrl(tableUrl), []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 100,
|
||||
limit: 10,
|
||||
limits: [10, 20, 40, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [[
|
||||
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{width: 300, title: '案件图片', align:'center',
|
||||
templet: function(row) {
|
||||
var photos = row.casePhotos.split(',')
|
||||
var value = '<div id="photo_'+ row.reportCaseId +'" class="swiper-container" style="width:100%;">' +
|
||||
'<div class="swiper-wrapper" style="width:100%">';
|
||||
for(var i = 0, item = photos[i]; item = photos[i++];) {
|
||||
value += '<div class="swiper-slide" style="width:100%;">' +
|
||||
'<img class="swiper-lazy" src="route/file/downloadfile/true/'+ item +'" style="width:270px;height:180px;cursor:pointer;"/>' +
|
||||
'<div class="swiper-lazy-preloader"></div>' +
|
||||
'</div>';
|
||||
}
|
||||
value += '</div><div id="photo_swiper_'+ row.reportCaseId +'" class="swiper-pagination"></div></div>';
|
||||
setTimeout(function() {
|
||||
new Swiper('#photo_'+ row.reportCaseId, {
|
||||
lazyLoading: true,
|
||||
autoplay: 3000,
|
||||
pagination : '#photo_swiper_'+ row.reportCaseId,
|
||||
paginationClickable :true,
|
||||
});
|
||||
new Viewer(document.getElementById('photo_'+ row.reportCaseId));
|
||||
}, 50);
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 350, title: '案件信息', align: 'center',
|
||||
templet: function (row) {
|
||||
var caseFlowType = row.caseFlowType;
|
||||
if(caseFlowType == '1'){
|
||||
caseFlowType = '(职能部门案件)';
|
||||
} else {
|
||||
caseFlowType = '(街镇案件)'
|
||||
}
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">案件编号</span><span class="col-right">'+ row.caseNumber +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">所在地区</span><span class="col-right">'+ row.areaName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">所在社区</span><span class="col-right">'+ row.communityName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">案件类型</span><span class="col-right">'+ caseFlowType + row.caseTypeName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">操作</span>' +
|
||||
'<span class="col-right">'+
|
||||
'<div class="btn-group btn-group-xs">' +
|
||||
'<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="showEvent">详情</button>'+
|
||||
'<button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="caseFlowEvent">流程</button>'+
|
||||
'</div>'+
|
||||
'</span>'+
|
||||
'</div>'+
|
||||
'</div>'
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 300, title: '案件内容', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">案件来源</span><span class="col-right">'+ sourceFormatter(row.caseSource) +'</span></div>'+
|
||||
'<div class="info-row"><a href="javascript:;" class="col-line" lay-event="showLocation"><i class="fa fa-map-marker"></i>'+ row.casePosition +'</a></div>'+
|
||||
'<div class="info-row"><span class="col-content">'+ row.caseContent +'</span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 250, title: '案件状态', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">上报时间</span><span class="col-right">'+ row.reportDate +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">上报人员</span><span class="col-right">'+ row.caseReporter +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">案件状态</span><span class="col-right">'+ caseStatusFormatter(row.caseStatus) +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right" style="color: red;">'+ ((row.overDays != null && row.overDays >= 1) ? '【超过'+ row.overDays +'天未处理】' : '') +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 250, title: '下派信息', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">下派时间</span><span class="col-right">'+ row.assignDate +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">处理人员</span><span class="col-right">'+ row.handleUserName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">处理时限</span><span class="col-right">'+ row.handleTime +'天</span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
}
|
||||
]],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
},
|
||||
done: function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
setTimeout(function(){
|
||||
initTable();
|
||||
},500);
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
dataLoading = true;
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(getParamsUrl(tableUrl), []),
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 100,
|
||||
done:function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化案件类型
|
||||
function initCaseType(){
|
||||
top.restAjax.get('api/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852', {}, null, function(code, data) {
|
||||
laytpl(document.getElementById('caseTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('caseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initCaseType();
|
||||
|
||||
//初始化子案件类型
|
||||
function initChildCaseType(parentId){
|
||||
if(typeof(parentId) === 'undefined' || '' == parentId){
|
||||
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render([], function(html) {
|
||||
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
top.restAjax.get('api/dict/listdict/' + parentId, {}, null, function(code, data) {
|
||||
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initChildCaseType();
|
||||
|
||||
//初始化时间
|
||||
function initDateTime(){
|
||||
laydate.render({
|
||||
elem: '#startTime'
|
||||
,value: ''
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime'
|
||||
,value: ''
|
||||
});
|
||||
}
|
||||
initDateTime();
|
||||
|
||||
function getParamsUrl(url) {
|
||||
var caseTypeId = $('#caseTypeId').val();
|
||||
var childCaseTypeId = $('#childCaseTypeId').val();
|
||||
var startTime = $('#startTime').val();
|
||||
var endTime = $('#endTime').val();
|
||||
var params = '?t='+ new Date().getTime();
|
||||
if('' != departmentId && 'undefined' != typeof(departmentId)) {
|
||||
params += '&departmentId='+ departmentId;
|
||||
}
|
||||
if('' != caseTypeId && '' != childCaseTypeId) {
|
||||
params += '&caseTypeId='+ childCaseTypeId;
|
||||
} else {
|
||||
params += '&caseTypeId='+ caseTypeId;
|
||||
}
|
||||
if('' != startTime) {
|
||||
params += '&startTime='+ startTime;
|
||||
}
|
||||
if('' != endTime) {
|
||||
params += '&endTime='+ endTime;
|
||||
}
|
||||
if('' != $('#caseNumber').val()) {
|
||||
params += '&caseNumber='+ $('#caseNumber').val();
|
||||
}
|
||||
// 职能部门案件
|
||||
params += '&caseFlowType=1';
|
||||
return url + params;
|
||||
}
|
||||
|
||||
// 来源格式化
|
||||
function sourceFormatter(val) {
|
||||
var value;
|
||||
switch (val) {
|
||||
case '1':
|
||||
value = '群众举报';
|
||||
break;
|
||||
case '2':
|
||||
value = '巡检采集';
|
||||
break;
|
||||
case '3':
|
||||
value = '专管员上报';
|
||||
break;
|
||||
default:
|
||||
value = '未知';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// 案件状态
|
||||
function caseStatusFormatter(val) {
|
||||
var value;
|
||||
switch (val) {
|
||||
case '0':
|
||||
value = '待受理';
|
||||
break;
|
||||
case '1':
|
||||
value = '待立案';
|
||||
break;
|
||||
case '2':
|
||||
value = '待下派';
|
||||
break;
|
||||
case '3':
|
||||
value = '待处理';
|
||||
break;
|
||||
case '4':
|
||||
value = '待检查';
|
||||
break;
|
||||
case '5':
|
||||
value = '待结案';
|
||||
break;
|
||||
case '6':
|
||||
value = '已归档';
|
||||
break;
|
||||
default:
|
||||
value = '异常';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// 删除
|
||||
function remove(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/reportcase/removereportcase/{ids}', [ids]), {}, null, function (code, data) {
|
||||
// success
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}, function () {
|
||||
reloadTable();
|
||||
});
|
||||
}, function (code, data) {
|
||||
// error
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
// before
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
// complete
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
if(obj.event === 'showEvent'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '详情',
|
||||
closeBtn: 1,
|
||||
area: ['70%', '80%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/show.html?reportCaseId={id}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'caseFlowEvent'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '案件流程',
|
||||
closeBtn: 1,
|
||||
area: ['50%', '60%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/list_case_log.html?reportCaseId={id}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'showLocation'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '案件位置预览',
|
||||
closeBtn: 1,
|
||||
area: ['50%', '60%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/map-case-mark.html?reportCaseId={reportCaseId}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'deleteEvent'){
|
||||
remove(obj.data.reportCaseId);
|
||||
}
|
||||
});
|
||||
|
||||
form.on('select(changeCaseType)',function(data){
|
||||
if(data.value == ''){
|
||||
$('#childCaseTypeId').val('');
|
||||
initChildCaseType();
|
||||
} else {
|
||||
initChildCaseType(data.value);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#search', function() {
|
||||
if(dataLoading){
|
||||
layer.msg('数据加载中,请稍等...');
|
||||
return;
|
||||
}
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
$(document).on('click', '#deleteTableData', function() {
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
if(checkStatus.data.length == 0){
|
||||
layer.msg('请先勾选要删除的数据')
|
||||
return;
|
||||
}
|
||||
var ids = '';
|
||||
for (var i = 0, item;item = checkStatus.data[i++];){
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item.reportCaseId;
|
||||
}
|
||||
remove(ids);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,466 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<base href="/servicecity/">
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
|
||||
<!-- 图片 -->
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/swiper3/css/swiper.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<!-- 图片 -->
|
||||
<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">
|
||||
<style>
|
||||
.layui-table-cell{
|
||||
height: auto;
|
||||
}
|
||||
.layui-table-body td{
|
||||
height: 210px;
|
||||
}
|
||||
.layui-table img{
|
||||
max-width: 100%;
|
||||
}
|
||||
.info-row {border-bottom: 1px dotted;}
|
||||
.info-row:last-child {border: none;}
|
||||
.info-row .col-left {width:30%;height:28px;text-align:center;border-right:1px dotted;display:inline-block;padding:5px;vertical-align:top;}
|
||||
.info-row .col-right {width:70%;display:inline-block;padding:5px;vertical-align:top;}
|
||||
.info-row .col-line {width:100%;color:black;text-align:center;display:block;padding:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||
.info-row .col-line .fa {color: red; margin-right: 5px;}
|
||||
.info-row .col-content {width:100%;display:inline-block;padding:5px;height:86px;overflow:auto;white-space:normal;word-break:break-all;word-wrap:break-word;vertical-align:top;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
|
||||
<div class="layui-inline" style="width: 150px;">
|
||||
<input type="hidden" id="areaId" name="areaId" value="">
|
||||
<input type="text" class="layui-input" id="areaName" name="areaName" value="" readonly="readonly">
|
||||
</div>
|
||||
<div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 150px;"></div>
|
||||
<script id="caseTypeSelectTemplate" type="text/html">
|
||||
<select id="caseTypeId" name="caseTypeId" lay-filter="changeCaseType">
|
||||
<option value="">案件类型</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dictId}}">{{item.dictName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<div class="layui-inline" id="childCaseTypeSelectTemplateBox" style="width: 150px;"></div>
|
||||
<script id="childCaseTypeSelectTemplate" type="text/html">
|
||||
<select id="childCaseTypeId" name="childCaseTypeId">
|
||||
<option value="">案件子类型</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dictId}}">{{item.dictName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
<!--<button type="button" id="deleteTableData" class="layui-btn layui-btn-danger layui-btn-sm">
|
||||
<i class="fa fa-lg fa-trash"></i> 批量删除
|
||||
</button>-->
|
||||
</div>
|
||||
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<!-- 图片 -->
|
||||
<script type="text/javascript" src="assets/js/vendor/swiper3/js/swiper.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<!-- 图片 -->
|
||||
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laytpl', 'form','laydate'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var laytpl = layui.laytpl;
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
var departmentId = '2da5c4db-209b-4c28-bf35-153535fdfc78';
|
||||
var tableUrl = 'api/reportcase/listpagereportcaseinspect';
|
||||
var dataLoading = false;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
dataLoading = true;
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(getParamsUrl(tableUrl), []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 100,
|
||||
limit: 10,
|
||||
limits: [10, 20, 40, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [[
|
||||
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{width: 300, title: '案件图片', align:'center',
|
||||
templet: function(row) {
|
||||
var photos = row.casePhotos.split(',')
|
||||
var value = '<div id="photo_'+ row.reportCaseId +'" class="swiper-container" style="width:100%;">' +
|
||||
'<div class="swiper-wrapper" style="width:100%">';
|
||||
for(var i = 0, item = photos[i]; item = photos[i++];) {
|
||||
value += '<div class="swiper-slide" style="width:100%;">' +
|
||||
'<img class="swiper-lazy" src="route/file/downloadfile/true/'+ item +'" style="width:270px;height:180px;cursor:pointer;"/>' +
|
||||
'<div class="swiper-lazy-preloader"></div>' +
|
||||
'</div>';
|
||||
}
|
||||
value += '</div><div id="photo_swiper_'+ row.reportCaseId +'" class="swiper-pagination"></div></div>';
|
||||
setTimeout(function() {
|
||||
new Swiper('#photo_'+ row.reportCaseId, {
|
||||
lazyLoading: true,
|
||||
autoplay: 3000,
|
||||
pagination : '#photo_swiper_'+ row.reportCaseId,
|
||||
paginationClickable :true,
|
||||
});
|
||||
new Viewer(document.getElementById('photo_'+ row.reportCaseId));
|
||||
}, 50);
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 350, title: '案件信息', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">案件编号</span><span class="col-right">'+ row.caseNumber +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">所在地区</span><span class="col-right">'+ row.areaName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">所在社区</span><span class="col-right">'+ row.communityName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">案件类型</span><span class="col-right">'+ row.caseTypeName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">操作</span>' +
|
||||
'<span class="col-right">'+
|
||||
'<div class="btn-group btn-group-xs">' +
|
||||
'<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="showEvent">详情</button>'+
|
||||
'<button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="caseFlowEvent">流程</button>'+
|
||||
'</div>'+
|
||||
'</span>'+
|
||||
'</div>'+
|
||||
'</div>'
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 300, title: '案件内容', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">案件来源</span><span class="col-right">'+ sourceFormatter(row.caseSource) +'</span></div>'+
|
||||
'<div class="info-row"><a href="javascript:;" class="col-line" lay-event="showLocation"><i class="fa fa-map-marker"></i>'+ row.casePosition +'</a></div>'+
|
||||
'<div class="info-row"><span class="col-content">'+ row.caseContent +'</span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 250, title: '案件状态', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">上报时间</span><span class="col-right">'+ row.reportDate +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">上报人员</span><span class="col-right">'+ row.caseReporter +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">案件状态</span><span class="col-right">'+ caseStatusFormatter(row.caseStatus) +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right" style="color: red;">'+ ((row.overDays != null && row.overDays >= 1) ? '【超过'+ row.overDays +'天未处理】' : '') +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 250, title: '下派信息', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">处理时间</span><span class="col-right">'+ row.handleDate +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">处理人员</span><span class="col-right">'+ row.handleUserName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">处理时长</span><span class="col-right">'+ row.handleTime +'天</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">是否超时</span><span class="col-right"></span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
}
|
||||
]],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
},
|
||||
done: function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
setTimeout(function(){
|
||||
initTable();
|
||||
},500);
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
dataLoading = true;
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(getParamsUrl(tableUrl), []),
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 100,
|
||||
done:function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化案件类型
|
||||
function initCaseType(){
|
||||
top.restAjax.get('api/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852', {}, null, function(code, data) {
|
||||
laytpl(document.getElementById('caseTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('caseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initCaseType();
|
||||
|
||||
//初始化子案件类型
|
||||
function initChildCaseType(parentId){
|
||||
if(typeof(parentId) === 'undefined' || '' == parentId){
|
||||
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render([], function(html) {
|
||||
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
top.restAjax.get('api/dict/listdict/' + parentId, {}, null, function(code, data) {
|
||||
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initChildCaseType();
|
||||
|
||||
//初始化时间
|
||||
function initDateTime(){
|
||||
laydate.render({
|
||||
elem: '#startTime'
|
||||
,value: ''
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime'
|
||||
,value: ''
|
||||
});
|
||||
}
|
||||
initDateTime();
|
||||
|
||||
function getParamsUrl(url) {
|
||||
var caseTypeId = $('#caseTypeId').val();
|
||||
var childCaseTypeId = $('#childCaseTypeId').val();
|
||||
var startTime = $('#startTime').val();
|
||||
var endTime = $('#endTime').val();
|
||||
var params = '?t='+ new Date().getTime();
|
||||
if('' != departmentId && 'undefined' != typeof(departmentId)) {
|
||||
params += '&departmentId='+ departmentId;
|
||||
}
|
||||
if('' != caseTypeId && '' != childCaseTypeId) {
|
||||
params += '&caseTypeId='+ childCaseTypeId;
|
||||
} else {
|
||||
params += '&caseTypeId='+ caseTypeId;
|
||||
}
|
||||
if('' != startTime) {
|
||||
params += '&startTime='+ startTime;
|
||||
}
|
||||
if('' != endTime) {
|
||||
params += '&endTime='+ endTime;
|
||||
}
|
||||
return url + params;
|
||||
}
|
||||
|
||||
// 来源格式化
|
||||
function sourceFormatter(val) {
|
||||
var value;
|
||||
switch (val) {
|
||||
case '1':
|
||||
value = '群众举报';
|
||||
break;
|
||||
case '2':
|
||||
value = '巡检采集';
|
||||
break;
|
||||
case '3':
|
||||
value = '专管员上报';
|
||||
break;
|
||||
default:
|
||||
value = '未知';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// 案件状态
|
||||
function caseStatusFormatter(val) {
|
||||
var value;
|
||||
switch (val) {
|
||||
case '0':
|
||||
value = '待受理';
|
||||
break;
|
||||
case '1':
|
||||
value = '待立案';
|
||||
break;
|
||||
case '2':
|
||||
value = '待下派';
|
||||
break;
|
||||
case '3':
|
||||
value = '待处理';
|
||||
break;
|
||||
case '4':
|
||||
value = '待检查';
|
||||
break;
|
||||
case '5':
|
||||
value = '待结案';
|
||||
break;
|
||||
case '6':
|
||||
value = '已归档';
|
||||
break;
|
||||
default:
|
||||
value = '异常';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// 删除
|
||||
function remove(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/reportcase/removereportcase/{ids}', [ids]), {}, null, function (code, data) {
|
||||
// success
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}, function () {
|
||||
reloadTable();
|
||||
});
|
||||
}, function (code, data) {
|
||||
// error
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
// before
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
// complete
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
if(obj.event === 'showEvent'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '详情',
|
||||
closeBtn: 1,
|
||||
area: ['70%', '80%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/show.html?reportCaseId={id}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'caseFlowEvent'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '案件流程',
|
||||
closeBtn: 1,
|
||||
area: ['50%', '60%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/list_case_log.html?reportCaseId={id}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'showLocation'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '案件位置预览',
|
||||
closeBtn: 1,
|
||||
area: ['800px', '565px'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/map-case-mark.html?reportCaseId={reportCaseId}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'deleteEvent'){
|
||||
remove(obj.data.reportCaseId);
|
||||
}
|
||||
});
|
||||
|
||||
form.on('select(changeCaseType)',function(data){
|
||||
if(data.value == ''){
|
||||
$('#childCaseTypeId').val('');
|
||||
initChildCaseType();
|
||||
} else {
|
||||
initChildCaseType(data.value);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#search', function() {
|
||||
if(dataLoading){
|
||||
layer.msg('数据加载中,请稍等...');
|
||||
return;
|
||||
}
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
$(document).on('click', '#deleteTableData', function() {
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
if(checkStatus.data.length == 0){
|
||||
layer.msg('请先勾选要删除的数据')
|
||||
return;
|
||||
}
|
||||
var ids = '';
|
||||
for (var i = 0, item;item = checkStatus.data[i++];){
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item.reportCaseId;
|
||||
}
|
||||
remove(ids);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,454 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<base href="/servicecity/">
|
||||
<meta charset="UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11,chrome=1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
|
||||
<!-- 图片 -->
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/swiper3/css/swiper.min.css"/>
|
||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||
<!-- 图片 -->
|
||||
<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">
|
||||
<style>
|
||||
.layui-table-cell{
|
||||
height: auto;
|
||||
}
|
||||
.layui-table-body td{
|
||||
height: 210px;
|
||||
}
|
||||
.layui-table img{
|
||||
max-width: 100%;
|
||||
}
|
||||
.info-row {border-bottom: 1px dotted;}
|
||||
.info-row:last-child {border: none;}
|
||||
.info-row .col-left {width:30%;height:28px;text-align:center;border-right:1px dotted;display:inline-block;padding:5px;vertical-align:top;}
|
||||
.info-row .col-right {width:70%;display:inline-block;padding:5px;vertical-align:top;}
|
||||
.info-row .col-line {width:100%;color:black;text-align:center;display:block;padding:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
|
||||
.info-row .col-line .fa {color: red; margin-right: 5px;}
|
||||
.info-row .col-content {width:100%;display:inline-block;padding:5px;height:86px;overflow:auto;white-space:normal;word-break:break-all;word-wrap:break-word;vertical-align:top;}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<div class="test-table-reload-btn layui-form" style="margin-bottom: 5px;">
|
||||
<div class="layui-inline" style="width: 150px;">
|
||||
<input type="hidden" id="areaId" name="areaId" value="">
|
||||
<input type="text" class="layui-input" id="areaName" name="areaName" value="" readonly="readonly">
|
||||
</div>
|
||||
<div class="layui-inline" id="caseTypeSelectTemplateBox" style="width: 150px;"></div>
|
||||
<script id="caseTypeSelectTemplate" type="text/html">
|
||||
<select id="caseTypeId" name="caseTypeId" lay-filter="changeCaseType">
|
||||
<option value="">案件类型</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dictId}}">{{item.dictName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<div class="layui-inline" id="childCaseTypeSelectTemplateBox" style="width: 150px;"></div>
|
||||
<script id="childCaseTypeSelectTemplate" type="text/html">
|
||||
<select id="childCaseTypeId" name="childCaseTypeId">
|
||||
<option value="">案件子类型</option>
|
||||
{{# for(var i = 0, item; item = d[i++];) { }}
|
||||
<option value="{{item.dictId}}">{{item.dictName}}</option>
|
||||
{{# } }}
|
||||
</select>
|
||||
</script>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="startTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="开始时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<input type="text" id="endTime" class="layui-input search-item"
|
||||
readonly="readonly" placeholder="结束时间" style="height: 38px;width:150px;cursor: pointer" autocomplete="off">
|
||||
</div>
|
||||
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||
<i class="fa fa-lg fa-search"></i> 搜索
|
||||
</button>
|
||||
<!--<button type="button" id="deleteTableData" class="layui-btn layui-btn-danger layui-btn-sm">
|
||||
<i class="fa fa-lg fa-trash"></i> 批量删除
|
||||
</button>-->
|
||||
</div>
|
||||
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="assets/layuiadmin/layui/layui.js"></script>
|
||||
<!-- 图片 -->
|
||||
<script type="text/javascript" src="assets/js/vendor/swiper3/js/swiper.min.js"></script>
|
||||
<script type="text/javascript" src="assets/js/vendor/viewer/viewer.min.js"></script>
|
||||
<!-- 图片 -->
|
||||
|
||||
<script type="text/javascript">
|
||||
layui.config({
|
||||
base: 'assets/layuiadmin/'
|
||||
}).extend({
|
||||
index: 'lib/index'
|
||||
}).use(['index', 'table', 'laytpl', 'form','laydate'], function() {
|
||||
var $ = layui.$;
|
||||
var $win = $(window);
|
||||
var laytpl = layui.laytpl;
|
||||
var table = layui.table;
|
||||
var admin = layui.admin;
|
||||
var form = layui.form;
|
||||
var laydate = layui.laydate;
|
||||
var departmentId = '2da5c4db-209b-4c28-bf35-153535fdfc78';
|
||||
var tableUrl = 'api/reportcase/listpagereportcase?caseStatus=6';
|
||||
var dataLoading = false;
|
||||
|
||||
// 初始化表格
|
||||
function initTable() {
|
||||
dataLoading = true;
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
id: 'dataTable',
|
||||
url: top.restAjax.path(getParamsUrl(tableUrl), []),
|
||||
width: admin.screen() > 1 ? '100%' : '',
|
||||
height: $win.height() - 100,
|
||||
limit: 10,
|
||||
limits: [10, 20, 40, 80, 100, 200],
|
||||
request: {
|
||||
pageName: 'page',
|
||||
limitName: 'rows'
|
||||
},
|
||||
cols: [[
|
||||
{field:'rowNum', width:60, title: '序号', fixed: 'left', align:'center', templet: '<span>{{d.LAY_INDEX}}</span>'},
|
||||
{type:'checkbox', fixed: 'left'},
|
||||
{width: 300, title: '案件图片', align:'center',
|
||||
templet: function(row) {
|
||||
var photos = row.casePhotos.split(',')
|
||||
var value = '<div id="photo_'+ row.reportCaseId +'" class="swiper-container" style="width:100%;">' +
|
||||
'<div class="swiper-wrapper" style="width:100%">';
|
||||
for(var i = 0, item = photos[i]; item = photos[i++];) {
|
||||
value += '<div class="swiper-slide" style="width:100%;">' +
|
||||
'<img class="swiper-lazy" src="route/file/downloadfile/true/'+ item +'" style="width:270px;height:180px;cursor:pointer;"/>' +
|
||||
'<div class="swiper-lazy-preloader"></div>' +
|
||||
'</div>';
|
||||
}
|
||||
value += '</div><div id="photo_swiper_'+ row.reportCaseId +'" class="swiper-pagination"></div></div>';
|
||||
setTimeout(function() {
|
||||
new Swiper('#photo_'+ row.reportCaseId, {
|
||||
lazyLoading: true,
|
||||
autoplay: 3000,
|
||||
pagination : '#photo_swiper_'+ row.reportCaseId,
|
||||
paginationClickable :true,
|
||||
});
|
||||
new Viewer(document.getElementById('photo_'+ row.reportCaseId));
|
||||
}, 50);
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 350, title: '案件信息', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">案件编号</span><span class="col-right">'+ row.caseNumber +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">所在地区</span><span class="col-right">'+ row.areaName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">所在社区</span><span class="col-right">'+ row.communityName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">案件类型</span><span class="col-right">'+ row.caseTypeName +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">操作</span>' +
|
||||
'<span class="col-right">'+
|
||||
'<div class="btn-group btn-group-xs">' +
|
||||
'<button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="showEvent">详情</button>'+
|
||||
'<button type="button" class="layui-btn layui-btn-warm layui-btn-sm" lay-event="caseFlowEvent">流程</button>'+
|
||||
'</div>'+
|
||||
'</span>'+
|
||||
'</div>'+
|
||||
'</div>'
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 400, title: '案件内容', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">案件来源</span><span class="col-right">'+ sourceFormatter(row.caseSource) +'</span></div>'+
|
||||
'<div class="info-row"><a href="javascript:;" class="col-line" lay-event="showLocation"><i class="fa fa-map-marker"></i>'+ row.casePosition +'</a></div>'+
|
||||
'<div class="info-row"><span class="col-content">'+ row.caseContent +'</span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
},
|
||||
{width: 250, title: '案件状态', align: 'center',
|
||||
templet: function (row) {
|
||||
var value = '<div style="text-align: left">'+
|
||||
'<div class="info-row"><span class="col-left">上报时间</span><span class="col-right">'+ row.reportDate +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">上报人员</span><span class="col-right">'+ row.caseReporter +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left">案件状态</span><span class="col-right">'+ caseStatusFormatter(row.caseStatus) +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right" style="color: red;">'+ ((row.overDays != null && row.overDays >= 1) ? '【超过'+ row.overDays +'天未处理】' : '') +'</span></div>'+
|
||||
'<div class="info-row"><span class="col-left"></span><span class="col-right"></span></div>'+
|
||||
'</div>';
|
||||
return value;
|
||||
}
|
||||
}
|
||||
]],
|
||||
page: true,
|
||||
parseData: function(data) {
|
||||
return {
|
||||
'code': 0,
|
||||
'msg': '',
|
||||
'count': data.total,
|
||||
'data': data.rows
|
||||
};
|
||||
},
|
||||
done: function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
setTimeout(function(){
|
||||
initTable();
|
||||
},500);
|
||||
|
||||
// 重载表格
|
||||
function reloadTable(currentPage) {
|
||||
dataLoading = true;
|
||||
table.reload('dataTable', {
|
||||
url: top.restAjax.path(getParamsUrl(tableUrl), []),
|
||||
page: {
|
||||
curr: currentPage
|
||||
},
|
||||
height: $win.height() - 100,
|
||||
done:function(){
|
||||
dataLoading = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//初始化案件类型
|
||||
function initCaseType(){
|
||||
top.restAjax.get('api/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852', {}, null, function(code, data) {
|
||||
laytpl(document.getElementById('caseTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('caseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initCaseType();
|
||||
|
||||
//初始化子案件类型
|
||||
function initChildCaseType(parentId){
|
||||
if(typeof(parentId) === 'undefined' || '' == parentId){
|
||||
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render([], function(html) {
|
||||
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
}
|
||||
top.restAjax.get('api/dict/listdict/' + parentId, {}, null, function(code, data) {
|
||||
laytpl(document.getElementById('childCaseTypeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('childCaseTypeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
form.render('select');
|
||||
}, function(code, data) {
|
||||
top.dialog.msg(data.msg);
|
||||
});
|
||||
}
|
||||
initChildCaseType();
|
||||
|
||||
//初始化时间
|
||||
function initDateTime(){
|
||||
laydate.render({
|
||||
elem: '#startTime'
|
||||
,value: ''
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#endTime'
|
||||
,value: ''
|
||||
});
|
||||
}
|
||||
initDateTime();
|
||||
|
||||
function getParamsUrl(url) {
|
||||
var caseTypeId = $('#caseTypeId').val();
|
||||
var childCaseTypeId = $('#childCaseTypeId').val();
|
||||
var startTime = $('#startTime').val();
|
||||
var endTime = $('#endTime').val();
|
||||
var params = '&t='+ new Date().getTime();
|
||||
if('' != departmentId && 'undefined' != typeof(departmentId)) {
|
||||
params += '&departmentId='+ departmentId;
|
||||
}
|
||||
if('' != caseTypeId && '' != childCaseTypeId) {
|
||||
params += '&caseTypeId='+ childCaseTypeId;
|
||||
} else {
|
||||
params += '&caseTypeId='+ caseTypeId;
|
||||
}
|
||||
if('' != startTime) {
|
||||
params += '&startTime='+ startTime;
|
||||
}
|
||||
if('' != endTime) {
|
||||
params += '&endTime='+ endTime;
|
||||
}
|
||||
return url + params;
|
||||
}
|
||||
|
||||
// 来源格式化
|
||||
function sourceFormatter(val) {
|
||||
var value;
|
||||
switch (val) {
|
||||
case '1':
|
||||
value = '群众举报';
|
||||
break;
|
||||
case '2':
|
||||
value = '巡检采集';
|
||||
break;
|
||||
case '3':
|
||||
value = '专管员上报';
|
||||
break;
|
||||
default:
|
||||
value = '未知';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// 案件状态
|
||||
function caseStatusFormatter(val) {
|
||||
var value;
|
||||
switch (val) {
|
||||
case '0':
|
||||
value = '待受理';
|
||||
break;
|
||||
case '1':
|
||||
value = '待立案';
|
||||
break;
|
||||
case '2':
|
||||
value = '待下派';
|
||||
break;
|
||||
case '3':
|
||||
value = '待处理';
|
||||
break;
|
||||
case '4':
|
||||
value = '待检查';
|
||||
break;
|
||||
case '5':
|
||||
value = '待结案';
|
||||
break;
|
||||
case '6':
|
||||
value = '已归档';
|
||||
break;
|
||||
default:
|
||||
value = '异常';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
// 删除
|
||||
function remove(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/reportcase/removereportcase/{ids}', [ids]), {}, null, function (code, data) {
|
||||
// success
|
||||
top.dialog.msg(top.dataMessage.deleteSuccess, {time: 1000}, function () {
|
||||
reloadTable();
|
||||
});
|
||||
}, function (code, data) {
|
||||
// error
|
||||
top.dialog.msg(data.msg);
|
||||
}, function () {
|
||||
// before
|
||||
layIndex = top.dialog.msg(top.dataMessage.deleting, {icon: 16, time: 0, shade: 0.3});
|
||||
}, function () {
|
||||
// complete
|
||||
top.dialog.close(layIndex);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
table.on('tool(dataTable)', function(obj) {
|
||||
if(obj.event === 'showEvent'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '详情',
|
||||
closeBtn: 1,
|
||||
area: ['70%', '80%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/show.html?reportCaseId={id}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'caseFlowEvent'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '案件流程',
|
||||
closeBtn: 1,
|
||||
area: ['50%', '60%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/list_case_log.html?reportCaseId={id}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'showLocation'){
|
||||
layer.open({
|
||||
type: 2,
|
||||
title: '案件位置预览',
|
||||
closeBtn: 1,
|
||||
area: ['50%', '60%'],
|
||||
shadeClose: true,
|
||||
anim: 2,
|
||||
content: top.restAjax.path('route/reportcase/map-case-mark.html?reportCaseId={reportCaseId}',
|
||||
[obj.data.reportCaseId]),
|
||||
end: function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if(obj.event === 'deleteEvent'){
|
||||
remove(obj.data.reportCaseId);
|
||||
}
|
||||
});
|
||||
|
||||
form.on('select(changeCaseType)',function(data){
|
||||
if(data.value == ''){
|
||||
$('#childCaseTypeId').val('');
|
||||
initChildCaseType();
|
||||
} else {
|
||||
initChildCaseType(data.value);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click', '#search', function() {
|
||||
if(dataLoading){
|
||||
layer.msg('数据加载中,请稍等...');
|
||||
return;
|
||||
}
|
||||
reloadTable(1);
|
||||
});
|
||||
|
||||
$(document).on('click', '#deleteTableData', function() {
|
||||
var checkStatus = table.checkStatus('dataTable');
|
||||
if(checkStatus.data.length == 0){
|
||||
layer.msg('请先勾选要删除的数据')
|
||||
return;
|
||||
}
|
||||
var ids = '';
|
||||
for (var i = 0, item;item = checkStatus.data[i++];){
|
||||
if(i > 1) {
|
||||
ids += '_';
|
||||
}
|
||||
ids += item.reportCaseId;
|
||||
}
|
||||
remove(ids);
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -183,47 +183,11 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
// 初始化地区
|
||||
function initArea() {
|
||||
top.restAjax.get('api/dict/listdict/9d179f05-3ea0-48f7-853c-d3b7124b791c', {}, null, function(code, data) {
|
||||
data.unshift({
|
||||
dictId: 'none',
|
||||
dictName: '请选择地区'
|
||||
});
|
||||
$('#areaId').combobox({
|
||||
panelHeight: '100px',
|
||||
valueField: 'dictId',
|
||||
textField: 'dictName',
|
||||
onSelect: function(data) {
|
||||
if(data.dictId == 'none') {
|
||||
$('#communityId').combobox('setValue', '');
|
||||
$('#communityIdBox').hide();
|
||||
} else {
|
||||
$('#communityIdBox').show();
|
||||
initCommunity(data.dictId);
|
||||
}
|
||||
},
|
||||
});
|
||||
$('#areaId').combobox('loadData', data);
|
||||
}, function(code, data) {
|
||||
top.DialogBox.msg(data.msg);
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化社区
|
||||
function initCommunity(areaId) {
|
||||
$('#communityId').combobox({
|
||||
url:'api/community/listcommunity?areaId='+ areaId,
|
||||
method: 'get',
|
||||
panelHeight: '100px',
|
||||
valueField: 'communityId',
|
||||
textField: 'communityName'
|
||||
});
|
||||
$('#communityId').combobox('setValue', '');
|
||||
}
|
||||
$(function() {
|
||||
top.Mask.hideMask();
|
||||
$('#app').fadeTo(1000, 1);
|
||||
initArea();
|
||||
|
||||
$('#userType').combo({
|
||||
panelHeight: '100px',
|
||||
|
Loading…
Reference in New Issue
Block a user