Merge remote-tracking branch 'origin/dev_New' into dev_New
| | |
| | | id bigint auto_increment primary key, |
| | | purchase_return_order_id bigint not null default 0 comment '退货单id', |
| | | sales_ledger_product_id bigint not null default 0 comment '采购产品id', |
| | | return_quantity decimal(16, 4) not null default 0 comment '退货数量', |
| | | create_time datetime null comment '录入时间', |
| | | update_time datetime null comment '更新时间', |
| | | index idx_purchase_return_order_id (purchase_return_order_id), |
| | |
| | | package com.ruoyi.purchase.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @since 2026-03-09 01:37:44 |
| | | * @since 2026-03-10 04:45:35 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/purchaseReturnOrderProducts") |
| | | @Api(tags = "采购退货产品") |
| | | public class PurchaseReturnOrderProductsController { |
| | | |
| | | } |
| | |
| | | import com.ruoyi.purchase.dto.PurchaseReturnOrderDto; |
| | | import com.ruoyi.purchase.mapper.PurchaseReturnOrdersMapper; |
| | | import com.ruoyi.purchase.service.PurchaseReturnOrdersService; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/purchaseReturnOrders") |
| | | @Api(tags = "采购退货单") |
| | | public class PurchaseReturnOrdersController { |
| | | @Autowired |
| | | private PurchaseReturnOrdersService purchaseReturnOrdersService; |
| | |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @since 2026-03-09 01:37:44 |
| | | * @since 2026-03-10 04:45:35 |
| | | */ |
| | | @Mapper |
| | | public interface PurchaseReturnOrderProductsMapper extends BaseMapper<PurchaseReturnOrderProducts> { |
| | |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @since 2026-03-09 01:37:44 |
| | | * @since 2026-03-10 04:45:35 |
| | | */ |
| | | @Getter |
| | | @Setter |
| | |
| | | @ApiModelProperty("采购产品id") |
| | | private Long salesLedgerProductId; |
| | | |
| | | @ApiModelProperty("退货数量") |
| | | private BigDecimal returnQuantity; |
| | | |
| | | @ApiModelProperty("录入时间") |
| | | @TableField(fill = FieldFill.INSERT) |
| | | private LocalDateTime createTime; |
| | |
| | | @ApiModelProperty("更新时间") |
| | | @TableField(fill = FieldFill.INSERT_UPDATE) |
| | | private LocalDateTime updateTime; |
| | | |
| | | @ApiModelProperty("退货数量") |
| | | private BigDecimal num; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Getter; |
| | |
| | | private Integer projectPhase; |
| | | |
| | | @ApiModelProperty("制单日期") |
| | | private LocalDateTime preparedAt; |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private LocalDate preparedAt; |
| | | |
| | | @ApiModelProperty("制单人id") |
| | | private Long preparedUserId; |
| | |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @since 2026-03-09 01:37:44 |
| | | * @since 2026-03-10 04:45:35 |
| | | */ |
| | | public interface PurchaseReturnOrderProductsService extends IService<PurchaseReturnOrderProducts> { |
| | | |
| | |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @since 2026-03-09 01:37:44 |
| | | * @since 2026-03-10 04:45:35 |
| | | */ |
| | | @Service |
| | | public class PurchaseReturnOrderProductsServiceImpl extends ServiceImpl<PurchaseReturnOrderProductsMapper, PurchaseReturnOrderProducts> implements PurchaseReturnOrderProductsService { |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean add(PurchaseReturnOrderDto purchaseReturnOrderDto) { |
| | | this.save(purchaseReturnOrderDto); |
| | | if (purchaseReturnOrderDto.getPurchaseReturnOrderProductsDtos().isEmpty()) { |
| | | if (!purchaseReturnOrderDto.getPurchaseReturnOrderProductsDtos().isEmpty()) { |
| | | for (PurchaseReturnOrderProductsDto purchaseReturnOrderProductsDto :purchaseReturnOrderDto.getPurchaseReturnOrderProductsDtos()) { |
| | | purchaseReturnOrderProductsDto.setSalesLedgerProductId(purchaseReturnOrderProductsDto.getSalesLedgerProductId()); |
| | | purchaseReturnOrderProductsDto.setPurchaseReturnOrderId(purchaseReturnOrderDto.getId()); |
| | | purchaseReturnOrderProductsDto.setReturnQuantity(purchaseReturnOrderProductsDto.getReturnQuantity()); |
| | | purchaseReturnOrderProductsMapper.insert(purchaseReturnOrderProductsDto); |
| | | } |
| | | } |
| | |
| | | <id column="id" property="id" /> |
| | | <result column="purchase_return_order_id" property="purchaseReturnOrderId" /> |
| | | <result column="sales_ledger_product_id" property="salesLedgerProductId" /> |
| | | <result column="return_quantity" property="returnQuantity" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="num" property="num" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | <result column="tenant_id" property="tenantId" /> |
| | | </resultMap> |
| | | <select id="pageSafeTraining" resultType="com.ruoyi.safe.dto.SafeTrainingDto"> |
| | | select st.*, |
| | | su.nick_name assessmentUserName, |
| | | count(std.id) nums |
| | | from safe_training st |
| | | left join safe_training_details std on std.safe_training_id = st.id |
| | | left join sys_user su on st.assessment_user_id = su.user_id |
| | | where st.state = #{c.state} |
| | | GROUP BY st.id |
| | | SELECT |
| | | st.*, |
| | | su.nick_name AS assessmentUserName, |
| | | COUNT(std.id) AS nums |
| | | FROM safe_training st |
| | | LEFT JOIN safe_training_details std ON std.safe_training_id = st.id |
| | | LEFT JOIN sys_user su ON st.assessment_user_id = su.user_id |
| | | WHERE st.state = #{c.state} |
| | | <if test="c.placeTraining != null and c.placeTraining != ''"> |
| | | and st.place_training like concat('%', #{c.placeTraining}, '%') |
| | | AND st.place_training LIKE CONCAT('%', #{c.placeTraining}, '%') |
| | | </if> |
| | | <if test="c.trainingDate != null "> |
| | | and st.training_date = date_format(#{c.trainingDate},'%Y%m%d') |
| | | AND DATE_FORMAT(st.training_date, '%Y%m%d') = DATE_FORMAT(#{c.trainingDate}, '%Y%m%d') |
| | | </if> |
| | | GROUP BY st.id, su.nick_name |
| | | </select> |
| | | <select id="getSafeTraining" resultType="com.ruoyi.safe.dto.SafeTrainingDto"> |
| | | select st.*, |