Merge branch 'main' of http://47.97.8.94:19527/yj/zn-cloud
This commit is contained in:
commit
9f02423626
@ -25,6 +25,11 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode OA_EVECTION_NOT_EXISTS = new ErrorCode(1_009_001_101, "出差申请不存在");
|
ErrorCode OA_EVECTION_NOT_EXISTS = new ErrorCode(1_009_001_101, "出差申请不存在");
|
||||||
ErrorCode OA_SEAL_NOT_EXISTS = new ErrorCode(1_009_001_102, "用章申请不存在");
|
ErrorCode OA_SEAL_NOT_EXISTS = new ErrorCode(1_009_001_102, "用章申请不存在");
|
||||||
ErrorCode OA_CONTRACT_NOT_EXISTS = new ErrorCode(1_009_001_103, "合同审批不存在");
|
ErrorCode OA_CONTRACT_NOT_EXISTS = new ErrorCode(1_009_001_103, "合同审批不存在");
|
||||||
|
ErrorCode OA_CASH_NOT_EXISTS = new ErrorCode(1_009_001_104, "现金支出申请不存在");
|
||||||
|
ErrorCode OA_OVERTIME_NOT_EXISTS = new ErrorCode(1_009_001_105, "加班申请不存在");
|
||||||
|
ErrorCode OA_REGULAR_NOT_EXISTS = new ErrorCode(1_009_001_106, "转正申请不存在");
|
||||||
|
ErrorCode OA_SHIFTJOBS_NOT_EXISTS = new ErrorCode(1_009_001_107, "调岗申请不存在");
|
||||||
|
ErrorCode OA_SECOND_NOT_EXISTS = new ErrorCode(1_009_001_108, "借调申请不存在");
|
||||||
|
|
||||||
// ========== 流程模型 1-009-002-000 ==========
|
// ========== 流程模型 1-009-002-000 ==========
|
||||||
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1_009_002_000, "已经存在流程标识为【{}】的流程");
|
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1_009_002_000, "已经存在流程标识为【{}】的流程");
|
||||||
|
@ -41,7 +41,7 @@ public class BpmOACashController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得请假申请")
|
@Operation(summary = "获得现金支出申请")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
public CommonResult<BpmOACashRespVO> getCash(@RequestParam("id") Long id) {
|
public CommonResult<BpmOACashRespVO> getCash(@RequestParam("id") Long id) {
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class BpmOAContractController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得请假申请")
|
@Operation(summary = "获得合同审批")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
public CommonResult<BpmOAContractRespVO> getContract(@RequestParam("id") Long id) {
|
public CommonResult<BpmOAContractRespVO> getContract(@RequestParam("id") Long id) {
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class BpmOAEvectionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得请假申请")
|
@Operation(summary = "获得出差申请")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
public CommonResult<BpmOAEvectionRespVO> getEvection(@RequestParam("id") Long id) {
|
public CommonResult<BpmOAEvectionRespVO> getEvection(@RequestParam("id") Long id) {
|
||||||
|
|
||||||
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime.BpmOAOvertimeCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime.BpmOAOvertimeRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAOvertimeConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAOvertimeDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAOvertimeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 加班申请 Controller
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Tag(name = "管理后台 - OA 加班申请")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/oa/overtime")
|
||||||
|
@Validated
|
||||||
|
public class BpmOAOvertimeController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOAOvertimeService overtimeService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建请求申请")
|
||||||
|
public CommonResult<Long> createOvertime(@Valid @RequestBody BpmOAOvertimeCreateReqVO createReqVO) {
|
||||||
|
|
||||||
|
return success(overtimeService.createOvertime(getLoginUserId(), createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得加班申请")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<BpmOAOvertimeRespVO> getOvertime(@RequestParam("id") Long id) {
|
||||||
|
|
||||||
|
BpmOAOvertimeDO overtime = overtimeService.getOvertime(id);
|
||||||
|
|
||||||
|
return success(BpmOAOvertimeConvert.INSTANCE.convert(overtime));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOARegularConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOARegularService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 转正申请 Controller
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Tag(name = "管理后台 - OA 转正申请")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/oa/regular")
|
||||||
|
@Validated
|
||||||
|
public class BpmOARegularController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOARegularService regularService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建请求申请")
|
||||||
|
public CommonResult<Long> createRegular(@Valid @RequestBody BpmOARegularCreateReqVO createReqVO) {
|
||||||
|
|
||||||
|
return success(regularService.createRegular(getLoginUserId(), createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得转正申请")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<BpmOARegularRespVO> getRegular(@RequestParam("id") Long id) {
|
||||||
|
|
||||||
|
BpmOARegularDO regular = regularService.getRegular(id);
|
||||||
|
|
||||||
|
return success(BpmOARegularConvert.INSTANCE.convert(regular));
|
||||||
|
}
|
||||||
|
}
|
@ -41,7 +41,7 @@ public class BpmOASealController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/get")
|
@GetMapping("/get")
|
||||||
@Operation(summary = "获得请假申请")
|
@Operation(summary = "获得用章申请")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
public CommonResult<BpmOASealRespVO> getSeal(@RequestParam("id") Long id) {
|
public CommonResult<BpmOASealRespVO> getSeal(@RequestParam("id") Long id) {
|
||||||
|
|
||||||
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second.BpmOASecondCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOASecondConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASecondDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASecondService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 借调申请 Controller
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Tag(name = "管理后台 - OA 借调申请")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/oa/second")
|
||||||
|
@Validated
|
||||||
|
public class BpmOASecondController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASecondService service;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建借调申请")
|
||||||
|
public CommonResult<Long> createLeave(@Valid @RequestBody BpmOASecondCreateReqVO createReqVO) {
|
||||||
|
return success(service.createSecond(getLoginUserId(), createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得借调申请")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<?> getLeave(@RequestParam("id") Long id) {
|
||||||
|
BpmOASecondDO second = service.getSecond(id);
|
||||||
|
return success(BpmOASecondConvert.INSTANCE.convert(second));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs.BpmOAShiftjobsCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs.BpmOAShiftjobsRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAShiftjobsConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAShiftjobsDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAShiftjobsService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 调岗申请 Controller
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Tag(name = "管理后台 - OA 调岗申请")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bpm/oa/shiftjobs")
|
||||||
|
@Validated
|
||||||
|
public class BpmOAShiftjobsController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOAShiftjobsService shiftjobsService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建请求申请")
|
||||||
|
public CommonResult<Long> createShiftjobs(@Valid @RequestBody BpmOAShiftjobsCreateReqVO createReqVO) {
|
||||||
|
|
||||||
|
return success(shiftjobsService.createShiftjobs(getLoginUserId(), createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得用章申请")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<BpmOAShiftjobsRespVO> getShiftjobs(@RequestParam("id") Long id) {
|
||||||
|
|
||||||
|
BpmOAShiftjobsDO shiftjobs = shiftjobsService.getShiftjobs(id);
|
||||||
|
|
||||||
|
return success(BpmOAShiftjobsConvert.INSTANCE.convert(shiftjobs));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班申请 创建 Request VO
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 加班申请创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode()
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOAOvertimeCreateReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "加班原因", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "加班事由不能为空")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
@Schema(description = "加班的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "开始时间不能为空")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
@Schema(description = "加班的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "结束时间不能为空")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
@Schema(description = "加班时长", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "加班时长不能为空")
|
||||||
|
private BigDecimal timeLength;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 加班申请 请求Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOAOvertimeRespVO extends BpmOABaseRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "加班原因", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "加班事由不能为空")
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
@Schema(description = "加班的开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "开始时间不能为空")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
@Schema(description = "加班的结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "结束时间不能为空")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
@Schema(description = "加班时长", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "加班时长不能为空")
|
||||||
|
private BigDecimal timeLength;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
}
|
@ -1,7 +1,5 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure;
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.ProcureDetail;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimbursement;
|
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure;
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.ProcureDetail;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure;
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.ProcureDetail;
|
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement;
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
@ -0,0 +1,45 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转正申请 创建 Request VO
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 转正申请创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode()
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOARegularCreateReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "部门不能为空")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "入职时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||||
|
private LocalDate entryDate;
|
||||||
|
|
||||||
|
@Schema(description = "转正时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "转正时间不能为空")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||||
|
private LocalDate confirmationDate;
|
||||||
|
|
||||||
|
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 转正申请 请求Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOARegularRespVO extends BpmOABaseRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "部门不能为空")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
@Schema(description = "入职时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||||
|
private LocalDate entryDate;
|
||||||
|
|
||||||
|
@Schema(description = "转正时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "转正时间不能为空")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||||
|
private LocalDate confirmationDate;
|
||||||
|
|
||||||
|
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
}
|
@ -0,0 +1,39 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借调申请 创建 Request VO
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 借调申请创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode()
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOASecondCreateReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "借调类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "借调类型不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "借调说明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
@Schema(description = "借调明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "借调项目不能为空")
|
||||||
|
private List<Second> seconds;
|
||||||
|
|
||||||
|
@Schema(description = "押金", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long deposit;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems ;
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 借调申请创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOASecondRespVO extends BpmOABaseRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "借调类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "借调类型不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "借调说明", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
@Schema(description = "借调明细", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "借调项目不能为空")
|
||||||
|
private List<Second> seconds;
|
||||||
|
|
||||||
|
@Schema(description = "押金", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long deposit;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems ;
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调岗申请 创建 Request VO
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 调岗申请创建 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode()
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOAShiftjobsCreateReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "调岗类型-参见 bpm_oa_shiftjobs_type 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotNull(message = "调岗类型不能为空")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "原部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "原部门不能为空")
|
||||||
|
private Long oldDeptId;
|
||||||
|
|
||||||
|
@Schema(description = "原上级领导编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long oldParentId;
|
||||||
|
|
||||||
|
@Schema(description = "原岗位编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long oldPostId;
|
||||||
|
|
||||||
|
@Schema(description = "新部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "新部门不能为空")
|
||||||
|
private Long newDeptId;
|
||||||
|
|
||||||
|
@Schema(description = "新上级领导编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long newParentId;
|
||||||
|
|
||||||
|
@Schema(description = "新岗位编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long newPostId;
|
||||||
|
|
||||||
|
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Schema(description = "管理后台 - 调岗申请 请求Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class BpmOAShiftjobsRespVO extends BpmOABaseRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "调岗类型-参见 bpm_oa_shiftjobs_type 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotNull(message = "调岗类型不能为空")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "原部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "原部门不能为空")
|
||||||
|
private Long oldDeptId;
|
||||||
|
|
||||||
|
@Schema(description = "原上级领导编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long oldParentId;
|
||||||
|
|
||||||
|
@Schema(description = "原岗位编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long oldPostId;
|
||||||
|
|
||||||
|
@Schema(description = "新部门编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "新部门不能为空")
|
||||||
|
private Long newDeptId;
|
||||||
|
|
||||||
|
@Schema(description = "新上级领导编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long newParentId;
|
||||||
|
|
||||||
|
@Schema(description = "新岗位编号", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private Long newPostId;
|
||||||
|
|
||||||
|
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime.BpmOAOvertimeCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime.BpmOAOvertimeRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAOvertimeDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班申请 Convert
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOAOvertimeConvert {
|
||||||
|
|
||||||
|
BpmOAOvertimeConvert INSTANCE = Mappers.getMapper(BpmOAOvertimeConvert.class);
|
||||||
|
|
||||||
|
BpmOAOvertimeDO convert(BpmOAOvertimeCreateReqVO bean);
|
||||||
|
|
||||||
|
BpmOAOvertimeRespVO convert(BpmOAOvertimeDO bean);
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转正申请 Convert
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOARegularConvert {
|
||||||
|
|
||||||
|
BpmOARegularConvert INSTANCE = Mappers.getMapper(BpmOARegularConvert.class);
|
||||||
|
|
||||||
|
BpmOARegularDO convert(BpmOARegularCreateReqVO bean);
|
||||||
|
|
||||||
|
BpmOARegularRespVO convert(BpmOARegularDO bean);
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second.BpmOASecondCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second.BpmOASecondRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASecondDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借调申请 Convert
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOASecondConvert {
|
||||||
|
|
||||||
|
BpmOASecondConvert INSTANCE = Mappers.getMapper(BpmOASecondConvert.class);
|
||||||
|
|
||||||
|
BpmOASecondDO convert(BpmOASecondCreateReqVO bean);
|
||||||
|
|
||||||
|
BpmOASecondRespVO convert(BpmOASecondDO bean);
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.convert.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs.BpmOAShiftjobsCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs.BpmOAShiftjobsRespVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAShiftjobsDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
import org.mapstruct.factory.Mappers;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调岗申请 Convert
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOAShiftjobsConvert {
|
||||||
|
|
||||||
|
BpmOAShiftjobsConvert INSTANCE = Mappers.getMapper(BpmOAShiftjobsConvert.class);
|
||||||
|
|
||||||
|
BpmOAShiftjobsDO convert(BpmOAShiftjobsCreateReqVO bean);
|
||||||
|
|
||||||
|
BpmOAShiftjobsRespVO convert(BpmOAShiftjobsDO bean);
|
||||||
|
}
|
@ -0,0 +1,85 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 加班申请 DO
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@TableName(value ="bpm_oa_overtime", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOAOvertimeDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差表单主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
*
|
||||||
|
* 关联 AdminUserDO 的 id 属性
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班事由
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime startTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结束时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班时长
|
||||||
|
*/
|
||||||
|
private BigDecimal timeLength;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差的结果
|
||||||
|
*
|
||||||
|
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||||
|
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||||
|
*/
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应的流程编号
|
||||||
|
*
|
||||||
|
* 关联 ProcessInstance 的 id 属性
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件基本信息
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems ;
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.ProcureDetail;
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.procure.ProcureDetail;
|
||||||
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
@ -0,0 +1,84 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 转正申请 DO
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@TableName(value ="bpm_oa_regular", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOARegularDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差表单主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
*
|
||||||
|
* 关联 AdminUserDO 的 id 属性
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人的部门编号
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入职时间
|
||||||
|
*/
|
||||||
|
private LocalDate entryDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转正时间
|
||||||
|
*/
|
||||||
|
private LocalDate confirmationDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 出差的结果
|
||||||
|
*
|
||||||
|
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||||
|
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||||
|
*/
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应的流程编号
|
||||||
|
*
|
||||||
|
* 关联 ProcessInstance 的 id 属性
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件基本信息
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems ;
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second.Second;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 借调申请 DO
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@TableName(value ="bpm_oa_second", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOASecondDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请假表单主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
* 关联 AdminUserDO 的 id 属性
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借调类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借调说明
|
||||||
|
*/
|
||||||
|
private String reason;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借调明细数据JSON
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<Second> seconds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 押金
|
||||||
|
*/
|
||||||
|
private Long deposit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结果
|
||||||
|
*
|
||||||
|
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||||
|
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||||
|
*/
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应的流程编号
|
||||||
|
*
|
||||||
|
* 关联 ProcessInstance 的 id 属性
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件基本信息
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems;
|
||||||
|
}
|
@ -0,0 +1,103 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 调岗申请 DO
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@TableName(value ="bpm_oa_shiftjobs", autoResultMap = true)
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BpmOAShiftjobsDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调岗表单主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请人的用户编号
|
||||||
|
*
|
||||||
|
* 关联 AdminUserDO 的 id 属性
|
||||||
|
*/
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调岗类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原部门编号
|
||||||
|
*/
|
||||||
|
private Long oldDeptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原上级领导编号
|
||||||
|
*/
|
||||||
|
private Long oldParentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 原岗位编号
|
||||||
|
*/
|
||||||
|
private Long oldPostId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新部门编号
|
||||||
|
*/
|
||||||
|
private Long newDeptId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新上级领导编号
|
||||||
|
*/
|
||||||
|
private Long newParentId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新岗位编号
|
||||||
|
*/
|
||||||
|
private Long newPostId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String notes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用章的结果
|
||||||
|
*
|
||||||
|
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||||
|
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||||
|
*/
|
||||||
|
private Integer result;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对应的流程编号
|
||||||
|
*
|
||||||
|
* 关联 ProcessInstance 的 id 属性
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件基本信息
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||||
|
private List<UploadUserFile> fileItems ;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAOvertimeDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班申请 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOAOvertimeMapper extends BaseMapperX<BpmOAOvertimeDO> {
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转正申请 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOARegularMapper extends BaseMapperX<BpmOARegularDO> {
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASecondDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借调申请 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOASecondMapper extends BaseMapperX<BpmOASecondDO> {
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAShiftjobsDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调岗申请 Mapper
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BpmOAShiftjobsMapper extends BaseMapperX<BpmOAShiftjobsDO> {
|
||||||
|
}
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_CONTRACT_NOT_EXISTS;
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_CASH_NOT_EXISTS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OA 现金支出 Service 实现类
|
* OA 现金支出 Service 实现类
|
||||||
@ -74,7 +74,7 @@ public class BpmOACashServiceImpl extends BpmOABaseService implements BpmOACashS
|
|||||||
|
|
||||||
private void validateLeaveExists(Long id) {
|
private void validateLeaveExists(Long id) {
|
||||||
if (cashMapper.selectById(id) == null) {
|
if (cashMapper.selectById(id) == null) {
|
||||||
throw exception(OA_CONTRACT_NOT_EXISTS);
|
throw exception(OA_CASH_NOT_EXISTS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime.BpmOAOvertimeCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAOvertimeDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加班申请 Service 接口
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
public interface BpmOAOvertimeService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建加班申请
|
||||||
|
*
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createOvertime(Long userId, @Valid BpmOAOvertimeCreateReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新加班申请的状态
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @param result 结果
|
||||||
|
*/
|
||||||
|
void updateOvertimeResult(Long id, Integer result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得加班申请
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 加班申请
|
||||||
|
*/
|
||||||
|
BpmOAOvertimeDO getOvertime(Long id);
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.overtime.BpmOAOvertimeCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAOvertimeConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAOvertimeDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAOvertimeMapper;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_OVERTIME_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 加班申请 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmOAOvertimeServiceImpl extends BpmOABaseService implements BpmOAOvertimeService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 加班对应的流程定义 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "oa_overtime";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOAOvertimeMapper overtimeMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createOvertime(Long userId, BpmOAOvertimeCreateReqVO createReqVO) {
|
||||||
|
|
||||||
|
//插入OA 转正申请
|
||||||
|
BpmOAOvertimeDO overtime = BpmOAOvertimeConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||||
|
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||||
|
overtimeMapper.insert(overtime) ;
|
||||||
|
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||||
|
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(overtime.getId()))).getCheckedData();
|
||||||
|
|
||||||
|
// 将工作流的编号,更新到 OA 加班单中
|
||||||
|
overtimeMapper.updateById(new BpmOAOvertimeDO().setId(overtime.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
|
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||||
|
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
|
if (fileItems != null && !fileItems.isEmpty()) {
|
||||||
|
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||||
|
}
|
||||||
|
return overtime.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOvertimeResult(Long id, Integer result) {
|
||||||
|
|
||||||
|
validateLeaveExists(id);
|
||||||
|
overtimeMapper.updateById(new BpmOAOvertimeDO().setId(id).setResult(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateLeaveExists(Long id) {
|
||||||
|
if (overtimeMapper.selectById(id) == null) {
|
||||||
|
throw exception(OA_OVERTIME_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmOAOvertimeDO getOvertime(Long id) {
|
||||||
|
|
||||||
|
return overtimeMapper.selectById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 转正申请 Service 接口
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
public interface BpmOARegularService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建转正申请
|
||||||
|
*
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createRegular(Long userId, @Valid BpmOARegularCreateReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新转正申请的状态
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @param result 结果
|
||||||
|
*/
|
||||||
|
void updateRegularResult(Long id, Integer result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得转正申请
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 转正申请
|
||||||
|
*/
|
||||||
|
BpmOARegularDO getRegular(Long id);
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOARegularConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOARegularMapper;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_REGULAR_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 转正申请 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmOARegularServiceImpl extends BpmOABaseService implements BpmOARegularService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 转正对应的流程定义 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "oa_regular";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOARegularMapper regularMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createRegular(Long userId, BpmOARegularCreateReqVO createReqVO) {
|
||||||
|
|
||||||
|
//插入OA 转正申请
|
||||||
|
BpmOARegularDO regular = BpmOARegularConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||||
|
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||||
|
regularMapper.insert(regular) ;
|
||||||
|
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||||
|
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(regular.getId()))).getCheckedData();
|
||||||
|
|
||||||
|
// 将工作流的编号,更新到 OA 转正单中
|
||||||
|
regularMapper.updateById(new BpmOARegularDO().setId(regular.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
|
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||||
|
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
|
if (fileItems != null && !fileItems.isEmpty()) {
|
||||||
|
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||||
|
}
|
||||||
|
return regular.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateRegularResult(Long id, Integer result) {
|
||||||
|
|
||||||
|
validateLeaveExists(id);
|
||||||
|
regularMapper.updateById(new BpmOARegularDO().setId(id).setResult(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateLeaveExists(Long id) {
|
||||||
|
if (regularMapper.selectById(id) == null) {
|
||||||
|
throw exception(OA_REGULAR_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmOARegularDO getRegular(Long id) {
|
||||||
|
|
||||||
|
return regularMapper.selectById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -5,6 +5,12 @@ import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASealDO;
|
|||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用章申请 Service 接口
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
public interface BpmOASealService {
|
public interface BpmOASealService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,7 +30,7 @@ import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_SEAL_NOT_E
|
|||||||
public class BpmOASealServiceImpl extends BpmOABaseService implements BpmOASealService {
|
public class BpmOASealServiceImpl extends BpmOABaseService implements BpmOASealService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OA 出差对应的流程定义 KEY
|
* OA 用章对应的流程定义 KEY
|
||||||
*/
|
*/
|
||||||
public static final String PROCESS_KEY = "oa_seal";
|
public static final String PROCESS_KEY = "oa_seal";
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ public class BpmOASealServiceImpl extends BpmOABaseService implements BpmOASealS
|
|||||||
@Override
|
@Override
|
||||||
public Long createSeal(Long userId, BpmOASealCreateReqVO createReqVO) {
|
public Long createSeal(Long userId, BpmOASealCreateReqVO createReqVO) {
|
||||||
|
|
||||||
//插入OA 出差申请
|
//插入OA 用章申请
|
||||||
BpmOASealDO seal = BpmOASealConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
BpmOASealDO seal = BpmOASealConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||||
sealMapper.insert(seal) ;
|
sealMapper.insert(seal) ;
|
||||||
@ -54,7 +54,7 @@ public class BpmOASealServiceImpl extends BpmOABaseService implements BpmOASealS
|
|||||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(seal.getId()))).getCheckedData();
|
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(seal.getId()))).getCheckedData();
|
||||||
|
|
||||||
// 将工作流的编号,更新到 OA 请假单中
|
// 将工作流的编号,更新到 OA 用章单中
|
||||||
sealMapper.updateById(new BpmOASealDO().setId(seal.getId()).setProcessInstanceId(processInstanceId));
|
sealMapper.updateById(new BpmOASealDO().setId(seal.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||||
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second.BpmOASecondCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASecondDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 借调申请 Service 接口
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
public interface BpmOASecondService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建借调申请
|
||||||
|
*
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createSecond(Long userId, @Valid BpmOASecondCreateReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新借调申请的状态
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @param result 结果
|
||||||
|
*/
|
||||||
|
void updateSecondResult(Long id, Integer result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得借调申请
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 借调申请
|
||||||
|
*/
|
||||||
|
BpmOASecondDO getSecond(Long id);
|
||||||
|
}
|
@ -0,0 +1,83 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.second.BpmOASecondCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOASecondConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOASecondDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOASecondMapper;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_SECOND_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
* OA 借调申请 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmOASecondServiceImpl extends BpmOABaseService implements BpmOASecondService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 请假对应的流程定义 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "oa_second";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASecondMapper secondMapper ;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createSecond(Long userId, BpmOASecondCreateReqVO createReqVO) {
|
||||||
|
BpmOASecondDO second = BpmOASecondConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||||
|
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||||
|
secondMapper.insert(second) ;
|
||||||
|
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||||
|
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(second.getId()))).getCheckedData();
|
||||||
|
|
||||||
|
// 将工作流的编号,更新到 OA 请假单中
|
||||||
|
secondMapper.updateById(new BpmOASecondDO().setId(second.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
|
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||||
|
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
|
if (fileItems != null && !fileItems.isEmpty()) {
|
||||||
|
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||||
|
}
|
||||||
|
return second.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSecondResult(Long id, Integer result) {
|
||||||
|
validateLeaveExists(id);
|
||||||
|
secondMapper.updateById(new BpmOASecondDO().setId(id).setResult(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateLeaveExists(Long id) {
|
||||||
|
if (secondMapper.selectById(id) == null) {
|
||||||
|
throw exception(OA_SECOND_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmOASecondDO getSecond(Long id) {
|
||||||
|
|
||||||
|
return secondMapper.selectById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs.BpmOAShiftjobsCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAShiftjobsDO;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 调岗申请 Service 接口
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
public interface BpmOAShiftjobsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建调岗申请
|
||||||
|
*
|
||||||
|
* @param userId 用户编号
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createShiftjobs(Long userId, @Valid BpmOAShiftjobsCreateReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新调岗申请的状态
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @param result 结果
|
||||||
|
*/
|
||||||
|
void updateShiftjobsResult(Long id, Integer result);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得调岗申请
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 调岗申请
|
||||||
|
*/
|
||||||
|
BpmOAShiftjobsDO getShiftjobs(Long id);
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.BpmProcessInstanceApi;
|
||||||
|
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.shiftjobs.BpmOAShiftjobsCreateReqVO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.controller.admin.upload.UploadUserFile;
|
||||||
|
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOAShiftjobsConvert;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAShiftjobsDO;
|
||||||
|
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAShiftjobsMapper;
|
||||||
|
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_SHIFTJOBS_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 调岗申请 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class BpmOAShiftjobsServiceImpl extends BpmOABaseService implements BpmOAShiftjobsService{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 调岗对应的流程定义 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "oa_shiftjobs";
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOAShiftjobsMapper shiftjobsMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmProcessInstanceApi processInstanceApi;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createShiftjobs(Long userId, BpmOAShiftjobsCreateReqVO createReqVO) {
|
||||||
|
|
||||||
|
//插入OA 调岗申请
|
||||||
|
BpmOAShiftjobsDO shiftjobs = BpmOAShiftjobsConvert.INSTANCE.convert(createReqVO).setUserId(userId)
|
||||||
|
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||||
|
shiftjobsMapper.insert(shiftjobs) ;
|
||||||
|
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
String processInstanceId = processInstanceApi.createProcessInstance(userId,
|
||||||
|
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||||
|
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(shiftjobs.getId()))).getCheckedData();
|
||||||
|
|
||||||
|
// 将工作流的编号,更新到 OA 调岗单中
|
||||||
|
shiftjobsMapper.updateById(new BpmOAShiftjobsDO().setId(shiftjobs.getId()).setProcessInstanceId(processInstanceId));
|
||||||
|
|
||||||
|
List<UploadUserFile> fileItems = createReqVO.getFileItems() ;
|
||||||
|
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||||
|
if (fileItems != null && !fileItems.isEmpty()) {
|
||||||
|
uploadBpmFileProcessInstanceId(processInstanceId,fileItems) ;
|
||||||
|
}
|
||||||
|
return shiftjobs.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateShiftjobsResult(Long id, Integer result) {
|
||||||
|
|
||||||
|
validateLeaveExists(id);
|
||||||
|
shiftjobsMapper.updateById(new BpmOAShiftjobsDO().setId(id).setResult(result));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateLeaveExists(Long id) {
|
||||||
|
if (shiftjobsMapper.selectById(id) == null) {
|
||||||
|
throw exception(OA_SHIFTJOBS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BpmOAShiftjobsDO getShiftjobs(Long id) {
|
||||||
|
|
||||||
|
return shiftjobsMapper.selectById(id);
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceRe
|
|||||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashService;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashService;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashServiceImpl;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOACashServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ import javax.annotation.Resource;
|
|||||||
*
|
*
|
||||||
* @author 符溶馨
|
* @author 符溶馨
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class BpmOACashResultListener extends BpmProcessInstanceResultEventListener {
|
public class BpmOACashResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
@Resource
|
@Resource
|
||||||
private BpmOACashService cashService;
|
private BpmOACashService cashService;
|
||||||
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceRe
|
|||||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAContractService;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAContractService;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAContractServiceImpl;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAContractServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ import javax.annotation.Resource;
|
|||||||
*
|
*
|
||||||
* @author 符溶馨
|
* @author 符溶馨
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class BpmOAContractResultListener extends BpmProcessInstanceResultEventListener {
|
public class BpmOAContractResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceRe
|
|||||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAEvectionService;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAEvectionService;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAEvectionServiceImpl;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAEvectionServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ import javax.annotation.Resource;
|
|||||||
*
|
*
|
||||||
* @author 符溶馨
|
* @author 符溶馨
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class BpmOAEvectionResultListener extends BpmProcessInstanceResultEventListener {
|
public class BpmOAEvectionResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAOvertimeService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAOvertimeServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 加班单的结果的监听器实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class BpmOAOvertimeResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOAOvertimeService overtimeService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
return BpmOAOvertimeServiceImpl.PROCESS_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||||
|
overtimeService.updateOvertimeResult(Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceRe
|
|||||||
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASealService;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASealService;
|
||||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASealServiceImpl;
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASealServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -12,6 +13,7 @@ import javax.annotation.Resource;
|
|||||||
*
|
*
|
||||||
* @author 符溶馨
|
* @author 符溶馨
|
||||||
*/
|
*/
|
||||||
|
@Component
|
||||||
public class BpmOASealResultListener extends BpmProcessInstanceResultEventListener {
|
public class BpmOASealResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASecondService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOASecondServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 借调单的结果的监听器实现类
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class BpmOASecondResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOASecondService secondService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
return BpmOASecondServiceImpl.PROCESS_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||||
|
secondService.updateSecondResult(Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.iocoder.yudao.module.bpm.service.oa.listener;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEvent;
|
||||||
|
import cn.iocoder.yudao.module.bpm.framework.bpm.core.event.BpmProcessInstanceResultEventListener;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAShiftjobsService;
|
||||||
|
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAShiftjobsServiceImpl;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* OA 调岗单的结果的监听器实现类
|
||||||
|
*
|
||||||
|
* @author 符溶馨
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class BpmOAShiftjobsResultListener extends BpmProcessInstanceResultEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BpmOAShiftjobsService shiftjobsService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
|
||||||
|
return BpmOAShiftjobsServiceImpl.PROCESS_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||||
|
shiftjobsService.updateShiftjobsResult(Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.service.screendata.ScreenDataService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.annotation.security.PermitAll;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "工厂大屏数据")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/smartfactory/factory-screen-data")
|
||||||
|
@Validated
|
||||||
|
public class FactoryScreenDataController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ScreenDataService screenDataService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param type 1: 省,2 市,3区
|
||||||
|
* @param adcode
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getProvincesData")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏全局省份/省/市工厂数据(包函工厂基本信息)")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<List<ProvincesDataRespVO>> getProvincesData(Integer type, String adcode) {
|
||||||
|
List<ProvincesDataRespVO> provincesDatas = screenDataService.getProvincesData(type,adcode) ;
|
||||||
|
return success(provincesDatas);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getStaffData")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏员工信息数据")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<StaffDataRespVO> getStaffData(Long factoryId) {
|
||||||
|
StaffDataRespVO staffDataRespVO = screenDataService.getStaffData(factoryId) ;
|
||||||
|
return success(staffDataRespVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getPropertyData")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏资产数据")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<PropertyDataRespVO> getPropertyData(Long factoryId) {
|
||||||
|
PropertyDataRespVO propertyDataRespVO = screenDataService.getPropertyData(factoryId) ;
|
||||||
|
return success(propertyDataRespVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getFactoryOperateData")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏工厂运营数据")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<OperateDataRespVO> getFactoryOperateData(Long factoryId) {
|
||||||
|
OperateDataRespVO factoryOperateDataRespVO = screenDataService.getFactoryOperateData(factoryId) ;
|
||||||
|
return success(factoryOperateDataRespVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getFactoryRollData")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏工厂滚动数据")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<FactoryRollDataRespVO> getFactoryRollData() {
|
||||||
|
FactoryRollDataRespVO factoryRollDataRespVO = screenDataService.getFactoryRollData() ;
|
||||||
|
return success(factoryRollDataRespVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getFactoryCamerasData")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏工厂监控视频数据")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<List<FactoryCameraDataRespVO>> getFactoryCamerasData(Long factoryId) {
|
||||||
|
List<FactoryCameraDataRespVO> factoryCameraDatas = screenDataService.getFactoryCamerasData(factoryId) ;
|
||||||
|
return success(factoryCameraDatas);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getFactoryWeatherInfo")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏工厂天气数据")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<FactoryWeatherDataRespVO> getFactoryWeatherInfo(Long factoryId) {
|
||||||
|
return success(screenDataService.getFactoryWeatherInfo(factoryId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏工厂打包线数据
|
||||||
|
* @param type
|
||||||
|
* @param factoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/getFactoryPackLineInfo")
|
||||||
|
@PermitAll
|
||||||
|
@Operation(summary = "大屏工厂打包线数据")
|
||||||
|
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志
|
||||||
|
public CommonResult<List<FactoryPackLineDataRespVO>> getFactoryPackLineInfo(Integer type,Long factoryId ) {
|
||||||
|
return success(screenDataService.getFactoryPackLineInfo(type,factoryId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 工厂摄像头数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class FactoryCameraDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "设备id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "南昌市")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "设别编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "afcbdc00465348918d67518e2294792b")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Schema(description = "设备图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://xx.com/ss.jpg")
|
||||||
|
private String imgUrl ;
|
||||||
|
|
||||||
|
@Schema(description = "推流地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "ws://hik.znkj.ispt.com.cn:559/openUrl/Koe0Kg8")
|
||||||
|
private String streamUrl ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 工厂打包线数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class FactoryPackLineDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "打包线id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private Long packLineId;
|
||||||
|
|
||||||
|
@Schema(description = "规格id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
private String standardsId;
|
||||||
|
|
||||||
|
@Schema(description = "规格标准", requiredMode = Schema.RequiredMode.REQUIRED, example = "800 * 400")
|
||||||
|
private String standards;
|
||||||
|
|
||||||
|
@Schema(description = "打包数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer total;
|
||||||
|
|
||||||
|
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2024-03-04")
|
||||||
|
private String date ;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 工厂基础滚动数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class FactoryRollDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "工厂名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "江西省南昌市第一工厂")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "工厂简称", requiredMode = Schema.RequiredMode.REQUIRED, example = "第一工厂")
|
||||||
|
private String shortName;
|
||||||
|
|
||||||
|
@Schema(description = "城市名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "南昌市")
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
@Schema(description = "员工数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer total;
|
||||||
|
|
||||||
|
@Schema(description = "窑炉数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer kilnTotal;
|
||||||
|
|
||||||
|
@Schema(description = "打包线数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer packLineTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "托盘数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer trayTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "绑带", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer tieTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "叉车数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer forkliftTotal ;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 工厂天气数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class FactoryWeatherDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "工厂ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Long factoryId;
|
||||||
|
|
||||||
|
@Schema(description = "城市编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private String areaCode ;
|
||||||
|
|
||||||
|
@Schema(description = "温度", requiredMode = Schema.RequiredMode.REQUIRED, example = "12.3")
|
||||||
|
private String temperature ;
|
||||||
|
|
||||||
|
@Schema(description = "湿度", requiredMode = Schema.RequiredMode.REQUIRED, example = "68%")
|
||||||
|
private String humidity ;
|
||||||
|
|
||||||
|
@Schema(description = "天气", requiredMode = Schema.RequiredMode.REQUIRED, example = "晴")
|
||||||
|
private String weather ;
|
||||||
|
|
||||||
|
@Schema(description = "日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "晴")
|
||||||
|
private String date ;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,165 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 工厂运营数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class OperateDataRespVO {
|
||||||
|
|
||||||
|
/**今日 **/
|
||||||
|
@Schema(description = "今日出库", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer outboundTotal;
|
||||||
|
|
||||||
|
@Schema(description = "今日入库(打包数-破损)", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer warehouseTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "今日破损", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer wornTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "优等品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100 (优等品,即使打包线打包数量)")
|
||||||
|
private Integer ydpTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "一级品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer yjpTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "合格品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer hgpTotal ;
|
||||||
|
|
||||||
|
/**昨日 **/
|
||||||
|
@Schema(description = "昨日出库", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer outboundTotalYesterday;
|
||||||
|
|
||||||
|
@Schema(description = "昨日入库", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer warehouseTotalYesterday ;
|
||||||
|
|
||||||
|
@Schema(description = "昨日破损", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer wornTotalYesterday ;
|
||||||
|
|
||||||
|
@Schema(description = "优等品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer ydpTotalYesterday ;
|
||||||
|
|
||||||
|
@Schema(description = "一级品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer yjpTotalYesterday ;
|
||||||
|
|
||||||
|
@Schema(description = "合格品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer hgpTotalYesterday ;
|
||||||
|
|
||||||
|
/**本周 **/
|
||||||
|
@Schema(description = "本周出库", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer outboundTotalWeek;
|
||||||
|
|
||||||
|
@Schema(description = "本周入库", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer warehouseTotalWeek ;
|
||||||
|
|
||||||
|
@Schema(description = "本周分检数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer sortingTotalWeek ;
|
||||||
|
|
||||||
|
@Schema(description = "本周破损", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer wornTotalWeek ;
|
||||||
|
|
||||||
|
@Schema(description = "优等品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer ydpTotalWeek ;
|
||||||
|
|
||||||
|
@Schema(description = "一级品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer yjpTotalWeek ;
|
||||||
|
|
||||||
|
@Schema(description = "合格品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer hgpTotalWeek ;
|
||||||
|
|
||||||
|
/**本月 **/
|
||||||
|
@Schema(description = "本月出库", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer outboundTotalMonth;
|
||||||
|
|
||||||
|
@Schema(description = "本月入库", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer warehouseTotalMonth ;
|
||||||
|
|
||||||
|
@Schema(description = "本月分检数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer sortingTotalMonth ;
|
||||||
|
|
||||||
|
@Schema(description = "本月破损", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer wornTotalMonth ;
|
||||||
|
|
||||||
|
@Schema(description = "优等品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer ydpTotalMonth ;
|
||||||
|
|
||||||
|
@Schema(description = "一级品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer yjpTotalMonth ;
|
||||||
|
|
||||||
|
@Schema(description = "合格品", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer hgpTotalMonth ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公式:(今日破损 - 昨日破损) / 昨日破损 * 100% = 环比%
|
||||||
|
*/
|
||||||
|
@Schema(description = "破损环比增长/下降", requiredMode = Schema.RequiredMode.REQUIRED, example = "-12.22%")
|
||||||
|
private String wornQOQ;
|
||||||
|
|
||||||
|
|
||||||
|
DecimalFormat df = new DecimalFormat("#0.00");
|
||||||
|
|
||||||
|
public String setWornQOQ() {
|
||||||
|
double a = getWornTotal() ;
|
||||||
|
double b = getWornTotalYesterday() ;
|
||||||
|
double i = ((a - b) / b ) * 100;
|
||||||
|
this.wornQOQ = df.format(i) ;
|
||||||
|
return wornQOQ;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Schema(description = "优等率", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private String ydl;
|
||||||
|
@Schema(description = "昨日优等率", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private String ydlYesterday;
|
||||||
|
@Schema(description = "本周优等率", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private String ydlWeek;
|
||||||
|
@Schema(description = "本月优等率", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private String ydlMonth;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据type类型, 计划今日,昨日,本周,本月
|
||||||
|
* @param type 1= 今日 2= 昨日 3= 本周 4本月
|
||||||
|
* @param ydpTotal 合格品
|
||||||
|
* @param yjpTotal 一级品
|
||||||
|
* @param hgpTotal 合格品
|
||||||
|
*/
|
||||||
|
public void setYdl(Integer type, Integer ydpTotal, Integer yjpTotal, Integer hgpTotal) {
|
||||||
|
double a = ydpTotal ;
|
||||||
|
double b = ydpTotal + yjpTotal + hgpTotal ;
|
||||||
|
double i = (a / b ) * 100 ;
|
||||||
|
String c = df.format(i) ;
|
||||||
|
switch ( type ) {
|
||||||
|
case 1:
|
||||||
|
this.ydl = c ;
|
||||||
|
break ;
|
||||||
|
case 2:
|
||||||
|
this.ydlYesterday = c ;
|
||||||
|
break ;
|
||||||
|
case 3:
|
||||||
|
this.ydlWeek = c ;
|
||||||
|
break ;
|
||||||
|
case 4:
|
||||||
|
this.ydlMonth = c ;
|
||||||
|
break ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// public static void main(String[] args) {
|
||||||
|
// OperateDataRespVO a = new OperateDataRespVO() ;
|
||||||
|
//
|
||||||
|
// a.setYdl(4, 100, 20,30);
|
||||||
|
//
|
||||||
|
// System.out.println(a.getYdl());
|
||||||
|
// System.out.println(a.getYdlYesterday());
|
||||||
|
// System.out.println(a.getYdlWeek());
|
||||||
|
// System.out.println(a.getYdlMonth());
|
||||||
|
// }
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 资产数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class PropertyDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "窑炉数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer kilnTotal;
|
||||||
|
|
||||||
|
@Schema(description = "打包线数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer packLineTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "托盘数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer trayTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "绑带", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer tieTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "叉车数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private ForkliftInfo forkliftInfo ;
|
||||||
|
|
||||||
|
class ForkliftInfo {
|
||||||
|
@Schema(description = "叉车数", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer forkliftTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "运行中", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer onlineTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "离线", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
|
||||||
|
private Integer outLineTotal ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.factoryinfo.vo.FactoryInfoRespVO;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.factoryinfo.FactoryInfoDO;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 省份工厂数据 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ProvincesDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "区域名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "江西省 or 高安市")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "区域标记点", requiredMode = Schema.RequiredMode.REQUIRED, example = "[114.173355, 22.320048]")
|
||||||
|
private List<Double> center ;
|
||||||
|
|
||||||
|
@Schema(description = "区域标记点oid", requiredMode = Schema.RequiredMode.REQUIRED, example = "[114.134357, 22.377366]")
|
||||||
|
private List<Double> centroid ;
|
||||||
|
|
||||||
|
@Schema(description = "区域代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "810000")
|
||||||
|
private Integer adcode ;
|
||||||
|
|
||||||
|
@Schema(description = "英文名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "jiangxi")
|
||||||
|
private String enName ;
|
||||||
|
|
||||||
|
@Schema(description = "工厂数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||||
|
private Integer value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 只有到第三层 district_id 区县的时候,需要输出工厂ID
|
||||||
|
*/
|
||||||
|
@Schema(description = "工厂Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||||
|
private Long factoryId;
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月05日 13:55
|
||||||
|
*/
|
||||||
|
@Schema(description = "大屏数据 - 工厂员工数据 Response VO")
|
||||||
|
@Data
|
||||||
|
public class StaffDataRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "员工数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||||
|
private Integer total;
|
||||||
|
|
||||||
|
@Schema(description = "男员工", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
|
||||||
|
private Integer maleTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "女员工", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||||
|
private Integer femaleTotal ;
|
||||||
|
|
||||||
|
@Schema(description = "员工信息", requiredMode = Schema.RequiredMode.REQUIRED, example = "阿依塔洪·阿依提巴依 搬运工")
|
||||||
|
private List<StaffInfo> staffInfos ;
|
||||||
|
|
||||||
|
class StaffInfo {
|
||||||
|
@Schema(description = "员工名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "马龙")
|
||||||
|
private String name ;
|
||||||
|
@Schema(description = "岗位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "叉车司机")
|
||||||
|
private String postName ;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.framework.util;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.apache.http.client.methods.*;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author qun.xu
|
||||||
|
* @version 1.0.0
|
||||||
|
* @date 2019.03.28
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class HttpUtil {
|
||||||
|
/**
|
||||||
|
* GET请求 带头部信息
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param headers
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String doGetSetHeader(String url, Map<String, String> headers) {
|
||||||
|
try {
|
||||||
|
CloseableHttpClient httpClient = HttpClients.createDefault();
|
||||||
|
HttpGet request = new HttpGet(url);
|
||||||
|
headers.forEach((k, v) -> request.setHeader(k, v));
|
||||||
|
HttpResponse response = httpClient.execute(request);
|
||||||
|
return EntityUtils.toString(response.getEntity(), "UTF-8");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.screendata;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏数据 Service 接口
|
||||||
|
*
|
||||||
|
* @author 姚君
|
||||||
|
*/
|
||||||
|
public interface ScreenDataService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏全局省份/省/市工厂数据
|
||||||
|
* adcode是null,就查询全部省份数据
|
||||||
|
* @param adcode 省/市/区编码
|
||||||
|
* @return 显示数据
|
||||||
|
*/
|
||||||
|
List<ProvincesDataRespVO> getProvincesData(Integer type, String adcode) ;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询员工数据
|
||||||
|
* factoryId是null,查询所有工厂员工数据
|
||||||
|
* @param factoryId 工厂ID ,
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
StaffDataRespVO getStaffData(Long factoryId) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询资产数据
|
||||||
|
* @param factoryId
|
||||||
|
* factoryId是null,查询所有工厂资产数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PropertyDataRespVO getPropertyData(Long factoryId) ;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工厂运营数据
|
||||||
|
* @param factoryId
|
||||||
|
* factoryId是null,查询所有工厂运营数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
OperateDataRespVO getFactoryOperateData(Long factoryId) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏工厂滚屏数据查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FactoryRollDataRespVO getFactoryRollData() ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工厂监控设备集合
|
||||||
|
* @param factoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FactoryCameraDataRespVO> getFactoryCamerasData(Long factoryId) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工厂对应城市的天气数据
|
||||||
|
* @param factoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FactoryWeatherDataRespVO getFactoryWeatherInfo(Long factoryId) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据类型获取工厂打包线数据
|
||||||
|
* @param type 1= 今日 2= 本周
|
||||||
|
* @param factoryId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FactoryPackLineDataRespVO> getFactoryPackLineInfo(Integer type,Long factoryId) ;
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package cn.iocoder.yudao.module.smartfactory.service.screendata;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSON;
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.controller.screendata.factory.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.smartfactory.framework.util.HttpUtil;
|
||||||
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 功能描述
|
||||||
|
*
|
||||||
|
* @author: yj
|
||||||
|
* @date: 2024年03月06日 11:54
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ScreenDataServiceImpl implements ScreenDataService{
|
||||||
|
@Override
|
||||||
|
public List<ProvincesDataRespVO> getProvincesData(Integer type,String adcode) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StaffDataRespVO getStaffData(Long factoryId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PropertyDataRespVO getPropertyData(Long factoryId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OperateDataRespVO getFactoryOperateData(Long factoryId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FactoryRollDataRespVO getFactoryRollData() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FactoryCameraDataRespVO> getFactoryCamerasData(Long factoryId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static final String WEATHER_URL = "https://d1.weather.com.cn/sk_2d/";
|
||||||
|
private static final String REFERER = "referer";
|
||||||
|
private static final String REFERER_URL = "http://www.weather.com.cn/";
|
||||||
|
private static final String WEATHER_SPLIT = "dataSK=";
|
||||||
|
|
||||||
|
public FactoryWeatherDataRespVO getFactoryWeatherInfo(Long factoryId) {
|
||||||
|
//根据factoryId 查询areaCode;
|
||||||
|
String areaCode = "101190101" ;
|
||||||
|
String url = WEATHER_URL + areaCode + ".html";
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
headers.put(REFERER, REFERER_URL);
|
||||||
|
String result = HttpUtil.doGetSetHeader(url, headers);
|
||||||
|
String[] str = result.split(WEATHER_SPLIT);
|
||||||
|
if(str.length > 1) {
|
||||||
|
FactoryWeatherDataRespVO vo = new FactoryWeatherDataRespVO();
|
||||||
|
JSONObject jsonObject = JSONUtil.parseObj(str[1]) ;
|
||||||
|
vo.setFactoryId(factoryId);
|
||||||
|
vo.setAreaCode(areaCode) ;
|
||||||
|
vo.setTemperature(jsonObject.getStr("temp")) ; //温度
|
||||||
|
vo.setHumidity(jsonObject.getStr("sd")); //湿度
|
||||||
|
vo.setWeather(jsonObject.getStr("weather")) ; //天气
|
||||||
|
vo.setDate(jsonObject.getStr("date")); //日期
|
||||||
|
return vo ;
|
||||||
|
}else {
|
||||||
|
return null ;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<FactoryPackLineDataRespVO> getFactoryPackLineInfo(Integer type, Long factoryId) {
|
||||||
|
return null ;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user