| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.dto.SalesReceiptReturnDto; |
| | | import com.ruoyi.account.pojo.SalesReceiptReturn; |
| | | import com.ruoyi.account.service.SalesReceiptReturnService; |
| | | import com.ruoyi.account.service.impl.SalesReceiptReturnServiceImpl; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¶æ¬¾é货表 å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 03:34:18 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/salesReceiptReturn") |
| | | public class SalesReceiptReturnController { |
| | | |
| | | @Autowired |
| | | private SalesReceiptReturnService salesReceiptReturnService; |
| | | |
| | | |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation("æ¶æ¬¾é货表-å页æ¥è¯¢") |
| | | public R<IPage<SalesReceiptReturnDto>> page(SalesReceiptReturnDto salesReceiptReturnDto) { |
| | | return R.ok(salesReceiptReturnService.pageSalesReceiptReturnDto(salesReceiptReturnDto)); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.dto.SalesRefundAmountOrderDto; |
| | | import com.ruoyi.account.pojo.SalesRefundAmountOrder; |
| | | import com.ruoyi.account.service.SalesRefundAmountOrderService; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | | * éå®ç®¡ç--鿬¾å å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-07 10:16:47 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/salesRefundAmountOrder") |
| | | public class SalesRefundAmountOrderController { |
| | | |
| | | @Autowired |
| | | private SalesRefundAmountOrderService salesRefundAmountOrderService; |
| | | |
| | | @GetMapping("/page") |
| | | public R pageSalesRefundAmountOrderDto(Page<SalesRefundAmountOrderDto> page, SalesRefundAmountOrderDto salesRefundAmountOrder) { |
| | | return R.ok(salesRefundAmountOrderService.pageSalesRefundAmountOrderDto(page, salesRefundAmountOrder)); |
| | | } |
| | | |
| | | @ApiOperation("å¤ç") |
| | | @PostMapping("/dispose") |
| | | public R dispose( SalesRefundAmountOrderDto salesRefundAmountOrderId) { |
| | | return R.ok(salesRefundAmountOrderService.dispose(salesRefundAmountOrderId)); |
| | | } |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import com.ruoyi.account.pojo.SalesReceiptReturn; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SalesReceiptReturnDto extends SalesReceiptReturn { |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.dto; |
| | | |
| | | import com.ruoyi.account.pojo.SalesRefundAmountOrder; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class SalesRefundAmountOrderDto extends SalesRefundAmountOrder { |
| | | |
| | | @ApiModelProperty("éè´§åå·") |
| | | private String returnManagementNo; |
| | | |
| | | @ApiModelProperty("客æ·åç§°") |
| | | private String customerName; |
| | | |
| | | @ApiModelProperty("éå®åå·") |
| | | private String salesContractNo; |
| | | |
| | | @ApiModelProperty("å建人åç§°") |
| | | private String createUserName; |
| | | |
| | | |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.ruoyi.account.pojo.SalesReceiptReturn; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¶æ¬¾é货表 Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 03:34:18 |
| | | */ |
| | | @Mapper |
| | | public interface SalesReceiptReturnMapper extends BaseMapper<SalesReceiptReturn> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.dto.SalesRefundAmountOrderDto; |
| | | import com.ruoyi.account.pojo.SalesRefundAmountOrder; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | | * éå®ç®¡ç--鿬¾å Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-07 10:16:47 |
| | | */ |
| | | @Mapper |
| | | public interface SalesRefundAmountOrderMapper extends BaseMapper<SalesRefundAmountOrder> { |
| | | |
| | | IPage<SalesRefundAmountOrderDto> pageSalesRefundAmountOrderDto(Page<SalesRefundAmountOrderDto> page,@Param("ew") SalesRefundAmountOrderDto salesRefundAmountOrder); |
| | | } |
| | |
| | | private Long businessId; |
| | | |
| | | /** |
| | | * ä¸å¡ç±»å 1-仿¬¾ 2-è¿æ¬¾ |
| | | * ä¸å¡ç±»å 1-仿¬¾ 2-è¿æ¬¾ 3-èªèµåæ¾ |
| | | */ |
| | | private Integer businessType; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.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-09 03:34:18 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sales_receipt_return") |
| | | @ApiModel(value = "SalesReceiptReturn对象", description = "æ¶æ¬¾é货表") |
| | | public class SalesReceiptReturn implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty("ä¸»é® ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("鿬¾åå·") |
| | | private String refundId; |
| | | |
| | | @ApiModelProperty("仿¬¾è´¦å·") |
| | | private String paymentAccount; |
| | | |
| | | @ApiModelProperty("仿¬¾è´¦å·åç§°") |
| | | private String paymentAccountName; |
| | | |
| | | @ApiModelProperty("仿¬¾æ¹å¼") |
| | | private Byte paymentMethod; |
| | | |
| | | @ApiModelProperty("å®é
仿¬¾éé¢") |
| | | private BigDecimal actualAmount; |
| | | |
| | | @ApiModelProperty("æç»è´¹") |
| | | private BigDecimal fee; |
| | | |
| | | @ApiModelProperty("交æå·") |
| | | private String transactionNo; |
| | | |
| | | @ApiModelProperty("伿 éé¢") |
| | | private BigDecimal discountAmount; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建è
") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private Long createUser; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.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 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-07 10:16:47 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("sales_refund_amount_order") |
| | | @ApiModel(value = "SalesRefundAmountOrder对象", description = "éå®ç®¡ç--鿬¾å") |
| | | public class SalesRefundAmountOrder implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("éè´§åå·id") |
| | | private Long returnManagementId; |
| | | |
| | | @ApiModelProperty("ç¶æ") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty("åºé款éé¢") |
| | | private BigDecimal refundAmount; |
| | | |
| | | @ApiModelProperty("已鿬¾éé¢") |
| | | private BigDecimal refundedAmount; |
| | | |
| | | @ApiModelProperty("æªé款éé¢") |
| | | private BigDecimal notRefundedAmount; |
| | | |
| | | @ApiModelProperty("å建æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("å建人id") |
| | | private Long createUserId; |
| | | |
| | | @ApiModelProperty("æ´æ°äººid") |
| | | private Long updateUserId; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.dto.SalesReceiptReturnDto; |
| | | import com.ruoyi.account.pojo.SalesReceiptReturn; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¶æ¬¾é货表 æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 03:34:18 |
| | | */ |
| | | public interface SalesReceiptReturnService extends IService<SalesReceiptReturn> { |
| | | |
| | | IPage<SalesReceiptReturnDto> pageSalesReceiptReturnDto(SalesReceiptReturnDto salesReceiptReturnDto); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.dto.SalesRefundAmountOrderDto; |
| | | import com.ruoyi.account.pojo.SalesRefundAmountOrder; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * éå®ç®¡ç--鿬¾å æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-07 10:16:47 |
| | | */ |
| | | public interface SalesRefundAmountOrderService extends IService<SalesRefundAmountOrder> { |
| | | |
| | | IPage<SalesRefundAmountOrderDto> pageSalesRefundAmountOrderDto(Page<SalesRefundAmountOrderDto> page, SalesRefundAmountOrderDto salesRefundAmountOrder); |
| | | |
| | | Boolean addSalesRefundAmountOrderDto(SalesRefundAmountOrderDto salesRefundAmountOrder); |
| | | |
| | | |
| | | Boolean dispose(SalesRefundAmountOrderDto salesRefundAmountOrder); |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.account.dto.SalesReceiptReturnDto; |
| | | import com.ruoyi.account.pojo.SalesReceiptReturn; |
| | | import com.ruoyi.account.mapper.SalesReceiptReturnMapper; |
| | | import com.ruoyi.account.service.SalesReceiptReturnService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * æ¶æ¬¾é货表 æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 03:34:18 |
| | | */ |
| | | @Service |
| | | public class SalesReceiptReturnServiceImpl extends ServiceImpl<SalesReceiptReturnMapper, SalesReceiptReturn> implements SalesReceiptReturnService { |
| | | |
| | | @Override |
| | | public IPage<SalesReceiptReturnDto> pageSalesReceiptReturnDto(SalesReceiptReturnDto salesReceiptReturnDto) { |
| | | |
| | | return null; |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.account.dto.SalesRefundAmountOrderDto; |
| | | import com.ruoyi.account.pojo.SalesRefundAmountOrder; |
| | | import com.ruoyi.account.mapper.SalesRefundAmountOrderMapper; |
| | | import com.ruoyi.account.service.SalesRefundAmountOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * éå®ç®¡ç--鿬¾å æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-07 10:16:47 |
| | | */ |
| | | @Service |
| | | public class SalesRefundAmountOrderServiceImpl extends ServiceImpl<SalesRefundAmountOrderMapper, SalesRefundAmountOrder> implements SalesRefundAmountOrderService { |
| | | |
| | | |
| | | @Autowired |
| | | private SalesRefundAmountOrderMapper salesRefundAmountOrderMapper; |
| | | |
| | | @Override |
| | | public IPage<SalesRefundAmountOrderDto> pageSalesRefundAmountOrderDto(Page<SalesRefundAmountOrderDto> page, SalesRefundAmountOrderDto salesRefundAmountOrder) { |
| | | return salesRefundAmountOrderMapper.pageSalesRefundAmountOrderDto(page, salesRefundAmountOrder); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean addSalesRefundAmountOrderDto(SalesRefundAmountOrderDto salesRefundAmountOrder) { |
| | | return this.save(salesRefundAmountOrder); |
| | | } |
| | | |
| | | @Override |
| | | public Boolean dispose(SalesRefundAmountOrderDto salesRefundAmountOrder) { |
| | | |
| | | return null; |
| | | } |
| | | } |
| | |
| | | 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.*; |
| | |
| | | * @since 2026/03/04 14:53 |
| | | */ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class CustomerFollowUpFileServiceImpl extends ServiceImpl<CustomerFollowUpFileMapper, CustomerFollowUpFile> implements CustomerFollowUpFileService { |
| | | |
| | | private final CustomerFollowUpService customerFollowUpService; |
| | | @Autowired |
| | | @Lazy |
| | | private CustomerFollowUpService customerFollowUpService; |
| | | |
| | | |
| | | @Override |
| | |
| | | public void insertFill(MetaObject metaObject) { |
| | | Integer userId = null; |
| | | Long tenantId = null; |
| | | String userName = null; |
| | | try { |
| | | userId = SecurityUtils.getUserId().intValue(); |
| | | tenantId = SecurityUtils.getLoginUser().getTenantId(); |
| | | userName = SecurityUtils.getUsername(); |
| | | } catch (Exception ignored) { |
| | | } |
| | | this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now()); |
| | |
| | | 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, "createUserName", String.class, userName); |
| | | this.strictInsertFill(metaObject, "updateUserName", String.class, userName); |
| | | |
| | | this.strictInsertFill(metaObject, "tenantId", Long.class, tenantId); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonCreator; |
| | | import com.fasterxml.jackson.annotation.JsonValue; |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import lombok.Getter; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/10 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Getter |
| | | public enum IsDeleteEnum implements BaseEnum<Integer> { |
| | | NOT_DELETED(0, "æªå é¤"), |
| | | DELETED(1, "å·²å é¤"); |
| | | |
| | | private final Integer code; |
| | | private final String value; |
| | | |
| | | IsDeleteEnum(Integer code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.common.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonCreator; |
| | | import lombok.Getter; |
| | | |
| | |
| | | TO_BEGIN(1, "å¾
å¼å§"), |
| | | ON_GOING(2, "è¿è¡ä¸"), |
| | | ENDED(3, "å·²ç»æ"); |
| | | |
| | | @EnumValue |
| | | private final Integer code; |
| | | |
| | | private final String value; |
| | | |
| | | PlanStageEnum(Integer code, String value) { |
| | | this.code = code; |
| | | this.value = value; |
| | | } |
| | | |
| | | @JsonCreator |
| | | public static PlanStageEnum fromCode(Integer code) { |
| | | return BaseEnum.fromCode(PlanStageEnum.class, code); |
| | | } |
| | | } |
| | |
| | | private BigDecimal unQuantity; |
| | | |
| | | private BigDecimal totalReturnNum; |
| | | |
| | | // éè´§æ»ä»· |
| | | private BigDecimal price; |
| | | |
| | | // éè´§æ»ä»· |
| | | private BigDecimal taxInclusiveUnitPrice; |
| | | } |
| | |
| | | public interface ReturnSaleProductMapper extends BaseMapper<ReturnSaleProduct> { |
| | | |
| | | List<ReturnSaleProductDto> listReturnSaleProductDto(@Param("returnManagementId") Long returnManagementId); |
| | | |
| | | List<ReturnSaleProductDto> listReturnSaleProduct(@Param("returnManagementId") Long returnManagementId); |
| | | } |
| | |
| | | public interface ReturnSaleProductService extends IService<ReturnSaleProduct> { |
| | | |
| | | List<ReturnSaleProductDto> listReturnSaleProductDto(Long returnManagementId); |
| | | |
| | | List<ReturnSaleProductDto> listReturnSaleProduct(Long returnManagementId); |
| | | } |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | 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.account.dto.SalesRefundAmountOrderDto; |
| | | import com.ruoyi.account.pojo.SalesRefundAmountOrder; |
| | | import com.ruoyi.account.service.SalesRefundAmountOrderService; |
| | | import com.ruoyi.common.utils.OrderUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.procurementrecord.dto.ReturnManagementDto; |
| | | import com.ruoyi.procurementrecord.dto.ReturnSaleProductDto; |
| | | import com.ruoyi.procurementrecord.mapper.ReturnManagementMapper; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnManagement; |
| | | import com.ruoyi.procurementrecord.pojo.ReturnSaleProduct; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | private ShippingInfoService shippingInfoService; |
| | | @Autowired |
| | | private SalesLedgerMapper salesLedgerMapper; |
| | | @Autowired |
| | | private SalesRefundAmountOrderService salesRefundAmountOrderService; |
| | | |
| | | @Override |
| | | public IPage<ReturnManagementDto> listPage(Page page, ReturnManagementDto returnManagement) { |
| | |
| | | @Override |
| | | public boolean handle(Long returnManagementId) { |
| | | ReturnManagement byId = this.getById(returnManagementId); |
| | | List<ReturnSaleProductDto> list = returnSaleProductService.listReturnSaleProduct(returnManagementId); |
| | | byId.setStatus(1); |
| | | updateById(byId); |
| | | SalesRefundAmountOrderDto salesRefundAmountOrder = new SalesRefundAmountOrderDto(); |
| | | salesRefundAmountOrder.setReturnManagementId(returnManagementId); |
| | | salesRefundAmountOrder.setStatus(0); |
| | | salesRefundAmountOrder.setCreateTime(byId.getCreateTime()); |
| | | salesRefundAmountOrder.setCreateUserId(SecurityUtils.getUserId()); |
| | | BigDecimal bigDecimal = new BigDecimal(0); |
| | | for (ReturnSaleProductDto returnSaleProduct : list) { |
| | | bigDecimal = bigDecimal.add(returnSaleProduct.getPrice()); |
| | | salesRefundAmountOrder.setRefundedAmount(new BigDecimal(0)); |
| | | } |
| | | salesRefundAmountOrder.setRefundAmount(bigDecimal); |
| | | salesRefundAmountOrder.setNotRefundedAmount(salesRefundAmountOrder.getRefundedAmount()); |
| | | salesRefundAmountOrderService.addSalesRefundAmountOrderDto(salesRefundAmountOrder); |
| | | return true; |
| | | } |
| | | |
| | |
| | | |
| | | return returnSaleProductMapper.listReturnSaleProductDto(returnManagementId); |
| | | } |
| | | |
| | | @Override |
| | | public List<ReturnSaleProductDto> listReturnSaleProduct(Long returnManagementId) { |
| | | return returnSaleProductMapper.listReturnSaleProduct(returnManagementId); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.projectManagement.controller; |
| | | |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.projectManagement.dto.UpdateStateInfo; |
| | | import com.ruoyi.projectManagement.service.InfoService; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SearchInfoVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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 org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | |
| | | private final InfoService infoService; |
| | | |
| | | @PostMapping("/save") |
| | | @ApiOperation("ä¿å") |
| | | public AjaxResult save(@RequestBody @Valid SaveInfoVo saveInfoVo) { |
| | | infoService.save(saveInfoVo); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/updateStatus") |
| | | @ApiOperation("ä¿®æ¹ç¶æ") |
| | | public AjaxResult updateStatus(@RequestBody @Valid UpdateStateInfo updateStateInfo){ |
| | | infoService.updateStatus(updateStateInfo); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/delete/{id}") |
| | | @ApiOperation("å é¤") |
| | | public AjaxResult delete(@PathVariable Long id) { |
| | | infoService.deleteInfo(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @PostMapping("/listPage") |
| | | @ApiOperation("å页å表") |
| | | public AjaxResult listPage(@RequestBody @Valid SearchInfoVo vo) { |
| | | return AjaxResult.success(infoService.searchListInfo(vo)); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/{id}") |
| | | @ApiOperation("详æ
") |
| | | public AjaxResult getInfoById(@PathVariable Long id) { |
| | | return AjaxResult.success(infoService.getInfoById(id)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.projectManagement.dto; |
| | | |
| | | 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; |
| | |
| | | public class SaveInfoDto implements Serializable { |
| | | private Long id; |
| | | private String no; |
| | | @NotBlank |
| | | @NotBlank(message = "title为空") |
| | | private String title; |
| | | private Long clientId; |
| | | private String clientName; |
| | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate establishTime; |
| | | // 项ç®ç±»å id |
| | | @NotNull |
| | | @NotNull(message = "projectManagementPlanId为空") |
| | | private Long projectManagementPlanId; |
| | | |
| | | private String source; |
| | |
| | | private Long managerId; |
| | | private String managerName; |
| | | private Long salesmanId; |
| | | private String salesmanName; |
| | | private String salesmanName; |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate actualEndTime; |
| | | |
| | | // å®¡æ ¸ç¶æ |
| | | private Integer reviewStatus; |
| | | |
| | | // 项ç®ç¶æ |
| | | private Integer status; |
| | | |
| | |
| | | |
| | | private String remark; |
| | | |
| | | @JsonIgnore |
| | | private String attachment; |
| | | |
| | | private List<SimpleFileVo> attachmentList; |
| | | |
| | | private List<String> attachmentIds; // éä»¶ids |
| | | |
| | | private List<TeamDto> teamList; |
| | | |
| | | private List<PlanStageDto> planStage; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.dto; |
| | | |
| | | import com.ruoyi.common.enums.PlanStageEnum; |
| | | import com.ruoyi.common.enums.ReviewStatusEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/10 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class UpdateStateInfo implements Serializable { |
| | | @NotNull(message = "idä¸è½ä¸ºç©º") |
| | | private Long id; |
| | | |
| | | // 审æ¹ç¶æ |
| | | private ReviewStatusEnum reviewStatus; |
| | | |
| | | // è¿åº¦ç¶æ |
| | | private PlanStageEnum stage; |
| | | |
| | | |
| | | } |
| | |
| | | package com.ruoyi.projectManagement.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.projectManagement.pojo.Info; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.projectManagement.vo.ListInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SearchInfoVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | |
| | | */ |
| | | public interface InfoMapper extends BaseMapper<Info> { |
| | | |
| | | Page<ListInfoVo> searchListInfo(@Param("vo") SearchInfoVo vo); |
| | | } |
| | | |
| | | |
| | |
| | | @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @TableField(value = "create_user_name", fill = FieldFill.INSERT) |
| | | private String createUserName; |
| | | |
| | | @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUserName; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | |
| | | @TableField(value = "team",typeHandler = JacksonTypeHandler.class) |
| | | private List<TeamDto> team; |
| | | |
| | | @TableField(value = "create_user_name", fill = FieldFill.INSERT) |
| | | private String createUserName; |
| | | |
| | | @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUserName; |
| | | } |
| | |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | @ApiModelProperty(value="æ´æ°äºº") |
| | | private Integer updateUser; |
| | | |
| | | @TableField(value = "create_user_name", fill = FieldFill.INSERT) |
| | | private String createUserName; |
| | | |
| | | @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUserName; |
| | | } |
| | |
| | | @TableField(value = "update_user",fill = FieldFill.INSERT_UPDATE) |
| | | private Integer updateUser; |
| | | |
| | | @TableField(value = "create_user_name", fill = FieldFill.INSERT) |
| | | private String createUserName; |
| | | |
| | | @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUserName; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | @TableField(value = "project_management_info_id") |
| | | private Long projectManagementInfoId; |
| | | |
| | | |
| | | @TableField(value = "create_user_name", fill = FieldFill.INSERT) |
| | | private String createUserName; |
| | | |
| | | @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateUserName; |
| | | |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | package com.ruoyi.projectManagement.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.projectManagement.dto.UpdateStateInfo; |
| | | import com.ruoyi.projectManagement.vo.InfoVo; |
| | | import com.ruoyi.projectManagement.vo.ListInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SearchInfoVo; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | public interface InfoService { |
| | | /** |
| | | * ä¿å项ç®ä¿¡æ¯ |
| | | * |
| | | * @param saveInfoVo ä¿å项ç®ä¿¡æ¯çDTO |
| | | */ |
| | | void save(@NotNull SaveInfoVo saveInfoVo); |
| | | |
| | | /** |
| | | * æ´æ°é¡¹ç®ä¿¡æ¯ç¶æ |
| | | * |
| | | * @param updateStateInfo æ´æ°é¡¹ç®ä¿¡æ¯ç¶æçDTO |
| | | */ |
| | | void updateStatus(@NotNull UpdateStateInfo updateStateInfo); |
| | | |
| | | /** |
| | | * å é¤é¡¹ç®ä¿¡æ¯ |
| | | * |
| | | * @param id 项ç®ä¿¡æ¯ID |
| | | */ |
| | | void deleteInfo(@NotNull Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢é¡¹ç®ä¿¡æ¯å表 |
| | | * |
| | | * @param vo æ¥è¯¢æ¡ä»¶ |
| | | * @return 项ç®ä¿¡æ¯å表 |
| | | */ |
| | | Page<ListInfoVo> searchListInfo(@NotNull SearchInfoVo vo); |
| | | |
| | | |
| | | InfoVo getInfoById(@NotNull Long id); |
| | | } |
| | |
| | | package com.ruoyi.projectManagement.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.enums.IsDeleteEnum; |
| | | import com.ruoyi.common.enums.SaleEnum; |
| | | import com.ruoyi.projectManagement.dto.ContractInfoDto; |
| | | import com.ruoyi.projectManagement.dto.SaveInfoDto; |
| | | import com.ruoyi.projectManagement.dto.ShippingAddressDto; |
| | | import com.ruoyi.projectManagement.dto.UpdateStateInfo; |
| | | import com.ruoyi.projectManagement.mapper.InfoMapper; |
| | | import com.ruoyi.projectManagement.pojo.Info; |
| | | 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.InfoVo; |
| | | import com.ruoyi.projectManagement.vo.ListInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SaveInfoVo; |
| | | import com.ruoyi.projectManagement.vo.SearchInfoVo; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.ISalesLedgerService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.SneakyThrows; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.Assert; |
| | | |
| | | import java.util.List; |
| | | import java.util.concurrent.CompletableFuture; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | |
| | | @Transactional(readOnly = true) |
| | | public class InfoServiceImpl implements InfoService { |
| | | private final InfoHandleService infoHandleService; |
| | | private final InfoMapper infoMapper; |
| | | 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); |
| | | if(saveInfoVo.getShippingAddress() != null){ |
| | | shippingAddressHandleService.save(infoId, saveInfoVo.getShippingAddress()); |
| | | } |
| | | if(saveInfoVo.getContractInfo() != null){ |
| | | contractInfoHandleService.save(infoId, saveInfoVo.getContractInfo()); |
| | | } |
| | | if(saveInfoVo.getSalesLedgerProductList() != null){ |
| | | salesLedgerService.handleSalesLedgerProducts(infoId, saveInfoVo.getSalesLedgerProductList(), SaleEnum.MANAGEMENT); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void updateStatus(UpdateStateInfo updateStateInfo) { |
| | | Info info = new Info(); |
| | | info.setId(updateStateInfo.getId()); |
| | | // 审æ¹ç¶æ |
| | | if(updateStateInfo.getReviewStatus() != null){ |
| | | info.setReviewStatus(updateStateInfo.getReviewStatus().getCode()); |
| | | } |
| | | |
| | | // è¿åº¦ç¶æ |
| | | if(updateStateInfo.getStage() != null){ |
| | | info.setStatus(updateStateInfo.getStage().getCode()); |
| | | } |
| | | |
| | | infoMapper.updateById(info); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public void deleteInfo(Long id) { |
| | | LambdaUpdateWrapper<Info> updateWrapper = new LambdaUpdateWrapper<Info>(); |
| | | updateWrapper.eq(Info::getId, id); |
| | | updateWrapper.set(Info::getIsDelete, IsDeleteEnum.DELETED.getCode()); |
| | | |
| | | // 对åºéè¡¨ä¿¡æ¯æ¯å¦å é¤å¾
ç¡®å®ï¼å 为åç»å¯è½ä¼è¿è¡å¼ç¨æä»¥å
ä¸å é¤ |
| | | } |
| | | |
| | | @Override |
| | | public Page<ListInfoVo> searchListInfo(SearchInfoVo vo) { |
| | | Page<ListInfoVo> listInfoVoPage = infoMapper.searchListInfo(vo); |
| | | |
| | | |
| | | return listInfoVoPage; |
| | | } |
| | | |
| | | @Override |
| | | @SneakyThrows |
| | | public InfoVo getInfoById(Long id) { |
| | | |
| | | CompletableFuture<SaveInfoDto> infoFuture = CompletableFuture.supplyAsync(() -> infoHandleService.getInfoById(id)); |
| | | CompletableFuture<ContractInfoDto> contractFuture = CompletableFuture.supplyAsync(() -> contractInfoHandleService.getByInfoId(id)); |
| | | CompletableFuture<ShippingAddressDto> shippingFuture = CompletableFuture.supplyAsync(() -> shippingAddressHandleService.getByInfoId(id)); |
| | | // åå |
| | | CompletableFuture<List<SalesLedgerProduct>> listCompletableFuture = CompletableFuture.supplyAsync(() -> salesLedgerService.getSalesLedgerProductListByRelateId(id,SaleEnum.MANAGEMENT)); |
| | | |
| | | // ä¸çº§é¡¹ç®ä¿¡æ¯ |
| | | CompletableFuture<List<SaveInfoDto>> subordinateInfoListFuture = CompletableFuture.supplyAsync(() -> infoHandleService.getSubordinateInfo(id)); |
| | | |
| | | |
| | | // çå¾
ææå¼æ¥å®æ |
| | | CompletableFuture.allOf(infoFuture, contractFuture, shippingFuture,listCompletableFuture,subordinateInfoListFuture).join(); |
| | | |
| | | SaveInfoDto info = infoFuture.get(); |
| | | ContractInfoDto contract = contractFuture.get(); |
| | | ShippingAddressDto shippingAddress = shippingFuture.get(); |
| | | List<SalesLedgerProduct> salesLedgerProductList = listCompletableFuture.get(); |
| | | List<SaveInfoDto> saveInfoDtos = subordinateInfoListFuture.get(); |
| | | InfoVo vo = new InfoVo(); |
| | | vo.setInfo(info); |
| | | vo.setContractInfo(contract); |
| | | vo.setShippingAddress(shippingAddress); |
| | | vo.setSalesLedgerProductList(salesLedgerProductList); |
| | | vo.setSubordinateInfoList(saveInfoDtos); |
| | | return vo; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.ruoyi.projectManagement.service.impl.handle; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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; |
| | | |
| | |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class,readOnly = true) |
| | | public class ContractInfoHandleService{ |
| | | |
| | | private final ContractInfoMapper contractInfoMapper; |
| | | @Autowired |
| | | private ContractInfoMapper contractInfoMapper; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void save(@Nullable Long id, @NotNull ContractInfoDto contractInfoDto) { |
| | |
| | | contractInfoMapper.updateById(contractInfo); |
| | | } |
| | | } |
| | | |
| | | public ContractInfoDto getByInfoId(@NotNull Long id) { |
| | | LambdaQueryWrapper<ContractInfo> queryWrapper = new LambdaQueryWrapper<ContractInfo>(); |
| | | queryWrapper.eq(ContractInfo::getProjectManagementInfoId, id); |
| | | queryWrapper.eq(ContractInfo::getIsDelete, 0); |
| | | queryWrapper.last("limit 1"); |
| | | ContractInfo contractInfo = contractInfoMapper.selectOne(queryWrapper); |
| | | return BeanUtil.copyProperties(contractInfo, ContractInfoDto.class); |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.google.common.collect.Lists; |
| | | import com.ruoyi.basic.service.CustomerFollowUpFileService; |
| | | 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; |
| | |
| | | */ |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | @Transactional(rollbackFor = Exception.class,readOnly = true) |
| | | @Transactional(rollbackFor = Exception.class, readOnly = true) |
| | | public class InfoHandleService { |
| | | |
| | | private static final String GENERATE_SERIAL_NUMBER_PREFIX = "XM"; |
| | |
| | | |
| | | private final PlanService planService; |
| | | |
| | | private final CustomerFollowUpFileService customerFollowUpFileService; |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long save(@NotNull SaveInfoDto saveInfoDto){ |
| | | public Long save(@NotNull SaveInfoDto saveInfoDto) { |
| | | Info info = BeanUtil.copyProperties(saveInfoDto, Info.class); |
| | | |
| | | // éä»¶ç¹æ®å¤ç |
| | |
| | | info.setAttachment(attachmentIds); |
| | | |
| | | // çæåºå· (妿éè¦èªå¨çæçè¯) |
| | | if(StrUtil.isBlank(info.getNo())){ |
| | | if (StrUtil.isBlank(info.getNo())) { |
| | | info.setNo(generateSerialNumber()); |
| | | } |
| | | info.setTeam(saveInfoDto.getTeamList()); |
| | | if(info.getId() == null){ |
| | | 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 { |
| | | } else { |
| | | infoMapper.updateById(info); |
| | | } |
| | | return info.getId(); |
| | | } |
| | | |
| | | public SaveInfoDto getInfoById(@NotNull Long id) { |
| | | Info info = infoMapper.selectById(id); |
| | | return convert(info); |
| | | } |
| | | |
| | | private SaveInfoDto convert(Info info) { |
| | | SaveInfoDto saveInfoDto = BeanUtil.copyProperties(info, SaveInfoDto.class); |
| | | // éä»¶å¤ç |
| | | saveInfoDto.setTeamList(info.getTeam()); |
| | | customerFollowUpFileService.fillAttachment(Lists.newArrayList(saveInfoDto), SaveInfoDto::getAttachment, SaveInfoDto::setAttachmentList); |
| | | return saveInfoDto; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * è·åæ¹idä¸å项ç®ä¿¡æ¯ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | public List<SaveInfoDto> getSubordinateInfo(@NotNull Long id) { |
| | | LambdaQueryWrapper<Info> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(Info::getProjectManagementInfoParentId, id); |
| | | queryWrapper.orderByAsc(Info::getCreateTime); |
| | | List<Info> infoList = infoMapper.selectList(queryWrapper); |
| | | return infoList.stream().map(this::convert).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | 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 planNodeByPlanId.stream().map(it -> new PlanStageDto(it.getId(), it.getName(), PlanStageEnum.TO_BEGIN)).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * çæé¡¹ç®ç¼å· |
| | | * |
| | | * @return |
| | | */ |
| | | private String generateSerialNumber() { |
| | |
| | | package com.ruoyi.projectManagement.service.impl.handle; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ruoyi.projectManagement.dto.ShippingAddressDto; |
| | | import com.ruoyi.projectManagement.mapper.ShippingAddressMapper; |
| | | import com.ruoyi.projectManagement.pojo.ShippingAddress; |
| | |
| | | shippingAddressMapper.updateById(shippingAddress); |
| | | } |
| | | } |
| | | |
| | | |
| | | public ShippingAddressDto getByInfoId(@NotNull Long id) { |
| | | LambdaQueryWrapper<ShippingAddress> queryWrapper = new LambdaQueryWrapper<ShippingAddress>(); |
| | | queryWrapper.eq(ShippingAddress::getProjectManagementInfoId, id); |
| | | queryWrapper.eq(ShippingAddress::getIsDelete, 0); |
| | | queryWrapper.last("limit 1"); |
| | | ShippingAddress shippingAddress = shippingAddressMapper.selectOne(queryWrapper); |
| | | return BeanUtil.copyProperties(shippingAddress, ShippingAddressDto.class); |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import com.ruoyi.projectManagement.dto.SaveInfoDto; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/10 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class InfoVo extends SaveInfoVo implements Serializable { |
| | | |
| | | |
| | | // 项ç®é¶æ®µ |
| | | private String xxx; |
| | | |
| | | // ä¸çº§é¡¹ç® |
| | | private List<SaveInfoDto> subordinateInfoList; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.projectManagement.dto.SaveInfoDto; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | |
| | | /** |
| | | * 页é¢åè¡¨ä¿¡æ¯ |
| | | * |
| | | * @author buhuazhen |
| | | * @date 2026/3/10 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ListInfoVo extends SaveInfoDto implements Serializable { |
| | | |
| | | // 对åºé¡¹ç®ç±»ååç§° |
| | | private String projectManagementPlanName; |
| | | |
| | | // 对åºç¶é¡¹ç®åç§° |
| | | private String projectManagementInfoParentName; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime createTime; // å建æ¶é´ |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime updateTime; // æ´æ°æ¶é´ |
| | | |
| | | private String createUserName; // å建人åç§° |
| | | private String updateUserName; // æ´æ°äººåç§° |
| | | } |
| | |
| | | |
| | | private Integer sort; |
| | | |
| | | @NotBlank |
| | | @NotBlank(message = "nameä¸è½ä¸ºç©º") |
| | | private String name; |
| | | |
| | | @NotNull |
| | | @NotNull(message = "leaderIdä¸è½ä¸ºç©º") |
| | | private Long leaderId; |
| | | |
| | | @NotBlank |
| | | @NotBlank(message = "leaderNameä¸è½ä¸ºç©º") |
| | | private String leaderName; |
| | | |
| | | private Integer estimatedDuration; |
| | |
| | | public class SavePlanVo implements Serializable { |
| | | |
| | | private Long id; |
| | | @NotBlank |
| | | @NotBlank(message = "nameä¸è½ä¸ºç©º") |
| | | private String name; |
| | | // @NotBlank |
| | | private String description; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.projectManagement.vo; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.enums.PlanStageEnum; |
| | | import com.ruoyi.common.enums.ReviewStatusEnum; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @author buhuazhen |
| | | * @date 2026/3/10 |
| | | * @email 3038525872@qq.com |
| | | */ |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class SearchInfoVo extends Page implements Serializable { |
| | | private String noOrName; // 项ç®ç¼å·æé¡¹ç®åç§° |
| | | private String clientName; // 客æ·åç§° |
| | | private String salesmanName; // ä¸å¡å |
| | | |
| | | // 审æ¹ç¶æ |
| | | private ReviewStatusEnum reviewStatus; |
| | | |
| | | // è¿åº¦ç¶æ |
| | | private PlanStageEnum stage; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.controller; |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 01:37:44 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/purchaseReturnOrderProducts") |
| | | public class PurchaseReturnOrderProductsController { |
| | | |
| | | } |
| | |
| | | if (purchaseReturnOrderDto.getIsDefaultNo()) { |
| | | purchaseReturnOrderDto.setNo(OrderUtils.countTodayByCreateTime(purchaseReturnOrdersMapper, "CGTL")); |
| | | } |
| | | return AjaxResult.success(purchaseReturnOrdersService.save(purchaseReturnOrderDto)); |
| | | return AjaxResult.success(purchaseReturnOrdersService.add(purchaseReturnOrderDto)); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrderProducts; |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class PurchaseReturnOrderDto extends PurchaseReturnOrders { |
| | | // æ¯å¦ä½¿ç¨ç³»ç»åå· |
| | | private Boolean isDefaultNo; |
| | | |
| | | |
| | | private List<PurchaseReturnOrderProductsDto> purchaseReturnOrderProductsDtos; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.dto; |
| | | |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrderProducts; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class PurchaseReturnOrderProductsDto extends PurchaseReturnOrderProducts { |
| | | |
| | | private String productName; |
| | | private String model; |
| | | private String unit; |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.mapper; |
| | | |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrderProducts; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper æ¥å£ |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 01:37:44 |
| | | */ |
| | | @Mapper |
| | | public interface PurchaseReturnOrderProductsMapper extends BaseMapper<PurchaseReturnOrderProducts> { |
| | | |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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-09 01:37:44 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | | @TableName("purchase_return_order_products") |
| | | @ApiModel(value = "PurchaseReturnOrderProducts对象", description = "") |
| | | public class PurchaseReturnOrderProducts implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("éè´§åid") |
| | | private Long purchaseReturnOrderId; |
| | | |
| | | @ApiModelProperty("éè´äº§åid") |
| | | private Long salesLedgerProductId; |
| | | |
| | | @ApiModelProperty("å½å
¥æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ApiModelProperty("æ´æ°æ¶é´") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("éè´§æ°é") |
| | | private BigDecimal num; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.service; |
| | | |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrderProducts; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 01:37:44 |
| | | */ |
| | | public interface PurchaseReturnOrderProductsService extends IService<PurchaseReturnOrderProducts> { |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface PurchaseReturnOrdersService extends IService<PurchaseReturnOrders> { |
| | | IPage<PurchaseReturnOrderVo> listPage(Page page, PurchaseReturnOrderDto purchaseReturnOrderDto); |
| | | |
| | | Boolean add(PurchaseReturnOrderDto purchaseReturnOrderDto); |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.purchase.service.impl; |
| | | |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrderProducts; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrderProductsMapper; |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrderProductsService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * æå¡å®ç°ç±» |
| | | * </p> |
| | | * |
| | | * @author è¯å¯¼è½¯ä»¶ï¼æ±èï¼æéå
¬å¸ |
| | | * @since 2026-03-09 01:37:44 |
| | | */ |
| | | @Service |
| | | public class PurchaseReturnOrderProductsServiceImpl extends ServiceImpl<PurchaseReturnOrderProductsMapper, PurchaseReturnOrderProducts> implements PurchaseReturnOrderProductsService { |
| | | |
| | | } |
| | |
| | | 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.dto.PurchaseReturnOrderProductsDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrderProductsMapper; |
| | | import com.ruoyi.purchase.pojo.PurchaseReturnOrders; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper; |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrdersService; |
| | |
| | | import com.ruoyi.purchase.vo.PurchaseReturnOrderVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public class PurchaseReturnOrdersServiceImpl extends ServiceImpl<PurchaseReturnOrdersMapper, PurchaseReturnOrders> implements PurchaseReturnOrdersService { |
| | | @Autowired |
| | | private PurchaseReturnOrdersMapper purchaseReturnOrdersMapper; |
| | | @Autowired |
| | | private PurchaseReturnOrderProductsMapper purchaseReturnOrderProductsMapper; |
| | | |
| | | @Override |
| | | public IPage<PurchaseReturnOrderVo> listPage(Page page, PurchaseReturnOrderDto purchaseReturnOrderDto) { |
| | | return purchaseReturnOrdersMapper.listPage(page, purchaseReturnOrderDto); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean add(PurchaseReturnOrderDto purchaseReturnOrderDto) { |
| | | this.save(purchaseReturnOrderDto); |
| | | if (purchaseReturnOrderDto.getPurchaseReturnOrderProductsDtos().isEmpty()) { |
| | | for (PurchaseReturnOrderProductsDto purchaseReturnOrderProductsDto :purchaseReturnOrderDto.getPurchaseReturnOrderProductsDtos()) { |
| | | purchaseReturnOrderProductsDto.setPurchaseReturnOrderId(purchaseReturnOrderDto.getId()); |
| | | purchaseReturnOrderProductsMapper.insert(purchaseReturnOrderProductsDto); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | int addOrUpdateSalesLedger(SalesLedgerDto salesLedgerDto); |
| | | |
| | | List<SalesLedgerProduct> getSalesLedgerProductListByRelateId(@NotNull Long relateId,@NotNull SaleEnum type); |
| | | |
| | | void handleSalesLedgerProducts(Long salesLedgerId, List<SalesLedgerProduct> products, SaleEnum type); |
| | | |
| | | SalesLedgerDto getSalesLedgerWithProducts(SalesLedgerDto salesLedgerDto); |
| | |
| | | return salesLedgerMapper.selectSalesLedgerList(salesLedgerDto); |
| | | } |
| | | |
| | | |
| | | public List<SalesLedgerProduct> getSalesLedgerProductListByRelateId(Long relateId, SaleEnum type){ |
| | | LambdaQueryWrapper<SalesLedgerProduct> productWrapper = new LambdaQueryWrapper<>(); |
| | | productWrapper.eq(SalesLedgerProduct::getSalesLedgerId, relateId); |
| | | productWrapper.eq(SalesLedgerProduct::getType, type.getCode()); |
| | | return salesLedgerProductMapper.selectList(productWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public SalesLedgerDto getSalesLedgerWithProducts(SalesLedgerDto salesLedgerDto) { |
| | | // 1. æ¥è¯¢ä¸»è¡¨ |
| | |
| | | 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; // æè¿å空åè¡¨ï¼æ ¹æ®ä¸å¡éæ±è°æ´ |
| | | } |
| | | Long staffId = id.longValue(); |
| | | // 社ä¿éé¢ |
| | | BigDecimal schemeAmount = new BigDecimal("0.00"); |
| | | BigDecimal socialPersonal = new BigDecimal("0.00"); |
| | | // å
¬ç§¯ééé¢ |
| | | BigDecimal gjj = new BigDecimal("0.00"); |
| | | BigDecimal fundPersonal = new BigDecimal("0.00"); |
| | | // åºæ¬å·¥èµ |
| | | BigDecimal basicSalary = new BigDecimal("0.00"); |
| | | map.put("gjj", gjj); // å
¬ç§¯é |
| | | map.put("schemeAmount", schemeAmount); // 社ä¿éé¢ |
| | | map.put("fundPersonal", fundPersonal); // å
¬ç§¯é |
| | | map.put("socialPersonal", socialPersonal); // 社ä¿éé¢ |
| | | map.put("basicSalary", basicSalary); // åºæ¬å·¥èµ |
| | | // 个ç¨éé¢ |
| | | BigDecimal salaryTax = new BigDecimal("0.00"); |
| | |
| | | // åºåå·¥èµ |
| | | map.put("grossSalary", basicSalary); |
| | | // 个ç¨éé¢ï¼æ 社ä¿çï¼ |
| | | BigDecimal bigDecimal = TaxCalculator.calculateMonthlyTax(basicSalary, schemeAmount, gjj); |
| | | BigDecimal bigDecimal = TaxCalculator.calculateMonthlyTax(basicSalary, socialPersonal, fundPersonal); |
| | | 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)) { |
| | |
| | | continue; |
| | | } |
| | | for (SchemeInsuranceDetail detail : detailList) { |
| | | if("使¿å
¬ç§¯é".equals(detail.getInsuranceType())){ |
| | | gjj = gjj.add(calculateByEmployeeIdType(detail.getInsuranceType(),gjj, staffOnJobDto, detail)); |
| | | if("å
¬ç§¯é".equals(detail.getInsuranceType())){ |
| | | fundPersonal = fundPersonal.add(calculateByEmployeeIdType(detail.getInsuranceType(),fundPersonal, staffOnJobDto, detail)); |
| | | }else{ |
| | | schemeAmount = schemeAmount.add(calculateByEmployeeIdType(detail.getInsuranceType(),schemeAmount, staffOnJobDto, detail)); |
| | | socialPersonal = socialPersonal.add(calculateByEmployeeIdType(detail.getInsuranceType(),socialPersonal, staffOnJobDto, detail)); |
| | | } |
| | | } |
| | | } |
| | | map.put("schemeAmount", schemeAmount); |
| | | map.put("gjj", gjj); |
| | | map.put("socialPersonal", socialPersonal); |
| | | map.put("fundPersonal", fundPersonal); |
| | | // 个ç¨éé¢ï¼ç¤¾ä¿çï¼ |
| | | bigDecimal = TaxCalculator.calculateMonthlyTax(basicSalary, schemeAmount, gjj); |
| | | bigDecimal = TaxCalculator.calculateMonthlyTax(basicSalary, socialPersonal, fundPersonal); |
| | | map.put("salaryTax", bigDecimal); |
| | | // åºæ£å·¥èµ |
| | | map.put("deductSalary", bigDecimal.add(gjj).add(schemeAmount)); |
| | | map.put("deductSalary", bigDecimal.add(fundPersonal).add(socialPersonal)); |
| | | // å®åå·¥èµ |
| | | map.put("netSalary", basicSalary.subtract(bigDecimal).subtract(gjj).subtract(schemeAmount)); |
| | | map.put("netSalary", basicSalary.subtract(bigDecimal).subtract(fundPersonal).subtract(socialPersonal)); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * éè¿åå·¥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) { |
| | | LambdaQueryWrapper<StaffSalaryMain> staffSalaryMainLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | |
| | | return AjaxResult.error("åæ°é误"); |
| | | } |
| | | // å¾
å®¡æ ¸ä¸å¯ç¼è¾ |
| | | if(staffSalaryMain1.getStatus() > 2){ |
| | | return AjaxResult.error("å¾
å®¡æ ¸ä¸å¯ç¼è¾"); |
| | | } |
| | | // if(staffSalaryMain1.getStatus() > 3){ |
| | | // 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()); |
| | | if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(staffSalaryMain.getStaffSalaryDetailList())){ |
| | | staffSalaryDetailMapper.delete(new LambdaQueryWrapper<StaffSalaryDetail>().eq(StaffSalaryDetail::getMainId, staffSalaryMain.getId())); |
| | | staffSalaryMain.getStaffSalaryDetailList().forEach(detail -> { |
| | | 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.account.mapper.SalesReceiptReturnMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.pojo.SalesReceiptReturn"> |
| | | <id column="id" property="id" /> |
| | | <result column="refund_id" property="refundId" /> |
| | | <result column="payment_account" property="paymentAccount" /> |
| | | <result column="payment_account_name" property="paymentAccountName" /> |
| | | <result column="payment_method" property="paymentMethod" /> |
| | | <result column="actual_amount" property="actualAmount" /> |
| | | <result column="fee" property="fee" /> |
| | | <result column="transaction_no" property="transactionNo" /> |
| | | <result column="discount_amount" property="discountAmount" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_user" property="createUser" /> |
| | | </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.account.mapper.SalesRefundAmountOrderMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.account.pojo.SalesRefundAmountOrder"> |
| | | <id column="id" property="id" /> |
| | | <result column="return_management_id" property="returnManagementId" /> |
| | | <result column="status" property="status" /> |
| | | <result column="refund_amount" property="refundAmount" /> |
| | | <result column="refunded_amount" property="refundedAmount" /> |
| | | <result column="not_refunded_amount" property="notRefundedAmount" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_user_id" property="createUserId" /> |
| | | <result column="update_user_id" property="updateUserId" /> |
| | | </resultMap> |
| | | <select id="pageSalesRefundAmountOrderDto" resultType="com.ruoyi.account.dto.SalesRefundAmountOrderDto"> |
| | | select sl.sales_contract_no, |
| | | sl.customer_contract_no, |
| | | slp.specification_model, |
| | | slp.product_category as product_name, |
| | | slp.unit, |
| | | sl.customer_name, |
| | | rm.return_no as return_management_no, |
| | | srao.* |
| | | from sales_refund_amount_order srao |
| | | left join return_management rm on srao.return_management_id = rm.id |
| | | left join return_sale_product rs on rm.id = rs.return_management_id |
| | | left join sales_ledger_product slp on rs.return_sale_ledger_product_id = slp.id |
| | | left join sales_ledger sl on slp.sales_ledger_id = sl.id |
| | | <where> |
| | | <if test="ew.salesContractNo != null and ew.salesContractNo !=''"> |
| | | and sl.sales_contract_no like concat('%',#{ew.salesContractNo},'%') |
| | | </if> |
| | | <if test="ew.returnManagementNo != null and ew.returnManagementNo !=''"> |
| | | and rm.return_no like concat('%',#{ew.returnManagementNo},'%') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | GROUP BY return_sale_ledger_product_id) rs ON rs.return_sale_ledger_product_id = slp.id |
| | | where rm.id =#{returnManagementId} |
| | | </select> |
| | | <select id="listReturnSaleProduct" resultType="com.ruoyi.procurementrecord.dto.ReturnSaleProductDto"> |
| | | select rsp.*,slp.tax_inclusive_unit_price ,slp.tax_inclusive_total_price*rsp.num as price |
| | | from return_sale_product rsp |
| | | left join sales_ledger_product slp on slp.id = rsp.return_sale_ledger_product_id |
| | | where rsp.return_management_id = #{returnManagementId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | department_name,order_date,order_amount, |
| | | remark,attachment |
| | | </sql> |
| | | <select id="searchListInfo" resultType="com.ruoyi.projectManagement.vo.ListInfoVo"> |
| | | select t1.*, t2.name as project_management_plan_name,t3.title as projectManagementInfoParentName |
| | | from project_management_info as t1 |
| | | left join project_management_plan as t2 on t1.project_management_plan_id = t2.id |
| | | left join project_management_info as t3 on t1.project_management_info_parent_id = t3.id |
| | | where t1.is_delete = 0 |
| | | <if test="vo.noOrName != null and vo.noOrName != ''"> |
| | | and ( t1.no like concat('%', #{vo.noOrName}, '%') OR t1.title like concat('%', #{vo.noOrName}, '%') ) |
| | | </if> |
| | | <if test="vo.clientName != null and vo.clientName != ''"> |
| | | and t1.client_name like concat('%', #{vo.clientName}, '%') |
| | | </if> |
| | | <if test="vo.salesmanName != null and vo.salesmanName != ''"> |
| | | and t1.salesman_name like concat('%', #{vo.salesmanName}, '%') |
| | | </if> |
| | | <if test="vo.reviewStatus != null"> |
| | | and t1.review_status = #{vo.reviewStatus.code} |
| | | </if> |
| | | <if test="vo.stage != null"> |
| | | and t1.stage = #{vo.stage.code} |
| | | </if> |
| | | 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.purchase.mapper.PurchaseReturnOrderProductsMapper"> |
| | | |
| | | <!-- éç¨æ¥è¯¢æ å°ç»æ --> |
| | | <resultMap id="BaseResultMap" type="com.ruoyi.purchase.pojo.PurchaseReturnOrderProducts"> |
| | | <id column="id" property="id" /> |
| | | <result column="purchase_return_order_id" property="purchaseReturnOrderId" /> |
| | | <result column="sales_ledger_product_id" property="salesLedgerProductId" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="num" property="num" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |