| | |
| | | package org.springblade.mdm.basesetting.producedivision.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.mdm.basesetting.producedivision.entity.ProduceDivision; |
| | | import org.springblade.mdm.basesetting.producedivision.entity.QinzheFgb; |
| | | import org.springblade.mdm.basesetting.producedivision.mapper.QinzheFgbMapper; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.DivisionExcel; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.ImportResult; |
| | | import org.springblade.mdm.basesetting.producedivision.vo.QinzheFgbExcel; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | return lambdaQuery().eq(QinzheFgb::getLjh, ljh).list().stream().findFirst().orElse(null); |
| | | } |
| | | |
| | | /** |
| | | * 查询分页 |
| | | * @param query 查询参数 |
| | | * @return 分页数据 |
| | | */ |
| | | /* |
| | | public IPage<QinzheFgb> pageQuery(String name, Query query) { |
| | | return this.lambdaQuery().like(StringUtils.isNotBlank(name),QinzheFgb::getZggy,name).page(Condition.getPage(query)); |
| | | } |
| | | */ |
| | | |
| | | public List<String> seletDropList(String ljh) { |
| | | return this.baseMapper.seletDropList(ljh); |
| | | |
| | |
| | | for(QinzheFgbExcel qzExcel: list){ |
| | | QinzheFgb fgb = new QinzheFgb(); |
| | | BeanUtils.copyProperties(qzExcel,fgb); |
| | | fgb.setSource("QZ"); |
| | | fgb.setSource(QinzheFgb.SOURCE_MDM); |
| | | entityList.add(fgb); |
| | | } |
| | | |
| | |
| | | * @param entityList 数据列表 |
| | | */ |
| | | @Transactional |
| | | private void saveIfNotExists(List<QinzheFgb> entityList) { |
| | | void saveIfNotExists(List<QinzheFgb> entityList) { |
| | | |
| | | List<QinzheFgb> willSaveList = entityList.stream().filter(e -> !exists(e)).toList(); |
| | | this.saveBatch(willSaveList); |
| | |
| | | .eq(QinzheFgb::getCph, entity.getCph()).eq(QinzheFgb::getZggy, entity.getZggy()).count() > 0; |
| | | } |
| | | |
| | | /** |
| | | * 修改勤哲分工表数据 |
| | | * @param fgb 数据实体 |
| | | */ |
| | | public void updateFgb(QinzheFgb fgb) { |
| | | lambdaUpdate().eq(QinzheFgb::getLjh, fgb.getLjh()) |
| | | .set(QinzheFgb::getZggy, fgb.getZggy()) |
| | | .set(QinzheFgb::getCph, fgb.getCph()).set(QinzheFgb::getSource,QinzheFgb.SOURCE_MDM).update(); |
| | | } |
| | | } |