| ¶Ô±ÈÐÂÎļþ |
| | |
| | | #产åéè´§å表 |
| | | drop table if exists purchase_return_orders; |
| | | create table purchase_return_orders |
| | | ( |
| | | id bigint auto_increment primary key, |
| | | no varchar(255) null comment 'éè´§åç¼å·', |
| | | return_type tinyint not null default 0 comment 'éè´§æ¹å¼ 0éè´§éæ¬¾ 1ææ¶', |
| | | supplier_id bigint not null default 0 comment 'ä¾åºåid', |
| | | project_id bigint not null default 0 comment '项ç®id', |
| | | project_phase tinyint not null default 0 comment '项ç®é¶æ®µ', |
| | | prepared_at datetime null comment 'å¶åæ¥æ', |
| | | prepared_user_id bigint not null default 0 comment 'å¶å人id', |
| | | return_user_id bigint not null default 0 comment 'éæäººid', |
| | | purchase_ledger_id bigint not null default 0 comment 'éè´è®¢åid', |
| | | total_discount_amount decimal(10, 2) null comment 'æ´åææ£é¢', |
| | | total_discount_rate decimal(10, 2) null comment 'æ´åææ£ç', |
| | | total_amount decimal(10,2) null comment 'æäº¤éé¢', |
| | | remark text null comment '夿³¨', |
| | | create_time datetime null comment 'å½å
¥æ¶é´', |
| | | update_time datetime null comment 'æ´æ°æ¶é´', |
| | | index idx_supplier_id (supplier_id), |
| | | index idx_purchase_ledger_id (purchase_ledger_id), |
| | | index idx_project_id (project_id) |
| | | ); |
| | | |
| | | #产åéè´§åä¸éè´äº§åå
³è表 |
| | | drop table if exists purchase_return_order_products; |
| | | create table purchase_return_order_products |
| | | ( |
| | | id bigint auto_increment primary key, |
| | | purchase_return_order_id bigint not null default 0 comment 'éè´§åid', |
| | | sales_ledger_product_id bigint not null default 0 comment 'éè´äº§åid', |
| | | create_time datetime null comment 'å½å
¥æ¶é´', |
| | | update_time datetime null comment 'æ´æ°æ¶é´', |
| | | index idx_purchase_return_order_id (purchase_return_order_id), |
| | | index idx_sales_ledger_product_id (sales_ledger_product_id) |
| | | ); |
| | |
| | | <tomcat.version>9.0.102</tomcat.version>
|
| | | <minio.version>8.4.3</minio.version>
|
| | | <okhttp.version>4.9.0</okhttp.version>
|
| | | <hutool.version>5.8.18</hutool.version>
|
| | | <logback.version>1.2.13</logback.version>
|
| | | <spring-security.version>5.7.12</spring-security.version>
|
| | | <spring-framework.version>5.3.39</spring-framework.version>
|
| | |
| | | <version>${getui-sdk.version}</version>
|
| | | <scope>compile</scope>
|
| | | </dependency>
|
| | | |
| | | <!--hutoolå·¥å
·å
-->
|
| | | <dependency>
|
| | | <groupId>cn.hutool</groupId>
|
| | | <artifactId>hutool-all</artifactId>
|
| | | <version>${hutool.version}</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>cn.hutool</groupId>
|
| | | <artifactId>hutool-all</artifactId>
|
| | | <version>5.8.43</version>
|
| | | </dependency>
|
| | | <dependency>
|
| | | <groupId>com.fasterxml.jackson.datatype</groupId>
|
| | | <artifactId>jackson-datatype-jsr310</artifactId>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
| | |
| | | .eq(SysNotice::getStatus,"1") |
| | | .lt(SysNotice::getCreateTime, LocalDateTime.now())); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.basic.dto.CustomerFollowUpFileDto; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | @PostMapping("/upload/{followUpId}") |
| | | @Log(title = "客æ·è·è¿-ä¸ä¼ éä»¶", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @PathVariable Integer followUpId) { |
| | | customerFollowUpService.addFollowUpFiles(files, followUpId); |
| | | return AjaxResult.success(); |
| | | return AjaxResult.success(customerFollowUpService.addFollowUpFiles(files, followUpId)); |
| | | } |
| | | |
| | | /** |
| | | * ä¸ä¼ è·è¿éä»¶ï¼å¤ç¨ï¼æ IDï¼ |
| | | */ |
| | | @ApiOperation("ä¸ä¼ éä»¶(å¤ç¨)") |
| | | @PostMapping("/upload") |
| | | @Log(title = "ä¸ä¼ éä»¶(å¤ç¨)", businessType = BusinessType.INSERT) |
| | | public AjaxResult uploadFiles(@RequestParam("files") List<MultipartFile> files, @RequestParam(required = false) String name) { |
| | | List<CustomerFollowUpFileDto> uploadedFiles = customerFollowUpService.addFollowUpFiles(files, null); |
| | | return AjaxResult.success(uploadedFiles); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ¥è¯¢éä»¶å表 |
| | | */ |
| | | @ApiOperation("æ¹éæ¥è¯¢éä»¶å表") |
| | | @PostMapping("/file/list") |
| | | public AjaxResult getFileList(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(customerFollowUpService.getFollowUpFilesByIds(ids)); |
| | | } |
| | | |
| | | /** |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.basic.dto; |
| | | |
| | | import com.ruoyi.basic.pojo.CustomerFollowUpFile; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 客æ·è·è¿éä»¶DTO |
| | | * |
| | | * @author deslrey |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CustomerFollowUpFileDto extends CustomerFollowUpFile { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ä¸ä¼ è
å§å |
| | | */ |
| | | private String createUserName; |
| | | |
| | | /** |
| | | * ä¿®æ¹è
å§å |
| | | */ |
| | | private String updateUserName; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.pojo.CustomerFollowUpFile; |
| | | import com.ruoyi.common.vo.SimpleFileVo; |
| | | |
| | | import javax.annotation.Nullable; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.util.List; |
| | | import java.util.function.BiConsumer; |
| | | import java.util.function.Function; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | * @since 2026/03/04 14:52 |
| | | */ |
| | | public interface CustomerFollowUpFileService extends IService<CustomerFollowUpFile> { |
| | | |
| | | /** |
| | | * æ ¹æ® xx,xxx,xxæ¹éæ¥è¯¢å¹¶ä¸åºæå
¥SimpleFileVoè¿å
¥ |
| | | * @param list |
| | | * @param getAttachmentIds |
| | | * @param setAttachmentList |
| | | * @param <T> |
| | | */ |
| | | <T> void fillAttachment( |
| | | @Nullable List<T> list, |
| | | @NotNull Function<T, String> getAttachmentIds, |
| | | @NotNull BiConsumer<T, List<SimpleFileVo>> setAttachmentList |
| | | ); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.basic.dto.CustomerFollowUpDto; |
| | | import com.ruoyi.basic.pojo.CustomerFollowUp; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.ruoyi.basic.dto.CustomerFollowUpFileDto; |
| | | import com.ruoyi.basic.pojo.CustomerFollowUpFile; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æ·»å è·è¿éä»¶ |
| | | */ |
| | | void addFollowUpFiles(List<MultipartFile> files, Integer followUpId); |
| | | List<CustomerFollowUpFileDto> addFollowUpFiles(List<MultipartFile> files, Integer followUpId); |
| | | |
| | | /** |
| | | * å é¤è·è¿éä»¶ |
| | |
| | | void deleteFollowUpFile(Integer fileId); |
| | | |
| | | /** |
| | | * æ ¹æ®éä»¶IDéåè·åéä»¶å表 |
| | | */ |
| | | List<CustomerFollowUpFile> getFollowUpFilesByIds(Collection<Long> fileIds); |
| | | |
| | | /** |
| | | * è·åè·è¿è¯¦æ
|
| | | */ |
| | | CustomerFollowUpDto getFollowUpWithFiles(Integer id); |
| | |
| | | package com.ruoyi.basic.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.stream.CollectorUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.basic.mapper.CustomerFollowUpFileMapper; |
| | | import com.ruoyi.basic.pojo.CustomerFollowUpFile; |
| | | import com.ruoyi.basic.service.CustomerFollowUpFileService; |
| | | import com.ruoyi.basic.service.CustomerFollowUpService; |
| | | import com.ruoyi.common.vo.SimpleFileVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.function.BiConsumer; |
| | | import java.util.function.Function; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | * @since 2026/03/04 14:53 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class CustomerFollowUpFileServiceImpl extends ServiceImpl<CustomerFollowUpFileMapper, CustomerFollowUpFile> implements CustomerFollowUpFileService { |
| | | |
| | | private final CustomerFollowUpService customerFollowUpService; |
| | | |
| | | |
| | | @Override |
| | | public <T> void fillAttachment(List<T> list, Function<T, String> getAttachmentIds, BiConsumer<T, List<SimpleFileVo>> setAttachmentList) { |
| | | if (CollUtil.isEmpty(list)) { |
| | | return; |
| | | } |
| | | // æ¶éæææä»¶ID |
| | | Set<Long> ids = list.stream() |
| | | .map(getAttachmentIds) |
| | | .filter(StrUtil::isNotBlank) |
| | | .flatMap(s -> Arrays.stream(s.split(","))) |
| | | .map(Long::valueOf) |
| | | .collect(Collectors.toSet()); |
| | | List<CustomerFollowUpFile> followUpFilesByIds = new ArrayList<>(); |
| | | Lists.partition(Lists.newArrayList(ids), 999).forEach(it -> { |
| | | followUpFilesByIds.addAll( |
| | | customerFollowUpService.getFollowUpFilesByIds(it) |
| | | ); |
| | | }); |
| | | if (CollUtil.isEmpty(followUpFilesByIds)) { |
| | | return; |
| | | } |
| | | Map<Long, SimpleFileVo> collectMap = followUpFilesByIds.stream().map(SimpleFileVo::convert).collect(Collectors.toMap( |
| | | SimpleFileVo::getId, |
| | | Function.identity() |
| | | )); |
| | | list.forEach(t -> { |
| | | String attachmentIds = getAttachmentIds.apply(t); |
| | | if (StrUtil.isNotBlank(attachmentIds)) { |
| | | List<SimpleFileVo> fileVos = Arrays.stream(attachmentIds.split(",")) |
| | | .map(Long::valueOf) |
| | | .map(it->collectMap.getOrDefault(it, null)) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | setAttachmentList.accept(t, fileVos); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.basic.pojo.CustomerFollowUpFile; |
| | | import com.ruoyi.basic.service.CustomerFollowUpFileService; |
| | | import com.ruoyi.basic.service.CustomerFollowUpService; |
| | | import com.ruoyi.basic.service.ICustomerService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.basic.dto.CustomerFollowUpFileDto; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.service.ISysUserService; |
| | | |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | |
| | |
| | | |
| | | @Value("${file.upload-dir}") |
| | | private String uploadDir; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addFollowUpFiles(List<MultipartFile> files, Integer followUpId) { |
| | | handleFollowUpFiles(files, followUpId); |
| | | public List<CustomerFollowUpFileDto> addFollowUpFiles(List<MultipartFile> files, Integer followUpId) { |
| | | return handleFollowUpFiles(files, followUpId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | } |
| | | |
| | | private void handleFollowUpFiles(List<MultipartFile> multipartFiles, Integer followUpId) { |
| | | @Override |
| | | public List<CustomerFollowUpFile> getFollowUpFilesByIds(Collection<Long> fileIds) { |
| | | if (fileIds == null || fileIds.isEmpty()) { |
| | | return new ArrayList<>(0); |
| | | } |
| | | |
| | | LambdaQueryWrapper<CustomerFollowUpFile> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.in(CustomerFollowUpFile::getId, fileIds) |
| | | .select(CustomerFollowUpFile::getId, CustomerFollowUpFile::getFileUrl, CustomerFollowUpFile::getFileName); |
| | | return customerFollowUpFileService.list(queryWrapper); |
| | | } |
| | | |
| | | private List<CustomerFollowUpFileDto> handleFollowUpFiles(List<MultipartFile> multipartFiles, Integer followUpId) { |
| | | List<CustomerFollowUpFile> fileList = new ArrayList<>(); |
| | | List<CustomerFollowUpFileDto> dtoList = new ArrayList<>(); |
| | | if (multipartFiles == null || multipartFiles.isEmpty()) { |
| | | return; |
| | | return dtoList; |
| | | } |
| | | |
| | | Long currentUserId = SecurityUtils.getUserId(); |
| | | Long currentTenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | List<CustomerFollowUpFile> fileList = new ArrayList<>(); |
| | | |
| | | for (MultipartFile file : multipartFiles) { |
| | | if (file == null || file.isEmpty()) { |
| | |
| | | |
| | | String originalFilename = file.getOriginalFilename(); |
| | | String fileExtension = FilenameUtils.getExtension(originalFilename); |
| | | String formalFilename = followUpId + "_" + |
| | | String prefix = (followUpId != null) ? followUpId.toString() : "temp"; |
| | | String formalFilename = prefix + "_" + |
| | | System.currentTimeMillis() + "_" + |
| | | UUID.randomUUID().toString().substring(0, 8) + |
| | | (StringUtils.hasText(fileExtension) ? "." + fileExtension : ""); |
| | |
| | | } |
| | | if (!fileList.isEmpty()) { |
| | | customerFollowUpFileService.saveBatch(fileList); |
| | | return convertToDtoList(fileList); |
| | | } |
| | | return dtoList; |
| | | } |
| | | |
| | | private List<CustomerFollowUpFileDto> convertToDtoList(List<CustomerFollowUpFile> fileList) { |
| | | List<CustomerFollowUpFileDto> dtoList = new ArrayList<>(); |
| | | if (fileList == null || fileList.isEmpty()) { |
| | | return dtoList; |
| | | } |
| | | for (CustomerFollowUpFile entity : fileList) { |
| | | CustomerFollowUpFileDto dto = new CustomerFollowUpFileDto(); |
| | | BeanUtils.copyProperties(entity, dto); |
| | | |
| | | if (entity.getCreateUser() != null) { |
| | | SysUser createUser = sysUserService.selectUserById(entity.getCreateUser()); |
| | | if (createUser != null) { |
| | | dto.setCreateUserName(createUser.getNickName()); |
| | | } |
| | | } |
| | | if (entity.getUpdateUser() != null) { |
| | | SysUser updateUser = sysUserService.selectUserById(entity.getUpdateUser()); |
| | | if (updateUser != null) { |
| | | dto.setUpdateUserName(updateUser.getNickName()); |
| | | } |
| | | } |
| | | dtoList.add(dto); |
| | | } |
| | | return dtoList; |
| | | } |
| | | |
| | | private void validateFollowUp(CustomerFollowUp followUp) { |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Optional; |
| | | |
| | | @Component |
| | | public class MybatisHandler implements MetaObjectHandler { |
| | |
| | | this.strictInsertFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now()); |
| | | this.strictInsertFill(metaObject, "createUser", Integer.class, userId); |
| | | this.strictInsertFill(metaObject, "updateUser", Integer.class, userId); |
| | | this.strictInsertFill(metaObject, "createUser", Long.class, userId == null ? 0 : userId.longValue()); |
| | | this.strictInsertFill(metaObject, "updateUser", Long.class, userId == null ? 0 : userId.longValue()); |
| | | this.strictInsertFill(metaObject, "tenantId", Long.class, tenantId); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonCreator; |
| | | import lombok.Getter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Getter |
| | | public enum PlanStageEnum implements BaseEnum<Integer>, Serializable { |
| | | TO_BEGIN(1, "å¾
å¼å§"), |
| | | ON_GOING(2, "è¿è¡ä¸"), |
| | | ENDED(3, "å·²ç»æ"); |
| | | |
| | | private final Integer code; |
| | | private final String value; |
| | | |
| | | PlanStageEnum(Integer code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | public enum ProcessType implements BaseEnum<Integer>{ |
| | | |
| | | TIMEKEEPING(1, "计æ¶"), |
| | | PIECERATE(2, "计件"); |
| | | |
| | | private final Integer code; |
| | | private final String value; |
| | | |
| | | ProcessType(Integer code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getCode() { |
| | | return this.code; |
| | | } |
| | | |
| | | @Override |
| | | public String getValue() { |
| | | return this.value; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Getter |
| | | public enum ReviewStatusEnum implements BaseEnum<Integer>, Serializable { |
| | | PENDING_REVIEW(0, "å¾
å®¡æ ¸"), |
| | | APPROVED(1, "å·²å®¡æ ¸"), |
| | | REJECTED(2, "å®¡æ ¸æªéè¿"); |
| | | |
| | | private final Integer code; |
| | | private final String value; |
| | | |
| | | ReviewStatusEnum(Integer code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Getter |
| | | public enum SaleEnum implements BaseEnum<Integer>{ |
| | | SALE(1, "éå®"), |
| | | PURCHASE(2, "éè´"), |
| | | MANAGEMENT(3, "项ç®"); |
| | | |
| | | private final Integer code; |
| | | private final String value; |
| | | |
| | | SaleEnum(Integer code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.vo; |
| | | |
| | | import com.ruoyi.basic.pojo.CustomerFollowUpFile; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/6 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SimpleFileVo implements Serializable { |
| | | private Long id; |
| | | private String fileName; |
| | | private String fileUrl; |
| | | |
| | | public static SimpleFileVo convert(@NotNull CustomerFollowUpFile file){ |
| | | return new SimpleFileVo(file.getId(), file.getFileName(), file.getFileUrl()); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.procurementrecord.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.mapper.ReturnManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | | import com.ruoyi.procurementrecord.service.ReturnManagementService; |
| | | import com.ruoyi.procurementrecord.service.ReturnSaleProductService; |
| | | import com.ruoyi.procurementrecord.service.impl.ReturnSaleProductServiceImpl; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | * @date : 2025/9/17 10:34 |
| | | */ |
| | | @RestController |
| | | @Api(tags = "å°è´§ç®¡ç") |
| | | @Api(tags = "éå®éè´§") |
| | | @RequestMapping("/returnManagement") |
| | | public class ReturnManagementController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ReturnManagementService returnManagementService; |
| | | |
| | | @Autowired |
| | | private ReturnManagementMapper returnManagementMapper; |
| | | private ReturnSaleProductService returnSaleProductService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å°è´§ç®¡ç-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ReturnManagement returnManagement) { |
| | | IPage<ReturnManagement> result = returnManagementService.listPage(page, returnManagement); |
| | | @ApiOperation("éå®éè´§-æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, ReturnManagementDto returnManagement) { |
| | | IPage<ReturnManagementDto> result = returnManagementService.listPage(page, returnManagement); |
| | | return AjaxResult.success(result); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("å°è´§ç®¡ç-æ·»å ") |
| | | @ApiOperation("éå®éè´§-æ·»å ") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody ReturnManagement returnManagement) { |
| | | String rt = OrderUtils.countTodayByCreateTime(returnManagementMapper, "RT"); |
| | | returnManagement.setReturnNo(rt); |
| | | boolean result = returnManagementService.save(returnManagement); |
| | | return result ? success() : error(); |
| | | public AjaxResult add(@RequestBody ReturnManagementDto returnManagementDto) { |
| | | return returnManagementService.addReturnManagementDto(returnManagementDto) ? success() : error(); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("å°è´§ç®¡ç-ä¿®æ¹") |
| | | @ApiOperation("éå®éè´§-ä¿®æ¹") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult update(@RequestBody ReturnManagement returnManagement) { |
| | | boolean result = returnManagementService.updateById(returnManagement); |
| | | return result ? success() : error(); |
| | | public AjaxResult update(@RequestBody ReturnManagementDto returnManagementDto) { |
| | | return returnManagementService.updateReturnManagementDto(returnManagementDto) ? success() : error(); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("éå®éè´§-å¤çéè´§å") |
| | | @GetMapping("/handle") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult handle(Long returnManagementId) { |
| | | return returnManagementService.handle(returnManagementId) ? success() : error(); |
| | | } |
| | | |
| | | |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("å°è´§ç®¡ç-å é¤") |
| | | @ApiOperation("éå®éè´§-å é¤") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult del(@RequestBody List<Long> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) return error("è¯·éæ©è³å°ä¸æ¡æ°æ®"); |
| | | returnSaleProductService.remove(new QueryWrapper<ReturnSaleProduct>() |
| | | .lambda() |
| | | .in(ReturnSaleProduct::getReturnManagementId, ids)); |
| | | boolean result = returnManagementService.removeByIds(ids); |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | @GetMapping("/getById") |
| | | @ApiOperation("éå®éè´§-æ ¹æ®idæ¥è¯¢") |
| | | public AjaxResult getById(Long returnManagementId) { |
| | | ReturnManagementDto returnManagementDto = returnManagementService.getReturnManagementDtoById(returnManagementId); |
| | | return success(returnManagementDto); |
| | | } |
| | | |
| | | @GetMapping("/getByShippingId") |
| | | @ApiOperation("éå®éè´§-æ ¹æ®åºåºåæ¥è¯¢éå®è®¢å以å产åä¿¡æ¯") |
| | | public AjaxResult getByShippingId(Long shippingId) { |
| | | SalesLedgerDto salesLedgerDto = returnManagementService.getReturnManagementDtoByShippingIdId(shippingId); |
| | | return success(salesLedgerDto); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * é货产å表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:57:42 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/returnSaleProduct") |
| | | public class ReturnSaleProductController { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2025/9/17 10:28 |
| | | */ |
| | | @Data |
| | | public class ReturnManagementDto extends ReturnManagement { |
| | | |
| | | |
| | | @ApiModelProperty(value = "客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @ApiModelProperty(value = "éå®åå·") |
| | | private String salesContractNo; |
| | | |
| | | @ApiModelProperty(value = "ä¸å¡å") |
| | | private String salesman; |
| | | |
| | | |
| | | @ApiModelProperty("å
³èåºåºåå·") |
| | | private String shippingNo; |
| | | |
| | | @ApiModelProperty(value = "项ç®åç§°") |
| | | private String projectName; |
| | | |
| | | @ApiModelProperty(value = "éå®å°è´¦id") |
| | | private Long salesLedgerId; |
| | | |
| | | @ApiModelProperty(value = "éå®äº§å对象æ°ç»") |
| | | private List<ReturnSaleProductDto> returnSaleProducts; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.dto; |
| | | |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class ReturnSaleProductDto extends ReturnSaleProduct { |
| | | |
| | | private String productName; |
| | | |
| | | private String model; |
| | | |
| | | private String unit; |
| | | |
| | | //æªéè´§æ°é |
| | | private BigDecimal unQuantity; |
| | | |
| | | private BigDecimal totalReturnNum; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.procurementrecord.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | * @param page |
| | | * @return |
| | | */ |
| | | IPage<ReturnManagement> listPage(Page page,@Param("req") ReturnManagement returnManagement); |
| | | IPage<ReturnManagementDto> listPage(Page page, @Param("req") ReturnManagementDto returnManagement); |
| | | |
| | | ReturnManagementDto getReturnManagementDtoById(Long id); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.mapper; |
| | | |
| | | import com.ruoyi.procurementrecord.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * é货产å表 Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:57:42 |
| | | */ |
| | | @Mapper |
| | | public interface ReturnSaleProductMapper extends BaseMapper<ReturnSaleProduct> { |
| | | |
| | | List<ReturnSaleProductDto> listReturnSaleProductDto(@Param("returnManagementId") Long returnManagementId); |
| | | } |
| | |
| | | @ApiModelProperty(value = "éè´§åå·") |
| | | private String returnNo; |
| | | |
| | | @ApiModelProperty(value = "å
³èåå·") |
| | | private String relatedNo; |
| | | @ApiModelProperty("客æ·id") |
| | | private Long customerId; |
| | | |
| | | @ApiModelProperty(value = "éè´§ç±»å") |
| | | private String returnType; |
| | | @ApiModelProperty("å
³èåºåºåå·Id") |
| | | private Long shippingId; |
| | | |
| | | @ApiModelProperty(value = "ä¾åºååç§°") |
| | | private String supplierName; |
| | | @ApiModelProperty("项ç®id") |
| | | private Long projectId; |
| | | |
| | | @ApiModelProperty(value = "éè´§åå ") |
| | | private String returnReason; |
| | | @ApiModelProperty("项ç®é¶æ®µ") |
| | | private String projectStage; |
| | | |
| | | @ApiModelProperty(value = "éè´§ç¶æ") |
| | | private String status; |
| | | @ApiModelProperty("å¶å人") |
| | | private String maker; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ApiModelProperty("å¶åæ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime makeTime; |
| | | |
| | | @ApiModelProperty("ç»ç®äºº") |
| | | private String settler; |
| | | |
| | | @ApiModelProperty("ç¶æ") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty(value = "åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @ApiModelProperty(value = "ç§æ·ID") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long tenantId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * é货产å表 |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:57:42 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("return_sale_product") |
| | | @ApiModel(value = "ReturnSaleProduct对象", description = "é货产å表") |
| | | public class ReturnSaleProduct implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主é®id") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("éè´§åid") |
| | | private Long returnManagementId; |
| | | |
| | | @ApiModelProperty("é货产åid") |
| | | private Long returnSaleLedgerProductId; |
| | | |
| | | @ApiModelProperty("éè´§äº§åæ°é") |
| | | private BigDecimal num; |
| | | |
| | | @ApiModelProperty("éè´§ç¶æ 0 æªéå 1å·²éè´§") |
| | | private Integer status; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.procurementrecord.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | * @param returnManagement |
| | | * @return |
| | | */ |
| | | IPage<ReturnManagement> listPage(Page page, ReturnManagement returnManagement); |
| | | IPage<ReturnManagementDto> listPage(Page page, ReturnManagementDto returnManagement); |
| | | |
| | | boolean addReturnManagementDto(ReturnManagementDto returnManagementDto); |
| | | |
| | | boolean updateReturnManagementDto(ReturnManagementDto returnManagementDto); |
| | | |
| | | SalesLedgerDto getReturnManagementDtoByShippingIdId(Long shippingId); |
| | | |
| | | boolean handle(Long returnManagementId); |
| | | |
| | | ReturnManagementDto getReturnManagementDtoById(Long returnManagementId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.service; |
| | | |
| | | import com.ruoyi.procurementrecord.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * é货产å表 æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:57:42 |
| | | */ |
| | | public interface ReturnSaleProductService extends IService<ReturnSaleProduct> { |
| | | |
| | | List<ReturnSaleProductDto> listReturnSaleProductDto(Long returnManagementId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.procurementrecord.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.mapper.ReturnManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | | import com.ruoyi.procurementrecord.service.ReturnManagementService; |
| | | import com.ruoyi.procurementrecord.service.ReturnSaleProductService; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.mapper.SalesLedgerMapper; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import com.ruoyi.sales.service.ShippingInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | @Autowired |
| | | private ReturnManagementMapper returnManagementMapper; |
| | | |
| | | @Autowired |
| | | private ReturnSaleProductService returnSaleProductService; |
| | | @Autowired |
| | | private ShippingInfoService shippingInfoService; |
| | | @Autowired |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | |
| | | @Override |
| | | public IPage<ReturnManagement> listPage(Page page, ReturnManagement returnManagement) { |
| | | IPage<ReturnManagement> returnManagementIPage = returnManagementMapper.listPage(page, returnManagement); |
| | | public IPage<ReturnManagementDto> listPage(Page page, ReturnManagementDto returnManagement) { |
| | | IPage<ReturnManagementDto> returnManagementIPage = returnManagementMapper.listPage(page, returnManagement); |
| | | return returnManagementIPage; |
| | | } |
| | | |
| | | @Override |
| | | public boolean addReturnManagementDto(ReturnManagementDto returnManagementDto) { |
| | | String rt = OrderUtils.countTodayByCreateTime(returnManagementMapper, "RT"); |
| | | returnManagementDto.setReturnNo(rt); |
| | | save(returnManagementDto); |
| | | for (ReturnSaleProduct returnSaleProduct : returnManagementDto.getReturnSaleProducts()) { |
| | | returnSaleProduct.setReturnManagementId(returnManagementDto.getId()); |
| | | returnSaleProduct.setStatus(0); |
| | | returnSaleProductService.save(returnSaleProduct); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public boolean updateReturnManagementDto(ReturnManagementDto returnManagementDto) { |
| | | List<ReturnSaleProduct> returnSaleProducts = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(returnManagementDto.getReturnSaleProducts())) { |
| | | returnManagementDto.getReturnSaleProducts().stream().forEach(returnSaleProductDto -> { |
| | | ReturnSaleProduct returnSaleProduct = new ReturnSaleProduct(); |
| | | BeanUtils.copyProperties(returnSaleProductDto, returnSaleProduct); |
| | | returnSaleProducts.add(returnSaleProduct); |
| | | }); |
| | | } |
| | | returnSaleProductService.updateBatchById(returnSaleProducts); |
| | | return updateById(returnManagementDto); |
| | | } |
| | | |
| | | @Override |
| | | public SalesLedgerDto getReturnManagementDtoByShippingIdId(Long shippingId) { |
| | | ShippingInfo byId = shippingInfoService.getById(shippingId); |
| | | SalesLedger salesLedger = salesLedgerMapper.selectById(byId.getSalesLedgerId()); |
| | | SalesLedgerDto salesLedgerDto = new SalesLedgerDto(); |
| | | BeanUtils.copyProperties(salesLedger, salesLedgerDto); |
| | | |
| | | List<SalesLedgerProductDto> salesLedgerProductDtos = shippingInfoService.getReturnManagementDtoById(byId.getId()); |
| | | salesLedgerDto.setProductDtoData(salesLedgerProductDtos); |
| | | return salesLedgerDto; |
| | | } |
| | | |
| | | @Override |
| | | public boolean handle(Long returnManagementId) { |
| | | ReturnManagement byId = this.getById(returnManagementId); |
| | | byId.setStatus(1); |
| | | updateById(byId); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public ReturnManagementDto getReturnManagementDtoById(Long returnManagementId) { |
| | | ReturnManagementDto returnManagementDtoById = returnManagementMapper.getReturnManagementDtoById(returnManagementId); |
| | | returnManagementDtoById.setReturnSaleProducts(returnSaleProductService.listReturnSaleProductDto(returnManagementId)); |
| | | return returnManagementDtoById; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | import com.ruoyi.procurementrecord.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | | import com.ruoyi.procurementrecord.mapper.ReturnSaleProductMapper; |
| | | import com.ruoyi.procurementrecord.service.ReturnSaleProductService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * é货产å表 æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:57:42 |
| | | */ |
| | | @Service |
| | | public class ReturnSaleProductServiceImpl extends ServiceImpl<ReturnSaleProductMapper, ReturnSaleProduct> implements ReturnSaleProductService { |
| | | |
| | | @Autowired |
| | | private ReturnSaleProductMapper returnSaleProductMapper; |
| | | @Override |
| | | public List<ReturnSaleProductDto> listReturnSaleProductDto(Long returnManagementId) { |
| | | |
| | | return returnSaleProductMapper.listReturnSaleProductDto(returnManagementId); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProductOrderDto; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.dto.UserProductionAccountingDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | | import com.ruoyi.production.service.impl.SalesLedgerProductionAccountingServiceImpl; |
| | |
| | | public R listProductionDetails(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page){ |
| | | return R.ok(salesLedgerProductionAccountingService.listProductionDetails(salesLedgerProductionAccountingDto,page)); |
| | | } |
| | | |
| | | @GetMapping("getByUserId") |
| | | @ApiModelProperty("æ¥è¯¢å·¥äººç产工èµä¿¡æ¯") |
| | | public R getByUserId(UserProductionAccountingDto userProductionAccountingDto){ |
| | | return R.ok(salesLedgerProductionAccountingService.getByUserId(userProductionAccountingDto)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class UserAccountDto { |
| | | |
| | | private String userName; |
| | | |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty("计æ¶") |
| | | private BigDecimal account; |
| | | |
| | | @ApiModelProperty("计件") |
| | | private BigDecimal accountBalance; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.production.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class UserProductionAccountingDto { |
| | | private Long userId; |
| | | |
| | | private String date; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.dto.UserAccountDto; |
| | | import com.ruoyi.production.dto.UserProductionAccountingDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | IPage<SalesLedgerProductionAccountingDto> pageProductionAccounting(Page page, @Param("ew") SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto); |
| | | |
| | | List<Map<String, Object>> selectDailyWagesStats(@Param("startDate") String startDate, @Param("endDate") String endDate); |
| | | |
| | | UserAccountDto getByUserId(@Param( "ew") UserProductionAccountingDto userProductionAccountingDto); |
| | | } |
| | |
| | | @TableField(updateStrategy = FieldStrategy.IGNORED) |
| | | private BigDecimal salaryQuota; |
| | | |
| | | @ApiModelProperty("ç±»å åºåæ¯è®¡æ¶è¿æ¯è®¡ä»¶ 0 è®¡æ¶ 1计件") |
| | | private Long type; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.dto.UserAccountDto; |
| | | import com.ruoyi.production.dto.UserProductionAccountingDto; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | | |
| | | /** |
| | |
| | | IPage<SalesLedgerProductionAccountingDto> pageProductionAccounting(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page); |
| | | |
| | | IPage<ProductionProductMainDto> listProductionDetails(SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto, Page page); |
| | | |
| | | UserAccountDto getByUserId(UserProductionAccountingDto userProductionAccountingDto); |
| | | } |
| | |
| | | } |
| | | } |
| | | productOrderMapper.updateById(productOrder); |
| | | /*æ·»å çäº§æ ¸ç®*/ |
| | | /*æ·»å çäº§æ ¸ç® åºåå·¥åºæ¯è®¡ä»¶è¿æ¯è®¡æ¶*/ |
| | | BigDecimal workHours = (productProcess.getType() == 1) |
| | | ? productProcess.getSalaryQuota().multiply(productQty) |
| | | : productProcess.getSalaryQuota(); |
| | | |
| | | SalesLedgerProductionAccounting salesLedgerProductionAccounting = SalesLedgerProductionAccounting.builder() |
| | | .productMainId(productionProductMain.getId()) |
| | | .schedulingUserId(user.getUserId()) |
| | | .schedulingUserName(user.getNickName()) |
| | | .finishedNum(productQty) |
| | | .workHours(productProcess.getSalaryQuota()) |
| | | .workHours(workHours) |
| | | .process(productProcess.getName()) |
| | | .schedulingDate(LocalDate.now()) |
| | | .tenantId(dto.getTenantId()) |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.production.dto.ProductionProductMainDto; |
| | | import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto; |
| | | import com.ruoyi.production.dto.UserAccountDto; |
| | | import com.ruoyi.production.dto.UserProductionAccountingDto; |
| | | import com.ruoyi.production.mapper.ProductionProductMainMapper; |
| | | import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper; |
| | | import com.ruoyi.production.pojo.SalesLedgerProductionAccounting; |
| | |
| | | return productionProductMainMapper.listProductionDetails(salesLedgerProductionAccountingDto, page); |
| | | } |
| | | |
| | | @Override |
| | | public UserAccountDto getByUserId(UserProductionAccountingDto userProductionAccountingDto) { |
| | | return salesLedgerProductionAccountingMapper.getByUserId( userProductionAccountingDto); |
| | | } |
| | | |
| | | public static boolean isNumeric(String str) { |
| | | if (str == null || str.isEmpty()) { |
| | | return false; |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface SysUserDeptMapper extends BaseMapper<SysUserDept> { |
| | | |
| | | List<SysUserDeptVo> userLoginFacotryList(@Param("userDeptVo") SysUserDeptVo userDeptVo); |
| | | |
| | | List<Map<String, Object>> setSchemeApplicableStaffUserInfo(@Param("ids") List<Long> ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.projectManagement.service.InfoService; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/projectManagement/info") |
| | | @Api(value = "InfoController", tags = "项ç®ç®¡çä¿¡æ¯è¡¨(项ç®ç®¡çç±»å)") |
| | | @RequiredArgsConstructor |
| | | public class InfoController { |
| | | |
| | | private final InfoService infoService; |
| | | |
| | | @PostMapping("/save") |
| | | public AjaxResult save(@RequestBody @Valid SaveInfoVo saveInfoVo) { |
| | | infoService.save(saveInfoVo); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.projectManagement.service.PlanService; |
| | | import com.ruoyi.projectManagement.vo.SavePlanNodeVo; |
| | | import com.ruoyi.projectManagement.vo.SavePlanVo; |
| | | import com.ruoyi.projectManagement.vo.SearchPlanVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/7 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/projectManagement/plan") |
| | | @Api(value = "PlanController", tags = "项ç®ç®¡ç计å表(项ç®ç®¡çç±»å)") |
| | | @RequiredArgsConstructor |
| | | public class PlanController { |
| | | |
| | | private final PlanService planService; |
| | | |
| | | @PostMapping("/save") |
| | | @ApiOperation("ä¿å") |
| | | public AjaxResult save(@RequestBody @Valid SavePlanVo savePlanVo) { |
| | | planService.savePlan(savePlanVo); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | planService.deletePlan(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/listPage") |
| | | @ApiOperation("å页å表") |
| | | public AjaxResult listPage(@RequestBody SearchPlanVo searchPlanVo) { |
| | | return AjaxResult.success(planService.searchPlan(searchPlanVo)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.dto; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ContractInfoDto implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | private Long id; |
| | | |
| | | /** |
| | | * åç§° |
| | | */ |
| | | private String name; |
| | | |
| | | /** |
| | | * æ§å« |
| | | */ |
| | | private String sex; |
| | | |
| | | /** |
| | | * çæ¥ |
| | | */ |
| | | private String birthday; |
| | | |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | private String department; |
| | | |
| | | /** |
| | | * èå¡ |
| | | */ |
| | | private String job; |
| | | |
| | | /** |
| | | * ææºå· |
| | | */ |
| | | private String phoneNumber; |
| | | |
| | | /** |
| | | * é®ç®± |
| | | */ |
| | | private String email; |
| | | |
| | | /** |
| | | * QQ |
| | | */ |
| | | private String qq; |
| | | |
| | | /** |
| | | * åºå®å·ç |
| | | */ |
| | | private String lineaFissa; |
| | | |
| | | /** |
| | | * 微信 |
| | | */ |
| | | private String wx; |
| | | |
| | | /** |
| | | * ç±è´¯ |
| | | */ |
| | | private String origineEtnica; |
| | | |
| | | /** |
| | | * æ³äººä»£è¡¨ |
| | | */ |
| | | private String rappresentanteLegale; |
| | | |
| | | /** |
| | | * 对åºé¡¹ç®ç®¡çä¿¡æ¯id |
| | | */ |
| | | private Long projectManagementInfoId; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.dto; |
| | | |
| | | import com.ruoyi.common.enums.PlanStageEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PlanStageDto implements Serializable { |
| | | private Long id; |
| | | private String name; |
| | | private PlanStageEnum planStageEnum; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SaveInfoDto implements Serializable { |
| | | private Long id; |
| | | private String no; |
| | | @NotBlank |
| | | private String title; |
| | | private Long clientId; |
| | | private String clientName; |
| | | // å¼ç¨çç¶id |
| | | private Long projectManagementInfoParentId; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate establishTime; |
| | | // 项ç®ç±»å id |
| | | @NotNull |
| | | private Long projectManagementPlanId; |
| | | |
| | | private String source; |
| | | |
| | | private Long managerId; |
| | | private String managerName; |
| | | private Long salesmanId; |
| | | private String salesmanName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate planStartTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate planEndTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate actualStartTime; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate actualEndTime; |
| | | |
| | | // 项ç®ç¶æ |
| | | private Integer status; |
| | | |
| | | private Long departmentId; |
| | | private String departmentName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate orderDate; |
| | | |
| | | |
| | | private String orderAmount; |
| | | |
| | | private String remark; |
| | | |
| | | private List<String> attachmentIds; // éä»¶ids |
| | | |
| | | private List<TeamDto> teamList; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.dto; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ShippingAddressDto implements Serializable { |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ¶è´§äºº |
| | | */ |
| | | private String consignee; |
| | | |
| | | /** |
| | | * èç³»æ¹å¼ |
| | | */ |
| | | private String contract; |
| | | |
| | | /** |
| | | * å°å |
| | | */ |
| | | private String address; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class TeamDto implements Serializable { |
| | | |
| | | private Integer userId; |
| | | private String userName; |
| | | private String userRoleId; |
| | | private String userRoleName; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date joinTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date departTime; |
| | | private String contact; |
| | | private String remark; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.mapper; |
| | | |
| | | import com.ruoyi.projectManagement.pojo.ContractInfo; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãproject_management_contract_info(项ç®è系信æ¯)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2026-03-09 16:38:09 |
| | | * @Entity com.ruoyi.projectManagement.pojo.ContractInfo |
| | | */ |
| | | public interface ContractInfoMapper extends BaseMapper<ContractInfo> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.mapper; |
| | | |
| | | import com.ruoyi.projectManagement.pojo.Info; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãproject_management_info(项ç®ç®¡çä¿¡æ¯)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2026-03-09 13:57:50 |
| | | * @Entity com.ruoyi.projectManagement.pojo.Info |
| | | */ |
| | | public interface InfoMapper extends BaseMapper<Info> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.projectManagement.pojo.Plan; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.projectManagement.vo.SearchPlanVo; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãproject_management_plan(项ç®ç®¡ç计å表(项ç®ç®¡çç±»å))ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2026-03-06 15:29:26 |
| | | * @Entity generator.domain.ProjectManagementPlan |
| | | */ |
| | | public interface PlanMapper extends BaseMapper<Plan> { |
| | | |
| | | IPage<Plan> selectPlanPage(SearchPlanVo searchPlanVo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.mapper; |
| | | |
| | | import com.ruoyi.projectManagement.pojo.PlanNode; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãproject_management_plan_node(计åèç¹)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2026-03-06 17:05:38 |
| | | * @Entity generator.domain.ProjectManagementPlanNode |
| | | */ |
| | | public interface PlanNodeMapper extends BaseMapper<PlanNode> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.mapper; |
| | | |
| | | import com.ruoyi.projectManagement.pojo.ShippingAddress; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãproject_management_shipping_address(æ¶è´§å°å)ãçæ°æ®åºæä½Mapper |
| | | * @createDate 2026-03-09 16:28:07 |
| | | * @Entity com.ruoyi.projectManagement.pojo.ShippingAddress |
| | | */ |
| | | public interface ShippingAddressMapper extends BaseMapper<ShippingAddress> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 项ç®èç³»ä¿¡æ¯ |
| | | * @TableName project_management_contract_info |
| | | */ |
| | | @TableName(value ="project_management_contract_info") |
| | | @Data |
| | | public class ContractInfo implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * åç§° |
| | | */ |
| | | @TableField(value = "name") |
| | | private String name; |
| | | |
| | | /** |
| | | * æ§å« |
| | | */ |
| | | @TableField(value = "sex") |
| | | private String sex; |
| | | |
| | | /** |
| | | * çæ¥ |
| | | */ |
| | | @TableField(value = "birthday") |
| | | private String birthday; |
| | | |
| | | /** |
| | | * é¨é¨ |
| | | */ |
| | | @TableField(value = "department") |
| | | private String department; |
| | | |
| | | /** |
| | | * èå¡ |
| | | */ |
| | | @TableField(value = "job") |
| | | private String job; |
| | | |
| | | /** |
| | | * ææºå· |
| | | */ |
| | | @TableField(value = "phone_number") |
| | | private String phoneNumber; |
| | | |
| | | /** |
| | | * é®ç®± |
| | | */ |
| | | @TableField(value = "email") |
| | | private String email; |
| | | |
| | | /** |
| | | * QQ |
| | | */ |
| | | @TableField(value = "qq") |
| | | private String qq; |
| | | |
| | | /** |
| | | * åºå®å·ç |
| | | */ |
| | | @TableField(value = "linea_fissa") |
| | | private String lineaFissa; |
| | | |
| | | /** |
| | | * 微信 |
| | | */ |
| | | @TableField(value = "wx") |
| | | private String wx; |
| | | |
| | | /** |
| | | * ç±è´¯ |
| | | */ |
| | | @TableField(value = "origine_etnica") |
| | | private String origineEtnica; |
| | | |
| | | /** |
| | | * æ³äººä»£è¡¨ |
| | | */ |
| | | @TableField(value = "rappresentante_legale") |
| | | private String rappresentanteLegale; |
| | | |
| | | /** |
| | | * 对åºé¡¹ç®ç®¡çä¿¡æ¯id |
| | | */ |
| | | @TableField(value = "project_management_info_id") |
| | | private Long projectManagementInfoId; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_user", fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_user", fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_time", fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; |
| | | import com.ruoyi.projectManagement.dto.PlanStageDto; |
| | | import com.ruoyi.projectManagement.dto.TeamDto; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 项ç®ç®¡çä¿¡æ¯ |
| | | * @TableName project_management_info |
| | | */ |
| | | @TableName(value ="project_management_info",autoResultMap = true) |
| | | @Data |
| | | public class Info implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 项ç®ç¼å· |
| | | */ |
| | | @TableField(value = "no") |
| | | private String no; |
| | | |
| | | /** |
| | | * ä¸»é¢ |
| | | */ |
| | | @TableField(value = "title") |
| | | private String title; |
| | | |
| | | /** |
| | | * 客æ·id |
| | | */ |
| | | @TableField(value = "client_id") |
| | | private Long clientId; |
| | | |
| | | /** |
| | | * 客æ·åç§° |
| | | */ |
| | | @TableField(value = "client_name") |
| | | private String clientName; |
| | | |
| | | /** |
| | | * ç´¢å¼çç¶é¡¹ç®id |
| | | */ |
| | | @TableField(value = "project_management_info_parent_id") |
| | | private Long projectManagementInfoParentId; |
| | | |
| | | /** |
| | | * ç«é¡¹æ¶é´ |
| | | */ |
| | | @TableField(value = "establish_time") |
| | | private LocalDate establishTime; |
| | | |
| | | /** |
| | | * 项ç®é¶æ®µid |
| | | */ |
| | | @TableField(value = "project_management_plan_id") |
| | | private Long projectManagementPlanId; |
| | | |
| | | /** |
| | | * æ¥æº |
| | | */ |
| | | @TableField(value = "source") |
| | | private String source; |
| | | |
| | | /** |
| | | * 项ç®ç»çid |
| | | */ |
| | | @TableField(value = "manager_id") |
| | | private Long managerId; |
| | | |
| | | /** |
| | | * 项ç®ç»çåå |
| | | */ |
| | | @TableField(value = "manager_name") |
| | | private String managerName; |
| | | |
| | | /** |
| | | * ä¸å¡åid |
| | | */ |
| | | @TableField(value = "salesman_id") |
| | | private Long salesmanId; |
| | | |
| | | /** |
| | | * ä¸å¡ååå |
| | | */ |
| | | @TableField(value = "salesman_name") |
| | | private String salesmanName; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_user",fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | /** |
| | | * 计åå¼å§æ¶é´ |
| | | */ |
| | | @TableField(value = "plan_start_time") |
| | | private LocalDate planStartTime; |
| | | |
| | | /** |
| | | * 计åç»ææ¶é´ |
| | | */ |
| | | @TableField(value = "plan_end_time") |
| | | private LocalDate planEndTime; |
| | | |
| | | /** |
| | | * å®é
å¼å§æ¶é´ |
| | | */ |
| | | @TableField(value = "actual_start_time") |
| | | private LocalDate actualStartTime; |
| | | |
| | | /** |
| | | * å®é
ç»ææ¥æ |
| | | */ |
| | | @TableField(value = "actual_end_time") |
| | | private LocalDate actualEndTime; |
| | | |
| | | /** |
| | | * å®¡æ ¸ç¶æ |
| | | */ |
| | | @TableField(value = "review_status") |
| | | private Integer reviewStatus; |
| | | |
| | | /** |
| | | * 项ç®ç¶æ |
| | | */ |
| | | @TableField(value = "status") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * é¨é¨id |
| | | */ |
| | | @TableField(value = "department_id") |
| | | private Long departmentId; |
| | | |
| | | /** |
| | | * é¨é¨åå |
| | | */ |
| | | @TableField(value = "department_name") |
| | | private String departmentName; |
| | | |
| | | /** |
| | | * è®¢åæ¥æ |
| | | */ |
| | | @TableField(value = "order_date") |
| | | private LocalDate orderDate; |
| | | |
| | | /** |
| | | * 订åéé¢ |
| | | */ |
| | | @TableField(value = "order_amount") |
| | | private String orderAmount; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @TableField(value = "remark") |
| | | private String remark; |
| | | |
| | | /** |
| | | * éä»¶ |
| | | */ |
| | | @TableField(value = "attachment") |
| | | private String attachment; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField(value = "plan_stage",typeHandler = JacksonTypeHandler.class) |
| | | private List<PlanStageDto> planStage; |
| | | |
| | | @TableField(value = "team",typeHandler = JacksonTypeHandler.class) |
| | | private List<TeamDto> team; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 项ç®ç®¡ç计å表(项ç®ç®¡çç±»å) |
| | | * @TableName project_management_plan |
| | | */ |
| | | @TableName(value ="project_management_plan") |
| | | @Data |
| | | @ApiModel(description="项ç®ç®¡ç计å表(项ç®ç®¡çç±»å)") |
| | | public class Plan { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @ApiModelProperty(value="主é®ID") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 计ååç§° |
| | | */ |
| | | @TableField(value = "name") |
| | | @ApiModelProperty(value="计ååç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * 计åæè¿° |
| | | */ |
| | | @TableField(value = "description") |
| | | @ApiModelProperty(value="计åæè¿°") |
| | | private String description; |
| | | |
| | | /** |
| | | * éä»¶ ,è¿è¡åå² |
| | | */ |
| | | @TableField(value = "attachment") |
| | | @ApiModelProperty(value="éä»¶") |
| | | private String attachment; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "is_delete") |
| | | @ApiModelProperty(value="æ¯å¦å é¤") |
| | | private Integer isDelete; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value="å建æ¶é´") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value="æ´æ°æ¶é´") |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_user",fill = FieldFill.INSERT) |
| | | @ApiModelProperty(value="å建人") |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value="æ´æ°äºº") |
| | | private Integer updateUser; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 计åèç¹ |
| | | * @TableName project_management_plan_node |
| | | */ |
| | | @TableName(value ="project_management_plan_node") |
| | | @Data |
| | | public class PlanNode implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(type = IdType.AUTO) |
| | | @TableField(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 对åºid |
| | | */ |
| | | @TableField(value = "project_management_plan_id") |
| | | private Long projectManagementPlanId; |
| | | |
| | | /** |
| | | * æåº |
| | | */ |
| | | @TableField(value = "sort") |
| | | private Integer sort; |
| | | |
| | | /** |
| | | * é¶æ®µåç§° |
| | | */ |
| | | @TableField(value = "name") |
| | | private String name; |
| | | |
| | | /** |
| | | * è´è´£ä»»ID |
| | | */ |
| | | @TableField(value = "leader_id") |
| | | private Long leaderId; |
| | | |
| | | /** |
| | | * è´è´£ä»»åç§° |
| | | */ |
| | | @TableField(value = "leader_name") |
| | | private String leaderName; |
| | | |
| | | /** |
| | | * é¢è®¡å·¥æ(天) |
| | | */ |
| | | @TableField(value = "estimated_duration") |
| | | private Integer estimatedDuration; |
| | | |
| | | /** |
| | | * 工价 |
| | | */ |
| | | @TableField(value = "hourly_rate") |
| | | private String hourlyRate; |
| | | |
| | | /** |
| | | * ä½ä¸å
容 |
| | | */ |
| | | @TableField(value = "work_content") |
| | | private String workContent; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_user",fill = FieldFill.INSERT) |
| | | private Integer createUser; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æ¶è´§å°å |
| | | * @TableName project_management_shipping_address |
| | | */ |
| | | @TableName(value ="project_management_shipping_address") |
| | | @Data |
| | | public class ShippingAddress implements Serializable { |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * æ¶è´§äºº |
| | | */ |
| | | @TableField(value = "consignee") |
| | | private String consignee; |
| | | |
| | | /** |
| | | * èç³»æ¹å¼ |
| | | */ |
| | | @TableField(value = "contract") |
| | | private String contract; |
| | | |
| | | /** |
| | | * å°å |
| | | */ |
| | | @TableField(value = "address") |
| | | private String address; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "is_delete") |
| | | private Integer isDelete; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "create_user",fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | |
| | | @TableField(value = "project_management_info_id") |
| | | private Long projectManagementInfoId; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service; |
| | | |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | public interface InfoService { |
| | | void save(@NotNull SaveInfoVo saveInfoVo); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.projectManagement.pojo.Plan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.projectManagement.pojo.PlanNode; |
| | | import com.ruoyi.projectManagement.vo.PlanVo; |
| | | import com.ruoyi.projectManagement.vo.SavePlanNodeVo; |
| | | import com.ruoyi.projectManagement.vo.SavePlanVo; |
| | | import com.ruoyi.projectManagement.vo.SearchPlanVo; |
| | | |
| | | import javax.annotation.Nullable; |
| | | import javax.validation.constraints.NotNull; |
| | | import javax.validation.constraints.Null; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description é对表ãproject_management_plan(项ç®ç®¡ç计å表(项ç®ç®¡çç±»å))ãçæ°æ®åºæä½Service |
| | | * @createDate 2026-03-06 15:29:26 |
| | | */ |
| | | public interface PlanService{ |
| | | |
| | | /** |
| | | * ä¿å项ç®ç®¡ç计å |
| | | * @param savePlanVo |
| | | */ |
| | | void savePlan(@NotNull SavePlanVo savePlanVo); |
| | | |
| | | /** |
| | | * ä¿å计åèç¹ |
| | | * @param planId |
| | | * @param savePlanNodeVos |
| | | */ |
| | | void savePlanNode(@NotNull Long planId,@Nullable List<SavePlanNodeVo> savePlanNodeVos); |
| | | |
| | | List<PlanNode> getPlanNodeByPlanId(@NotNull Long planId); |
| | | |
| | | /** |
| | | * å é¤é¡¹ç®ç®¡ç计å |
| | | * @param id |
| | | */ |
| | | void deletePlan(@NotNull Long id); |
| | | |
| | | void deletePlanNode(@Nullable List<Long> ids); |
| | | |
| | | IPage<PlanVo> searchPlan(@NotNull SearchPlanVo searchPlanVo); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service.impl; |
| | | |
| | | import com.ruoyi.common.enums.SaleEnum; |
| | | import com.ruoyi.projectManagement.service.InfoService; |
| | | import com.ruoyi.projectManagement.service.impl.handle.ContractInfoHandleService; |
| | | import com.ruoyi.projectManagement.service.impl.handle.InfoHandleService; |
| | | import com.ruoyi.projectManagement.service.impl.handle.ShippingAddressHandleService; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional(readOnly = true) |
| | | public class InfoServiceImpl implements InfoService { |
| | | private final InfoHandleService infoHandleService; |
| | | private final ContractInfoHandleService contractInfoHandleService; |
| | | private final ShippingAddressHandleService shippingAddressHandleService; |
| | | private final ISalesLedgerService salesLedgerService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public void save(SaveInfoVo saveInfoVo) { |
| | | // ä¿åä¸»ä¿¡æ¯ |
| | | Long infoId = infoHandleService.save(saveInfoVo.getInfo()); |
| | | shippingAddressHandleService.save(infoId, saveInfoVo.getShippingAddress()); |
| | | contractInfoHandleService.save(infoId, saveInfoVo.getContractInfo()); |
| | | salesLedgerService.handleSalesLedgerProducts(infoId, saveInfoVo.getSalesLedgerProductList(), SaleEnum.MANAGEMENT); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.basic.service.CustomerFollowUpFileService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.projectManagement.mapper.PlanMapper; |
| | | import com.ruoyi.projectManagement.mapper.PlanNodeMapper; |
| | | import com.ruoyi.projectManagement.pojo.Plan; |
| | | import com.ruoyi.projectManagement.pojo.PlanNode; |
| | | import com.ruoyi.projectManagement.service.PlanService; |
| | | import com.ruoyi.projectManagement.vo.*; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.jetbrains.annotations.Nullable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @description 项ç®ç®¡ç计åçå®ç° |
| | | * @createDate 2026-03-06 15:29:26 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional(readOnly = true) |
| | | public class PlanServiceImpl implements PlanService { |
| | | |
| | | private final PlanMapper planMapper; |
| | | |
| | | private final CustomerFollowUpFileService customerFollowUpFileService; |
| | | |
| | | private final PlanNodeMapper planNodeMapper; |
| | | |
| | | @Lazy |
| | | @Autowired |
| | | private PlanService planService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void savePlan(SavePlanVo savePlanVo) { |
| | | Plan plan = BeanUtil.copyProperties(savePlanVo, Plan.class); |
| | | // éä»¶å¤ç , æ¼æ¥ |
| | | String attachments = String.join(",", Optional.ofNullable(savePlanVo.getAttachmentIds()).orElse(Collections.emptyList())); |
| | | plan.setAttachment(attachments); |
| | | if (savePlanVo.getId() == null) { |
| | | planMapper.insert(plan); |
| | | } else { |
| | | planMapper.updateById(plan); |
| | | } |
| | | planService.savePlanNode(plan.getId(), savePlanVo.getSavePlanNodeList()); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void savePlanNode(Long planId, @Nullable List<SavePlanNodeVo> savePlanNodeVos) { |
| | | Assert.notNull(planId, () -> new ServiceException("计åIDä¸è½ä¸ºç©º")); |
| | | if (CollUtil.isEmpty(savePlanNodeVos)) { |
| | | return; |
| | | } |
| | | |
| | | // å é¤å¤ä½èç¹ |
| | | List<Long> existNodeIds = savePlanNodeVos.stream().map(SavePlanNodeVo::getId).filter(Objects::nonNull).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<PlanNode> planNodeLambdaQueryWrapper = new LambdaQueryWrapper<PlanNode>() |
| | | .select(PlanNode::getId) |
| | | .eq(PlanNode::getProjectManagementPlanId, planId); |
| | | if(CollUtil.isNotEmpty(existNodeIds)){ |
| | | planNodeLambdaQueryWrapper.notIn(PlanNode::getId, existNodeIds); |
| | | } |
| | | List<PlanNode> needDeleteNode = planNodeMapper.selectList(planNodeLambdaQueryWrapper); |
| | | |
| | | deletePlanNode(needDeleteNode.stream().map(PlanNode::getId).collect(Collectors.toList())); |
| | | |
| | | List<PlanNode> planNodes = BeanUtil.copyToList(savePlanNodeVos, PlanNode.class); |
| | | // 设置æåºç´¢å¼ |
| | | IntStream.range(0, savePlanNodeVos.size()).forEach(i -> { |
| | | planNodes.get(i).setSort(i); |
| | | planNodes.get(i).setProjectManagementPlanId(planId); |
| | | if (planNodes.get(i).getId() == null) { |
| | | planNodeMapper.insert(planNodes.get(i)); |
| | | } else { |
| | | planNodeMapper.updateById(planNodes.get(i)); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlanNode> getPlanNodeByPlanId(Long planId) { |
| | | return planNodeMapper.selectList(new LambdaQueryWrapper<PlanNode>() |
| | | .eq(PlanNode::getIsDelete, 0) |
| | | .eq(PlanNode::getProjectManagementPlanId, planId).orderByAsc(PlanNode::getSort)); |
| | | } |
| | | |
| | | private List<PlanNode> getPlanNodeByPlanIds(List<Long> planIds) { |
| | | return planNodeMapper.selectList(new LambdaQueryWrapper<PlanNode>() |
| | | .eq(PlanNode::getIsDelete, 0) |
| | | .in(PlanNode::getProjectManagementPlanId, planIds).orderByAsc(PlanNode::getSort)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deletePlan(Long id) { |
| | | planMapper.update(null, |
| | | new LambdaUpdateWrapper<Plan>() |
| | | .eq(Plan::getId, id) |
| | | .set(Plan::getIsDelete, 1)); |
| | | planService.deletePlanNode(getPlanNodeByPlanId(id).stream().map(PlanNode::getId).collect(Collectors.toList())); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deletePlanNode(List<Long> ids) { |
| | | if (CollUtil.isNotEmpty(ids)) { |
| | | planNodeMapper.update(null, |
| | | new LambdaUpdateWrapper<PlanNode>() |
| | | .in(PlanNode::getId, ids) |
| | | .set(PlanNode::getIsDelete, 1)); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public IPage<PlanVo> searchPlan(SearchPlanVo searchPlanVo) { |
| | | IPage<Plan> planIPage = planMapper.selectPlanPage(searchPlanVo); |
| | | IPage<PlanVo> resultPage = planIPage.convert(plan -> BeanUtil.copyProperties(plan, PlanVo.class)); |
| | | // æä»¶è·å |
| | | customerFollowUpFileService.fillAttachment(resultPage.getRecords(), PlanVo::getAttachment, PlanVo::setAttachmentList); |
| | | Map<Long, List<PlanNodeVo>> collect = getPlanNodeByPlanIds(resultPage.getRecords().stream().map(PlanVo::getId).collect(Collectors.toList())) |
| | | .stream() |
| | | .map(it -> BeanUtil.copyProperties(it, PlanNodeVo.class)) |
| | | .collect(Collectors.groupingBy(PlanNodeVo::getProjectManagementPlanId, Collectors.toList())); |
| | | resultPage.getRecords().forEach(planVo -> planVo.setPlanNodeList(collect.getOrDefault(planVo.getId(), Collections.emptyList()))); |
| | | return resultPage; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service.impl.handle; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.ruoyi.projectManagement.dto.ContractInfoDto; |
| | | import com.ruoyi.projectManagement.mapper.ContractInfoMapper; |
| | | import com.ruoyi.projectManagement.pojo.ContractInfo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Nullable; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class,readOnly = true) |
| | | public class ContractInfoHandleService{ |
| | | |
| | | private final ContractInfoMapper contractInfoMapper; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void save(@Nullable Long id, @NotNull ContractInfoDto contractInfoDto) { |
| | | ContractInfo contractInfo = BeanUtil.copyProperties(contractInfoDto, ContractInfo.class); |
| | | contractInfo.setProjectManagementInfoId(id); |
| | | if (contractInfoDto.getId() == null) { |
| | | contractInfoMapper.insert(contractInfo); |
| | | } else { |
| | | contractInfoMapper.updateById(contractInfo); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service.impl.handle; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.common.enums.PlanStageEnum; |
| | | import com.ruoyi.common.enums.ReviewStatusEnum; |
| | | import com.ruoyi.common.utils.EnumUtil; |
| | | import com.ruoyi.projectManagement.dto.PlanStageDto; |
| | | import com.ruoyi.projectManagement.dto.SaveInfoDto; |
| | | import com.ruoyi.projectManagement.mapper.InfoMapper; |
| | | import com.ruoyi.projectManagement.pojo.Info; |
| | | import com.ruoyi.projectManagement.pojo.PlanNode; |
| | | import com.ruoyi.projectManagement.service.PlanService; |
| | | import com.ruoyi.projectManagement.service.impl.PlanServiceImpl; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class,readOnly = true) |
| | | public class InfoHandleService { |
| | | |
| | | private static final String GENERATE_SERIAL_NUMBER_PREFIX = "XM"; |
| | | |
| | | private final InfoMapper infoMapper; |
| | | |
| | | private final PlanService planService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long save(@NotNull SaveInfoDto saveInfoDto){ |
| | | Info info = BeanUtil.copyProperties(saveInfoDto, Info.class); |
| | | |
| | | // éä»¶ç¹æ®å¤ç |
| | | String attachmentIds = StrUtil.join(",", Optional.ofNullable(saveInfoDto.getAttachmentIds()).orElse(Collections.emptyList())); |
| | | info.setAttachment(attachmentIds); |
| | | |
| | | // çæåºå· (妿éè¦èªå¨çæçè¯) |
| | | if(StrUtil.isBlank(info.getNo())){ |
| | | info.setNo(generateSerialNumber()); |
| | | } |
| | | info.setTeam(saveInfoDto.getTeamList()); |
| | | if(info.getId() == null){ |
| | | // çæå¯¹åºçé¶æ®µå
³ç³»æ°æ® |
| | | info.setPlanStage(getPlanStageList(info.getProjectManagementPlanId())); |
| | | // æå
¥é»è®¤ç¶æ |
| | | info.setStatus(PlanStageEnum.TO_BEGIN.getCode()); |
| | | info.setReviewStatus(ReviewStatusEnum.PENDING_REVIEW.getCode()); |
| | | infoMapper.insert(info); |
| | | }else { |
| | | infoMapper.updateById(info); |
| | | } |
| | | return info.getId(); |
| | | } |
| | | |
| | | |
| | | private List<PlanStageDto> getPlanStageList(@NotNull Long planId) { |
| | | List<PlanNode> planNodeByPlanId = planService.getPlanNodeByPlanId(planId); |
| | | return planNodeByPlanId.stream().map(it-> new PlanStageDto(it.getId(), it.getName(), PlanStageEnum.TO_BEGIN)).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * çæé¡¹ç®ç¼å· |
| | | * @return |
| | | */ |
| | | private String generateSerialNumber() { |
| | | // è·åå½åæ¥æ |
| | | String date = DateUtil.format(DateUtil.date(), "yyyyMMdd"); |
| | | |
| | | // æ¥è¯¢ä»å¤©å·²ç»çæçæ°é |
| | | LambdaQueryWrapper<Info> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.likeRight(Info::getNo, GENERATE_SERIAL_NUMBER_PREFIX + date); |
| | | |
| | | Long count = infoMapper.selectCount(queryWrapper); |
| | | |
| | | // åºå· +1 |
| | | Long serial = count + 1; |
| | | |
| | | // 3ä½è¡¥0 |
| | | String serialStr = String.format("%03d", serial); |
| | | |
| | | return GENERATE_SERIAL_NUMBER_PREFIX + date + serialStr; |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.service.impl.handle; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.ruoyi.projectManagement.dto.ShippingAddressDto; |
| | | import com.ruoyi.projectManagement.mapper.ShippingAddressMapper; |
| | | import com.ruoyi.projectManagement.pojo.ShippingAddress; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Nullable; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class,readOnly = true) |
| | | public class ShippingAddressHandleService { |
| | | |
| | | private final ShippingAddressMapper shippingAddressMapper; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void save(@Nullable Long infoId,@NotNull ShippingAddressDto shippingAddressDto){ |
| | | ShippingAddress shippingAddress = BeanUtil.copyProperties(shippingAddressDto, ShippingAddress.class); |
| | | shippingAddress.setProjectManagementInfoId(infoId); |
| | | if (shippingAddressDto.getId() == null) { |
| | | shippingAddressMapper.insert(shippingAddress); |
| | | }else { |
| | | shippingAddressMapper.updateById(shippingAddress); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/7 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PlanNodeVo implements Serializable { |
| | | private Long id; |
| | | |
| | | private Long projectManagementPlanId; |
| | | |
| | | private Integer sort; |
| | | |
| | | private String name; |
| | | |
| | | private Long leaderId; |
| | | |
| | | private String leaderName; |
| | | |
| | | private Integer estimatedDuration; |
| | | |
| | | private String hourlyRate; |
| | | |
| | | private String workContent; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.ruoyi.common.vo.SimpleFileVo; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计åVO |
| | | * @author buhuazhen |
| | | * @date 2026/3/6 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PlanVo implements Serializable { |
| | | |
| | | private Long id; |
| | | |
| | | private String name; |
| | | |
| | | private String description; |
| | | |
| | | // éä»¶ |
| | | private List<SimpleFileVo> attachmentList; |
| | | |
| | | @JsonIgnore |
| | | private String attachment; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | private List<PlanNodeVo> planNodeList; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import com.ruoyi.projectManagement.dto.ContractInfoDto; |
| | | import com.ruoyi.projectManagement.dto.SaveInfoDto; |
| | | import com.ruoyi.projectManagement.dto.ShippingAddressDto; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/9 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SaveInfoVo implements Serializable { |
| | | |
| | | @Valid |
| | | private SaveInfoDto info; |
| | | |
| | | @Valid |
| | | private ShippingAddressDto shippingAddress; |
| | | |
| | | @Valid |
| | | private ContractInfoDto contractInfo; |
| | | |
| | | private List<SalesLedgerProduct> salesLedgerProductList; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/7 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SavePlanNodeVo implements Serializable { |
| | | private Long id; |
| | | |
| | | private Long projectManagementPlanId; |
| | | |
| | | private Integer sort; |
| | | |
| | | @NotBlank |
| | | private String name; |
| | | |
| | | @NotNull |
| | | private Long leaderId; |
| | | |
| | | @NotBlank |
| | | private String leaderName; |
| | | |
| | | private Integer estimatedDuration; |
| | | |
| | | private String hourlyRate; |
| | | |
| | | private String workContent; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/6 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SavePlanVo implements Serializable { |
| | | |
| | | private Long id; |
| | | @NotBlank |
| | | private String name; |
| | | // @NotBlank |
| | | private String description; |
| | | |
| | | private List<String> attachmentIds; |
| | | |
| | | @Valid |
| | | private List<SavePlanNodeVo> savePlanNodeList; |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/6 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class SearchPlanVo extends Page implements Serializable { |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.projectManagement.mapper.RolesMapper; |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper; |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrdersService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 11:44:38 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/purchaseReturnOrders") |
| | | public class PurchaseReturnOrdersController { |
| | | @Autowired |
| | | private PurchaseReturnOrdersService purchaseReturnOrdersService; |
| | | |
| | | @Autowired |
| | | private PurchaseReturnOrdersMapper purchaseReturnOrdersMapper; |
| | | |
| | | |
| | | @GetMapping("/listPage") |
| | | public AjaxResult listPage(Page page, PurchaseReturnOrderDto purchaseReturnOrderDto) { |
| | | return AjaxResult.success(purchaseReturnOrdersService.listPage(page, purchaseReturnOrderDto)); |
| | | } |
| | | |
| | | // æ°å¢ |
| | | @Log(title = "éè´éè´§å", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | | public AjaxResult add(@RequestBody PurchaseReturnOrderDto purchaseReturnOrderDto) throws Exception { |
| | | if (purchaseReturnOrderDto.getIsDefaultNo()) { |
| | | purchaseReturnOrderDto.setNo(OrderUtils.countTodayByCreateTime(purchaseReturnOrdersMapper, "CGTL")); |
| | | } |
| | | return AjaxResult.success(purchaseReturnOrdersService.save(purchaseReturnOrderDto)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PurchaseReturnOrderDto extends PurchaseReturnOrders { |
| | | // æ¯å¦ä½¿ç¨ç³»ç»åå· |
| | | private Boolean isDefaultNo; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.purchase.vo.PurchaseReturnOrderVo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 11:44:38 |
| | | */ |
| | | @Mapper |
| | | public interface PurchaseReturnOrdersMapper extends BaseMapper<PurchaseReturnOrders> { |
| | | IPage<PurchaseReturnOrderVo> listPage(Page page, @Param("params") PurchaseReturnOrders purchaseReturnOrder); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 11:44:38 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("purchase_return_orders") |
| | | @ApiModel(value = "PurchaseReturnOrders对象", description = "éè´éè´§å") |
| | | public class PurchaseReturnOrders implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("éè´§åç¼å·") |
| | | private String no; |
| | | |
| | | @ApiModelProperty("éè´§æ¹å¼ 0éè´§éæ¬¾ 1ææ¶") |
| | | private Integer returnType; |
| | | |
| | | @ApiModelProperty("ä¾åºåid") |
| | | private Long supplierId; |
| | | |
| | | @ApiModelProperty("项ç®id") |
| | | private Long projectId; |
| | | |
| | | @ApiModelProperty("项ç®é¶æ®µ") |
| | | private Integer projectPhase; |
| | | |
| | | @ApiModelProperty("å¶åæ¥æ") |
| | | private LocalDateTime preparedAt; |
| | | |
| | | @ApiModelProperty("å¶å人id") |
| | | private Long preparedUserId; |
| | | |
| | | @ApiModelProperty("éæäººid") |
| | | private Long returnUserId; |
| | | |
| | | @ApiModelProperty("éè´è®¢åid") |
| | | private Long purchaseLedgerId; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("'æ´åææ£é¢'") |
| | | private BigDecimal totalDiscountAmount; |
| | | |
| | | @ApiModelProperty("'æ´åææ£ç'") |
| | | private BigDecimal totalDiscountRate; |
| | | |
| | | @ApiModelProperty("'æäº¤éé¢'") |
| | | private BigDecimal totalAmount; |
| | | |
| | | @ApiModelProperty("å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.purchase.vo.PurchaseReturnOrderVo; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 11:44:38 |
| | | */ |
| | | public interface PurchaseReturnOrdersService extends IService<PurchaseReturnOrders> { |
| | | IPage<PurchaseReturnOrderVo> listPage(Page page, PurchaseReturnOrderDto purchaseReturnOrderDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper; |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrdersService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.purchase.vo.PurchaseReturnOrderVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 11:44:38 |
| | | */ |
| | | @Service |
| | | public class PurchaseReturnOrdersServiceImpl extends ServiceImpl<PurchaseReturnOrdersMapper, PurchaseReturnOrders> implements PurchaseReturnOrdersService { |
| | | @Autowired |
| | | private PurchaseReturnOrdersMapper purchaseReturnOrdersMapper; |
| | | |
| | | @Override |
| | | public IPage<PurchaseReturnOrderVo> listPage(Page page, PurchaseReturnOrderDto purchaseReturnOrderDto) { |
| | | return purchaseReturnOrdersMapper.listPage(page, purchaseReturnOrderDto); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.vo; |
| | | |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | |
| | | public class PurchaseReturnOrderVo extends PurchaseReturnOrders { |
| | | //ä¾åºååç§° |
| | | private String supplierName; |
| | | |
| | | // éè´ååå· |
| | | private String purchaseContractNumber; |
| | | |
| | | //éæäººå§å |
| | | private String returnUserName; |
| | | |
| | | //å¶å人å§å |
| | | private String createUserName; |
| | | } |
| | |
| | | util.exportExcel(response, list, "åè´§ä¿¡æ¯"); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/getByCustomerName") |
| | | @ApiOperation("éè¿å®¢æ·åç§°æ¥è¯¢") |
| | | public AjaxResult getByCustomerName(String customerName) { |
| | | return AjaxResult.success(shippingInfoService.getShippingInfoByCustomerName(customerName)); |
| | | } |
| | | } |
| | |
| | | |
| | | private Boolean hasChildren = false; |
| | | private List<SalesLedgerProduct> productData; |
| | | private List<SalesLedgerProductDto> productDtoData; |
| | | private List<String> tempFileIds; |
| | | private List<CommonFile> SalesLedgerFiles; |
| | | |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Excel; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | |
| | | |
| | | private Integer approvalStatus; |
| | | |
| | | |
| | | @ApiModelProperty(value = "æªéè´§æ°") |
| | | private BigDecimal unQuantity; |
| | | |
| | | @ApiModelProperty(value = "éè´§æ»æ°") |
| | | private BigDecimal totalReturnNum; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.procurementrecord.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | IPage<ShippingInfoDto> listPage(Page page, @Param("req") ShippingInfo req); |
| | | |
| | | List<ShippingInfo> listAll(); |
| | | |
| | | List<SalesLedgerProductDto> getReturnManagementDtoById(@Param("shippingId")Long shippingId); |
| | | |
| | | List<ShippingInfo> getShippingInfoByCustomerName(String customerName); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.aftersalesservice.pojo.AfterSalesService; |
| | | import com.ruoyi.common.enums.SaleEnum; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.sales.dto.LossProductModelDto; |
| | | import com.ruoyi.sales.dto.MonthlyAmountDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerDto; |
| | | import com.ruoyi.sales.pojo.SalesLedger; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | |
| | | int addOrUpdateSalesLedger(SalesLedgerDto salesLedgerDto); |
| | | |
| | | void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, SaleEnum type); |
| | | |
| | | SalesLedgerDto getSalesLedgerWithProducts(SalesLedgerDto salesLedgerDto); |
| | | |
| | | List getSalesNo(); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.procurementrecord.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.pojo.ShippingInfo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | |
| | | boolean deductStock(ShippingInfoDto req) throws IOException; |
| | | |
| | | boolean delete(List<Long> ids); |
| | | |
| | | List<SalesLedgerProductDto> getReturnManagementDtoById( Long shippingId); |
| | | |
| | | List<ShippingInfo> getShippingInfoByCustomerName(String customerName); |
| | | } |
| | |
| | | import com.ruoyi.basic.mapper.ProductModelMapper; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.enums.FileNameType; |
| | | import com.ruoyi.common.enums.SaleEnum; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.EnumUtil; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | |
| | | // 4. å¤çåè¡¨æ°æ® |
| | | List<SalesLedgerProduct> productList = salesLedgerDto.getProductData(); |
| | | if (productList != null && !productList.isEmpty()) { |
| | | handleSalesLedgerProducts(salesLedger.getId(), productList, salesLedgerDto.getType()); |
| | | handleSalesLedgerProducts(salesLedger.getId(), productList, EnumUtil.fromCode(SaleEnum.class,salesLedgerDto.getType())); |
| | | updateMainContractAmount( |
| | | salesLedger.getId(), |
| | | productList, |
| | |
| | | } |
| | | |
| | | |
| | | private void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, Integer type) { |
| | | @Override |
| | | public void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, SaleEnum type) { |
| | | // æIDåç»ï¼åºåæ°å¢åæ´æ°çè®°å½ |
| | | Map<Boolean, List<SalesLedgerProduct>> partitionedProducts = products.stream() |
| | | .peek(p -> p.setSalesLedgerId(salesLedgerId)) |
| | |
| | | // æ§è¡æ´æ°æä½ |
| | | if (!updateList.isEmpty()) { |
| | | for (SalesLedgerProduct product : updateList) { |
| | | product.setType(type); |
| | | product.setType(type.getCode()); |
| | | salesLedgerProductMapper.updateById(product); |
| | | } |
| | | } |
| | | // æ§è¡æå
¥æä½ |
| | | if (!insertList.isEmpty()) { |
| | | for (SalesLedgerProduct salesLedgerProduct : insertList) { |
| | | salesLedgerProduct.setType(type); |
| | | salesLedgerProduct.setType(type.getCode()); |
| | | salesLedgerProduct.setNoInvoiceNum(salesLedgerProduct.getQuantity()); |
| | | salesLedgerProduct.setNoInvoiceAmount(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | | salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice()); |
| | |
| | | import com.ruoyi.common.enums.StockOutQualifiedRecordTypeEnum; |
| | | import com.ruoyi.other.service.impl.TempFileServiceImpl; |
| | | import com.ruoyi.procurementrecord.utils.StockUtils; |
| | | import com.ruoyi.sales.dto.SalesLedgerProductDto; |
| | | import com.ruoyi.sales.dto.ShippingInfoDto; |
| | | import com.ruoyi.sales.mapper.SalesLedgerProductMapper; |
| | | import com.ruoyi.sales.mapper.ShippingInfoMapper; |
| | |
| | | |
| | | return this.removeBatchByIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public List<SalesLedgerProductDto> getReturnManagementDtoById(Long shippingId) { |
| | | return shippingInfoMapper.getReturnManagementDtoById(shippingId ); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<ShippingInfo> getShippingInfoByCustomerName(String customerName) { |
| | | return shippingInfoMapper.getShippingInfoByCustomerName(customerName); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.Bank; |
| | | import com.ruoyi.staff.service.BankService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * é¶è¡ç®¡ç表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 03:40:54 |
| | | */ |
| | | @Api(tags = "é¶è¡ç®¡ç表") |
| | | @RestController |
| | | @RequestMapping("/bank") |
| | | public class BankController { |
| | | |
| | | @Autowired |
| | | private BankService bankService; |
| | | |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | | return AjaxResult.success(bankService.list()); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å¢é¶è¡ç®¡ç表") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "é¶è¡ç®¡ç表", businessType = BusinessType.INSERT) |
| | | public AjaxResult add(@RequestBody Bank bank) { |
| | | return AjaxResult.success(bankService.save(bank)); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("æ´æ°é¶è¡ç®¡ç表") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "é¶è¡ç®¡ç表", businessType = BusinessType.UPDATE) |
| | | public AjaxResult update(@RequestBody Bank bank) { |
| | | return AjaxResult.success(bankService.updateById(bank)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤é¶è¡ç®¡ç表") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Log(title = "é¶è¡ç®¡ç表", businessType = BusinessType.DELETE) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return AjaxResult.success(bankService.removeBatchByIds(ids)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.staff.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.pojo.PersonalShift; |
| | | import com.ruoyi.staff.service.PersonalAttendanceLocationConfigService; |
| | | import com.ruoyi.staff.service.PersonalShiftService; |
| | | import com.ruoyi.staff.utils.StyleMonthUtils; |
| | | import com.ruoyi.staff.utils.StyleYearUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:52:19 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/personalShift") |
| | | @Api(tags = "人åæç") |
| | | public class PersonalShiftController { |
| | | |
| | | @Autowired |
| | | private PersonalShiftService personalShiftService; |
| | | |
| | | @ApiOperation("人åæç") |
| | | @PostMapping("/add") |
| | | public R add(@RequestBody PerformanceShiftAddDto performanceShiftAddDto){ |
| | | return R.ok(personalShiftService.performanceShiftAdd(performanceShiftAddDto)); |
| | | } |
| | | |
| | | @ApiOperation(value = "æä»½å页æ¥è¯¢") |
| | | @GetMapping("page") |
| | | public R performanceShiftPage(Integer size, Integer current, String time, String userName, Integer sysDeptId) { |
| | | return R.ok(personalShiftService.performanceShiftPage(new Page<>(current, size), time, userName, sysDeptId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "年份å页æ¥è¯¢") |
| | | @GetMapping("pageYear") |
| | | public R performanceShiftPageYear(Integer size, Integer current, String time, String userName, Integer sysDeptId) { |
| | | return R.ok(personalShiftService.performanceShiftPageYear(new Page<>(current, size), time, userName, sysDeptId)); |
| | | } |
| | | |
| | | @ApiOperation(value = "çæ¬¡ç¶æä¿®æ¹") |
| | | @PostMapping("update") |
| | | public R performanceShiftUpdate(@RequestBody PersonalShift personalShift) { |
| | | personalShiftService.performanceShiftUpdate(personalShift); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "导åº") |
| | | @GetMapping("export") |
| | | public void exportToExcel(@NotNull(message = "æ¶é´ä¸è½ä¸ºç©ºï¼") String time, String userName, Integer sysDeptId, Boolean isMonth, HttpServletResponse response) throws Exception { |
| | | Map<Object, Object> data; |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setHeader("requestType","excel"); |
| | | response.setHeader("Access-Control-Expose-Headers", "requestType"); |
| | | if (!isMonth) { |
| | | data = personalShiftService.exportToYearExcel(time, userName, sysDeptId); |
| | | // 设置åå
æ ¼æ ·å¼ |
| | | HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleYearUtils.getHeadStyle(), StyleYearUtils.getContentStyle()); |
| | | // ä¿åå°ç¬¬ä¸ä¸ªsheetä¸ |
| | | EasyExcel.write(response.getOutputStream()) |
| | | .head((List<List<String>>) data.get("header")) |
| | | .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) // èªéåºå宽 |
| | | .registerWriteHandler(horizontalCellStyleStrategy) |
| | | .sheet("年度") |
| | | .doWrite((Collection<?>) data.get("data")); |
| | | } else { |
| | | data = personalShiftService.exportToMonthExcel(time, userName, sysDeptId); |
| | | // 设置åå
æ ¼æ ·å¼ |
| | | HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleMonthUtils.getHeadStyle(), StyleMonthUtils.getContentStyle()); |
| | | EasyExcel.write(response.getOutputStream()) |
| | | .head((List<List<String>>) data.get("header")) |
| | | .registerWriteHandler(horizontalCellStyleStrategy) |
| | | .sheet("æåº¦") |
| | | .doWrite((Collection<?>) data.get("data")); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥å·¥èµæç»è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:24:35 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/staffSalaryDetail") |
| | | public class StaffSalaryDetailController { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.ruoyi.staff.service.StaffSalaryMainService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.aspectj.weaver.loadtime.Aj; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å工工èµä¸»è¡¨ å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:22:05 |
| | | */ |
| | | @Api(tags = "å工工èµä¸»è¡¨") |
| | | @RestController |
| | | @RequestMapping("/staffSalaryMain") |
| | | public class StaffSalaryMainController { |
| | | |
| | | @Autowired |
| | | private StaffSalaryMainService staffSalaryMainService; |
| | | |
| | | @GetMapping("/listPage") |
| | | @ApiOperation("å工工èµä¸»è¡¨å页æ¥è¯¢") |
| | | public AjaxResult listPage(Page page, StaffSalaryMain staffSalaryMain) { |
| | | return staffSalaryMainService.listPage(page, staffSalaryMain); |
| | | } |
| | | |
| | | @ApiOperation("éè¿é¨é¨idsè·åç¨æ·ä¿¡æ¯è®¡ç®æ¯ä¸ªåå·¥çå·¥èµ") |
| | | @PostMapping("/calculateSalary") |
| | | public AjaxResult calculateSalary(@RequestBody List<Long> ids) { |
| | | return staffSalaryMainService.calculateSalary(ids); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("æ°å»ºå·¥èµè¡¨") |
| | | @Log(title = "æ°å»ºå·¥èµè¡¨", businessType = BusinessType.INSERT) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody StaffSalaryMain staffSalaryMain) { |
| | | return staffSalaryMainService.add(staffSalaryMain); |
| | | } |
| | | |
| | | @PostMapping("/update") |
| | | @ApiOperation("ä¿®æ¹å·¥èµè¡¨") |
| | | @Log(title = "ä¿®æ¹å·¥èµè¡¨", businessType = BusinessType.UPDATE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult updateStaffSalaryMain(@RequestBody StaffSalaryMain staffSalaryMain) { |
| | | return staffSalaryMainService.updateStaffSalaryMain(staffSalaryMain); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("å é¤å·¥èµè¡¨") |
| | | @Log(title = "å é¤å·¥èµè¡¨", businessType = BusinessType.DELETE) |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult delete(@RequestBody List<Long> ids) { |
| | | return staffSalaryMainService.delete(ids); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.controller; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æåº¦ä¸ªç¨è®¡ç®å·¥å
·ç±»ï¼ä»
éæåº¦æ¶å
¥ã社ä¿ä¸ªäººãå
¬ç§¯é个人ä¸ä¸ªåæ°ï¼ |
| | | */ |
| | | public class TaxCalculator { |
| | | // æåº¦å
å¾é¢ï¼5000å
ï¼ |
| | | private static final BigDecimal MONTHLY_EXEMPTION = new BigDecimal("5000"); |
| | | |
| | | // æåº¦ä¸ªç¨ç¨ç表ï¼[åºçº³ç¨æå¾é¢ä¸é, ç¨ç, éç®æ£é¤æ°] |
| | | private static final List<TaxBracket> MONTHLY_TAX_BRACKETS = new ArrayList<>(); |
| | | |
| | | // éæåå§åç¨çè¡¨ï¼ææåº¦æ¢ç®ï¼å¯¹åºå
¨å¹´è¡¨/12ï¼ |
| | | static { |
| | | MONTHLY_TAX_BRACKETS.add(new TaxBracket(new BigDecimal("3000"), new BigDecimal("0.03"), new BigDecimal("0"))); |
| | | MONTHLY_TAX_BRACKETS.add(new TaxBracket(new BigDecimal("12000"), new BigDecimal("0.10"), new BigDecimal("210"))); |
| | | MONTHLY_TAX_BRACKETS.add(new TaxBracket(new BigDecimal("25000"), new BigDecimal("0.20"), new BigDecimal("1410"))); |
| | | MONTHLY_TAX_BRACKETS.add(new TaxBracket(new BigDecimal("35000"), new BigDecimal("0.25"), new BigDecimal("2660"))); |
| | | MONTHLY_TAX_BRACKETS.add(new TaxBracket(new BigDecimal("55000"), new BigDecimal("0.30"), new BigDecimal("4410"))); |
| | | MONTHLY_TAX_BRACKETS.add(new TaxBracket(new BigDecimal("80000"), new BigDecimal("0.35"), new BigDecimal("7160"))); |
| | | MONTHLY_TAX_BRACKETS.add(new TaxBracket(new BigDecimal("999999"), new BigDecimal("0.45"), new BigDecimal("15160"))); |
| | | } |
| | | |
| | | // ç¨ç表å
é¨ç±» |
| | | private static class TaxBracket { |
| | | final BigDecimal max; // 该档ä½åºçº³ç¨æå¾é¢ä¸é |
| | | final BigDecimal rate; // ç¨ç |
| | | final BigDecimal deduction; // éç®æ£é¤æ° |
| | | |
| | | TaxBracket(BigDecimal max, BigDecimal rate, BigDecimal deduction) { |
| | | this.max = max; |
| | | this.rate = rate; |
| | | this.deduction = deduction; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 计ç®åæä¸ªäººæå¾ç¨ï¼ä»
éä¸ä¸ªåæ°ï¼ |
| | | * @param monthlyIncome æåº¦æ¶å
¥ï¼ç¨åï¼ |
| | | * @param socialSecurity 社ä¿ä¸ªäººç¼´çº³éé¢ |
| | | * @param fund å
¬ç§¯é个人缴纳éé¢ |
| | | * @return æåº¦åºç¼´ä¸ªç¨ï¼ä¿ç2ä½å°æ°ï¼ |
| | | */ |
| | | public static BigDecimal calculateMonthlyTax( |
| | | BigDecimal monthlyIncome, |
| | | BigDecimal socialSecurity, |
| | | BigDecimal fund |
| | | ) { |
| | | // 1. 空å¼/è´æ°å¤çï¼åæ°ä¸ºnullæè´æ°æ¶æ0è®¡ç® |
| | | monthlyIncome = (monthlyIncome == null || monthlyIncome.compareTo(BigDecimal.ZERO) < 0) ? BigDecimal.ZERO : monthlyIncome; |
| | | socialSecurity = (socialSecurity == null || socialSecurity.compareTo(BigDecimal.ZERO) < 0) ? BigDecimal.ZERO : socialSecurity; |
| | | fund = (fund == null || fund.compareTo(BigDecimal.ZERO) < 0) ? BigDecimal.ZERO : fund; |
| | | |
| | | // 2. è®¡ç®æåº¦åºçº³ç¨æå¾é¢ = æåº¦æ¶å
¥ - 5000å
å¾é¢ - 社ä¿ä¸ªäºº - å
¬ç§¯é个人 |
| | | BigDecimal taxableIncome = monthlyIncome |
| | | .subtract(MONTHLY_EXEMPTION) |
| | | .subtract(socialSecurity) |
| | | .subtract(fund); |
| | | |
| | | // 3. åºçº³ç¨æå¾é¢â¤0æ¶ï¼ä¸ªç¨ä¸º0 |
| | | if (taxableIncome.compareTo(BigDecimal.ZERO) <= 0) { |
| | | return BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | // 4. å¹é
ç¨çæ¡£ä½è®¡ç®ä¸ªç¨ |
| | | for (TaxBracket bracket : MONTHLY_TAX_BRACKETS) { |
| | | if (taxableIncome.compareTo(bracket.max) <= 0) { |
| | | return taxableIncome.multiply(bracket.rate) |
| | | .subtract(bracket.deduction) |
| | | .setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | | } |
| | | |
| | | // 5. è¶
è¿æé«æ¡£ä½ï¼80000å
ï¼çæ
åµ |
| | | TaxBracket lastBracket = MONTHLY_TAX_BRACKETS.get(MONTHLY_TAX_BRACKETS.size() - 1); |
| | | return taxableIncome.multiply(lastBracket.rate) |
| | | .subtract(lastBracket.deduction) |
| | | .setScale(2, RoundingMode.HALF_UP); |
| | | } |
| | | |
| | | // æµè¯ç¤ºä¾ |
| | | public static void main(String[] args) { |
| | | // 示ä¾1ï¼ææ¶å
¥10000ï¼ç¤¾ä¿ä¸ªäºº800ï¼å
¬ç§¯é个人500 |
| | | BigDecimal income1 = new BigDecimal("10000"); |
| | | BigDecimal social1 = new BigDecimal("800"); |
| | | BigDecimal fund1 = new BigDecimal("500"); |
| | | BigDecimal tax1 = calculateMonthlyTax(income1, social1, fund1); |
| | | System.out.println("ææ¶å
¥10000ï¼ç¤¾ä¿800ï¼å
¬ç§¯é500ï¼ä¸ªç¨ï¼" + tax1 + " å
"); // 计ç®ç»æï¼111.00 å
|
| | | |
| | | // 示ä¾2ï¼ææ¶å
¥5000ï¼ç¤¾ä¿500ï¼å
¬ç§¯é200 |
| | | BigDecimal income2 = new BigDecimal("5000"); |
| | | BigDecimal social2 = new BigDecimal("500"); |
| | | BigDecimal fund2 = new BigDecimal("200"); |
| | | BigDecimal tax2 = calculateMonthlyTax(income2, social2, fund2); |
| | | System.out.println("ææ¶å
¥5000ï¼ç¤¾ä¿500ï¼å
¬ç§¯é200ï¼ä¸ªç¨ï¼" + tax2 + " å
"); // 计ç®ç»æï¼0.00 å
|
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Data |
| | | public class PerformanceShiftAddDto { |
| | | |
| | | @NotNull(message = "è¯·éæ©çæ¬¡") |
| | | @ApiModelProperty("çæ¬¡") |
| | | private Integer personalAttendanceLocationConfigId; |
| | | |
| | | @NotNull(message = "è¯·éæ©åå·¥") |
| | | @ApiModelProperty("åå·¥id") |
| | | private String staffOnJobId; |
| | | |
| | | @NotNull(message = "è¯·éæ©å¨æ¬¡") |
| | | @ApiModelProperty("å¼å§å¨æ¬¡") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startWeek; |
| | | |
| | | @NotNull(message = "è¯·éæ©å¨æ¬¡") |
| | | @ApiModelProperty("ç»æå¨æ¬¡") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endWeek; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class PerformanceShiftMapDto { |
| | | |
| | | private String name; |
| | | |
| | | private String shiftTime; |
| | | |
| | | private String userId; |
| | | |
| | | private String department; |
| | | |
| | | private Map<String, Object> monthlyAttendance = new HashMap<>(); |
| | | |
| | | private List<Map<String, Object>> list = new ArrayList<>(); |
| | | |
| | | private List<Map<Object, Object>> headerList = new ArrayList<>(); |
| | | } |
| | |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime endAt; |
| | | |
| | | //çæ¬¡ |
| | | private String shift; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.ruoyi.staff.pojo.Bank; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * é¶è¡ç®¡ç表 Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 03:40:54 |
| | | */ |
| | | @Mapper |
| | | public interface BankMapper extends BaseMapper<Bank> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.config.MyBaseMapper; |
| | | import com.ruoyi.staff.dto.PerformanceShiftMapDto; |
| | | import com.ruoyi.staff.pojo.PersonalShift; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:52:19 |
| | | */ |
| | | @Mapper |
| | | public interface PersonalShiftMapper extends BaseMapper<PersonalShift> { |
| | | |
| | | IPage<PerformanceShiftMapDto> performanceShiftPage(Page<Object> page, @Param("time") String time, @Param("userName") String userName, @Param("sysDeptId") Integer sysDeptId); |
| | | |
| | | |
| | | IPage<Map<String, Object>> performanceShiftYear(Page<Object> page, @Param("time") String time, @Param("userName") String userName, @Param("sysDeptId") Integer sysDeptId); |
| | | |
| | | List<Map<String, Object>> performanceShiftYearList(@Param("time") String time, @Param("userName") String userName, @Param("sysDeptId") Integer sysDeptId); |
| | | |
| | | List<PerformanceShiftMapDto> performanceShiftList(@Param("time") String time, @Param("userName") String userName, @Param("sysDeptId") Integer sysDeptId); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.staff.pojo.SchemeApplicableStaff; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.staff.pojo.SchemeInsuranceDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Mapper |
| | | public interface SchemeApplicableStaffMapper extends BaseMapper<SchemeApplicableStaff> { |
| | | /** |
| | | * æ ¹æ®äººåIDæ¥è¯¢å¯¹åºçç¤¾ä¿æ¹æ¡ï¼æ ¸å¿æ¹æ³ï¼ |
| | | * @param staffId 人åID |
| | | * @return 该人åéç¨çææç¤¾ä¿æ¹æ¡å表 |
| | | */ |
| | | List<SchemeApplicableStaff> selectSchemeByStaffId(@Param("staffId") Long staffId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¤¾ä¿æ¹æ¡IDæ¥è¯¢å¯¹åºçæç»å表 |
| | | * @param schemeId ç¤¾ä¿æ¹æ¡ID |
| | | * @return æ¹æ¡æç»å表 |
| | | */ |
| | | List<SchemeInsuranceDetail> selectDetailBySchemeId(@Param("schemeId") Long schemeId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.ruoyi.staff.pojo.StaffSalaryDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥å·¥èµæç»è¡¨ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:24:35 |
| | | */ |
| | | @Mapper |
| | | public interface StaffSalaryDetailMapper extends BaseMapper<StaffSalaryDetail> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.mapper; |
| | | |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * å工工èµä¸»è¡¨ Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:22:05 |
| | | */ |
| | | @Mapper |
| | | public interface StaffSalaryMainMapper extends BaseMapper<StaffSalaryMain> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * é¶è¡ç®¡ç表 |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 03:40:54 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("bank") |
| | | @ApiModel(value = "Bank对象", description = "é¶è¡ç®¡ç表") |
| | | public class Bank implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("é¶è¡åç§°") |
| | | private String bankName; |
| | | } |
| | |
| | | @JsonFormat(pattern = "HH:mm") |
| | | @DateTimeFormat(pattern = "HH:mm") |
| | | private LocalTime endAt; |
| | | |
| | | @ApiModelProperty("çæ¬¡") |
| | | private String shift; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:52:19 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("personal_shift") |
| | | @ApiModel(value = "PersonalShift对象", description = "") |
| | | public class PersonalShift implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("çæ¬¡(æå¡è§åid)") |
| | | private Integer personalAttendanceLocationConfigId; |
| | | |
| | | @ApiModelProperty("åå·¥å¨èid") |
| | | private Long staffOnJobId; |
| | | |
| | | @ApiModelProperty("å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("æçæ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime workTime; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥å·¥èµæç»è¡¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:24:35 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("staff_salary_detail") |
| | | @ApiModel(value = "StaffSalaryDetail对象", description = "åå·¥å·¥èµæç»è¡¨") |
| | | public class StaffSalaryDetail implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("主é®ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("å
³èå·¥èµä¸»è¡¨ID") |
| | | private Long mainId; |
| | | |
| | | @ApiModelProperty("å
³èstaff_on_job表主é®ID") |
| | | private Long staffOnJobId; |
| | | |
| | | @ApiModelProperty("åå·¥å§å") |
| | | private String staffName; |
| | | |
| | | @ApiModelProperty("èä½åç§°") |
| | | private String postName; |
| | | |
| | | @ApiModelProperty("é¨é¨åç§°") |
| | | private String deptName; |
| | | |
| | | @ApiModelProperty("åºæ¬å·¥èµ") |
| | | private BigDecimal basicSalary; |
| | | |
| | | @ApiModelProperty("计件工èµ") |
| | | private BigDecimal pieceSalary; |
| | | |
| | | @ApiModelProperty("计æ¶å·¥èµ") |
| | | private BigDecimal hourlySalary; |
| | | |
| | | @ApiModelProperty("å
¶ä»æ¶å
¥") |
| | | private BigDecimal otherIncome; |
| | | |
| | | @ApiModelProperty("社ä¿ä¸ªäºº") |
| | | private BigDecimal socialPersonal; |
| | | |
| | | @ApiModelProperty("å
¬ç§¯é个人") |
| | | private BigDecimal fundPersonal; |
| | | |
| | | @ApiModelProperty("å
¶ä»æ¯åº") |
| | | private BigDecimal otherDeduct; |
| | | |
| | | @ApiModelProperty("å·¥èµä¸ªç¨") |
| | | private BigDecimal salaryTax; |
| | | |
| | | @ApiModelProperty("åºåå·¥èµ") |
| | | private BigDecimal grossSalary; |
| | | |
| | | @ApiModelProperty("åºæ£å·¥èµ") |
| | | private BigDecimal deductSalary; |
| | | |
| | | @ApiModelProperty("å®åå·¥èµ") |
| | | private BigDecimal netSalary; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | /** |
| | | * <p> |
| | | * å工工èµä¸»è¡¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:22:05 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("staff_salary_main") |
| | | @ApiModel(value = "StaffSalaryMain对象", description = "å工工èµä¸»è¡¨") |
| | | public class StaffSalaryMain implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableField(exist = false) |
| | | private List<StaffSalaryDetail> staffSalaryDetailList; |
| | | |
| | | @ApiModelProperty("主é®ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("å®¡æ ¸äººId") |
| | | private Long auditUserId; |
| | | |
| | | @ApiModelProperty("å®¡æ ¸äººåç§°") |
| | | private String auditUserName; |
| | | |
| | | @ApiModelProperty("å·¥èµä¸»é¢") |
| | | private String salaryTitle; |
| | | |
| | | @ApiModelProperty("å
³èé¨é¨IDï¼å¤ä¸ªç¨éå·åé") |
| | | private String deptIds; |
| | | |
| | | @ApiModelProperty("å·¥èµæä»½ï¼æ ¼å¼ï¼yyyy-MM") |
| | | private String salaryMonth; |
| | | |
| | | @ApiModelProperty("夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty("ç¶æï¼1-è稿 2-å®¡æ ¸æªéè¿ 3-å¾
å®¡æ ¸ 4-å¾
忾 5-已忾") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("å·¥èµæ»é¢") |
| | | private BigDecimal totalSalary; |
| | | |
| | | @ApiModelProperty("æ¯ä»é¶è¡") |
| | | private String payBank; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("å建人") |
| | | private String createUserName; |
| | | |
| | | @ApiModelProperty("åæ¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8",shape = JsonFormat.Shape.STRING) |
| | | private LocalDateTime payTime; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8",shape = JsonFormat.Shape.STRING) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("åå»ºç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("ä¿®æ¹ç¨æ·") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private Long updateUser; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.ruoyi.staff.pojo.Bank; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * é¶è¡ç®¡ç表 æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 03:40:54 |
| | | */ |
| | | public interface BankService extends IService<Bank> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.staff.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.staff.pojo.PersonalShift; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:52:19 |
| | | */ |
| | | public interface PersonalShiftService extends IService<PersonalShift> { |
| | | |
| | | int performanceShiftAdd(PerformanceShiftAddDto performanceShiftAddDto); |
| | | |
| | | Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, Integer sysDeptId); |
| | | |
| | | void performanceShiftUpdate(PersonalShift performanceShift); |
| | | |
| | | IPage<Map<String, Object>> performanceShiftPageYear(Page<Object> page, String time, String userName, Integer sysDeptId); |
| | | |
| | | Map<Object, Object> exportToYearExcel(String time, String userName, Integer sysDeptId) throws Exception; |
| | | |
| | | Map<Object, Object> exportToMonthExcel(String time, String userName, Integer sysDeptId); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.ruoyi.staff.pojo.StaffSalaryDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥å·¥èµæç»è¡¨ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:24:35 |
| | | */ |
| | | public interface StaffSalaryDetailService extends IService<StaffSalaryDetail> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | | * å工工èµä¸»è¡¨ æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:22:05 |
| | | */ |
| | | public interface StaffSalaryMainService extends IService<StaffSalaryMain> { |
| | | |
| | | AjaxResult listPage(Page page, StaffSalaryMain staffSalaryMain); |
| | | |
| | | AjaxResult add(StaffSalaryMain staffSalaryMain); |
| | | |
| | | AjaxResult updateStaffSalaryMain(StaffSalaryMain staffSalaryMain); |
| | | |
| | | AjaxResult delete(List<Long> ids); |
| | | |
| | | AjaxResult calculateSalary(List<Long> ids); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.ruoyi.staff.pojo.Bank; |
| | | import com.ruoyi.staff.mapper.BankMapper; |
| | | import com.ruoyi.staff.service.BankService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * é¶è¡ç®¡ç表 æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 03:40:54 |
| | | */ |
| | | @Service |
| | | public class BankServiceImpl extends ServiceImpl<BankMapper, Bank> implements BankService { |
| | | |
| | | } |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | import com.ruoyi.staff.dto.PersonalAttendanceRecordsDto; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.mapper.PersonalShiftMapper; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import com.ruoyi.staff.pojo.PersonalShift; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @Autowired |
| | | private PersonalShiftMapper personalShiftMapper; |
| | | |
| | | @Override |
| | | public int add(PersonalAttendanceRecordsDto personalAttendanceRecordsDto) { |
| | | // å½åæ¶é´ |
| | |
| | | if (staffOnJob == null) { |
| | | throw new BaseException("å½åç¨æ·æ²¡æå¯¹åºçå工信æ¯"); |
| | | } |
| | | /*夿æå¡ä½ç½®æ¯å¦å¨è§åèå´å
*/ |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(Wrappers.<PersonalAttendanceLocationConfig>lambdaQuery() |
| | | .eq(PersonalAttendanceLocationConfig::getSysDeptId, staffOnJob.getSysDeptId()) |
| | | .orderByDesc(PersonalAttendanceLocationConfig::getId)); |
| | | if (personalAttendanceLocationConfigs == null || personalAttendanceLocationConfigs.isEmpty()) { |
| | | throw new BaseException("å½åé¨é¨æ²¡æè®¾ç½®æå¡è§å"); |
| | | //夿夿åå·¥å½å¤©æ¯å¦ææçæ°æ® |
| | | List<PersonalShift> personalShifts = personalShiftMapper.selectList(Wrappers.<PersonalShift>lambdaQuery() |
| | | .eq(PersonalShift::getStaffOnJobId, staffOnJob.getId()) |
| | | .eq(PersonalShift::getWorkTime, currentDate.atStartOfDay()) |
| | | .isNotNull(PersonalShift::getPersonalAttendanceLocationConfigId)); |
| | | if (CollectionUtil.isEmpty(personalShifts)){ |
| | | throw new BaseException("å½åç¨æ·å½å¤©æ²¡ææçæ°æ®"); |
| | | } |
| | | /*夿æå¡ä½ç½®æ¯å¦å¨è§åèå´å
*/ |
| | | PersonalShift personalShift = personalShifts.get(0); |
| | | |
| | | PersonalAttendanceLocationConfig locationConfig = personalAttendanceLocationConfigMapper.selectById(personalShift.getPersonalAttendanceLocationConfigId()); |
| | | Double punchLongitude = personalAttendanceRecordsDto.getLongitude(); //æå¡çç»åº¦ |
| | | Double punchLatitude = personalAttendanceRecordsDto.getLatitude(); // æå¡ç纬度 |
| | | if (punchLongitude == null || punchLatitude == null) { |
| | | throw new BaseException("æå¡å¤±è´¥ï¼æªè·åå°æ¨çä½ç½®ä¿¡æ¯ï¼è¯·å¼å¯å®ä½æé"); |
| | | } |
| | | //è®¡ç®æå¡ä½ç½®ä¸èå¤ç¹çè·ç¦» |
| | | PersonalAttendanceLocationConfig locationConfig = personalAttendanceLocationConfigs.get(0);//è·åææ°ç䏿¡æ°æ® |
| | | double allowedRadius = locationConfig.getRadius(); // å
许çèå´ï¼ç±³ï¼ |
| | | double actualDistance = LocationUtils.calculateDistance( |
| | | punchLatitude, punchLongitude, // åå·¥æå¡çç»çº¬åº¦ |
| | |
| | | SysDept dept = sysDeptMapper.selectDeptById(staffOnJob.getSysDeptId()); |
| | | resultDto.setDeptName(dept != null ? dept.getDeptName() : null); |
| | | //è·å该å工对åºçæå¡è§å |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(Wrappers.<PersonalAttendanceLocationConfig>lambdaQuery() |
| | | .eq(PersonalAttendanceLocationConfig::getSysDeptId, staffOnJob.getSysDeptId()) |
| | | .orderByDesc(PersonalAttendanceLocationConfig::getId)); |
| | | if (personalAttendanceLocationConfigs.size()>0){ |
| | | resultDto.setStartAt(personalAttendanceLocationConfigs.get(0).getStartAt()); |
| | | resultDto.setEndAt(personalAttendanceLocationConfigs.get(0).getEndAt()); |
| | | List<PersonalShift> personalShifts = personalShiftMapper.selectList(Wrappers.<PersonalShift>lambdaQuery() |
| | | .eq(PersonalShift::getStaffOnJobId, staffOnJob.getId()) |
| | | .eq(PersonalShift::getWorkTime, currentDate.atStartOfDay()) |
| | | .isNotNull(PersonalShift::getPersonalAttendanceLocationConfigId)); |
| | | if (CollectionUtil.isNotEmpty(personalShifts)){ |
| | | PersonalAttendanceLocationConfig personalAttendanceLocationConfig = personalAttendanceLocationConfigMapper.selectById(personalShifts.get(0).getPersonalAttendanceLocationConfigId()); |
| | | resultDto.setStartAt(personalAttendanceLocationConfig.getStartAt()); |
| | | resultDto.setEndAt(personalAttendanceLocationConfig.getEndAt()); |
| | | resultDto.setShift(personalAttendanceLocationConfig.getShift()); |
| | | } |
| | | return resultDto; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.project.system.domain.SysDictData; |
| | | import com.ruoyi.staff.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.staff.dto.PerformanceShiftMapDto; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.pojo.PersonalShift; |
| | | import com.ruoyi.staff.mapper.PersonalShiftMapper; |
| | | import com.ruoyi.staff.service.PersonalAttendanceLocationConfigService; |
| | | import com.ruoyi.staff.service.PersonalShiftService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.staff.utils.JackSonUtil; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.YearMonth; |
| | | import java.time.ZoneId; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.util.*; |
| | | |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-05 03:52:19 |
| | | */ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class PersonalShiftServiceImpl extends ServiceImpl<PersonalShiftMapper, PersonalShift> implements PersonalShiftService { |
| | | |
| | | @Autowired |
| | | private PersonalAttendanceLocationConfigMapper personalAttendanceLocationConfigMapper; |
| | | |
| | | @Override |
| | | public int performanceShiftAdd(PerformanceShiftAddDto performanceShiftAddDto) { |
| | | List<PersonalShift> list = new ArrayList<>(); |
| | | LocalDateTime startWeek = performanceShiftAddDto.getStartWeek();//å¼å§æ¥æ |
| | | LocalDateTime endWeek = performanceShiftAddDto.getEndWeek();//ç»ææ¥æ |
| | | |
| | | |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | String formattedDateTime = performanceShiftAddDto.getStartWeek().format(formatter); |
| | | String[] splitUserId = performanceShiftAddDto.getStaffOnJobId().split(","); |
| | | for (String userId : splitUserId) { |
| | | //夿æ¯å¦è·¨æ |
| | | boolean isMonth = startWeek.getMonthValue() != endWeek.getMonthValue(); |
| | | if (isMonth){ |
| | | //å¦æè·¨æ,å两个æé½å¤æä¸ä¸çæ°æ®åºæ¯åªä¸ªæä»½çæ°æ®æ²¡æ |
| | | boolean exists1 = baseMapper.exists(Wrappers.<PersonalShift>lambdaQuery() |
| | | .eq(PersonalShift::getWorkTime, startWeek) |
| | | .eq(PersonalShift::getStaffOnJobId, userId)); |
| | | boolean exists2 = baseMapper.exists(Wrappers.<PersonalShift>lambdaQuery() |
| | | .eq(PersonalShift::getWorkTime, endWeek) |
| | | .eq(PersonalShift::getStaffOnJobId, userId)); |
| | | if (!exists1 && !exists2){ |
| | | //两个æé½ä¸å卿°æ® |
| | | list = saveMonth(performanceShiftAddDto.getStartWeek(), userId, list); |
| | | list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list); |
| | | }else if (!exists1 && exists2){ |
| | | //å¼å§çæä»½ä¸å卿°æ® |
| | | list = saveMonth(performanceShiftAddDto.getStartWeek(), userId, list); |
| | | }else if (exists1 && !exists2){ |
| | | //ç»æçæä»½ä¸å卿°æ® |
| | | list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list); |
| | | } |
| | | }else { |
| | | //ä¸è·¨æ |
| | | boolean exists = baseMapper.exists(Wrappers.<PersonalShift>lambdaQuery() |
| | | .in(PersonalShift::getWorkTime, formattedDateTime) |
| | | .eq(PersonalShift::getStaffOnJobId, userId)); |
| | | // 妿ä¸å卿·»å æ°æ® |
| | | if (!exists) { |
| | | list = saveMonth(performanceShiftAddDto.getEndWeek(), userId, list); |
| | | } |
| | | } |
| | | } |
| | | if (!list.isEmpty()) { |
| | | saveBatch(list); |
| | | list.clear(); |
| | | } |
| | | // 忬¡æ´æ° |
| | | List<LocalDateTime> datesBetween = getLocalDateTimesBetween(performanceShiftAddDto.getStartWeek(), performanceShiftAddDto.getEndWeek()); |
| | | for (LocalDateTime date : datesBetween) { |
| | | for (String s : splitUserId) { |
| | | PersonalShift personalShift = new PersonalShift(); |
| | | personalShift.setPersonalAttendanceLocationConfigId(performanceShiftAddDto.getPersonalAttendanceLocationConfigId()); |
| | | personalShift.setStaffOnJobId(Long.valueOf(s)); |
| | | personalShift.setWorkTime(date); |
| | | String formatterDateTime = date.format(formatter); |
| | | baseMapper.update(new PersonalShift(), Wrappers.<PersonalShift>lambdaUpdate() |
| | | .set(PersonalShift::getPersonalAttendanceLocationConfigId, performanceShiftAddDto.getPersonalAttendanceLocationConfigId()) |
| | | .eq(PersonalShift::getStaffOnJobId, s) |
| | | .eq(PersonalShift::getWorkTime, formatterDateTime)); |
| | | } |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> performanceShiftPage(Page<Object> page, String time, String userName, Integer sysDeptId) { |
| | | IPage<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftPage(page, time, userName, sysDeptId); |
| | | //æ¥è¯¢ææç次(æå¡è§å) |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(null); |
| | | mapIPage.getRecords().forEach(i -> { |
| | | String[] shiftTimes = i.getShiftTime().split(";"); |
| | | double totalAttendance = 0;//æ»åºå¤å¤©æ° |
| | | List<Map<String, Object>> map = new ArrayList<>(); |
| | | // å岿¥æ |
| | | for (String shiftTime : shiftTimes) { |
| | | i.setShiftTime(null); |
| | | Map<String, Object> hashMap = new HashMap<>(); |
| | | String[] shiftTimeAndShift = shiftTime.split("ï¼"); |
| | | //æçè¯¦ç»æ°æ® |
| | | hashMap.put("id", shiftTimeAndShift[2]); |
| | | hashMap.put("shift", shiftTimeAndShift[1]); |
| | | hashMap.put("time", shiftTimeAndShift[0]); |
| | | map.add(hashMap); |
| | | i.setList(map); |
| | | //æ±æ»çåçæ¬¡ç»è®¡æ°æ® |
| | | for (PersonalAttendanceLocationConfig personalAttendanceLocationConfig : personalAttendanceLocationConfigs) { |
| | | if (!i.getMonthlyAttendance().containsKey(personalAttendanceLocationConfig.getShift())){ |
| | | i.getMonthlyAttendance().put(personalAttendanceLocationConfig.getShift(), 0); |
| | | } |
| | | if (personalAttendanceLocationConfig.getShift().equals(shiftTimeAndShift[1])) { |
| | | BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(personalAttendanceLocationConfig.getShift()).toString()); |
| | | i.getMonthlyAttendance().put(personalAttendanceLocationConfig.getShift(), bigDecimal.add(new BigDecimal("1"))); |
| | | } |
| | | } |
| | | //ç»è®¡æ»åºå¤å¤©æ°(æ©/ä¸/æ/å¤)é½ç®åºå¤,å
¶ä½é½æ¯ä¼æ¯ |
| | | if (shiftTimeAndShift[1].contains("æ©") || |
| | | shiftTimeAndShift[1].contains("ä¸") || |
| | | shiftTimeAndShift[1].contains("æ") || |
| | | shiftTimeAndShift[1].contains("å¤")) { |
| | | i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1); |
| | | } |
| | | } |
| | | }); |
| | | // è·åheaderæ¶é´ |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å符串æ¶é´è½¬æ¢ä¸º LocalDateTime ç±»åæ¶é´ |
| | | LocalDateTime localDateTime = LocalDateTime.parse(time, formatters); |
| | | LocalDate firstDayOfMonth = localDateTime.toLocalDate().withDayOfMonth(1); |
| | | LocalDate lastDayOfMonth = localDateTime.toLocalDate().with(TemporalAdjusters.lastDayOfMonth()); |
| | | List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay()); |
| | | List<Object> list1 = new ArrayList<>(); |
| | | for (LocalDateTime dateTime : localDateTimesBetween) { |
| | | Map<Object, Object> hashMap = new HashMap<>(); |
| | | DateTime parse = DateUtil.parse(dateTime.format(formatter)); |
| | | hashMap.put("weekly", DateUtil.weekOfYear(DateUtil.offsetDay(parse, 1))); |
| | | hashMap.put("headerTime", getWeek(dateTime.format(formatters))); |
| | | list1.add(hashMap); |
| | | } |
| | | Map<String, Object> resultMap = new HashMap<>(); |
| | | resultMap.put("page", mapIPage); |
| | | resultMap.put("headerList", list1); |
| | | return resultMap; |
| | | } |
| | | |
| | | @Override |
| | | public void performanceShiftUpdate(PersonalShift personalShift) { |
| | | baseMapper.update(new PersonalShift(), Wrappers.<PersonalShift>lambdaUpdate() |
| | | .eq(PersonalShift::getId, personalShift.getId()) |
| | | .set(PersonalShift::getPersonalAttendanceLocationConfigId, personalShift.getPersonalAttendanceLocationConfigId())); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> performanceShiftPageYear(Page<Object> page, String time, String userName, Integer sysDeptId) { |
| | | IPage<Map<String, Object>> mapYearIPage = baseMapper.performanceShiftYear(page, time, userName, sysDeptId); |
| | | //æ¥è¯¢ææç次(æå¡è§å) |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(null); |
| | | mapYearIPage.setRecords(annualAttendanceProcessing(mapYearIPage.getRecords(), personalAttendanceLocationConfigs)); |
| | | return mapYearIPage; |
| | | } |
| | | |
| | | @Override |
| | | public Map<Object, Object> exportToYearExcel(String time, String userName, Integer sysDeptId) throws Exception { |
| | | Map<Object, Object> map = new HashMap<>(); |
| | | //æ¥è¯¢ææç次(æå¡è§å) |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(null); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å符串æ¶é´è½¬æ¢ä¸º LocalDateTime ç±»åæ¶é´ |
| | | LocalDateTime localDateTime = LocalDateTime.parse(time, formatters); |
| | | map.put("header", getYearHeader(localDateTime.getYear() + " å¹´", personalAttendanceLocationConfigs)); |
| | | List<Map<String, Object>> mapYearList = baseMapper.performanceShiftYearList(time, userName, sysDeptId); |
| | | annualAttendanceProcessing(mapYearList, personalAttendanceLocationConfigs); |
| | | List<List<Object>> lists = dataRequiredForProcessingIntoExcel(mapYearList, personalAttendanceLocationConfigs); |
| | | map.put("data", lists); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Map<Object, Object> exportToMonthExcel(String time, String userName, Integer sysDeptId) { |
| | | //æ¥è¯¢ææç次(æå¡è§å) |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(null); |
| | | List<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftList(time, userName, sysDeptId); |
| | | mapIPage.forEach(i -> { |
| | | String[] shiftTimes = i.getShiftTime().split(";"); |
| | | double totalAttendance = 0; |
| | | List<Map<String, Object>> map = new ArrayList<>(); |
| | | // å岿¥æ |
| | | for (String shiftTime : shiftTimes) { |
| | | Map<String, Object> hashMap = new HashMap<>(); |
| | | String[] shiftTimeAndShift = shiftTime.split("ï¼"); |
| | | for (PersonalAttendanceLocationConfig personalAttendanceLocationConfig : personalAttendanceLocationConfigs) { |
| | | if (!i.getMonthlyAttendance().containsKey(personalAttendanceLocationConfig.getShift())) { |
| | | i.getMonthlyAttendance().put(personalAttendanceLocationConfig.getShift(), 0); |
| | | } |
| | | if (personalAttendanceLocationConfig.getShift().equals(shiftTimeAndShift[1])) { |
| | | BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(personalAttendanceLocationConfig.getShift()).toString()); |
| | | i.getMonthlyAttendance().put(personalAttendanceLocationConfig.getShift(), bigDecimal.add(new BigDecimal("1"))); |
| | | } |
| | | } |
| | | //ç»è®¡æ»åºå¤å¤©æ°(æ©/ä¸/æ/å¤)é½ç®åºå¤,å
¶ä½é½æ¯ä¼æ¯ |
| | | if (shiftTimeAndShift[1].contains("æ©") || |
| | | shiftTimeAndShift[1].contains("ä¸") || |
| | | shiftTimeAndShift[1].contains("æ") || |
| | | shiftTimeAndShift[1].contains("å¤")) { |
| | | i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1); |
| | | } |
| | | hashMap.put("id", shiftTimeAndShift[2]); |
| | | hashMap.put("shift", shiftTimeAndShift[1]); |
| | | hashMap.put("time", shiftTimeAndShift[0]); |
| | | map.add(hashMap); |
| | | } |
| | | i.setList(map); |
| | | i.setShiftTime(null); |
| | | }); |
| | | Map<Object, Object> map = new HashMap<>(); |
| | | DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | // å°å符串æ¶é´è½¬æ¢ä¸º LocalDateTime ç±»åæ¶é´ |
| | | LocalDateTime localDateTime = LocalDateTime.parse(time, formatters); |
| | | map.put("header", getMonthHeader(localDateTime)); |
| | | List<List<Object>> lists = dataRequiredForProcessingIntoExcelMonth(mapIPage, personalAttendanceLocationConfigs); |
| | | map.put("data", lists); |
| | | return map; |
| | | } |
| | | |
| | | // å¹´å页ä¸å¯¼åºå
±åä½¿ç¨ |
| | | public List<Map<String, Object>> annualAttendanceProcessing(List<Map<String, Object>> mapYearList,List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs) { |
| | | for (Map<String, Object> map : mapYearList) { |
| | | Map<String, Object> resultMap = new LinkedHashMap<>(); |
| | | Map<String, Object> hashMapYear = new LinkedHashMap<>(); |
| | | double totalYearAttendance = 0; |
| | | // ä¸å¹´12个æ |
| | | for (int i = 1; i < 13; i++) { |
| | | Map<String, Object> hashMapMonth = new LinkedHashMap<>(); |
| | | double totalMonthAttendance = 0; |
| | | for (PersonalAttendanceLocationConfig personalAttendanceLocationConfig : personalAttendanceLocationConfigs) { |
| | | // åå§åèµå¼ |
| | | if (!hashMapYear.containsKey(personalAttendanceLocationConfig.getShift())){ |
| | | hashMapYear.put(personalAttendanceLocationConfig.getShift(), 0); |
| | | } |
| | | // æ |
| | | if (!ObjectUtils.isEmpty(map.get("month_str"))) { |
| | | String charArray = map.get("month_str").toString(); |
| | | int count = countOccurrences(charArray, i + "ï¼" + personalAttendanceLocationConfig.getShift()); |
| | | hashMapMonth.put(personalAttendanceLocationConfig.getShift(), count); |
| | | hashMapYear.put(personalAttendanceLocationConfig.getShift(), new BigDecimal(hashMapYear.get(personalAttendanceLocationConfig.getShift()).toString()).add(new BigDecimal(count))); |
| | | // æ©ï¼ä¸ï¼å¤ï¼å·® |
| | | if (personalAttendanceLocationConfig.getShift().contains("æ©") || |
| | | personalAttendanceLocationConfig.getShift().contains("ä¸") || |
| | | personalAttendanceLocationConfig.getShift().contains("æ") || |
| | | personalAttendanceLocationConfig.getShift().contains("å¤")) { |
| | | totalMonthAttendance += count; |
| | | totalYearAttendance += count; |
| | | } |
| | | } |
| | | // ç©ºæ°æ® |
| | | else { |
| | | map.put("work_time", i); |
| | | hashMapMonth.put(personalAttendanceLocationConfig.getShift(), 0); |
| | | } |
| | | } |
| | | hashMapMonth.put("totalMonthAttendance", totalMonthAttendance); |
| | | hashMapYear.put("totalYearAttendance", totalYearAttendance); |
| | | resultMap.put(i + "", hashMapMonth); |
| | | } |
| | | map.remove("month_str"); |
| | | map.remove("year_str"); |
| | | map.put("year", hashMapYear); |
| | | map.put("month", resultMap); |
| | | } |
| | | return mapYearList; |
| | | } |
| | | |
| | | public static int countOccurrences(String str, String target) { |
| | | int count = 0; |
| | | int index = 0; |
| | | while ((index = str.indexOf(target, index)) != -1) { |
| | | count++; |
| | | index += target.length(); |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | public List<List<Object>> dataRequiredForProcessingIntoExcel(List<Map<String, Object>> list, List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs) throws Exception { |
| | | List<List<Object>> data = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | List<Object> excelRowList = new ArrayList<>(); |
| | | excelRowList.add(i + 1); |
| | | excelRowList.add(list.get(i).get("account")); |
| | | excelRowList.add(list.get(i).get("name")); |
| | | Map<String, Object> year = JackSonUtil.unmarshal(JackSonUtil.marshal(list.get(i).get("year")), Map.class); |
| | | excelRowList.add(year.get("totalYearAttendance")); |
| | | personalAttendanceLocationConfigs.forEach(j -> { |
| | | excelRowList.add(year.get(j.getShift())); |
| | | }); |
| | | Map<String, Map<String, Object>> month = JackSonUtil.unmarshal(JackSonUtil.marshal(list.get(i).get("month")), Map.class); |
| | | for (int j = 1; j < 13; j++) { |
| | | Object totalMonthAttendance = month.get(j + "").get("totalMonthAttendance"); |
| | | excelRowList.add(totalMonthAttendance); |
| | | for (PersonalAttendanceLocationConfig personalAttendanceLocationConfig : personalAttendanceLocationConfigs) { |
| | | excelRowList.add(month.get(j + "").get(personalAttendanceLocationConfig.getShift())); |
| | | } |
| | | } |
| | | data.add(excelRowList); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | |
| | | private List<PersonalShift> saveMonth (LocalDateTime week,String userId,List<PersonalShift> list){ |
| | | LocalDate firstDayOfMonth = week.toLocalDate().withDayOfMonth(1); |
| | | LocalDate lastDayOfMonth = week.toLocalDate().with(TemporalAdjusters.lastDayOfMonth()); |
| | | List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay()); |
| | | localDateTimesBetween.forEach(i -> { |
| | | PersonalShift personalShift = new PersonalShift(); |
| | | personalShift.setStaffOnJobId(Long.valueOf(userId)); |
| | | personalShift.setWorkTime(i); |
| | | list.add(personalShift); |
| | | if (list.size() >= 1000) { |
| | | saveBatch(list); |
| | | list.clear(); |
| | | } |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | // è·å两个localDateTimeçæ¯ä¸å¤© |
| | | public static List<LocalDateTime> getLocalDateTimesBetween(LocalDateTime start, LocalDateTime end) { |
| | | List<LocalDateTime> localDateTimes = new ArrayList<>(); |
| | | LocalDate currentDate = start.toLocalDate(); |
| | | LocalDateTime currentLocalDateTime = start; |
| | | while (!currentDate.isAfter(end.toLocalDate())) { |
| | | localDateTimes.add(currentLocalDateTime); |
| | | currentLocalDateTime = currentLocalDateTime.plusDays(1); |
| | | currentDate = currentDate.plusDays(1); |
| | | } |
| | | return localDateTimes; |
| | | } |
| | | |
| | | public static String getWeek(String dayStr) { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | try { |
| | | Date date = sdf.parse(dayStr); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(date); |
| | | int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); |
| | | int day = calendar.get(Calendar.DAY_OF_MONTH); |
| | | return day + " " + getWeekDay(dayOfWeek); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public static String getWeekDay(int dayOfWeek) { |
| | | switch (dayOfWeek) { |
| | | case Calendar.MONDAY: |
| | | return "å¨ä¸"; |
| | | case Calendar.TUESDAY: |
| | | return "å¨äº"; |
| | | case Calendar.WEDNESDAY: |
| | | return "å¨ä¸"; |
| | | case Calendar.THURSDAY: |
| | | return "å¨å"; |
| | | case Calendar.FRIDAY: |
| | | return "å¨äº"; |
| | | case Calendar.SATURDAY: |
| | | return "å¨å
"; |
| | | case Calendar.SUNDAY: |
| | | return "卿¥"; |
| | | default: |
| | | return "æªç¥"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * è¿å表头 |
| | | * <p> |
| | | * å¤å±List代表è¡å
å± List代表å ç¸åçåæ°æ®ä¼è¢«ä¸»å¨åå¹¶ |
| | | * æé åå表头 |
| | | * |
| | | * @return List<List < String>> |
| | | */ |
| | | private static List<List<String>> getYearHeader(String year, List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs) { |
| | | List<List<String>> line = new ArrayList<>(); |
| | | line.add(Arrays.asList("è夿±æ»", "åºå·", "åºå·")); |
| | | line.add(Arrays.asList("è夿±æ»", "å·¥å·", "å·¥å·")); |
| | | line.add(Arrays.asList("è夿±æ»", "å§å", "å§å")); |
| | | line.add(Arrays.asList("åºå¤è¯¦æ
", year, "åºå¤")); |
| | | // å¹´ header |
| | | for (PersonalAttendanceLocationConfig personalAttendanceLocationConfig : personalAttendanceLocationConfigs) { |
| | | line.add(Arrays.asList("è夿±æ»", year, personalAttendanceLocationConfig.getShift())); |
| | | } |
| | | // æheader |
| | | for (int i = 1; i < 13; i++) { |
| | | line.add(Arrays.asList("åºå¤è¯¦æ
", i + " æ", "åºå¤")); |
| | | for (PersonalAttendanceLocationConfig personalAttendanceLocationConfig : personalAttendanceLocationConfigs) { |
| | | line.add(Arrays.asList("åºå¤è¯¦æ
", i + " æ", personalAttendanceLocationConfig.getShift())); |
| | | } |
| | | } |
| | | return line; |
| | | } |
| | | |
| | | private static List<List<String>> getMonthHeader(LocalDateTime localDateTimeYear) { |
| | | String year = localDateTimeYear.getYear() + " 年人åçæ¬¡"; |
| | | List<List<String>> line = new ArrayList<>(); |
| | | line.add(Arrays.asList(year, "åºå·", "åºå·", "åºå·")); |
| | | line.add(Arrays.asList(year, "å§å", "å§å", "å§å")); |
| | | line.add(Arrays.asList(year, "é¨é¨", "é¨é¨", "é¨é¨")); |
| | | line.add(Arrays.asList(year, localDateTimeYear.getYear() + "", localDateTimeYear.getYear() + "", "åºå¤")); |
| | | line.add(Arrays.asList(year, localDateTimeYear.getYear() + "", localDateTimeYear.getYear() + "","ä¼")); |
| | | line.add(Arrays.asList(year, "å¹´", "å¹´", "请å")); |
| | | line.add(Arrays.asList(year, localDateTimeYear.getMonthValue() + "", localDateTimeYear.getMonthValue() + "", "æ©")); |
| | | line.add(Arrays.asList(year, "æ", "æ", "ä¸")); |
| | | line.add(Arrays.asList(year, "", "", "å¤")); |
| | | line.add(Arrays.asList(year, "卿¬¡", "ææ", "åºå·®")); |
| | | LocalDate firstDayOfMonth = localDateTimeYear.toLocalDate().withDayOfMonth(1); |
| | | LocalDate lastDayOfMonth = localDateTimeYear.toLocalDate().with(TemporalAdjusters.lastDayOfMonth()); |
| | | List<LocalDateTime> timeList = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay()); |
| | | timeList.forEach(i -> { |
| | | int dayOfYear = i.getDayOfMonth(); |
| | | Date from = Date.from(i.atZone(ZoneId.systemDefault()).toInstant()); |
| | | String weekDay = getWeekDay(i.getDayOfWeek().getValue()); |
| | | line.add(Arrays.asList(year, DateUtil.weekOfYear(DateUtil.offsetDay(from, 1)) + "", weekDay, dayOfYear + "")); |
| | | }); |
| | | return line; |
| | | } |
| | | |
| | | public List<List<Object>> dataRequiredForProcessingIntoExcelMonth(List<PerformanceShiftMapDto> list, List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs) { |
| | | List<List<Object>> data = new ArrayList<>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | List<Object> excelRowList = new ArrayList<>(); |
| | | excelRowList.add(i + 1); |
| | | excelRowList.add(list.get(i).getName()); |
| | | excelRowList.add(list.get(i).getDepartment()); |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("totalAttendance")); |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("%ä¼%")); // ä¼ |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("%å%")); // å |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("%æ©%")); // æ© |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("%ä¸%")); // ä¸ |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("%å¤%")); // å¤ |
| | | excelRowList.add(list.get(i).getMonthlyAttendance().get("%å·®%")); // å·® |
| | | for (Map<String, Object> o : list.get(i).getList()) { |
| | | String enumLabel = ""; |
| | | for (PersonalAttendanceLocationConfig personalAttendanceLocationConfig : personalAttendanceLocationConfigs) { |
| | | if (personalAttendanceLocationConfig.getShift().equals(o.get("shift"))) { |
| | | enumLabel = personalAttendanceLocationConfig.getShift(); |
| | | } |
| | | } |
| | | excelRowList.add(ObjectUtils.isEmpty(enumLabel) ? "-" : enumLabel); |
| | | } |
| | | data.add(excelRowList); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.project.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.staff.controller.TaxCalculator; |
| | | import com.ruoyi.staff.dto.StaffOnJobDto; |
| | | import com.ruoyi.staff.mapper.SchemeInsuranceDetailMapper; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.SchemeApplicableStaff; |
| | | import com.ruoyi.staff.mapper.SchemeApplicableStaffMapper; |
| | | import com.ruoyi.staff.pojo.SchemeInsuranceDetail; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.IStaffOnJobService; |
| | | import com.ruoyi.staff.service.SchemeApplicableStaffService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private SysDeptMapper sysDeptMapper; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | |
| | | @Override |
| | |
| | | |
| | | public void setSchemeApplicableStaffUserInfo(SchemeApplicableStaff schemeApplicableStaff) { |
| | | // éè¿é¨é¨è·å人åid |
| | | List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectList(new LambdaQueryWrapper<SysUserDept>() |
| | | .in(SysUserDept::getDeptId, schemeApplicableStaff.getDeptIds())); |
| | | if(CollectionUtils.isEmpty(sysUserDepts)){ |
| | | String[] split = schemeApplicableStaff.getDeptIds().split(","); |
| | | List<StaffOnJob> staffOnJobs = staffOnJobMapper.selectList(new LambdaQueryWrapper<StaffOnJob>() |
| | | .in(StaffOnJob::getSysDeptId, Arrays.stream(split).map(Long::valueOf).collect(Collectors.toList()))); |
| | | if(CollectionUtils.isEmpty(staffOnJobs)){ |
| | | throw new IllegalArgumentException("é¨é¨ä¸æ åå·¥"); |
| | | } |
| | | List<SysUser> sysUsers = sysUserMapper.selectUserByIds(sysUserDepts.stream().map(SysUserDept::getUserId).collect(Collectors.toList())); |
| | | if(CollectionUtils.isEmpty(sysUsers)){ |
| | | throw new IllegalArgumentException("é¨é¨ä¸æ åå·¥"); |
| | | } |
| | | schemeApplicableStaff.setStaffIds(sysUsers |
| | | schemeApplicableStaff.setStaffIds(staffOnJobs |
| | | .stream() |
| | | .map(SysUser::getUserId) |
| | | .map(StaffOnJob::getId) |
| | | .filter(Objects::nonNull) // è¿æ»¤æ null å¼ |
| | | .map(String::valueOf) |
| | | .collect(Collectors.joining( ","))); |
| | | schemeApplicableStaff.setStaffNames(sysUsers.stream().map(SysUser::getNickName).collect(Collectors.joining(","))); |
| | | schemeApplicableStaff.setStaffNames(staffOnJobs.stream().map(StaffOnJob::getStaffName).collect(Collectors.joining(","))); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .in(SchemeInsuranceDetail::getSchemeId, ids)); |
| | | return AjaxResult.success(delete); |
| | | } |
| | | |
| | | /** |
| | | * éè¿åå·¥id计ç®ç¤¾ä¿æ¹æ¡ |
| | | * @param id |
| | | */ |
| | | public void calculateByEmployeeId(Integer id,Map<String, Object> map) { |
| | | // 1. å
¥åæ ¡éª |
| | | if (id == null) { |
| | | return; // æè¿å空åè¡¨ï¼æ ¹æ®ä¸å¡éæ±è°æ´ |
| | | } |
| | | Long staffId = id.longValue(); |
| | | // 社ä¿éé¢ |
| | | BigDecimal schemeAmount = new BigDecimal("0.00"); |
| | | // å
¬ç§¯ééé¢ |
| | | BigDecimal gjj = new BigDecimal("0.00"); |
| | | // åºæ¬å·¥èµ |
| | | BigDecimal basicSalary = new BigDecimal("0.00"); |
| | | map.put("gjj", gjj); // å
¬ç§¯é |
| | | map.put("schemeAmount", schemeAmount); // 社ä¿éé¢ |
| | | map.put("basicSalary", basicSalary); // åºæ¬å·¥èµ |
| | | // 个ç¨éé¢ |
| | | BigDecimal salaryTax = new BigDecimal("0.00"); |
| | | map.put("salaryTax", salaryTax); |
| | | // è®¡ä»¶å·¥èµ |
| | | BigDecimal pieceSalary = new BigDecimal("0.00"); |
| | | map.put("pieceSalary", pieceSalary); |
| | | // 计æ¶å·¥èµ |
| | | BigDecimal hourlySalary = new BigDecimal("0.00"); |
| | | map.put("hourlySalary", hourlySalary); |
| | | // å
¶ä»æ¶å
¥ |
| | | BigDecimal otherIncome = new BigDecimal("0.00"); |
| | | map.put("otherIncome", otherIncome); |
| | | // å
¶ä»æ¯åº |
| | | BigDecimal otherDeduct = new BigDecimal("0.00"); |
| | | map.put("otherDeduct", otherDeduct); |
| | | // åºåå·¥èµ |
| | | BigDecimal grossSalary = new BigDecimal("0.00"); |
| | | map.put("grossSalary", grossSalary); |
| | | // åºæ£å·¥èµ |
| | | BigDecimal deductSalary = new BigDecimal("0.00"); |
| | | map.put("deductSalary", deductSalary); |
| | | // å®åå·¥èµ |
| | | BigDecimal netSalary = new BigDecimal("0.00"); |
| | | map.put("netSalary", netSalary); |
| | | // è°ç¨åºæ¬å·¥èµ |
| | | StaffOnJob staffOnJobDto = staffOnJobMapper.selectById(staffId); |
| | | if(staffOnJobDto == null){ |
| | | return; |
| | | } |
| | | basicSalary = staffOnJobDto.getBasicSalary(); |
| | | map.put("basicSalary", basicSalary); |
| | | // åºåå·¥èµ |
| | | map.put("grossSalary", basicSalary); |
| | | // 个ç¨éé¢ï¼æ 社ä¿çï¼ |
| | | BigDecimal bigDecimal = TaxCalculator.calculateMonthlyTax(basicSalary, schemeAmount, gjj); |
| | | map.put("salaryTax", bigDecimal); |
| | | // 2. æ¥è¯¢è¯¥äººå对åºçç¤¾ä¿æ¹æ¡ |
| | | List<SchemeApplicableStaff> schemeList = schemeApplicableStaffMapper.selectSchemeByStaffId(staffId); |
| | | if (CollectionUtils.isEmpty(schemeList)) { |
| | | return; // æ å¹é
æ¹æ¡ï¼è¿å空å表 |
| | | } |
| | | // 3. 为æ¯ä¸ªæ¹æ¡å
³èæç»å表 |
| | | for (SchemeApplicableStaff scheme : schemeList) { |
| | | List<SchemeInsuranceDetail> detailList = schemeApplicableStaffMapper.selectDetailBySchemeId(scheme.getId()); |
| | | // æ ¹æ®æç»å表计ç®ç¤¾ä¿ç¼´è´¹éé¢ |
| | | if(CollectionUtils.isEmpty(detailList)){ |
| | | continue; |
| | | } |
| | | for (SchemeInsuranceDetail detail : detailList) { |
| | | if("使¿å
¬ç§¯é".equals(detail.getInsuranceType())){ |
| | | gjj = gjj.add(calculateByEmployeeIdType(detail.getInsuranceType(),gjj, staffOnJobDto, detail)); |
| | | }else{ |
| | | schemeAmount = schemeAmount.add(calculateByEmployeeIdType(detail.getInsuranceType(),schemeAmount, staffOnJobDto, detail)); |
| | | } |
| | | } |
| | | } |
| | | map.put("schemeAmount", schemeAmount); |
| | | map.put("gjj", gjj); |
| | | // 个ç¨éé¢ï¼ç¤¾ä¿çï¼ |
| | | bigDecimal = TaxCalculator.calculateMonthlyTax(basicSalary, schemeAmount, gjj); |
| | | map.put("salaryTax", bigDecimal); |
| | | // åºæ£å·¥èµ |
| | | map.put("deductSalary", bigDecimal.add(gjj).add(schemeAmount)); |
| | | // å®åå·¥èµ |
| | | map.put("netSalary", basicSalary.subtract(bigDecimal).subtract(gjj).subtract(schemeAmount)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç® |
| | | * @param type |
| | | * @param bigDecimal |
| | | * @param staffOnJobDto |
| | | * @param detail |
| | | * @return |
| | | */ |
| | | public BigDecimal calculateByEmployeeIdType(String type,BigDecimal bigDecimal, StaffOnJob staffOnJobDto,SchemeInsuranceDetail detail) { |
| | | // 夿æ¯å¦è°ç¨åºæ¬å·¥èµ |
| | | if (detail.getUseBasicSalary() == 1) { |
| | | BigDecimal divide = detail.getPaymentBase().multiply(detail.getPersonalRatio()).divide(new BigDecimal("100"), 2); |
| | | bigDecimal = bigDecimal.add(divide); |
| | | }else{ |
| | | // è°ç¨åºæ¬å·¥èµ |
| | | BigDecimal multiply = staffOnJobDto.getBasicSalary().multiply(detail.getPersonalRatio().divide(new BigDecimal("100"), 2)); |
| | | bigDecimal = bigDecimal.add(multiply); |
| | | } |
| | | bigDecimal = bigDecimal.add(detail.getPersonalFixed()); |
| | | return bigDecimal; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.ruoyi.staff.pojo.StaffSalaryDetail; |
| | | import com.ruoyi.staff.mapper.StaffSalaryDetailMapper; |
| | | import com.ruoyi.staff.service.StaffSalaryDetailService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * åå·¥å·¥èµæç»è¡¨ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:24:35 |
| | | */ |
| | | @Service |
| | | public class StaffSalaryDetailServiceImpl extends ServiceImpl<StaffSalaryDetailMapper, StaffSalaryDetail> implements StaffSalaryDetailService { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.domain.SysUserDept; |
| | | import com.ruoyi.project.system.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.project.system.mapper.SysUserMapper; |
| | | import com.ruoyi.staff.mapper.StaffSalaryDetailMapper; |
| | | import com.ruoyi.staff.pojo.SchemeApplicableStaff; |
| | | import com.ruoyi.staff.pojo.StaffSalaryDetail; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.ruoyi.staff.mapper.StaffSalaryMainMapper; |
| | | import com.ruoyi.staff.service.StaffSalaryDetailService; |
| | | import com.ruoyi.staff.service.StaffSalaryMainService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * å工工èµä¸»è¡¨ æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-06 01:22:05 |
| | | */ |
| | | @Service |
| | | public class StaffSalaryMainServiceImpl extends ServiceImpl<StaffSalaryMainMapper, StaffSalaryMain> implements StaffSalaryMainService { |
| | | |
| | | @Autowired |
| | | private StaffSalaryMainMapper staffSalaryMainMapper; |
| | | |
| | | @Autowired |
| | | private StaffSalaryDetailService staffSalaryDetailService; |
| | | |
| | | @Autowired |
| | | private StaffSalaryDetailMapper staffSalaryDetailMapper; |
| | | |
| | | @Autowired |
| | | private SchemeApplicableStaffServiceImpl schemeApplicableStaffService; |
| | | |
| | | @Autowired |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, StaffSalaryMain staffSalaryMain) { |
| | | LambdaQueryWrapper<StaffSalaryMain> staffSalaryMainLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(staffSalaryMain != null){ |
| | | if(StringUtils.isNotEmpty(staffSalaryMain.getSalaryTitle())){ |
| | | staffSalaryMainLambdaQueryWrapper.like(StaffSalaryMain::getSalaryTitle, staffSalaryMain.getSalaryTitle()); |
| | | } |
| | | if(StringUtils.isNotEmpty(staffSalaryMain.getSalaryMonth())){ |
| | | staffSalaryMainLambdaQueryWrapper.like(StaffSalaryMain::getSalaryMonth, staffSalaryMain.getSalaryMonth()); |
| | | } |
| | | if(staffSalaryMain.getStatus() != null){ |
| | | staffSalaryMainLambdaQueryWrapper.eq(StaffSalaryMain::getStatus, staffSalaryMain.getStatus()); |
| | | } |
| | | } |
| | | Page<StaffSalaryMain> page1 = staffSalaryMainMapper.selectPage(page, staffSalaryMainLambdaQueryWrapper); |
| | | page1.getRecords().forEach(main -> { |
| | | List<StaffSalaryDetail> staffSalaryDetailList = staffSalaryDetailMapper.selectList(new LambdaQueryWrapper<StaffSalaryDetail>().eq(StaffSalaryDetail::getMainId, main.getId())); |
| | | main.setStaffSalaryDetailList(staffSalaryDetailList); |
| | | }); |
| | | return AjaxResult.success(page1); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult add(StaffSalaryMain staffSalaryMain) { |
| | | staffSalaryMainMapper.insert(staffSalaryMain); |
| | | staffSalaryMain.getStaffSalaryDetailList().forEach(detail -> { |
| | | detail.setMainId(staffSalaryMain.getId()); |
| | | }); |
| | | staffSalaryDetailService.saveBatch(staffSalaryMain.getStaffSalaryDetailList()); |
| | | return AjaxResult.success("æ°å¢æå"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateStaffSalaryMain(StaffSalaryMain staffSalaryMain) { |
| | | if(staffSalaryMain == null){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | } |
| | | StaffSalaryMain staffSalaryMain1 = staffSalaryMainMapper.selectById(staffSalaryMain.getId()); |
| | | if(staffSalaryMain1 == null){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | } |
| | | // å¾
å®¡æ ¸ä¸å¯ç¼è¾ |
| | | if(staffSalaryMain1.getStatus() > 2){ |
| | | return AjaxResult.error("å¾
å®¡æ ¸ä¸å¯ç¼è¾"); |
| | | } |
| | | staffSalaryMainMapper.updateById(staffSalaryMain); |
| | | staffSalaryDetailMapper.delete(new LambdaQueryWrapper<StaffSalaryDetail>().eq(StaffSalaryDetail::getMainId, staffSalaryMain.getId())); |
| | | staffSalaryMain.getStaffSalaryDetailList().forEach(detail -> { |
| | | detail.setMainId(staffSalaryMain.getId()); |
| | | }); |
| | | staffSalaryDetailService.saveBatch(staffSalaryMain.getStaffSalaryDetailList()); |
| | | return AjaxResult.success("ä¿®æ¹æå"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult delete(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | } |
| | | staffSalaryMainMapper.deleteBatchIds(ids); |
| | | staffSalaryDetailMapper.delete(new LambdaQueryWrapper<StaffSalaryDetail>().in(StaffSalaryDetail::getMainId, ids)); |
| | | return AjaxResult.success("å 餿å"); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult calculateSalary(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | } |
| | | List<Map<String, Object>> longs = setSchemeApplicableStaffUserInfo(ids); // éè¿é¨é¨idsè·åç¨æ·ä¿¡æ¯ |
| | | if(CollectionUtils.isEmpty(longs)){ |
| | | return AjaxResult.error("æ åå·¥"); |
| | | } |
| | | for (Map<String, Object> id : longs) { |
| | | schemeApplicableStaffService.calculateByEmployeeId((Integer) id.get("id"),id); |
| | | } |
| | | return AjaxResult.success(longs); |
| | | } |
| | | |
| | | public List<Map<String, Object>> setSchemeApplicableStaffUserInfo(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return new ArrayList<>(); |
| | | } |
| | | // éè¿é¨é¨è·å人åid |
| | | return sysUserDeptMapper.setSchemeApplicableStaffUserInfo(ids); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.staff.task; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.staff.dto.PerformanceShiftAddDto; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceLocationConfigMapper; |
| | | import com.ruoyi.staff.mapper.PersonalShiftMapper; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceLocationConfig; |
| | | import com.ruoyi.staff.pojo.PersonalAttendanceRecords; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.service.PersonalAttendanceRecordsService; |
| | | import com.ruoyi.staff.mapper.PersonalAttendanceRecordsMapper; |
| | | import com.ruoyi.staff.service.PersonalShiftService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.LocalTime; |
| | | import java.time.ZoneId; |
| | | import java.time.temporal.TemporalAdjusters; |
| | | import java.time.temporal.WeekFields; |
| | | import java.util.List; |
| | | import java.util.Locale; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 个人èå¤è®°å½å®æ¶ä»»å¡ |
| | |
| | | |
| | | @Autowired |
| | | private PersonalAttendanceRecordsService personalAttendanceRecordsService; |
| | | |
| | | @Autowired |
| | | private PersonalAttendanceLocationConfigMapper personalAttendanceLocationConfigMapper; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @Autowired |
| | | private PersonalShiftService personalShiftService; |
| | | |
| | | /** |
| | | * æ¯å¤©åæ¨çææ¨æ¥ç缺å¤è®°å½ |
| | |
| | | log.error("çææ¨æ¥ç¼ºå¤è®°å½ä»»å¡æ§è¡å¤±è´¥ï¼{}", e.getMessage(), e); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 宿¶ä»»å¡,æ¯ä¸ªæ1å·ç00:00:00ç»ä¸ä¸ä¸ªææç |
| | | * ç»æ¯ä¸ªäººé½è¿è¡æç(é»è®¤æ©ç) |
| | | */ |
| | | @Scheduled(cron = "0 10 0 1 * ?") |
| | | private void timerCreateSchedule() { |
| | | log.info("å¼å§ç»æ¯ä¸ªäººè¿è¡æç,é»è®¤æ©ç======start"); |
| | | PerformanceShiftAddDto performanceShiftAddDto = new PerformanceShiftAddDto(); |
| | | //æ¥è¯¢ææç次(æå¡è§å) |
| | | List<PersonalAttendanceLocationConfig> personalAttendanceLocationConfigs = personalAttendanceLocationConfigMapper.selectList(null); |
| | | if (CollectionUtil.isEmpty(personalAttendanceLocationConfigs)){ |
| | | return; |
| | | } |
| | | performanceShiftAddDto.setPersonalAttendanceLocationConfigId(personalAttendanceLocationConfigs.get(0).getId()); |
| | | //å¨è人å |
| | | List<StaffOnJob> staffOnJobs = staffOnJobMapper.selectList(Wrappers.<StaffOnJob>lambdaQuery().eq(StaffOnJob::getStaffState, 1)); |
| | | if (CollectionUtil.isEmpty(staffOnJobs)){ |
| | | return; |
| | | } |
| | | String userIds = staffOnJobs.stream().map(user -> user.getId().toString()).distinct().collect(Collectors.joining(",")); |
| | | performanceShiftAddDto.setStaffOnJobId(userIds); |
| | | //卿¬¡--å½æææ |
| | | // è·åå½åæ¥æ |
| | | LocalDate today = LocalDate.now(ZoneId.of(ZoneId.SHORT_IDS.get("CTT"))).plusMonths(1); |
| | | // è·åæ¬æç第ä¸å¤©åæåä¸å¤© |
| | | LocalDate firstDayOfMonth = today.with(TemporalAdjusters.firstDayOfMonth()); |
| | | LocalDate lastDayOfMonth = today.with(TemporalAdjusters.lastDayOfMonth()); |
| | | // è·åå¨å段信æ¯ï¼æ ¹æ®åºåè®¾ç½®ï¼ |
| | | WeekFields weekFields = WeekFields.of(Locale.getDefault()); |
| | | // è·åæ¬æç¬¬ä¸å¤©çå¨ä¸ |
| | | LocalDate startOfWeek = firstDayOfMonth.with(TemporalAdjusters.previousOrSame(weekFields.getFirstDayOfWeek())); |
| | | // éåæ¬æææå¤©æ°ï¼æ¾åºæ¯å¨ç第ä¸å¤©åæåä¸å¤© |
| | | LocalDate endOfWeek; |
| | | while (startOfWeek.isBefore(firstDayOfMonth.plusMonths(1))) { |
| | | endOfWeek = startOfWeek.plusDays(6); |
| | | LocalDateTime startDateTime = LocalDateTime.of(startOfWeek, LocalTime.MIDNIGHT); |
| | | LocalDateTime endDateTime = LocalDateTime.of(endOfWeek, LocalTime.MIDNIGHT); |
| | | log.info("Week starts on {} and ends on {}", startDateTime, endDateTime); |
| | | performanceShiftAddDto.setStartWeek(startDateTime); |
| | | performanceShiftAddDto.setEndWeek(endDateTime); |
| | | personalShiftService.performanceShiftAdd(performanceShiftAddDto); |
| | | startOfWeek = startOfWeek.plusWeeks(1); |
| | | } |
| | | log.info("æçç»æ======end"); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.utils; |
| | | |
| | | import com.fasterxml.jackson.core.JsonGenerationException; |
| | | import com.fasterxml.jackson.core.JsonParseException; |
| | | import com.fasterxml.jackson.databind.JsonMappingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.ObjectWriter; |
| | | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.OutputStream; |
| | | |
| | | /** |
| | | * JSONè§£æå¤ç |
| | | * |
| | | * @author zss |
| | | */ |
| | | @Component |
| | | public class JackSonUtil { |
| | | private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); |
| | | private static final ObjectWriter OBJECT_WRITER = OBJECT_MAPPER.writerWithDefaultPrettyPrinter(); |
| | | |
| | | public static void marshal(File file, Object value) throws Exception { |
| | | try { |
| | | OBJECT_WRITER.writeValue(file, value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static void marshal(OutputStream os, Object value) throws Exception { |
| | | try { |
| | | OBJECT_WRITER.writeValue(os, value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static String marshal(Object value) throws Exception { |
| | | try { |
| | | return OBJECT_WRITER.writeValueAsString(value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static byte[] marshalBytes(Object value) throws Exception { |
| | | try { |
| | | return OBJECT_WRITER.writeValueAsBytes(value); |
| | | } catch (JsonGenerationException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static <T> T unmarshal(File file, Class<T> valueType) throws Exception { |
| | | try { |
| | | return OBJECT_MAPPER.readValue(file, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static <T> T unmarshal(InputStream is, Class<T> valueType) throws Exception { |
| | | try { |
| | | return OBJECT_MAPPER.readValue(is, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å符串转对象 |
| | | * @param str |
| | | * @param valueType |
| | | * @return |
| | | * @param <T> |
| | | * @throws Exception |
| | | */ |
| | | public static <T> T unmarshal(String str, Class<T> valueType) throws Exception { |
| | | try { |
| | | OBJECT_MAPPER.registerModule(new JavaTimeModule()); |
| | | return OBJECT_MAPPER.readValue(str, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | |
| | | public static <T> T unmarshal(byte[] bytes, Class<T> valueType) throws Exception { |
| | | try { |
| | | if (bytes == null) { |
| | | bytes = new byte[0]; |
| | | } |
| | | return OBJECT_MAPPER.readValue(bytes, 0, bytes.length, valueType); |
| | | } catch (JsonParseException e) { |
| | | throw new Exception(e); |
| | | } catch (JsonMappingException e) { |
| | | throw new Exception(e); |
| | | } catch (IOException e) { |
| | | throw new Exception(e); |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.utils; |
| | | |
| | | import com.alibaba.excel.write.metadata.style.WriteCellStyle; |
| | | import com.alibaba.excel.write.metadata.style.WriteFont; |
| | | import org.apache.poi.ss.usermodel.BorderStyle; |
| | | import org.apache.poi.ss.usermodel.FillPatternType; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.VerticalAlignment; |
| | | |
| | | public class StyleMonthUtils { |
| | | /** |
| | | * æ 颿 ·å¼ |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getHeadStyle(){ |
| | | // 头ççç¥ |
| | | WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
| | | // èæ¯é¢è² |
| | | // headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex()); |
| | | // headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // åä½ |
| | | WriteFont headWriteFont = new WriteFont(); |
| | | headWriteFont.setFontName("ç线");//设置åä½åå |
| | | headWriteFont.setFontHeightInPoints((short)9);//设置åä½å¤§å° |
| | | headWriteFont.setBold(true);//åä½å ç² |
| | | headWriteFont.setColor((short) 0); |
| | | headWriteCellStyle.setWriteFont(headWriteFont); //卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | // æ ·å¼ |
| | | headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | headWriteCellStyle.setBottomBorderColor((short) 0);//设置åºè¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | headWriteCellStyle.setLeftBorderColor((short) 0);//设置左边æ¡é¢è²; |
| | | headWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | headWriteCellStyle.setRightBorderColor((short) 0);//设置å³è¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | headWriteCellStyle.setTopBorderColor((short) 0); //设置顶边æ¡é¢è²; |
| | | |
| | | headWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);//设置水平对é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); //设置åç´å¯¹é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return headWriteCellStyle; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å
å®¹æ ·å¼ |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getContentStyle(){ |
| | | // å
容ççç¥ |
| | | WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
| | | |
| | | // è¿ééè¦æå® FillPatternType 为FillPatternType.SOLID_FOREGROUND ä¸ç¶æ æ³æ¾ç¤ºèæ¯é¢è².头é»è®¤äº FillPatternTypeæä»¥å¯ä»¥ä¸æå® |
| | | // contentWriteCellStyle.setFillForegroundColor(IndexedColors.LIGHT_GREEN.getIndex()); |
| | | contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // 设置åä½ |
| | | WriteFont contentWriteFont = new WriteFont(); |
| | | contentWriteFont.setFontHeightInPoints((short) 10);//设置åä½å¤§å° |
| | | contentWriteFont.setFontName("ç线"); //设置åä½åå |
| | | contentWriteCellStyle.setWriteFont(contentWriteFont);//卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | //è®¾ç½®æ ·å¼; |
| | | contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | contentWriteCellStyle.setBottomBorderColor((short) 0);//设置åºè¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | contentWriteCellStyle.setRightBorderColor((short) 0);//设置å³è¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边æ¡é¢è²; |
| | | |
| | | contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// æ°´å¹³å±
ä¸ |
| | | contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// åç´å±
ä¸ |
| | | contentWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | // contentWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return contentWriteCellStyle; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.utils; |
| | | |
| | | import com.alibaba.excel.write.metadata.style.WriteCellStyle; |
| | | import com.alibaba.excel.write.metadata.style.WriteFont; |
| | | import org.apache.poi.ss.usermodel.BorderStyle; |
| | | import org.apache.poi.ss.usermodel.FillPatternType; |
| | | import org.apache.poi.ss.usermodel.HorizontalAlignment; |
| | | import org.apache.poi.ss.usermodel.VerticalAlignment; |
| | | |
| | | public class StyleYearUtils { |
| | | /** |
| | | * æ 颿 ·å¼ |
| | | * |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getHeadStyle() { |
| | | // 头ççç¥ |
| | | WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
| | | // èæ¯é¢è² |
| | | // headWriteCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex()); |
| | | headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // åä½ |
| | | WriteFont headWriteFont = new WriteFont(); |
| | | headWriteFont.setFontName("仿å®");//设置åä½åå |
| | | headWriteFont.setFontHeightInPoints((short) 9);//设置åä½å¤§å° |
| | | headWriteFont.setBold(true);//åä½å ç² |
| | | headWriteFont.setColor((short) 1); |
| | | headWriteCellStyle.setWriteFont(headWriteFont); //卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | // æ ·å¼ |
| | | headWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | headWriteCellStyle.setBottomBorderColor((short) 1);//设置åºè¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | headWriteCellStyle.setLeftBorderColor((short) 1);//设置左边æ¡é¢è²; |
| | | headWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | headWriteCellStyle.setRightBorderColor((short) 1);//设置å³è¾¹æ¡é¢è²; |
| | | headWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | headWriteCellStyle.setTopBorderColor((short) 1); //设置顶边æ¡é¢è²; |
| | | |
| | | headWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);//设置水平对é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); //设置åç´å¯¹é½çæ ·å¼ä¸ºå±
ä¸å¯¹é½; |
| | | headWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return headWriteCellStyle; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å
å®¹æ ·å¼ |
| | | * |
| | | * @return |
| | | */ |
| | | public static WriteCellStyle getContentStyle() { |
| | | // å
容ççç¥ |
| | | WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
| | | |
| | | // è¿ééè¦æå® FillPatternType 为FillPatternType.SOLID_FOREGROUND ä¸ç¶æ æ³æ¾ç¤ºèæ¯é¢è².头é»è®¤äº FillPatternTypeæä»¥å¯ä»¥ä¸æå® |
| | | // contentWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); |
| | | contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND); |
| | | |
| | | // 设置åä½ |
| | | WriteFont contentWriteFont = new WriteFont(); |
| | | contentWriteFont.setFontHeightInPoints((short) 9);//设置åä½å¤§å° |
| | | contentWriteFont.setFontName("仿å®"); //设置åä½åå |
| | | contentWriteCellStyle.setWriteFont(contentWriteFont);//卿 ·å¼ç¨åºç¨è®¾ç½®çåä½; |
| | | |
| | | //è®¾ç½®æ ·å¼; |
| | | contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置åºè¾¹æ¡; |
| | | contentWriteCellStyle.setBottomBorderColor((short) 0);//设置åºè¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderLeft(BorderStyle.THIN); //设置左边æ¡; |
| | | contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置å³è¾¹æ¡; |
| | | contentWriteCellStyle.setRightBorderColor((short) 0);//设置å³è¾¹æ¡é¢è²; |
| | | contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边æ¡; |
| | | contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边æ¡é¢è²; |
| | | |
| | | contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// æ°´å¹³å±
ä¸ |
| | | contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// åç´å±
ä¸ |
| | | contentWriteCellStyle.setWrapped(false); //设置èªå¨æ¢è¡; |
| | | |
| | | // contentWriteCellStyle.setShrinkToFit(true);//è®¾ç½®ææ¬æ¶ç¼©è³åé |
| | | |
| | | return contentWriteCellStyle; |
| | | } |
| | | |
| | | } |
| | |
| | | t2.tax_exclusive_total_price, |
| | | t3.inbound_num as quantityStock |
| | | from purchase_ledger t1 |
| | | left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id |
| | | left join sales_ledger_product t2 on t1.id = t2.sales_ledger_id and slp.type = 2 |
| | | left join procurement_record_storage t3 on t2.id = t3.sales_ledger_product_id |
| | | where t1.purchase_contract_number = #{req.purchaseContractNumber} |
| | | <if test="req.id != null and req.id != ''"> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.procurementrecord.mapper.ReturnManagementMapper"> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.procurementrecord.pojo.ReturnManagement"> |
| | | select * from return_management |
| | | <select id="listPage" resultType="com.ruoyi.procurementrecord.dto.ReturnManagementDto"> |
| | | select rm.*, |
| | | c.customer_name, |
| | | si.shipping_no, |
| | | sl.project_name, |
| | | sl.sales_contract_no, |
| | | sl.salesman |
| | | from return_management rm |
| | | left join shipping_info si on rm.shipping_id = si.id |
| | | left join customer c on rm.customer_id = c.id |
| | | left join sales_ledger sl on si.sales_ledger_id = sl.id |
| | | <where> |
| | | <if test="req.returnNo != null and req.returnNo != ''"> |
| | | and return_no like concat('%',#{req.returnNo},'%') |
| | | and rm.return_no like concat('%',#{req.returnNo},'%') |
| | | </if> |
| | | <if test="req.returnType != null and req.returnType != ''"> |
| | | and return_type = #{req.returnType} |
| | | <if test="req.customerName != null and req.customerName != ''"> |
| | | and c.customer_name like concat('%',#{req.customerName},'%') |
| | | </if> |
| | | <if test="req.projectName != null and req.projectName != ''"> |
| | | and sl.project_name like concat('%',#{req.projectName},'%') |
| | | </if> |
| | | <if test="req.salesman != null and req.salesman != ''"> |
| | | and sl.salesman like concat('%',#{req.salesman},'%') |
| | | </if> |
| | | <if test="req.shippingNo != null and req.shippingNo != ''"> |
| | | and rm.shipping_no like concat('%',#{req.shippingNo},'%') |
| | | </if> |
| | | <if test="req.projectStage != null and req.projectStage != ''"> |
| | | and rm.project_stage like concat('%',#{req.projectStage},'%') |
| | | </if> |
| | | <if test="req.maker != null and req.maker != ''"> |
| | | and rm.maker like concat('%',#{req.maker},'%') |
| | | </if> |
| | | <if test="req.salesContractNo != null and req.salesContractNo != ''"> |
| | | and sl.sales_contract_no like concat('%',#{req.salesContractNo},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.procurementrecord.dto.ReturnManagementDto"> |
| | | select rm.*, |
| | | c.customer_name, |
| | | si.shipping_no, |
| | | sl.project_name, |
| | | sl.sales_contract_no, |
| | | sl.salesman |
| | | from return_management rm |
| | | left join shipping_info si on rm.shipping_id = si.id |
| | | left join customer c on rm.customer_id = c.id |
| | | left join sales_ledger sl on si.sales_ledger_id = sl.id |
| | | where rm.id = #{id} |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.procurementrecord.mapper.ReturnSaleProductMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.procurementrecord.pojo.ReturnSaleProduct"> |
| | | <id column="id" property="id" /> |
| | | <result column="return_management_id" property="returnManagementId" /> |
| | | <result column="return_sale_ledger_product_id" property="returnSaleLedgerProductId" /> |
| | | <result column="num" property="num" /> |
| | | <result column="status" property="status" /> |
| | | </resultMap> |
| | | <select id="listReturnSaleProductDto" resultType="com.ruoyi.procurementrecord.dto.ReturnSaleProductDto"> |
| | | SELECT slp.product_category as product_name, |
| | | slp.specification_model as model, |
| | | rsp.*, |
| | | GREATEST(slp.quantity - COALESCE(rs.total_return_num, 0), 0) AS un_quantity, |
| | | COALESCE(rs.total_return_num, 0) AS total_return_num |
| | | FROM return_sale_product rsp |
| | | LEFT JOIN return_management rm ON rm.id = rsp.return_management_id |
| | | LEFT JOIN shipping_info si ON si.id = rm.shipping_id |
| | | LEFT JOIN sales_ledger_product slp ON si.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | LEFT JOIN (SELECT return_sale_ledger_product_id, |
| | | |
| | | SUM(num) AS total_return_num |
| | | FROM return_sale_product |
| | | WHERE 1 = 1 and return_management_id != #{returnManagementId} |
| | | GROUP BY return_sale_ledger_product_id) rs ON rs.return_sale_ledger_product_id = slp.id |
| | | where rm.id =#{returnManagementId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | ) shipping_status_counts ON sl.id = shipping_status_counts.sales_ledger_id |
| | | left join product_model pm on po.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id |
| | | left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id and slp.type = 1 |
| | | left join product_process_route ppr on po.id = ppr.product_order_id |
| | | left join product_bom pb on pb.id = ppr.bom_id |
| | | <where> |
| | |
| | | FROM |
| | | sales_ledger_production_accounting t4 |
| | | LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and slp.type = 1 |
| | | <where> |
| | | t3.type = 1 |
| | | <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' "> |
| | |
| | | GROUP BY DATE(ppout.create_time) |
| | | ORDER BY DATE(ppout.create_time); |
| | | </select> |
| | | <select id="getByUserId" resultType="com.ruoyi.production.dto.UserAccountDto"> |
| | | select |
| | | slpa.scheduling_user_id as user_id, |
| | | pp.type, |
| | | sum(case when pp.type = 0 then slpa.work_hours else 0 end) as account, |
| | | sum(case when pp.type = 1 then slpa.work_hours else 0 end) as accountBalance |
| | | from sales_ledger_production_accounting slpa |
| | | left join product_process pp on pp.name = slpa.process |
| | | where slpa.scheduling_user_id = #{ew.userId} |
| | | and slpa.scheduling_date like concat(#{ew.date}, '%') |
| | | group by slpa.scheduling_user_id |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | FROM |
| | | sales_ledger_scheduling T2 |
| | | LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id |
| | | left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id |
| | | left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id and slp.type = 1 |
| | | <where> |
| | | t3.type = 1 |
| | | <if test="salesLedgerDto.status != null and salesLedgerDto.status != '' "> |
| | |
| | | FROM |
| | | sales_ledger_work t4 |
| | | LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id |
| | | left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id and slp.type = 1 |
| | | left join sales_ledger_scheduling t2 on t4.sales_ledger_scheduling_id = t2.id |
| | | <where> |
| | | t3.type = 1 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.projectManagement.mapper.ContractInfoMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.projectManagement.pojo.ContractInfo"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="sex" column="sex" jdbcType="VARCHAR"/> |
| | | <result property="birthday" column="birthday" jdbcType="VARCHAR"/> |
| | | <result property="department" column="department" jdbcType="VARCHAR"/> |
| | | <result property="job" column="job" jdbcType="VARCHAR"/> |
| | | <result property="phoneNumber" column="phone_number" jdbcType="VARCHAR"/> |
| | | <result property="email" column="email" jdbcType="VARCHAR"/> |
| | | <result property="qq" column="qq" jdbcType="VARCHAR"/> |
| | | <result property="lineaFissa" column="linea_fissa" jdbcType="VARCHAR"/> |
| | | <result property="wx" column="wx" jdbcType="VARCHAR"/> |
| | | <result property="origineEtnica" column="origine_etnica" jdbcType="VARCHAR"/> |
| | | <result property="rappresentanteLegale" column="rappresentante_legale" jdbcType="VARCHAR"/> |
| | | <result property="projectManagementInfoId" column="project_management_info_id" jdbcType="BIGINT"/> |
| | | <result property="isDelete" column="is_delete" jdbcType="INTEGER"/> |
| | | <result property="createUser" column="create_user" jdbcType="BIGINT"/> |
| | | <result property="updateUser" column="update_user" jdbcType="BIGINT"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,name,sex, |
| | | birthday,department,job, |
| | | phone_number,email,qq, |
| | | linea_fissa,wx,origine_etnica, |
| | | rappresentante_legale,project_management_info_id,is_delete, |
| | | create_user,update_user,create_time, |
| | | update_time |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.projectManagement.mapper.InfoMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.projectManagement.pojo.Info"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="no" column="no" jdbcType="VARCHAR"/> |
| | | <result property="title" column="title" jdbcType="VARCHAR"/> |
| | | <result property="clientId" column="client_id" jdbcType="BIGINT"/> |
| | | <result property="clientName" column="client_name" jdbcType="VARCHAR"/> |
| | | <result property="projectManagementInfoParentId" column="project_management_info_parent_id" jdbcType="BIGINT"/> |
| | | <result property="establishTime" column="establish_time" jdbcType="TIMESTAMP"/> |
| | | <result property="projectManagementPlanId" column="project_management_plan_id" jdbcType="BIGINT"/> |
| | | <result property="source" column="source" jdbcType="VARCHAR"/> |
| | | <result property="managerId" column="manager_id" jdbcType="BIGINT"/> |
| | | <result property="managerName" column="manager_name" jdbcType="VARCHAR"/> |
| | | <result property="salesmanId" column="salesman_id" jdbcType="BIGINT"/> |
| | | <result property="salesmanName" column="salesman_name" jdbcType="VARCHAR"/> |
| | | <result property="isDelete" column="is_delete" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="create_user" jdbcType="INTEGER"/> |
| | | <result property="updateUser" column="update_user" jdbcType="INTEGER"/> |
| | | <result property="planStartTime" column="plan_start_time" jdbcType="TIMESTAMP"/> |
| | | <result property="planEndTime" column="plan_end_time" jdbcType="TIMESTAMP"/> |
| | | <result property="actualStartTime" column="actual_start_time" jdbcType="TIMESTAMP"/> |
| | | <result property="actualEndTime" column="actual_end_time" jdbcType="TIMESTAMP"/> |
| | | <result property="status" column="status" jdbcType="INTEGER"/> |
| | | <result property="departmentId" column="department_id" jdbcType="BIGINT"/> |
| | | <result property="departmentName" column="department_name" jdbcType="VARCHAR"/> |
| | | <result property="orderDate" column="order_date" jdbcType="TIMESTAMP"/> |
| | | <result property="orderAmount" column="order_amount" jdbcType="VARCHAR"/> |
| | | <result property="remark" column="remark" jdbcType="VARCHAR"/> |
| | | <result property="attachment" column="attachment" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,no,title, |
| | | client_id,client_name,project_management_info_parent_id, |
| | | establish_time,project_management_plan_id,source, |
| | | manager_id,manager_name,salesman_id, |
| | | salesman_name,is_delete,create_time, |
| | | update_time,create_user,update_user, |
| | | plan_start_time,plan_end_time,actual_start_time, |
| | | actual_end_time,status,department_id, |
| | | department_name,order_date,order_amount, |
| | | remark,attachment |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.projectManagement.mapper.PlanMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.projectManagement.pojo.Plan"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="description" column="description" jdbcType="VARCHAR"/> |
| | | <result property="attachment" column="attachment" jdbcType="VARCHAR"/> |
| | | <result property="isDelete" column="is_delete" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="create_user" jdbcType="VARCHAR"/> |
| | | <result property="updateUser" column="update_user" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,name,description, |
| | | attachment,is_delete,create_time, |
| | | update_time,create_user,update_user |
| | | </sql> |
| | | |
| | | <select id="selectPlanPage" resultMap="BaseResultMap"> |
| | | select t1.* |
| | | from project_management_plan as t1 |
| | | where t1.is_delete = 0 |
| | | order by t1.create_time desc |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.projectManagement.mapper.PlanNodeMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.projectManagement.pojo.PlanNode"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="projectManagementPlanId" column="project_management_plan_id" jdbcType="BIGINT"/> |
| | | <result property="sort" column="sort" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="leaderId" column="leader_id" jdbcType="BIGINT"/> |
| | | <result property="leaderName" column="leader_name" jdbcType="VARCHAR"/> |
| | | <result property="estimatedDuration" column="estimated_duration" jdbcType="INTEGER"/> |
| | | <result property="hourlyRate" column="hourly_rate" jdbcType="VARCHAR"/> |
| | | <result property="workContent" column="work_content" jdbcType="VARCHAR"/> |
| | | <result property="isDelete" column="is_delete" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="create_user" jdbcType="VARCHAR"/> |
| | | <result property="updateUser" column="update_user" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,project_management_plan_id,sort, |
| | | name,leader_id,leader_name, |
| | | estimated_duration,hourly_rate,work_content, |
| | | is_delete,create_time,update_time, |
| | | create_user,update_user |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.projectManagement.mapper.ShippingAddressMapper"> |
| | | |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.projectManagement.pojo.ShippingAddress"> |
| | | <id property="id" column="id" jdbcType="BIGINT"/> |
| | | <result property="consignee" column="consignee" jdbcType="VARCHAR"/> |
| | | <result property="contract" column="contract" jdbcType="VARCHAR"/> |
| | | <result property="address" column="address" jdbcType="VARCHAR"/> |
| | | <result property="isDelete" column="is_delete" jdbcType="INTEGER"/> |
| | | <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/> |
| | | <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/> |
| | | <result property="createUser" column="create_user" jdbcType="BIGINT"/> |
| | | <result property="updateUser" column="update_user" jdbcType="BIGINT"/> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List"> |
| | | id,consignee,contract, |
| | | address,is_delete,create_time, |
| | | update_time,create_user,update_user |
| | | </sql> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.purchase.pojo.PurchaseReturnOrders"> |
| | | <id column="id" property="id" /> |
| | | <result column="no" property="no" /> |
| | | <result column="return_type" property="returnType" /> |
| | | <result column="supplier_id" property="supplierId" /> |
| | | <result column="project_id" property="projectId" /> |
| | | <result column="project_phase" property="projectPhase" /> |
| | | <result column="prepared_at" property="preparedAt" /> |
| | | <result column="prepared_user_id" property="preparedUserId" /> |
| | | <result column="return_user_id" property="returnUserId" /> |
| | | <result column="purchase_ledger_id" property="purchaseLedgerId" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | </resultMap> |
| | | |
| | | <select id="listPage" resultType="com.ruoyi.purchase.vo.PurchaseReturnOrderVo"> |
| | | SELECT |
| | | pro.*, |
| | | sm.supplier_name as supplierName, |
| | | pl.purchase_contract_number as purchaseContractNumber, |
| | | su.user_name as returnUserName, |
| | | su1.user_name as createUserName |
| | | FROM purchase_return_orders pro |
| | | LEFT JOIN supplier_manage sm ON pro.supplier_id = sm.id |
| | | LEFT JOIN purchase_ledger pl ON pl.id = pro.purchase_ledger_id |
| | | LEFT JOIN sys_user su ON su.user_id = pro.return_user_id |
| | | LEFT JOIN sys_user su1 ON su1.user_id = pro.prepared_user_id |
| | | where 1=1 |
| | | <if test="params.no != null and params.no != '' "> |
| | | AND pro.no LIKE CONCAT('%',#{params.no},'%') |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | FROM invoice_ledger_file |
| | | GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | SUM(receipt_payment_amount) AS receipt_payment_amount_total, |
| | |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1 |
| | | LEFT JOIN ( |
| | | SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP |
| | | BY invoice_ledger_id |
| | |
| | | GROUP_CONCAT( name ORDER BY id ASC SEPARATOR ' | ') AS invoiceFileName |
| | | FROM invoice_ledger_file GROUP BY invoice_ledger_id |
| | | ) T4 ON T4.invoice_ledger_id = T1.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id |
| | | LEFT JOIN sales_ledger_product T5 ON T2.sales_ledger_product_id = T5.id and slp.type = 1 |
| | | LEFT JOIN ( |
| | | SELECT SUM(receipt_payment_amount) AS receipt_payment_amount_total,invoice_ledger_id FROM receipt_payment GROUP |
| | | BY invoice_ledger_id |
| | |
| | | left join production_product_main ppm on qi.product_main_id = ppm.id |
| | | left join product_work_order pwo on ppm.work_order_id = pwo.id |
| | | left join product_order po on pwo.product_order_id = po.id |
| | | left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id |
| | | left join sales_ledger_product slp on po.sale_ledger_product_id = slp.id and slp.type = 1 |
| | | where qi.product_main_id = #{productMainId} |
| | | |
| | | |
| | |
| | | p.product_name, |
| | | ps.unit_quantity * slp.quantity AS single_quantity |
| | | FROM sales_ledger sl |
| | | LEFT JOIN sales_ledger_product slp ON slp.sales_ledger_id = sl.id |
| | | LEFT JOIN sales_ledger_product slp ON slp.sales_ledger_id = sl.id and slp.type = 1 |
| | | LEFT JOIN product_model pm ON pm.id = slp.product_model_id |
| | | LEFT JOIN product_bom pb ON pb.product_model_id = pm.id |
| | | LEFT JOIN product_structure ps ON pb.id = ps.bom_id |
| | |
| | | FROM shipment_approval sa |
| | | LEFT JOIN shipping_info si ON sa.shipping_info_id = si.id |
| | | LEFT JOIN sales_ledger sl ON sa.sales_ledger_id = sl.id |
| | | LEFT JOIN sales_ledger_product slp ON sa.sales_ledger_product_id = slp.id |
| | | LEFT JOIN sales_ledger_product slp ON sa.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | LEFT JOIN sys_user T2 ON sl.entry_person = T2.user_id |
| | | <where> |
| | | 1=1 |
| | |
| | | sl.customer_name |
| | | FROM shipping_info s |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id |
| | | LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | left join product_model pm on slp.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | | WHERE 1=1 |
| | |
| | | FROM shipping_info s |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | </select> |
| | | <select id="getReturnManagementDtoById" resultType="com.ruoyi.sales.dto.SalesLedgerProductDto"> |
| | | SELECT |
| | | slp.*, |
| | | GREATEST(slp.quantity - COALESCE(rs.total_return_num, 0), 0) AS un_quantity, |
| | | COALESCE(rs.total_return_num, 0) AS total_return_num |
| | | FROM shipping_info si |
| | | LEFT JOIN sales_ledger_product slp ON si.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | LEFT JOIN ( |
| | | SELECT |
| | | return_sale_ledger_product_id, |
| | | SUM(num) AS total_return_num |
| | | FROM return_sale_product rsp |
| | | left join return_management rm on rm.id = rsp.return_management_id |
| | | left join shipping_info si on si.id = rm.shipping_id |
| | | WHERE 1=1 |
| | | GROUP BY return_sale_ledger_product_id |
| | | ) rs ON rs.return_sale_ledger_product_id = slp.id |
| | | <where> |
| | | <if test="shippingId != null"> |
| | | si.id = #{shippingId} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getShippingInfoByCustomerName" resultType="com.ruoyi.sales.pojo.ShippingInfo"> |
| | | select * from shipping_info si |
| | | left join sales_ledger sl on si.sales_ledger_id = sl.id |
| | | where sl.customer_name = #{customerName} |
| | | </select> |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.staff.mapper.BankMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.Bank"> |
| | | <id column="id" property="id" /> |
| | | <result column="bank_name" property="bankName" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.staff.mapper.PersonalShiftMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.PersonalShift"> |
| | | <id column="id" property="id" /> |
| | | <result column="personal_attendance_location_config_id" property="personalAttendanceLocationConfigId" /> |
| | | <result column="staff_on_job_id" property="staffOnJobId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="work_time" property="workTime" /> |
| | | </resultMap> |
| | | <select id="performanceShiftPage" resultType="com.ruoyi.staff.dto.PerformanceShiftMapDto"> |
| | | SELECT |
| | | u.staff_name name, |
| | | GROUP_CONCAT(s.work_time, 'ï¼', IFNULL(palc.shift, ''), 'ï¼', s.id order by s.work_time SEPARATOR ';') AS shift_time, |
| | | u.id user_id |
| | | FROM personal_shift s |
| | | LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id |
| | | LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id |
| | | <where> |
| | | <if test="sysDeptId != null and sysDeptId != ''"> |
| | | and u.sys_dept_id = #{sysDeptId} |
| | | </if> |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.staff_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | </where> |
| | | GROUP BY u.id |
| | | order by s.create_time |
| | | </select> |
| | | |
| | | <select id="performanceShiftYear" resultType="java.util.Map"> |
| | | SELECT |
| | | u.staff_name name, |
| | | u.id user_id, |
| | | u.staff_no account, |
| | | DATE_FORMAT(s.work_time, '%c') work_time, |
| | | GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), 'ï¼', IFNULL(palc.shift, '') order by s.work_time SEPARATOR ';') month_str |
| | | FROM personal_shift s |
| | | LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id |
| | | LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id |
| | | <where> |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.staff_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="sysDeptId != null and sysDeptId != ''"> |
| | | and u.sys_dept_id = #{sysDeptId} |
| | | </if> |
| | | </where> |
| | | GROUP BY u.id |
| | | order by s.create_time |
| | | </select> |
| | | <select id="performanceShiftYearList" resultType="java.util.Map"> |
| | | SELECT |
| | | u.staff_name name, |
| | | s.staff_on_job_id user_id, u.staff_no account, |
| | | DATE_FORMAT(s.work_time, '%c') work_time, |
| | | GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), 'ï¼', IFNULL(palc.shift, '') order by s.work_time SEPARATOR ';') month_str |
| | | FROM personal_shift s |
| | | LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id |
| | | LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id |
| | | <where> |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.staff_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="sysDeptId != null and sysDeptId != ''"> |
| | | and u.sys_dept_id = #{sysDeptId} |
| | | </if> |
| | | </where> |
| | | GROUP BY u.id |
| | | order by s.create_time |
| | | </select> |
| | | <select id="performanceShiftList" resultType="com.ruoyi.staff.dto.PerformanceShiftMapDto"> |
| | | SELECT |
| | | u.staff_name name, |
| | | GROUP_CONCAT(s.work_time, 'ï¼', IFNULL(palc.shift, ''), 'ï¼', s.id order by s.work_time SEPARATOR ';') AS shift_time, u.id user_id |
| | | FROM personal_shift s |
| | | LEFT JOIN staff_on_job u ON u.id = s.staff_on_job_id |
| | | LEFT JOIN personal_attendance_location_config palc ON palc.id = s.personal_attendance_location_config_id |
| | | <where> |
| | | <if test="time != null and time != ''"> |
| | | and DATE_FORMAT(s.work_time, '%Y-%m') = DATE_FORMAT(#{time}, '%Y-%m' ) |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | and u.staff_name like concat('%', #{userName}, '%') |
| | | </if> |
| | | <if test="sysDeptId != null and sysDeptId != ''"> |
| | | and u.sys_dept_id = #{sysDeptId} |
| | | </if> |
| | | </where> |
| | | GROUP BY u.id |
| | | order by s.create_time |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.staff.mapper.SchemeApplicableStaffMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.SchemeApplicableStaff"> |
| | | <id column="id" property="id" /> |
| | | <result column="title" property="title" /> |
| | | <result column="dept_ids" property="deptIds" /> |
| | | <result column="staff_names" property="staffNames" /> |
| | | <result column="staff_ids" property="staffIds" /> |
| | | <result column="insurance_types" property="insuranceTypes" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | </resultMap> |
| | | <!-- åºç¡å段æ¥è¯¢ --> |
| | | <sql id="schemeColumns"> |
| | | id, title, dept_ids, staff_names, staff_ids, |
| | | insurance_types, remark, create_time, update_time, |
| | | create_user, update_user |
| | | </sql> |
| | | |
| | | <!-- æ ¹æ®äººåIDæ¥è¯¢ç¤¾ä¿æ¹æ¡ --> |
| | | <select id="selectSchemeByStaffId" resultType="com.ruoyi.staff.pojo.SchemeApplicableStaff"> |
| | | SELECT |
| | | <include refid="schemeColumns"/> |
| | | FROM |
| | | scheme_applicable_staff |
| | | WHERE |
| | | 1 = 1 |
| | | <!-- æ ¸å¿ï¼å¹é
staff_idsä¸å
å«ç®æ 人åIDçè®°å½ --> |
| | | AND FIND_IN_SET(#{staffId}, staff_ids) |
| | | <!-- å¯éï¼å¢å ææç¶æè¿æ»¤ï¼å¦æè¡¨ä¸æç¶æåæ®µï¼ --> |
| | | <!-- AND status = 1 --> |
| | | ORDER BY |
| | | create_time DESC |
| | | </select> |
| | | |
| | | <!-- æ¥è¯¢æ¹æ¡å¯¹åºçæç» --> |
| | | <select id="selectDetailBySchemeId" resultType="com.ruoyi.staff.pojo.SchemeInsuranceDetail"> |
| | | SELECT |
| | | id, scheme_id, insurance_type, payment_base, |
| | | use_basic_salary, personal_ratio, personal_fixed, |
| | | create_time, update_time, create_user, update_user |
| | | FROM |
| | | scheme_insurance_detail |
| | | WHERE |
| | | scheme_id = #{schemeId} |
| | | </select> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.staff.mapper.StaffSalaryDetailMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.StaffSalaryDetail"> |
| | | <id column="id" property="id" /> |
| | | <result column="main_id" property="mainId" /> |
| | | <result column="staff_on_job_id" property="staffOnJobId" /> |
| | | <result column="staff_name" property="staffName" /> |
| | | <result column="post_name" property="postName" /> |
| | | <result column="dept_name" property="deptName" /> |
| | | <result column="basic_salary" property="basicSalary" /> |
| | | <result column="piece_salary" property="pieceSalary" /> |
| | | <result column="hourly_salary" property="hourlySalary" /> |
| | | <result column="other_income" property="otherIncome" /> |
| | | <result column="social_personal" property="socialPersonal" /> |
| | | <result column="fund_personal" property="fundPersonal" /> |
| | | <result column="other_deduct" property="otherDeduct" /> |
| | | <result column="salary_tax" property="salaryTax" /> |
| | | <result column="gross_salary" property="grossSalary" /> |
| | | <result column="deduct_salary" property="deductSalary" /> |
| | | <result column="net_salary" property="netSalary" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="com.ruoyi.staff.mapper.StaffSalaryMainMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.staff.pojo.StaffSalaryMain"> |
| | | <id column="id" property="id" /> |
| | | <result column="salary_title" property="salaryTitle" /> |
| | | <result column="dept_ids" property="deptIds" /> |
| | | <result column="salary_month" property="salaryMonth" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="status" property="status" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="update_user" property="updateUser" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.project.system.mapper.SysUserDeptMapper"> |
| | | |
| | | <select id="setSchemeApplicableStaffUserInfo" resultType="java.util.Map"> |
| | | SELECT |
| | | T1.id as id, |
| | | T1.staff_no as staffNo, |
| | | T1.staff_name as staffName, |
| | | T2.dept_id as deptId, |
| | | T2.dept_name as deptName |
| | | FROM |
| | | staff_on_job T1 |
| | | LEFT JOIN sys_dept T2 ON T1.sys_dept_id = T2.dept_id |
| | | <where> |
| | | T1.sys_dept_id in<foreach collection="ids" item="id" separator="," close=")" open="(">#{id}</foreach> |
| | | </where> |
| | | GROUP BY |
| | | T1.id |
| | | </select> |
| | | |
| | | <select id="userLoginFacotryList" resultType="com.ruoyi.project.system.domain.vo.SysUserDeptVo"> |
| | | SELECT |
| | | T1.user_id, |