czt
2025-12-01 096296cd7485c5583c8194d88cca700e3c4d84a0
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutNoticeService.java
@@ -1,8 +1,10 @@
package com.fzzy.igds.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.data.NoticeDto;
import com.fzzy.igds.data.NoticeParam;
import com.fzzy.igds.mapper.InoutNoticeInMapper;
import com.fzzy.igds.mapper.InoutNoticeMapper;
import com.fzzy.igds.repository.InoutNoticeInRepository;
import com.fzzy.igds.repository.InoutNoticeOutRepository;
@@ -12,14 +14,17 @@
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * @Description 出入库通知单service层,包含入库通知单和出库通知单
@@ -37,15 +42,27 @@
    @Resource
    private InoutNoticeMapper noticeMapper;
    /**
    @Resource
    private InoutNoticeInMapper noticeInMapper;
/*    *//**
     * JPA分页查询数据
     *
     * @param specification
     * @param pageable
     * @return
     */
     *//*
    public Page<InoutNoticeIn> queryAllNoticeIn(Specification<InoutNoticeIn> specification, Pageable pageable) {
        return noticeInRepository.findAll(specification, pageable);
    }*/
    public void pageQueryIn(Page<InoutNoticeIn> page, NoticeParam param) {
        QueryWrapper<InoutNoticeIn> queryWrapper = new QueryWrapper<>();
        if(null == param) param = new NoticeParam();
        param.setCompanyId(ContextUtil.getCompanyId());
        queryWrapper.eq("company_id", param.getCompanyId());
        noticeInMapper.selectPage(page, queryWrapper);
    }
    /**
@@ -77,15 +94,20 @@
     * @return
     */
    public String saveOrUpdateIn(InoutNoticeIn data) {
        if (Constant.YN_Y.equals(data.getTag())) {
        if (null == data.getUpdateBy()) {
            data.setUpdateBy(ContextUtil.getLoginUserName());
            data.setUpdateTime(new Date());
            data.setCreateBy(ContextUtil.getLoginUserName());
            data.setCreateTime(new Date());
            data.setAuditStatus(Constant.COMPLETE_STATUS_NONE);
            data.setCompleteStatus(Constant.COMPLETE_STATUS_NONE);
            noticeInRepository.save(data);
        } else {
            data.setUpdateBy(ContextUtil.getLoginUserName());
            data.setUpdateTime(new Date());
            noticeInRepository.save(data);
        }
        data.setUpdateBy(ContextUtil.getLoginUserName());
        data.setUpdateTime(new Date());
        noticeInRepository.save(data);
        return null;
    }
@@ -108,7 +130,8 @@
     * @return
     */
    public Page<InoutNoticeOut> queryAllNoticeOut(Specification<InoutNoticeOut> specification, Pageable pageable) {
        return noticeOutRepository.findAll(specification, pageable);
        //return noticeOutRepository.findAll(specification, pageable);
        return null;
    }
    /**
@@ -285,4 +308,5 @@
        return null;
    }
}