feat(smartfactory): 新增搬运组工资规格关联和每日个人工资记录功能

- 新增搬运组工资规格关联相关的数据结构和接口
- 新增每日个人工资记录相关的数据结构和接口
- 实现搬运组工资规格关联和每日个人工资记录的 CRUD 操作- 添加工厂搬运规格相关的数据结构和接口
- 实现工厂搬运规格的 CRUD 操作
-优化员工相关接口,增加获取当前登录用户所属工厂的功能
This commit is contained in:
aikai 2025-03-25 16:36:29 +08:00
parent ab7111cae3
commit 34d4078199
47 changed files with 2411 additions and 12 deletions

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.framework.common.enums.SocialTypeEnum;
import cn.iocoder.yudao.framework.common.template.dto.ApprovalResultNotificationMessageDTO;
import cn.iocoder.yudao.framework.common.template.dto.PerformanceResultConfirmationReminderDTO;
import cn.iocoder.yudao.framework.common.template.dto.ProcessToDoReminderDTO;
import cn.iocoder.yudao.framework.common.template.dto.StaffCertificateInformationDTO;
import cn.iocoder.yudao.framework.common.template.vo.MsgData;
import cn.iocoder.yudao.framework.common.template.vo.SubscribeMessageReqDTO;
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
@ -149,4 +150,46 @@ public class WxMpMsgTemplateUtils {
return message;
}
/**
* 叉车年检过期提醒
*
* @param dto
* @return
*/
public SubscribeMessageReqDTO forkliftAnnualInspectionExpiredReminder(StaffCertificateInformationDTO dto) {
SubscribeMessageReqDTO message = new SubscribeMessageReqDTO();
message.setToUser(dto.getOpenId());
message.setTemplateId(PERFORMANCE_RESULT_CONFIRMATION_REMINDER);
//证件类型
MsgData certificateName = new MsgData();
certificateName.setName("thing1");
certificateName.setValue(dto.getCertificateName());
message.addData(certificateName);
//到期时间
MsgData time = new MsgData();
time.setName("time2");
time.setValue(dto.getTime());
message.addData(time);
//姓名
MsgData name = new MsgData();
name.setName("thing4");
name.setValue(dto.getTime());
message.addData(name);
//备注
MsgData remarks = new MsgData();
remarks.setName("thing3");
remarks.setValue(dto.getTime());
message.addData(remarks);
message.setJumpWxMaFlag(false);
// message.setMiniProgramState(dto.getMiniProgramState());
// message.setPage(dto.getPage());
message.setSocialType(SocialTypeEnum.WECHAT_MINI_APP.getType());
return message;
}
}

View File

@ -0,0 +1,24 @@
package cn.iocoder.yudao.framework.common.template.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class StaffCertificateInformationDTO {
@Schema(description = "接收者(用户)的 openid")
private String openId;
@Schema(description = "工人名称")
private String userName;
@Schema(description = "证书名称")
private String certificateName;
@Schema(description = "到期时间")
private String time;
@Schema(description = "备注")
private String remarks;
@Schema(description = "跳转小程序类型")
private String miniProgramState = "formal";
@Schema(description = "小程序页面地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "pages/home/index")
private String page;
}

View File

@ -91,9 +91,4 @@ public class CrmContractController {
contractService.check(checkInfoVO);
return success(true);
}
}

View File

@ -36,4 +36,8 @@ public interface ErrorCodeConstants {
ErrorCode STAFF_SALARY_NOT_EXISTS = new ErrorCode(1_000_004_001, "工资记录不存在!");
ErrorCode INDUSTRIAL_INJURY_NOT_EXISTS = new ErrorCode(1_000_004_002, "工伤记录不存在!");
ErrorCode STAFF_SALARY_EXISTS = new ErrorCode(1_000_004_003, "工资记录已存在");
// ========== 搬运模块 1_000_005_000 ==========
ErrorCode CANNOT_FIND_THE_CORRESPONDING_FACTORY_HANDLING_SPECIFICATION = new ErrorCode(1_000_005_001, "找不到对应的工厂搬运规格");
}

View File

@ -0,0 +1,86 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsRespVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsService;
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.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Tag(name = "管理后台 - 搬运组工资规格关联")
@RestController
@RequestMapping("/smartfactory/handling-group-amount-specifications")
@Validated
public class HandlingGroupAmountSpecificationsController {
@Resource
private HandlingGroupAmountSpecificationsService handlingGroupAmountSpecificationsService;
@PostMapping("/createOrEdit")
@Operation(summary = "创建搬运组工资规格关联")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:create')")
public CommonResult<Boolean> createOrEdit(@Valid @RequestBody HandlingGroupAmountSpecificationsSaveReqVO createReqVO) {
handlingGroupAmountSpecificationsService.createOrEdit(createReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除搬运组工资规格关联")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:delete')")
public CommonResult<Boolean> deleteHandlingGroupAmountSpecifications(@RequestParam("id") Long id) {
handlingGroupAmountSpecificationsService.deleteHandlingGroupAmountSpecifications(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得搬运组工资规格关联")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:query')")
public CommonResult<HandlingGroupAmountSpecificationsRespVO> getHandlingGroupAmountSpecifications(@RequestParam("id") Long id) {
HandlingGroupAmountSpecificationsDO handlingGroupAmountSpecifications = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecifications(id);
return success(BeanUtils.toBean(handlingGroupAmountSpecifications, HandlingGroupAmountSpecificationsRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得搬运组工资规格关联分页")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:query')")
public CommonResult<PageResult<HandlingGroupAmountSpecificationsRespVO>> getHandlingGroupAmountSpecificationsPage(@Valid HandlingGroupAmountSpecificationsPageReqVO pageReqVO) {
PageResult<HandlingGroupAmountSpecificationsDO> pageResult = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecificationsPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, HandlingGroupAmountSpecificationsRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出搬运组工资规格关联 Excel")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:export')")
@OperateLog(type = EXPORT)
public void exportHandlingGroupAmountSpecificationsExcel(@Valid HandlingGroupAmountSpecificationsPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<HandlingGroupAmountSpecificationsDO> list = handlingGroupAmountSpecificationsService.getHandlingGroupAmountSpecificationsPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "搬运组工资规格关联.xls", "数据", HandlingGroupAmountSpecificationsRespVO.class,
BeanUtils.toBean(list, HandlingGroupAmountSpecificationsRespVO.class));
}
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 搬运组工资规格关联分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HandlingGroupAmountSpecificationsPageReqVO extends PageParam {
@Schema(description = "搬运规格id", example = "23178")
private Long handlingSpecificationsId;
@Schema(description = "数量", example = "15611")
private Integer totalCount;
@Schema(description = "日期 格式 yyyy-MM-dd")
private String dateStr;
@Schema(description = "总金额(根据规格和总量计算出 该搬运组获得的总金额)")
private BigDecimal amount;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 搬运组工资规格关联 Response VO")
@Data
@ExcelIgnoreUnannotated
public class HandlingGroupAmountSpecificationsRespVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9721")
@ExcelProperty("主键id")
private Long id;
@Schema(description = "搬运规格id", example = "23178")
@ExcelProperty("搬运规格id")
private Long handlingSpecificationsId;
@Schema(description = "搬运规格名称", example = "23178")
@ExcelProperty("搬运规格名称")
private String handlingSpecificationsName;
@Schema(description = "数量", example = "15611")
@ExcelProperty("数量")
private Integer totalCount;
@Schema(description = "日期 格式 yyyy-MM-dd")
@ExcelProperty("日期 格式 yyyy-MM-dd")
private String dateStr;
@Schema(description = "总金额(根据规格和总量计算出 该搬运组获得的总金额)")
@ExcelProperty("总金额(根据规格和总量计算出 该搬运组获得的总金额)")
private BigDecimal amount;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Schema(description = "管理后台 - 搬运组工资规格关联新增/修改 Request VO")
@Data
public class HandlingGroupAmountSpecificationsSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9721")
private Long id;
@Schema(description = "搬运规格id", example = "23178")
@NotNull(message = "搬运规格不能为空")
private Long handlingSpecificationsId;
@Schema(description = "数量", example = "15611")
@NotNull(message = "数量不能为空")
private Integer totalCount;
@Schema(description = "日期 格式 yyyy-MM-dd")
@NotNull(message = "日期不能为空")
private String dateStr;
}

View File

@ -0,0 +1,104 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.dto.StaffWagesPageDTO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.*;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount.HandlingGroupUserAmountService;
@Tag(name = "管理后台 - 搬运组每日个人工资记录")
@RestController
@RequestMapping("/smartfactory/handling-group-user-amount")
@Validated
public class HandlingGroupUserAmountController {
@Resource
private HandlingGroupUserAmountService handlingGroupUserAmountService;
@PostMapping("/createOrEdit")
@Operation(summary = "创建搬运组每日个人工资记录")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:create')")
public CommonResult<Boolean> createOrEdit(@Valid @RequestBody HandlingGroupUserAmountSaveReqVO createReqVO) {
handlingGroupUserAmountService.createOrEdit(createReqVO);
return success(true);
}
@PutMapping("/update")
@Operation(summary = "更新搬运组每日个人工资记录")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:update')")
public CommonResult<Boolean> updateHandlingGroupUserAmount(@Valid @RequestBody HandlingGroupUserAmountSaveReqVO updateReqVO) {
handlingGroupUserAmountService.updateHandlingGroupUserAmount(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除搬运组每日个人工资记录")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:delete')")
public CommonResult<Boolean> deleteHandlingGroupUserAmount(@RequestParam("id") Long id) {
handlingGroupUserAmountService.deleteHandlingGroupUserAmount(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得搬运组每日个人工资记录")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:query')")
public CommonResult<HandlingGroupUserAmountRespVO> getHandlingGroupUserAmount(@RequestParam("id") Long id) {
HandlingGroupUserAmountDO handlingGroupUserAmount = handlingGroupUserAmountService.getHandlingGroupUserAmount(id);
return success(BeanUtils.toBean(handlingGroupUserAmount, HandlingGroupUserAmountRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得搬运组每日个人工资记录分页")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:query')")
public CommonResult<PageResult<HandlingGroupUserAmountRespVO>> getHandlingGroupUserAmountPage(@Valid HandlingGroupUserAmountPageReqVO pageReqVO) {
PageResult<HandlingGroupUserAmountDO> pageResult = handlingGroupUserAmountService.getHandlingGroupUserAmountPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, HandlingGroupUserAmountRespVO.class));
}
@GetMapping("/staffWagesPage")
@Operation(summary = "以用户分组工资分页列表")
public CommonResult<PageResult<StaffWagesPageVO>> staffWagesPage(@Valid StaffWagesPageDTO dto) {
PageResult<StaffWagesPageVO> pageResult = handlingGroupUserAmountService.staffWagesPage(dto);
return success(pageResult);
}
@GetMapping("/export-excel")
@Operation(summary = "导出搬运组每日个人工资记录 Excel")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:export')")
@OperateLog(type = EXPORT)
public void exportHandlingGroupUserAmountExcel(@Valid HandlingGroupUserAmountPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<HandlingGroupUserAmountDO> list = handlingGroupUserAmountService.getHandlingGroupUserAmountPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "搬运组每日个人工资记录.xls", "数据", HandlingGroupUserAmountRespVO.class,
BeanUtils.toBean(list, HandlingGroupUserAmountRespVO.class));
}
}

View File

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.dto;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Data
public class StaffWagesPageDTO extends PageParam {
@Schema(description = "用户id", example = "12639")
private Long userId;
@Schema(description = "工厂id", example = "12639")
private Long factoryId;
@Schema(description = "搬运组工资规格关联id", example = "27617")
private Long handlingGroupAmountSpecificationsId;
@Schema(description = "日期 格式 yyyy-MM-dd")
private String dateStr;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,35 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 搬运组每日个人工资记录分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HandlingGroupUserAmountPageReqVO extends PageParam {
@Schema(description = "用户id", example = "12639")
private Long userId;
@Schema(description = "搬运组工资规格关联id", example = "27617")
private Long handlingGroupAmountSpecificationsId;
@Schema(description = "日期 格式 yyyy-MM-dd")
private String dateStr;
@Schema(description = "搬运组每日个人工资")
private BigDecimal amount;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,45 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 搬运组每日个人工资记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class HandlingGroupUserAmountRespVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17728")
@ExcelProperty("主键id")
private Long id;
@Schema(description = "用户id", example = "12639")
@ExcelProperty("用户id")
private Long userId;
@Schema(description = "用户名称", example = "12639")
@ExcelProperty("用户名称")
private String userName;
@Schema(description = "搬运组工资规格关联id", example = "27617")
@ExcelProperty("搬运组工资规格关联id")
private Long handlingGroupAmountSpecificationsId;
@Schema(description = "日期 格式 yyyy-MM-dd")
@ExcelProperty("日期 格式 yyyy-MM-dd")
private String dateStr;
@Schema(description = "搬运组每日个人工资")
@ExcelProperty("搬运组每日个人工资")
private BigDecimal amount;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,29 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 搬运组每日个人工资记录新增/修改 Request VO")
@Data
public class HandlingGroupUserAmountSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "17728")
private Long id;
@Schema(description = "用户id", example = "12639")
private Long userId;
@Schema(description = "搬运组工资规格关联id", example = "27617")
private Long handlingGroupAmountSpecificationsId;
@Schema(description = "日期 格式 yyyy-MM-dd")
private String dateStr;
@Schema(description = "搬运组每日个人工资")
private BigDecimal amount;
}

View File

@ -0,0 +1,22 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class StaffWagesPageVO {
@Schema(description = "用户id", example = "12639")
@ExcelProperty("用户id")
private Long userId;
@Schema(description = "用户名称", example = "12639")
@ExcelProperty("用户名称")
private String userName;
@Schema(description = "总工资")
@ExcelProperty("总工资")
private BigDecimal totalAmount;
}

View File

@ -0,0 +1,102 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo.*;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
import cn.iocoder.yudao.module.smartfactory.service.handlingspecifications.HandlingSpecificationsService;
@Tag(name = "管理后台 - 工厂搬运规格")
@RestController
@RequestMapping("/smartfactory/handling-specifications")
@Validated
public class HandlingSpecificationsController {
@Resource
private HandlingSpecificationsService handlingSpecificationsService;
@PostMapping("/create")
@Operation(summary = "创建工厂搬运规格")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-specifications:create')")
public CommonResult<Long> createHandlingSpecifications(@Valid @RequestBody HandlingSpecificationsSaveReqVO createReqVO) {
return success(handlingSpecificationsService.createHandlingSpecifications(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工厂搬运规格")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-specifications:update')")
public CommonResult<Boolean> updateHandlingSpecifications(@Valid @RequestBody HandlingSpecificationsSaveReqVO updateReqVO) {
handlingSpecificationsService.updateHandlingSpecifications(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工厂搬运规格")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('smartfactory:handling-specifications:delete')")
public CommonResult<Boolean> deleteHandlingSpecifications(@RequestParam("id") Long id) {
handlingSpecificationsService.deleteHandlingSpecifications(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得工厂搬运规格")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-specifications:query')")
public CommonResult<HandlingSpecificationsRespVO> getHandlingSpecifications(@RequestParam("id") Long id) {
HandlingSpecificationsDO handlingSpecifications = handlingSpecificationsService.getHandlingSpecifications(id);
return success(BeanUtils.toBean(handlingSpecifications, HandlingSpecificationsRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得工厂搬运规格分页")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-specifications:query')")
public CommonResult<PageResult<HandlingSpecificationsRespVO>> getHandlingSpecificationsPage(@Valid HandlingSpecificationsPageReqVO pageReqVO) {
PageResult<HandlingSpecificationsDO> pageResult = handlingSpecificationsService.getHandlingSpecificationsPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, HandlingSpecificationsRespVO.class));
}
@GetMapping("/list")
@Operation(summary = "获得工厂搬运规格列表")
public CommonResult<List<HandlingSpecificationsRespVO>> getHandlingSpecificationsList(@Valid HandlingSpecificationsPageReqVO pageReqVO) {
List<HandlingSpecificationsDO> list = handlingSpecificationsService.getHandlingSpecificationsList(pageReqVO);
return success(BeanUtils.toBean(list, HandlingSpecificationsRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出工厂搬运规格 Excel")
@PreAuthorize("@ss.hasPermission('smartfactory:handling-specifications:export')")
@OperateLog(type = EXPORT)
public void exportHandlingSpecificationsExcel(@Valid HandlingSpecificationsPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<HandlingSpecificationsDO> list = handlingSpecificationsService.getHandlingSpecificationsPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "工厂搬运规格.xls", "数据", HandlingSpecificationsRespVO.class,
BeanUtils.toBean(list, HandlingSpecificationsRespVO.class));
}
}

View File

@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
@Schema(description = "管理后台 - 工厂搬运规格分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HandlingSpecificationsPageReqVO extends PageParam {
@Schema(description = "工厂id", example = "9106")
private Long factoryId;
@Schema(description = "规格名称", example = "张三")
private String specificationsName;
@Schema(description = "类型 0数量 1重量 默认数量", example = "1")
private Integer type;
}

View File

@ -0,0 +1,53 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 工厂搬运规格 Response VO")
@Data
@ExcelIgnoreUnannotated
public class HandlingSpecificationsRespVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26164")
@ExcelProperty("主键id")
private Long id;
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9106")
@ExcelProperty("工厂id")
private Long factoryId;
@Schema(description = "工厂名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "9106")
@ExcelProperty("工厂名称")
private String factoryName;
@Schema(description = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@ExcelProperty("规格名称")
private String specificationsName;
@Schema(description = "类型 0数量 1重量 默认数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("类型 0数量 1重量 默认数量")
private Integer type;
@Schema(description = "重量 /(公斤 kg")
@ExcelProperty("重量 /(公斤 kg")
private BigDecimal weight;
@Schema(description = "数量")
@ExcelProperty("数量")
private Integer num;
@Schema(description = "单价/(吨/1000 or 件) ", requiredMode = Schema.RequiredMode.REQUIRED, example = "18521")
@ExcelProperty("单价/(吨/1000 or 件) ")
private BigDecimal unitPrice;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 工厂搬运规格新增/修改 Request VO")
@Data
public class HandlingSpecificationsSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26164")
private Long id;
@Schema(description = "工厂id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9106")
@NotNull(message = "工厂id不能为空")
private Long factoryId;
@Schema(description = "规格名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
@NotEmpty(message = "规格名称不能为空")
private String specificationsName;
@Schema(description = "类型 0数量 1重量 默认数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "类型 0数量 1重量 默认数量不能为空")
private Integer type;
@Schema(description = "重量 /(公斤 kg")
private BigDecimal weight;
@Schema(description = "数量")
private Integer num;
@Schema(description = "单价/(吨/1000 or 件) ", requiredMode = Schema.RequiredMode.REQUIRED, example = "18521")
@NotNull(message = "单价/(吨/1000 or 件) 不能为空")
private BigDecimal unitPrice;
}

View File

@ -60,6 +60,12 @@ public class StaffController {
return success(staffService.createStaff(createReqVO));
}
@GetMapping("/getTheFactoryOfTheCurrentlyLoggedInUser")
@Operation(summary = "获取当前登录用户所属工厂Id为null就是不属于任何工厂")
public CommonResult<Long> getTheFactoryOfTheCurrentlyLoggedInUser() {
return success(staffService.getTheFactoryOfTheCurrentlyLoggedInUser());
}
@PutMapping("/update")
@Operation(summary = "更新员工")
@PreAuthorize("@ss.hasPermission('factory:staff:update')")
@ -97,6 +103,15 @@ public class StaffController {
return success(BeanUtils.toBean(staffs, StaffRespVO.class));
}
@GetMapping("/getListByFactoryId")
@Operation(summary = "获得指定厂员工")
public CommonResult<List<StaffRespVO>> getListByFactoryId(@RequestParam("factoryId") Long factoryId,
@RequestParam(value = "nickName", required = false) String nickName) {
List<StaffDO> staffs = staffService.getListByFactoryId(factoryId, nickName);
return success(BeanUtils.toBean(staffs, StaffRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得员工分页")
@PreAuthorize("@ss.hasPermission('factory:staff:query')")

View File

@ -0,0 +1,102 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationRespVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation.StaffCertificateInformationDO;
import cn.iocoder.yudao.module.smartfactory.service.staffcertificateinformation.StaffCertificateInformationService;
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.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Tag(name = "管理后台 - 叉车员工证件信息")
@RestController
@RequestMapping("/smartfactory/staff-certificate-information")
@Validated
public class StaffCertificateInformationController {
@Resource
private StaffCertificateInformationService staffCertificateInformationService;
@PostMapping("/create")
@Operation(summary = "创建叉车员工证件信息")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-certificate-information:create')")
public CommonResult<Long> createStaffCertificateInformation(@Valid @RequestBody StaffCertificateInformationSaveReqVO createReqVO) {
return success(staffCertificateInformationService.createStaffCertificateInformation(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新叉车员工证件信息")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-certificate-information:update')")
public CommonResult<Boolean> updateStaffCertificateInformation(@Valid @RequestBody StaffCertificateInformationSaveReqVO updateReqVO) {
staffCertificateInformationService.updateStaffCertificateInformation(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除叉车员工证件信息")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('smartfactory:staff-certificate-information:delete')")
public CommonResult<Boolean> deleteStaffCertificateInformation(@RequestParam("id") Long id) {
staffCertificateInformationService.deleteStaffCertificateInformation(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得叉车员工证件信息")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-certificate-information:query')")
public CommonResult<StaffCertificateInformationRespVO> getStaffCertificateInformation(@RequestParam("id") Long id) {
StaffCertificateInformationDO staffCertificateInformation = staffCertificateInformationService.getStaffCertificateInformation(id);
return success(BeanUtils.toBean(staffCertificateInformation, StaffCertificateInformationRespVO.class));
}
@GetMapping("/getByStaffId")
@Operation(summary = "通过工厂员工ID获得叉车员工证件信息")
@Parameter(name = "staffId", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-certificate-information:query')")
public CommonResult<StaffCertificateInformationRespVO> getByStaffId(@RequestParam("staffId") Long staffId) {
StaffCertificateInformationDO staffCertificateInformation = staffCertificateInformationService.getByStaffId(staffId);
return success(BeanUtils.toBean(staffCertificateInformation, StaffCertificateInformationRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得叉车员工证件信息分页")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-certificate-information:query')")
public CommonResult<PageResult<StaffCertificateInformationRespVO>> getStaffCertificateInformationPage(@Valid StaffCertificateInformationPageReqVO pageReqVO) {
PageResult<StaffCertificateInformationDO> pageResult = staffCertificateInformationService.getStaffCertificateInformationPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, StaffCertificateInformationRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出叉车员工证件信息 Excel")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-certificate-information:export')")
@OperateLog(type = EXPORT)
public void exportStaffCertificateInformationExcel(@Valid StaffCertificateInformationPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<StaffCertificateInformationDO> list = staffCertificateInformationService.getStaffCertificateInformationPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "叉车员工证件信息.xls", "数据", StaffCertificateInformationRespVO.class,
BeanUtils.toBean(list, StaffCertificateInformationRespVO.class));
}
}

View File

@ -0,0 +1,41 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 叉车员工证件信息分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class StaffCertificateInformationPageReqVO extends PageParam {
@Schema(description = "工厂员工id", example = "93")
private Long staffId;
@Schema(description = "身份证正面")
private String idCardFront;
@Schema(description = "身份证反面")
private String idCardReverse;
@Schema(description = "叉车证书")
private String forkliftCertificate;
@Schema(description = "叉车年检信息")
private String forkliftAnnualInspection;
@Schema(description = "年检过期时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] forkliftAnnualInspectionExpiredTime;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -0,0 +1,52 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 叉车员工证件信息 Response VO")
@Data
@ExcelIgnoreUnannotated
public class StaffCertificateInformationRespVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9880")
@ExcelProperty("主键id")
private Long id;
@Schema(description = "工厂员工id", example = "93")
@ExcelProperty("工厂员工id")
private Long staffId;
@Schema(description = "工厂员工名称", example = "93")
@ExcelProperty("工厂员工名称")
private String staffName;
@Schema(description = "身份证正面")
@ExcelProperty("身份证正面")
private String idCardFront;
@Schema(description = "身份证反面")
@ExcelProperty("身份证反面")
private String idCardReverse;
@Schema(description = "叉车证书")
@ExcelProperty("叉车证书")
private String forkliftCertificate;
@Schema(description = "叉车年检信息")
@ExcelProperty("叉车年检信息")
private String forkliftAnnualInspection;
@Schema(description = "年检过期时间")
@ExcelProperty("年检过期时间")
private LocalDateTime forkliftAnnualInspectionExpiredTime;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
}

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 叉车员工证件信息新增/修改 Request VO")
@Data
public class StaffCertificateInformationSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9880")
private Long id;
@Schema(description = "工厂员工id", example = "93")
private Long staffId;
@Schema(description = "身份证正面")
private String idCardFront;
@Schema(description = "身份证反面")
private String idCardReverse;
@Schema(description = "叉车证书")
private String forkliftCertificate;
@Schema(description = "叉车年检信息")
private String forkliftAnnualInspection;
@Schema(description = "年检过期时间")
private LocalDateTime forkliftAnnualInspectionExpiredTime;
public static void main(String[] args) {
System.out.println(new Date().getTime());
}
}

View File

@ -0,0 +1,54 @@
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.math.BigDecimal;
/**
* 搬运组工资规格关联 DO
*
* @author 艾楷
*/
@TableName("sf_handling_group_amount_specifications")
@KeySequence("sf_handling_group_amount_specifications_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HandlingGroupAmountSpecificationsDO extends BaseDO {
/**
* 主键id
*/
@TableId
private Long id;
/**
* 搬运规格id
*/
private Long handlingSpecificationsId;
@TableField(exist = false)
private String handlingSpecificationsName;
/**
* 数量
*/
private Integer totalCount;
/**
* 日期 格式 yyyy-MM-dd
*/
private String dateStr;
/**
* 总金额根据规格和总量计算出 该搬运组获得的总金额
*/
private BigDecimal amount;
}

View File

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.*;
import java.math.BigDecimal;
/**
* 搬运组每日个人工资记录 DO
*
* @author 艾楷
*/
@TableName("sf_handling_group_user_amount")
@KeySequence("sf_handling_group_user_amount_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HandlingGroupUserAmountDO extends BaseDO {
/**
* 主键id
*/
@TableId
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 用户名称
*/
@TableField(exist = false)
private String userName;
/**
* 搬运组工资规格关联id
*/
private Long handlingGroupAmountSpecificationsId;
/**
* 日期 格式 yyyy-MM-dd
*/
private String dateStr;
/**
* 搬运组每日个人工资
*/
private BigDecimal amount;
}

View File

@ -0,0 +1,62 @@
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 工厂搬运规格 DO
*
* @author 艾楷
*/
@TableName("sf_handling_specifications")
@KeySequence("sf_handling_specifications_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HandlingSpecificationsDO extends BaseDO {
/**
* 主键id
*/
@TableId
private Long id;
/**
* 工厂id
*/
private Long factoryId;
/**
* 工厂名称
*/
@TableField(exist = false)
private String factoryName;
/**
* 规格名称
*/
private String specificationsName;
/**
* 类型 0数量 1重量 默认数量
*/
private Integer type;
/**
* 重量 /公斤 kg
*/
private BigDecimal weight;
/**
* 数量
*/
private Integer num;
/**
* 单价//1000 or
*/
private BigDecimal unitPrice;
}

View File

@ -0,0 +1,68 @@
package cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDateTime;
/**
* 叉车员工证件信息 DO
*
* @author 艾楷
*/
@TableName("sf_staff_certificate_information")
@KeySequence("sf_staff_certificate_information_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StaffCertificateInformationDO extends BaseDO {
/**
* 主键id
*/
@TableId
private Long id;
/**
* 工厂员工id
*/
private Long staffId;
/**
* 工厂员工名称
*/
@TableField(exist = false)
private String staffName;
/**
* 身份证正面
*/
private String idCardFront;
/**
* 身份证反面
*/
private String idCardReverse;
/**
* 叉车证书
*/
private String forkliftCertificate;
/**
* 叉车年检信息
*/
private String forkliftAnnualInspection;
/**
* 年检过期时间
*/
private LocalDateTime forkliftAnnualInspectionExpiredTime;
/**
* 年检过期提醒 是否提醒 0否 1是
*/
private Integer reminderFlag;
}

View File

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecifications;
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.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
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;
/**
* 搬运组工资规格关联 Mapper
*
* @author 艾楷
*/
@Mapper
public interface HandlingGroupAmountSpecificationsMapper extends BaseMapperX<HandlingGroupAmountSpecificationsDO> {
default PageResult<HandlingGroupAmountSpecificationsDO> selectPage(HandlingGroupAmountSpecificationsPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<HandlingGroupAmountSpecificationsDO>()
.eqIfPresent(HandlingGroupAmountSpecificationsDO::getHandlingSpecificationsId, reqVO.getHandlingSpecificationsId())
.eqIfPresent(HandlingGroupAmountSpecificationsDO::getTotalCount, reqVO.getTotalCount())
.eqIfPresent(HandlingGroupAmountSpecificationsDO::getDateStr, reqVO.getDateStr())
.eqIfPresent(HandlingGroupAmountSpecificationsDO::getAmount, reqVO.getAmount())
.betweenIfPresent(HandlingGroupAmountSpecificationsDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(HandlingGroupAmountSpecificationsDO::getId));
}
/**
* 获取分页列表
*
* @param page
* @param vo
* @return
*/
IPage<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsPage(@Param("page") Page page, @Param("vo") HandlingGroupAmountSpecificationsPageReqVO vo);
/**
* 获取详情
*
* @param id
* @return
*/
HandlingGroupAmountSpecificationsDO getHandlingGroupAmountSpecifications(@Param("id") Long id);
}

View File

@ -0,0 +1,48 @@
package cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupuseramount;
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.module.smartfactory.controller.admin.handlinggroupuseramount.dto.StaffWagesPageDTO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.StaffWagesPageVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
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;
/**
* 搬运组每日个人工资记录 Mapper
*
* @author 艾楷
*/
@Mapper
public interface HandlingGroupUserAmountMapper extends BaseMapperX<HandlingGroupUserAmountDO> {
default PageResult<HandlingGroupUserAmountDO> selectPage(HandlingGroupUserAmountPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<HandlingGroupUserAmountDO>()
.eqIfPresent(HandlingGroupUserAmountDO::getUserId, reqVO.getUserId())
.eqIfPresent(HandlingGroupUserAmountDO::getHandlingGroupAmountSpecificationsId, reqVO.getHandlingGroupAmountSpecificationsId())
.eqIfPresent(HandlingGroupUserAmountDO::getDateStr, reqVO.getDateStr())
.eqIfPresent(HandlingGroupUserAmountDO::getAmount, reqVO.getAmount())
.betweenIfPresent(HandlingGroupUserAmountDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(HandlingGroupUserAmountDO::getId));
}
/**
* @param page
* @param vo
* @return
*/
IPage<HandlingGroupUserAmountDO> getHandlingGroupUserAmountPage(@Param("page") Page page, @Param("vo") HandlingGroupUserAmountPageReqVO vo);
/**
* 员工工资列表
*
* @param page
* @param dto
* @return
*/
IPage<StaffWagesPageVO> staffWagesPage(@Param("page") Page page, @Param("dto") StaffWagesPageDTO dto);
}

View File

@ -0,0 +1,47 @@
package cn.iocoder.yudao.module.smartfactory.dal.mysql.handlingspecifications;
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.module.smartfactory.controller.admin.handlingspecifications.vo.HandlingSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
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;
import java.util.List;
/**
* 工厂搬运规格 Mapper
*
* @author 艾楷
*/
@Mapper
public interface HandlingSpecificationsMapper extends BaseMapperX<HandlingSpecificationsDO> {
default PageResult<HandlingSpecificationsDO> selectPage(HandlingSpecificationsPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<HandlingSpecificationsDO>()
.eqIfPresent(HandlingSpecificationsDO::getFactoryId, reqVO.getFactoryId())
.likeIfPresent(HandlingSpecificationsDO::getSpecificationsName, reqVO.getSpecificationsName())
.eqIfPresent(HandlingSpecificationsDO::getType, reqVO.getType())
.orderByDesc(HandlingSpecificationsDO::getId));
}
/**
* 分页列表
*
* @param page
* @param vo
* @return
*/
IPage<HandlingSpecificationsDO> getHandlingSpecificationsPage(@Param("page") Page page, @Param("vo") HandlingSpecificationsPageReqVO vo);
/**
* 获取列表
*
* @param vo
* @return
*/
List<HandlingSpecificationsDO> getHandlingSpecificationsList(@Param("vo") HandlingSpecificationsPageReqVO vo);
}

View File

@ -0,0 +1,49 @@
package cn.iocoder.yudao.module.smartfactory.dal.mysql.staffcertificateinformation;
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.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationPageReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation.StaffCertificateInformationDO;
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;
/**
* 叉车员工证件信息 Mapper
*
* @author 艾楷
*/
@Mapper
public interface StaffCertificateInformationMapper extends BaseMapperX<StaffCertificateInformationDO> {
default PageResult<StaffCertificateInformationDO> selectPage(StaffCertificateInformationPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<StaffCertificateInformationDO>()
.eqIfPresent(StaffCertificateInformationDO::getStaffId, reqVO.getStaffId())
.eqIfPresent(StaffCertificateInformationDO::getIdCardFront, reqVO.getIdCardFront())
.eqIfPresent(StaffCertificateInformationDO::getIdCardReverse, reqVO.getIdCardReverse())
.eqIfPresent(StaffCertificateInformationDO::getForkliftCertificate, reqVO.getForkliftCertificate())
.eqIfPresent(StaffCertificateInformationDO::getForkliftAnnualInspection, reqVO.getForkliftAnnualInspection())
.betweenIfPresent(StaffCertificateInformationDO::getForkliftAnnualInspectionExpiredTime, reqVO.getForkliftAnnualInspectionExpiredTime())
.betweenIfPresent(StaffCertificateInformationDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(StaffCertificateInformationDO::getId));
}
/**
* 通过id获取
*
* @param id
* @return
*/
StaffCertificateInformationDO getStaffCertificateInformation(@Param("id") Long id);
/**
* 分页列表
*
* @param page
* @param vo
* @return
*/
IPage<StaffCertificateInformationDO> getStaffCertificateInformationPage(@Param("page") Page page, @Param("vo") StaffCertificateInformationPageReqVO vo);
}

View File

@ -0,0 +1,121 @@
package cn.iocoder.yudao.module.smartfactory.framework.job.staffCertificateInformation;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.map.MapUtil;
import cn.iocoder.yudao.framework.common.Constants;
import cn.iocoder.yudao.framework.common.enums.SocialTypeEnum;
import cn.iocoder.yudao.framework.common.template.WxMpMsgTemplateUtils;
import cn.iocoder.yudao.framework.common.template.dto.StaffCertificateInformationDTO;
import cn.iocoder.yudao.framework.common.template.vo.SubscribeMessageReqDTO;
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation.StaffCertificateInformationDO;
import cn.iocoder.yudao.module.smartfactory.service.staff.StaffService;
import cn.iocoder.yudao.module.smartfactory.service.staffcertificateinformation.StaffCertificateInformationService;
import cn.iocoder.yudao.module.system.api.auth.AdminOauthUserOtherInfoApi;
import cn.iocoder.yudao.module.system.api.auth.dto.AdminOauthUserOtherInfoApiDTO;
import cn.iocoder.yudao.module.system.api.auth.vo.AdminOauthUserOtherInfoApiVO;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.subscribe.SubscribeMessageSendApi;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 员工证件过期提醒 工厂负责人 - 每天下午3点执行 过期前3个月就提醒下
*/
@Component
@Slf4j
public class StaffCertificateInformationJob {
@Resource
private StaffCertificateInformationService staffCertificateInformationService;
@Resource
private StaffService staffService;
@Resource
private DeptApi deptApi;
@Resource
private AdminOauthUserOtherInfoApi adminOauthUserOtherInfoApi;
@Resource
private SubscribeMessageSendApi subscribeMessageSendApi;
private static final String CERTIFICATE_NAME = "叉车年检信息";
private static final String REMARKS = "的叉车年检信息即将到期,请注意!";
@XxlJob("staffCertificateInformationJob")
@TenantJob // --- 这个注解 会将租户列表拉出来 完了后逐个租户执行 定时任务需要注意
public ReturnT<String> execute() throws Exception {
LocalDateTime now = LocalDateTime.now();
now = now.plusMonths(3L);
// 获取当前日期 上个月得第一天
List<StaffCertificateInformationDO> list = staffCertificateInformationService.list(new LambdaQueryWrapper<StaffCertificateInformationDO>()
.eq(StaffCertificateInformationDO::getReminderFlag, 0)
.le(StaffCertificateInformationDO::getForkliftAnnualInspectionExpiredTime, now));
if (CollUtil.isEmpty(list)) {
return ReturnT.SUCCESS;
}
List<Long> ids = list.stream().map(StaffCertificateInformationDO::getId).collect(Collectors.toList());
Map<Long, LocalDateTime> forkliftAnnualInspectionExpiredTimeMap = list.stream().collect(Collectors.toMap(StaffCertificateInformationDO::getStaffId, StaffCertificateInformationDO::getForkliftAnnualInspectionExpiredTime));
// 获取员工id 列表
List<Long> staffIds = list.stream().map(StaffCertificateInformationDO::getStaffId).collect(Collectors.toList());
// 查询员工列表 - 员工列表里面有工厂id 然后拿到工厂id 去查询部门表 获取到工厂负责人
List<StaffDO> staffList = staffService.getList(staffIds);
//根据工厂id分组
Map<Long, List<StaffDO>> map = staffList.stream().collect(Collectors.groupingBy(StaffDO::getFactoryId));
List<Long> factoryIds = new ArrayList<>(map.keySet());
// 查询部门表根据工厂ids
List<DeptRespDTO> deptList = deptApi.getDeptByFactoryIds(factoryIds).getCheckedData();
//工厂负责人map
Map<Long, Long> factoryLeaderUserIdMap = new HashMap<>();
if (CollUtil.isEmpty(deptList)) {
factoryLeaderUserIdMap = deptList.stream().collect(Collectors.toMap(DeptRespDTO::getFactoryId, DeptRespDTO::getLeaderUserId));
}
if (MapUtil.isNotEmpty(factoryLeaderUserIdMap)) {
// -- 获取发起人的openId
List<AdminOauthUserOtherInfoApiVO> adminOauthUserOtherInfoApiVOS = adminOauthUserOtherInfoApi.getOpenIdByCondition(
new AdminOauthUserOtherInfoApiDTO().setUserIds(new ArrayList<>(factoryLeaderUserIdMap.values()))
.setSocialType(SocialTypeEnum.WECHAT_MP.getType())).getCheckedData();
Map<Long, String> leaderOpenIdMap = adminOauthUserOtherInfoApiVOS.stream().collect(Collectors.toMap(AdminOauthUserOtherInfoApiVO::getUserId, AdminOauthUserOtherInfoApiVO::getOpenId));
for (StaffDO staffDO : staffList) {
Long factoryId = staffDO.getFactoryId();
Long leaderUserId = factoryLeaderUserIdMap.get(factoryId);
String leaderOpenId = leaderOpenIdMap.get(leaderUserId);
if (leaderOpenId == null) {
continue;
}
LocalDateTime localDateTime = forkliftAnnualInspectionExpiredTimeMap.get(staffDO.getId());
if (localDateTime == null) {
continue;
}
String time = localDateTime.format(Constants.REPO_DATE_FORMAT);
SubscribeMessageReqDTO dto = new WxMpMsgTemplateUtils().forkliftAnnualInspectionExpiredReminder(new StaffCertificateInformationDTO()
.setOpenId(leaderOpenId)
.setUserName(staffDO.getNickName())
.setCertificateName(CERTIFICATE_NAME)
.setTime(time)
.setRemarks(staffDO.getNickName() + REMARKS)
.setMiniProgramState("formal"));
subscribeMessageSendApi.sendMpMsg(dto);
}
// -- 将这些人设为已经提醒
staffCertificateInformationService.update(new StaffCertificateInformationDO().setReminderFlag(1),
new LambdaQueryWrapper<StaffCertificateInformationDO>()
.in(StaffCertificateInformationDO::getId, ids));
}
// 返回执行成功
return ReturnT.SUCCESS;
}
}

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.bpm.api.oa.BpmOALoanApi;
import cn.iocoder.yudao.module.infra.api.config.ConfigApi;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
import cn.iocoder.yudao.module.system.api.assets.AssetsTypeApi;
import cn.iocoder.yudao.module.system.api.auth.AdminOauthUserOtherInfoApi;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.PostApi;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
@ -20,7 +21,7 @@ import org.springframework.context.annotation.Configuration;
@Configuration(proxyBeanMethods = false)
@EnableFeignClients(clients = {FileApi.class, RoleApi.class, DeptApi.class, PostApi.class, AdminUserApi.class, SmsSendApi.class, DictDataApi.class, NotifyMessageSendApi.class,
SubscribeMessageSendApi.class, ConfigApi.class, PermissionApi.class, AssetsTypeApi.class, LoanApi.class, BpmOALoanApi.class
SubscribeMessageSendApi.class, ConfigApi.class, PermissionApi.class, AssetsTypeApi.class, LoanApi.class, BpmOALoanApi.class, AdminOauthUserOtherInfoApi.class
})
public class RpcConfiguration {
}

View File

@ -0,0 +1,61 @@
package cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
import javax.validation.Valid;
/**
* 搬运组工资规格关联 Service 接口
*
* @author 艾楷
*/
public interface HandlingGroupAmountSpecificationsService {
/**
* 创建搬运组工资规格关联
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createHandlingGroupAmountSpecifications(@Valid HandlingGroupAmountSpecificationsSaveReqVO createReqVO);
/**
* 更新搬运组工资规格关联
*
* @param updateReqVO 更新信息
*/
void updateHandlingGroupAmountSpecifications(@Valid HandlingGroupAmountSpecificationsSaveReqVO updateReqVO);
/**
* 删除搬运组工资规格关联
*
* @param id 编号
*/
void deleteHandlingGroupAmountSpecifications(Long id);
/**
* 获得搬运组工资规格关联
*
* @param id 编号
* @return 搬运组工资规格关联
*/
HandlingGroupAmountSpecificationsDO getHandlingGroupAmountSpecifications(Long id);
/**
* 获得搬运组工资规格关联分页
*
* @param pageReqVO 分页查询
* @return 搬运组工资规格关联分页
*/
PageResult<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsPage(HandlingGroupAmountSpecificationsPageReqVO pageReqVO);
/**
* 新增编辑
*
* @param createReqVO
*/
void createOrEdit(@Valid HandlingGroupAmountSpecificationsSaveReqVO createReqVO);
}

View File

@ -0,0 +1,93 @@
package cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsMapper;
import cn.iocoder.yudao.module.smartfactory.service.handlingspecifications.HandlingSpecificationsService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.math.BigDecimal;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.smartfactory.enums.ErrorCodeConstants.CANNOT_FIND_THE_CORRESPONDING_FACTORY_HANDLING_SPECIFICATION;
/**
* 搬运组工资规格关联 Service 实现类
*
* @author 艾楷
*/
@Service
@Validated
public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGroupAmountSpecificationsService {
@Resource
private HandlingGroupAmountSpecificationsMapper handlingGroupAmountSpecificationsMapper;
@Resource
private HandlingSpecificationsService handlingSpecificationsService;
private static final BigDecimal THOUSANDTH = new BigDecimal("0.001");
@Override
public Long createHandlingGroupAmountSpecifications(HandlingGroupAmountSpecificationsSaveReqVO createReqVO) {
// 插入
HandlingGroupAmountSpecificationsDO handlingGroupAmountSpecifications = BeanUtils.toBean(createReqVO, HandlingGroupAmountSpecificationsDO.class);
handlingGroupAmountSpecificationsMapper.insert(handlingGroupAmountSpecifications);
// 返回
return handlingGroupAmountSpecifications.getId();
}
@Override
public void updateHandlingGroupAmountSpecifications(HandlingGroupAmountSpecificationsSaveReqVO updateReqVO) {
// 更新
HandlingGroupAmountSpecificationsDO updateObj = BeanUtils.toBean(updateReqVO, HandlingGroupAmountSpecificationsDO.class);
handlingGroupAmountSpecificationsMapper.updateById(updateObj);
}
@Override
public void deleteHandlingGroupAmountSpecifications(Long id) {
// 删除
handlingGroupAmountSpecificationsMapper.deleteById(id);
}
@Override
public HandlingGroupAmountSpecificationsDO getHandlingGroupAmountSpecifications(Long id) {
return handlingGroupAmountSpecificationsMapper.getHandlingGroupAmountSpecifications(id);
}
@Override
public PageResult<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsPage(HandlingGroupAmountSpecificationsPageReqVO pageReqVO) {
IPage<HandlingGroupAmountSpecificationsDO> pageResult = handlingGroupAmountSpecificationsMapper.getHandlingGroupAmountSpecificationsPage(MyBatisUtils.buildPage(pageReqVO), pageReqVO);
return new PageResult<>(pageResult.getRecords(), pageResult.getTotal());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void createOrEdit(HandlingGroupAmountSpecificationsSaveReqVO createReqVO) {
HandlingSpecificationsDO handlingSpecificationsDO = handlingSpecificationsService.getById(createReqVO.getHandlingSpecificationsId());
if (handlingSpecificationsDO == null) {
throw exception(CANNOT_FIND_THE_CORRESPONDING_FACTORY_HANDLING_SPECIFICATION);
}
BigDecimal totalAmount;
if (handlingSpecificationsDO.getType() == 0) {
totalAmount = new BigDecimal(createReqVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getUnitPrice());
} else {
totalAmount = new BigDecimal(createReqVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getWeight())
.multiply(handlingSpecificationsDO.getUnitPrice().multiply(THOUSANDTH));
}
// 插入
HandlingGroupAmountSpecificationsDO handlingGroupAmountSpecifications = BeanUtils.toBean(createReqVO, HandlingGroupAmountSpecificationsDO.class);
handlingGroupAmountSpecifications.setAmount(totalAmount);
handlingGroupAmountSpecificationsMapper.insertOrUpdate(handlingGroupAmountSpecifications);
}
}

View File

@ -0,0 +1,71 @@
package cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.dto.StaffWagesPageDTO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.StaffWagesPageVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
import javax.validation.Valid;
/**
* 搬运组每日个人工资记录 Service 接口
*
* @author 艾楷
*/
public interface HandlingGroupUserAmountService {
/**
* 创建搬运组每日个人工资记录
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createHandlingGroupUserAmount(@Valid HandlingGroupUserAmountSaveReqVO createReqVO);
/**
* 更新搬运组每日个人工资记录
*
* @param updateReqVO 更新信息
*/
void updateHandlingGroupUserAmount(@Valid HandlingGroupUserAmountSaveReqVO updateReqVO);
/**
* 删除搬运组每日个人工资记录
*
* @param id 编号
*/
void deleteHandlingGroupUserAmount(Long id);
/**
* 获得搬运组每日个人工资记录
*
* @param id 编号
* @return 搬运组每日个人工资记录
*/
HandlingGroupUserAmountDO getHandlingGroupUserAmount(Long id);
/**
* 获得搬运组每日个人工资记录分页
*
* @param pageReqVO 分页查询
* @return 搬运组每日个人工资记录分页
*/
PageResult<HandlingGroupUserAmountDO> getHandlingGroupUserAmountPage(HandlingGroupUserAmountPageReqVO pageReqVO);
/**
* 新增编辑
*
* @param createReqVO
*/
void createOrEdit(@Valid HandlingGroupUserAmountSaveReqVO createReqVO);
/**
* 员工工资分页列表
*
* @param dto
* @return
*/
PageResult<StaffWagesPageVO> staffWagesPage(@Valid StaffWagesPageDTO dto);
}

View File

@ -0,0 +1,79 @@
package cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.dto.StaffWagesPageDTO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.StaffWagesPageVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupuseramount.HandlingGroupUserAmountMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
/**
* 搬运组每日个人工资记录 Service 实现类
*
* @author 艾楷
*/
@Service
@Validated
public class HandlingGroupUserAmountServiceImpl implements HandlingGroupUserAmountService {
@Resource
private HandlingGroupUserAmountMapper handlingGroupUserAmountMapper;
@Override
public Long createHandlingGroupUserAmount(HandlingGroupUserAmountSaveReqVO createReqVO) {
// 插入
HandlingGroupUserAmountDO handlingGroupUserAmount = BeanUtils.toBean(createReqVO, HandlingGroupUserAmountDO.class);
handlingGroupUserAmountMapper.insert(handlingGroupUserAmount);
// 返回
return handlingGroupUserAmount.getId();
}
@Override
public void updateHandlingGroupUserAmount(HandlingGroupUserAmountSaveReqVO updateReqVO) {
// 更新
HandlingGroupUserAmountDO updateObj = BeanUtils.toBean(updateReqVO, HandlingGroupUserAmountDO.class);
handlingGroupUserAmountMapper.updateById(updateObj);
}
@Override
public void deleteHandlingGroupUserAmount(Long id) {
// 删除
handlingGroupUserAmountMapper.deleteById(id);
}
@Override
public HandlingGroupUserAmountDO getHandlingGroupUserAmount(Long id) {
return handlingGroupUserAmountMapper.selectById(id);
}
@Override
public PageResult<HandlingGroupUserAmountDO> getHandlingGroupUserAmountPage(HandlingGroupUserAmountPageReqVO pageReqVO) {
IPage<HandlingGroupUserAmountDO> page = handlingGroupUserAmountMapper.getHandlingGroupUserAmountPage(MyBatisUtils.buildPage(pageReqVO) ,pageReqVO);
return new PageResult<>(page.getRecords(), page.getTotal());
}
@Override
@Transactional(rollbackFor = Exception.class)
public void createOrEdit(HandlingGroupUserAmountSaveReqVO createReqVO) {
// 插入
HandlingGroupUserAmountDO handlingGroupUserAmount = BeanUtils.toBean(createReqVO, HandlingGroupUserAmountDO.class);
handlingGroupUserAmountMapper.insertOrUpdate(handlingGroupUserAmount);
}
@Override
public PageResult<StaffWagesPageVO> staffWagesPage(StaffWagesPageDTO dto) {
IPage<StaffWagesPageVO> page = handlingGroupUserAmountMapper.staffWagesPage(MyBatisUtils.buildPage(dto) ,dto);
return new PageResult<>(page.getRecords(), page.getTotal());
}
}

View File

@ -0,0 +1,64 @@
package cn.iocoder.yudao.module.smartfactory.service.handlingspecifications;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo.HandlingSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo.HandlingSpecificationsSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.validation.Valid;
import java.util.List;
/**
* 工厂搬运规格 Service 接口
*
* @author 艾楷
*/
public interface HandlingSpecificationsService extends IService<HandlingSpecificationsDO> {
/**
* 创建工厂搬运规格
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createHandlingSpecifications(@Valid HandlingSpecificationsSaveReqVO createReqVO);
/**
* 更新工厂搬运规格
*
* @param updateReqVO 更新信息
*/
void updateHandlingSpecifications(@Valid HandlingSpecificationsSaveReqVO updateReqVO);
/**
* 删除工厂搬运规格
*
* @param id 编号
*/
void deleteHandlingSpecifications(Long id);
/**
* 获得工厂搬运规格
*
* @param id 编号
* @return 工厂搬运规格
*/
HandlingSpecificationsDO getHandlingSpecifications(Long id);
/**
* 获得工厂搬运规格分页
*
* @param pageReqVO 分页查询
* @return 工厂搬运规格分页
*/
PageResult<HandlingSpecificationsDO> getHandlingSpecificationsPage(HandlingSpecificationsPageReqVO pageReqVO);
/**
* 获取列表
*
* @param pageReqVO
* @return
*/
List<HandlingSpecificationsDO> getHandlingSpecificationsList(@Valid HandlingSpecificationsPageReqVO pageReqVO);
}

View File

@ -0,0 +1,69 @@
package cn.iocoder.yudao.module.smartfactory.service.handlingspecifications;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo.HandlingSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlingspecifications.vo.HandlingSpecificationsSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlingspecifications.HandlingSpecificationsMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* 工厂搬运规格 Service 实现类
*
* @author 艾楷
*/
@Service
@Validated
public class HandlingSpecificationsServiceImpl extends ServiceImpl<HandlingSpecificationsMapper, HandlingSpecificationsDO> implements HandlingSpecificationsService {
@Resource
private HandlingSpecificationsMapper handlingSpecificationsMapper;
@Override
public Long createHandlingSpecifications(HandlingSpecificationsSaveReqVO createReqVO) {
// 插入
HandlingSpecificationsDO handlingSpecifications = BeanUtils.toBean(createReqVO, HandlingSpecificationsDO.class);
handlingSpecificationsMapper.insert(handlingSpecifications);
// 返回
return handlingSpecifications.getId();
}
@Override
public void updateHandlingSpecifications(HandlingSpecificationsSaveReqVO updateReqVO) {
// 更新
HandlingSpecificationsDO updateObj = BeanUtils.toBean(updateReqVO, HandlingSpecificationsDO.class);
handlingSpecificationsMapper.updateById(updateObj);
}
@Override
public void deleteHandlingSpecifications(Long id) {
// 删除
handlingSpecificationsMapper.deleteById(id);
}
@Override
public HandlingSpecificationsDO getHandlingSpecifications(Long id) {
return handlingSpecificationsMapper.selectById(id);
}
@Override
public PageResult<HandlingSpecificationsDO> getHandlingSpecificationsPage(HandlingSpecificationsPageReqVO pageReqVO) {
IPage<HandlingSpecificationsDO> page = handlingSpecificationsMapper.getHandlingSpecificationsPage(MyBatisUtils.buildPage(pageReqVO) ,pageReqVO);
return new PageResult<>(page.getRecords(), page.getTotal());
}
@Override
public List<HandlingSpecificationsDO> getHandlingSpecificationsList(HandlingSpecificationsPageReqVO pageReqVO) {
return handlingSpecificationsMapper.getHandlingSpecificationsList(pageReqVO);
}
}

View File

@ -1,8 +1,11 @@
package cn.iocoder.yudao.module.smartfactory.service.staff;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.*;
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.StaffDataRespVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffImportExcelVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffImportRespVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
import javax.validation.Valid;
@ -64,12 +67,14 @@ public interface StaffService {
/**
* 获取人员数量
*
* @return
*/
Integer getCount();
/**
* 查询工厂员工信息
*
* @param factoryId 工厂编号
* @return
*/
@ -77,6 +82,7 @@ public interface StaffService {
/**
* 导入员工
*
* @param list 导入数据集合
* @param updateSupport 是否可更新
* @return 导入结果
@ -102,8 +108,25 @@ public interface StaffService {
/**
* 获取员工信息列表
*
* @param staffIds 员工编号集合
* @return 员工信息列表
*/
List<StaffDO> getList(Collection<Long> staffIds);
/**
* 获得指定工厂员工
*
* @param factoryId
* @param nickName
* @return
*/
List<StaffDO> getListByFactoryId(Long factoryId, String nickName);
/**
*
* @param userId
* @return
*/
Long getTheFactoryOfTheCurrentlyLoggedInUser();
}

View File

@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.common.util.string.DTO.IdCardDO;
import cn.iocoder.yudao.framework.common.util.string.StrUtils;
import cn.iocoder.yudao.framework.datapermission.core.util.DataPermissionUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.smartfactory.controller.admin.screendata.factory.vo.StaffDataRespVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffImportExcelVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffImportRespVO;
@ -16,8 +17,12 @@ import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffPageR
import cn.iocoder.yudao.module.smartfactory.controller.admin.staff.vo.StaffSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staff.StaffDO;
import cn.iocoder.yudao.module.smartfactory.dal.mysql.staff.StaffMapper;
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
@ -46,6 +51,10 @@ public class StaffServiceImpl implements StaffService {
@Resource
private DictDataApi dictDataApi;
@Resource
private DeptApi deptApi;
@Resource
private AdminUserApi adminUserApi;
@Override
public Long createStaff(StaffSaveReqVO createReqVO) {
@ -238,4 +247,31 @@ public class StaffServiceImpl implements StaffService {
public List<StaffDO> getList(Collection<Long> staffIds) {
return staffMapper.selectList(StaffDO::getId, staffIds);
}
@Override
public List<StaffDO> getListByFactoryId(Long factoryId, String nickName) {
return staffMapper.selectList(new LambdaQueryWrapperX<StaffDO>()
.eq(factoryId != null, StaffDO::getFactoryId, factoryId)
.like(StrUtil.isNotEmpty(nickName), StaffDO::getNickName, nickName));
}
@Override
public Long getTheFactoryOfTheCurrentlyLoggedInUser() {
Long userId = SecurityFrameworkUtils.getLoginUserId();
//获取当前登录用户
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(userId).getCheckedData();
Long deptId = null;
if (adminUserRespDTO != null) {
deptId = adminUserRespDTO.getDeptId();
}
DeptRespDTO dto = null;
if (deptId != null) {
dto = deptApi.getDept(deptId).getCheckedData();
}
// 获取当前登录用户所属部门
if (dto == null) {
return null;
}
return dto.getFactoryId();
}
}

View File

@ -0,0 +1,63 @@
package cn.iocoder.yudao.module.smartfactory.service.staffcertificateinformation;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation.StaffCertificateInformationDO;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.validation.Valid;
/**
* 叉车员工证件信息 Service 接口
*
* @author 艾楷
*/
public interface StaffCertificateInformationService extends IService<StaffCertificateInformationDO> {
/**
* 创建叉车员工证件信息
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createStaffCertificateInformation(@Valid StaffCertificateInformationSaveReqVO createReqVO);
/**
* 更新叉车员工证件信息
*
* @param updateReqVO 更新信息
*/
void updateStaffCertificateInformation(@Valid StaffCertificateInformationSaveReqVO updateReqVO);
/**
* 删除叉车员工证件信息
*
* @param id 编号
*/
void deleteStaffCertificateInformation(Long id);
/**
* 获得叉车员工证件信息
*
* @param id 编号
* @return 叉车员工证件信息
*/
StaffCertificateInformationDO getStaffCertificateInformation(Long id);
/**
* 获得叉车员工证件信息分页
*
* @param pageReqVO 分页查询
* @return 叉车员工证件信息分页
*/
PageResult<StaffCertificateInformationDO> getStaffCertificateInformationPage(StaffCertificateInformationPageReqVO pageReqVO);
/**
* 通过员工ID获得叉车员工证件信息
*
* @param staffId
* @return
*/
StaffCertificateInformationDO getByStaffId(Long staffId);
}

View File

@ -0,0 +1,77 @@
package cn.iocoder.yudao.module.smartfactory.service.staffcertificateinformation;
import cn.iocoder.yudao.framework.common.Constants;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.staffcertificateinformation.vo.StaffCertificateInformationSaveReqVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation.StaffCertificateInformationDO;
import cn.iocoder.yudao.module.smartfactory.dal.mysql.staffcertificateinformation.StaffCertificateInformationMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
/**
* 叉车员工证件信息 Service 实现类
*
* @author 艾楷
*/
@Service
@Validated
public class StaffCertificateInformationServiceImpl extends ServiceImpl<StaffCertificateInformationMapper, StaffCertificateInformationDO> implements StaffCertificateInformationService {
@Resource
private StaffCertificateInformationMapper staffCertificateInformationMapper;
@Override
public Long createStaffCertificateInformation(StaffCertificateInformationSaveReqVO createReqVO) {
// 插入
StaffCertificateInformationDO staffCertificateInformation = BeanUtils.toBean(createReqVO, StaffCertificateInformationDO.class);
staffCertificateInformationMapper.insert(staffCertificateInformation);
// 返回
return staffCertificateInformation.getId();
}
@Override
public void updateStaffCertificateInformation(StaffCertificateInformationSaveReqVO updateReqVO) {
// 更新
StaffCertificateInformationDO updateObj = BeanUtils.toBean(updateReqVO, StaffCertificateInformationDO.class);
// 判断时间是否有过改动 - 有的话 设置为未提醒
StaffCertificateInformationDO staffCertificateInformation = this.getStaffCertificateInformation(updateObj.getId());
String oldTimeStr = staffCertificateInformation.getForkliftAnnualInspectionExpiredTime().format(Constants.REPO_DATE_FORMAT);
String newTimeStr = updateObj.getForkliftAnnualInspectionExpiredTime().format(Constants.REPO_DATE_FORMAT);
if (!oldTimeStr.equals(newTimeStr)) {
updateObj.setReminderFlag(0);
}
staffCertificateInformationMapper.updateById(updateObj);
}
@Override
public void deleteStaffCertificateInformation(Long id) {
// 删除
staffCertificateInformationMapper.deleteById(id);
}
@Override
public StaffCertificateInformationDO getStaffCertificateInformation(Long id) {
return staffCertificateInformationMapper.getStaffCertificateInformation(id);
}
@Override
public PageResult<StaffCertificateInformationDO> getStaffCertificateInformationPage(StaffCertificateInformationPageReqVO pageReqVO) {
IPage<StaffCertificateInformationDO> page = staffCertificateInformationMapper.getStaffCertificateInformationPage(MyBatisUtils.buildPage(pageReqVO), pageReqVO);
return new PageResult<>(page.getRecords(), page.getTotal());
}
@Override
public StaffCertificateInformationDO getByStaffId(Long staffId) {
return staffCertificateInformationMapper.selectOne(new LambdaQueryWrapper<StaffCertificateInformationDO>()
.eq(StaffCertificateInformationDO::getStaffId, staffId));
}
}

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getHandlingGroupAmountSpecificationsPage"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO">
SELECT a.*,
b.specifications_name as handlingSpecificationsName
FROM sf_handling_group_amount_specifications AS a
LEFT JOIN sf_handling_specifications AS b ON a.handling_specifications_id = b.id
<where>
a.deleted = 0
and b.deleted = 0
<if test="vo.handlingSpecificationsId != null">
AND a.handling_specifications_id = #{vo.handlingSpecificationsId}
</if>
<if test="vo.dateStr != null and vo.dateStr != ''">
and a.date_str like concat('%', #{vo.dateStr}, '%')
</if>
</where>
</select>
<select id="getHandlingGroupAmountSpecifications"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO">
SELECT a.*,
b.specifications_name as handlingSpecificationsName
FROM sf_handling_group_amount_specifications AS a
LEFT JOIN sf_handling_specifications AS b ON a.handling_specifications_id = b.id
<where>
a.deleted = 0
and b.deleted = 0
and a.id = #{id}
</where>
</select>
</mapper>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupuseramount.HandlingGroupUserAmountMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getHandlingGroupUserAmountPage"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO">
SELECT a.*,
b.nick_name as userName
FROM sf_handling_group_user_amount as a
LEFT JOIN sf_staff as b on a.user_id = b.id
<where>
a.deleted = 0
and b.deleted = 0
<if test="vo.userId != null">
AND a.user_id = #{vo.userId}
</if>
<if test="vo.handlingGroupAmountSpecificationsId != null">
AND a.handling_group_amount_specifications_id= #{vo.handlingGroupAmountSpecificationsId}
</if>
<if test="vo.dateStr != null and vo.dateStr != ''">
and a.dateStr like concat('%', #{vo.dateStr}, '%')
</if>
<if test="vo.createTime != null and vo.createTime.length > 0">
<if test="vo.createTime[0] != null">
and a.create_time &gt;= #{vo.createTime[0]}
</if>
<if test="vo.createTime[1] != null">
and a.create_time &lt;= #{vo.createTime[1]}
</if>
</if>
</where>
</select>
<select id="staffWagesPage"
resultType="cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.StaffWagesPageVO">
select
a.id as userId,
a.nick_name as userName,
IFNULL(sum( b.amount ),0) AS totalAmount
from sf_staff as a
left join sf_handling_group_user_amount as b on a.id = b.user_id
<where>
a.deleted = 0
and b.deleted = 0
<if test="dto.userId != null">
AND a.id = #{dto.userId}
</if>
<if test="dto.factoryId != null">
AND a.factory_id = #{dto.factoryId}
</if>
<if test="dto.handlingGroupAmountSpecificationsId != null">
AND b.handling_group_amount_specifications_id = #{dto.handlingGroupAmountSpecificationsId}
</if>
<if test="dto.dateStr != null and dto.dateStr != ''">
and b.date_str like concat('%', #{dto.dateStr}, '%')
</if>
<if test="dto.createTime != null and dto.createTime.length > 0">
<if test="dto.createTime[0] != null">
and b.create_time &gt;= #{dto.createTime[0]}
</if>
<if test="dto.createTime[1] != null">
and b.create_time &lt;= #{dto.createTime[1]}
</if>
</if>
</where>
group by a.id
</select>
</mapper>

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.smartfactory.dal.mysql.handlingspecifications.HandlingSpecificationsMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getHandlingSpecificationsPage"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO">
select
a.*,
b.short_name as factoryName
from sf_handling_specifications as a
left join sf_factory_info as b on a.factory_id = b.id
<where>
a.deleted = 0
and b.deleted = 0
<if test="vo.factoryId != null">
and a.factory_id = #{vo.factoryId}
</if>
<if test="vo.specificationsName != null and vo.specificationsName != ''">
and a.specifications_name like concat('%', #{vo.specificationsName}, '%')
</if>
<if test="vo.type != null">
and a.type = #{vo.type}
</if>
</where>
</select>
<select id="getHandlingSpecificationsList"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO">
select
a.*,
b.short_name as factoryName
from sf_handling_specifications as a
left join sf_factory_info as b on a.factory_id = b.id
<where>
a.deleted = 0
and b.deleted = 0
<if test="vo.factoryId != null">
and a.factory_id = #{vo.factoryId}
</if>
<if test="vo.specificationsName != null and vo.specificationsName != ''">
and a.specifications_name like concat('%', #{vo.specificationsName}, '%')
</if>
<if test="vo.type != null">
and a.type = #{vo.type}
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.smartfactory.dal.mysql.staffcertificateinformation.StaffCertificateInformationMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getStaffCertificateInformation"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation.StaffCertificateInformationDO">
select
a.*,
b.nick_name as staffName
from sf_staff_certificate_information as a
left join sf_staff as b on a.staff_id = b.id
<where>
a.deleted = 0
and b.deleted = 0
<if test="id != null">
and a.id = #{id}
</if>
</where>
</select>
<select id="getStaffCertificateInformationPage"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.staffcertificateinformation.StaffCertificateInformationDO">
select
a.*,
b.nick_name as staffName
from sf_staff_certificate_information as a
left join sf_staff as b on a.staff_id = b.id
<where>
a.deleted = 0
and b.deleted = 0
<if test="vo.staffId != null">
and a.staff_id = #{vo.staffId}
</if>
<if test="vo.createTime != null and vo.createTime.length > 0">
<if test="vo.createTime[0] != null">
and a.create_time &gt;= #{vo.createTime[0]}
</if>
<if test="vo.createTime[1] != null">
and a.create_time &lt;= #{vo.createTime[1]}
</if>
</if>
</where>
</select>
</mapper>