Merge remote-tracking branch 'origin/dev_New' into dev_New
| | |
| | | <artifactId>hutool-all</artifactId>
|
| | | <version>5.8.43</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <groupId>com.fasterxml.jackson.datatype</groupId>
|
| | | <artifactId>jackson-datatype-jsr310</artifactId>
|
| | | </dependency>
|
| | |
|
| | | </dependencies>
|
| | |
|
| | |
| | | private Long businessId; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»å 1-仿¬¾ 2-è¿æ¬¾ |
| | | * ä¸å¡ç±»å 1-仿¬¾ 2-è¿æ¬¾ 3-èªèµåæ¾ |
| | | */ |
| | | private Integer businessType; |
| | | |
| | |
| | | import com.ruoyi.basic.service.CustomerFollowUpService; |
| | | import com.ruoyi.common.vo.SimpleFileVo; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | |
| | | @RequiredArgsConstructor |
| | | public class CustomerFollowUpFileServiceImpl extends ServiceImpl<CustomerFollowUpFileMapper, CustomerFollowUpFile> implements CustomerFollowUpFileService { |
| | | |
| | | private final CustomerFollowUpService customerFollowUpService; |
| | | @Autowired |
| | | @Lazy |
| | | private CustomerFollowUpService customerFollowUpService; |
| | | |
| | | |
| | | @Override |
| | |
| | | if (StrUtil.isNotBlank(attachmentIds)) { |
| | | List<SimpleFileVo> fileVos = Arrays.stream(attachmentIds.split(",")) |
| | | .map(Long::valueOf) |
| | | .map(it->collectMap.getOrDefault(it, (SimpleFileVo) Collections.emptyList())) |
| | | .map(it->collectMap.getOrDefault(it, null)) |
| | | .filter(Objects::nonNull) |
| | | .collect(Collectors.toList()); |
| | | setAttachmentList.accept(t, fileVos); |
| | | } |
| | |
| | | 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; |
| | | |
| | | 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.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.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.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.*; |
| | | |
| | | 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); |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | */ |
| | | void savePlanNode(@NotNull Long planId,@Nullable List<SavePlanNodeVo> savePlanNodeVos); |
| | | |
| | | List<PlanNode> getPlanNodeByPlanId(@NotNull Long planId); |
| | | |
| | | /** |
| | | * å é¤é¡¹ç®ç®¡ç计å |
| | | * @param id |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | private List<PlanNode> getPlanNodeByPlanId(Long planId) { |
| | | @Override |
| | | public List<PlanNode> getPlanNodeByPlanId(Long planId) { |
| | | return planNodeMapper.selectList(new LambdaQueryWrapper<PlanNode>() |
| | | .eq(PlanNode::getIsDelete, 0) |
| | | .eq(PlanNode::getProjectManagementPlanId, planId)); |
| | | .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)); |
| | | .in(PlanNode::getProjectManagementPlanId, planIds).orderByAsc(PlanNode::getSort)); |
| | | } |
| | | |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.beans.factory.annotation.Autowired; |
| | | 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 |
| | | @Transactional(rollbackFor = Exception.class,readOnly = true) |
| | | public class ContractInfoHandleService{ |
| | | |
| | | @Autowired |
| | | private 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 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 com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | |
| | | private Long id; |
| | | @NotBlank |
| | | private String name; |
| | | @NotBlank |
| | | // @NotBlank |
| | | private String description; |
| | | |
| | | private List<String> attachmentIds; |
| | |
| | | @Valid |
| | | private List<SavePlanNodeVo> savePlanNodeList; |
| | | |
| | | |
| | | } |
| | |
| | | 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.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.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.dto.CalculateSalaryDto; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.ruoyi.staff.service.StaffSalaryMainService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @ApiOperation("éè¿é¨é¨idsè·åç¨æ·ä¿¡æ¯è®¡ç®æ¯ä¸ªåå·¥çå·¥èµ") |
| | | @PostMapping("/calculateSalary") |
| | | public AjaxResult calculateSalary(@RequestBody List<Long> ids) { |
| | | return staffSalaryMainService.calculateSalary(ids); |
| | | public AjaxResult calculateSalary(@RequestBody CalculateSalaryDto calculateSalaryDto) { |
| | | return staffSalaryMainService.calculateSalary(calculateSalaryDto); |
| | | } |
| | | |
| | | @PostMapping("/add") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.staff.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author :yys |
| | | * @date : 2026/3/9 11:53 |
| | | */ |
| | | @Data |
| | | public class CalculateSalaryDto { |
| | | |
| | | private List<Long> ids; |
| | | |
| | | private String date; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.staff.dto.CalculateSalaryDto; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | |
| | | |
| | | AjaxResult delete(List<Long> ids); |
| | | |
| | | AjaxResult calculateSalary(List<Long> ids); |
| | | AjaxResult calculateSalary(CalculateSalaryDto calculateSalaryDto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.production.dto.UserAccountDto; |
| | | import com.ruoyi.production.dto.UserProductionAccountingDto; |
| | | import com.ruoyi.production.service.SalesLedgerProductionAccountingService; |
| | | import com.ruoyi.project.system.domain.SysDept; |
| | | import com.ruoyi.project.system.domain.SysUser; |
| | | import com.ruoyi.project.system.domain.SysUserDept; |
| | |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @Autowired |
| | | private SalesLedgerProductionAccountingService salesLedgerProductionAccountingService; |
| | | |
| | | |
| | | @Override |
| | |
| | | * éè¿åå·¥id计ç®ç¤¾ä¿æ¹æ¡ |
| | | * @param id |
| | | */ |
| | | public void calculateByEmployeeId(Integer id,Map<String, Object> map) { |
| | | public void calculateByEmployeeId(Integer id,Map<String, Object> map,String date) { |
| | | // 1. å
¥åæ ¡éª |
| | | if (id == null) { |
| | | return; // æè¿å空åè¡¨ï¼æ ¹æ®ä¸å¡éæ±è°æ´ |
| | |
| | | // 个ç¨éé¢ï¼æ 社ä¿çï¼ |
| | | BigDecimal bigDecimal = TaxCalculator.calculateMonthlyTax(basicSalary, schemeAmount, gjj); |
| | | map.put("salaryTax", bigDecimal); |
| | | // 计æ¶å·¥èµ è®¡ä»¶å·¥èµ |
| | | UserProductionAccountingDto userProductionAccountingDto = new UserProductionAccountingDto(); |
| | | userProductionAccountingDto.setUserId(getUidByStaffId(staffId)); |
| | | userProductionAccountingDto.setDate(date); |
| | | UserAccountDto byUserId = salesLedgerProductionAccountingService.getByUserId(userProductionAccountingDto); |
| | | if(byUserId != null){ |
| | | map.put("pieceSalary", byUserId.getAccountBalance()); |
| | | map.put("hourlySalary", byUserId.getAccount()); |
| | | // åºå å®åå¢å |
| | | grossSalary = grossSalary.add(byUserId.getAccountBalance()).add(byUserId.getAccount()); |
| | | map.put("grossSalary", grossSalary); |
| | | netSalary = netSalary.add(byUserId.getAccountBalance()).add(byUserId.getAccount()); |
| | | map.put("netSalary", netSalary); |
| | | } |
| | | // 2. æ¥è¯¢è¯¥äººå对åºçç¤¾ä¿æ¹æ¡ |
| | | List<SchemeApplicableStaff> schemeList = schemeApplicableStaffMapper.selectSchemeByStaffId(staffId); |
| | | if (CollectionUtils.isEmpty(schemeList)) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * éè¿åå·¥Idè·åç¨æ·id |
| | | * @param staffId |
| | | * @return |
| | | */ |
| | | public Long getUidByStaffId(Long staffId){ |
| | | StaffOnJob staffOnJob = staffOnJobMapper.selectById(staffId); |
| | | if(staffOnJob == null){ |
| | | return -1L; // è¿åä¸åå¨Id |
| | | } |
| | | SysUser sysUser = sysUserMapper.selectOne(new LambdaQueryWrapper<SysUser>() |
| | | .eq(SysUser::getUserName, staffOnJob.getStaffNo()) |
| | | .eq(SysUser::getDelFlag, "0") |
| | | .last("limit 1")); |
| | | if(sysUser == null){ |
| | | return -1L; // è¿åä¸åå¨Id |
| | | } |
| | | return sysUser.getUserId(); |
| | | } |
| | | |
| | | /** |
| | | * è®¡ç® |
| | | * @param type |
| | | * @param bigDecimal |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.mapper.AccountExpenseMapper; |
| | | import com.ruoyi.account.pojo.AccountExpense; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | 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.dto.CalculateSalaryDto; |
| | | import com.ruoyi.staff.mapper.StaffOnJobMapper; |
| | | import com.ruoyi.staff.mapper.StaffSalaryDetailMapper; |
| | | import com.ruoyi.staff.pojo.SchemeApplicableStaff; |
| | | import com.ruoyi.staff.pojo.StaffOnJob; |
| | | import com.ruoyi.staff.pojo.StaffSalaryDetail; |
| | | import com.ruoyi.staff.pojo.StaffSalaryMain; |
| | | import com.ruoyi.staff.mapper.StaffSalaryMainMapper; |
| | |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | |
| | | @Autowired |
| | | private StaffOnJobMapper staffOnJobMapper; |
| | | |
| | | @Autowired |
| | | private AccountExpenseMapper accountExpenseMapper; |
| | | |
| | | @Override |
| | | public AjaxResult listPage(Page page, StaffSalaryMain staffSalaryMain) { |
| | |
| | | detail.setMainId(staffSalaryMain.getId()); |
| | | }); |
| | | staffSalaryDetailService.saveBatch(staffSalaryMain.getStaffSalaryDetailList()); |
| | | // åè´¢å¡èå¨ï¼æ°å¢æ¯åº |
| | | if(staffSalaryMain.getStatus().equals(5)){ |
| | | AccountExpense accountExpense = new AccountExpense(); |
| | | accountExpense.setBusinessType(3); |
| | | accountExpense.setExpenseMoney(staffSalaryMain.getTotalSalary()); |
| | | accountExpense.setBusinessId(staffSalaryMain.getId()); |
| | | accountExpense.setExpenseDate(new Date()); |
| | | accountExpense.setExpenseMethod("2"); |
| | | accountExpense.setExpenseType("1"); |
| | | accountExpense.setExpenseDescribed(staffSalaryMain.getSalaryTitle()); |
| | | accountExpense.setNote(staffSalaryMain.getRemark()); |
| | | accountExpense.setInputUser(SecurityUtils.getLoginUser().getNickName()); |
| | | accountExpense.setInputTime(new Date()); |
| | | accountExpenseMapper.insert(accountExpense); |
| | | } |
| | | return AjaxResult.success("ä¿®æ¹æå"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult calculateSalary(List<Long> ids) { |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | public AjaxResult calculateSalary(CalculateSalaryDto calculateSalaryDto) { |
| | | if(CollectionUtils.isEmpty(calculateSalaryDto.getIds())){ |
| | | return AjaxResult.error("åæ°é误"); |
| | | } |
| | | List<Map<String, Object>> longs = setSchemeApplicableStaffUserInfo(ids); // éè¿é¨é¨idsè·åç¨æ·ä¿¡æ¯ |
| | | List<Map<String, Object>> longs = setSchemeApplicableStaffUserInfo(calculateSalaryDto.getIds()); // éè¿é¨é¨idsè·åç¨æ·ä¿¡æ¯ |
| | | if(CollectionUtils.isEmpty(longs)){ |
| | | return AjaxResult.error("æ åå·¥"); |
| | | } |
| | | for (Map<String, Object> id : longs) { |
| | | schemeApplicableStaffService.calculateByEmployeeId((Integer) id.get("id"),id); |
| | | schemeApplicableStaffService.calculateByEmployeeId((Integer) id.get("id"),id,calculateSalaryDto.getDate()); |
| | | } |
| | | return AjaxResult.success(longs); |
| | | } |
| | |
| | | // éè¿é¨é¨è·å人åid |
| | | return sysUserDeptMapper.setSchemeApplicableStaffUserInfo(ids); |
| | | } |
| | | |
| | | } |
| | |
| | | captchaType: math |
| | | # åå审æ¹ç¼å·åç¼(é
ç½®æä»¶åç¼å½å) |
| | | approvalNumberPrefix: NEWTEST |
| | | # ä¸ªæ¨ Unipush é
ç½® |
| | | getui: |
| | | appId: PfjyAAE0FK64FaO1w2CMb1 |
| | | appKey: zTMb831OEL6J4GK1uE3Ob4 |
| | | masterSecret: K1GFtsv42v61tXGnF7SGE5 |
| | | domain: https://restapi.getui.cn/v2/ |
| | | # 离线æ¨é使ç¨çå
å/ç»ä»¶å |
| | | intentComponent: uni.app.UNI099A590/io.dcloud.PandoraEntry |
| | | # å¼åç¯å¢é
ç½® |
| | | server: |
| | | # æå¡å¨çHTTP端å£ï¼é»è®¤ä¸º8080 |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.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> |