@@ -17,11 +17,11 @@ public interface BillTitleInfoRepo extends AbstractJpaRepo<BillTitleInfo, String | |||
//更新默认抬头 | |||
@Modifying | |||
@Transactional | |||
@Query("update BillTitleInfo set isDefault=0 where openId=?1 and isDefault =1 and titleType=?2") | |||
void updateIsDefault(String openId, Integer titleType); | |||
@Query("update BillTitleInfo set isDefault=0 where openId=?1 and isDefault =1 and valid=true ") | |||
void updateIsDefault(String openId); | |||
//查询默认抬头 | |||
@Query("from BillTitleInfo where openId=?1 and isDefault=?2 and titleType=?3") | |||
List<BillTitleInfo> findByCIdAndIsDefaultAndTitleType(String openId, Integer isDefault, Integer titleType); | |||
@Query("from BillTitleInfo where openId=?1 and isDefault=?2 and valid=true") | |||
List<BillTitleInfo> findByCIdAndIsDefault(String openId, Integer isDefault); | |||
} |
@@ -42,13 +42,13 @@ public class BillTitleInfoManagerImpl extends AbstractCommManager implements Bil | |||
String openId = findOpenIdByToken(req.getAccessToken()); | |||
// 查询当前客户是否有默认抬头 | |||
List<BillTitleInfo> titles = titleRepo.findByCIdAndIsDefaultAndTitleType(openId, 1, titleInfo.getTitleType()); | |||
List<BillTitleInfo> titles = titleRepo.findByCIdAndIsDefault(openId, 1); | |||
if (isEmpty(titles)) { | |||
// 没有默认抬头,则设置当前抬头为默认 | |||
titleInfo.setIsDefault(1); | |||
} else if (req.getIsDefault() == 1) { | |||
// 如果已经有默认抬头且修改为默认抬头,则取消其他默认抬头 | |||
titleRepo.updateIsDefault(openId, titleInfo.getTitleType()); | |||
titleRepo.updateIsDefault(openId); | |||
titleInfo.setIsDefault(1); | |||
} | |||
// 拷贝参数 | |||
@@ -69,12 +69,13 @@ public class BillTitleInfoManagerImpl extends AbstractCommManager implements Bil | |||
if (!list.isEmpty()) { | |||
// 找到最新一条,并且id不是titleInfo的id | |||
BillTitleInfo newDefaultTitle = list.stream() | |||
.filter(t -> !t.getId().equals(titleInfo.getId()) && t.getTitleType().equals(titleInfo.getTitleType())) | |||
.findFirst().orElse(list.get(0)); // 如果没有找到,取第一个 | |||
// todo 这里有问题好好思考一下!!! | |||
newDefaultTitle.setIsDefault(1); | |||
newDefaultTitle.setUpdateTime(LocalDateTime.now()); | |||
titleRepo.saveAndFlush(newDefaultTitle); | |||
.filter(t -> !t.getId().equals(titleInfo.getId())) | |||
.findFirst().orElse( null); // 取第一个,如果没有就取null | |||
if(newDefaultTitle != null) { | |||
newDefaultTitle.setIsDefault(1); | |||
newDefaultTitle.setUpdateTime(LocalDateTime.now()); | |||
titleRepo.saveAndFlush(newDefaultTitle); | |||
} | |||
} | |||
} | |||
titleInfo.setValid(false); | |||
@@ -86,21 +87,22 @@ public class BillTitleInfoManagerImpl extends AbstractCommManager implements Bil | |||
@Override | |||
public void add(BillTitleInfoAddRequestDTO req) throws ManagerException { | |||
String openId = findOpenIdByToken(req.getAccessToken()); | |||
BillTitleInfo titleInfo = new BillTitleInfo(); | |||
BeanUtils.copyProperties(req, titleInfo); | |||
titleInfo.setInsertTime(LocalDateTime.now()); | |||
titleInfo.setUpdateTime(LocalDateTime.now()); | |||
titleInfo.setValid(true); | |||
titleInfo.setOpenId(openId); | |||
// 查询当前客户是否有默认抬头 | |||
List<BillTitleInfo> titles = titleRepo.findByCIdAndIsDefaultAndTitleType(openId, 1, titleInfo.getTitleType()); | |||
List<BillTitleInfo> titles = titleRepo.findByCIdAndIsDefault(openId, 1); | |||
if (isEmpty(titles)) { | |||
// 没有默认抬头,则设置当前抬头为默认 | |||
titleInfo.setIsDefault(1); | |||
} else if (req.getIsDefault() == 1) { | |||
// 如果已经有默认抬头且修改为默认抬头,则取消其他默认抬头 | |||
titleRepo.updateIsDefault(openId, titleInfo.getTitleType()); | |||
titleInfo.setIsDefault(1); | |||
// 如果已经有默认抬头且添加的为默认抬头,则取消其他默认抬头 | |||
titleRepo.updateIsDefault(openId); | |||
} | |||
titleRepo.save(titleInfo); | |||
} |
@@ -1,6 +1,8 @@ | |||
package cn.com.taiji.invw.dto.transfer; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.invw.InventoryType; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyCommModel; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyDetailsModel; | |||
import io.swagger.annotations.ApiModel; | |||
@@ -25,4 +27,14 @@ public class InvwTransferApplyAddRequestDTO extends AbstractStaffBizRequestDTO { | |||
@ApiModelProperty(value = "调拨明细") | |||
@Valid | |||
private List<InvwTransferApplyDetailsModel> transferDetails; | |||
public void validate(ViolationValidator validator) { | |||
//CardType和ObuType不能同时为空 | |||
if (transferApply.getInventoryType() == InventoryType.CARD && transferApply.getCardType() == null) { | |||
validator.validField("cardType", true, "卡设备型号不能为空"); | |||
} | |||
if (transferApply.getInventoryType() == InventoryType.OBU && transferApply.getObuType() == null) { | |||
validator.validField("obuType", true, "签设备型号不能为空"); | |||
} | |||
} | |||
} |
@@ -1,7 +1,7 @@ | |||
package cn.com.taiji.invw.dto.transfer; | |||
import cn.com.taiji.core.entity.invw.InvwTransferApply; | |||
import cn.com.taiji.core.entity.invw.InvwTransferApplyDetails; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyModel; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
@@ -17,7 +17,7 @@ import java.util.List; | |||
public class InvwTransferApplyDetailResponseDTO { | |||
@ApiModelProperty(value = "调拨信息") | |||
private InvwTransferApply transferApply; | |||
private InvwTransferApplyModel transferApply; | |||
@ApiModelProperty(value = "调拨明细") | |||
private List<InvwTransferApplyDetails> transferDetails; | |||
} |
@@ -1,6 +1,8 @@ | |||
package cn.com.taiji.invw.dto.transfer; | |||
import cn.com.taiji.common.valid.ViolationValidator; | |||
import cn.com.taiji.core.dto.AbstractStaffBizRequestDTO; | |||
import cn.com.taiji.core.entity.dict.invw.InventoryType; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyCommModel; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyDetailsModel; | |||
import io.swagger.annotations.ApiModel; | |||
@@ -25,4 +27,14 @@ public class InvwTransferApplyEditRequestDTO extends AbstractStaffBizRequestDTO | |||
@ApiModelProperty(value = "调拨明细") | |||
@Valid | |||
private List<InvwTransferApplyDetailsModel> transferDetails; | |||
public void validate(ViolationValidator validator) { | |||
//CardType和ObuType不能同时为空 | |||
if (transferApply.getInventoryType() == InventoryType.CARD && transferApply.getCardType() == null) { | |||
validator.validField("cardType", true, "卡设备型号不能为空"); | |||
} | |||
if (transferApply.getInventoryType() == InventoryType.OBU && transferApply.getObuType() == null) { | |||
validator.validField("obuType", true, "签设备型号不能为空"); | |||
} | |||
} | |||
} |
@@ -70,7 +70,7 @@ public class InvwQryCardBatchManagerImpl extends AbstractCommManager implements | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(uploadUrl); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; | |||
} | |||
} |
@@ -70,7 +70,7 @@ public class InvwQryCardsManagerImpl extends AbstractCommManager implements Invw | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(uploadUrl); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; | |||
} | |||
} |
@@ -70,7 +70,7 @@ public class InvwQryObuBatchManagerImpl extends AbstractCommManager implements I | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(uploadUrl); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; | |||
} | |||
} |
@@ -70,7 +70,7 @@ public class InvwQryObusManagerImpl extends AbstractCommManager implements InvwQ | |||
// 上传文件 | |||
String uploadUrl = minioUtil.fileUploadHttp(file, BucketFileBus.INVW); | |||
CommExcelFileResponseDTO response = new CommExcelFileResponseDTO(); | |||
response.setFilePath(uploadUrl); | |||
response.setFilePath(minioUtil.getOuterUrl(uploadUrl)); | |||
return response; | |||
} | |||
} |
@@ -2,7 +2,6 @@ package cn.com.taiji.invw.manager.stocktaking; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.model.dao.ResultConverter; | |||
import cn.com.taiji.core.entity.dict.BucketFileBus; | |||
import cn.com.taiji.core.entity.dict.basic.DeviceVersion; | |||
import cn.com.taiji.core.entity.dict.invw.InvDeviceStatus; |
@@ -2,7 +2,6 @@ package cn.com.taiji.invw.manager.transfer; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.pub.StringTools; | |||
import cn.com.taiji.core.entity.dict.invw.InvApplyStatus; | |||
import cn.com.taiji.core.entity.dict.invw.InvDeviceStatus; | |||
import cn.com.taiji.core.entity.dict.invw.InventoryType; | |||
@@ -18,6 +17,7 @@ import cn.com.taiji.invw.dto.transfer.*; | |||
import cn.com.taiji.invw.manager.AbstractInvwManager; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyCommModel; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyDetailsModel; | |||
import cn.com.taiji.invw.model.transfer.InvwTransferApplyModel; | |||
import cn.com.taiji.invw.tools.GenerateNoUtil; | |||
import cn.hutool.core.io.FileUtil; | |||
import org.springframework.beans.BeanUtils; | |||
@@ -58,6 +58,7 @@ public class InvwTransferApplyManagerImpl extends AbstractInvwManager implements | |||
@Transactional(rollbackFor = Exception.class) | |||
@Override | |||
public void add(InvwTransferApplyAddRequestDTO req) throws ManagerException { | |||
req.validate(); | |||
InvwTransferApply transferApply = new InvwTransferApply(); | |||
List<InvwTransferApplyDetails> transferApplyDetails = new ArrayList<>(); | |||
// 处理调拨申请信息 | |||
@@ -71,11 +72,12 @@ public class InvwTransferApplyManagerImpl extends AbstractInvwManager implements | |||
@Transactional(rollbackFor = Exception.class) | |||
@Override | |||
public void edit(InvwTransferApplyEditRequestDTO req) throws ManagerException { | |||
req.validate(); | |||
InvwTransferApplyCommModel transferApplyModel = req.getTransferApply(); | |||
if (transferApplyModel == null) { | |||
throw new ManagerException("调拨申请不能为空"); | |||
} | |||
if (!StringTools.hasText(transferApplyModel.getId())) { | |||
if (!hasText(transferApplyModel.getId())) { | |||
throw new ManagerException("调拨申请id不能为空"); | |||
} | |||
InvwTransferApply transferApply = transferApplyRepo.findById(transferApplyModel.getId()).orElse(null); | |||
@@ -101,9 +103,14 @@ public class InvwTransferApplyManagerImpl extends AbstractInvwManager implements | |||
if (transferApply == null) { | |||
throw new ManagerException("调拨申请不存在"); | |||
} | |||
InvwTransferApplyModel model = new InvwTransferApplyModel(); | |||
BeanUtils.copyProperties(transferApply, model); | |||
if(hasText(transferApply.getFilePath())) { | |||
model.setFilePath(minioUtil.getOuterUrl(transferApply.getFilePath())); | |||
} | |||
List<InvwTransferApplyDetails> details = transferDetailsRepo.findByApplyNo(transferApply.getApplyNo()); | |||
response.setTransferApply(model); | |||
response.setTransferDetails(details); | |||
response.setTransferApply(transferApply); | |||
return response; | |||
} | |||
@@ -222,16 +229,16 @@ public class InvwTransferApplyManagerImpl extends AbstractInvwManager implements | |||
transferApply.setApplyStatus(InvApplyStatus.NEW); | |||
transferApply.setInsertTime(now); | |||
//查询发货仓库信息 | |||
InvwWarehouse sendAgency = warehouseRepo.findByCode(transferApplyModel.getSendStoreCode()); | |||
if(sendAgency == null) { | |||
throw new ManagerException("调拨申请失败,请检查发货仓库是否正确"); | |||
} | |||
//查询收货仓库信息 | |||
InvwWarehouse receiveAgency = warehouseRepo.findByCode(transferApplyModel.getReceiveStoreCode()); | |||
if(receiveAgency == null) { | |||
throw new ManagerException("调拨申请失败,请检查收货仓库是否正确"); | |||
} | |||
// //查询发货仓库信息 | |||
// InvwWarehouse sendAgency = warehouseRepo.findByCode(transferApplyModel.getSendStoreCode()); | |||
// if(sendAgency == null) { | |||
// throw new ManagerException("调拨申请失败,请检查发货仓库是否正确"); | |||
// } | |||
// //查询收货仓库信息 | |||
// InvwWarehouse receiveAgency = warehouseRepo.findByCode(transferApplyModel.getReceiveStoreCode()); | |||
// if(receiveAgency == null) { | |||
// throw new ManagerException("调拨申请失败,请检查收货仓库是否正确"); | |||
// } | |||
//处理仓库信息 | |||
setupTransferApplyDetails(transferApply, transferApplyModel); | |||
@@ -254,7 +261,7 @@ public class InvwTransferApplyManagerImpl extends AbstractInvwManager implements | |||
private void handleEditRequest(InvwTransferApplyEditRequestDTO editReq, InvwTransferApply transferApply, List<InvwTransferApplyDetails> transferApplyDetails) throws ManagerException { | |||
InvwTransferApplyCommModel transferApplyModel = editReq.getTransferApply(); | |||
List<InvwTransferApplyDetailsModel> transferModelDetails = editReq.getTransferDetails(); | |||
if(!StringTools.hasText(transferApplyModel.getId())){ | |||
if(!hasText(transferApplyModel.getId())){ | |||
throw new ManagerException("调拨id不能为空"); | |||
} | |||
@@ -2,7 +2,6 @@ package cn.com.taiji.invw.manager.warehouse; | |||
import cn.com.taiji.common.manager.ManagerException; | |||
import cn.com.taiji.common.model.dao.Pagination; | |||
import cn.com.taiji.common.pub.StringTools; | |||
import cn.com.taiji.core.entity.dict.log.OperateType; | |||
import cn.com.taiji.core.entity.invw.InvwWarehouse; | |||
import cn.com.taiji.core.entity.user.Staff; | |||
@@ -17,7 +16,6 @@ import cn.com.taiji.invw.model.warehouse.InvwWarehouseIdNameModel; | |||
import org.springframework.beans.BeanUtils; | |||
import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import org.springframework.util.StringUtils; | |||
import java.time.LocalDateTime; | |||
import java.util.ArrayList; | |||
@@ -44,7 +42,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
// 如果不是管理员,只能查询本渠道的仓库 | |||
if(!"MANAGER".equals(staff.getIdentityType())){ | |||
String agencyId = staff.getAgencyId(); | |||
if (!StringUtils.hasText(agencyId)) throw new ManagerException("渠道获取失败!"); | |||
if (!hasText(agencyId)) throw new ManagerException("渠道获取失败!"); | |||
req.setAgencyId(agencyId); | |||
} | |||
return warehouseRepo.page(req).convertResult(this::convert); | |||
@@ -70,7 +68,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
warehouse.setUpdateTime(LocalDateTime.now()); | |||
warehouse.setAgencyId(req.getAgencyId()); | |||
warehouse.setIsCheck(0); | |||
if (StringTools.hasText(req.getWarehouseChannelId())) { | |||
if (hasText(req.getWarehouseChannelId())) { | |||
warehouse.setChannelId(req.getWarehouseChannelId()); | |||
} | |||
warehouseRepo.save(warehouse); | |||
@@ -104,7 +102,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
// 截取为三段,1-7位前缀,8-13位中间,14-19位后缀 | |||
String prefix = maxCode.substring(0, 7); | |||
String middle = maxCode.substring(7, 13); | |||
if (!StringTools.hasText(suffix)) { | |||
if (!hasText(suffix)) { | |||
suffix = maxCode.substring(13, 19); | |||
} | |||
@@ -144,17 +142,17 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
} | |||
//一级仓库 | |||
if (warehouse.getWarehouseLevel() == 1) { | |||
if (StringTools.hasText(req.getParentId()) || StringTools.hasText(req.getAgencyId())) { | |||
if (hasText(req.getParentId()) || hasText(req.getAgencyId())) { | |||
throw new ManagerException("一级仓库只能修改仓库名称"); | |||
} | |||
if (StringTools.hasText(req.getName())) { | |||
if (hasText(req.getName())) { | |||
warehouse.setName(req.getName()); | |||
warehouse.setUpdateTime(LocalDateTime.now()); | |||
warehouseRepo.saveAndFlush(warehouse); | |||
} | |||
} else if (warehouse.getWarehouseLevel() == 2) { | |||
//二级仓库 | |||
if (StringTools.hasText(req.getParentId()) || StringTools.hasText(req.getAgencyId())) { | |||
if (hasText(req.getParentId()) || hasText(req.getAgencyId())) { | |||
//查询下级仓库 | |||
List<InvwWarehouse> warehouseList = warehouseRepo.findChiByIdAndStatus(warehouse.getId(), 1); | |||
if (warehouseList.size() > 0) { | |||
@@ -168,7 +166,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
if (cardCount > 0) { | |||
throw new ManagerException("该仓库有设备,只能修改仓库名称"); | |||
} | |||
if (StringTools.hasText(req.getParentId())) { | |||
if (hasText(req.getParentId())) { | |||
InvwWarehouse parentWarehouse = warehouseRepo.findById(req.getParentId()).orElse(null); | |||
if (parentWarehouse == null) { | |||
throw new ManagerException("上级仓库不存在"); | |||
@@ -176,11 +174,11 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
warehouse.setWarehouseLevel(parentWarehouse.getWarehouseLevel() + 1); | |||
warehouse.setParentId(req.getParentId()); | |||
} | |||
if (StringTools.hasText(req.getAgencyId())) { | |||
if (hasText(req.getAgencyId())) { | |||
warehouse.setAgencyId(req.getAgencyId()); | |||
} | |||
} | |||
if (StringTools.hasText(req.getName())) { | |||
if (hasText(req.getName())) { | |||
warehouse.setName(req.getName()); | |||
} | |||
warehouse.setUpdateTime(LocalDateTime.now()); | |||
@@ -188,7 +186,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
} else if (warehouse.getWarehouseLevel() == 3) { | |||
//三级仓库 | |||
if (StringTools.hasText(req.getParentId()) || StringTools.hasText(req.getWarehouseChannelId())) { | |||
if (hasText(req.getParentId()) || hasText(req.getWarehouseChannelId())) { | |||
long obuCount = obuDetailsRepo.findCountByStoreCode(warehouse.getCode()); | |||
if (obuCount > 0) { | |||
throw new ManagerException("该仓库有设备,只能修改仓库名称"); | |||
@@ -197,7 +195,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
if (cardCount > 0) { | |||
throw new ManagerException("该仓库有设备,只能修改仓库名称"); | |||
} | |||
if (StringTools.hasText(req.getParentId())) { | |||
if (hasText(req.getParentId())) { | |||
InvwWarehouse parentWarehouse = warehouseRepo.findById(req.getParentId()).orElse(null); | |||
if (parentWarehouse == null) { | |||
throw new ManagerException("上级仓库不存在"); | |||
@@ -205,11 +203,11 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
warehouse.setWarehouseLevel(parentWarehouse.getWarehouseLevel() + 1); | |||
warehouse.setParentId(req.getParentId()); | |||
} | |||
if (StringTools.hasText(req.getWarehouseChannelId())) { | |||
if (hasText(req.getWarehouseChannelId())) { | |||
warehouse.setChannelId(req.getWarehouseChannelId()); | |||
} | |||
} | |||
if (StringTools.hasText(req.getName())) { | |||
if (hasText(req.getName())) { | |||
warehouse.setName(req.getName()); | |||
} | |||
warehouse.setUpdateTime(LocalDateTime.now()); | |||
@@ -262,19 +260,19 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
List<InvwWarehouse> warehouseList = new ArrayList<>(); | |||
InvwWarehouseIdNameResponseDTO response = new InvwWarehouseIdNameResponseDTO(); | |||
InvwWarehouse warehouse = null; | |||
if (StringTools.hasText(req.getId())) { | |||
if (hasText(req.getId())) { | |||
warehouse = warehouseRepo.findById(req.getId()).orElse(null); | |||
} else { | |||
warehouseList = warehouseRepo.findAllByStatus(1); | |||
} | |||
if(StringTools.hasText(req.getType())) { | |||
if(hasText(req.getType())) { | |||
switch (req.getType()) { | |||
case "1": | |||
warehouseList = warehouseRepo.findParByParentIdAndStatus(req.getId(), 1); | |||
break; | |||
case "2": | |||
if (warehouse != null) { | |||
if (StringTools.hasText(warehouse.getParentId())) { | |||
if (hasText(warehouse.getParentId())) { | |||
warehouseList = warehouseRepo.findBroByParentIdAndStatus(warehouse.getParentId(), 1); | |||
} | |||
} | |||
@@ -284,14 +282,14 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
break; | |||
case "4": | |||
if (warehouse != null) { | |||
if (StringTools.hasText(warehouse.getParentId())) { | |||
if (hasText(warehouse.getParentId())) { | |||
warehouseList = warehouseRepo.findParBroByParentId(warehouse.getParentId(), 1); | |||
} | |||
} | |||
break; | |||
case "5": | |||
if (warehouse != null) { | |||
if (StringTools.hasText(warehouse.getParentId())) { | |||
if (hasText(warehouse.getParentId())) { | |||
warehouseList = warehouseRepo.findBroChiByParentIdOrId(warehouse.getParentId(), warehouse.getId(), 1); | |||
} | |||
} | |||
@@ -336,7 +334,7 @@ public class InvwWarehouseManagerImpl extends AbstractInvwManager implements Inv | |||
BeanUtils.copyProperties(warehouse, response); | |||
String parentId = warehouse.getParentId(); | |||
// 查询父级仓库 | |||
if (StringTools.hasText(parentId)) { | |||
if (hasText(parentId)) { | |||
InvwWarehouse parentWarehouse = warehouseRepo.findById(parentId).orElse(null); | |||
if(parentWarehouse != null){ | |||
response.setParentCode(parentWarehouse.getCode()); |
@@ -3,7 +3,6 @@ package cn.com.taiji.invw.model.transfer; | |||
import cn.com.taiji.core.entity.dict.basic.CardType; | |||
import cn.com.taiji.core.entity.dict.basic.DeviceVersion; | |||
import cn.com.taiji.core.entity.dict.basic.ObuType; | |||
import cn.com.taiji.core.entity.dict.invw.InvApplyStatus; | |||
import cn.com.taiji.core.entity.dict.invw.InventoryType; | |||
import cn.com.taiji.core.entity.dict.invw.OwnType; | |||
import io.swagger.annotations.ApiModel; |
@@ -0,0 +1,88 @@ | |||
package cn.com.taiji.invw.model.transfer; | |||
import cn.com.taiji.core.entity.dict.basic.CardType; | |||
import cn.com.taiji.core.entity.dict.basic.DeviceVersion; | |||
import cn.com.taiji.core.entity.dict.basic.ObuType; | |||
import cn.com.taiji.core.entity.dict.invw.InvApplyStatus; | |||
import cn.com.taiji.core.entity.dict.invw.InventoryType; | |||
import cn.com.taiji.core.entity.dict.invw.OwnType; | |||
import io.swagger.annotations.ApiModel; | |||
import io.swagger.annotations.ApiModelProperty; | |||
import lombok.Getter; | |||
import lombok.Setter; | |||
import lombok.experimental.Accessors; | |||
import java.time.LocalDateTime; | |||
@ApiModel(description = "调拨信息") | |||
@Getter | |||
@Setter | |||
@Accessors(chain = true) | |||
public class InvwTransferApplyModel { | |||
@ApiModelProperty(value = "调拨id") | |||
private String applyNo;//申请单号 | |||
@ApiModelProperty(value = "发货仓库") | |||
private String sendStoreCode;//发货仓库 | |||
@ApiModelProperty(value = "收货仓库") | |||
private String receiveStoreCode;//接收仓库 | |||
@ApiModelProperty(value = "库存类型") | |||
private InventoryType inventoryType;//库存类型InventoryType | |||
@ApiModelProperty(value = "品牌") | |||
private String brand;//品牌,字典新建DEVICE_BRAND | |||
@ApiModelProperty(value = "设备版本") | |||
private DeviceVersion version;//设备版本DeviceVersion | |||
@ApiModelProperty(value = "入库数量") | |||
private Integer applyCount;//入库数量 | |||
@ApiModelProperty(value = "单价") | |||
private Integer unitPrice;//单价(单位:分) | |||
@ApiModelProperty(value = "总价") | |||
private Integer totalPrice;//总价(单位:分) | |||
@ApiModelProperty(value = "申请时间") | |||
private LocalDateTime applyTime;//申请时间 | |||
@ApiModelProperty(value = "申请人") | |||
private String openId;//申请人 | |||
@ApiModelProperty(value = "接收时间") | |||
private LocalDateTime receiveTime;//接收时间 | |||
@ApiModelProperty(value = "接收人") | |||
private String receiverId;//接收人 | |||
@ApiModelProperty(value = "申请状态") | |||
private InvApplyStatus applyStatus;//申请状态,新申请、确认入库、入库失败(取消入库) | |||
@ApiModelProperty(value = "发货渠道编号") | |||
private String sendAgencyId;//发货渠道编号 | |||
@ApiModelProperty(value = "收货渠道编号") | |||
private String receiveAgencyId;//接收渠道编号 | |||
@ApiModelProperty(value = "卡类型") | |||
private CardType cardType;//卡类型CardType,卡或者单片式OBU时有值 | |||
@ApiModelProperty(value = "标签类型") | |||
private ObuType obuType;//标签类型ObuType | |||
@ApiModelProperty(value = "失败原因") | |||
private String reason;//失败原因 | |||
@ApiModelProperty(value = "插入时间") | |||
private LocalDateTime insertTime;//插入时间 | |||
@ApiModelProperty(value = "附件地址") | |||
private String filePath;//附件地址 | |||
@ApiModelProperty(value = "产权类型") | |||
private OwnType ownType;// 产权类型 | |||
} |