maven
6 小时以前 5eec9b5a9d8bf9e49663d5a51cab7490fef5b204
yys  生产管控(完成基本功能)
已修改13个文件
已添加7个文件
474 ■■■■■ 文件已修改
main-business/src/main/java/com/ruoyi/business/controller/ProductionSchedulingController.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/dto/OfficialInventoryDto.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/entity/OfficialInventory.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/entity/PendingInventory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/entity/Production.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/entity/ProductionScheduling.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/entity/PurchaseRegistration.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/mapper/ProductionSchedulingMapper.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/service/ProductionSchedulingService.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/service/impl/PendingInventoryServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/service/impl/ProductionMasterServiceImpl.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/service/impl/ProductionSchedulingServiceImpl.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/service/impl/ProductionServiceImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/resources/db/migration/postgresql/V20250603160101__create_table_purchase_registration.sql 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/resources/db/migration/postgresql/V20250604101800__create_table_production.sql 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/resources/db/migration/postgresql/V20250604104500__create_table_pending_inventory.sql 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/resources/db/migration/postgresql/V20250604111200__create_table_official_inventory.sql 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/resources/db/migration/postgresql/V20250825111200__create_table_production_scheduling.sql 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/resources/mapper/ProductionSchedulingMapper.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
main-business/src/main/java/com/ruoyi/business/controller/ProductionSchedulingController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
package com.ruoyi.business.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.business.dto.PurchaseRegistrationDto;
import com.ruoyi.business.entity.ProductionScheduling;
import com.ruoyi.business.entity.PurchaseRegistration;
import com.ruoyi.business.service.ProductionSchedulingService;
import com.ruoyi.common.core.domain.R;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
 * @author :yys
 * @date : 2025/8/25 16:39
 */
@RestController
@AllArgsConstructor
@RequestMapping("/productionScheduling")
public class ProductionSchedulingController {
    @Autowired
    private ProductionSchedulingService productionSchedulingService;
    @GetMapping("/list")
    public R<IPage<ProductionScheduling>> list(Page<ProductionScheduling> page, ProductionScheduling productionScheduling) {
        IPage<ProductionScheduling> list = productionSchedulingService.listPage(page,productionScheduling);
        return R.ok(list);
    }
    @PostMapping("/addProductionScheduling")
    @Transactional(rollbackFor = Exception.class)
    public R addProductionScheduling(@RequestBody List<ProductionScheduling> productionScheduling) {
        boolean save = productionSchedulingService.addProductionScheduling(productionScheduling);
        return save ? R.ok() : R.fail();
    }
    @PostMapping("/updateProductionScheduling")
    @Transactional(rollbackFor = Exception.class)
    public R updateProductionScheduling(@RequestBody ProductionScheduling productionScheduling) {
        boolean update = productionSchedulingService.updateById(productionScheduling);
        return update ? R.ok() : R.fail();
    }
    @DeleteMapping("/delProductionScheduling")
    @Transactional(rollbackFor = Exception.class)
    public R delProductionScheduling(@RequestBody List<Long> ids) {
        boolean delete = productionSchedulingService.removeByIds(ids);
        return delete ? R.ok() : R.fail();
    }
    @PostMapping("/work")
    @Transactional(rollbackFor = Exception.class)
    public R work(@RequestBody ProductionScheduling productionScheduling) {
        boolean update = productionSchedulingService.work(productionScheduling);
        return update ? R.ok() : R.fail();
    }
}
main-business/src/main/java/com/ruoyi/business/dto/OfficialInventoryDto.java
@@ -14,6 +14,8 @@
    private List<Long> ids;//要合并的正式库的id
    private Integer type;
    private String coal; //煤种
    private String supplierName; //供应商
main-business/src/main/java/com/ruoyi/business/entity/OfficialInventory.java
@@ -38,6 +38,12 @@
    private Long supplierId;
    /**
     * ç…¤æ–™ç±»åž‹ 1-成品 2-原料
     */
    @TableField(value = "type")
    private Integer type;
    /**
     * ç…¤ç§
     */
    @TableField(value = "coal_id")
main-business/src/main/java/com/ruoyi/business/entity/PendingInventory.java
@@ -55,6 +55,11 @@
    @TableField(value = "coal_id")
    private Long coalId;
    /**
     * ç…¤æ–™ç±»åž‹ 1-成品 2-原料
     */
    @TableField(value = "type")
    private Integer type;
    /**
     * å•位
     */
    @TableField(value = "unit")
main-business/src/main/java/com/ruoyi/business/entity/Production.java
@@ -82,4 +82,16 @@
     */
    @TableField(value = "production_date")
    private LocalDate productionDate;
    /**
     * ç…¤æ–™ç±»åž‹(1-成品 2-原料)
     */
    @TableField(value = "type")
    private Integer type;
    /**
     * çŠ¶æ€ï¼ˆ1-待排产 2-排产中 3-已排产)
     */
    @TableField(value = "status")
    private Integer status;
}
main-business/src/main/java/com/ruoyi/business/entity/ProductionScheduling.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,102 @@
package com.ruoyi.business.entity;
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 com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.MyBaseEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;
/**
 * @author :yys
 * @date : 2025/8/25 16:28
 */
@Data
@TableName("production_scheduling")
public class ProductionScheduling extends MyBaseEntity {
    private static final long serialVersionUID = 1L;
    /**
     * ä¸»é”®ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     *  ç”Ÿäº§æ˜Žç»†id
     */
    @TableField(value = "production_id")
    private Long productionId;
    /**
     * ç…¤ç§ID
     */
    @TableField(value = "coal_id")
    private Long coalId;
    /**
     * æ€»æ•°é‡
     */
    @TableField(exist = false)
    private BigDecimal productionQuantity;
    /**
     * æŽ’产数量
     */
    @TableField(value = "scheduling_num")
    private BigDecimal schedulingNum;
    /**
     * å…¥åº“数量
     */
    @TableField(value = "success_num")
    private BigDecimal successNum;
    /**
     * ç…¤æ–™ç±»åž‹ï¼ˆ1-成品 2-原料)
     */
    @TableField(value = "type")
    private Integer type;
    /**
     *状态(1-待生产 2-生产中 3-已报工)
     */
    @TableField(value = "status")
    private Integer status;
    /**
     * å•位
     */
    @TableField(value = "unit")
    private String unit;
    /**
     * å·¥åºï¼ˆå­—典)
     */
    @TableField(value = "process")
    private String process;
    /**
     * å·¥æ—¶å®šé¢
     */
    @TableField(value = "work_hours")
    private BigDecimal workHours;
    /**
     * æŽ’产日期
     */
    @TableField(value = "scheduling_date")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date schedulingDate;
    /**
     * æŽ’产人id
     */
    @TableField(value = "scheduling_user_id")
    private Long schedulingUserId;
    /**
     * æŽ’产人名称
     */
    @TableField(value = "scheduling_user_name")
    private String schedulingUserName;
}
main-business/src/main/java/com/ruoyi/business/entity/PurchaseRegistration.java
@@ -93,4 +93,10 @@
     */
    @TableField(value = "freight")
    private BigDecimal freight;
    /**
     * ç±»åž‹ï¼ˆ1-成品,2-原料)
     */
    @TableField(value = "type")
    private Integer type;
}
main-business/src/main/java/com/ruoyi/business/mapper/ProductionSchedulingMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package com.ruoyi.business.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.business.entity.ProductionScheduling;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
 * @author :yys
 * @date : 2025/8/25 16:35
 */
@Mapper
public interface ProductionSchedulingMapper extends BaseMapper<ProductionScheduling> {
    /**
     * æŸ¥è¯¢åˆ—表
     *
     * @param page
     * @param productionScheduling
     * @return
     */
    IPage<ProductionScheduling> listPage(Page<ProductionScheduling> page,@Param("req") ProductionScheduling productionScheduling);
}
main-business/src/main/java/com/ruoyi/business/service/ProductionSchedulingService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,28 @@
package com.ruoyi.business.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.business.entity.ProductionScheduling;
import java.util.List;
/**
 * @author :yys
 * @date : 2025/8/25 16:37
 */
public interface ProductionSchedulingService extends IService<ProductionScheduling> {
    /**
     * åˆ†é¡µæŸ¥è¯¢
     *
     * @param page
     * @param productionScheduling
     * @return
     */
    IPage<ProductionScheduling> listPage(Page<ProductionScheduling> page, ProductionScheduling productionScheduling);
    boolean addProductionScheduling(List<ProductionScheduling> productionScheduling);
    boolean work(ProductionScheduling productionScheduling);
}
main-business/src/main/java/com/ruoyi/business/service/impl/PendingInventoryServiceImpl.java
@@ -19,6 +19,7 @@
import com.ruoyi.basic.service.CoalFieldService;
import com.ruoyi.basic.service.CoalPlanService;
import com.ruoyi.basic.service.CoalValueService;
import com.ruoyi.business.constant.InventoryRecordConstant;
import com.ruoyi.business.dto.PendingInventoryDto;
import com.ruoyi.business.entity.OfficialInventory;
import com.ruoyi.business.entity.PendingInventory;
@@ -290,6 +291,7 @@
                officialInventory.setPendingId(pendingInventoryDto.getPId());
                officialInventory.setInventoryQuantity(quantity);
                officialInventory.setRegistrantId(1L);
                officialInventory.setType(pendingInventory.getType());
                officialInventory.setSupplierId(pendingInventoryDto.getSupplierId());
                officialInventoryMapper.insert(officialInventory);
            } else {
main-business/src/main/java/com/ruoyi/business/service/impl/ProductionMasterServiceImpl.java
@@ -173,7 +173,7 @@
        batchInsertInventories(masterId, dto.getProductionInventoryList());
        // æ’入待入库数据
        insertPendingInventory(dto.getProductionList());
//        insertPendingInventory(dto.getProductionList());
        return 1;
    }
@@ -263,6 +263,7 @@
            BeanUtils.copyProperties(p, copy);
            copy.setId(null);
            copy.setProductionMasterId(masterId);
            copy.setStatus(1);
            productionMapper.insert(copy);
        }
    }
@@ -283,7 +284,7 @@
    /**
     * å°†åŠ å·¥äº§ç”Ÿçš„äº§å“è®°å½•åˆ°å¾…å…¥åº“è¡¨
     */
    private void insertPendingInventory(List<Production> list) {
    public void insertPendingInventory(List<Production> list) {
        LocalDate currentDate = LocalDate.now();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String formattedDate = currentDate.format(formatter);
@@ -402,20 +403,20 @@
        }
        // æ‰¹é‡æ›´æ–°å®˜æ–¹åº“å­˜
        for (Map.Entry<Long, BigDecimal> entry : inventoryAdjustMap.entrySet()) {
            OfficialInventory official = officialInventoryMapper.selectById(entry.getKey());
            if (official == null) {
                throw new BaseException("官方库存不存在,ID: " + entry.getKey());
            }
            // ä½¿ç”¨çº¿ç¨‹å®‰å…¨çš„BigDecimal操作
            official.setInventoryQuantity(
                    Optional.ofNullable(official.getInventoryQuantity())
                            .orElse(BigDecimal.ZERO)
                            .add(entry.getValue())
            );
            officialInventoryMapper.updateById(official);
        }
//        for (Map.Entry<Long, BigDecimal> entry : inventoryAdjustMap.entrySet()) {
//            OfficialInventory official = officialInventoryMapper.selectById(entry.getKey());
//            if (official == null) {
//                throw new BaseException("官方库存不存在,ID: " + entry.getKey());
//            }
//
//            // ä½¿ç”¨çº¿ç¨‹å®‰å…¨çš„BigDecimal操作
//            official.setInventoryQuantity(
//                    Optional.ofNullable(official.getInventoryQuantity())
//                            .orElse(BigDecimal.ZERO)
//                            .add(entry.getValue())
//            );
//            officialInventoryMapper.updateById(official);
//        }
        // æ‰¹é‡åˆ é™¤ç”Ÿäº§åº“å­˜
        if (!productionIdsToDelete.isEmpty()) {
main-business/src/main/java/com/ruoyi/business/service/impl/ProductionSchedulingServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,103 @@
package com.ruoyi.business.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.entity.Production;
import com.ruoyi.business.entity.ProductionScheduling;
import com.ruoyi.business.mapper.ProductionMapper;
import com.ruoyi.business.mapper.ProductionSchedulingMapper;
import com.ruoyi.business.service.ProductionSchedulingService;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.mapper.SysUserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
/**
 * @author :yys
 * @date : 2025/8/25 16:38
 */
@Service
@Slf4j
public class ProductionSchedulingServiceImpl extends ServiceImpl<ProductionSchedulingMapper, ProductionScheduling> implements ProductionSchedulingService {
    @Autowired
    private ProductionSchedulingMapper productionSchedulingMapper;
    @Autowired
    private ProductionMapper productionMapper;
    @Autowired
    private SysUserMapper sysUserMapper;
    @Autowired
    private ProductionMasterServiceImpl productionMasterService;
    @Override
    public IPage<ProductionScheduling> listPage(Page<ProductionScheduling> page, ProductionScheduling productionScheduling) {
        return productionSchedulingMapper.listPage(page, productionScheduling);
    }
    @Override
    public boolean addProductionScheduling(List<ProductionScheduling> productionScheduling) {
        if (CollectionUtils.isEmpty(productionScheduling)) {
            return false;
        }
        BigDecimal reduce = productionScheduling.stream()
                .map(ProductionScheduling::getSchedulingNum)
                .reduce(BigDecimal.ZERO, BigDecimal::add);
        if(reduce.compareTo(productionScheduling.get(0).getProductionQuantity()) < 0){
            return false;
        }
        Production production = productionMapper.selectById(productionScheduling.get(0).getProductionId());
        if(production == null){
            throw new RuntimeException("生产订单为空");
        }
        production.setStatus(2);
        if(reduce.compareTo(productionScheduling.get(0).getProductionQuantity()) == 0){
            production.setStatus(3);
        }
        productionMapper.updateById(production);
        for (ProductionScheduling scheduling : productionScheduling) {
            SysUser sysUser = sysUserMapper.selectUserById(scheduling.getSchedulingUserId());
            if(sysUser == null) throw new RuntimeException("排产人员不存在");
            scheduling.setStatus(1);
            scheduling.setSchedulingUserName(sysUser.getNickName());
            productionSchedulingMapper.insert(scheduling);
        }
        return true;
    }
    @Override
    public boolean work(ProductionScheduling productionScheduling) {
        ProductionScheduling productionScheduling1 = productionSchedulingMapper.selectById(productionScheduling.getId());
        if(productionScheduling1 == null){
            throw new RuntimeException("生产报工不存在");
        }
        Production production = productionMapper.selectById(productionScheduling1.getProductionId());
        if(production == null){
            throw new RuntimeException("生产订单为空");
        }
        production.setProductionQuantity(productionScheduling.getSuccessNum());
        production.setProducerId(productionScheduling.getSchedulingUserId());
        // å…¥åº“
        productionMasterService.insertPendingInventory(Arrays.asList(production));
        // ä¿®æ”¹æŠ¥å·¥è¡¨çš„入库数量
        productionScheduling1.setSuccessNum(productionScheduling1.getSuccessNum().add(productionScheduling.getSuccessNum()));
        productionScheduling1.setStatus(2);
        // å…¥åº“数量 == æŽ’产数量 åˆ™ä¿®æ”¹ç”Ÿäº§è®¢å•状态
        if(productionScheduling1.getSuccessNum().compareTo(productionScheduling1.getSchedulingNum()) == 0){
            productionScheduling1.setStatus(3);
        }
        productionSchedulingMapper.updateById(productionScheduling1);
        return true;
    }
}
main-business/src/main/java/com/ruoyi/business/service/impl/ProductionServiceImpl.java
@@ -11,6 +11,7 @@
import com.ruoyi.business.service.ProductionService;
import com.ruoyi.common.utils.bean.BeanUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Objects;
@@ -27,6 +28,7 @@
@RequiredArgsConstructor
public class ProductionServiceImpl extends ServiceImpl<ProductionMapper, Production> implements ProductionService {
    @Autowired
    private ProductionMapper productionMapper;
    @Override
main-business/src/main/java/com/ruoyi/business/service/impl/PurchaseRegistrationServiceImpl.java
@@ -127,6 +127,7 @@
        pendingInventory.setPurchaseId(purchaseRegistration.getId());
        pendingInventory.setCoalId(purchaseRegistration.getCoalId());
        pendingInventory.setInventoryQuantity(purchaseRegistration.getPurchaseQuantity());
        pendingInventory.setType(purchaseRegistration.getType());
        return pendingInventory;
    }
main-business/src/main/resources/db/migration/postgresql/V20250603160101__create_table_purchase_registration.sql
@@ -21,7 +21,8 @@
    create_by                 VARCHAR(255),                      -- åˆ›å»ºäººç”¨æˆ·å
    create_time               TIMESTAMP WITHOUT TIME ZONE,       -- åˆ›å»ºæ—¶é—´ï¼Œé»˜è®¤å½“前时间
    update_by                 VARCHAR(255),                      -- æœ€åŽæ›´æ–°äººç”¨æˆ·å
    update_time               TIMESTAMP WITHOUT TIME ZONE        -- æœ€åŽæ›´æ–°æ—¶é—´ï¼Œé»˜è®¤å½“前时间
    update_time               TIMESTAMP WITHOUT TIME ZONE,        -- æœ€åŽæ›´æ–°æ—¶é—´ï¼Œé»˜è®¤å½“前时间
    type                      BIGINT,                              -- ç±»åž‹ï¼ˆ1-成品,2-原料)
);
-- ä¸ºè¡¨æ·»åŠ æ³¨é‡Š
@@ -46,4 +47,5 @@
COMMENT ON COLUMN purchase_registration.create_by IS '创建该记录的用户';
COMMENT ON COLUMN purchase_registration.create_time IS '记录创建时间';
COMMENT ON COLUMN purchase_registration.update_by IS '最后修改该记录的用户';
COMMENT ON COLUMN purchase_registration.update_time IS '记录最后更新时间';
COMMENT ON COLUMN purchase_registration.update_time IS '记录最后更新时间';
COMMENT ON COLUMN purchase_registration.type IS '类型(1-成品,2-原料)';
main-business/src/main/resources/db/migration/postgresql/V20250604101800__create_table_production.sql
@@ -13,6 +13,8 @@
    producer_id             BIGINT,                       -- ç”Ÿäº§äººid
    producer                VARCHAR(50),                       -- ç”Ÿäº§äºº
    production_date         DATE,                              -- ç”Ÿäº§æ—¥æœŸ
    type                    BIGINT,                                 -- ç…¤æ–™ç±»åž‹ 1-成品 2-原料
    status                  BIGINT,                           -- çŠ¶æ€ï¼ˆ1-待排产 2-已排产)
    deleted                 INT            NOT NULL DEFAULT 0, -- è½¯åˆ é™¤æ ‡å¿—:0=未删除,1=已删除
    create_by               VARCHAR(255),                      -- åˆ›å»ºäººç”¨æˆ·å
@@ -35,6 +37,8 @@
COMMENT ON COLUMN production.total_cost IS '总成本';
COMMENT ON COLUMN production.producer IS '生产人';
COMMENT ON COLUMN production.production_date IS '生产日期';
COMMENT ON COLUMN production.type IS '煤料类型 1-成品 2-原料';
COMMENT ON COLUMN production.status IS '状态(1-待排产 2-已排产)';
COMMENT ON COLUMN production.deleted IS '软删除标志,0=未删除,1=已删除';
COMMENT ON COLUMN production.create_by IS '创建该记录的用户';
main-business/src/main/resources/db/migration/postgresql/V20250604104500__create_table_pending_inventory.sql
@@ -18,6 +18,7 @@
    master_id                 BIGINT,                                 -- ç”Ÿäº§åŠ å·¥id
    purchase_id               BIGINT,                                 -- é‡‡è´­id
    coal_plan_id               BIGINT,                                 -- ç…¤è´¨æ–¹æ¡ˆid
    type               BIGINT,                                 -- ç…¤æ–™ç±»åž‹ 1-成品 2-原料
    deleted                   INTEGER      DEFAULT 0,                 -- è½¯åˆ é™¤æ ‡å¿—,0=未删除,1=已删除
    create_by                 VARCHAR(255),                           -- åˆ›å»ºè¯¥è®°å½•的用户
@@ -37,6 +38,7 @@
COMMENT ON COLUMN pending_inventory.price_including_tax IS '单价(含税)';
COMMENT ON COLUMN pending_inventory.total_price_including_tax IS '总价(含税)';
COMMENT ON COLUMN pending_inventory.registrant IS '登记人';
COMMENT ON COLUMN pending_inventory.type IS '煤料类型 1-成品 2-原料';
COMMENT ON COLUMN pending_inventory.registration_time IS '登记时间';
COMMENT ON COLUMN pending_inventory.price_excluding_tax IS '单价(不含税)';
COMMENT ON COLUMN pending_inventory.total_price_excluding_tax IS '总价(不含税)';
main-business/src/main/resources/db/migration/postgresql/V20250604111200__create_table_official_inventory.sql
@@ -12,7 +12,7 @@
    total_price_excluding_tax DECIMAL(10, 2) NOT NULL,           -- ä¸å«ç¨Žæ€»ä»·
    pending_replenishment     DECIMAL(10, 0),                    -- å¾…补库
    registrant_id             BIGINT         NOT NULL,           -- ç™»è®°äººid
    type                      VARCHAR(50),                       -- ç±»åž‹       1 é‡‡è´­/ 2 æ­£å¼   å…¥åº“
    type                      BIGINT,                            -- ç…¤æ–™ç±»åž‹       1 æˆå“/ 2 åŽŸæ–™
    pending_id                BIGINT,                            -- å¾…入库id
    coal_plan_id               BIGINT,                                 -- ç…¤è´¨æ–¹æ¡ˆid
    merge_id                  VARCHAR(255),                      -- åˆå¹¶id
@@ -37,6 +37,7 @@
COMMENT ON COLUMN official_inventory.price_including_tax IS '单价(含税)';
COMMENT ON COLUMN official_inventory.total_price_including_tax IS '总价(含税)';
COMMENT ON COLUMN official_inventory.pending_replenishment IS '待补库';
COMMENT ON COLUMN official_inventory.type IS '煤料类型       1 æˆå“/ 2 åŽŸæ–™';
COMMENT ON COLUMN official_inventory.registrant_id IS '登记人id';
COMMENT ON COLUMN official_inventory.registration_date IS '登记日期';
COMMENT ON COLUMN official_inventory.merge_id IS '合并id';
main-business/src/main/resources/db/migration/postgresql/V20250825111200__create_table_production_scheduling.sql
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,59 @@
-- åˆ›å»ºæ­£å¼åº“表
CREATE TABLE production_scheduling
(
    id BIGSERIAL PRIMARY KEY,  -- BIGSERIAL å¯¹åº” int8
    production_id int8 NOT NULL DEFAULT 0,
    coal_id                 BIGINT         NOT NULL DEFAULT 0, -- ç…¤ç§ID
    scheduling_num numeric(10,2),
    type int8,
    status int8,
    unit varchar(50),
    process varchar(50) NOT NULL,
    work_hours numeric(10,2) NOT NULL,
    scheduling_date date,
    scheduling_user_id int8,
    scheduling_user_name varchar(50),
    deleted int4 NOT NULL DEFAULT 0,
    create_by varchar(255) COLLATE "pg_catalog"."default",
    create_time timestamp(6),
    update_by varchar(255) COLLATE "pg_catalog"."default",
    success_num int8 DEFAULT 0,
    update_time timestamp(6)
);
COMMENT ON COLUMN "production_scheduling"."id" IS '主键ID';
COMMENT ON COLUMN "production_scheduling"."production_id" IS '生产明细id';
COMMENT ON COLUMN production_scheduling.coal_id IS '煤种ID';
COMMENT ON COLUMN "production_scheduling"."scheduling_num" IS '排产数量';
COMMENT ON COLUMN "production_scheduling"."unit" IS '单位';
COMMENT ON COLUMN "production_scheduling"."process" IS '工序(字典)';
COMMENT ON COLUMN "production_scheduling"."work_hours" IS '工时定额';
COMMENT ON COLUMN "production_scheduling"."scheduling_date" IS '排产日期';
COMMENT ON COLUMN "production_scheduling"."scheduling_user_id" IS '排产人id';
COMMENT ON COLUMN "production_scheduling"."scheduling_user_name" IS '排产人名称';
COMMENT ON COLUMN "production_scheduling"."deleted" IS '软删除标志,0=未删除,1=已删除';
COMMENT ON COLUMN "production_scheduling"."create_by" IS '创建该记录的用户';
COMMENT ON COLUMN "production_scheduling"."create_time" IS '记录创建时间';
COMMENT ON COLUMN "production_scheduling"."production_scheduling"."update_by" IS '最后修改该记录的用户';
COMMENT ON COLUMN "production_scheduling"."production_scheduling"."update_time" IS '记录最后更新时间';
COMMENT ON COLUMN "production_scheduling"."production_scheduling"."type" IS '煤料类型(1-成品 2-原料)';
COMMENT ON COLUMN "production_scheduling"."production_scheduling"."status" IS '状态(1-待生产 2-生产中 3-已报工)';
COMMENT ON COLUMN "production_scheduling"."production_scheduling"."success_num" IS '入库数量';
COMMENT ON TABLE "public"."production_scheduling" IS '生产报工表';
main-business/src/main/resources/mapper/ProductionSchedulingMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
<?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.business.mapper.ProductionSchedulingMapper">
    <select id="listPage" resultType="com.ruoyi.business.entity.ProductionScheduling">
        select * from production_scheduling where deleted = 0
    </select>
</mapper>