Compare commits
No commits in common. "e2bebcf9117e345eb5ac07ce5fae2e8019d780ef" and "36c84744984a4ba9d9242593c3dcac309256a3b6" have entirely different histories.
e2bebcf911
...
36c8474498
@ -65,14 +65,6 @@ public class DeptController {
|
|||||||
return success(list);
|
return success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getFactoryDeptListByLeaderUserId")
|
|
||||||
@Operation(summary = "获取当前用户所负责的工厂部门列表")
|
|
||||||
public CommonResult<List<DeptDO>> getFactoryDeptListByLeaderUserId() {
|
|
||||||
Long id = getLoginUserId();
|
|
||||||
List<DeptDO> list = deptService.getFactoryDeptByLeaderId(id);
|
|
||||||
return success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PutMapping("update")
|
@PutMapping("update")
|
||||||
@Operation(summary = "更新部门")
|
@Operation(summary = "更新部门")
|
||||||
@PreAuthorize("@ss.hasPermission('system:dept:update')")
|
@PreAuthorize("@ss.hasPermission('system:dept:update')")
|
||||||
|
@ -204,12 +204,4 @@ public interface DeptService {
|
|||||||
* @return 公司信息
|
* @return 公司信息
|
||||||
*/
|
*/
|
||||||
DeptDO getCompanyByDept(Long deptId);
|
DeptDO getCompanyByDept(Long deptId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录用户负责的工厂部门
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<DeptDO> getFactoryDeptByLeaderId(Long id);
|
|
||||||
}
|
}
|
||||||
|
@ -421,14 +421,6 @@ public class DeptServiceImpl implements DeptService {
|
|||||||
.orElse(null);
|
.orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<DeptDO> getFactoryDeptByLeaderId(Long id) {
|
|
||||||
return deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
|
||||||
.eq(DeptDO::getLeaderUserId, id)
|
|
||||||
.eq(DeptDO::getStatus, CommonStatusEnum.ENABLE.getStatus())
|
|
||||||
.isNotNull(DeptDO::getFactoryId));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DeptDO> getDeptList(DeptApiDTO dto) {
|
public List<DeptDO> getDeptList(DeptApiDTO dto) {
|
||||||
List<DeptDO> list = deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
List<DeptDO> list = deptMapper.selectList(new LambdaQueryWrapperX<DeptDO>()
|
||||||
|
@ -6,7 +6,6 @@ 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.vo.HandlingGroupAmountSpecificationsBatchCreateVO;
|
|
||||||
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.HandlingGroupAmountSpecificationsRespVO;
|
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.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsSaveReqVO;
|
||||||
@ -37,20 +36,11 @@ public class HandlingGroupAmountSpecificationsController {
|
|||||||
@Resource
|
@Resource
|
||||||
private HandlingGroupAmountSpecificationsService handlingGroupAmountSpecificationsService;
|
private HandlingGroupAmountSpecificationsService handlingGroupAmountSpecificationsService;
|
||||||
|
|
||||||
@PostMapping("/batchCreate")
|
@PostMapping("/createOrEdit")
|
||||||
@Operation(summary = "创建搬运组工资规格关联")
|
@Operation(summary = "创建搬运组工资规格关联")
|
||||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:create')")
|
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:create')")
|
||||||
public CommonResult<Boolean> batchCreate(@Valid @RequestBody HandlingGroupAmountSpecificationsBatchCreateVO vo) {
|
public CommonResult<Boolean> createOrEdit(@Valid @RequestBody HandlingGroupAmountSpecificationsSaveReqVO createReqVO) {
|
||||||
handlingGroupAmountSpecificationsService.batchCreate(vo);
|
handlingGroupAmountSpecificationsService.createOrEdit(createReqVO);
|
||||||
return success(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/update")
|
|
||||||
@Operation(summary = "更新搬运组工资规格关联")
|
|
||||||
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-amount-specifications:update')")
|
|
||||||
public CommonResult<Boolean> update(@Valid @RequestBody HandlingGroupAmountSpecificationsSaveReqVO createReqVO) {
|
|
||||||
handlingGroupAmountSpecificationsService.updateHandlingGroupAmountSpecifications(createReqVO);
|
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class HandlingGroupAmountSpecificationsBatchCreateItemVO {
|
|
||||||
|
|
||||||
@Schema(description = "搬运规格id", example = "23178")
|
|
||||||
@NotNull(message = "搬运规格不能为空")
|
|
||||||
private Long handlingSpecificationsId;
|
|
||||||
|
|
||||||
@Schema(description = "数量", example = "15611")
|
|
||||||
@NotNull(message = "数量不能为空")
|
|
||||||
private Integer totalCount;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,20 +0,0 @@
|
|||||||
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;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class HandlingGroupAmountSpecificationsBatchCreateVO {
|
|
||||||
@Schema(description = "工厂id", example = "23178")
|
|
||||||
private Long factoryId;
|
|
||||||
|
|
||||||
@Schema(description = "日期 格式 yyyy-MM-dd")
|
|
||||||
@NotNull(message = "日期不能为空")
|
|
||||||
private String dateStr;
|
|
||||||
|
|
||||||
@Schema(description = "子列表")
|
|
||||||
private List<HandlingGroupAmountSpecificationsBatchCreateItemVO> itemVOS;
|
|
||||||
}
|
|
@ -18,9 +18,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
|
|||||||
@ToString(callSuper = true)
|
@ToString(callSuper = true)
|
||||||
public class HandlingGroupAmountSpecificationsPageReqVO extends PageParam {
|
public class HandlingGroupAmountSpecificationsPageReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "工厂id", example = "23178")
|
|
||||||
private Long factoryId;
|
|
||||||
|
|
||||||
@Schema(description = "搬运规格id", example = "23178")
|
@Schema(description = "搬运规格id", example = "23178")
|
||||||
private Long handlingSpecificationsId;
|
private Long handlingSpecificationsId;
|
||||||
|
|
||||||
|
@ -17,9 +17,6 @@ public class HandlingGroupAmountSpecificationsRespVO {
|
|||||||
@ExcelProperty("主键id")
|
@ExcelProperty("主键id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "工厂id", example = "23178")
|
|
||||||
private Long factoryId;
|
|
||||||
|
|
||||||
@Schema(description = "搬运规格id", example = "23178")
|
@Schema(description = "搬运规格id", example = "23178")
|
||||||
@ExcelProperty("搬运规格id")
|
@ExcelProperty("搬运规格id")
|
||||||
private Long handlingSpecificationsId;
|
private Long handlingSpecificationsId;
|
||||||
|
@ -12,9 +12,6 @@ public class HandlingGroupAmountSpecificationsSaveReqVO {
|
|||||||
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9721")
|
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9721")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "工厂id", example = "23178")
|
|
||||||
private Long factoryId;
|
|
||||||
|
|
||||||
@Schema(description = "搬运规格id", example = "23178")
|
@Schema(description = "搬运规格id", example = "23178")
|
||||||
@NotNull(message = "搬运规格不能为空")
|
@NotNull(message = "搬运规格不能为空")
|
||||||
private Long handlingSpecificationsId;
|
private Long handlingSpecificationsId;
|
||||||
|
@ -1,29 +1,34 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount;
|
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
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.PageParam;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
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 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.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.handlinggroupuseramount.dto.StaffWagesPageDTO;
|
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.controller.admin.handlinggroupuseramount.vo.*;
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupuseramount.HandlingGroupUserAmountDO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount.HandlingGroupUserAmountService;
|
import cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount.HandlingGroupUserAmountService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.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 = "管理后台 - 搬运组每日个人工资记录")
|
@Tag(name = "管理后台 - 搬运组每日个人工资记录")
|
||||||
@RestController
|
@RestController
|
||||||
@ -36,6 +41,7 @@ public class HandlingGroupUserAmountController {
|
|||||||
|
|
||||||
@PostMapping("/createOrEdit")
|
@PostMapping("/createOrEdit")
|
||||||
@Operation(summary = "创建搬运组每日个人工资记录")
|
@Operation(summary = "创建搬运组每日个人工资记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:create')")
|
||||||
public CommonResult<Boolean> createOrEdit(@Valid @RequestBody HandlingGroupUserAmountSaveReqVO createReqVO) {
|
public CommonResult<Boolean> createOrEdit(@Valid @RequestBody HandlingGroupUserAmountSaveReqVO createReqVO) {
|
||||||
handlingGroupUserAmountService.createOrEdit(createReqVO);
|
handlingGroupUserAmountService.createOrEdit(createReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -43,6 +49,7 @@ public class HandlingGroupUserAmountController {
|
|||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新搬运组每日个人工资记录")
|
@Operation(summary = "更新搬运组每日个人工资记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:update')")
|
||||||
public CommonResult<Boolean> updateHandlingGroupUserAmount(@Valid @RequestBody HandlingGroupUserAmountSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateHandlingGroupUserAmount(@Valid @RequestBody HandlingGroupUserAmountSaveReqVO updateReqVO) {
|
||||||
handlingGroupUserAmountService.updateHandlingGroupUserAmount(updateReqVO);
|
handlingGroupUserAmountService.updateHandlingGroupUserAmount(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -51,6 +58,7 @@ public class HandlingGroupUserAmountController {
|
|||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除搬运组每日个人工资记录")
|
@Operation(summary = "删除搬运组每日个人工资记录")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:delete')")
|
||||||
public CommonResult<Boolean> deleteHandlingGroupUserAmount(@RequestParam("id") Long id) {
|
public CommonResult<Boolean> deleteHandlingGroupUserAmount(@RequestParam("id") Long id) {
|
||||||
handlingGroupUserAmountService.deleteHandlingGroupUserAmount(id);
|
handlingGroupUserAmountService.deleteHandlingGroupUserAmount(id);
|
||||||
return success(true);
|
return success(true);
|
||||||
@ -59,25 +67,15 @@ public class HandlingGroupUserAmountController {
|
|||||||
@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:handling-group-user-amount:query')")
|
||||||
public CommonResult<HandlingGroupUserAmountRespVO> getHandlingGroupUserAmount(@RequestParam("id") Long id) {
|
public CommonResult<HandlingGroupUserAmountRespVO> getHandlingGroupUserAmount(@RequestParam("id") Long id) {
|
||||||
HandlingGroupUserAmountDO handlingGroupUserAmount = handlingGroupUserAmountService.getHandlingGroupUserAmount(id);
|
HandlingGroupUserAmountDO handlingGroupUserAmount = handlingGroupUserAmountService.getHandlingGroupUserAmount(id);
|
||||||
return success(BeanUtils.toBean(handlingGroupUserAmount, HandlingGroupUserAmountRespVO.class));
|
return success(BeanUtils.toBean(handlingGroupUserAmount, HandlingGroupUserAmountRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/getListByMonth")
|
|
||||||
@Operation(summary = "获得搬运组工资记录 按月搜索")
|
|
||||||
@Parameter(name = "time", description = "日期 格式(yyyy-MM) 默认当前月", required = true, example = "1024")
|
|
||||||
public CommonResult<HandlingGroupUserAmountMonthVO> getListByMonth(@RequestParam(value = "id", required = false) Long id,
|
|
||||||
@RequestParam(value = "name", required = false) String name,
|
|
||||||
@RequestParam(value = "time", required = true) String time,
|
|
||||||
@RequestParam(value = "factoryId", required = false) Long factoryId) {
|
|
||||||
HandlingGroupUserAmountMonthVO vo = handlingGroupUserAmountService.getListByMonth(id, factoryId, time, name);
|
|
||||||
return success(vo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得搬运组每日个人工资记录分页")
|
@Operation(summary = "获得搬运组每日个人工资记录分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:query')")
|
||||||
public CommonResult<PageResult<HandlingGroupUserAmountRespVO>> getHandlingGroupUserAmountPage(@Valid HandlingGroupUserAmountPageReqVO pageReqVO) {
|
public CommonResult<PageResult<HandlingGroupUserAmountRespVO>> getHandlingGroupUserAmountPage(@Valid HandlingGroupUserAmountPageReqVO pageReqVO) {
|
||||||
PageResult<HandlingGroupUserAmountDO> pageResult = handlingGroupUserAmountService.getHandlingGroupUserAmountPage(pageReqVO);
|
PageResult<HandlingGroupUserAmountDO> pageResult = handlingGroupUserAmountService.getHandlingGroupUserAmountPage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, HandlingGroupUserAmountRespVO.class));
|
return success(BeanUtils.toBean(pageResult, HandlingGroupUserAmountRespVO.class));
|
||||||
@ -92,6 +90,7 @@ public class HandlingGroupUserAmountController {
|
|||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@Operation(summary = "导出搬运组每日个人工资记录 Excel")
|
@Operation(summary = "导出搬运组每日个人工资记录 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('smartfactory:handling-group-user-amount:export')")
|
||||||
@OperateLog(type = EXPORT)
|
@OperateLog(type = EXPORT)
|
||||||
public void exportHandlingGroupUserAmountExcel(@Valid HandlingGroupUserAmountPageReqVO pageReqVO,
|
public void exportHandlingGroupUserAmountExcel(@Valid HandlingGroupUserAmountPageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class HandlingGroupUserAmountMonthItemVO {
|
|
||||||
@Schema(description = "用户id", example = "15129")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
@Schema(description = "列表", example = "22544")
|
|
||||||
private Map<Integer,String> contentList;
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class HandlingGroupUserAmountMonthVO {
|
|
||||||
@Schema(description = "表头")
|
|
||||||
private Map<Integer,String> headers;
|
|
||||||
|
|
||||||
@Schema(description = "列表值")
|
|
||||||
private List<HandlingGroupUserAmountMonthItemVO> list;
|
|
||||||
}
|
|
@ -17,9 +17,6 @@ public class HandlingGroupUserAmountSaveReqVO {
|
|||||||
@Schema(description = "用户id", example = "12639")
|
@Schema(description = "用户id", example = "12639")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
@Schema(description = "工厂id", example = "12639")
|
|
||||||
private Long factoryId;
|
|
||||||
|
|
||||||
@Schema(description = "搬运组工资规格关联id", example = "27617")
|
@Schema(description = "搬运组工资规格关联id", example = "27617")
|
||||||
private Long handlingGroupAmountSpecificationsId;
|
private Long handlingGroupAmountSpecificationsId;
|
||||||
|
|
||||||
|
@ -31,10 +31,6 @@ public class HandlingGroupAmountSpecificationsDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableId
|
@TableId
|
||||||
private Long id;
|
private Long id;
|
||||||
/**
|
|
||||||
* 工厂id
|
|
||||||
*/
|
|
||||||
private Long factoryId;
|
|
||||||
/**
|
/**
|
||||||
* 搬运规格id
|
* 搬运规格id
|
||||||
*/
|
*/
|
||||||
|
@ -44,10 +44,6 @@ public class HandlingGroupUserAmountDO extends BaseDO {
|
|||||||
* 搬运组工资规格关联id
|
* 搬运组工资规格关联id
|
||||||
*/
|
*/
|
||||||
private Long handlingGroupAmountSpecificationsId;
|
private Long handlingGroupAmountSpecificationsId;
|
||||||
/**
|
|
||||||
* 工厂id
|
|
||||||
*/
|
|
||||||
private Long factoryId;
|
|
||||||
/**
|
/**
|
||||||
* 日期 格式 yyyy-MM-dd
|
* 日期 格式 yyyy-MM-dd
|
||||||
*/
|
*/
|
||||||
|
@ -12,10 +12,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搬运组每日个人工资记录 Mapper
|
* 搬运组每日个人工资记录 Mapper
|
||||||
*
|
*
|
||||||
@ -49,13 +45,4 @@ public interface HandlingGroupUserAmountMapper extends BaseMapperX<HandlingGroup
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
IPage<StaffWagesPageVO> staffWagesPage(@Param("page") Page page, @Param("dto") StaffWagesPageDTO dto);
|
IPage<StaffWagesPageVO> staffWagesPage(@Param("page") Page page, @Param("dto") StaffWagesPageDTO dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取月工资列表
|
|
||||||
* @param factoryId
|
|
||||||
* @param dateList
|
|
||||||
* @param name
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<Map<String, Object>> getListByMonth(@Param("id") Long id, @Param("factoryId") Long factoryId, @Param("dateList") List<String> dateList, @Param("name") String name);
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
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.vo.HandlingGroupAmountSpecificationsBatchCreateVO;
|
|
||||||
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.HandlingGroupAmountSpecificationsSaveReqVO;
|
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.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
|
||||||
@ -59,10 +58,4 @@ public interface HandlingGroupAmountSpecificationsService {
|
|||||||
* @param createReqVO
|
* @param createReqVO
|
||||||
*/
|
*/
|
||||||
void createOrEdit(@Valid HandlingGroupAmountSpecificationsSaveReqVO createReqVO);
|
void createOrEdit(@Valid HandlingGroupAmountSpecificationsSaveReqVO createReqVO);
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量新增
|
|
||||||
* @param vo
|
|
||||||
*/
|
|
||||||
void batchCreate(@Valid HandlingGroupAmountSpecificationsBatchCreateVO vo);
|
|
||||||
}
|
}
|
||||||
|
@ -3,15 +3,12 @@ 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.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
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.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsBatchCreateItemVO;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupamountspecifications.vo.HandlingGroupAmountSpecificationsBatchCreateVO;
|
|
||||||
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.HandlingGroupAmountSpecificationsSaveReqVO;
|
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.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
|
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.dal.mysql.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsMapper;
|
||||||
import cn.iocoder.yudao.module.smartfactory.service.handlingspecifications.HandlingSpecificationsService;
|
import cn.iocoder.yudao.module.smartfactory.service.handlingspecifications.HandlingSpecificationsService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@ -19,10 +16,6 @@ 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.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static cn.iocoder.yudao.module.smartfactory.enums.ErrorCodeConstants.CANNOT_FIND_THE_CORRESPONDING_FACTORY_HANDLING_SPECIFICATION;
|
import static cn.iocoder.yudao.module.smartfactory.enums.ErrorCodeConstants.CANNOT_FIND_THE_CORRESPONDING_FACTORY_HANDLING_SPECIFICATION;
|
||||||
@ -56,20 +49,6 @@ public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGro
|
|||||||
public void updateHandlingGroupAmountSpecifications(HandlingGroupAmountSpecificationsSaveReqVO updateReqVO) {
|
public void updateHandlingGroupAmountSpecifications(HandlingGroupAmountSpecificationsSaveReqVO updateReqVO) {
|
||||||
// 更新
|
// 更新
|
||||||
HandlingGroupAmountSpecificationsDO updateObj = BeanUtils.toBean(updateReqVO, HandlingGroupAmountSpecificationsDO.class);
|
HandlingGroupAmountSpecificationsDO updateObj = BeanUtils.toBean(updateReqVO, HandlingGroupAmountSpecificationsDO.class);
|
||||||
HandlingSpecificationsDO handlingSpecificationsDO = handlingSpecificationsService.getById(updateObj.getHandlingSpecificationsId());
|
|
||||||
if (handlingSpecificationsDO == null) {
|
|
||||||
throw exception(CANNOT_FIND_THE_CORRESPONDING_FACTORY_HANDLING_SPECIFICATION);
|
|
||||||
}
|
|
||||||
BigDecimal totalAmount;
|
|
||||||
if (handlingSpecificationsDO.getType() == 0) {
|
|
||||||
totalAmount = new BigDecimal(updateReqVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getUnitPrice());
|
|
||||||
} else {
|
|
||||||
totalAmount = new BigDecimal(updateReqVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getWeight())
|
|
||||||
.multiply(handlingSpecificationsDO.getUnitPrice().multiply(THOUSANDTH));
|
|
||||||
}
|
|
||||||
// 插入
|
|
||||||
HandlingGroupAmountSpecificationsDO handlingGroupAmountSpecifications = BeanUtils.toBean(updateReqVO, HandlingGroupAmountSpecificationsDO.class);
|
|
||||||
handlingGroupAmountSpecifications.setAmount(totalAmount);
|
|
||||||
handlingGroupAmountSpecificationsMapper.updateById(updateObj);
|
handlingGroupAmountSpecificationsMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,33 +90,4 @@ public class HandlingGroupAmountSpecificationsServiceImpl implements HandlingGro
|
|||||||
handlingGroupAmountSpecificationsMapper.insertOrUpdate(handlingGroupAmountSpecifications);
|
handlingGroupAmountSpecificationsMapper.insertOrUpdate(handlingGroupAmountSpecifications);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void batchCreate(HandlingGroupAmountSpecificationsBatchCreateVO vo) {
|
|
||||||
List<HandlingGroupAmountSpecificationsDO> list = new ArrayList<>();
|
|
||||||
List<Long> handlingSpecificationsIds = vo.getItemVOS().stream().map(HandlingGroupAmountSpecificationsBatchCreateItemVO::getHandlingSpecificationsId).collect(Collectors.toList());
|
|
||||||
List<HandlingSpecificationsDO> handlingSpecificationsDOS = handlingSpecificationsService.list(new LambdaQueryWrapper<HandlingSpecificationsDO>()
|
|
||||||
.in(HandlingSpecificationsDO::getId, handlingSpecificationsIds));
|
|
||||||
Map<Long, HandlingSpecificationsDO> map = handlingSpecificationsDOS.stream().collect(Collectors.toMap(HandlingSpecificationsDO::getId, item -> item));
|
|
||||||
for (HandlingGroupAmountSpecificationsBatchCreateItemVO itemVO : vo.getItemVOS()) {
|
|
||||||
HandlingGroupAmountSpecificationsDO handlingGroupAmountSpecificationsDO = new HandlingGroupAmountSpecificationsDO();
|
|
||||||
BigDecimal totalAmount;
|
|
||||||
HandlingSpecificationsDO handlingSpecificationsDO = map.get(itemVO.getHandlingSpecificationsId());
|
|
||||||
if (handlingSpecificationsDO == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (handlingSpecificationsDO.getType() == 0) {
|
|
||||||
totalAmount = new BigDecimal(itemVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getUnitPrice());
|
|
||||||
} else {
|
|
||||||
totalAmount = new BigDecimal(itemVO.getTotalCount().toString()).multiply(handlingSpecificationsDO.getWeight())
|
|
||||||
.multiply(handlingSpecificationsDO.getUnitPrice().multiply(THOUSANDTH));
|
|
||||||
}
|
|
||||||
handlingGroupAmountSpecificationsDO.setFactoryId(vo.getFactoryId());
|
|
||||||
handlingGroupAmountSpecificationsDO.setDateStr(vo.getDateStr());
|
|
||||||
handlingGroupAmountSpecificationsDO.setHandlingSpecificationsId(itemVO.getHandlingSpecificationsId());
|
|
||||||
handlingGroupAmountSpecificationsDO.setAmount(totalAmount);
|
|
||||||
handlingGroupAmountSpecificationsDO.setTotalCount(itemVO.getTotalCount());
|
|
||||||
list.add(handlingGroupAmountSpecificationsDO);
|
|
||||||
}
|
|
||||||
handlingGroupAmountSpecificationsMapper.insertBatch(list);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount;
|
|||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
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.dto.StaffWagesPageDTO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountMonthVO;
|
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountPageReqVO;
|
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.HandlingGroupUserAmountSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.StaffWagesPageVO;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.StaffWagesPageVO;
|
||||||
@ -69,14 +68,4 @@ public interface HandlingGroupUserAmountService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
PageResult<StaffWagesPageVO> staffWagesPage(@Valid StaffWagesPageDTO dto);
|
PageResult<StaffWagesPageVO> staffWagesPage(@Valid StaffWagesPageDTO dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获得搬运组工资记录 按月搜索
|
|
||||||
*
|
|
||||||
* @param factoryId
|
|
||||||
* @param time
|
|
||||||
* @param name
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
HandlingGroupUserAmountMonthVO getListByMonth(Long id, Long factoryId, String time, String name);
|
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
package cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount;
|
package cn.iocoder.yudao.module.smartfactory.service.handlinggroupuseramount;
|
||||||
|
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
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.handlinggroupuseramount.dto.StaffWagesPageDTO;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.dto.StaffWagesPageDTO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.*;
|
import cn.iocoder.yudao.module.smartfactory.controller.admin.handlinggroupuseramount.vo.HandlingGroupUserAmountPageReqVO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsDO;
|
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.handlinggroupuseramount.HandlingGroupUserAmountDO;
|
||||||
import cn.iocoder.yudao.module.smartfactory.dal.mysql.handlinggroupamountspecifications.HandlingGroupAmountSpecificationsMapper;
|
import cn.iocoder.yudao.module.smartfactory.dal.dataobject.handlingspecifications.HandlingSpecificationsDO;
|
||||||
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 org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@ -16,11 +16,6 @@ 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.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搬运组每日个人工资记录 Service 实现类
|
* 搬运组每日个人工资记录 Service 实现类
|
||||||
@ -33,10 +28,6 @@ public class HandlingGroupUserAmountServiceImpl implements HandlingGroupUserAmou
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private HandlingGroupUserAmountMapper handlingGroupUserAmountMapper;
|
private HandlingGroupUserAmountMapper handlingGroupUserAmountMapper;
|
||||||
@Resource
|
|
||||||
private HandlingGroupAmountSpecificationsMapper handlingGroupAmountSpecificationsMapper;
|
|
||||||
private static final String NAME = "姓名";
|
|
||||||
private static final String TOTAL_AMOUNT = "总金额";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createHandlingGroupUserAmount(HandlingGroupUserAmountSaveReqVO createReqVO) {
|
public Long createHandlingGroupUserAmount(HandlingGroupUserAmountSaveReqVO createReqVO) {
|
||||||
@ -67,64 +58,22 @@ public class HandlingGroupUserAmountServiceImpl implements HandlingGroupUserAmou
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<HandlingGroupUserAmountDO> getHandlingGroupUserAmountPage(HandlingGroupUserAmountPageReqVO pageReqVO) {
|
public PageResult<HandlingGroupUserAmountDO> getHandlingGroupUserAmountPage(HandlingGroupUserAmountPageReqVO pageReqVO) {
|
||||||
IPage<HandlingGroupUserAmountDO> page = handlingGroupUserAmountMapper.getHandlingGroupUserAmountPage(MyBatisUtils.buildPage(pageReqVO), pageReqVO);
|
IPage<HandlingGroupUserAmountDO> page = handlingGroupUserAmountMapper.getHandlingGroupUserAmountPage(MyBatisUtils.buildPage(pageReqVO) ,pageReqVO);
|
||||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createOrEdit(HandlingGroupUserAmountSaveReqVO createReqVO) {
|
public void createOrEdit(HandlingGroupUserAmountSaveReqVO createReqVO) {
|
||||||
HandlingGroupAmountSpecificationsDO handlingGroupAmountSpecificationsDO = handlingGroupAmountSpecificationsMapper.selectById(createReqVO.getHandlingGroupAmountSpecificationsId());
|
|
||||||
// 插入
|
// 插入
|
||||||
createReqVO.setFactoryId(handlingGroupAmountSpecificationsDO.getFactoryId());
|
|
||||||
HandlingGroupUserAmountDO handlingGroupUserAmount = BeanUtils.toBean(createReqVO, HandlingGroupUserAmountDO.class);
|
HandlingGroupUserAmountDO handlingGroupUserAmount = BeanUtils.toBean(createReqVO, HandlingGroupUserAmountDO.class);
|
||||||
handlingGroupUserAmountMapper.insertOrUpdate(handlingGroupUserAmount);
|
handlingGroupUserAmountMapper.insertOrUpdate(handlingGroupUserAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<StaffWagesPageVO> staffWagesPage(StaffWagesPageDTO dto) {
|
public PageResult<StaffWagesPageVO> staffWagesPage(StaffWagesPageDTO dto) {
|
||||||
IPage<StaffWagesPageVO> page = handlingGroupUserAmountMapper.staffWagesPage(MyBatisUtils.buildPage(dto), dto);
|
IPage<StaffWagesPageVO> page = handlingGroupUserAmountMapper.staffWagesPage(MyBatisUtils.buildPage(dto) ,dto);
|
||||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HandlingGroupUserAmountMonthVO getListByMonth(Long id, Long factoryId, String time, String name) {
|
|
||||||
HandlingGroupUserAmountMonthVO vo = new HandlingGroupUserAmountMonthVO();
|
|
||||||
Map<Integer, String> headers = new HashMap<>();
|
|
||||||
// -- 根据yyyy-MM获取到该月第一天时间 - 再获取到最后一天 - 完了后组装表头
|
|
||||||
String[] times = time.split("-");
|
|
||||||
LocalDateTime startTime = LocalDateTime.of(Integer.parseInt(times[0]), Integer.parseInt(times[1]), 1, 0, 0, 0);
|
|
||||||
LocalDateTime endTime = startTime.plusMonths(1).minusDays(1);
|
|
||||||
List<String> dateList = DateUtils.betweenDayList(startTime, endTime);
|
|
||||||
headers.put(1, NAME);
|
|
||||||
int num = 1;
|
|
||||||
for (String date : dateList) {
|
|
||||||
num++;
|
|
||||||
headers.put(num, date);
|
|
||||||
}
|
|
||||||
headers.put(num + 1, TOTAL_AMOUNT);
|
|
||||||
// - 插入表头
|
|
||||||
vo.setHeaders(headers);
|
|
||||||
|
|
||||||
List<Map<String, Object>> map = handlingGroupUserAmountMapper.getListByMonth(id, factoryId, dateList, name);
|
|
||||||
List<HandlingGroupUserAmountMonthItemVO> list = new ArrayList<>();
|
|
||||||
for (Map<String, Object> item : map) {
|
|
||||||
HandlingGroupUserAmountMonthItemVO itemVO = new HandlingGroupUserAmountMonthItemVO();
|
|
||||||
itemVO.setUserId((Long) item.get("userId"));
|
|
||||||
Map<Integer, String> itemMap = new HashMap<>();
|
|
||||||
itemMap.put(1, item.get("nickName").toString());
|
|
||||||
num = 1;
|
|
||||||
for (String date : dateList) {
|
|
||||||
num++;
|
|
||||||
itemMap.put(num, item.get(date).toString());
|
|
||||||
}
|
|
||||||
itemMap.put(num + 1, item.get("totalAmount").toString());
|
|
||||||
itemVO.setContentList(itemMap);
|
|
||||||
list.add(itemVO);
|
|
||||||
}
|
|
||||||
vo.setList(list);
|
|
||||||
return vo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -71,31 +71,4 @@
|
|||||||
</where>
|
</where>
|
||||||
group by a.id
|
group by a.id
|
||||||
</select>
|
</select>
|
||||||
<select id="getListByMonth" resultType="java.util.Map">
|
|
||||||
SELECT
|
|
||||||
a.user_id as userId,
|
|
||||||
b.nick_name as nickName,
|
|
||||||
<foreach collection="dateList" item="date" separator=",">
|
|
||||||
SUM(CASE WHEN a.date_str = #{date} THEN a.amount ELSE 0 END) AS `${date}`
|
|
||||||
</foreach>,
|
|
||||||
-- 继续添加该月所有日期...
|
|
||||||
SUM(a.amount) AS totalAmount
|
|
||||||
FROM
|
|
||||||
sf_handling_group_user_amount as a
|
|
||||||
left join sf_staff as b on a.user_id = b.id
|
|
||||||
<where>
|
|
||||||
a.deleted = 0
|
|
||||||
<if test="id != null">
|
|
||||||
and b.id = #{id}
|
|
||||||
</if>
|
|
||||||
<if test="factoryId != null">
|
|
||||||
and a.factory_id = #{factoryId}
|
|
||||||
</if>
|
|
||||||
<if test="name != null and name != ''">
|
|
||||||
and b.nick_name like concat('%', #{name}, '%')
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
GROUP BY
|
|
||||||
a.user_id;
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
Loading…
Reference in New Issue
Block a user