lius
2023-07-17 187bc7f5fbf919a6f1844ba16dc0b046c5a923ff
lxzn-module-mdc/src/main/java/org/jeecg/modules/mdc/service/impl/MdcStandardProcessDurationServiceImpl.java
@@ -8,6 +8,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.mdc.entity.MdcEquipment;
import org.jeecg.modules.mdc.entity.MdcNoplanClose;
import org.jeecg.modules.mdc.entity.MdcStandardProcessDuration;
import org.jeecg.modules.mdc.mapper.MdcStandardProcessDurationMapper;
@@ -16,6 +17,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;
@@ -151,4 +153,28 @@
        mv.addObject(NormalExcelConstants.DATA_LIST, mdcStandardProcessDurations);
        return mv;
    }
    /**
     * 添加数据
     *
     * @param mdcStandardProcessDuration
     * @return
     */
    @Override
    public boolean addData(MdcStandardProcessDuration mdcStandardProcessDuration) {
        boolean result = false;
        String[] equipmentIds = mdcStandardProcessDuration.getEquipmentIds().split(",");
        for (String equipmentId : equipmentIds) {
            MdcEquipment mdcEquipment = mdcEquipmentService.findEquipmentNameByEquipmentId(equipmentId);
            MdcStandardProcessDuration standardProcessDuration = new MdcStandardProcessDuration();
            BeanUtils.copyProperties(mdcStandardProcessDuration, standardProcessDuration);
            standardProcessDuration.setEquipmentId(mdcEquipment.getEquipmentId());
            standardProcessDuration.setEquipmentId(mdcEquipment.getEquipmentName());
            boolean b = super.save(standardProcessDuration);
            if (b) {
                result = true;
            }
        }
        return result;
    }
}