懒羊羊
2024-03-13 b64ed2c784bde6dea9d18149ca706ebe532c857d
jcdm-main/src/main/java/com/jcdm/main/bs/formulaChild/service/impl/BsFormulaChildInfoServiceImpl.java
@@ -1,9 +1,12 @@
package com.jcdm.main.bs.formulaChild.service.impl;
import java.util.Date;
import java.util.List;
import com.jcdm.common.core.domain.AjaxResult;
import com.jcdm.common.utils.DateUtils;
import com.jcdm.main.da.paramCollection.domain.DaParamCollection;
import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jcdm.main.bs.formulaChild.mapper.BsFormulaChildInfoMapper;
@@ -21,6 +24,9 @@
{
    @Autowired
    private BsFormulaChildInfoMapper bsFormulaChildInfoMapper;
    @Autowired
    private DaParamCollectionMapper daParamCollectionMapper;
    /**
     * 查询配方配置子信息
@@ -116,12 +122,26 @@
        if(bsFormulaChildInfos.size()>0){
            bsFormulaChildInfos.get(0).setResults("OK");
            bsFormulaChildInfoMapper.updateBsFormulaChildInfo(bsFormulaChildInfos.get(0));
            bsFormulaChildInfo.setParamValue(bsFormulaChildInfo.getMaterialCode());
            bsFormulaChildInfo.setParamCode(bsFormulaChildInfos.get(0).getParamCode());
            addParameterCollection(bsFormulaChildInfo);
        }else {
            return AjaxResult.error("非本工位物料,请重新扫描");
        }
        return AjaxResult.success("成功");
    }
    public void addParameterCollection(BsFormulaChildInfo bsFormulaChildInfo){
        DaParamCollection daParamCollection = new DaParamCollection();
        daParamCollection.setParamCode(bsFormulaChildInfo.getParamCode());
        daParamCollection.setWorkOrderNo(bsFormulaChildInfo.getWorkOrderNo());
        daParamCollection.setLocationCode(bsFormulaChildInfo.getLocationCode());
        daParamCollection.setParamValue(bsFormulaChildInfo.getParamValue());
        daParamCollection.setProductCode(bsFormulaChildInfo.getProductCode());
        daParamCollection.setCollectionTime(new Date());
        daParamCollectionMapper.insertDaParamCollection(daParamCollection);
    }
    @Override
    public AjaxResult workpieceRelease(BsFormulaChildInfo bsFormulaChildInfo) {
        bsFormulaChildInfoMapper.workpieceRelease(bsFormulaChildInfo);