|
|
|
@ -18,12 +18,19 @@ package com.logpm.basicdata.service.impl;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.fasterxml.jackson.annotation.JsonFormat; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataTeamGroupEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.service.IBasicdataWarehouseService; |
|
|
|
|
import com.logpm.basicdata.vo.BasicdataTeamGroupVO; |
|
|
|
|
import com.logpm.basicdata.excel.BasicdataTeamGroupExcel; |
|
|
|
|
import com.logpm.basicdata.mapper.BasicdataTeamGroupMapper; |
|
|
|
|
import com.logpm.basicdata.service.IBasicdataTeamGroupService; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -38,8 +45,10 @@ import java.util.Map;
|
|
|
|
|
* @since 2023-06-16 |
|
|
|
|
*/ |
|
|
|
|
@Service |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl<BasicdataTeamGroupMapper, BasicdataTeamGroupEntity> implements IBasicdataTeamGroupService { |
|
|
|
|
|
|
|
|
|
private final IBasicdataWarehouseService basicdataWarehouseService; |
|
|
|
|
@Override |
|
|
|
|
public IPage<BasicdataTeamGroupVO> selectBasicdataTeamGroupPage(IPage<BasicdataTeamGroupVO> page, BasicdataTeamGroupVO basicdataTeamGroup) { |
|
|
|
|
return page.setRecords(baseMapper.selectBasicdataTeamGroupPage(page, basicdataTeamGroup)); |
|
|
|
@ -66,4 +75,34 @@ public class BasicdataTeamGroupServiceImpl extends BaseServiceImpl<BasicdataTeam
|
|
|
|
|
return baseMapper.getListTeamInfo(params); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* |
|
|
|
|
* @param basicdataTeamGroup |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Boolean saveOrUpdateOwn(BasicdataTeamGroupEntity basicdataTeamGroup) { |
|
|
|
|
if(ObjectUtils.isNull(basicdataTeamGroup.getBelongTo())){ |
|
|
|
|
throw new ServiceException("参数异常!!"); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity one = basicdataWarehouseService.getOne(Wrappers.<BasicdataWarehouseEntity>query().lambda().eq(BasicdataWarehouseEntity::getId, basicdataTeamGroup.getBelongTo())); |
|
|
|
|
if(ObjectUtils.isNull(one)){ |
|
|
|
|
throw new ServiceException("仓库数据异常!!"); |
|
|
|
|
} |
|
|
|
|
//查询部门信息
|
|
|
|
|
if(ObjectUtils.isNotNull(basicdataTeamGroup.getId())){ |
|
|
|
|
//修改
|
|
|
|
|
basicdataTeamGroup.setDepartment(one.getDepartment()); |
|
|
|
|
basicdataTeamGroup.setDepartmentName(one.getDepartmentName()); |
|
|
|
|
this.updateById(basicdataTeamGroup); |
|
|
|
|
return true; |
|
|
|
|
}else{ |
|
|
|
|
//新增
|
|
|
|
|
basicdataTeamGroup.setDepartment(one.getDepartment()); |
|
|
|
|
basicdataTeamGroup.setDepartmentName(one.getDepartmentName()); |
|
|
|
|
this.save(basicdataTeamGroup); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|