Merge branch 'dev' of http://git.znkjfw.com/ak/zn-cloud into dev-假期设置
This commit is contained in:
commit
1e51d4299d
@ -13,4 +13,15 @@ public class PageUtils {
|
||||
return (pageParam.getPageNo() - 1) * pageParam.getPageSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据当前页面,判断是否还有下一页
|
||||
* @param total
|
||||
* @param pageParam
|
||||
* @return
|
||||
*/
|
||||
public static boolean hasNextPage(int total, PageParam pageParam) {
|
||||
int totalPages = (total + pageParam.getPageSize() - 1) / pageParam.getPageSize();
|
||||
return pageParam.getPageNo() < totalPages;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 47.97.8.94:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
discovery:
|
||||
namespace: prod # 命名空间。这里使用 prod 生产环境环境
|
||||
|
||||
@ -14,7 +14,7 @@ spring:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: 47.97.8.94:8848 # Nacos 服务器地址
|
||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||
namespace: prod # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
|
@ -37,6 +37,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode OA_ENTRY_NOT_EXISTS = new ErrorCode(1_009_001_111, "入职申请不存在");
|
||||
ErrorCode OA_GOOut_NOT_EXISTS = new ErrorCode(1_009_001_112, "外出申请不存在");
|
||||
ErrorCode OA_SALARY_NOT_EXISTS = new ErrorCode(1_009_001_113, "薪资付款申请不存在");
|
||||
ErrorCode OA_ASSET_NOT_EXISTS = new ErrorCode(1_009_001_114, "资产申领不存在");
|
||||
|
||||
// ========== 流程模型 1-009-002-000 ==========
|
||||
ErrorCode MODEL_KEY_EXISTS = new ErrorCode(1_009_002_000, "已经存在流程标识为【{}】的流程");
|
||||
|
@ -41,14 +41,12 @@ public class FinancialPaymentController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建财务支付子表")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:create')")
|
||||
public CommonResult<Long> createFinancialPayment(@Valid @RequestBody FinancialPaymentSaveVO vo) {
|
||||
return success(financialPaymentService.createFinancialPayment(vo));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新财务支付管理")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:update')")
|
||||
public CommonResult<Boolean> updateFinancialPayment(@Valid @RequestBody FinancialPaymentSaveReqVO updateReqVO) {
|
||||
financialPaymentService.updateFinancialPayment(updateReqVO);
|
||||
return success(true);
|
||||
@ -71,7 +69,6 @@ public class FinancialPaymentController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除财务支付管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:delete')")
|
||||
public CommonResult<Boolean> deleteFinancialPayment(@RequestParam("id") Long id) {
|
||||
financialPaymentService.deleteFinancialPayment(id);
|
||||
return success(true);
|
||||
@ -80,7 +77,6 @@ public class FinancialPaymentController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得财务支付管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:query')")
|
||||
public CommonResult<FinancialPaymentRespVO> getFinancialPayment(@RequestParam("id") Long id) {
|
||||
FinancialPaymentDO financialPayment = financialPaymentService.getFinancialPayment(id);
|
||||
FinancialPaymentRespVO vo = BeanUtils.toBean(financialPayment, FinancialPaymentRespVO.class);
|
||||
@ -105,7 +101,6 @@ public class FinancialPaymentController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得财务支付管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('bpm:financial-payment:query')")
|
||||
public CommonResult<PageResult<FinancialPaymentRespVO>> getFinancialPaymentPage(@Valid FinancialPaymentPageReqVO pageReqVO) {
|
||||
PageResult<FinancialPaymentDO> pageResult = financialPaymentService.getFinancialPaymentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, FinancialPaymentRespVO.class));
|
||||
|
@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim.BpmOAAssetClaimCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim.BpmOAAssetClaimRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAAssetClaimDO;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAAssetClaimService;
|
||||
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;
|
||||
|
||||
@Tag(name = "管理后台 - OA 资金申领")
|
||||
@RestController
|
||||
@RequestMapping("/bpm/oa/assetClaim")
|
||||
@Validated
|
||||
public class BpmOAAssetClaimController {
|
||||
|
||||
@Resource
|
||||
private BpmOAAssetClaimService assetClaimService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createAssetClaim(@Valid @RequestBody BpmOAAssetClaimCreateReqVO createReqVO) {
|
||||
|
||||
return success(assetClaimService.createAssetClaim(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得资金申领申请")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAAssetClaimRespVO> getAssetClaim(@RequestParam("id") Long id) {
|
||||
|
||||
BpmOAAssetClaimDO assetClaimDO = assetClaimService.getAssetClaim(id);
|
||||
|
||||
return success(BeanUtils.toBean(assetClaimDO, BpmOAAssetClaimRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@Operation(summary = "获得资金申领申请")
|
||||
@Parameter(name = "processInstanceId", description = "流程实例编号", required = true, example = "1024")
|
||||
public CommonResult<BpmOAAssetClaimRespVO> getAssetClaimByProcessInstanceId(@RequestParam("processInstanceId") String processInstanceId) {
|
||||
|
||||
BpmOAAssetClaimDO assetClaimDO = assetClaimService.getByProcessInstanceId(processInstanceId);
|
||||
|
||||
return success(BeanUtils.toBean(assetClaimDO, BpmOAAssetClaimRespVO.class));
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.evection.BpmOAEvectionRespVO;
|
||||
@ -16,8 +17,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
/**
|
||||
@ -54,9 +57,9 @@ public class BpmOAEvectionController {
|
||||
|
||||
BpmOAEvectionRespVO respVO = BpmOAEvectionConvert.INSTANCE.convert(evection);
|
||||
|
||||
if (evection.getTogetherUserId() != null) {
|
||||
AdminUserRespDTO userRespDTO = userApi.getUser(evection.getTogetherUserId()).getCheckedData();
|
||||
respVO.setTogetherUserName(userRespDTO.getNickname());
|
||||
if (CollectionUtil.isNotEmpty(evection.getTogetherUserIds())) {
|
||||
List<AdminUserRespDTO> userRespDTOs = userApi.getUserList(respVO.getTogetherUserIds()).getCheckedData();
|
||||
respVO.setTogetherUserName(String.join("、", convertList(userRespDTOs, AdminUserRespDTO::getNickname)));
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
@ -71,9 +74,9 @@ public class BpmOAEvectionController {
|
||||
|
||||
BpmOAEvectionRespVO respVO = BpmOAEvectionConvert.INSTANCE.convert(evection);
|
||||
|
||||
if (evection.getTogetherUserId() != null) {
|
||||
AdminUserRespDTO userRespDTO = userApi.getUser(evection.getTogetherUserId()).getCheckedData();
|
||||
respVO.setTogetherUserName(userRespDTO.getNickname());
|
||||
if (CollectionUtil.isNotEmpty(evection.getTogetherUserIds())) {
|
||||
List<AdminUserRespDTO> userRespDTOs = userApi.getUserList(evection.getTogetherUserIds()).getCheckedData();
|
||||
respVO.setTogetherUserName(String.join("、", convertList(userRespDTOs, AdminUserRespDTO::getNickname)));
|
||||
}
|
||||
|
||||
return success(respVO);
|
||||
|
@ -42,6 +42,10 @@ public class BpmOASalaryController {
|
||||
@Operation(summary = "创建请求申请")
|
||||
public CommonResult<Long> createSalary(@Valid @RequestBody BpmOASalaryCreateReqVO createReqVO) {
|
||||
|
||||
if (createReqVO.getFactoryId() != null) {
|
||||
DeptRespDTO dto = deptApi.getDeptByFactoryId(createReqVO.getFactoryId()).getCheckedData();
|
||||
createReqVO.setCompanyDeptId(dto.getId());
|
||||
}
|
||||
return success(salaryService.createSalary(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@ -51,9 +55,18 @@ public class BpmOASalaryController {
|
||||
public CommonResult<BpmOASalaryRespVO> getSalary(@RequestParam("id") Long id) {
|
||||
|
||||
BpmOASalaryDO salary = salaryService.getSalary(id);
|
||||
if (salary == null) {
|
||||
return success(new BpmOASalaryRespVO());
|
||||
}
|
||||
|
||||
return success(BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(getDept(salary.getCompanyDeptId()).getName()));
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
|
||||
BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(dto.getName())
|
||||
.setFactoryId(dto.getFactoryId());
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/getByProcessInstanceId")
|
||||
@ -63,8 +76,14 @@ public class BpmOASalaryController {
|
||||
|
||||
BpmOASalaryDO salary = salaryService.getByProcessInstanceId(processInstanceId);
|
||||
|
||||
return success(BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(getDept(salary.getCompanyDeptId()).getName()));
|
||||
// 获取部门详情
|
||||
DeptRespDTO dto = getDept(salary.getCompanyDeptId());
|
||||
|
||||
BpmOASalaryRespVO respVO = BpmOASalaryConvert.INSTANCE.convert(salary)
|
||||
.setCompanyName(dto.getName())
|
||||
.setFactoryId(dto.getFactoryId());
|
||||
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,6 +78,14 @@ public class BpmOASupplierProcurementPlanController {
|
||||
return success(BeanUtils.toBean(pageResult, BpmOASupplierProcurementPlanRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getPlanItem")
|
||||
@Operation(summary = "获得供应商采购计划商品列表")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<List<BpmOASupplierProcurementPlanItemRespVO>> getPlanItem(@RequestParam("id") Long id) {
|
||||
List<BpmOASupplierProcurementPlanItemDO> items = oaSupplierProcurementPlanItemService.getByProcurementPlanId(id);
|
||||
List<BpmOASupplierProcurementPlanItemRespVO> itemVos = BeanUtils.toBean(items, BpmOASupplierProcurementPlanItemRespVO.class);
|
||||
return success(itemVos);
|
||||
}
|
||||
|
||||
@GetMapping("/getListBySupplierId")
|
||||
@Operation(summary = "根据供应商id获取采购计划列表")
|
||||
|
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.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 BpmOAAssetClaimCreateReqVO {
|
||||
|
||||
@Schema(description = "收款人信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销总金额不能为空")
|
||||
private Long assetsTypeId;
|
||||
|
||||
@Schema(description = "现金支出明细")
|
||||
private Integer num;
|
||||
|
||||
@Schema(description = "单位")
|
||||
private String util;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "状态-参见 bpm_process_instance_result 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.BpmOABaseRespVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.cash.Cash;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Schema(description = "管理后台 - 现金支出 请求Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class BpmOAAssetClaimRespVO extends BpmOABaseRespVO {
|
||||
|
||||
@Schema(description = "收款人信息")
|
||||
private Long assetsTypeId;
|
||||
|
||||
@Schema(description = "现金支出明细")
|
||||
private List<Cash> num;
|
||||
|
||||
@Schema(description = "报销总金额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "报销总金额不能为空")
|
||||
private BigDecimal util;
|
||||
|
||||
@Schema(description = "上传文件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -11,6 +11,7 @@ import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ -30,7 +31,7 @@ public class BpmOAEvectionCreateReqVO {
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "随行人用户编号")
|
||||
private Long togetherUserId;
|
||||
private Set<Long> togetherUserIds;
|
||||
|
||||
@Schema(description = "出差起点", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "出差起点不能为空")
|
||||
|
@ -12,6 +12,7 @@ import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ -29,7 +30,7 @@ public class BpmOAEvectionRespVO extends BpmOABaseRespVO {
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "随行人用户编号")
|
||||
private Long togetherUserId;
|
||||
private Set<Long> togetherUserIds;
|
||||
|
||||
@Schema(description = "随行人用户名称")
|
||||
private String togetherUserName;
|
||||
|
@ -37,6 +37,10 @@ public class BpmOARegularCreateReqVO {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate confirmationDate;
|
||||
|
||||
@Schema(description = "期望转正时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate desireDate;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String notes;
|
||||
|
||||
|
@ -36,6 +36,10 @@ public class BpmOARegularRespVO extends BpmOABaseRespVO {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate confirmationDate;
|
||||
|
||||
@Schema(description = "期望转正时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate desireDate;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
|
||||
private String notes;
|
||||
|
||||
|
@ -5,15 +5,11 @@ 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.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
/**
|
||||
* 薪资付款申请 创建 Request VO
|
||||
*
|
||||
@ -29,10 +25,12 @@ public class BpmOASalaryCreateReqVO {
|
||||
@NotNull(message = "申请原因不能为空")
|
||||
private String reason;
|
||||
|
||||
@Schema(description = "付款公司", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "付款公司不能为空")
|
||||
@Schema(description = "付款公司")
|
||||
private Long companyDeptId;
|
||||
|
||||
@Schema(description = "付款工厂编号")
|
||||
private Long factoryId;
|
||||
|
||||
@Schema(description = "付款总额", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "付款总额不能为空")
|
||||
private BigDecimal paymentTotal;
|
||||
|
@ -6,15 +6,10 @@ 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.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
/**
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@ -33,6 +28,9 @@ public class BpmOASalaryRespVO extends BpmOABaseRespVO {
|
||||
@Schema(description = "付款公司名称")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "付款工厂")
|
||||
private Long FactoryId;
|
||||
|
||||
@Schema(description = "付款总额")
|
||||
private BigDecimal paymentTotal;
|
||||
|
||||
|
@ -48,6 +48,9 @@ public class BpmOASupplierProcurementPlanPageReqVO extends PageParam {
|
||||
@Schema(description = "是否上传凭证 0否 1是")
|
||||
private Integer certificateFlag;
|
||||
|
||||
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
|
||||
private Integer assignedFlag;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
@ -17,6 +17,9 @@ public class BpmOASupplierProcurementPlanReqVO {
|
||||
@Schema(description = "供应商id", example = "123")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
|
||||
private Integer assignedFlag;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "5984")
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -41,6 +41,9 @@ public class BpmOASupplierProcurementPlanRespVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
|
||||
private Integer assignedFlag;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "5984")
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -42,6 +42,9 @@ public class BpmOASupplierProcurementPlanSaveReqVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否已分配到资产中 0否 1是", example = "5984")
|
||||
private Integer assignedFlag;
|
||||
|
||||
@Schema(description = "流程实例的编号", example = "5984")
|
||||
private String processInstanceId;
|
||||
|
||||
|
@ -18,7 +18,6 @@ public class BpmOASupplierPurchasePaymentSaveReqVO {
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "申请人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "14357")
|
||||
@NotNull(message = "申请人的用户编号不能为空")
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "供应商id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13580")
|
||||
|
@ -198,4 +198,13 @@ public class BpmTaskController {
|
||||
|
||||
return success(taskService.getTaskListByProcessInstanceIds(historyProcessInstanceIds));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("getCurrentToDoProcessInstacePreAndNex-page")
|
||||
@Operation(summary = "获取当前待处理流程实例(带查询条件),上一个流程和下一个流程的实例ID")
|
||||
public CommonResult<Map<String,String>> getCurrentToDoProcessInstacePreAndNex(@RequestParam("processInstanceId") String processInstanceId,@Valid BpmTaskTodoPageReqVO pageVO) {
|
||||
return success(taskService.getCurrentToDoProcessInstacePreAndNex(getLoginUserId(), processInstanceId, pageVO));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@ -61,4 +62,7 @@ public class BpmProcessInstancePageItemRespVO {
|
||||
private String userName ;
|
||||
}
|
||||
|
||||
@Schema(description = "业务表字段信息", example = "报销总金额:999.11,开户行信息:银行卡,收款人卡号:1234567")
|
||||
private String detailInfo ;
|
||||
|
||||
}
|
||||
|
@ -55,6 +55,10 @@ public interface BpmProcessInstanceConvert {
|
||||
Map<String, List<Task>> taskMap,
|
||||
Map<Long, AdminUserRespDTO> userMap ) {
|
||||
List<BpmProcessInstancePageItemRespVO> list = convertList(page.getList());
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
BpmProcessInstancePageItemRespVO vo = list.get(i) ;
|
||||
vo.setDetailInfo(page.getList().get(i).getDetailInfo()) ;
|
||||
}
|
||||
list.forEach(respVO -> respVO.setTasks(convertList2(taskMap.get(respVO.getId()),userMap)));
|
||||
return new PageResult<>(list, page.getTotal());
|
||||
}
|
||||
@ -96,6 +100,7 @@ public interface BpmProcessInstanceConvert {
|
||||
String bpmnXml, AdminUserRespDTO startUser, DeptRespDTO dept) {
|
||||
BpmProcessInstanceRespVO respVO = convert2(processInstance);
|
||||
copyTo(processInstanceExt, respVO);
|
||||
respVO.setBusinessKey(processInstance.getBusinessKey()) ;
|
||||
// definition
|
||||
respVO.setProcessDefinition(convert2(processDefinition));
|
||||
copyTo(processDefinitionExt, respVO.getProcessDefinition());
|
||||
|
@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
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_asset_claim", autoResultMap = true)
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class BpmOAAssetClaimDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 出差表单主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
* 关联 AdminUserDO 的 id 属性
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 资产类型编号
|
||||
*/
|
||||
private Long assetsTypeId;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private Integer num;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String util;
|
||||
|
||||
/**
|
||||
* 申请事由
|
||||
*/
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 用章的结果
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}、
|
||||
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||
*/
|
||||
private Integer result;
|
||||
|
||||
/**
|
||||
* 对应的流程编号
|
||||
* 关联 ProcessInstance 的 id 属性
|
||||
*/
|
||||
private String processInstanceId;
|
||||
|
||||
/**
|
||||
* 附件基本信息
|
||||
*/
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<UploadUserFile> fileItems;
|
||||
}
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.bpm.dal.dataobject.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.type.JsonLongSetTypeHandler;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
@ -12,6 +13,7 @@ import lombok.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* OA 出差申请 DO
|
||||
@ -48,9 +50,10 @@ public class BpmOAEvectionDO extends BaseDO {
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 随行人用户编号
|
||||
* 随行人用户编号组
|
||||
*/
|
||||
private Long togetherUserId;
|
||||
@TableField(typeHandler = JsonLongSetTypeHandler.class)
|
||||
private Set<Long> togetherUserIds;
|
||||
|
||||
/**
|
||||
* 出差地点 起点
|
||||
|
@ -36,7 +36,6 @@ public class BpmOARegularDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 申请人的用户编号
|
||||
*
|
||||
* 关联 AdminUserDO 的 id 属性
|
||||
*/
|
||||
private Long userId;
|
||||
@ -56,13 +55,18 @@ public class BpmOARegularDO extends BaseDO {
|
||||
*/
|
||||
private LocalDate confirmationDate;
|
||||
|
||||
/**
|
||||
* 期望转正时间
|
||||
*/
|
||||
private LocalDate desireDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String notes;
|
||||
|
||||
/**
|
||||
* 出差的结果
|
||||
* 结果
|
||||
*
|
||||
* 枚举 {@link BpmProcessInstanceResultEnum}
|
||||
* 考虑到简单,所以直接复用了 BpmProcessInstanceResultEnum 枚举,也可以自己定义一个枚举哈
|
||||
|
@ -70,6 +70,10 @@ public class BpmOASupplierProcurementPlanDO extends BaseDO {
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否已分配到资产中 0否 1是
|
||||
*/
|
||||
private Integer assignedFlag;
|
||||
/**
|
||||
* 流程实例的编号
|
||||
*/
|
||||
|
@ -93,4 +93,27 @@ public class BpmProcessInstanceExtDO extends BaseDO {
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private Map<String, Object> formVariables;
|
||||
|
||||
/**
|
||||
* 流程业务主键ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String businessKey ;
|
||||
|
||||
/**
|
||||
* 当前流程实例对应的表名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String tableName ;
|
||||
|
||||
/**
|
||||
* 当前流程实例在我的流程列表中需要显示的字段中英文
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String fieldNames ;
|
||||
|
||||
/**
|
||||
* 当前流程实例在我的流程列表中需要显示的转换后的数据
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String detailInfo ;
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
package cn.iocoder.yudao.module.bpm.dal.mysql;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 功能描述
|
||||
*
|
||||
* @author: yj
|
||||
* @date: 2024年09月24日 12:10
|
||||
*/
|
||||
@Mapper
|
||||
public interface DynamicMapper extends BaseMapperX<Object> {
|
||||
|
||||
@Select("${SQL}")
|
||||
Map<String,String> selectListByTableName(@Param("SQL")String sql);
|
||||
}
|
@ -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.BpmOAAssetClaimDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 资产申领 Mapper
|
||||
*
|
||||
* @author 符溶馨
|
||||
|
||||
*/
|
||||
@Mapper
|
||||
public interface BpmOAAssetClaimMapper extends BaseMapperX<BpmOAAssetClaimDO> {
|
||||
}
|
@ -3,13 +3,18 @@ package cn.iocoder.yudao.module.bpm.dal.mysql.task;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.instance.*;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmProcessDefinitionExtDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
@Mapper
|
||||
public interface BpmProcessInstanceExtMapper extends BaseMapperX<BpmProcessInstanceExtDO> {
|
||||
|
||||
@ -30,9 +35,34 @@ public interface BpmProcessInstanceExtMapper extends BaseMapperX<BpmProcessInsta
|
||||
}
|
||||
|
||||
default PageResult<BpmProcessInstanceExtDO> selectPage(Long userId, BpmProcessInstanceMyPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessInstanceExtDO>()
|
||||
//只能查询流程标识定义为oa开头的流程
|
||||
.likeIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, "oa_")
|
||||
// return selectPage(reqVO, new LambdaQueryWrapperX<BpmProcessInstanceExtDO>()
|
||||
// //只能查询流程标识定义为oa开头的流程
|
||||
// .likeIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, "oa_")
|
||||
// .eqIfPresent(BpmProcessInstanceExtDO::getStartUserId, userId)
|
||||
// .likeIfPresent(BpmProcessInstanceExtDO::getName, reqVO.getName())
|
||||
// .eqIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, reqVO.getProcessDefinitionId())
|
||||
// .eqIfPresent(BpmProcessInstanceExtDO::getCategory, reqVO.getCategory())
|
||||
// .eqIfPresent(BpmProcessInstanceExtDO::getStatus, reqVO.getStatus())
|
||||
// .eqIfPresent(BpmProcessInstanceExtDO::getResult, reqVO.getResult())
|
||||
// .betweenIfPresent(BpmProcessInstanceExtDO::getCreateTime, reqVO.getCreateTime())
|
||||
// .orderByDesc(BpmProcessInstanceExtDO::getId));
|
||||
Long tenantId = TenantContextHolder.getTenantId() ;
|
||||
MPJLambdaWrapperX<BpmProcessInstanceExtDO> queryWrapper = new MPJLambdaWrapperX<>();
|
||||
queryWrapper.selectAll(BpmProcessInstanceExtDO.class);
|
||||
queryWrapper.selectAs("b.BUSINESS_KEY_", BpmProcessInstanceExtDO::getBusinessKey);
|
||||
queryWrapper.selectAs("d.name", BpmProcessInstanceExtDO::getTableName);
|
||||
queryWrapper.selectAs("d.field_names", BpmProcessInstanceExtDO::getFieldNames);
|
||||
queryWrapper.leftJoin(BpmProcessDefinitionExtDO.class,"e", on -> on.
|
||||
eq(BpmProcessDefinitionExtDO::getProcessDefinitionId,
|
||||
BpmProcessInstanceExtDO::getProcessDefinitionId)) ;
|
||||
//通过流程定义的关联业务配置表单ID,获取业务表,需要显示的中文名及英文字段
|
||||
queryWrapper.leftJoin("bpm_business_table_info d on e.business_table_info_id = d.id") ;
|
||||
//通过流程实例ID 获取流程业务主键ID
|
||||
queryWrapper.leftJoin("ACT_HI_PROCINST b on b.PROC_INST_ID_ = t.process_instance_id") ;
|
||||
//通过流程业务主键ID 查询对应的业务表,获取业务数据 业务表名,是通过流程定义获取
|
||||
//queryWrapper.leftJoin("(select * from ( select name from bpm_business_table_info where id = e.business_table_info_id ) ) c on b.BUSINESS_KEY_ = c.id") ;
|
||||
queryWrapper.eq("t.TENANT_ID", tenantId);
|
||||
queryWrapper.likeIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, "oa_")
|
||||
.eqIfPresent(BpmProcessInstanceExtDO::getStartUserId, userId)
|
||||
.likeIfPresent(BpmProcessInstanceExtDO::getName, reqVO.getName())
|
||||
.eqIfPresent(BpmProcessInstanceExtDO::getProcessDefinitionId, reqVO.getProcessDefinitionId())
|
||||
@ -40,7 +70,8 @@ public interface BpmProcessInstanceExtMapper extends BaseMapperX<BpmProcessInsta
|
||||
.eqIfPresent(BpmProcessInstanceExtDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(BpmProcessInstanceExtDO::getResult, reqVO.getResult())
|
||||
.betweenIfPresent(BpmProcessInstanceExtDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(BpmProcessInstanceExtDO::getId));
|
||||
.orderByDesc(BpmProcessInstanceExtDO::getId) ;
|
||||
return selectJoinPage(reqVO, BpmProcessInstanceExtDO.class, queryWrapper);
|
||||
}
|
||||
|
||||
default BpmProcessInstanceExtDO selectByProcessInstanceId(String processInstanceId) {
|
||||
|
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.bpm.framework.util;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 功能描述
|
||||
*
|
||||
* @author: yj
|
||||
* @date: 2024年09月25日 18:53
|
||||
*/
|
||||
@Data
|
||||
public class PaginationResult {
|
||||
//上一个
|
||||
private String previousId;
|
||||
//当前
|
||||
private String currentId;
|
||||
//下一个
|
||||
private String nextId;
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim.BpmOAAssetClaimCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAAssetClaimDO;
|
||||
|
||||
public interface BpmOAAssetClaimService {
|
||||
|
||||
/**
|
||||
* 创建请求申请
|
||||
* @param userId 用户id
|
||||
* @param createReqVO 创建信息
|
||||
* @return 创建的申请id
|
||||
*/
|
||||
Long createAssetClaim(Long userId, BpmOAAssetClaimCreateReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 获得资产申领申请
|
||||
* @param id id
|
||||
* @return 资产申领申请
|
||||
*/
|
||||
BpmOAAssetClaimDO getAssetClaim(Long id);
|
||||
|
||||
/**
|
||||
* 获得资产申领申请
|
||||
* @param processInstanceId 流程实例编号
|
||||
* @return 资产申领申请
|
||||
*/
|
||||
BpmOAAssetClaimDO getByProcessInstanceId(String processInstanceId);
|
||||
|
||||
/**
|
||||
* 更新资产申领的状态
|
||||
*
|
||||
* @param id 编号
|
||||
* @param result 结果
|
||||
*/
|
||||
void updateAssetClaimResult(String processInstanceId, Long id, Integer result);
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.bpm.api.task.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.assetClaim.BpmOAAssetClaimCreateReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAAssetClaimDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOAAssetClaimMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
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_ASSET_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* OA 资产申领 Service 实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BpmOAAssetClaimServiceImpl extends BpmOABaseService implements BpmOAAssetClaimService{
|
||||
|
||||
/**
|
||||
* OA 资产申领对应的流程定义 KEY
|
||||
*/
|
||||
public static final String PROCESS_KEY = "oa_asset_claim_2";
|
||||
|
||||
@Resource
|
||||
private BpmOAAssetClaimMapper assetClaimMapper;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService processInstanceService;
|
||||
|
||||
@Resource
|
||||
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||
|
||||
@Override
|
||||
public Long createAssetClaim(Long userId, BpmOAAssetClaimCreateReqVO createReqVO) {
|
||||
|
||||
//插入OA 现金支出申请
|
||||
BpmOAAssetClaimDO assetClaim = BeanUtils.toBean(createReqVO, BpmOAAssetClaimDO.class).setUserId(userId)
|
||||
.setResult(BpmProcessInstanceResultEnum.PROCESS.getResult());
|
||||
assetClaimMapper.insert(assetClaim);
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
String processInstanceId = processInstanceService.createProcessInstance(userId,
|
||||
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(PROCESS_KEY)
|
||||
.setVariables(processInstanceVariables).setBusinessKey(String.valueOf(assetClaim.getId())));
|
||||
|
||||
// 将工作流的编号,更新到 OA 现金支出单中
|
||||
assetClaimMapper.updateById(new BpmOAAssetClaimDO().setId(assetClaim.getId()).setProcessInstanceId(processInstanceId));
|
||||
|
||||
// 判断是否为重新发起的流程
|
||||
if (createReqVO.getProcessInstanceId() != null && createReqVO.getResult() == 3) {
|
||||
|
||||
historyProcessInstanceService.createHistoryProcessInstance(processInstanceId, createReqVO.getProcessInstanceId());
|
||||
}
|
||||
|
||||
List<UploadUserFile> fileItems = createReqVO.getFileItems();
|
||||
//这里的逻辑,如果fileItems不为空,且有数据,那么说明是上传了附件的,则需要更工作流文件表对应的实例Id
|
||||
if (fileItems != null && !fileItems.isEmpty()) {
|
||||
uploadBpmFileProcessInstanceId(processInstanceId, fileItems);
|
||||
}
|
||||
return assetClaim.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOAAssetClaimDO getAssetClaim(Long id) {
|
||||
|
||||
return assetClaimMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmOAAssetClaimDO getByProcessInstanceId(String processInstanceId) {
|
||||
|
||||
return assetClaimMapper.selectOne(BpmOAAssetClaimDO::getProcessInstanceId, processInstanceId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAssetClaimResult(String processInstanceId, Long id, Integer result) {
|
||||
|
||||
validateLeaveExists(id);
|
||||
assetClaimMapper.updateById(new BpmOAAssetClaimDO().setId(id).setResult(result));
|
||||
}
|
||||
|
||||
private void validateLeaveExists(Long id) {
|
||||
if (assetClaimMapper.selectById(id) == null) {
|
||||
throw exception(OA_ASSET_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
}
|
@ -97,7 +97,6 @@ public class BpmOAGoOutServiceImpl extends BpmOABaseService implements BpmOAGoOu
|
||||
|
||||
// -- 自己取消
|
||||
// -- 审核拒绝
|
||||
//所有关联的采购申请改为 未支付状态
|
||||
if (BpmProcessInstanceResultEnum.REJECT.getResult().equals(result)
|
||||
|| BpmProcessInstanceResultEnum.CANCEL.getResult().equals(result)
|
||||
|| BpmProcessInstanceResultEnum.BACK.getResult().equals(result)) {
|
||||
|
@ -28,7 +28,7 @@ public interface BpmOARegularService {
|
||||
* @param id 编号
|
||||
* @param result 结果
|
||||
*/
|
||||
void updateRegularResult(Long id, Integer result);
|
||||
void updateRegularResult(String processInstanceId, Long id, Integer result);
|
||||
|
||||
/**
|
||||
* 获得转正申请
|
||||
|
@ -1,21 +1,37 @@
|
||||
package cn.iocoder.yudao.module.bpm.service.oa;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
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.procure.BpmOAProcureListEditReqVO;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.regular.BpmOARegularCreateReqVO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.UploadUserFile;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.reimbursement.Reimbursement;
|
||||
import cn.iocoder.yudao.module.bpm.convert.oa.BpmOARegularConvert;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.financialpayment.FinancialPaymentDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAImprestDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAProcureDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOARegularDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.BpmOAReimbursementDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.dataobject.task.BpmProcessInstanceExtDO;
|
||||
import cn.iocoder.yudao.module.bpm.dal.mysql.oa.BpmOARegularMapper;
|
||||
import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import org.flowable.engine.runtime.ProcessInstance;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.bpm.enums.ErrorCodeConstants.OA_REGULAR_NOT_EXISTS;
|
||||
@ -44,6 +60,12 @@ public class BpmOARegularServiceImpl extends BpmOABaseService implements BpmOARe
|
||||
@Resource
|
||||
private BpmHistoryProcessInstanceService historyProcessInstanceService;
|
||||
|
||||
@Resource
|
||||
private BpmProcessInstanceService bpmProcessInstanceService;
|
||||
|
||||
@Resource
|
||||
private AdminUserApi userApi;
|
||||
|
||||
@Override
|
||||
public Long createRegular(Long userId, BpmOARegularCreateReqVO createReqVO) {
|
||||
|
||||
@ -76,9 +98,21 @@ public class BpmOARegularServiceImpl extends BpmOABaseService implements BpmOARe
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRegularResult(Long id, Integer result) {
|
||||
public void updateRegularResult(String processInstanceId, Long id, Integer result) {
|
||||
|
||||
validateLeaveExists(id);
|
||||
//审核通过 (最后节点)
|
||||
if (BpmProcessInstanceResultEnum.APPROVE.getResult().equals(result)) {
|
||||
|
||||
ProcessInstance instance = bpmProcessInstanceService.getProcessInstance(processInstanceId);
|
||||
|
||||
if (instance.isEnded()) {
|
||||
|
||||
// 同步修改用户编制状态为在职状态
|
||||
userApi.updateUserStaffing(Long.valueOf(instance.getStartUserId()), 7);
|
||||
}
|
||||
}
|
||||
|
||||
regularMapper.updateById(new BpmOARegularDO().setId(id).setResult(result));
|
||||
}
|
||||
|
||||
|
@ -165,10 +165,11 @@ public class BpmOASupplierProcurementPlanServiceImpl extends BpmOABaseService im
|
||||
public void uploadDeliveryReceipt(TheArrivalFileItemsVO vo) {
|
||||
BpmOASupplierProcurementPlanDO supplierProcurementPlanDO = oaSupplierProcurementPlanMapper.selectById(vo.getId());
|
||||
//判断是否需要更新到资产
|
||||
Boolean updateAssetFlag = false;
|
||||
if (CollectionUtil.isEmpty(supplierProcurementPlanDO.getTheArrivalFileItems())) {
|
||||
boolean updateAssetFlag = false;
|
||||
if (supplierProcurementPlanDO.getAssignedFlag() == 0) {
|
||||
updateAssetFlag = true;
|
||||
}
|
||||
supplierProcurementPlanDO.setAssignedFlag(1);
|
||||
supplierProcurementPlanDO.setTheArrivalFileItems(vo.getTheArrivalFileItems());
|
||||
oaSupplierProcurementPlanMapper.updateById(supplierProcurementPlanDO);
|
||||
// ----- 如果需要更新到资产 -
|
||||
|
@ -22,6 +22,7 @@ import cn.iocoder.yudao.module.bpm.enums.task.BpmProcessInstanceResultEnum;
|
||||
import cn.iocoder.yudao.module.bpm.service.financialpayment.FinancialPaymentService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmHistoryProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
import cn.iocoder.yudao.module.system.api.supplier.SupplierApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -66,7 +67,8 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im
|
||||
private BpmOASupplierProcurementPlanMapper supplierProcurementPlanMapper;
|
||||
@Resource
|
||||
private BpmOASupplierProcurementPlanItemMapper supplierProcurementPlanItemMapper;
|
||||
|
||||
@Resource
|
||||
private SupplierApi supplierApi;
|
||||
|
||||
/**
|
||||
* 供应商采购支付
|
||||
@ -76,9 +78,9 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im
|
||||
@Override
|
||||
public Long createOASupplierPurchasePayment(BpmOASupplierPurchasePaymentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
Long userId = WebFrameworkUtils.getLoginUserId();
|
||||
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = BeanUtils.toBean(createReqVO, BpmOASupplierPurchasePaymentDO.class);
|
||||
supplierPurchasePaymentMapper.insert(supplierPurchasePaymentDO);
|
||||
Long userId = WebFrameworkUtils.getLoginUserId();
|
||||
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
@ -118,7 +120,10 @@ public class BpmOASupplierPurchasePaymentServiceImpl extends BpmOABaseService im
|
||||
|
||||
@Override
|
||||
public BpmOASupplierPurchasePaymentDO getOASupplierPurchasePayment(Long id) {
|
||||
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = supplierPurchasePaymentMapper.getById(id);
|
||||
BpmOASupplierPurchasePaymentDO supplierPurchasePaymentDO = supplierPurchasePaymentMapper.selectById(id);
|
||||
// 根据supplierId 供应商id查询供应商
|
||||
CommonResult<String> result = supplierApi.getNameById(supplierPurchasePaymentDO.getSupplierId());
|
||||
supplierPurchasePaymentDO.setSupplierName(result.getData());
|
||||
List<Long> supplierProcurementPlanIds = Arrays.stream(supplierPurchasePaymentDO.getSupplierProcurementPlanIds().split(",")).map(Long::valueOf).collect(Collectors.toList());
|
||||
List<BpmOASupplierProcurementPlanDO> planDOS = supplierProcurementPlanMapper.selectList(new LambdaQueryWrapper<BpmOASupplierProcurementPlanDO>().in(BpmOASupplierProcurementPlanDO::getId, supplierProcurementPlanIds));
|
||||
List<BpmOASupplierProcurementPlanItemDO> planItemDOS = supplierProcurementPlanItemMapper.selectList(new LambdaQueryWrapper<BpmOASupplierProcurementPlanItemDO>().in(BpmOASupplierProcurementPlanItemDO::getProcurementPlanId, supplierProcurementPlanIds));
|
||||
|
@ -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.BpmOAAssetClaimService;
|
||||
import cn.iocoder.yudao.module.bpm.service.oa.BpmOAAssetClaimServiceImpl;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* OA 现金支出的结果的监听器实现类
|
||||
*
|
||||
* @author 符溶馨
|
||||
*/
|
||||
@Component
|
||||
public class BpmOAAssetClaimResultListener extends BpmProcessInstanceResultEventListener {
|
||||
@Resource
|
||||
private BpmOAAssetClaimService assetClaimService;
|
||||
|
||||
@Override
|
||||
protected String getProcessDefinitionKey() {
|
||||
|
||||
return BpmOAAssetClaimServiceImpl.PROCESS_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||
|
||||
assetClaimService.updateAssetClaimResult(event.getId(), Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||
}
|
||||
}
|
@ -27,6 +27,6 @@ public class BpmOARegularResultListener extends BpmProcessInstanceResultEventLis
|
||||
|
||||
@Override
|
||||
protected void onEvent(BpmProcessInstanceResultEvent event) {
|
||||
regularService.updateRegularResult(Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||
regularService.updateRegularResult(event.getId(), Long.parseLong(event.getBusinessKey()), event.getResult());
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -239,4 +239,14 @@ public interface BpmTaskService {
|
||||
BpmTaskExtDO getTaskByProcessInstanceIdAndResult(String processInstanceId, Integer result);
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前待处理流程实例(带查询条件),上一个流程和下一个流程的实例ID
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param processInstanceId 流程实例id
|
||||
* @param pageReqVO 分页请求
|
||||
* @return 流程任务分页
|
||||
*/
|
||||
Map<String,String> getCurrentToDoProcessInstacePreAndNex(Long userId, String processInstanceId,BpmTaskTodoPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
|
||||
// 获得 ProcessInstance
|
||||
List<HistoricProcessInstance> historicProcessInstances = processInstanceService.getHistoricProcessInstances(
|
||||
convertSet(tasks, HistoricTaskInstance::getProcessInstanceId));
|
||||
convertSet(tasks, HistoricTaskInstance::getProcessInstanceId));
|
||||
|
||||
// 判断搜索条件是否选择用户
|
||||
if (pageVO.getUserId() != null) {
|
||||
@ -1375,10 +1375,10 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
List<Task> tasks = taskQuery.list();
|
||||
if (!tasks.isEmpty()) {
|
||||
Task currentTask = tasks.get(0);
|
||||
System.out.println("当前任务节点ID: " + currentTask.getId());
|
||||
System.out.println("当前任务节点名称: " + currentTask.getName());
|
||||
System.out.println("当前任务节点创建时间: " + currentTask.getCreateTime());
|
||||
System.out.println("当前任务节点分配给: " + currentTask.getAssignee());
|
||||
// System.out.println("当前任务节点ID: " + currentTask.getId());
|
||||
// System.out.println("当前任务节点名称: " + currentTask.getName());
|
||||
// System.out.println("当前任务节点创建时间: " + currentTask.getCreateTime());
|
||||
// System.out.println("当前任务节点分配给: " + currentTask.getAssignee());
|
||||
return currentTask.getId();
|
||||
} else {
|
||||
System.out.println("没有找到当前进行中的任务节点");
|
||||
@ -1399,4 +1399,132 @@ public class BpmTaskServiceImpl implements BpmTaskService {
|
||||
.eq(BpmTaskExtDO::getProcessInstanceId, processInstanceId)
|
||||
.eq(BpmTaskExtDO::getResult, result));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前待处理流程实例(带查询条件),上一个流程和下一个流程的实例ID
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param processInstanceId 流程实例id
|
||||
* @param pageVO 分页请求
|
||||
* @return 流程任务分页
|
||||
*/
|
||||
public Map<String,String> getCurrentToDoProcessInstacePreAndNex(Long userId, String processInstanceId,BpmTaskTodoPageReqVO pageVO) {
|
||||
PageResult<BpmTaskTodoPageItemRespVO> list = getTodoTaskPage(userId, pageVO) ;
|
||||
|
||||
List<BpmTaskTodoPageItemRespVO> vos = list.getList() ;
|
||||
List<String> processInstanceIds = new ArrayList<>() ;
|
||||
for (BpmTaskTodoPageItemRespVO vo : vos) {
|
||||
processInstanceIds.add(vo.getProcessInstance().getId()) ;
|
||||
}
|
||||
String pre = null ;
|
||||
String next = null ;
|
||||
Long total = list.getTotal() ;
|
||||
|
||||
Integer pageNo = pageVO.getPageNo() ;
|
||||
//hasNext == true 还有下一页 false 没有下一页
|
||||
boolean hasNext = PageUtils.hasNextPage(total.intValue(),pageVO) ;
|
||||
//hasPre == true 还有下上页 false 没有上一页
|
||||
boolean hasPre = pageVO.getPageNo() > 1 ;
|
||||
//获取上一个
|
||||
for (int i = 0; i < processInstanceIds.size(); i++) {
|
||||
if( processInstanceIds.get(i).equals(processInstanceId) ) {
|
||||
if( i > 0 ) {
|
||||
pre = processInstanceIds.get(i - 1) ;
|
||||
}else if( hasPre ) {
|
||||
pageVO.setPageNo(pageNo - 1);
|
||||
list = getTodoTaskPage(userId, pageVO) ;
|
||||
BpmTaskTodoPageItemRespVO vo = list.getList().get(list.getList().size()-1);
|
||||
pre = vo.getProcessInstance().getId() ;
|
||||
}else {
|
||||
pre = null ;
|
||||
}
|
||||
}
|
||||
}
|
||||
//获取下一个
|
||||
for (int i = 0; i < processInstanceIds.size(); i++) {
|
||||
if( processInstanceIds.get(i).equals(processInstanceId) ) {
|
||||
if( i < processInstanceIds.size() - 1 ) {
|
||||
next = processInstanceIds.get(i + 1) ;
|
||||
}else if( hasNext ) {
|
||||
pageVO.setPageNo(pageNo + 1);
|
||||
list = getTodoTaskPage(userId, pageVO) ;
|
||||
BpmTaskTodoPageItemRespVO vo = list.getList().get(0);
|
||||
next = vo.getProcessInstance().getId() ;
|
||||
}else {
|
||||
next = null ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// int index = processInstanceIds.indexOf(processInstanceId);
|
||||
// if(index == 0 ) {
|
||||
// //下标未0
|
||||
// if (pageNo == 1) {
|
||||
// //如果pageNo == 1 说明是第一页,第一条数据,那么就没有pre
|
||||
// log.info("没有上个");
|
||||
// pre = null;
|
||||
// } else {
|
||||
// //如果pageNo > 1 说明是不是第一页的第一条数据,那么就有pre
|
||||
// //设置当前页面-1,并查询数据
|
||||
// pageVO.setPageNo(pageNo - 1);
|
||||
// log.info("查询上一页");
|
||||
// list = getTodoTaskPage(userId, pageVO) ;
|
||||
// BpmTaskTodoPageItemRespVO vo = list.getList().get(list.getList().size()-1);
|
||||
// pre = vo.getProcessInstance().getId() ;
|
||||
// }
|
||||
// if( processInstanceIds.size() == 1 ) {
|
||||
// //说明这一页,只有一条数据,没有下一条了
|
||||
// log.info("没有下一个");
|
||||
// next = null ;
|
||||
// }else {
|
||||
// next = processInstanceIds.get(index + 1);
|
||||
// }
|
||||
// } else if( index == processInstanceIds.size() -1 ) {
|
||||
// //如果下标==数据集合的size-1,说明是当前页面的最后一条数据
|
||||
// pre = processInstanceIds.get(index - 1);
|
||||
// if(!hasNext) {
|
||||
// //如果没有下一页了
|
||||
// log.info("没有下一个");
|
||||
// next = null; ;
|
||||
// }else {
|
||||
// //正常下一条数据
|
||||
// //设置当前页面+1,并查询数据
|
||||
// pageVO.setPageNo(pageNo + 1);
|
||||
// log.info("查询下一页");
|
||||
// list = getTodoTaskPage(userId, pageVO) ;
|
||||
// BpmTaskTodoPageItemRespVO vo = list.getList().get(0);
|
||||
// next = vo.getProcessInstance().getId() ;
|
||||
//
|
||||
// //审批处理后的下一条数据, 因为处理的是当前页最后一条数据,假设10条数据,处理了一条变成9条,重新查询后,会把原来第二页的数据查询在第一页的来。
|
||||
// //所有重新查询当前页面后,取最后一条数据
|
||||
// /**
|
||||
// log.info("审批后重新查询");
|
||||
// list = getTodoTaskPage(userId, pageVO) ;
|
||||
// BpmTaskTodoPageItemRespVO vo1 = list.getList().get(processInstanceIds.size() -1);
|
||||
// next = vo1.getProcessInstance().getId() ;
|
||||
// **/
|
||||
// }
|
||||
//
|
||||
// }else if( index > 0 && index < processInstanceIds.size() ){
|
||||
// //如果下标大于0 且不等于processInstanceIds.size() ,说明是中间的数据
|
||||
// pre = processInstanceIds.get(index - 1);
|
||||
// next = processInstanceIds.get(index + 1);
|
||||
// }else {
|
||||
// log.info("传入的processInstanceId:"+processInstanceId+"在列表中不存在");
|
||||
// pre = null ;
|
||||
// next = null ;
|
||||
// }
|
||||
|
||||
Map<String,String> map = new HashMap<>() ;
|
||||
map.put("pre",pre) ;
|
||||
map.put("next",next);
|
||||
map.put("current",processInstanceId) ;
|
||||
map.put("total",total.toString()) ;
|
||||
map.put("currentPage",pageVO.getPageNo().toString()) ;
|
||||
return map ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
password: ZNredis2024! # 密码,建议生产环境开启
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 47.97.8.94:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
discovery:
|
||||
namespace: prod # 命名空间。这里使用 dev 开发环境
|
||||
metadata:
|
||||
@ -16,7 +16,7 @@ spring:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: 47.97.8.94:8848 # Nacos 服务器地址
|
||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||
namespace: prod # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
|
@ -56,7 +56,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 1 # 数据库索引
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
# password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
|
@ -71,7 +71,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
password: ZNredis2024! # 密码,建议生产环境开启
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 47.97.8.94:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
discovery:
|
||||
namespace: prod # 命名空间。这里使用 dev 开发环境
|
||||
metadata:
|
||||
@ -16,7 +16,7 @@ spring:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: 47.97.8.94:8848 # Nacos 服务器地址
|
||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||
namespace: prod # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
|
@ -53,8 +53,8 @@ public interface DeptApi {
|
||||
CommonResult<Long> createDept(@RequestBody DeptRespDTO deptRespDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/update")
|
||||
@Operation(summary = "修改部门信息")
|
||||
void updateDept(@RequestBody DeptRespDTO deptRespDTO);
|
||||
@Operation(summary = "修改工厂部门信息")
|
||||
void updateFactoryDept(@RequestBody DeptRespDTO deptRespDTO);
|
||||
|
||||
@PostMapping(PREFIX + "/delete")
|
||||
@Operation(summary = "删除部门信息")
|
||||
|
@ -1,14 +1,16 @@
|
||||
package cn.iocoder.yudao.module.system.api.supplier;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.subscribe.dto.SubscribeMessageReqDTO;
|
||||
import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO;
|
||||
import cn.iocoder.yudao.module.system.enums.ApiConstants;
|
||||
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.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿:fallbackFactory =
|
||||
@Tag(name = "RPC 服务 - 供应商新增编辑")
|
||||
@ -20,4 +22,9 @@ public interface SupplierApi {
|
||||
@Operation(summary = "新增编辑供应商")
|
||||
CommonResult saveOrEdit(@RequestBody SupplierRpcDTO supplier);
|
||||
|
||||
|
||||
@GetMapping(PREFIX + "/getNameById")
|
||||
@Operation(summary = "获取供应商名称")
|
||||
@Parameter(name = "id", description = "供应商id", example = "1", required = true)
|
||||
CommonResult<String> getNameById(@RequestParam("id") Long id);
|
||||
}
|
||||
|
@ -84,6 +84,13 @@ public interface AdminUserApi {
|
||||
void updateFieldworkType(@RequestParam("userId") Long userId,
|
||||
@RequestParam("fieldworkFlag") Integer fieldworkFlag);
|
||||
|
||||
@PostMapping(PREFIX + "/updateUserStaffing")
|
||||
@Operation(summary = "修改用户信息")
|
||||
@Parameter(name = "userId", description = "用户id", example = "1024", required = true)
|
||||
@Parameter(name = "userStaffing", description = "用户编制", example = "1", required = true)
|
||||
void updateUserStaffing(@RequestParam("userId") Long userId,
|
||||
@RequestParam("userStaffing") Integer userStaffing);
|
||||
|
||||
@GetMapping(PREFIX + "/getUserIdsByUserNature")
|
||||
@Operation(summary = "获取所有用户性质为外勤的用户")
|
||||
@Parameter(name = "userNature", description = "用户性质", example = "3", required = true)
|
||||
|
@ -53,6 +53,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode DEPT_EXISTS_USER = new ErrorCode(1_002_004_005, "部门中存在员工,无法删除");
|
||||
ErrorCode DEPT_NOT_ENABLE = new ErrorCode(1_002_004_006, "部门({})不处于开启状态,不允许选择");
|
||||
ErrorCode DEPT_PARENT_IS_CHILD = new ErrorCode(1_002_004_007, "不能设置自己的子部门为父部门");
|
||||
ErrorCode FACTORY_DEPT_NOT_FOUND = new ErrorCode(1_002_004_008, "当前工厂没有对应部门");
|
||||
|
||||
// ========== 职称模块 1-002-005-000 ==========
|
||||
ErrorCode POST_NOT_FOUND = new ErrorCode(1_002_005_000, "当前职称不存在");
|
||||
|
@ -75,21 +75,14 @@ public class DeptApiImpl implements DeptApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDept(DeptRespDTO deptRespDTO) {
|
||||
public void updateFactoryDept(DeptRespDTO deptRespDTO) {
|
||||
|
||||
DeptDO deptDO = deptService.getDeptByFactoryId(deptRespDTO.getFactoryId());
|
||||
|
||||
if (deptDO != null) {
|
||||
|
||||
DeptSaveReqVO deptSaveReqVO = BeanUtils.toBean(deptDO, DeptSaveReqVO.class);
|
||||
deptSaveReqVO.setLeaderUserId(deptRespDTO.getLeaderUserId());
|
||||
deptSaveReqVO.setName(deptRespDTO.getName());
|
||||
|
||||
deptService.updateDept(deptSaveReqVO);
|
||||
}
|
||||
DeptSaveReqVO deptSaveReqVO = BeanUtils.toBean(deptRespDTO, DeptSaveReqVO.class);
|
||||
deptService.updateFactoryDept(deptSaveReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false)
|
||||
public void deleteDept(Long factoryId) {
|
||||
|
||||
DeptDO deptDO = deptService.getDeptByFactoryId(factoryId);
|
||||
@ -100,6 +93,7 @@ public class DeptApiImpl implements DeptApi {
|
||||
}
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false)
|
||||
public CommonResult<DeptRespDTO> getDeptByFactoryId(Long factoryId) {
|
||||
|
||||
DeptDO deptDO = deptService.getDeptByFactoryId(factoryId);
|
||||
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.api.supplier;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.system.api.supplier.dto.SupplierRpcDTO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.supplier.SupplierDO;
|
||||
import cn.iocoder.yudao.module.system.service.supplier.SupplierService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -23,4 +24,10 @@ public class SupplierApiImpl implements SupplierApi {
|
||||
supplierService.saveOrEdit(supplier);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<String> getNameById(Long id) {
|
||||
SupplierDO supplier = supplierService.getSupplier(id);
|
||||
return success(supplier == null ? "其他" : supplier.getSupplierName());
|
||||
}
|
||||
}
|
||||
|
@ -96,6 +96,12 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
userService.updateFieldworkType(userId, fieldworkFlag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserStaffing(Long userId, Integer userStaffing) {
|
||||
|
||||
userService.updateUserStaffing(userId, userStaffing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<Long>> getUserIdsByUserNature(Integer userNature) {
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.attendance.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.attendance.group.AttendanceGroupDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
@ -15,6 +16,8 @@ public class AttendanceRulesVO {
|
||||
private String officeLocation;
|
||||
@Schema(description = "是否允许外勤打卡 0否 1是")
|
||||
private Integer fieldworkFlag;
|
||||
@Schema(description = "考勤组信息")
|
||||
private AttendanceGroupDO attendanceGroupDO;
|
||||
|
||||
@Data
|
||||
public static class WorkRules {
|
||||
|
@ -128,6 +128,15 @@ public class DeptController {
|
||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping(value = { "/virtually-list"})
|
||||
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||
public CommonResult<List<DeptSimpleRespVO>> getVirtuallyDeptList() {
|
||||
List<DeptDO> list = deptService.getDeptList(
|
||||
new DeptListReqVO().setStatus(CommonStatusEnum.ENABLE.getStatus()));
|
||||
|
||||
return success(BeanUtils.toBean(list, DeptSimpleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/all-list"})
|
||||
@Operation(summary = "获取部门精简信息列表", description = "只包含被开启的部门,主要用于前端的下拉选项")
|
||||
@DataPermission(enable = false)
|
||||
|
@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.SigningDateRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
@ -21,9 +22,12 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 劳动合同管理")
|
||||
@RestController
|
||||
@ -101,4 +105,20 @@ public class LaborContractController {
|
||||
|
||||
return success(laborContractService.getLaborContractPage(pageReqVO));
|
||||
}
|
||||
|
||||
@GetMapping("/getSigningDate")
|
||||
@Operation(summary = "获得当前登录用户的入职时间和转正时间")
|
||||
public CommonResult<SigningDateRespVO> getSigningDate() {
|
||||
|
||||
LaborContractDO contractDO = laborContractService.getSigningDate(getLoginUserId());
|
||||
if (contractDO == null) {
|
||||
return success(new SigningDateRespVO());
|
||||
}
|
||||
|
||||
SigningDateRespVO respVO = BeanUtils.toBean(contractDO, SigningDateRespVO.class);
|
||||
// 设置转正日期
|
||||
LocalDate regularDate = contractDO.getSigningDate().plusMonths(contractDO.getProbationPeriodTime());
|
||||
respVO.setRegularDate(regularDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
return success(respVO);
|
||||
}
|
||||
}
|
@ -8,6 +8,7 @@ import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@ -23,6 +24,9 @@ public class LaborContractPageReqVO extends PageParam {
|
||||
@Schema(description = "部门id", example = "128")
|
||||
private Long deptId;
|
||||
|
||||
@Schema(description = "部门id", example = "128")
|
||||
private List<Long> deptIds;
|
||||
|
||||
@Schema(description = "签约日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] signingDate;
|
||||
|
@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
@Schema(description = "管理后台 - 劳动合同管理 Response VO")
|
||||
@Data
|
||||
public class SigningDateRespVO {
|
||||
|
||||
@Schema(description = "签约日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private String signingDate;
|
||||
|
||||
@Schema(description = "转正日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private String regularDate;
|
||||
}
|
@ -9,9 +9,12 @@ import lombok.Data;
|
||||
@Data
|
||||
public class UploadFile {
|
||||
|
||||
@Schema(description = "文件管理 fileId", requiredMode = Schema.RequiredMode.REQUIRED, example = "123.jpg")
|
||||
@Schema(description = "文件管理 fileId", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "123.jpg")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "文件URL", requiredMode = Schema.RequiredMode.REQUIRED, example = "http://xxx.xxx/xx/xx/123.jpgss")
|
||||
private String url;
|
||||
|
||||
|
@ -14,4 +14,6 @@ public class UserPageDTO extends PageParam {
|
||||
private String name;
|
||||
@Schema(description = "状态(0正常 1停用)不传则全部", example = "1")
|
||||
private Integer status;
|
||||
@Schema(description = "部门id", example = "1")
|
||||
private Long deptId;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
" contract_duration AS contractDuration,\n" +
|
||||
" probation_period_time AS probationPeriodTime,\n" +
|
||||
" status,\n" +
|
||||
" create_time AS createTime,\n" +
|
||||
" create_time AS createTime\n" +
|
||||
" FROM\n" +
|
||||
" system_labor_contract lc\n" +
|
||||
" INNER JOIN (SELECT\n" +
|
||||
@ -153,7 +153,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
" AND lc.create_time = max.max_create_time) a on a.user_id = t.id");
|
||||
queryWrapper.eq(AdminUserDO::getUserType, 1);
|
||||
queryWrapper.likeIfPresent(AdminUserDO::getNickname, pageReqVO.getUserName());
|
||||
queryWrapper.eqIfPresent(AdminUserDO::getDeptId, pageReqVO.getDeptId());
|
||||
queryWrapper.inIfPresent(AdminUserDO::getDeptId, pageReqVO.getDeptIds());
|
||||
if (Objects.nonNull(pageReqVO.getSigningDate())) {
|
||||
queryWrapper.between("a.signing_date", pageReqVO.getSigningDate()[0], pageReqVO.getSigningDate()[1]);
|
||||
}
|
||||
@ -163,6 +163,7 @@ public interface AdminUserMapper extends BaseMapperX<AdminUserDO> {
|
||||
queryWrapper.eq(Objects.nonNull(pageReqVO.getStatus()), "a.status", pageReqVO.getStatus());
|
||||
queryWrapper.groupBy(AdminUserDO::getId);
|
||||
queryWrapper.orderByAsc("a.status");
|
||||
queryWrapper.orderByAsc(AdminUserDO::getId);
|
||||
|
||||
return selectJoinPage(mpPage, LaborContractRespVO.class, queryWrapper);
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.system.dal.mysql.worklog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.annotation.DataPermission;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.aop.DataPermissionContextHolder;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.MPJLambdaWrapperX;
|
||||
@ -16,6 +15,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.worklog.LogInstanceDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.worklog.LogReadDo;
|
||||
import cn.iocoder.yudao.module.system.service.worklog.dto.LogReadUserRespDTO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -65,8 +65,8 @@ public interface LogInstanceMapper extends BaseMapperX<LogInstanceDO> {
|
||||
.eq(LogReadDo::getLogInstanceId, LogInstanceDO::getId)
|
||||
.eq(LogReadDo::getReadUserId, userId)
|
||||
.eq(LogReadDo::getDeleted, 0));
|
||||
queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS readCount FROM work_log_read where read_status = 1 GROUP BY log_instance_id) c on t.id = c.log_instance_id");
|
||||
queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS unReadCount FROM work_log_read where read_status = 0 GROUP BY log_instance_id) AS d ON t.id = d.log_instance_id");
|
||||
queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS readCount FROM work_log_read where read_status = 1 and deleted = 0 GROUP BY log_instance_id) c on t.id = c.log_instance_id");
|
||||
queryWrapper.leftJoin("(SELECT log_instance_id, COUNT(log_instance_id) AS unReadCount FROM work_log_read where read_status = 0 and deleted = 0 GROUP BY log_instance_id) AS d ON t.id = d.log_instance_id");
|
||||
queryWrapper.leftJoin("(SELECT work_log_id, COUNT(work_log_id) AS comment FROM work_log_comment GROUP BY work_log_id) AS b ON t.id = b.work_log_id");
|
||||
queryWrapper.eqIfPresent(LogInstanceDO::getDeptId, reqVO.getDeptId());
|
||||
queryWrapper.eqIfPresent(LogInstanceDO::getFormId, reqVO.getFormId());
|
||||
@ -108,9 +108,76 @@ public interface LogInstanceMapper extends BaseMapperX<LogInstanceDO> {
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
LogInstanceRespVO getNextOrUp(@Param("reqVO") LogInstancePageReqVO dto,
|
||||
LogInstanceRespVO getMyNextOrUp(@Param("reqVO") LogInstancePageReqVO dto,
|
||||
@Param("id") Long id, @Param("userId") Long userId,
|
||||
@Param("type") Integer type,
|
||||
@Param("pagingType") Integer pagingType,
|
||||
@Param("userIds") List<Long> userIds);
|
||||
|
||||
default IPage<LogInstanceRespVO> getNextOrUp(@Param("reqVO") LogInstancePageReqVO reqVO,
|
||||
@Param("id") Long id,
|
||||
@Param("userId") Long userId,
|
||||
@Param("type") Integer type,
|
||||
@Param("userIds") List<Long> userIds){
|
||||
|
||||
String sql = "";
|
||||
|
||||
MPJLambdaWrapperX<LogInstanceDO> queryWrapper = new MPJLambdaWrapperX<>();
|
||||
queryWrapper.selectAs(LogInstanceDO::getId, LogInstanceRespVO::getId);
|
||||
queryWrapper.selectAs(LogInstanceDO::getName, LogInstanceRespVO::getName);
|
||||
queryWrapper.innerJoin(UserPostDO.class, "userPost", UserPostDO::getUserId, LogInstanceDO::getStartUserId);
|
||||
queryWrapper.innerJoin(DeptDO.class, "dept", DeptDO::getId, LogInstanceDO::getDeptId);
|
||||
queryWrapper.innerJoin(PostDO.class, "post", PostDO::getId, UserPostDO::getPostId);
|
||||
if (type == 1) {
|
||||
sql = " (t.time > tt.time) or\n" +
|
||||
" (t.time = tt.time and tt.sort > post.sort) or\n" +
|
||||
" (t.time = tt.time and tt.sort = post.sort and tt.create_time < t.create_time)";
|
||||
|
||||
queryWrapper.orderByAsc(LogInstanceDO::getTime);
|
||||
queryWrapper.orderByDesc(PostDO::getSort);
|
||||
queryWrapper.orderByAsc(LogInstanceDO::getCreateTime);
|
||||
}
|
||||
if (type == 0) {
|
||||
sql = " (t.time < tt.time) or\n" +
|
||||
" (t.time = tt.time and tt.sort < post.sort) or\n" +
|
||||
" (t.time = tt.time and tt.sort = post.sort and tt.create_time > t.create_time)";
|
||||
|
||||
queryWrapper.orderByDesc(LogInstanceDO::getTime);
|
||||
queryWrapper.orderByAsc(PostDO::getSort);
|
||||
queryWrapper.orderByDesc(LogInstanceDO::getCreateTime);
|
||||
}
|
||||
queryWrapper.innerJoin("(\n" +
|
||||
"SELECT \n" +
|
||||
" a.id,\n" +
|
||||
" a.name,\n" +
|
||||
" a.time,\n" +
|
||||
" d.sort,\n" +
|
||||
" a.create_time\n" +
|
||||
"FROM \n" +
|
||||
" work_log_instance_ext a\n" +
|
||||
" INNER JOIN system_user_post b ON (b.user_id = a.start_user_id) \n" +
|
||||
" INNER JOIN system_dept c ON (c.id = a.dept_id) \n" +
|
||||
" INNER JOIN system_post d ON (d.id = b.post_id) \n" +
|
||||
"WHERE \n" +
|
||||
" a.id = " + id + "\n" +
|
||||
" AND a.deleted = 0 \n" +
|
||||
" AND b.deleted = 0 \n" +
|
||||
" AND c.deleted = 0 \n" +
|
||||
" AND d.deleted = 0\n" +
|
||||
") tt on \n" + sql);
|
||||
queryWrapper.eqIfPresent(LogInstanceDO::getDeptId, reqVO.getDeptId());
|
||||
queryWrapper.eqIfPresent(LogInstanceDO::getFormId, reqVO.getFormId());
|
||||
queryWrapper.eqIfPresent(LogInstanceDO::getStartUserId, reqVO.getStartUserId());
|
||||
queryWrapper.betweenIfPresent(LogInstanceDO::getTime, reqVO.getCreateTime());
|
||||
queryWrapper.inIfPresent(LogInstanceDO::getStartUserId, userIds);
|
||||
queryWrapper.ne(LogInstanceDO::getStartUserId, userId);
|
||||
|
||||
if (reqVO.getIsProduce() != null && reqVO.getIsProduce() == 1) {
|
||||
queryWrapper.like(DeptDO::getFlag, "166");
|
||||
}
|
||||
if (reqVO.getIsProduce() != null && reqVO.getIsProduce() == 2) {
|
||||
queryWrapper.notLike(DeptDO::getFlag, "166");
|
||||
}
|
||||
|
||||
return selectJoinPage(new Page<>(1, 1), LogInstanceRespVO.class, queryWrapper);
|
||||
}
|
||||
}
|
@ -954,6 +954,7 @@ public class AttendanceServiceImpl implements AttendanceService {
|
||||
vo.setFieldworkFlag(group.getFieldworkFlag());
|
||||
vo.setWorkRules(workRules);
|
||||
vo.setOfficeLocation(group.getAddress());
|
||||
vo.setAttendanceGroupDO(group);
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ import javax.annotation.Resource;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -115,7 +116,7 @@ public class WorkLogCommentServiceImpl implements WorkLogCommentService {
|
||||
List<CommentPageListVO> records = pageList.getRecords();
|
||||
if (dto.getIsShowWorkLogContent() != null && dto.getIsShowWorkLogContent() == 1 && !records.isEmpty()) {
|
||||
//模版ids过滤
|
||||
List<Long> workFormIds = records.stream().map(CommentPageListVO::getWorkFormId).collect(Collectors.toList());
|
||||
Set<Long> workFormIds = records.stream().map(CommentPageListVO::getWorkFormId).collect(Collectors.toSet());
|
||||
// 查询模版列表
|
||||
List<LogFormDO> formList = logFormService.getFormList(workFormIds);
|
||||
Map<Long, LogFormDO> formMap = formList.stream().collect(Collectors.toMap(LogFormDO::getId, item -> item));
|
||||
|
@ -30,6 +30,12 @@ public interface DeptService {
|
||||
*/
|
||||
void updateDept(DeptSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 更新工厂部门
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateFactoryDept(DeptSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除部门
|
||||
*
|
||||
|
@ -128,6 +128,17 @@ public class DeptServiceImpl implements DeptService {
|
||||
deptMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFactoryDept(DeptSaveReqVO updateReqVO) {
|
||||
|
||||
// 校验自己存在
|
||||
validateFactoryDeptExists(updateReqVO.getFactoryId());
|
||||
|
||||
DeptDO update = BeanUtils.toBean(updateReqVO, DeptDO.class);
|
||||
deptMapper.update(update, new LambdaQueryWrapperX<DeptDO>()
|
||||
.eq(DeptDO::getFactoryId, updateReqVO.getFactoryId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(cacheNames = RedisKeyConstants.DEPT_CHILDREN_ID_LIST,
|
||||
allEntries = true) // allEntries 清空所有缓存,因为操作一个部门,涉及到多个缓存
|
||||
@ -153,6 +164,17 @@ public class DeptServiceImpl implements DeptService {
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void validateFactoryDeptExists(Long factoryId) {
|
||||
if (factoryId == null) {
|
||||
return;
|
||||
}
|
||||
DeptDO dept = deptMapper.selectOne(DeptDO::getFactoryId, factoryId);
|
||||
if (dept == null) {
|
||||
throw exception(FACTORY_DEPT_NOT_FOUND);
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void validateParentDept(Long id, Long parentId) {
|
||||
if (parentId == null || DeptDO.PARENT_ID_ROOT.equals(parentId)) {
|
||||
@ -289,6 +311,7 @@ public class DeptServiceImpl implements DeptService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@DataPermission(enable = false)
|
||||
public DeptDO getDeptByFactoryId(Long factoryId) {
|
||||
|
||||
return deptMapper.selectOne(DeptDO::getFactoryId, factoryId);
|
||||
|
@ -83,5 +83,10 @@ public interface LaborContractService {
|
||||
*/
|
||||
List<LaborContractDO> getListByEndTime(LocalDate now);
|
||||
|
||||
|
||||
/**
|
||||
* 获得当前登录用户的入职时间和转正时间
|
||||
* @param userId 用户编号
|
||||
* @return 日期
|
||||
*/
|
||||
LaborContractDO getSigningDate(Long userId);
|
||||
}
|
@ -1,14 +1,17 @@
|
||||
package cn.iocoder.yudao.module.system.service.laborcontract;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractRespVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.laborcontract.vo.LaborContractSaveReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.laborcontract.LaborContractDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.laborcontract.LaborContractMapper;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper;
|
||||
import cn.iocoder.yudao.module.system.service.dept.DeptService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -20,6 +23,7 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.LABOR_CONTRACT_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
@ -37,6 +41,9 @@ public class LaborContractServiceImpl implements LaborContractService {
|
||||
@Resource
|
||||
private AdminUserMapper userMapper;
|
||||
|
||||
@Resource
|
||||
private DeptService deptService;
|
||||
|
||||
@Override
|
||||
public Long createLaborContract(LaborContractSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@ -93,6 +100,13 @@ public class LaborContractServiceImpl implements LaborContractService {
|
||||
@Override
|
||||
public PageResult<LaborContractRespVO> getLaborContractPage(LaborContractPageReqVO pageReqVO) {
|
||||
|
||||
if (pageReqVO.getDeptId() != null) {
|
||||
|
||||
// 获取所有子级部门
|
||||
List<DeptDO> deptDOS = deptService.getChildDept(pageReqVO.getDeptId());
|
||||
pageReqVO.setDeptIds(convertList(deptDOS, DeptDO::getId));
|
||||
}
|
||||
|
||||
Page<LaborContractRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
IPage<LaborContractRespVO> pageList = userMapper.selectContractPage(page, pageReqVO);
|
||||
|
||||
@ -118,4 +132,15 @@ public class LaborContractServiceImpl implements LaborContractService {
|
||||
.lt(LaborContractDO::getExpirationDate, now)
|
||||
.eq(LaborContractDO::getStatus, 3));
|
||||
}
|
||||
|
||||
@Override
|
||||
public LaborContractDO getSigningDate(Long userId) {
|
||||
|
||||
List<LaborContractDO> list = laborContractMapper.selectList(new LambdaQueryWrapperX<LaborContractDO>()
|
||||
.eq(LaborContractDO::getUserId, userId)
|
||||
.isNotNull(LaborContractDO::getProbationPeriodTime)
|
||||
.orderByDesc(LaborContractDO::getCreateTime));
|
||||
|
||||
return CollectionUtil.isEmpty(list) ? null : list.get(0);
|
||||
}
|
||||
}
|
@ -103,6 +103,14 @@ public interface AdminUserService {
|
||||
*/
|
||||
void updateFieldwork(Long id, Integer fieldworkFlag);
|
||||
|
||||
/**
|
||||
* 修改用户编制
|
||||
*
|
||||
* @param id 用户编号
|
||||
* @param userStaffing 编制
|
||||
*/
|
||||
void updateUserStaffing(Long id, Integer userStaffing);
|
||||
|
||||
/**
|
||||
* 修改外勤打卡状态
|
||||
* 用于临时开启外勤打卡
|
||||
|
@ -277,6 +277,12 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
userMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateUserStaffing(Long id, Integer userStaffing) {
|
||||
|
||||
userMapper.updateById(new AdminUserDO().setId(id).setUserStaffing(userStaffing));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFieldworkType(Long id, Integer fieldworkFlag) {
|
||||
// 更新状态
|
||||
@ -356,8 +362,8 @@ public class AdminUserServiceImpl implements AdminUserService {
|
||||
.header("Connection", "keep-alive")
|
||||
.header("Content-Type", "application/json")
|
||||
.header("Cookie", "JSESSIONID=node07ayjwewvdr8q3ov9smy6m94c3668.node0")
|
||||
.header("Origin", "http://47.97.8.94:8082")
|
||||
.header("Referer", "http://47.97.8.94:8082/settings/device")
|
||||
.header("Origin", "http://127.0.0.1:8082")
|
||||
.header("Referer", "http://127.0.0.1:8082/settings/device")
|
||||
.header("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36")
|
||||
.body(JSONUtil.toJsonStr(object))
|
||||
.timeout(20000) // 设置超时时间
|
||||
|
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.service.worklog;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
@ -256,14 +257,14 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
if (!records.isEmpty()) {
|
||||
|
||||
//模版ids过滤
|
||||
List<Long> workFormIds = records.stream().map(LogInstanceRespVO::getFormId).collect(Collectors.toList());
|
||||
Set<Long> workFormIds = records.stream().map(LogInstanceRespVO::getFormId).collect(Collectors.toSet());
|
||||
|
||||
// 查询模版列表
|
||||
List<LogFormDO> formList = logFormService.getFormList(workFormIds);
|
||||
Map<Long, LogFormDO> formMap = formList.stream().collect(Collectors.toMap(LogFormDO::getId, item -> item));
|
||||
|
||||
//查询用户信息列表
|
||||
List<Long> userIds = records.stream().map(LogInstanceRespVO::getStartUserId).collect(Collectors.toList());
|
||||
Set<Long> userIds = records.stream().map(LogInstanceRespVO::getStartUserId).collect(Collectors.toSet());
|
||||
Map<Long, AdminUserDO> userMap = adminUserService.getUserMap(userIds);
|
||||
|
||||
//遍历
|
||||
@ -400,10 +401,26 @@ public class LogInstanceServiceImpl implements LogInstanceService {
|
||||
//以及岗位为总监或副总监的用户
|
||||
leaderUserIds = adminUserService.getUserByBoss();
|
||||
}
|
||||
LogInstanceRespVO upLogInstance = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 1, pagingType, leaderUserIds);
|
||||
LogInstanceRespVO nextLogInstance = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 0, pagingType, leaderUserIds);
|
||||
vo.setUpLogInstance(upLogInstance);
|
||||
vo.setNextLogInstance(nextLogInstance);
|
||||
if (pagingType == 0) {
|
||||
IPage<LogInstanceRespVO> upLogInstances = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 1, leaderUserIds);
|
||||
IPage<LogInstanceRespVO> nextLogInstances = logInstanceMapper.getNextOrUp(dto, id, getLoginUserId(), 0, leaderUserIds);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(upLogInstances.getRecords())) {
|
||||
vo.setUpLogInstance(upLogInstances.getRecords().get(0));
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(nextLogInstances.getRecords())) {
|
||||
vo.setNextLogInstance(nextLogInstances.getRecords().get(0));
|
||||
}
|
||||
}
|
||||
|
||||
if (pagingType == 1) {
|
||||
LogInstanceRespVO upLogInstance = logInstanceMapper.getMyNextOrUp(dto, id, getLoginUserId(), 1, leaderUserIds);
|
||||
LogInstanceRespVO nextLogInstance = logInstanceMapper.getMyNextOrUp(dto, id, getLoginUserId(), 0, leaderUserIds);
|
||||
|
||||
vo.setUpLogInstance(upLogInstance);
|
||||
vo.setNextLogInstance(nextLogInstance);
|
||||
}
|
||||
|
||||
//获取日志详情
|
||||
return vo;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 1 # 数据库索引
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
# password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
|
@ -67,7 +67,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
password: ZNredis2024! # 密码,建议生产环境开启
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
@ -92,7 +92,7 @@ xxl:
|
||||
job:
|
||||
enabled: true # 是否开启调度中心,默认为 true 开启
|
||||
admin:
|
||||
addresses: http://47.97.8.94:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
executor:
|
||||
appname: ${spring.application.name} # 执行器 AppName
|
||||
ip: # 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
||||
|
@ -3,7 +3,7 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 47.97.8.94:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
discovery:
|
||||
namespace: prod # 命名空间。这里使用 dev 开发环境
|
||||
metadata:
|
||||
@ -16,7 +16,7 @@ spring:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: 47.97.8.94:8848 # Nacos 服务器地址
|
||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||
namespace: prod # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
|
@ -73,6 +73,9 @@
|
||||
#{groupId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="dto.deptId != null">
|
||||
and a.dept_id = #{dto.deptId}
|
||||
</if>
|
||||
<if test="dto.name != null and dto.name != ''">
|
||||
and a.nickname like concat('%', #{dto.name}, '%')
|
||||
</if>
|
||||
|
@ -94,61 +94,66 @@
|
||||
or result.data_scope = 1 )
|
||||
</select>
|
||||
|
||||
<select id="getNextOrUp"
|
||||
<select id="getMyNextOrUp"
|
||||
resultType="cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO">
|
||||
SELECT
|
||||
a.id,
|
||||
a.name
|
||||
t.id,
|
||||
t.name
|
||||
FROM
|
||||
work_log_instance_ext AS a
|
||||
LEFT JOIN work_log_read AS e ON a.id = e.log_instance_id
|
||||
AND e.read_user_id = #{userId}
|
||||
work_log_instance_ext AS t
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
a.time,
|
||||
a.create_time
|
||||
FROM
|
||||
work_log_instance_ext a
|
||||
WHERE
|
||||
a.id = #{id}
|
||||
) tt ON
|
||||
<if test="type == 1">
|
||||
( t.time > tt.time )
|
||||
OR ( t.time = tt.time AND tt.create_time < t.create_time )
|
||||
</if>
|
||||
<if test="type == 0">
|
||||
( t.time < tt.time )
|
||||
OR ( t.time = tt.time AND tt.create_time > t.create_time )
|
||||
</if>
|
||||
<where>
|
||||
a.deleted = 0
|
||||
<if test="type == 0">
|
||||
and a.id < #{id}
|
||||
</if>
|
||||
<if test="type == 1">
|
||||
and a.id > #{id}
|
||||
</if>
|
||||
t.deleted = 0
|
||||
AND t.start_user_id = #{userId}
|
||||
<if test="reqVO.type != null">
|
||||
and a.type = #{reqVO.type}
|
||||
and t.type = #{reqVO.type}
|
||||
</if>
|
||||
<if test="reqVO.deptId != null">
|
||||
and a.dept_id = #{reqVO.deptId}
|
||||
and t.dept_id = #{reqVO.deptId}
|
||||
</if>
|
||||
<if test="reqVO.startUserId != null">
|
||||
and a.start_user_id = #{reqVO.startUserId}
|
||||
and t.start_user_id = #{reqVO.startUserId}
|
||||
</if>
|
||||
<if test="reqVO.createTime != null and reqVO.createTime.length > 0">
|
||||
<if test="reqVO.createTime[0] != null">
|
||||
and a.create_time >= #{reqVO.createTime[0]}
|
||||
and t.create_time >= #{reqVO.createTime[0]}
|
||||
</if>
|
||||
<if test="reqVO.createTime[1] != null">
|
||||
and a.create_time <= #{reqVO.createTime[1]}
|
||||
and t.create_time <= #{reqVO.createTime[1]}
|
||||
</if>
|
||||
</if>
|
||||
<if test="reqVO.readStatus != null">
|
||||
and e.read_status = #{reqVO.readStatus}
|
||||
</if>
|
||||
<if test="pagingType == 0">
|
||||
and a.start_user_id != #{userId}
|
||||
</if>
|
||||
<if test="pagingType == 1">
|
||||
and a.start_user_id = #{userId}
|
||||
</if>
|
||||
<if test="reqVO.isBoss != null">
|
||||
and a.start_user_id in
|
||||
and t.start_user_id in
|
||||
<foreach collection="userIds" item="userId" open="(" close=")" separator=",">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
<if test="type == 0">
|
||||
order by id desc
|
||||
ORDER BY
|
||||
t.time DESC,
|
||||
t.create_time DESC
|
||||
</if>
|
||||
<if test="type == 1">
|
||||
order by id asc
|
||||
ORDER BY
|
||||
t.time,
|
||||
t.create_time
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
@ -156,13 +161,11 @@
|
||||
<select id="selectMyPageResult" resultType="cn.iocoder.yudao.module.system.controller.admin.worklog.vo.loginstance.LogInstanceRespVO">
|
||||
SELECT
|
||||
a.*,
|
||||
e.read_status as readStatus,
|
||||
COALESCE(c.readCount, 0) as readCount,
|
||||
COALESCE(d.unreadCount, 0) as unReadCount,
|
||||
COALESCE(b.comment, 0) as comment
|
||||
FROM
|
||||
work_log_instance_ext as a
|
||||
LEFT JOIN work_log_read as e ON a.id = e.log_instance_id and e.read_user_id = #{userId}
|
||||
LEFT JOIN (SELECT log_instance_id, COUNT(log_instance_id) AS readCount FROM work_log_read where read_status = 1 AND deleted = 0 GROUP BY log_instance_id ) AS c ON a.id = c.log_instance_id
|
||||
LEFT JOIN (SELECT log_instance_id, COUNT(log_instance_id) AS unReadCount FROM work_log_read where read_status = 0 AND deleted = 0 GROUP BY log_instance_id ) AS d ON a.id = d.log_instance_id
|
||||
LEFT JOIN (SELECT work_log_id, COUNT(work_log_id) AS comment FROM work_log_comment where deleted = 0 GROUP BY work_log_id) AS b ON a.id = b.work_log_id
|
||||
|
@ -71,7 +71,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
password: ZNredis2024! # 密码,建议生产环境开启
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 47.97.8.94:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
discovery:
|
||||
namespace: prod # 命名空间。这里使用 dev 开发环境
|
||||
metadata:
|
||||
@ -16,7 +16,7 @@ spring:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: 47.97.8.94:8848 # Nacos 服务器地址
|
||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||
namespace: prod # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
|
@ -91,7 +91,7 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
||||
deptRespDTO.setName(updateReqVO.getShortName());
|
||||
deptRespDTO.setLeaderUserId(updateReqVO.getLeaderUserId());
|
||||
deptRespDTO.setFactoryId(updateReqVO.getId());
|
||||
deptApi.updateDept(deptRespDTO);
|
||||
deptApi.updateFactoryDept(deptRespDTO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -259,5 +259,11 @@ public class FactoryInfoServiceImpl implements FactoryInfoService {
|
||||
// 更新
|
||||
FactoryInfoDO updateObj = BeanUtils.toBean(updateReqVO, FactoryInfoDO.class);
|
||||
factoryInfoMapper.updateById(updateObj);
|
||||
|
||||
//同步更新 工厂部门状态
|
||||
DeptRespDTO deptRespDTO = new DeptRespDTO();
|
||||
deptRespDTO.setFactoryId(updateReqVO.getId());
|
||||
deptRespDTO.setStatus(updateReqVO.getStatus());
|
||||
deptApi.updateFactoryDept(deptRespDTO);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 1 # 数据库索引
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
# password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
|
@ -71,7 +71,7 @@ spring:
|
||||
host: 127.0.0.1 # 地址
|
||||
port: 6379 # 端口
|
||||
database: 0 # 数据库索引
|
||||
password: ZNredis2024! # 密码,建议生产环境开启
|
||||
password: yhtkj@2024! # 密码,建议生产环境开启
|
||||
|
||||
--- #################### MQ 消息队列相关配置 ####################
|
||||
|
||||
@ -95,7 +95,7 @@ xxl:
|
||||
job:
|
||||
enabled: true # 是否开启调度中心,默认为 true 开启
|
||||
admin:
|
||||
addresses: http://47.97.8.94:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
addresses: http://127.0.0.1:9090/xxl-job-admin # 调度中心部署跟地址
|
||||
executor:
|
||||
appname: ${spring.application.name} # 执行器 AppName
|
||||
ip: # 执行器IP [选填]:默认为空表示自动获取IP,多网卡时可手动设置指定IP,该IP不会绑定Host仅作为通讯实用;地址信息用于 "执行器注册" 和 "调度中心请求并触发任务";
|
||||
@ -170,4 +170,4 @@ resource:
|
||||
#视频能力
|
||||
video:
|
||||
previewUrls: /artemis/api/video/v2/cameras/previewURLs
|
||||
replayUrlApi: /artemis/api/video/v2/cameras/playbackURLs
|
||||
replayUrlApi: /artemis/api/video/v2/cameras/playbackURLs
|
||||
|
@ -3,7 +3,7 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 47.97.8.94:8848
|
||||
server-addr: 127.0.0.1:8848
|
||||
discovery:
|
||||
namespace: prod # 命名空间。这里使用 dev 开发环境
|
||||
metadata:
|
||||
@ -16,7 +16,7 @@ spring:
|
||||
nacos:
|
||||
# Nacos Config 配置项,对应 NacosConfigProperties 配置属性类
|
||||
config:
|
||||
server-addr: 47.97.8.94:8848 # Nacos 服务器地址
|
||||
server-addr: 127.0.0.1:8848 # Nacos 服务器地址
|
||||
namespace: prod # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name
|
||||
|
Loading…
Reference in New Issue
Block a user