Merge branch 'dev' of http://git.znkjfw.com/ak/zn-cloud into frx

This commit is contained in:
furongxin 2025-05-17 14:39:01 +08:00
commit 52fc51c738
17 changed files with 289 additions and 45 deletions

View File

@ -1,15 +1,21 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications; package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsTotalNumDTO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.*; import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.*;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountItemVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO; import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
import cn.iocoder.yudao.module.smartfactory.service.factoryinfo.FactoryInfoService; import cn.iocoder.yudao.module.smartfactory.service.factoryinfo.FactoryInfoService;
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsService; import cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsService;
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount.HandlingGroupUserAmountService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -21,6 +27,7 @@ import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -37,6 +44,8 @@ public class HandlingGroupAmountSpecificationsController {
@Resource @Resource
private HandlingGroupAmountSpecificationsService handlingGroupAmountSpecificationsService; private HandlingGroupAmountSpecificationsService handlingGroupAmountSpecificationsService;
@Resource
private HandlingGroupUserAmountService handlingGroupUserAmountService;
@Resource @Resource
private FactoryInfoService factoryInfoService; private FactoryInfoService factoryInfoService;
@ -50,11 +59,20 @@ public class HandlingGroupAmountSpecificationsController {
@GetMapping("/getTotalNum") @GetMapping("/getTotalNum")
@Operation(summary = "获取合计数") @Operation(summary = "获取合计数")
public CommonResult<HandlingGroupAmountSpecificationsTotalNumVO> getTotalNum(@RequestParam(required = false) Long factoryId) { public CommonResult<HandlingGroupAmountSpecificationsTotalNumVO> getTotalNum(@Valid HandlingGroupAmountSpecificationsTotalNumDTO dto) {
HandlingGroupAmountSpecificationsTotalNumVO vo = handlingGroupAmountSpecificationsService.getTotalNum(factoryId); HandlingGroupAmountSpecificationsTotalNumVO vo = handlingGroupAmountSpecificationsService.getTotalNum(dto);
return success(vo); return success(vo);
} }
@GetMapping("/getAmountSubtotal")
@Operation(summary = "获取金额小计")
public CommonResult<BigDecimal> getAmountSubtotal(@RequestParam Integer totalCount,
@RequestParam Long handlingSpecificationsId) {
BigDecimal amount = handlingGroupAmountSpecificationsService.getAmountSubtotal(totalCount, handlingSpecificationsId);
return success(amount);
}
@PostMapping("/batchUpdate") @PostMapping("/batchUpdate")
@Operation(summary = "批量更新搬运组工资规格关联") @Operation(summary = "批量更新搬运组工资规格关联")
public CommonResult<Boolean> batchUpdate(@Valid @RequestBody HandlingGroupAmountSpecificationsBatchUpdateVO vo) { public CommonResult<Boolean> batchUpdate(@Valid @RequestBody HandlingGroupAmountSpecificationsBatchUpdateVO vo) {
@ -88,10 +106,21 @@ public class HandlingGroupAmountSpecificationsController {
PageResult<HandlingGroupAmountSpecificationsRespVO> result = BeanUtils.toBean(pageResult, HandlingGroupAmountSpecificationsRespVO.class); PageResult<HandlingGroupAmountSpecificationsRespVO> result = BeanUtils.toBean(pageResult, HandlingGroupAmountSpecificationsRespVO.class);
// 计算合计 - 先根据工厂+搬运组+日期进行分组 // 计算合计 - 先根据工厂+搬运组+日期进行分组
Map<String, List<HandlingGroupAmountSpecificationsRespVO>> map = result.getList().stream().collect(Collectors.groupingBy(a -> a.getFactoryId() + "_" + a.getHandlingGroupId() + "_" + a.getDateStr())); Map<String, List<HandlingGroupAmountSpecificationsRespVO>> map = result.getList().stream().collect(Collectors.groupingBy(a -> a.getFactoryId() + "_" + a.getHandlingGroupId() + "_" + a.getDateStr()));
List<Long> ids = result.getList().stream().map(HandlingGroupAmountSpecificationsRespVO::getId).collect(Collectors.toList());
Map<Long, List<HandlingGroupUserAmountDO>> handlingGroupUserAmountMap = new HashMap<>();
if (CollUtil.isNotEmpty(ids)) {
List<HandlingGroupUserAmountDO> list = handlingGroupUserAmountService.getByHandlingGroupAmountSpecificationsId(ids);
handlingGroupUserAmountMap = list.stream().collect(Collectors.groupingBy(HandlingGroupUserAmountDO::getHandlingGroupAmountSpecificationsId));
}
for (HandlingGroupAmountSpecificationsRespVO handlingGroupAmountSpecificationsDO : result.getList()) { for (HandlingGroupAmountSpecificationsRespVO handlingGroupAmountSpecificationsDO : result.getList()) {
String key = handlingGroupAmountSpecificationsDO.getFactoryId() + "_" + handlingGroupAmountSpecificationsDO.getHandlingGroupId() + "_" + handlingGroupAmountSpecificationsDO.getDateStr(); String key = handlingGroupAmountSpecificationsDO.getFactoryId() + "_" + handlingGroupAmountSpecificationsDO.getHandlingGroupId() + "_" + handlingGroupAmountSpecificationsDO.getDateStr();
handlingGroupAmountSpecificationsDO.setTotalAmount(getSumValue(map.get(key), HandlingGroupAmountSpecificationsRespVO::getAmount, BigDecimal::add)); handlingGroupAmountSpecificationsDO.setTotalAmount(getSumValue(map.get(key), HandlingGroupAmountSpecificationsRespVO::getAmount, BigDecimal::add));
handlingGroupAmountSpecificationsDO.setTotalNum(getSumValue(map.get(key), HandlingGroupAmountSpecificationsRespVO::getTotalCount, Integer::sum)); handlingGroupAmountSpecificationsDO.setTotalNum(getSumValue(map.get(key), HandlingGroupAmountSpecificationsRespVO::getTotalCount, Integer::sum));
List<HandlingGroupUserAmountDO> items = handlingGroupUserAmountMap.get(handlingGroupAmountSpecificationsDO.getId());
if (CollUtil.isNotEmpty(items)) {
List<HandlingGroupUserAmountItemVO> handlingGroupUserAmountItemVOS = BeanUtils.toBean(items, HandlingGroupUserAmountItemVO.class);
handlingGroupAmountSpecificationsDO.setHandlingGroupUserAmountItemVOS(handlingGroupUserAmountItemVOS);
}
} }
return success(result); return success(result);
} }

View File

@ -0,0 +1,26 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.ToString;
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
@ToString(callSuper = true)
public class HandlingGroupAmountSpecificationsTotalNumDTO {
@Schema(description = "工厂id")
private Long factoryId;
@Schema(description = "规格id")
private Long handlingSpecificationsId;
@Schema(description = "叉车司机名称")
private String forkliftDriverName;
@Schema(description = "搬运工名称")
private String porterName;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
}

View File

@ -28,6 +28,9 @@ public class HandlingGroupAmountSpecificationsPageReqVO extends PageParam {
@Schema(description = "叉车司机名称", example = "23178") @Schema(description = "叉车司机名称", example = "23178")
private String staffName; private String staffName;
@Schema(description = "搬运工名称", example = "23178")
private String porterName;
@Schema(description = "搬运规格id", example = "23178") @Schema(description = "搬运规格id", example = "23178")
private Long handlingSpecificationsId; private Long handlingSpecificationsId;

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo; package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountItemVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountRespVO;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -7,6 +9,7 @@ import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
@Schema(description = "管理后台 - 搬运组工资规格关联 Response VO") @Schema(description = "管理后台 - 搬运组工资规格关联 Response VO")
@Data @Data
@ -71,4 +74,6 @@ public class HandlingGroupAmountSpecificationsRespVO {
@ExcelProperty("数量小计") @ExcelProperty("数量小计")
private Integer totalNum; private Integer totalNum;
@Schema(description = "搬运工明细列表")
private List<HandlingGroupUserAmountItemVO> handlingGroupUserAmountItemVOS;
} }

View File

@ -85,6 +85,13 @@ public class HandlingGroupUserAmountController {
return success(BeanUtils.toBean(pageResult, HandlingGroupUserAmountRespVO.class)); return success(BeanUtils.toBean(pageResult, HandlingGroupUserAmountRespVO.class));
} }
@GetMapping("/listAll")
@Operation(summary = "获得搬运组每日个人工资记录列表")
public CommonResult<List<HandlingGroupUserAmountRespVO>> getHandlingGroupUserAmountList(@Valid HandlingGroupUserAmountPageReqVO pageReqVO) {
List<HandlingGroupUserAmountDO> list = handlingGroupUserAmountService.getHandlingGroupUserAmountList(pageReqVO);
return success(BeanUtils.toBean(list, HandlingGroupUserAmountRespVO.class));
}
@GetMapping("/staffWagesPage") @GetMapping("/staffWagesPage")
@Operation(summary = "以用户分组工资分页列表") @Operation(summary = "以用户分组工资分页列表")
public CommonResult<PageResult<StaffWagesPageVO>> staffWagesPage(@Valid StaffWagesPageDTO dto) { public CommonResult<PageResult<StaffWagesPageVO>> staffWagesPage(@Valid StaffWagesPageDTO dto) {

View File

@ -0,0 +1,25 @@
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.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;
@Data
@ExcelIgnoreUnannotated
public class HandlingGroupUserAmountItemVO {
@Schema(description = "用户id", example = "12639")
@ExcelProperty("用户id")
private Long userId;
@Schema(description = "用户名称", example = "12639")
@ExcelProperty("用户名称")
private String userName;
@Schema(description = "搬运组每日个人工资")
@ExcelProperty("搬运组每日个人工资")
private BigDecimal amount;
}

View File

@ -55,7 +55,6 @@ public class StaffController {
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建员工") @Operation(summary = "创建员工")
@PreAuthorize("@ss.hasPermission('factory:staff:create')")
public CommonResult<Long> createStaff(@Valid @RequestBody StaffSaveReqVO createReqVO) { public CommonResult<Long> createStaff(@Valid @RequestBody StaffSaveReqVO createReqVO) {
return success(staffService.createStaff(createReqVO)); return success(staffService.createStaff(createReqVO));
} }
@ -68,7 +67,6 @@ public class StaffController {
@PutMapping("/update") @PutMapping("/update")
@Operation(summary = "更新员工") @Operation(summary = "更新员工")
@PreAuthorize("@ss.hasPermission('factory:staff:update')")
public CommonResult<Boolean> updateStaff(@Valid @RequestBody StaffSaveReqVO updateReqVO) { public CommonResult<Boolean> updateStaff(@Valid @RequestBody StaffSaveReqVO updateReqVO) {
staffService.updateStaff(updateReqVO); staffService.updateStaff(updateReqVO);
return success(true); return success(true);
@ -76,7 +74,6 @@ public class StaffController {
@PutMapping("/update-salary") @PutMapping("/update-salary")
@Operation(summary = "更新员工") @Operation(summary = "更新员工")
@PreAuthorize("@ss.hasPermission('factory:staff:update')")
public CommonResult<Boolean> updateStaffSalary(@RequestBody StaffSalaryUpdateVO updateReqVO) { public CommonResult<Boolean> updateStaffSalary(@RequestBody StaffSalaryUpdateVO updateReqVO) {
staffService.updateStaffSalary(updateReqVO); staffService.updateStaffSalary(updateReqVO);
return success(true); return success(true);
@ -85,7 +82,6 @@ public class StaffController {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除员工") @Operation(summary = "删除员工")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('factory:staff:delete')")
public CommonResult<Boolean> deleteStaff(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteStaff(@RequestParam("id") Long id) {
staffService.deleteStaff(id); staffService.deleteStaff(id);
return success(true); return success(true);
@ -94,7 +90,6 @@ public class StaffController {
@GetMapping("/get") @GetMapping("/get")
@Operation(summary = "获得员工") @Operation(summary = "获得员工")
@Parameter(name = "id", description = "编号", required = true, example = "1024") @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
public CommonResult<StaffDO> getStaff(@RequestParam("id") Long id) { public CommonResult<StaffDO> getStaff(@RequestParam("id") Long id) {
StaffDO staff = staffService.getStaff(id); StaffDO staff = staffService.getStaff(id);
return success(staff); return success(staff);
@ -104,7 +99,6 @@ public class StaffController {
@Operation(summary = "获得指定厂区得员工") @Operation(summary = "获得指定厂区得员工")
@Parameter(name = "factoryId", description = "厂区编号", required = true, example = "1024") @Parameter(name = "factoryId", description = "厂区编号", required = true, example = "1024")
@Parameter(name = "isIn", description = "是否获取该厂区得员工", required = true, example = "1024") @Parameter(name = "isIn", description = "是否获取该厂区得员工", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
public CommonResult<List<StaffRespVO>> getListByFactory(@RequestParam("factoryId") Long factoryId, public CommonResult<List<StaffRespVO>> getListByFactory(@RequestParam("factoryId") Long factoryId,
@RequestParam("isIn") Boolean isIn) { @RequestParam("isIn") Boolean isIn) {
List<StaffDO> staffs = staffService.getListByFactory(factoryId, isIn); List<StaffDO> staffs = staffService.getListByFactory(factoryId, isIn);
@ -123,7 +117,6 @@ public class StaffController {
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得员工分页") @Operation(summary = "获得员工分页")
@PreAuthorize("@ss.hasPermission('factory:staff:query')")
public CommonResult<PageResult<StaffRespVO>> getStaffPage(@Valid StaffPageReqVO pageReqVO) { public CommonResult<PageResult<StaffRespVO>> getStaffPage(@Valid StaffPageReqVO pageReqVO) {
PageResult<StaffDO> pageResult = staffService.getStaffPage(pageReqVO); PageResult<StaffDO> pageResult = staffService.getStaffPage(pageReqVO);
PageResult<StaffRespVO> result = BeanUtils.toBean(pageResult, StaffRespVO.class); PageResult<StaffRespVO> result = BeanUtils.toBean(pageResult, StaffRespVO.class);
@ -143,7 +136,6 @@ public class StaffController {
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出员工 Excel") @Operation(summary = "导出员工 Excel")
@PreAuthorize("@ss.hasPermission('factory:staff:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportStaffExcel(@Valid StaffPageReqVO pageReqVO, public void exportStaffExcel(@Valid StaffPageReqVO pageReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
@ -193,7 +185,6 @@ public class StaffController {
@Parameter(name = "file", description = "Excel 文件", required = true), @Parameter(name = "file", description = "Excel 文件", required = true),
@Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true") @Parameter(name = "updateSupport", description = "是否支持更新,默认为 false", example = "true")
}) })
@PreAuthorize("@ss.hasPermission('factory:staff:import')")
public CommonResult<StaffImportRespVO> importExcel(@RequestParam("file") MultipartFile file, public CommonResult<StaffImportRespVO> importExcel(@RequestParam("file") MultipartFile file,
@RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception { @RequestParam(value = "updateSupport", required = false, defaultValue = "false") Boolean updateSupport) throws Exception {
List<StaffImportExcelVO> list = ExcelUtils.read(file, StaffImportExcelVO.class); List<StaffImportExcelVO> list = ExcelUtils.read(file, StaffImportExcelVO.class);

View File

@ -39,14 +39,12 @@ public class StaffSalaryController {
@PostMapping("/create") @PostMapping("/create")
@Operation(summary = "创建员工工资") @Operation(summary = "创建员工工资")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:create')")
public CommonResult<Long> createStaff(@Valid @RequestBody StaffSalarySaveReqVO createReqVO) { public CommonResult<Long> createStaff(@Valid @RequestBody StaffSalarySaveReqVO createReqVO) {
return success(staffSalaryService.createStaffSalary(createReqVO)); return success(staffSalaryService.createStaffSalary(createReqVO));
} }
@PutMapping("/update") @PutMapping("/update")
@Operation(summary = "更新厂区员工工资") @Operation(summary = "更新厂区员工工资")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:update')")
public CommonResult<Boolean> updateStaffSalary(@Valid @RequestBody StaffSalarySaveReqVO updateReqVO) { public CommonResult<Boolean> updateStaffSalary(@Valid @RequestBody StaffSalarySaveReqVO updateReqVO) {
staffSalaryService.updateStaffSalary(updateReqVO); staffSalaryService.updateStaffSalary(updateReqVO);
return success(true); return success(true);
@ -54,7 +52,6 @@ public class StaffSalaryController {
@PutMapping("/update-status") @PutMapping("/update-status")
@Operation(summary = "更新厂区员工工资状态") @Operation(summary = "更新厂区员工工资状态")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:update')")
public CommonResult<Boolean> updateStatus(@RequestBody StaffSalarySaveReqVO updateReqVO) { public CommonResult<Boolean> updateStatus(@RequestBody StaffSalarySaveReqVO updateReqVO) {
staffSalaryService.updateStatus(updateReqVO); staffSalaryService.updateStatus(updateReqVO);
return success(true); return success(true);
@ -63,7 +60,6 @@ public class StaffSalaryController {
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除厂区员工工资") @Operation(summary = "删除厂区员工工资")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:delete')")
public CommonResult<Boolean> deleteStaffSalary(@RequestParam("id") Long id) { public CommonResult<Boolean> deleteStaffSalary(@RequestParam("id") Long id) {
staffSalaryService.deleteStaffSalary(id); staffSalaryService.deleteStaffSalary(id);
return success(true); return success(true);
@ -72,7 +68,6 @@ public class StaffSalaryController {
@GetMapping("/get") @GetMapping("/get")
@Operation(summary = "获得厂区员工工资") @Operation(summary = "获得厂区员工工资")
@Parameter(name = "id", description = "编号", required = true, example = "1024") @Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:query')")
public CommonResult<StaffSalaryRespVO> getStaffSalary(@RequestParam("id") Long id) { public CommonResult<StaffSalaryRespVO> getStaffSalary(@RequestParam("id") Long id) {
StaffSalaryDO staffSalary = staffSalaryService.getStaffSalary(id); StaffSalaryDO staffSalary = staffSalaryService.getStaffSalary(id);
@ -81,7 +76,6 @@ public class StaffSalaryController {
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得厂区员工工资分页") @Operation(summary = "获得厂区员工工资分页")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:query')")
public CommonResult<PageResult<StaffSalaryRespVO>> getStaffSalaryPage(@Valid StaffSalaryPageReqVO pageReqVO) { public CommonResult<PageResult<StaffSalaryRespVO>> getStaffSalaryPage(@Valid StaffSalaryPageReqVO pageReqVO) {
PageResult<StaffSalaryRespVO> pageResult = staffSalaryService.getStaffSalaryPage(pageReqVO); PageResult<StaffSalaryRespVO> pageResult = staffSalaryService.getStaffSalaryPage(pageReqVO);
return success(pageResult); return success(pageResult);
@ -89,7 +83,6 @@ public class StaffSalaryController {
@GetMapping("/total") @GetMapping("/total")
@Operation(summary = "获取工资统计") @Operation(summary = "获取工资统计")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:query')")
public CommonResult<SalaryTotalVO> getStaffSalaryTotal(@Valid StaffSalaryPageReqVO pageReqVO) { public CommonResult<SalaryTotalVO> getStaffSalaryTotal(@Valid StaffSalaryPageReqVO pageReqVO) {
return success(staffSalaryService.getStaffSalaryTotal(pageReqVO)); return success(staffSalaryService.getStaffSalaryTotal(pageReqVO));
@ -97,7 +90,6 @@ public class StaffSalaryController {
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出厂区员工工资 Excel") @Operation(summary = "导出厂区员工工资 Excel")
@PreAuthorize("@ss.hasPermission('smartfactory:staff-salary:export')")
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportStaffSalaryExcel(@Valid StaffSalaryPageReqVO pageReqVO, public void exportStaffSalaryExcel(@Valid StaffSalaryPageReqVO pageReqVO,
HttpServletResponse response) throws IOException { HttpServletResponse response) throws IOException {
@ -107,4 +99,4 @@ public class StaffSalaryController {
ExcelUtils.write(response, "厂区员工工资.xls", "数据", StaffSalaryRespVO.class, ExcelUtils.write(response, "厂区员工工资.xls", "数据", StaffSalaryRespVO.class,
list); list);
} }
} }

View File

@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecif
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsTotalNumDTO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO; import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsPageReqVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsTotalNumVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO; import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -56,4 +58,12 @@ public interface HandlingGroupAmountSpecificationsMapper extends BaseMapperX<Han
* @return * @return
*/ */
List<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsList(@Param("factoryId") Long factoryId, @Param("dateStr") String dateStr, @Param("handlingGroupId") Long handlingGroupId); List<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsList(@Param("factoryId") Long factoryId, @Param("dateStr") String dateStr, @Param("handlingGroupId") Long handlingGroupId);
/**
* 获取总金额
*
* @param dto
* @return
*/
HandlingGroupAmountSpecificationsTotalNumVO getTotalNum(@Param("dto") HandlingGroupAmountSpecificationsTotalNumDTO dto);
} }

View File

@ -58,4 +58,18 @@ public interface HandlingGroupUserAmountMapper extends BaseMapperX<HandlingGroup
* @return * @return
*/ */
List<Map<String, Object>> getListByMonth(@Param("id") Long id, @Param("factoryId") Long factoryId, @Param("dateList") List<String> dateList, @Param("name") String name); List<Map<String, Object>> getListByMonth(@Param("id") Long id, @Param("factoryId") Long factoryId, @Param("dateList") List<String> dateList, @Param("name") String name);
/**
* 列表
* @param vo
* @return
*/
List<HandlingGroupUserAmountDO> getHandlingGroupUserAmountList(@Param("vo") HandlingGroupUserAmountPageReqVO vo);
/**
*
* @param handlingGroupAmountSpecificationsIds
* @return
*/
List<HandlingGroupUserAmountDO> getByHandlingGroupAmountSpecificationsId(@Param("handlingGroupAmountSpecificationsIds") List<Long> handlingGroupAmountSpecificationsIds);
} }

View File

@ -1,10 +1,12 @@
package cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications; package cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecifications;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsTotalNumDTO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.*; import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.*;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO; import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
import javax.validation.Valid; import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.List; import java.util.List;
/** /**
@ -67,5 +69,13 @@ public interface HandlingGroupAmountSpecificationsService {
* @param factoryId * @param factoryId
* @return * @return
*/ */
HandlingGroupAmountSpecificationsTotalNumVO getTotalNum(Long factoryId); HandlingGroupAmountSpecificationsTotalNumVO getTotalNum(HandlingGroupAmountSpecificationsTotalNumDTO dto);
/**
* 获取金额小计
* @param totalCount
* @param handlingSpecificationsId
* @return
*/
BigDecimal getAmountSubtotal(Integer totalCount, Long handlingSpecificationsId);
} }

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.smartfactory.service.handlinggroupamountspecific
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils; import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupListVO; import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroup.vo.HandlingGroupListVO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.dto.HandlingGroupAmountSpecificationsTotalNumDTO;
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.*; import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.*;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO; 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.dataobject.handlingspecifications.HandlingSpecificationsDO;
@ -20,12 +21,10 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.getSumValue;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
/** /**
@ -58,7 +57,7 @@ public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGro
@Override @Override
public List<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsList(Long factoryId, String dateStr, Long handlingGroupId) { public List<HandlingGroupAmountSpecificationsDO> getHandlingGroupAmountSpecificationsList(Long factoryId, String dateStr, Long handlingGroupId) {
return handlingGroupAmountSpecificationsMapper.getHandlingGroupAmountSpecificationsList(factoryId,dateStr,handlingGroupId); return handlingGroupAmountSpecificationsMapper.getHandlingGroupAmountSpecificationsList(factoryId, dateStr, handlingGroupId);
} }
@Override @Override
@ -139,15 +138,14 @@ public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGro
continue; continue;
} }
if (handlingSpecificationsDO.getType() == 0) { if (handlingSpecificationsDO.getType() == 0) {
totalAmount = new BigDecimal(item.getTotalCount().toString()).multiply(handlingSpecificationsDO.getUnitPrice()); totalAmount = new BigDecimal(handlingGroupAmountSpecificationsBatchCreateItemVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getUnitPrice());
} else { } else {
totalAmount = new BigDecimal(item.getTotalCount().toString()).multiply(handlingSpecificationsDO.getWeight()) totalAmount = new BigDecimal(handlingGroupAmountSpecificationsBatchCreateItemVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getWeight())
.multiply(handlingSpecificationsDO.getUnitPrice().multiply(THOUSANDTH)); .multiply(handlingSpecificationsDO.getUnitPrice().multiply(THOUSANDTH));
} }
item.setAmount(totalAmount); item.setAmount(totalAmount);
item.setTotalCount(item.getTotalCount()); item.setTotalCount(handlingGroupAmountSpecificationsBatchCreateItemVO.getTotalCount());
item.setStaffId(vo.getStaffId()); item.setStaffId(vo.getStaffId());
item.setHandlingGroupId(vo.getHandlingGroupId());
} }
handlingGroupAmountSpecificationsMapper.updateBatch(list); handlingGroupAmountSpecificationsMapper.updateBatch(list);
} }
@ -161,14 +159,20 @@ public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGro
} }
@Override @Override
public HandlingGroupAmountSpecificationsTotalNumVO getTotalNum(Long factoryId) { public HandlingGroupAmountSpecificationsTotalNumVO getTotalNum(HandlingGroupAmountSpecificationsTotalNumDTO dto) {
HandlingGroupAmountSpecificationsTotalNumVO vo = new HandlingGroupAmountSpecificationsTotalNumVO(); return handlingGroupAmountSpecificationsMapper.getTotalNum(dto);
List<HandlingGroupAmountSpecificationsDO> list = handlingGroupAmountSpecificationsMapper.selectList(new LambdaQueryWrapper<HandlingGroupAmountSpecificationsDO>() }
.eq(factoryId != null, HandlingGroupAmountSpecificationsDO::getFactoryId, factoryId));
BigDecimal amount = getSumValue(list, HandlingGroupAmountSpecificationsDO::getAmount, BigDecimal::add); @Override
Integer num = getSumValue(list, HandlingGroupAmountSpecificationsDO::getTotalCount, Integer::sum); public BigDecimal getAmountSubtotal(Integer totalCount, Long handlingSpecificationsId) {
vo.setNum(num.longValue()); HandlingSpecificationsDO handlingSpecificationsDO = handlingSpecificationsService.getById(handlingSpecificationsId);
vo.setAmount(amount); BigDecimal totalAmount;
return vo; if (handlingSpecificationsDO.getType() == 0) {
totalAmount = new BigDecimal(totalCount.toString()).multiply(handlingSpecificationsDO.getUnitPrice());
} else {
totalAmount = new BigDecimal(totalCount.toString()).multiply(handlingSpecificationsDO.getWeight())
.multiply(handlingSpecificationsDO.getUnitPrice().multiply(THOUSANDTH));
}
return totalAmount;
} }
} }

View File

@ -7,15 +7,17 @@ import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseram
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountSaveReqVO; 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.controller.admin.handlinggroupuseramount.vo.StaffWagesPageVO;
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO; import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.List;
/** /**
* 搬运组每日个人工资记录 Service 接口 * 搬运组每日个人工资记录 Service 接口
* *
* @author 艾楷 * @author 艾楷
*/ */
public interface HandlingGroupUserAmountService { public interface HandlingGroupUserAmountService extends IService<HandlingGroupUserAmountDO> {
/** /**
* 创建搬运组每日个人工资记录 * 创建搬运组每日个人工资记录
@ -79,4 +81,18 @@ public interface HandlingGroupUserAmountService {
* @return * @return
*/ */
HandlingGroupUserAmountMonthVO getListByMonth(Long id, Long factoryId, Integer type, String time, String name); HandlingGroupUserAmountMonthVO getListByMonth(Long id, Long factoryId, Integer type, String time, String name);
/**
* 列表
* @param pageReqVO
* @return
*/
List<HandlingGroupUserAmountDO> getHandlingGroupUserAmountList(HandlingGroupUserAmountPageReqVO pageReqVO);
/**
*
* @param handlingGroupAmountSpecificationsIds
* @return
*/
List<HandlingGroupUserAmountDO> getByHandlingGroupAmountSpecificationsId(List<Long> handlingGroupAmountSpecificationsIds);
} }

View File

@ -11,16 +11,14 @@ import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramou
import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsMapper; import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsMapper;
import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupuseramount.HandlingGroupUserAmountMapper; import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupuseramount.HandlingGroupUserAmountMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 搬运组每日个人工资记录 Service 实现类 * 搬运组每日个人工资记录 Service 实现类
@ -29,7 +27,7 @@ import java.util.Map;
*/ */
@Service @Service
@Validated @Validated
public class HandlingGroupUserAmountServiceImpl implements HandlingGroupUserAmountService { public class HandlingGroupUserAmountServiceImpl extends ServiceImpl<HandlingGroupUserAmountMapper,HandlingGroupUserAmountDO> implements HandlingGroupUserAmountService {
@Resource @Resource
private HandlingGroupUserAmountMapper handlingGroupUserAmountMapper; private HandlingGroupUserAmountMapper handlingGroupUserAmountMapper;
@ -136,5 +134,15 @@ public class HandlingGroupUserAmountServiceImpl implements HandlingGroupUserAmou
return vo; return vo;
} }
@Override
public List<HandlingGroupUserAmountDO> getHandlingGroupUserAmountList(HandlingGroupUserAmountPageReqVO pageReqVO) {
return handlingGroupUserAmountMapper.getHandlingGroupUserAmountList(pageReqVO);
}
@Override
public List<HandlingGroupUserAmountDO> getByHandlingGroupAmountSpecificationsId(List<Long> handlingGroupAmountSpecificationsIds) {
return handlingGroupUserAmountMapper.getByHandlingGroupAmountSpecificationsId(handlingGroupAmountSpecificationsIds);
}
} }

View File

@ -72,6 +72,14 @@ public class StaffServiceImpl implements StaffService {
throw exception(STAFF_NOT_EXISTS); throw exception(STAFF_NOT_EXISTS);
} }
// 校验用户名身份证号是否已经存在
Long cunt = staffMapper.selectCount(new LambdaQueryWrapperX<StaffDO>()
.neIfPresent(StaffDO::getId, updateReqVO.getId())
.eqIfPresent(StaffDO::getIdCard, updateReqVO.getIdCard()));
if (cunt > 0) {
throw exception(USER_USERNAME_EXISTS);
}
// 身份证号是否已经存在 // 身份证号是否已经存在
validateUserForCreate(null, null, null, updateReqVO.getIdCard()); validateUserForCreate(null, null, null, updateReqVO.getIdCard());

View File

@ -21,6 +21,10 @@
LEFT JOIN sf_handling_specifications AS b ON a.handling_specifications_id = b.id LEFT JOIN sf_handling_specifications AS b ON a.handling_specifications_id = b.id
LEFT JOIN sf_staff AS c ON c.id = a.staff_id LEFT JOIN sf_staff AS c ON c.id = a.staff_id
left join sf_handling_group as d on a.handling_group_id = d.id left join sf_handling_group as d on a.handling_group_id = d.id
<if test="vo.porterName != null and vo.porterName != ''">
left join sf_handling_group_user_amount as e on a.id = e.handling_group_amount_specifications_id
left join sf_staff as g on g.id = e.user_id
</if>
<where> <where>
a.deleted = 0 a.deleted = 0
and b.deleted = 0 and b.deleted = 0
@ -36,10 +40,21 @@
<if test="vo.factoryId != null"> <if test="vo.factoryId != null">
AND a.factory_id = #{vo.factoryId} AND a.factory_id = #{vo.factoryId}
</if> </if>
<if test="vo.dateStr != null and vo.dateStr != ''"> <if test="vo.porterName != null and vo.porterName != ''">
and a.date_str like concat('%', #{vo.dateStr}, '%') and g.nick_name like concat('%', #{vo.porterName}, '%')
</if>
<if test="vo.createTime != null and vo.createTime.length > 0">
<if test="vo.createTime[0] != null">
and STR_TO_DATE( a.date_str, '%Y-%m-%d' ) &gt;= #{vo.createTime[0]}
</if>
<if test="vo.createTime[1] != null">
and STR_TO_DATE( a.date_str, '%Y-%m-%d' ) &lt;= #{vo.createTime[1]}
</if>
</if> </if>
</where> </where>
<if test="vo.porterName != null and vo.porterName != ''">
group by a.id
</if>
</select> </select>
<select id="getHandlingGroupAmountSpecifications" <select id="getHandlingGroupAmountSpecifications"
resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO"> resultType="cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO">
@ -79,4 +94,37 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getTotalNum"
resultType="cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsTotalNumVO">
select
sum(a.total_count) as num,
sum(a.amount) as amount
from sf_handling_group_amount_specifications AS a
left join sf_staff as b on a.staff_id = b.id
left join sf_handling_group_user_amount as c on a.id = c.handling_group_amount_specifications_id
left join sf_staff as d on d.id = c.user_id
<where>
a.deleted = 0
<if test="dto.factoryId != null">
and a.factory_id = #{dto.factoryId}
</if>
<if test="dto.handlingSpecificationsId != null">
and a.handling_specifications_id = #{dto.handlingSpecificationsId}
</if>
<if test="dto.forkliftDriverName != null and dto.forkliftDriverName != ''">
and b.nick_name like concat('%', #{dto.forkliftDriverName}, '%')
</if>
<if test="dto.porterName != null and dto.porterName != ''">
and d.nick_name like concat('%', #{dto.porterName}, '%')
</if>
<if test="dto.createTime != null and dto.createTime.length > 0">
<if test="dto.createTime[0] != null">
and STR_TO_DATE( a.date_str, '%Y-%m-%d' ) &gt;= #{dto.createTime[0]}
</if>
<if test="dto.createTime[1] != null">
and STR_TO_DATE( a.date_str, '%Y-%m-%d' ) &lt;= #{dto.createTime[1]}
</if>
</if>
</where>
</select>
</mapper> </mapper>

View File

@ -101,4 +101,52 @@
GROUP BY GROUP BY
a.user_id; a.user_id;
</select> </select>
<select id="getHandlingGroupUserAmountList"
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.handlingGroupId != null">
AND a.handling_group_id = #{vo.handlingGroupId}
</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="getByHandlingGroupAmountSpecificationsId"
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="handlingGroupAmountSpecificationsIds != null and handlingGroupAmountSpecificationsIds.size() > 0">
and a.handling_group_amount_specifications_id in
<foreach collection="handlingGroupAmountSpecificationsIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
</select>
</mapper> </mapper>