czt
2025-12-31 c6fdc1e8ec03c93977de6ddbebf84613c7d8b26e
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutNoticeService.java
@@ -3,8 +3,11 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzzy.igds.constant.AuditStatus;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.data.ExportWordParam;
import com.fzzy.igds.data.NoticeDto;
import com.fzzy.igds.data.NoticeParam;
import com.fzzy.igds.domain.Depot;
import com.fzzy.igds.domain.Dept;
import com.fzzy.igds.mapper.InoutNoticeInMapper;
import com.fzzy.igds.mapper.InoutNoticeOutMapper;
import com.fzzy.igds.domain.InoutNoticeIn;
@@ -12,12 +15,15 @@
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description 出入库通知单service层,包含入库通知单和出库通知单
@@ -32,6 +38,10 @@
    private InoutNoticeInMapper noticeInMapper;
    @Resource
    private InoutNoticeOutMapper noticeOutMapper;
    @Resource
    private DepotService depotService;
    @Resource
    private CoreDeptService coreDeptService;
    /*----------------------入库通知单信息-------------------------*/
    /**
@@ -381,4 +391,110 @@
        return null;
    }
    /**
     *
     * @param param
     * @return
     */
    public ExportWordParam handleInData(ExportWordParam param) {
        InoutNoticeIn notice = this.getNoticeInOne(param.getBizId());
        //转换为模板需要的map数据源
        Map<String, Object> map = new HashMap();
        map.put("serId", notice.getId());
        map.put("name", notice.getName());
        String type = "";
        if("10".equals(notice.getType())){
            type = "库区通知单";
        }
        if("20".equals(notice.getType())){
            type = "监管通知单";
        }
        map.put("type", type);
        map.put("customerName", notice.getCustomerName());
        String unitName = "";
        Dept dept = coreDeptService.getDeptById(notice.getUnitName());
        if(dept != null){
            unitName = dept.getKqmc();
        }
        map.put("unitName", unitName);
        Depot depot = depotService.getCacheDepot(notice.getCompanyId(), notice.getDepotId());
        String depotId = "";
        if(dept != null){
            depotId = depot.getName();
        }
        map.put("depotId", depotId);
        map.put("year", notice.getYear());
        map.put("targetNumber", notice.getTargetNumber());
        map.put("completeNumber", notice.getCompleteNumber());
        map.put("completeStatus", notice.getCompleteStatus());
        map.put("contract", notice.getContract());
        map.put("remark", notice.getRemark());
        map.put("createUser", notice.getCreateBy());
        map.put("createTime", DateFormatUtils.format(notice.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
        param.setDataMap(map);
        return param;
    }
    /**
     *
     * @param param
     * @return
     */
    public ExportWordParam handleOutData(ExportWordParam param) {
        InoutNoticeOut notice = this.getNoticeOutOne(param.getBizId());
        //转换为模板需要的map数据源
        Map<String, Object> map = new HashMap();
        map.put("serId", notice.getId());
        map.put("name", notice.getName());
        String type = "";
        if("10".equals(notice.getType())){
            type = "库区通知单";
        }
        if("20".equals(notice.getType())){
            type = "监管通知单";
        }
        map.put("type", type);
        map.put("customerName", notice.getCustomerName());
        String unitName = "";
        Dept dept = coreDeptService.getDeptById(notice.getUnitName());
        if(dept != null){
            unitName = dept.getKqmc();
        }
        map.put("unitName", unitName);
        Depot depot = depotService.getCacheDepot(notice.getCompanyId(), notice.getDepotId());
        String depotId = "";
        if(dept != null){
            depotId = depot.getName();
        }
        map.put("depotId", depotId);
        map.put("year", notice.getYear());
        map.put("targetNumber", notice.getTargetNumber());
        map.put("completeNumber", notice.getCompleteNumber());
        map.put("completeStatus", notice.getCompleteStatus());
        map.put("contract", notice.getContract());
        map.put("remark", notice.getRemark());
        map.put("createUser", notice.getCreateBy());
        map.put("createTime", DateFormatUtils.format(notice.getCreateTime(), "yyyy-MM-dd HH:mm:ss"));
        param.setDataMap(map);
        return param;
    }
}