Lius
2024-07-08 4e5af86ad91040f4c9a2656396079b7192c8bdcf
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcProcessQuantityServiceImpl.java
@@ -16,6 +16,7 @@
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.web.servlet.ModelAndView;
@@ -141,4 +142,27 @@
    public MdcProcessQuantityDto findById(String id) {
        return this.baseMapper.findById(id);
    }
    /**
     * 添加数据
     *
     * @param mdcProcessQuantity
     * @return
     */
    @Override
    public boolean addData(MdcProcessQuantity mdcProcessQuantity) {
        boolean result = false;
        String[] equipmentIds = mdcProcessQuantity.getEquipmentIds().split(",");
        for (String equipmentId : equipmentIds) {
            MdcProcessQuantity processQuantity = new MdcProcessQuantity();
            BeanUtils.copyProperties(mdcProcessQuantity, processQuantity);
            processQuantity.setEquipmentId(equipmentId);
            boolean b = super.save(processQuantity);
            if (b) {
                result = true;
            }
        }
        return result;
    }
}