供应商后台 up by dh
This commit is contained in:
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@@ -17,15 +18,10 @@ import javax.servlet.http.HttpServletRequest;
|
||||
*/
|
||||
public interface ISupplierService extends IService<Supplier> {
|
||||
/**
|
||||
* 查询厂商/供应商分页列表
|
||||
* 新增供应商
|
||||
*
|
||||
* @param supplier 查询条件
|
||||
* @param pageNo 查询条件
|
||||
* @param pageSize 查询条件
|
||||
* @return 供应申请列表
|
||||
* @param supplier 病种目录实体
|
||||
* @return
|
||||
*/
|
||||
Page<Supplier> getPage(Supplier supplier, Integer pageNo, Integer pageSize);
|
||||
|
||||
|
||||
|
||||
boolean addSupplier(Supplier supplier);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.clinical.domain.ConditionDefinition;
|
||||
import com.openhis.clinical.mapper.ConditionDefinitionMapper;
|
||||
import com.openhis.common.enums.DelFlag;
|
||||
import com.openhis.workflow.domain.SupplyRequest;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -14,6 +16,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.Supplier;
|
||||
import com.openhis.administration.mapper.SupplierMapper;
|
||||
import com.openhis.administration.service.ISupplierService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 供应商管理Service业务层处理
|
||||
@@ -25,43 +30,28 @@ import com.openhis.administration.service.ISupplierService;
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements ISupplierService {
|
||||
|
||||
private final SupplierMapper supplierMapper;
|
||||
/**
|
||||
* 查询厂商/产地列表
|
||||
* 新增供应商
|
||||
*
|
||||
* @param supplier 查询条件
|
||||
* @param pageNo 查询条件
|
||||
* @param pageSize 查询条件
|
||||
* @return 厂商/产地列表
|
||||
* @param supplier 厂商/产地实体
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Page<Supplier> getPage(Supplier supplier, Integer pageNo, Integer pageSize) {
|
||||
Page<Supplier> supplierList = new Page<>();
|
||||
// // 判断入库数量
|
||||
// if (supplyRequest.getItemQuantity() != 0) {
|
||||
// // 查询供应申请信息列表
|
||||
// supplyRequestList = supplyRequestMapper.selectPage(new Page<>(pageNo, pageSize),
|
||||
// new LambdaQueryWrapper<SupplyRequest>().eq(SupplyRequest::getDeleteFlag, DelFlag.NO.getValue()));
|
||||
// } else {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// 设置查询条件
|
||||
LambdaQueryWrapper<Supplier> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(supplier.getBusNo())) {
|
||||
lambdaQueryWrapper.eq(Supplier::getBusNo, supplier.getBusNo());
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean addSupplier(Supplier supplier) {
|
||||
// 根据病种编码判断病种是否存在
|
||||
List<Supplier> suppliers =
|
||||
supplierMapper.selectList(new LambdaQueryWrapper<Supplier>()
|
||||
.eq(Supplier::getBusNo, supplier.getBusNo()));
|
||||
if (suppliers.size() > 0) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotEmpty(supplier.getName())) {
|
||||
lambdaQueryWrapper.eq(Supplier::getName, supplier.getName());
|
||||
// 新增供应商
|
||||
int insert = supplierMapper.insert(supplier);
|
||||
if (insert != 1) {
|
||||
return false;
|
||||
}
|
||||
if (StringUtils.isNotNull(supplier.getTypeEnum())) {
|
||||
lambdaQueryWrapper.eq(Supplier::getTypeEnum, supplier.getTypeEnum());
|
||||
}
|
||||
lambdaQueryWrapper.eq(Supplier::getDeleteFlag, DelFlag.NO.getValue());
|
||||
|
||||
supplierList = supplierMapper.selectPage(new Page<>(pageNo, pageSize), lambdaQueryWrapper);
|
||||
// 返回入库信息列表
|
||||
return supplierList;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user