diff --git a/src/main/java/com/cm/systemcity/config/properties/ConstsIdProperties.java b/src/main/java/com/cm/systemcity/config/properties/ConstsIdProperties.java new file mode 100644 index 0000000..34fb60f --- /dev/null +++ b/src/main/java/com/cm/systemcity/config/properties/ConstsIdProperties.java @@ -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 { + + } + +} diff --git a/src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java b/src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java index 6d78005..940a2d6 100644 --- a/src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java +++ b/src/main/java/com/cm/systemcity/consts/ISystemCityConsts.java @@ -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"; + } diff --git a/src/main/java/com/cm/systemcity/controller/apis/config/ConfigController.java b/src/main/java/com/cm/systemcity/controller/apis/config/ConfigController.java index 1246f77..75ec4e1 100644 --- a/src/main/java/com/cm/systemcity/controller/apis/config/ConfigController.java +++ b/src/main/java/com/cm/systemcity/controller/apis/config/ConfigController.java @@ -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("网格员不记录轨迹开始时间不能为空"); diff --git a/src/main/java/com/cm/systemcity/controller/apis/leave/LeaveController.java b/src/main/java/com/cm/systemcity/controller/apis/leave/LeaveController.java index 97c0a2d..862940a 100644 --- a/src/main/java/com/cm/systemcity/controller/apis/leave/LeaveController.java +++ b/src/main/java/com/cm/systemcity/controller/apis/leave/LeaveController.java @@ -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> listPageLeaveDetail2(ListPage page) throws SearchException { + Map 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 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 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", ""); } diff --git a/src/main/java/com/cm/systemcity/controller/app/config/ConfigAppController.java b/src/main/java/com/cm/systemcity/controller/app/config/ConfigAppController.java index e9ffaf1..2bd392c 100644 --- a/src/main/java/com/cm/systemcity/controller/app/config/ConfigAppController.java +++ b/src/main/java/com/cm/systemcity/controller/app/config/ConfigAppController.java @@ -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 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()); diff --git a/src/main/java/com/cm/systemcity/controller/app/leave/LeaveAppController.java b/src/main/java/com/cm/systemcity/controller/app/leave/LeaveAppController.java index 04c18e0..6e6d1dc 100644 --- a/src/main/java/com/cm/systemcity/controller/app/leave/LeaveAppController.java +++ b/src/main/java/com/cm/systemcity/controller/app/leave/LeaveAppController.java @@ -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 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 = "请假列表接口") diff --git a/src/main/java/com/cm/systemcity/dao/user/ICityUserDao.java b/src/main/java/com/cm/systemcity/dao/user/ICityUserDao.java new file mode 100644 index 0000000..44ee9f4 --- /dev/null +++ b/src/main/java/com/cm/systemcity/dao/user/ICityUserDao.java @@ -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 params); + +} diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/config/PunchTimeDTOV2.java b/src/main/java/com/cm/systemcity/pojo/dtos/config/PunchTimeDTOV2.java index b7b8c7f..c456efb 100644 --- a/src/main/java/com/cm/systemcity/pojo/dtos/config/PunchTimeDTOV2.java +++ b/src/main/java/com/cm/systemcity/pojo/dtos/config/PunchTimeDTOV2.java @@ -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; } diff --git a/src/main/java/com/cm/systemcity/pojo/dtos/leave/LeaveDTO.java b/src/main/java/com/cm/systemcity/pojo/dtos/leave/LeaveDTO.java index 4c90d63..aa3b017 100644 --- a/src/main/java/com/cm/systemcity/pojo/dtos/leave/LeaveDTO.java +++ b/src/main/java/com/cm/systemcity/pojo/dtos/leave/LeaveDTO.java @@ -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 + '\'' + + '}'; } } \ No newline at end of file diff --git a/src/main/java/com/cm/systemcity/pojo/vos/config/ConfigVOV2.java b/src/main/java/com/cm/systemcity/pojo/vos/config/ConfigVOV2.java index 4365c2d..2449aa7 100644 --- a/src/main/java/com/cm/systemcity/pojo/vos/config/ConfigVOV2.java +++ b/src/main/java/com/cm/systemcity/pojo/vos/config/ConfigVOV2.java @@ -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; } diff --git a/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveApprovalVO.java b/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveApprovalVO.java index efcd1d8..31fa62d 100644 --- a/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveApprovalVO.java +++ b/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveApprovalVO.java @@ -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; } } \ No newline at end of file diff --git a/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveVO.java b/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveVO.java index fb4baa0..a4a0bb1 100644 --- a/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveVO.java +++ b/src/main/java/com/cm/systemcity/pojo/vos/leave/LeaveVO.java @@ -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; } } \ No newline at end of file diff --git a/src/main/java/com/cm/systemcity/service/leave/ILeaveService.java b/src/main/java/com/cm/systemcity/service/leave/ILeaveService.java index 3ee4ac6..4c94919 100644 --- a/src/main/java/com/cm/systemcity/service/leave/ILeaveService.java +++ b/src/main/java/com/cm/systemcity/service/leave/ILeaveService.java @@ -75,8 +75,23 @@ public interface ILeaveService { * @return * @throws UpdateException */ + @Deprecated SuccessResult updateLeaveOfApproval(Map 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 params) throws UpdateException, SearchException; + SuccessResult updateLeaveOfApproval(String token, String leaveId, Integer approverState, String approverRefuseSummary); + + /** * 全部请假列表 * @@ -169,6 +188,15 @@ public interface ILeaveService { */ SuccessResultList> listPageLeaveDetail(ListPage page) throws SearchException; + /** + * 2级分页请假详情列表 + * + * @param page + * @return + */ + SuccessResultList> listPageLeaveDetail2(ListPage page); + + /** * 导出(EXCEL)请教记录 * @@ -194,4 +222,7 @@ public interface ILeaveService { * @throws SearchException */ Integer countUserLeave(Map params) throws SearchException; + + + } diff --git a/src/main/java/com/cm/systemcity/service/leave/impl/LeaveServiceImpl.java b/src/main/java/com/cm/systemcity/service/leave/impl/LeaveServiceImpl.java index c9bb645..1a8422a 100644 --- a/src/main/java/com/cm/systemcity/service/leave/impl/LeaveServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/leave/impl/LeaveServiceImpl.java @@ -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 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 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 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 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 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 listLeaveAll(Map params) throws SearchException { List leaveDTOs = leaveDao.listLeave(params); @@ -236,7 +296,7 @@ public class LeaveServiceImpl extends BaseService implements ILeaveService { Map 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> listPageLeaveDetail2(ListPage page) { + // 1级审批通过的请假列表 + page.getParams().put("approverState", 1); + PageHelper.startPage(page.getPage(), page.getRows()); + List list = leaveDao.listLeave(page.getParams()); + PageInfo pageInfo = new PageInfo<>(list); + return new SuccessResultList<>(list, pageInfo.getPageNum(), pageInfo.getTotal()); + } + @Override public void listLeaveDetailToExcel(HttpServletResponse response, Map params) throws SearchException, IOException { response.setContentType("application/vnd.ms-excel"); diff --git a/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java b/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java index 2bb8a27..112abd3 100755 --- a/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/reportcase/impl/ReportCaseServiceImpl.java @@ -682,6 +682,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listPageReportCaseHandle(ListPage page) throws SearchException { setNPersonAreaParams(page.getParams()); + page.getParams().put("caseStatus", 3); PageHelper.startPage(page.getPage(), page.getRows()); List reportCaseHandleDTOs = reportCaseDao.listPageReportCaseHandle(page.getParams()); PageInfo pageInfo = new PageInfo<>(reportCaseHandleDTOs); @@ -787,6 +788,7 @@ public class ReportCaseServiceImpl extends BaseService implements IReportCaseSer @Override public SuccessResultList> listPageReportCaseInspect(ListPage page) throws SearchException { setNPersonAreaParams(page.getParams()); + page.getParams().put("caseStatus", 4); PageHelper.startPage(page.getPage(), page.getRows()); List reportCaseInspectDTOs = reportCaseDao.listPageReportCaseInspect(page.getParams()); PageInfo pageInfo = new PageInfo<>(reportCaseInspectDTOs); diff --git a/src/main/java/com/cm/systemcity/service/user/CityUserService.java b/src/main/java/com/cm/systemcity/service/user/CityUserService.java new file mode 100644 index 0000000..8ef39ba --- /dev/null +++ b/src/main/java/com/cm/systemcity/service/user/CityUserService.java @@ -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 params = getHashMap(4); + params.put("userId", userId); + params.put("departmentId", departmentGaId); + Integer count = cityUserDao.countDepartmentUser(params); + return count != null && count > 0; + } + +} diff --git a/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java b/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java index b20308e..095e485 100755 --- a/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/userlocation/impl/UserLocationServiceImpl.java @@ -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); // 上午结束上班时间 diff --git a/src/main/java/com/cm/systemcity/service/usersignin/impl/UserSigninServiceImpl.java b/src/main/java/com/cm/systemcity/service/usersignin/impl/UserSigninServiceImpl.java index 27542aa..ebf6f4d 100755 --- a/src/main/java/com/cm/systemcity/service/usersignin/impl/UserSigninServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/usersignin/impl/UserSigninServiceImpl.java @@ -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 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> gridDaySignInList = userSigninDao.listGridUserSignIn(params); - for(Map item : gridDaySignInList){ - item.put("gmtCreate", item.get("gmtCreate").toString().substring(0,19)); + for (Map item : gridDaySignInList) { + item.put("gmtCreate", item.get("gmtCreate").toString().substring(0, 19)); } PageInfo> 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> nDaySignInList = userSigninDao.listNUserSignIn(params); - for(Map item : nDaySignInList){ - item.put("gmtCreate", item.get("gmtCreate").toString().substring(0,19)); + for (Map item : nDaySignInList) { + item.put("gmtCreate", item.get("gmtCreate").toString().substring(0, 19)); } PageInfo> 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 getCheckUserSignin(String token, Map 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); } diff --git a/src/main/java/com/cm/systemcity/service/usersignout/impl/UserSignoutServiceImpl.java b/src/main/java/com/cm/systemcity/service/usersignout/impl/UserSignoutServiceImpl.java index 547ea38..434cddc 100755 --- a/src/main/java/com/cm/systemcity/service/usersignout/impl/UserSignoutServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/usersignout/impl/UserSignoutServiceImpl.java @@ -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 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"; } diff --git a/src/main/resources/application-btgxq.yml b/src/main/resources/application-btgxq.yml index a55e148..361e8e8 100644 --- a/src/main/resources/application-btgxq.yml +++ b/src/main/resources/application-btgxq.yml @@ -147,4 +147,10 @@ socket: delay-ping-seconds: 3 send-client-info-active: false # 上报服务器数据时间 - send-client-info-second: 30 \ No newline at end of file + send-client-info-second: 30 + +consts-id: + # 组织机构 + department: + # 公安 + ga: 2da5c4db-209b-4c28-bf35-153535fdfc78 diff --git a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml index d7072ff..4b6e9c4 100755 --- a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml +++ b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml @@ -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 diff --git a/src/main/resources/mybatis/mapper/leave/leave-mapper.xml b/src/main/resources/mybatis/mapper/leave/leave-mapper.xml index 1c7c6bf..5533a7f 100644 --- a/src/main/resources/mybatis/mapper/leave/leave-mapper.xml +++ b/src/main/resources/mybatis/mapper/leave/leave-mapper.xml @@ -8,13 +8,25 @@ + + + + + + + + + + + + @@ -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 @@ leave_type = #{leaveType}, + + leave_type_name = #{leaveTypeName}, + leave_summary = #{leaveSummary}, @@ -110,6 +143,9 @@ leave_time_long = #{leaveTimeLong}, + + leave_img = #{leaveImg}, + leave_state = #{leaveState}, @@ -135,6 +171,24 @@ leave_refuse_summary = #{leaveRefuseSummary}, + + + approver_state = #{approverState}, + + + approver_refuse_summary = #{approverRefuseSummary}, + + + approver2_id = #{approver2Id}, + + + approver2_name = #{approver2Name}, + + + approver2_state = #{approver2State}, + + + approver2_refuse_summary = #{approver2RefuseSummary}, modifier = #{modifier}, gmt_modified = #{gmtModified} @@ -154,6 +208,10 @@ WHERE t1.is_delete = 0 AND t2.is_delete = 0 + + AND + t1.approver_state = #{approverState} + AND t1.approver_id = #{approverId} @@ -175,6 +233,10 @@ t2.user_username like concat('%', concat(#{keywords}, '%')) ) + + AND + t1.creator = #{creator} + order by t1.gmt_create desc @@ -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, diff --git a/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml b/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml index 71eac0e..34d5204 100755 --- a/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml +++ b/src/main/resources/mybatis/mapper/reportcase/reportcase-mapper.xml @@ -497,6 +497,46 @@ ) ) + + 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} + ) + ) + ) + ORDER BY t1.gmt_create DESC @@ -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 AND t2.handle_user_id = #{handleUserId} @@ -990,6 +1029,47 @@ ) ) + + 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} + ) + ) + ORDER BY t1.gmt_modified DESC @@ -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 AND t1.creator = #{reporterId} @@ -1180,6 +1259,47 @@ ) ) + + 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} + ) + ) + ORDER BY t1.gmt_modified DESC diff --git a/src/main/resources/mybatis/mapper/user/city-user-mapper.xml b/src/main/resources/mybatis/mapper/user/city-user-mapper.xml new file mode 100644 index 0000000..282b38a --- /dev/null +++ b/src/main/resources/mybatis/mapper/user/city-user-mapper.xml @@ -0,0 +1,32 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/assessment/list_day_ga.html b/src/main/resources/static/route/assessment/list_day_ga.html new file mode 100644 index 0000000..642def6 --- /dev/null +++ b/src/main/resources/static/route/assessment/list_day_ga.html @@ -0,0 +1,263 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+ + + +
+ +
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/assessment/list_history_ga.html b/src/main/resources/static/route/assessment/list_history_ga.html new file mode 100644 index 0000000..3d809de --- /dev/null +++ b/src/main/resources/static/route/assessment/list_history_ga.html @@ -0,0 +1,258 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+ + +
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/config/config.html b/src/main/resources/static/route/config/config.html index f6e9831..09e013b 100755 --- a/src/main/resources/static/route/config/config.html +++ b/src/main/resources/static/route/config/config.html @@ -21,7 +21,7 @@
-
+
【网格员】打卡设置
@@ -114,7 +114,7 @@
-
+
【专管员】打卡设置
@@ -197,6 +197,52 @@
+
+
+
+
【公安局】打卡设置
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
diff --git a/src/main/resources/static/route/leave/list.html b/src/main/resources/static/route/leave/list.html index b71eeb8..af6e21b 100644 --- a/src/main/resources/static/route/leave/list.html +++ b/src/main/resources/static/route/leave/list.html @@ -28,7 +28,7 @@
- @@ -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 '' + rowData + ''; } }, - {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 `${rowData}`; + } + }, + {field: 'leaveImg', width: 100, title: '请假条', align:'center', + templet: function(row) { + var rowData = row[this.field]; + if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') { + return '-'; + } + return ''; } }, {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 '待审批' + } + if(rowData == '1') { + return '同意' + } + if(rowData == '2') { + return '不同意' + } + 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 '待审批' + } + if(rowData == '1') { + return '同意' + } + if(rowData == '2') { + return '不同意' + } + 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 += '
'; dom += ' +
+
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/reportcase/list_community_handle_ga.html b/src/main/resources/static/route/reportcase/list_community_handle_ga.html new file mode 100644 index 0000000..86bcd86 --- /dev/null +++ b/src/main/resources/static/route/reportcase/list_community_handle_ga.html @@ -0,0 +1,477 @@ + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+ + +
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/reportcase/list_community_inspect_ga.html b/src/main/resources/static/route/reportcase/list_community_inspect_ga.html new file mode 100644 index 0000000..c35b479 --- /dev/null +++ b/src/main/resources/static/route/reportcase/list_community_inspect_ga.html @@ -0,0 +1,466 @@ + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ + +
+
+ +
+ +
+ +
+
+ +
+ + +
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/reportcase/list_community_placeonfile_ga.html b/src/main/resources/static/route/reportcase/list_community_placeonfile_ga.html new file mode 100644 index 0000000..171f38d --- /dev/null +++ b/src/main/resources/static/route/reportcase/list_community_placeonfile_ga.html @@ -0,0 +1,454 @@ + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ + +
+
+ +
+ +
+ +
+
+ +
+ + +
+ +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/usersignout/list_unsign_jurisdiction.html b/src/main/resources/static/route/usersignout/list_unsign_jurisdiction.html index 8086e7e..fa7e344 100755 --- a/src/main/resources/static/route/usersignout/list_unsign_jurisdiction.html +++ b/src/main/resources/static/route/usersignout/list_unsign_jurisdiction.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',