pref_mail@163.com
11 months ago
15 changed files with 187 additions and 15 deletions
@ -0,0 +1,65 @@
|
||||
package com.logpm.basicdata.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
@Data |
||||
@TableName("logpm_basicdata_forwarding_unit") |
||||
@ApiModel(value = "BasicdataForwardingUnit对象", description = "默认仓库发货单位表") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class BasicdataForwardingUnitEntity extends TenantEntity { |
||||
|
||||
/** |
||||
* 预留1 |
||||
*/ |
||||
@ApiModelProperty(value = "预留1") |
||||
private String reserve1; |
||||
/** |
||||
* 预留2 |
||||
*/ |
||||
@ApiModelProperty(value = "预留2") |
||||
private String reserve2; |
||||
/** |
||||
* 预留3 |
||||
*/ |
||||
@ApiModelProperty(value = "预留3") |
||||
private String reserve3; |
||||
/** |
||||
* 预留4 |
||||
*/ |
||||
@ApiModelProperty(value = "预留4") |
||||
private String reserve4; |
||||
/** |
||||
* 预留5 |
||||
*/ |
||||
@ApiModelProperty(value = "预留5") |
||||
private String reserve5; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 仓库id |
||||
*/ |
||||
@ApiModelProperty(value = "仓库id") |
||||
private Long warehouseId; |
||||
|
||||
@ApiModelProperty(value = "仓库名称") |
||||
private String warehouseName; |
||||
|
||||
@ApiModelProperty(value = "用户id") |
||||
private Long userId; |
||||
|
||||
/** |
||||
* 客户id |
||||
*/ |
||||
@ApiModelProperty(value = "客户id") |
||||
private Long clientId; |
||||
|
||||
@ApiModelProperty(value = "客户名称") |
||||
private String clientName; |
||||
|
||||
} |
@ -0,0 +1,20 @@
|
||||
package com.logpm.basicdata.feign; |
||||
|
||||
import org.springblade.common.constant.ModuleNameConstant; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
|
||||
@FeignClient( |
||||
value = ModuleNameConstant.APPLICATION_BASICDATA_NAME |
||||
) |
||||
public interface IBasicdataForwardingUnitClient { |
||||
|
||||
String API_PREFIX = "forwardingUnit/client"; |
||||
String TOP = API_PREFIX + "/top"; |
||||
|
||||
|
||||
@GetMapping(API_PREFIX+"/findForwardingUnitByWarehouseId") |
||||
Long findForwardingUnitByWarehouseIdAndUserId(@RequestParam("warehouseId") Long warehouseId,@RequestParam("userId") Long userId); |
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.logpm.basicdata.feign; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import com.logpm.basicdata.service.IBasicdataForwardingUnitService; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.util.Objects; |
||||
|
||||
@ApiIgnore() |
||||
@RestController |
||||
@AllArgsConstructor |
||||
public class BasicdataForwardingUnitClient implements IBasicdataForwardingUnitClient{ |
||||
|
||||
private final IBasicdataForwardingUnitService basicdataForwardingUnitService; |
||||
|
||||
@Override |
||||
public Long findForwardingUnitByWarehouseIdAndUserId(Long warehouseId, Long userId) { |
||||
QueryWrapper<BasicdataForwardingUnitEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.eq("warehouse_id",warehouseId) |
||||
.eq("user_id",userId); |
||||
|
||||
BasicdataForwardingUnitEntity forwardingUnitEntity = basicdataForwardingUnitService.getOne(queryWrapper); |
||||
if(!Objects.isNull(forwardingUnitEntity)){ |
||||
return forwardingUnitEntity.getClientId(); |
||||
} |
||||
return null; |
||||
} |
||||
} |
@ -0,0 +1,11 @@
|
||||
package com.logpm.basicdata.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
|
||||
@Mapper |
||||
public interface BasicdataForwardingUnitMapper extends BaseMapper<BasicdataForwardingUnitEntity> { |
||||
|
||||
|
||||
} |
@ -0,0 +1,7 @@
|
||||
package com.logpm.basicdata.service; |
||||
|
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
|
||||
public interface IBasicdataForwardingUnitService extends BaseService<BasicdataForwardingUnitEntity> { |
||||
} |
@ -0,0 +1,16 @@
|
||||
package com.logpm.basicdata.service.impl; |
||||
|
||||
import com.logpm.basicdata.entity.BasicdataForwardingUnitEntity; |
||||
import com.logpm.basicdata.mapper.BasicdataForwardingUnitMapper; |
||||
import com.logpm.basicdata.service.IBasicdataForwardingUnitService; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
@Slf4j |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class BasicdataForwardingUnitServiceImpl extends BaseServiceImpl<BasicdataForwardingUnitMapper, BasicdataForwardingUnitEntity> implements IBasicdataForwardingUnitService { |
||||
|
||||
} |
Loading…
Reference in new issue